From 9108e094e73b709557b5e9f013283952d1033cf9 Mon Sep 17 00:00:00 2001 From: Thomas A Date: Sat, 9 Apr 2022 16:00:21 -0700 Subject: [PATCH] Add Libc Code From Darling Repo Based on Libc-1353.60.8 --- .gitignore | 11 + .upstream_base_commits | 94 + APPLE_LICENSE | 367 + CMakeLists.txt | 250 + Libc.xcodeproj/project.pbxproj | 16625 ++++++++++++++++ Platforms/appletvos/Makefile.inc | 48 + Platforms/bridgeos/Makefile.inc | 48 + Platforms/driverkit/Makefile.inc | 48 + Platforms/iphoneos/Makefile.inc | 48 + Platforms/macosx/Makefile.inc | 50 + Platforms/watchos/Makefile.inc | 48 + compat-43/CMakeLists.txt | 50 + compat-43/FreeBSD/creat.2 | 62 + compat-43/FreeBSD/creat.c | 58 + compat-43/FreeBSD/gethostid.3 | 78 + compat-43/FreeBSD/gethostid.c | 54 + compat-43/FreeBSD/getwd.c | 51 + compat-43/FreeBSD/killpg.2 | 105 + compat-43/FreeBSD/killpg.c | 61 + compat-43/FreeBSD/sethostid.c | 49 + compat-43/FreeBSD/setpgrp.c | 48 + compat-43/FreeBSD/setrgid.c | 43 + compat-43/FreeBSD/setruid.3 | 80 + compat-43/FreeBSD/setruid.c | 43 + compat-43/setregid.c | 59 + compat-43/setreuid.c | 60 + compat-43/sigaltstk.c | 36 + compat-43/sigblock.2 | 87 + compat-43/sigcompat.c | 235 + compat-43/sigpause.2 | 89 + compat-43/sigsetmask.2 | 85 + compat-43/sigvec.2 | 327 + darling-scripts/generate-derived.sh | 13 + darling-scripts/replace-libc-comments.sh | 17 + darwin/CMakeLists.txt | 13 + darwin/atexit_receipt.c | 23 + darwin/compatibility_hacks.c | 59 + darwin/darling_hacks.c | 8 + darwin/forceLibcToBuild.c | 6 + darwin/kvm.c | 107 + darwin/libc_private.h | 70 + db/CMakeLists.txt | 48 + db/btree/FreeBSD/bt_close.c | 178 + db/btree/FreeBSD/bt_conv.c | 212 + db/btree/FreeBSD/bt_debug.c | 322 + db/btree/FreeBSD/bt_delete.c | 635 + db/btree/FreeBSD/bt_extern.h | 67 + db/btree/FreeBSD/bt_get.c | 99 + db/btree/FreeBSD/bt_open.c | 444 + db/btree/FreeBSD/bt_overflow.c | 216 + db/btree/FreeBSD/bt_page.c | 94 + db/btree/FreeBSD/bt_put.c | 314 + db/btree/FreeBSD/bt_search.c | 200 + db/btree/FreeBSD/bt_seq.c | 442 + db/btree/FreeBSD/bt_split.c | 796 + db/btree/FreeBSD/bt_utils.c | 246 + db/btree/FreeBSD/btree.h | 380 + db/db/FreeBSD/db.c | 105 + db/hash/FreeBSD/hash.c | 963 + db/hash/FreeBSD/hash.h | 292 + db/hash/FreeBSD/hash_bigkey.c | 646 + db/hash/FreeBSD/hash_buf.c | 358 + db/hash/FreeBSD/hash_extern.h | 62 + db/hash/FreeBSD/hash_func.c | 210 + db/hash/FreeBSD/hash_log2.c | 52 + db/hash/FreeBSD/hash_page.c | 948 + db/hash/FreeBSD/ndbm.c | 239 + db/hash/FreeBSD/page.h | 89 + db/man/FreeBSD/btree.3 | 271 + db/man/FreeBSD/dbm.3 | 274 + db/man/FreeBSD/dbopen.3 | 546 + db/man/FreeBSD/hash.3 | 196 + db/man/FreeBSD/mpool.3 | 227 + db/man/FreeBSD/recno.3 | 228 + db/mpool/FreeBSD/mpool.c | 446 + db/recno/FreeBSD/rec_close.c | 182 + db/recno/FreeBSD/rec_delete.c | 187 + db/recno/FreeBSD/rec_extern.h | 51 + db/recno/FreeBSD/rec_get.c | 291 + db/recno/FreeBSD/rec_open.c | 238 + db/recno/FreeBSD/rec_put.c | 275 + db/recno/FreeBSD/rec_search.c | 121 + db/recno/FreeBSD/rec_seq.c | 127 + db/recno/FreeBSD/rec_utils.c | 112 + db/recno/FreeBSD/recno.h | 36 + derived/arm/libc-features.h | 26 + derived/arm64/libc-features.h | 26 + derived/i386/libc-features.h | 26 + derived/libc-features.h | 13 + derived/ppc/libc-features.h | 26 + derived/x86_64/libc-features.h | 30 + empty.c | 0 emulated/CMakeLists.txt | 9 + emulated/brk.2 | 150 + emulated/brk.c | 82 + emulated/bsd_signal.3 | 119 + emulated/bsd_signal.c | 44 + emulated/lchflags.3 | 52 + emulated/lchflags.c | 44 + emulated/lchmod.3 | 54 + emulated/lchmod.c | 43 + emulated/lutimes.3 | 62 + emulated/lutimes.c | 60 + emulated/statvfs.3 | 214 + emulated/statvfs.c | 84 + emulated/tcgetsid.3 | 77 + emulated/tcgetsid.c | 42 + fbsdcompat/_fbsd_compat_.h | 184 + fbsdcompat/_fpmath.h | 105 + fbsdcompat/fpmath.h | 66 + fbsdcompat/machine/atomic.h | 25 + fbsdcompat/namespace.h | 25 + fbsdcompat/port_after.h | 1 + fbsdcompat/port_before.h | 1 + fbsdcompat/reentrant.h | 134 + fbsdcompat/spinlock.h | 113 + fbsdcompat/sys/cdefs.h | 165 + fbsdcompat/sys/endian.h | 26 + fbsdcompat/un-namespace.h | 25 + gdtoa/CMakeLists.txt | 54 + gdtoa/FreeBSD/_hdtoa.c | 326 + gdtoa/FreeBSD/_ldtoa.c | 118 + gdtoa/FreeBSD/gdtoa-dmisc.c | 216 + gdtoa/FreeBSD/gdtoa-dtoa.c | 766 + gdtoa/FreeBSD/gdtoa-gdtoa.c | 745 + gdtoa/FreeBSD/gdtoa-gethex.c | 407 + gdtoa/FreeBSD/gdtoa-gmisc.c | 86 + gdtoa/FreeBSD/gdtoa-hd_init.c | 76 + gdtoa/FreeBSD/gdtoa-hexnan.c | 209 + gdtoa/FreeBSD/gdtoa-misc.c | 933 + gdtoa/FreeBSD/gdtoa-smisc.c | 191 + gdtoa/FreeBSD/gdtoa-strtoIg.c | 137 + gdtoa/FreeBSD/gdtoa-strtod.c | 1044 + gdtoa/FreeBSD/gdtoa-strtodg.c | 1096 + gdtoa/FreeBSD/gdtoa-strtof.c | 94 + gdtoa/FreeBSD/gdtoa-strtopdd.c | 241 + gdtoa/FreeBSD/gdtoa-strtopx.c | 114 + gdtoa/FreeBSD/gdtoa-strtord.c | 69 + gdtoa/FreeBSD/gdtoa-sum.c | 98 + gdtoa/FreeBSD/gdtoa-ulp.c | 70 + gdtoa/FreeBSD/gdtoa.h | 154 + gdtoa/FreeBSD/gdtoa_fltrnds.h | 19 + gdtoa/FreeBSD/gdtoaimp.h | 741 + gdtoa/FreeBSD/glue.c | 10 + gdtoa/FreeBSD/machdep_ldisQ.c | 45 + gdtoa/FreeBSD/machdep_ldisd.c | 51 + gdtoa/FreeBSD/machdep_ldisdd.c | 56 + gdtoa/FreeBSD/machdep_ldisx.c | 57 + gdtoa/_ldbl_util.c | 128 + gdtoa/arith.h | 57 + gdtoa/gd_qnan.h | 33 + gdtoa/gdtoa.tgz | Bin 0 -> 118424 bytes gen/CMakeLists.txt | 226 + gen/FreeBSD/_rand48.c | 21 + gen/FreeBSD/alarm.3 | 94 + gen/FreeBSD/alarm.c | 57 + gen/FreeBSD/arc4random.3 | 100 + gen/FreeBSD/arc4random.c | 414 + gen/FreeBSD/assert.c | 98 + gen/FreeBSD/basename.3 | 116 + gen/FreeBSD/basename.c | 97 + gen/FreeBSD/clock.3 | 71 + gen/FreeBSD/clock.c | 55 + gen/FreeBSD/closedir.c | 75 + gen/FreeBSD/ctermid.3 | 112 + gen/FreeBSD/ctermid.c | 57 + gen/FreeBSD/daemon.3 | 134 + gen/FreeBSD/daemon.c | 124 + gen/FreeBSD/dirname.3 | 127 + gen/FreeBSD/dirname.c | 87 + gen/FreeBSD/drand48.c | 25 + gen/FreeBSD/erand48.c | 26 + gen/FreeBSD/err.3 | 263 + gen/FreeBSD/err.c | 328 + gen/FreeBSD/exec.3 | 326 + gen/FreeBSD/exec.c | 289 + gen/FreeBSD/fmtcheck.3 | 115 + gen/FreeBSD/fmtcheck.c | 325 + gen/FreeBSD/fmtmsg.3 | 260 + gen/FreeBSD/fmtmsg.c | 271 + gen/FreeBSD/fnmatch.3 | 162 + gen/FreeBSD/fnmatch.c | 472 + gen/FreeBSD/ftok.3 | 88 + gen/FreeBSD/ftok.c | 46 + gen/FreeBSD/getbsize.3 | 94 + gen/FreeBSD/getbsize.c | 104 + gen/FreeBSD/getcap.3 | 567 + gen/FreeBSD/getcap.c | 1058 + gen/FreeBSD/getcwd.3 | 164 + gen/FreeBSD/getcwd.c | 338 + gen/FreeBSD/gethostname.3 | 131 + gen/FreeBSD/gethostname.c | 71 + gen/FreeBSD/getlogin.c | 103 + gen/FreeBSD/getmntinfo.3 | 174 + gen/FreeBSD/getmntinfo.c | 109 + gen/FreeBSD/getmntinfo64.c | 68 + gen/FreeBSD/getpagesize.3 | 61 + gen/FreeBSD/getpagesize.c | 64 + gen/FreeBSD/getpass.3 | 93 + gen/FreeBSD/getpeereid.3 | 137 + gen/FreeBSD/getpeereid.c | 56 + gen/FreeBSD/getprogname.3 | 93 + gen/FreeBSD/getprogname.c | 19 + gen/FreeBSD/glob.3 | 502 + gen/FreeBSD/glob.c | 1177 ++ gen/FreeBSD/isatty.c | 56 + gen/FreeBSD/jrand48.c | 25 + gen/FreeBSD/lcong48.c | 25 + gen/FreeBSD/lockf.3 | 270 + gen/FreeBSD/lockf.c | 96 + gen/FreeBSD/lrand48.c | 24 + gen/FreeBSD/mrand48.c | 24 + gen/FreeBSD/nice.3 | 69 + gen/FreeBSD/nice.c | 65 + gen/FreeBSD/nrand48.c | 25 + gen/FreeBSD/opendir.c | 428 + gen/FreeBSD/pause.3 | 81 + gen/FreeBSD/pause.c | 56 + gen/FreeBSD/popen.3 | 205 + gen/FreeBSD/popen.c | 262 + gen/FreeBSD/psignal.3 | 122 + gen/FreeBSD/psignal.c | 63 + gen/FreeBSD/raise.3 | 74 + gen/FreeBSD/rand48.3 | 201 + gen/FreeBSD/rand48.h | 81 + gen/FreeBSD/readdir.c | 174 + gen/FreeBSD/readpassphrase.3 | 183 + gen/FreeBSD/readpassphrase.c | 213 + gen/FreeBSD/rewinddir.c | 67 + gen/FreeBSD/scandir.3 | 128 + gen/FreeBSD/scandir.c | 153 + gen/FreeBSD/scandir_b.c | 32 + gen/FreeBSD/seed48.c | 29 + gen/FreeBSD/seekdir.c | 57 + gen/FreeBSD/sethostname.c | 51 + gen/FreeBSD/setmode.3 | 114 + gen/FreeBSD/setmode.c | 469 + gen/FreeBSD/setprogname.c | 33 + gen/FreeBSD/siginterrupt.3 | 120 + gen/FreeBSD/siginterrupt.c | 63 + gen/FreeBSD/siglist.c | 106 + gen/FreeBSD/signal.3 | 276 + gen/FreeBSD/signal.c | 95 + gen/FreeBSD/signbit.3 | 53 + gen/FreeBSD/sleep.3 | 83 + gen/FreeBSD/sleep.c | 71 + gen/FreeBSD/srand48.c | 22 + gen/FreeBSD/stringlist.3 | 135 + gen/FreeBSD/stringlist.c | 122 + gen/FreeBSD/sysconf.3 | 223 + gen/FreeBSD/sysconf.c | 685 + gen/FreeBSD/sysctl.3 | 727 + gen/FreeBSD/sysctl.c | 206 + gen/FreeBSD/sysctlbyname.c | 54 + gen/FreeBSD/sysctlnametomib.c | 58 + gen/FreeBSD/telldir.c | 197 + gen/FreeBSD/telldir.h | 89 + gen/FreeBSD/termios.c | 280 + gen/FreeBSD/time.3 | 101 + gen/FreeBSD/time.c | 63 + gen/FreeBSD/times.3 | 139 + gen/FreeBSD/times.c | 69 + gen/FreeBSD/timespec_get.3 | 81 + gen/FreeBSD/timespec_get.c | 54 + gen/FreeBSD/timezone.3 | 69 + gen/FreeBSD/timezone.c | 137 + gen/FreeBSD/ttyname.3 | 141 + gen/FreeBSD/ttyname.c | 212 + gen/FreeBSD/ttyslot.c | 47 + gen/FreeBSD/ualarm.3 | 100 + gen/FreeBSD/ualarm.c | 63 + gen/FreeBSD/ulimit.3 | 101 + gen/FreeBSD/ulimit.c | 68 + gen/FreeBSD/unvis.3 | 259 + gen/FreeBSD/unvis.c | 557 + gen/FreeBSD/usleep.3 | 92 + gen/FreeBSD/usleep.c | 53 + gen/FreeBSD/utime.3 | 95 + gen/FreeBSD/utime.c | 55 + gen/FreeBSD/vis.3 | 506 + gen/FreeBSD/vis.c | 667 + gen/FreeBSD/wait.c | 60 + gen/FreeBSD/wait3.c | 50 + gen/FreeBSD/waitpid.c | 71 + gen/FreeBSD/wordexp.3 | 206 + gen/FreeBSD/wordexp.c | 600 + gen/NetBSD/endutxent.3 | 335 + gen/NetBSD/getlastlogx.3 | 139 + gen/NetBSD/rb.c | 1440 ++ gen/NetBSD/rbtree.3 | 326 + gen/NetBSD/utmpx.5 | 101 + gen/NetBSD/utmpx.c | 587 + gen/__dirent.h | 15 + gen/authentication.c | 102 + gen/backtrace.3 | 142 + gen/backtrace.c | 228 + gen/clock_gettime.3 | 186 + gen/clock_gettime.c | 227 + gen/compat.5 | 190 + gen/confstr.3 | 179 + gen/confstr.c | 264 + gen/crypt.3 | 237 + gen/crypt.c | 1050 + gen/devname.3 | 94 + gen/devname.c | 114 + gen/directory.3 | 279 + gen/dirfd.c | 35 + gen/disklabel.c | 218 + gen/errlst.c | 191 + gen/execinfo.h | 63 + gen/filesec.c | 353 + gen/fts.3 | 820 + gen/fts.c | 1582 ++ gen/ftw.3 | 227 + gen/get_compat.c | 225 + gen/get_compat.h | 32 + gen/getdomainname.3 | 98 + gen/getloadavg.3 | 69 + gen/getloadavg.c | 93 + gen/getttyent.3 | 185 + gen/getttyent.c | 392 + gen/getusershell.3 | 102 + gen/getusershell.c | 156 + gen/getvfsbyname.3 | 93 + gen/getvfsbyname.c | 97 + gen/intro.3 | 130 + gen/nanosleep.c | 311 + gen/nftw.c | 275 + gen/nlist.3 | 77 + gen/nlist.c | 340 + gen/oldsyslog.c | 321 + gen/posix_memalign.3 | 96 + gen/pwcache.3 | 97 + gen/raise.c | 40 + gen/setlogin.c | 79 + gen/sigsetops.3 | 129 + gen/sigsetops.c | 124 + gen/strtofflags.3 | 105 + gen/strtofflags.c | 183 + gen/sync_volume_np.3 | 81 + gen/sync_volume_np.c | 80 + gen/tcgetpgrp.3 | 91 + gen/tcsendbreak.3 | 169 + gen/tcsetattr.3 | 357 + gen/tcsetpgrp.3 | 109 + gen/thread_stack_pcs.c | 107 + gen/thread_stack_pcs.h | 38 + gen/tzset.3 | 340 + gen/uname.3 | 92 + gen/uname.c | 88 + gen/utmpx-darwin.c | 1193 ++ gen/utmpx-darwin.h | 129 + gen/utmpx_thread.h | 48 + gmon/CMakeLists.txt | 9 + gmon/gmon.c | 210 + gmon/moncontrol.3 | 101 + i386/CMakeLists.txt | 16 + i386/gen/mcount.S | 39 + include/FreeBSD/nl_types.h | 103 + include/NetBSD/utmpx.h | 178 + include/__wctype.h | 74 + include/_ctermid.h | 27 + include/_ctype.h | 387 + include/_locale.h | 76 + include/_regex.h | 121 + include/_stdio.h | 161 + include/_types.h | 71 + include/_types/_intmax_t.h | 40 + include/_types/_nl_item.h | 33 + include/_types/_uint16_t.h | 32 + include/_types/_uint32_t.h | 32 + include/_types/_uint64_t.h | 32 + include/_types/_uint8_t.h | 32 + include/_types/_uintmax_t.h | 40 + include/_types/_wctrans_t.h | 33 + include/_types/_wctype_t.h | 33 + include/_wctype.h | 164 + include/_xlocale.h | 37 + include/aio.h | 37 + include/alloca.h | 45 + include/ar.h | 67 + include/arpa/ftp.h | 109 + include/arpa/inet.h | 97 + include/arpa/nameser_compat.h | 195 + include/arpa/telnet.h | 320 + include/arpa/tftp.h | 84 + include/asm.h | 415 + include/assert.h | 119 + include/authentication.h | 36 + include/bitstring.h | 150 + include/cpio.h | 55 + include/crt_externs.h | 47 + include/ctype.h | 75 + include/db.h | 219 + include/dirent.h | 191 + include/disktab.h | 61 + include/err.h | 93 + include/errno.h | 24 + include/execinfo.h | 1 + include/fcntl.h | 23 + include/fmtmsg.h | 73 + include/fnmatch.h | 82 + include/fsproperties.h | 58 + include/fstab.h | 79 + include/fts.h | 190 + include/ftw.h | 60 + include/get_compat.h | 1 + include/getopt.h | 86 + include/glob.h | 130 + include/inttypes.h | 297 + include/iso646.h | 52 + include/kvm.h | 91 + include/langinfo.h | 120 + include/libc.h | 75 + include/libgen.h | 63 + include/libkern/OSThermalNotification.h | 135 + include/limits.h | 169 + include/locale.h | 56 + include/memory.h | 36 + include/monetary.h | 45 + include/monitor.h | 64 + include/mpool.h | 105 + include/ndbm.h | 120 + include/nlist.h | 85 + include/os/activity.h | 1 + include/os/alloc_once_private.h | 1 + include/os/assumes.h | 1 + include/os/debug_private.h | 1 + include/os/log.h | 1 + include/os/object.h | 1 + include/os/overflow.h | 1 + include/paths.h | 101 + include/poll.h | 26 + include/printf.h | 284 + include/protocols/routed.h | 104 + include/protocols/rwhod.h | 94 + include/protocols/talkd.h | 157 + include/protocols/timed.h | 130 + include/pthread_spinlock.h | 1 + include/ranlib.h | 101 + include/readpassphrase.h | 39 + include/regex.h | 217 + include/rune.h | 73 + include/runetype.h | 115 + include/search.h | 62 + include/secure/_common.h | 41 + include/secure/_stdio.h | 90 + include/secure/_string.h | 154 + include/secure/_strings.h | 59 + include/semaphore.h | 31 + include/sgtty.h | 54 + include/signal.h | 129 + include/stab.h | 67 + include/standards.h | 34 + include/stdbool.h | 46 + include/stddef.h | 90 + include/stdint.h | 205 + include/stdio.h | 427 + include/stdlib.h | 406 + include/strhash.h | 68 + include/string.h | 199 + include/stringlist.h | 57 + include/strings.h | 101 + include/struct.h | 79 + include/sys/acl.h | 211 + include/sys/cdefs.h | 127 + include/sys/rbtree.h | 104 + include/sys/statvfs.h | 60 + include/sysexits.3 | 132 + include/sysexits.h | 118 + include/syslog.h | 24 + include/tar.h | 73 + include/termios.h | 35 + include/time.h | 218 + include/timeconv.h | 62 + include/ttyent.h | 71 + include/tzfile.h | 1 + include/ulimit.h | 41 + include/unistd.h | 791 + include/util.h | 115 + include/utime.h | 75 + include/utmp.h | 99 + include/vis.h | 138 + include/wchar.h | 253 + include/wctype.h | 130 + include/wordexp.h | 85 + include/xlocale.h | 111 + include/xlocale/__wctype.h | 143 + include/xlocale/_ctype.h | 237 + include/xlocale/_inttypes.h | 47 + include/xlocale/_langinfo.h | 35 + include/xlocale/_monetary.h | 38 + include/xlocale/_regex.h | 55 + include/xlocale/_stdio.h | 82 + include/xlocale/_stdlib.h | 74 + include/xlocale/_string.h | 39 + include/xlocale/_time.h | 41 + include/xlocale/_wchar.h | 145 + include/xlocale/_wctype.h | 97 + libdarwin/AppleFactoryVariant.plist | 8 + libdarwin/AppleInternalVariant.plist | 8 + libdarwin/CMakeLists.txt | 47 + libdarwin/bsd.c | 191 + libdarwin/ctl.c | 612 + libdarwin/dirstat.c | 365 + libdarwin/dirstat_collection.c | 216 + libdarwin/err.c | 85 + libdarwin/exception.c | 207 + libdarwin/h/bsd.h | 149 + libdarwin/h/cleanup.h | 380 + libdarwin/h/ctl.h | 543 + libdarwin/h/dirstat.h | 55 + libdarwin/h/dirstat_collection.h | 41 + libdarwin/h/err.h | 188 + libdarwin/h/errno.h | 236 + libdarwin/h/libdarwin_init.h | 42 + libdarwin/h/mach_exception.h | 248 + libdarwin/h/mach_utils.h | 245 + libdarwin/h/stdio.h | 394 + libdarwin/h/stdlib.h | 543 + libdarwin/h/string.h | 193 + libdarwin/init.c | 37 + libdarwin/internal.h | 95 + libdarwin/mach.c | 485 + libdarwin/stdio.c | 276 + libdarwin/stdlib.c | 183 + libdarwin/string.c | 407 + libdarwin/tapi.h | 59 + libdarwin/variant.c | 756 + locale/CMakeLists.txt | 93 + locale/FreeBSD/ascii.c | 193 + locale/FreeBSD/big5.5 | 51 + locale/FreeBSD/big5.c | 174 + locale/FreeBSD/btowc.3 | 117 + locale/FreeBSD/btowc.c | 62 + locale/FreeBSD/collate.c | 1008 + locale/FreeBSD/collate.h | 123 + locale/FreeBSD/collcmp.c | 46 + locale/FreeBSD/ctype.3 | 158 + locale/FreeBSD/digittoint.3 | 78 + locale/FreeBSD/euc.5 | 134 + locale/FreeBSD/euc.c | 277 + locale/FreeBSD/fix_grouping.c | 98 + locale/FreeBSD/gb18030.5 | 78 + locale/FreeBSD/gb18030.c | 222 + locale/FreeBSD/gb2312.5 | 57 + locale/FreeBSD/gb2312.c | 157 + locale/FreeBSD/gbk.5 | 63 + locale/FreeBSD/gbk.c | 167 + locale/FreeBSD/isalnum.3 | 104 + locale/FreeBSD/isalpha.3 | 102 + locale/FreeBSD/isascii.3 | 53 + locale/FreeBSD/isblank.3 | 85 + locale/FreeBSD/iscntrl.3 | 92 + locale/FreeBSD/isdigit.3 | 103 + locale/FreeBSD/isgraph.3 | 107 + locale/FreeBSD/isideogram.3 | 58 + locale/FreeBSD/islower.3 | 92 + locale/FreeBSD/isphonogram.3 | 58 + locale/FreeBSD/isprint.3 | 105 + locale/FreeBSD/ispunct.3 | 97 + locale/FreeBSD/isrune.3 | 64 + locale/FreeBSD/isspace.3 | 89 + locale/FreeBSD/isspecial.3 | 60 + locale/FreeBSD/isupper.3 | 92 + locale/FreeBSD/iswalnum.3 | 165 + locale/FreeBSD/isxdigit.3 | 103 + locale/FreeBSD/ldpart.c | 156 + locale/FreeBSD/ldpart.h | 39 + locale/FreeBSD/lmessages.c | 123 + locale/FreeBSD/lmessages.h | 44 + locale/FreeBSD/lmonetary.c | 230 + locale/FreeBSD/lmonetary.h | 61 + locale/FreeBSD/lnumeric.c | 129 + locale/FreeBSD/lnumeric.h | 43 + locale/FreeBSD/localeconv.3 | 239 + locale/FreeBSD/localeconv.c | 193 + locale/FreeBSD/mblen.3 | 127 + locale/FreeBSD/mblen.c | 58 + locale/FreeBSD/mblocal.h | 64 + locale/FreeBSD/mbrlen.3 | 168 + locale/FreeBSD/mbrlen.c | 49 + locale/FreeBSD/mbrtowc.3 | 161 + locale/FreeBSD/mbrtowc.c | 50 + locale/FreeBSD/mbsinit.3 | 81 + locale/FreeBSD/mbsinit.c | 47 + locale/FreeBSD/mbsnrtowcs.c | 102 + locale/FreeBSD/mbsrtowcs.3 | 174 + locale/FreeBSD/mbsrtowcs.c | 53 + locale/FreeBSD/mbstowcs.3 | 107 + locale/FreeBSD/mbstowcs.c | 55 + locale/FreeBSD/mbtowc.3 | 134 + locale/FreeBSD/mbtowc.c | 59 + locale/FreeBSD/mskanji.5 | 70 + locale/FreeBSD/mskanji.c | 159 + locale/FreeBSD/multibyte.3 | 142 + locale/FreeBSD/nextwctype.3 | 80 + locale/FreeBSD/nextwctype.c | 100 + locale/FreeBSD/nl_langinfo.3 | 109 + locale/FreeBSD/nl_langinfo.c | 190 + locale/FreeBSD/nomacros.c | 12 + locale/FreeBSD/none.c | 179 + locale/FreeBSD/rune.c | 369 + locale/FreeBSD/rune32.h | 20 + locale/FreeBSD/runetype.c | 76 + locale/FreeBSD/setlocale.3 | 185 + locale/FreeBSD/setlocale.c | 393 + locale/FreeBSD/setlocale.h | 43 + locale/FreeBSD/setrunelocale.c | 207 + locale/FreeBSD/table.c | 468 + locale/FreeBSD/toascii.3 | 69 + locale/FreeBSD/tolower.3 | 98 + locale/FreeBSD/tolower.c | 83 + locale/FreeBSD/toupper.3 | 98 + locale/FreeBSD/toupper.c | 83 + locale/FreeBSD/towlower.3 | 85 + locale/FreeBSD/towupper.3 | 85 + locale/FreeBSD/utf2.c | 411 + locale/FreeBSD/utf8.5 | 102 + locale/FreeBSD/utf8.c | 467 + locale/FreeBSD/wcrtomb.3 | 128 + locale/FreeBSD/wcrtomb.c | 49 + locale/FreeBSD/wcsftime.3 | 88 + locale/FreeBSD/wcsftime.c | 119 + locale/FreeBSD/wcsnrtombs.c | 122 + locale/FreeBSD/wcsrtombs.3 | 175 + locale/FreeBSD/wcsrtombs.c | 53 + locale/FreeBSD/wcstod.3 | 90 + locale/FreeBSD/wcstod.c | 126 + locale/FreeBSD/wcstof.c | 93 + locale/FreeBSD/wcstoimax.c | 134 + locale/FreeBSD/wcstol.3 | 141 + locale/FreeBSD/wcstol.c | 127 + locale/FreeBSD/wcstold.c | 93 + locale/FreeBSD/wcstoll.c | 133 + locale/FreeBSD/wcstombs.3 | 111 + locale/FreeBSD/wcstombs.c | 55 + locale/FreeBSD/wcstoul.c | 125 + locale/FreeBSD/wcstoull.c | 132 + locale/FreeBSD/wcstoumax.c | 132 + locale/FreeBSD/wctob.c | 54 + locale/FreeBSD/wctomb.3 | 128 + locale/FreeBSD/wctomb.c | 57 + locale/FreeBSD/wctrans.3 | 156 + locale/FreeBSD/wctrans.c | 100 + locale/FreeBSD/wctype.3 | 153 + locale/FreeBSD/wctype.c | 88 + locale/FreeBSD/wcwidth.3 | 106 + locale/FreeBSD/wcwidth.c | 60 + locale/ctype_l.3 | 186 + locale/duplocale.3 | 36 + locale/freelocale.3 | 30 + locale/frune.c | 127 + locale/isalnum_l.3 | 185 + locale/isctype.c | 30 + locale/iswalnum_l.3 | 115 + locale/iswctype.c | 31 + locale/lconv.c | 98 + locale/locale/UTF-8/LC_CTYPE | Bin 0 -> 81360 bytes locale/locale/af_ZA.ISO8859-1/LC_COLLATE | 1 + locale/locale/af_ZA.ISO8859-1/LC_CTYPE | 1 + .../af_ZA.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/af_ZA.ISO8859-1/LC_MONETARY | 15 + locale/locale/af_ZA.ISO8859-1/LC_NUMERIC | 3 + locale/locale/af_ZA.ISO8859-1/LC_TIME | 1 + locale/locale/af_ZA.ISO8859-15/LC_COLLATE | 1 + locale/locale/af_ZA.ISO8859-15/LC_CTYPE | 1 + .../af_ZA.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/af_ZA.ISO8859-15/LC_MONETARY | 1 + locale/locale/af_ZA.ISO8859-15/LC_NUMERIC | 1 + locale/locale/af_ZA.ISO8859-15/LC_TIME | 1 + locale/locale/af_ZA.UTF-8/LC_COLLATE | 1 + locale/locale/af_ZA.UTF-8/LC_CTYPE | 1 + .../af_ZA.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/af_ZA.UTF-8/LC_MONETARY | 1 + locale/locale/af_ZA.UTF-8/LC_NUMERIC | 1 + locale/locale/af_ZA.UTF-8/LC_TIME | 1 + locale/locale/af_ZA/LC_COLLATE | 1 + locale/locale/af_ZA/LC_CTYPE | 1 + locale/locale/af_ZA/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/af_ZA/LC_MONETARY | 1 + locale/locale/af_ZA/LC_NUMERIC | 1 + locale/locale/af_ZA/LC_TIME | 1 + locale/locale/am_ET.UTF-8/LC_COLLATE | 1 + locale/locale/am_ET.UTF-8/LC_CTYPE | Bin 0 -> 3280 bytes .../am_ET.UTF-8/LC_MESSAGES/LC_MESSAGES | 5 + locale/locale/am_ET.UTF-8/LC_MONETARY | 15 + locale/locale/am_ET.UTF-8/LC_NUMERIC | 3 + locale/locale/am_ET.UTF-8/LC_TIME | 58 + locale/locale/am_ET/LC_COLLATE | 1 + locale/locale/am_ET/LC_CTYPE | Bin 0 -> 3280 bytes locale/locale/am_ET/LC_MESSAGES/LC_MESSAGES | 5 + locale/locale/am_ET/LC_MONETARY | 15 + locale/locale/am_ET/LC_NUMERIC | 3 + locale/locale/am_ET/LC_TIME | 58 + locale/locale/be_BY.CP1131/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/be_BY.CP1131/LC_CTYPE | Bin 0 -> 3263 bytes .../be_BY.CP1131/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/be_BY.CP1131/LC_MONETARY | 15 + locale/locale/be_BY.CP1131/LC_NUMERIC | 1 + locale/locale/be_BY.CP1131/LC_TIME | 58 + locale/locale/be_BY.CP1251/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/be_BY.CP1251/LC_CTYPE | 1 + .../be_BY.CP1251/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/be_BY.CP1251/LC_MONETARY | 15 + locale/locale/be_BY.CP1251/LC_NUMERIC | 3 + locale/locale/be_BY.CP1251/LC_TIME | 58 + locale/locale/be_BY.ISO8859-5/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/be_BY.ISO8859-5/LC_CTYPE | 1 + .../be_BY.ISO8859-5/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/be_BY.ISO8859-5/LC_MONETARY | 15 + locale/locale/be_BY.ISO8859-5/LC_NUMERIC | 1 + locale/locale/be_BY.ISO8859-5/LC_TIME | 58 + locale/locale/be_BY.UTF-8/LC_COLLATE | 1 + locale/locale/be_BY.UTF-8/LC_CTYPE | 1 + .../be_BY.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/be_BY.UTF-8/LC_MONETARY | 15 + locale/locale/be_BY.UTF-8/LC_NUMERIC | 1 + locale/locale/be_BY.UTF-8/LC_TIME | 58 + locale/locale/be_BY/LC_COLLATE | 1 + locale/locale/be_BY/LC_CTYPE | 1 + locale/locale/be_BY/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/be_BY/LC_MONETARY | 15 + locale/locale/be_BY/LC_NUMERIC | 1 + locale/locale/be_BY/LC_TIME | 58 + locale/locale/bg_BG.CP1251/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/bg_BG.CP1251/LC_CTYPE | Bin 0 -> 3235 bytes .../bg_BG.CP1251/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/bg_BG.CP1251/LC_MONETARY | 15 + locale/locale/bg_BG.CP1251/LC_NUMERIC | 3 + locale/locale/bg_BG.CP1251/LC_TIME | 58 + locale/locale/bg_BG.UTF-8/LC_COLLATE | 1 + locale/locale/bg_BG.UTF-8/LC_CTYPE | 1 + .../bg_BG.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/bg_BG.UTF-8/LC_MONETARY | 15 + locale/locale/bg_BG.UTF-8/LC_NUMERIC | 1 + locale/locale/bg_BG.UTF-8/LC_TIME | 58 + locale/locale/bg_BG/LC_COLLATE | 1 + locale/locale/bg_BG/LC_CTYPE | 1 + locale/locale/bg_BG/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/bg_BG/LC_MONETARY | 15 + locale/locale/bg_BG/LC_NUMERIC | 1 + locale/locale/bg_BG/LC_TIME | 58 + locale/locale/ca_ES.ISO8859-1/LC_COLLATE | Bin 0 -> 2518 bytes locale/locale/ca_ES.ISO8859-1/LC_CTYPE | 1 + .../ca_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/ca_ES.ISO8859-1/LC_MONETARY | 15 + locale/locale/ca_ES.ISO8859-1/LC_NUMERIC | 3 + locale/locale/ca_ES.ISO8859-1/LC_TIME | 58 + locale/locale/ca_ES.ISO8859-15/LC_COLLATE | Bin 0 -> 2518 bytes locale/locale/ca_ES.ISO8859-15/LC_CTYPE | 1 + .../ca_ES.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/ca_ES.ISO8859-15/LC_MONETARY | 1 + locale/locale/ca_ES.ISO8859-15/LC_NUMERIC | 1 + locale/locale/ca_ES.ISO8859-15/LC_TIME | 1 + locale/locale/ca_ES.UTF-8/LC_COLLATE | 1 + locale/locale/ca_ES.UTF-8/LC_CTYPE | 1 + .../ca_ES.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/ca_ES.UTF-8/LC_MONETARY | 1 + locale/locale/ca_ES.UTF-8/LC_NUMERIC | 1 + locale/locale/ca_ES.UTF-8/LC_TIME | 58 + locale/locale/ca_ES/LC_COLLATE | 1 + locale/locale/ca_ES/LC_CTYPE | 1 + locale/locale/ca_ES/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/ca_ES/LC_MONETARY | 1 + locale/locale/ca_ES/LC_NUMERIC | 1 + locale/locale/ca_ES/LC_TIME | 58 + locale/locale/cs/LC_MESSAGES/texinfo.mo | Bin 0 -> 38319 bytes locale/locale/cs_CZ.ISO8859-2/LC_COLLATE | Bin 0 -> 2274 bytes locale/locale/cs_CZ.ISO8859-2/LC_CTYPE | 1 + .../cs_CZ.ISO8859-2/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/cs_CZ.ISO8859-2/LC_MONETARY | 15 + locale/locale/cs_CZ.ISO8859-2/LC_NUMERIC | 3 + locale/locale/cs_CZ.ISO8859-2/LC_TIME | 58 + locale/locale/cs_CZ.UTF-8/LC_COLLATE | 1 + locale/locale/cs_CZ.UTF-8/LC_CTYPE | 1 + .../cs_CZ.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/cs_CZ.UTF-8/LC_MONETARY | 15 + locale/locale/cs_CZ.UTF-8/LC_NUMERIC | 1 + locale/locale/cs_CZ.UTF-8/LC_TIME | 58 + locale/locale/cs_CZ/LC_COLLATE | 1 + locale/locale/cs_CZ/LC_CTYPE | 1 + locale/locale/cs_CZ/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/cs_CZ/LC_MONETARY | 15 + locale/locale/cs_CZ/LC_NUMERIC | 1 + locale/locale/cs_CZ/LC_TIME | 58 + locale/locale/da/LC_MESSAGES/texinfo.mo | Bin 0 -> 58319 bytes locale/locale/da_DK.ISO8859-1/LC_COLLATE | 1 + locale/locale/da_DK.ISO8859-1/LC_CTYPE | 1 + .../da_DK.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/da_DK.ISO8859-1/LC_MONETARY | 15 + locale/locale/da_DK.ISO8859-1/LC_NUMERIC | 3 + locale/locale/da_DK.ISO8859-1/LC_TIME | 58 + locale/locale/da_DK.ISO8859-15/LC_COLLATE | 1 + locale/locale/da_DK.ISO8859-15/LC_CTYPE | 1 + .../da_DK.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/da_DK.ISO8859-15/LC_MONETARY | 1 + locale/locale/da_DK.ISO8859-15/LC_NUMERIC | 1 + locale/locale/da_DK.ISO8859-15/LC_TIME | 1 + locale/locale/da_DK.UTF-8/LC_COLLATE | 1 + locale/locale/da_DK.UTF-8/LC_CTYPE | 1 + .../da_DK.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/da_DK.UTF-8/LC_MONETARY | 1 + locale/locale/da_DK.UTF-8/LC_NUMERIC | 1 + locale/locale/da_DK.UTF-8/LC_TIME | 58 + locale/locale/da_DK/LC_COLLATE | 1 + locale/locale/da_DK/LC_CTYPE | 1 + locale/locale/da_DK/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/da_DK/LC_MONETARY | 1 + locale/locale/da_DK/LC_NUMERIC | 1 + locale/locale/da_DK/LC_TIME | 58 + locale/locale/de/LC_MESSAGES/texinfo.mo | Bin 0 -> 79236 bytes locale/locale/de_AT.ISO8859-1/LC_COLLATE | 1 + locale/locale/de_AT.ISO8859-1/LC_CTYPE | 1 + .../de_AT.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 1 + .../de_AT.ISO8859-1/LC_MESSAGES/texinfo.mo | Bin 0 -> 431 bytes locale/locale/de_AT.ISO8859-1/LC_MONETARY | 15 + locale/locale/de_AT.ISO8859-1/LC_NUMERIC | 1 + locale/locale/de_AT.ISO8859-1/LC_TIME | 58 + locale/locale/de_AT.ISO8859-15/LC_COLLATE | 1 + locale/locale/de_AT.ISO8859-15/LC_CTYPE | 1 + .../de_AT.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_AT.ISO8859-15/LC_MONETARY | 1 + locale/locale/de_AT.ISO8859-15/LC_NUMERIC | 1 + locale/locale/de_AT.ISO8859-15/LC_TIME | 1 + locale/locale/de_AT.UTF-8/LC_COLLATE | 1 + locale/locale/de_AT.UTF-8/LC_CTYPE | 1 + .../de_AT.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_AT.UTF-8/LC_MONETARY | 1 + locale/locale/de_AT.UTF-8/LC_NUMERIC | 1 + locale/locale/de_AT.UTF-8/LC_TIME | 58 + locale/locale/de_AT/LC_COLLATE | 1 + locale/locale/de_AT/LC_CTYPE | 1 + locale/locale/de_AT/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_AT/LC_MONETARY | 1 + locale/locale/de_AT/LC_NUMERIC | 1 + locale/locale/de_AT/LC_TIME | 58 + locale/locale/de_CH.ISO8859-1/LC_COLLATE | 1 + locale/locale/de_CH.ISO8859-1/LC_CTYPE | 1 + .../de_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_CH.ISO8859-1/LC_MONETARY | 15 + locale/locale/de_CH.ISO8859-1/LC_NUMERIC | 1 + locale/locale/de_CH.ISO8859-1/LC_TIME | 1 + locale/locale/de_CH.ISO8859-15/LC_COLLATE | 1 + locale/locale/de_CH.ISO8859-15/LC_CTYPE | 1 + .../de_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_CH.ISO8859-15/LC_MONETARY | 1 + locale/locale/de_CH.ISO8859-15/LC_NUMERIC | 1 + locale/locale/de_CH.ISO8859-15/LC_TIME | 1 + locale/locale/de_CH.UTF-8/LC_COLLATE | 1 + locale/locale/de_CH.UTF-8/LC_CTYPE | 1 + .../de_CH.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_CH.UTF-8/LC_MONETARY | 1 + locale/locale/de_CH.UTF-8/LC_NUMERIC | 1 + locale/locale/de_CH.UTF-8/LC_TIME | 1 + locale/locale/de_CH/LC_COLLATE | 1 + locale/locale/de_CH/LC_CTYPE | 1 + locale/locale/de_CH/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_CH/LC_MONETARY | 1 + locale/locale/de_CH/LC_NUMERIC | 1 + locale/locale/de_CH/LC_TIME | 1 + locale/locale/de_DE.ISO8859-1/LC_COLLATE | Bin 0 -> 2130 bytes locale/locale/de_DE.ISO8859-1/LC_CTYPE | 1 + .../de_DE.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/de_DE.ISO8859-1/LC_MONETARY | 15 + locale/locale/de_DE.ISO8859-1/LC_NUMERIC | 3 + locale/locale/de_DE.ISO8859-1/LC_TIME | 58 + locale/locale/de_DE.ISO8859-15/LC_COLLATE | Bin 0 -> 2130 bytes locale/locale/de_DE.ISO8859-15/LC_CTYPE | 1 + .../de_DE.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_DE.ISO8859-15/LC_MONETARY | 1 + locale/locale/de_DE.ISO8859-15/LC_NUMERIC | 1 + locale/locale/de_DE.ISO8859-15/LC_TIME | 1 + locale/locale/de_DE.UTF-8/LC_COLLATE | 1 + locale/locale/de_DE.UTF-8/LC_CTYPE | 1 + .../de_DE.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_DE.UTF-8/LC_MONETARY | 1 + locale/locale/de_DE.UTF-8/LC_NUMERIC | 1 + locale/locale/de_DE.UTF-8/LC_TIME | 58 + locale/locale/de_DE/LC_COLLATE | 1 + locale/locale/de_DE/LC_CTYPE | 1 + locale/locale/de_DE/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/de_DE/LC_MONETARY | 1 + locale/locale/de_DE/LC_NUMERIC | 1 + locale/locale/de_DE/LC_TIME | 58 + locale/locale/el_GR.ISO8859-7/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/el_GR.ISO8859-7/LC_CTYPE | Bin 0 -> 3227 bytes .../el_GR.ISO8859-7/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/el_GR.ISO8859-7/LC_MONETARY | 15 + locale/locale/el_GR.ISO8859-7/LC_NUMERIC | 3 + locale/locale/el_GR.ISO8859-7/LC_TIME | 58 + locale/locale/el_GR.UTF-8/LC_COLLATE | 1 + locale/locale/el_GR.UTF-8/LC_CTYPE | 1 + .../el_GR.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/el_GR.UTF-8/LC_MONETARY | 1 + locale/locale/el_GR.UTF-8/LC_NUMERIC | 1 + locale/locale/el_GR.UTF-8/LC_TIME | 58 + locale/locale/el_GR/LC_COLLATE | 1 + locale/locale/el_GR/LC_CTYPE | 1 + locale/locale/el_GR/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/el_GR/LC_MONETARY | 1 + locale/locale/el_GR/LC_NUMERIC | 1 + locale/locale/el_GR/LC_TIME | 58 + locale/locale/en_AU.ISO8859-1/LC_COLLATE | 1 + locale/locale/en_AU.ISO8859-1/LC_CTYPE | 1 + .../en_AU.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_AU.ISO8859-1/LC_MONETARY | 21 + locale/locale/en_AU.ISO8859-1/LC_NUMERIC | 1 + locale/locale/en_AU.ISO8859-1/LC_TIME | 1 + locale/locale/en_AU.ISO8859-15/LC_COLLATE | 1 + locale/locale/en_AU.ISO8859-15/LC_CTYPE | 1 + .../en_AU.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_AU.ISO8859-15/LC_MONETARY | 1 + locale/locale/en_AU.ISO8859-15/LC_NUMERIC | 1 + locale/locale/en_AU.ISO8859-15/LC_TIME | 1 + locale/locale/en_AU.US-ASCII/LC_COLLATE | 1 + locale/locale/en_AU.US-ASCII/LC_CTYPE | 1 + .../en_AU.US-ASCII/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_AU.US-ASCII/LC_MONETARY | 1 + locale/locale/en_AU.US-ASCII/LC_NUMERIC | 1 + locale/locale/en_AU.US-ASCII/LC_TIME | 1 + locale/locale/en_AU.UTF-8/LC_COLLATE | 1 + locale/locale/en_AU.UTF-8/LC_CTYPE | 1 + .../en_AU.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_AU.UTF-8/LC_MONETARY | 1 + locale/locale/en_AU.UTF-8/LC_NUMERIC | 1 + locale/locale/en_AU.UTF-8/LC_TIME | 1 + locale/locale/en_AU/LC_COLLATE | 1 + locale/locale/en_AU/LC_CTYPE | 1 + locale/locale/en_AU/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_AU/LC_MONETARY | 1 + locale/locale/en_AU/LC_NUMERIC | 1 + locale/locale/en_AU/LC_TIME | 1 + locale/locale/en_CA.ISO8859-1/LC_COLLATE | 1 + locale/locale/en_CA.ISO8859-1/LC_CTYPE | 1 + .../en_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/en_CA.ISO8859-1/LC_MONETARY | 15 + locale/locale/en_CA.ISO8859-1/LC_NUMERIC | 1 + locale/locale/en_CA.ISO8859-1/LC_TIME | 1 + locale/locale/en_CA.ISO8859-15/LC_COLLATE | 1 + locale/locale/en_CA.ISO8859-15/LC_CTYPE | 1 + .../en_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_CA.ISO8859-15/LC_MONETARY | 1 + locale/locale/en_CA.ISO8859-15/LC_NUMERIC | 1 + locale/locale/en_CA.ISO8859-15/LC_TIME | 1 + locale/locale/en_CA.US-ASCII/LC_COLLATE | 1 + locale/locale/en_CA.US-ASCII/LC_CTYPE | 1 + .../en_CA.US-ASCII/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_CA.US-ASCII/LC_MONETARY | 1 + locale/locale/en_CA.US-ASCII/LC_NUMERIC | 1 + locale/locale/en_CA.US-ASCII/LC_TIME | 1 + locale/locale/en_CA.UTF-8/LC_COLLATE | 1 + locale/locale/en_CA.UTF-8/LC_CTYPE | 1 + .../en_CA.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_CA.UTF-8/LC_MONETARY | 1 + locale/locale/en_CA.UTF-8/LC_NUMERIC | 1 + locale/locale/en_CA.UTF-8/LC_TIME | 1 + locale/locale/en_CA/LC_COLLATE | 1 + locale/locale/en_CA/LC_CTYPE | 1 + locale/locale/en_CA/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_CA/LC_MONETARY | 1 + locale/locale/en_CA/LC_NUMERIC | 1 + locale/locale/en_CA/LC_TIME | 1 + locale/locale/en_GB.ISO8859-1/LC_COLLATE | 1 + locale/locale/en_GB.ISO8859-1/LC_CTYPE | 1 + .../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/en_GB.ISO8859-1/LC_MONETARY | 15 + locale/locale/en_GB.ISO8859-1/LC_NUMERIC | 1 + locale/locale/en_GB.ISO8859-1/LC_TIME | 58 + locale/locale/en_GB.ISO8859-15/LC_COLLATE | 1 + locale/locale/en_GB.ISO8859-15/LC_CTYPE | 1 + .../en_GB.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_GB.ISO8859-15/LC_MONETARY | 1 + locale/locale/en_GB.ISO8859-15/LC_NUMERIC | 1 + locale/locale/en_GB.ISO8859-15/LC_TIME | 1 + locale/locale/en_GB.US-ASCII/LC_COLLATE | 1 + locale/locale/en_GB.US-ASCII/LC_CTYPE | 1 + .../en_GB.US-ASCII/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_GB.US-ASCII/LC_MONETARY | 1 + locale/locale/en_GB.US-ASCII/LC_NUMERIC | 1 + locale/locale/en_GB.US-ASCII/LC_TIME | 1 + locale/locale/en_GB.UTF-8/LC_COLLATE | 1 + locale/locale/en_GB.UTF-8/LC_CTYPE | 1 + .../en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_GB.UTF-8/LC_MONETARY | 15 + locale/locale/en_GB.UTF-8/LC_NUMERIC | 1 + locale/locale/en_GB.UTF-8/LC_TIME | 1 + locale/locale/en_GB/LC_COLLATE | 1 + locale/locale/en_GB/LC_CTYPE | 1 + locale/locale/en_GB/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_GB/LC_MONETARY | 15 + locale/locale/en_GB/LC_NUMERIC | 1 + locale/locale/en_GB/LC_TIME | 1 + locale/locale/en_IE.UTF-8/LC_COLLATE | 1 + locale/locale/en_IE.UTF-8/LC_CTYPE | 1 + .../en_IE.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_IE.UTF-8/LC_MONETARY | 15 + locale/locale/en_IE.UTF-8/LC_NUMERIC | 1 + locale/locale/en_IE.UTF-8/LC_TIME | 1 + locale/locale/en_IE/LC_COLLATE | 1 + locale/locale/en_IE/LC_CTYPE | 1 + locale/locale/en_IE/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_IE/LC_MONETARY | 15 + locale/locale/en_IE/LC_NUMERIC | 1 + locale/locale/en_IE/LC_TIME | 1 + locale/locale/en_NZ.ISO8859-1/LC_COLLATE | 1 + locale/locale/en_NZ.ISO8859-1/LC_CTYPE | 1 + .../en_NZ.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_NZ.ISO8859-1/LC_MONETARY | 15 + locale/locale/en_NZ.ISO8859-1/LC_NUMERIC | 1 + locale/locale/en_NZ.ISO8859-1/LC_TIME | 1 + locale/locale/en_NZ.ISO8859-15/LC_COLLATE | 1 + locale/locale/en_NZ.ISO8859-15/LC_CTYPE | 1 + .../en_NZ.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_NZ.ISO8859-15/LC_MONETARY | 1 + locale/locale/en_NZ.ISO8859-15/LC_NUMERIC | 1 + locale/locale/en_NZ.ISO8859-15/LC_TIME | 1 + locale/locale/en_NZ.US-ASCII/LC_COLLATE | 1 + locale/locale/en_NZ.US-ASCII/LC_CTYPE | 1 + .../en_NZ.US-ASCII/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_NZ.US-ASCII/LC_MONETARY | 1 + locale/locale/en_NZ.US-ASCII/LC_NUMERIC | 1 + locale/locale/en_NZ.US-ASCII/LC_TIME | 1 + locale/locale/en_NZ.UTF-8/LC_COLLATE | 1 + locale/locale/en_NZ.UTF-8/LC_CTYPE | 1 + .../en_NZ.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_NZ.UTF-8/LC_MONETARY | 1 + locale/locale/en_NZ.UTF-8/LC_NUMERIC | 1 + locale/locale/en_NZ.UTF-8/LC_TIME | 1 + locale/locale/en_NZ/LC_COLLATE | 1 + locale/locale/en_NZ/LC_CTYPE | 1 + locale/locale/en_NZ/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_NZ/LC_MONETARY | 1 + locale/locale/en_NZ/LC_NUMERIC | 1 + locale/locale/en_NZ/LC_TIME | 1 + locale/locale/en_US.ISO8859-1/LC_COLLATE | 1 + locale/locale/en_US.ISO8859-1/LC_CTYPE | 1 + .../en_US.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/en_US.ISO8859-1/LC_MONETARY | 15 + locale/locale/en_US.ISO8859-1/LC_NUMERIC | 3 + locale/locale/en_US.ISO8859-1/LC_TIME | 58 + locale/locale/en_US.ISO8859-15/LC_COLLATE | 1 + locale/locale/en_US.ISO8859-15/LC_CTYPE | 1 + .../en_US.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_US.ISO8859-15/LC_MONETARY | 1 + locale/locale/en_US.ISO8859-15/LC_NUMERIC | 1 + locale/locale/en_US.ISO8859-15/LC_TIME | 1 + locale/locale/en_US.US-ASCII/LC_COLLATE | 1 + locale/locale/en_US.US-ASCII/LC_CTYPE | 1 + .../en_US.US-ASCII/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_US.US-ASCII/LC_MONETARY | 1 + locale/locale/en_US.US-ASCII/LC_NUMERIC | 1 + locale/locale/en_US.US-ASCII/LC_TIME | 1 + locale/locale/en_US.UTF-8/LC_COLLATE | 1 + locale/locale/en_US.UTF-8/LC_CTYPE | 1 + .../en_US.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_US.UTF-8/LC_MONETARY | 1 + locale/locale/en_US.UTF-8/LC_NUMERIC | 1 + locale/locale/en_US.UTF-8/LC_TIME | 1 + locale/locale/en_US/LC_COLLATE | 1 + locale/locale/en_US/LC_CTYPE | 1 + locale/locale/en_US/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/en_US/LC_MONETARY | 1 + locale/locale/en_US/LC_NUMERIC | 1 + locale/locale/en_US/LC_TIME | 1 + locale/locale/eo/LC_MESSAGES/texinfo.mo | Bin 0 -> 61416 bytes locale/locale/es_ES.ISO8859-1/LC_COLLATE | Bin 0 -> 2518 bytes locale/locale/es_ES.ISO8859-1/LC_CTYPE | 1 + .../es_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/es_ES.ISO8859-1/LC_MONETARY | 15 + locale/locale/es_ES.ISO8859-1/LC_NUMERIC | 3 + locale/locale/es_ES.ISO8859-1/LC_TIME | 58 + locale/locale/es_ES.ISO8859-15/LC_COLLATE | Bin 0 -> 2518 bytes locale/locale/es_ES.ISO8859-15/LC_CTYPE | 1 + .../es_ES.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/es_ES.ISO8859-15/LC_MONETARY | 1 + locale/locale/es_ES.ISO8859-15/LC_NUMERIC | 1 + locale/locale/es_ES.ISO8859-15/LC_TIME | 1 + locale/locale/es_ES.UTF-8/LC_COLLATE | 1 + locale/locale/es_ES.UTF-8/LC_CTYPE | 1 + .../es_ES.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/es_ES.UTF-8/LC_MONETARY | 1 + locale/locale/es_ES.UTF-8/LC_NUMERIC | 1 + locale/locale/es_ES.UTF-8/LC_TIME | 58 + locale/locale/es_ES/LC_COLLATE | 1 + locale/locale/es_ES/LC_CTYPE | 1 + locale/locale/es_ES/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/es_ES/LC_MONETARY | 1 + locale/locale/es_ES/LC_NUMERIC | 1 + locale/locale/es_ES/LC_TIME | 58 + locale/locale/et_EE.ISO8859-15/LC_COLLATE | Bin 0 -> 2130 bytes locale/locale/et_EE.ISO8859-15/LC_CTYPE | 1 + .../et_EE.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/et_EE.ISO8859-15/LC_MONETARY | 15 + locale/locale/et_EE.ISO8859-15/LC_NUMERIC | 3 + locale/locale/et_EE.ISO8859-15/LC_TIME | 58 + locale/locale/et_EE.UTF-8/LC_COLLATE | 1 + locale/locale/et_EE.UTF-8/LC_CTYPE | 1 + .../et_EE.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/et_EE.UTF-8/LC_MONETARY | 1 + locale/locale/et_EE.UTF-8/LC_NUMERIC | 1 + locale/locale/et_EE.UTF-8/LC_TIME | 58 + locale/locale/et_EE/LC_COLLATE | 1 + locale/locale/et_EE/LC_CTYPE | 1 + locale/locale/et_EE/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/et_EE/LC_MONETARY | 1 + locale/locale/et_EE/LC_NUMERIC | 1 + locale/locale/et_EE/LC_TIME | 58 + locale/locale/eu_ES.ISO8859-1/LC_COLLATE | 1 + locale/locale/eu_ES.ISO8859-1/LC_CTYPE | 1 + .../eu_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/eu_ES.ISO8859-1/LC_MONETARY | 1 + locale/locale/eu_ES.ISO8859-1/LC_NUMERIC | 3 + locale/locale/eu_ES.ISO8859-1/LC_TIME | 58 + locale/locale/eu_ES.ISO8859-15/LC_COLLATE | 1 + locale/locale/eu_ES.ISO8859-15/LC_CTYPE | 1 + .../eu_ES.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/eu_ES.ISO8859-15/LC_MONETARY | 1 + locale/locale/eu_ES.ISO8859-15/LC_NUMERIC | 1 + locale/locale/eu_ES.ISO8859-15/LC_TIME | 1 + locale/locale/eu_ES.UTF-8/LC_COLLATE | 1 + locale/locale/eu_ES.UTF-8/LC_CTYPE | 1 + .../eu_ES.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/eu_ES.UTF-8/LC_MONETARY | 1 + locale/locale/eu_ES.UTF-8/LC_NUMERIC | 1 + locale/locale/eu_ES.UTF-8/LC_TIME | 1 + locale/locale/eu_ES/LC_COLLATE | 1 + locale/locale/eu_ES/LC_CTYPE | 1 + locale/locale/eu_ES/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/eu_ES/LC_MONETARY | 1 + locale/locale/eu_ES/LC_NUMERIC | 1 + locale/locale/eu_ES/LC_TIME | 1 + locale/locale/fi_FI.ISO8859-1/LC_COLLATE | 1 + locale/locale/fi_FI.ISO8859-1/LC_CTYPE | 1 + .../fi_FI.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/fi_FI.ISO8859-1/LC_MONETARY | 15 + locale/locale/fi_FI.ISO8859-1/LC_NUMERIC | 3 + locale/locale/fi_FI.ISO8859-1/LC_TIME | 58 + locale/locale/fi_FI.ISO8859-15/LC_COLLATE | 1 + locale/locale/fi_FI.ISO8859-15/LC_CTYPE | 1 + .../fi_FI.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fi_FI.ISO8859-15/LC_MONETARY | 1 + locale/locale/fi_FI.ISO8859-15/LC_NUMERIC | 1 + locale/locale/fi_FI.ISO8859-15/LC_TIME | 1 + locale/locale/fi_FI.UTF-8/LC_COLLATE | 1 + locale/locale/fi_FI.UTF-8/LC_CTYPE | 1 + .../fi_FI.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fi_FI.UTF-8/LC_MONETARY | 1 + locale/locale/fi_FI.UTF-8/LC_NUMERIC | 1 + locale/locale/fi_FI.UTF-8/LC_TIME | 58 + locale/locale/fi_FI/LC_COLLATE | 1 + locale/locale/fi_FI/LC_CTYPE | 1 + locale/locale/fi_FI/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fi_FI/LC_MONETARY | 1 + locale/locale/fi_FI/LC_NUMERIC | 1 + locale/locale/fi_FI/LC_TIME | 58 + locale/locale/fr/LC_MESSAGES/texinfo.mo | Bin 0 -> 78442 bytes locale/locale/fr_BE.ISO8859-1/LC_COLLATE | 1 + locale/locale/fr_BE.ISO8859-1/LC_CTYPE | 1 + .../fr_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/fr_BE.ISO8859-1/LC_MONETARY | 15 + locale/locale/fr_BE.ISO8859-1/LC_NUMERIC | 3 + locale/locale/fr_BE.ISO8859-1/LC_TIME | 1 + locale/locale/fr_BE.ISO8859-15/LC_COLLATE | 1 + locale/locale/fr_BE.ISO8859-15/LC_CTYPE | 1 + .../fr_BE.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_BE.ISO8859-15/LC_MONETARY | 1 + locale/locale/fr_BE.ISO8859-15/LC_NUMERIC | 1 + locale/locale/fr_BE.ISO8859-15/LC_TIME | 1 + locale/locale/fr_BE.UTF-8/LC_COLLATE | 1 + locale/locale/fr_BE.UTF-8/LC_CTYPE | 1 + .../fr_BE.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_BE.UTF-8/LC_MONETARY | 1 + locale/locale/fr_BE.UTF-8/LC_NUMERIC | 1 + locale/locale/fr_BE.UTF-8/LC_TIME | 1 + locale/locale/fr_BE/LC_COLLATE | 1 + locale/locale/fr_BE/LC_CTYPE | 1 + locale/locale/fr_BE/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_BE/LC_MONETARY | 1 + locale/locale/fr_BE/LC_NUMERIC | 1 + locale/locale/fr_BE/LC_TIME | 1 + locale/locale/fr_CA.ISO8859-1/LC_COLLATE | 1 + locale/locale/fr_CA.ISO8859-1/LC_CTYPE | 1 + .../fr_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_CA.ISO8859-1/LC_MONETARY | 15 + locale/locale/fr_CA.ISO8859-1/LC_NUMERIC | 1 + locale/locale/fr_CA.ISO8859-1/LC_TIME | 1 + locale/locale/fr_CA.ISO8859-15/LC_COLLATE | 1 + locale/locale/fr_CA.ISO8859-15/LC_CTYPE | 1 + .../fr_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_CA.ISO8859-15/LC_MONETARY | 1 + locale/locale/fr_CA.ISO8859-15/LC_NUMERIC | 1 + locale/locale/fr_CA.ISO8859-15/LC_TIME | 1 + locale/locale/fr_CA.UTF-8/LC_COLLATE | 1 + locale/locale/fr_CA.UTF-8/LC_CTYPE | 1 + .../fr_CA.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_CA.UTF-8/LC_MONETARY | 1 + locale/locale/fr_CA.UTF-8/LC_NUMERIC | 1 + locale/locale/fr_CA.UTF-8/LC_TIME | 1 + locale/locale/fr_CA/LC_COLLATE | 1 + locale/locale/fr_CA/LC_CTYPE | 1 + locale/locale/fr_CA/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_CA/LC_MONETARY | 1 + locale/locale/fr_CA/LC_NUMERIC | 1 + locale/locale/fr_CA/LC_TIME | 1 + locale/locale/fr_CH.ISO8859-1/LC_COLLATE | 1 + locale/locale/fr_CH.ISO8859-1/LC_CTYPE | 1 + .../fr_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/fr_CH.ISO8859-1/LC_MONETARY | 1 + locale/locale/fr_CH.ISO8859-1/LC_NUMERIC | 1 + locale/locale/fr_CH.ISO8859-1/LC_TIME | 1 + locale/locale/fr_CH.ISO8859-15/LC_COLLATE | 1 + locale/locale/fr_CH.ISO8859-15/LC_CTYPE | 1 + .../fr_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_CH.ISO8859-15/LC_MONETARY | 1 + locale/locale/fr_CH.ISO8859-15/LC_NUMERIC | 1 + locale/locale/fr_CH.ISO8859-15/LC_TIME | 1 + locale/locale/fr_CH.UTF-8/LC_COLLATE | 1 + locale/locale/fr_CH.UTF-8/LC_CTYPE | 1 + .../fr_CH.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_CH.UTF-8/LC_MONETARY | 1 + locale/locale/fr_CH.UTF-8/LC_NUMERIC | 1 + locale/locale/fr_CH.UTF-8/LC_TIME | 1 + locale/locale/fr_CH/LC_COLLATE | 1 + locale/locale/fr_CH/LC_CTYPE | 1 + locale/locale/fr_CH/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_CH/LC_MONETARY | 1 + locale/locale/fr_CH/LC_NUMERIC | 1 + locale/locale/fr_CH/LC_TIME | 1 + locale/locale/fr_FR.ISO8859-1/LC_COLLATE | 1 + locale/locale/fr_FR.ISO8859-1/LC_CTYPE | 1 + .../fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/fr_FR.ISO8859-1/LC_MONETARY | 15 + locale/locale/fr_FR.ISO8859-1/LC_NUMERIC | 3 + locale/locale/fr_FR.ISO8859-1/LC_TIME | 58 + locale/locale/fr_FR.ISO8859-15/LC_COLLATE | 1 + locale/locale/fr_FR.ISO8859-15/LC_CTYPE | 1 + .../fr_FR.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_FR.ISO8859-15/LC_MONETARY | 1 + locale/locale/fr_FR.ISO8859-15/LC_NUMERIC | 1 + locale/locale/fr_FR.ISO8859-15/LC_TIME | 1 + locale/locale/fr_FR.UTF-8/LC_COLLATE | 1 + locale/locale/fr_FR.UTF-8/LC_CTYPE | 1 + .../fr_FR.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_FR.UTF-8/LC_MONETARY | 1 + locale/locale/fr_FR.UTF-8/LC_NUMERIC | 1 + locale/locale/fr_FR.UTF-8/LC_TIME | 58 + locale/locale/fr_FR/LC_COLLATE | 1 + locale/locale/fr_FR/LC_CTYPE | 1 + locale/locale/fr_FR/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/fr_FR/LC_MONETARY | 1 + locale/locale/fr_FR/LC_NUMERIC | 1 + locale/locale/fr_FR/LC_TIME | 58 + locale/locale/he/LC_MESSAGES/texinfo.mo | Bin 0 -> 54894 bytes locale/locale/he_IL.UTF-8/LC_COLLATE | 1 + locale/locale/he_IL.UTF-8/LC_CTYPE | 1 + .../he_IL.UTF-8/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/he_IL.UTF-8/LC_MONETARY | 15 + locale/locale/he_IL.UTF-8/LC_NUMERIC | 1 + locale/locale/he_IL.UTF-8/LC_TIME | 58 + locale/locale/he_IL/LC_COLLATE | 1 + locale/locale/he_IL/LC_CTYPE | 1 + locale/locale/he_IL/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/he_IL/LC_MONETARY | 15 + locale/locale/he_IL/LC_NUMERIC | 1 + locale/locale/he_IL/LC_TIME | 58 + locale/locale/hi_IN.ISCII-DEV/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/hi_IN.ISCII-DEV/LC_CTYPE | Bin 0 -> 3164 bytes .../hi_IN.ISCII-DEV/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/hi_IN.ISCII-DEV/LC_MONETARY | 15 + locale/locale/hi_IN.ISCII-DEV/LC_NUMERIC | 3 + locale/locale/hi_IN.ISCII-DEV/LC_TIME | 58 + locale/locale/hr/LC_MESSAGES/texinfo.mo | Bin 0 -> 35680 bytes locale/locale/hr_HR.ISO8859-2/LC_COLLATE | 1 + locale/locale/hr_HR.ISO8859-2/LC_CTYPE | 1 + .../hr_HR.ISO8859-2/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/hr_HR.ISO8859-2/LC_MONETARY | 21 + locale/locale/hr_HR.ISO8859-2/LC_NUMERIC | 3 + locale/locale/hr_HR.ISO8859-2/LC_TIME | 58 + locale/locale/hr_HR.UTF-8/LC_COLLATE | 1 + locale/locale/hr_HR.UTF-8/LC_CTYPE | 1 + .../hr_HR.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/hr_HR.UTF-8/LC_MONETARY | 1 + locale/locale/hr_HR.UTF-8/LC_NUMERIC | 1 + locale/locale/hr_HR.UTF-8/LC_TIME | 58 + locale/locale/hr_HR/LC_COLLATE | 1 + locale/locale/hr_HR/LC_CTYPE | 1 + locale/locale/hr_HR/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/hr_HR/LC_MONETARY | 1 + locale/locale/hr_HR/LC_NUMERIC | 1 + locale/locale/hr_HR/LC_TIME | 58 + locale/locale/hu_HU.ISO8859-2/LC_COLLATE | 1 + locale/locale/hu_HU.ISO8859-2/LC_CTYPE | 1 + .../hu_HU.ISO8859-2/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/hu_HU.ISO8859-2/LC_MONETARY | 15 + locale/locale/hu_HU.ISO8859-2/LC_NUMERIC | 3 + locale/locale/hu_HU.ISO8859-2/LC_TIME | 58 + locale/locale/hu_HU.UTF-8/LC_COLLATE | 1 + locale/locale/hu_HU.UTF-8/LC_CTYPE | 1 + .../hu_HU.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/hu_HU.UTF-8/LC_MONETARY | 1 + locale/locale/hu_HU.UTF-8/LC_NUMERIC | 1 + locale/locale/hu_HU.UTF-8/LC_TIME | 58 + locale/locale/hu_HU/LC_COLLATE | 1 + locale/locale/hu_HU/LC_CTYPE | 1 + locale/locale/hu_HU/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/hu_HU/LC_MONETARY | 1 + locale/locale/hu_HU/LC_NUMERIC | 1 + locale/locale/hu_HU/LC_TIME | 58 + locale/locale/hy_AM.ARMSCII-8/LC_COLLATE | Bin 0 -> 2130 bytes locale/locale/hy_AM.ARMSCII-8/LC_CTYPE | Bin 0 -> 3221 bytes .../hy_AM.ARMSCII-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/hy_AM.ARMSCII-8/LC_MONETARY | 15 + locale/locale/hy_AM.ARMSCII-8/LC_NUMERIC | 3 + locale/locale/hy_AM.ARMSCII-8/LC_TIME | 58 + locale/locale/hy_AM.UTF-8/LC_COLLATE | 1 + locale/locale/hy_AM.UTF-8/LC_CTYPE | 1 + .../hy_AM.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/hy_AM.UTF-8/LC_MONETARY | 15 + locale/locale/hy_AM.UTF-8/LC_NUMERIC | 1 + locale/locale/hy_AM.UTF-8/LC_TIME | 58 + locale/locale/hy_AM/LC_COLLATE | 1 + locale/locale/hy_AM/LC_CTYPE | 1 + locale/locale/hy_AM/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/hy_AM/LC_MONETARY | 15 + locale/locale/hy_AM/LC_NUMERIC | 1 + locale/locale/hy_AM/LC_TIME | 58 + locale/locale/is_IS.ISO8859-1/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/is_IS.ISO8859-1/LC_CTYPE | 1 + .../is_IS.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/is_IS.ISO8859-1/LC_MONETARY | 15 + locale/locale/is_IS.ISO8859-1/LC_NUMERIC | 3 + locale/locale/is_IS.ISO8859-1/LC_TIME | 58 + locale/locale/is_IS.ISO8859-15/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/is_IS.ISO8859-15/LC_CTYPE | 1 + .../is_IS.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/is_IS.ISO8859-15/LC_MONETARY | 1 + locale/locale/is_IS.ISO8859-15/LC_NUMERIC | 1 + locale/locale/is_IS.ISO8859-15/LC_TIME | 1 + locale/locale/is_IS.UTF-8/LC_COLLATE | 1 + locale/locale/is_IS.UTF-8/LC_CTYPE | 1 + .../is_IS.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/is_IS.UTF-8/LC_MONETARY | 1 + locale/locale/is_IS.UTF-8/LC_NUMERIC | 1 + locale/locale/is_IS.UTF-8/LC_TIME | 58 + locale/locale/is_IS/LC_COLLATE | 1 + locale/locale/is_IS/LC_CTYPE | 1 + locale/locale/is_IS/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/is_IS/LC_MONETARY | 1 + locale/locale/is_IS/LC_NUMERIC | 1 + locale/locale/is_IS/LC_TIME | 58 + locale/locale/it_CH.ISO8859-1/LC_COLLATE | 1 + locale/locale/it_CH.ISO8859-1/LC_CTYPE | 1 + .../it_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/it_CH.ISO8859-1/LC_MONETARY | 1 + locale/locale/it_CH.ISO8859-1/LC_NUMERIC | 1 + locale/locale/it_CH.ISO8859-1/LC_TIME | 1 + locale/locale/it_CH.ISO8859-15/LC_COLLATE | 1 + locale/locale/it_CH.ISO8859-15/LC_CTYPE | 1 + .../it_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/it_CH.ISO8859-15/LC_MONETARY | 1 + locale/locale/it_CH.ISO8859-15/LC_NUMERIC | 1 + locale/locale/it_CH.ISO8859-15/LC_TIME | 1 + locale/locale/it_CH.UTF-8/LC_COLLATE | 1 + locale/locale/it_CH.UTF-8/LC_CTYPE | 1 + .../it_CH.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/it_CH.UTF-8/LC_MONETARY | 1 + locale/locale/it_CH.UTF-8/LC_NUMERIC | 1 + locale/locale/it_CH.UTF-8/LC_TIME | 1 + locale/locale/it_CH/LC_COLLATE | 1 + locale/locale/it_CH/LC_CTYPE | 1 + locale/locale/it_CH/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/it_CH/LC_MONETARY | 1 + locale/locale/it_CH/LC_NUMERIC | 1 + locale/locale/it_CH/LC_TIME | 1 + locale/locale/it_IT.ISO8859-1/LC_COLLATE | 1 + locale/locale/it_IT.ISO8859-1/LC_CTYPE | 1 + .../it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/it_IT.ISO8859-1/LC_MONETARY | 15 + locale/locale/it_IT.ISO8859-1/LC_NUMERIC | 3 + locale/locale/it_IT.ISO8859-1/LC_TIME | 58 + locale/locale/it_IT.ISO8859-15/LC_COLLATE | 1 + locale/locale/it_IT.ISO8859-15/LC_CTYPE | 1 + .../it_IT.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/it_IT.ISO8859-15/LC_MONETARY | 1 + locale/locale/it_IT.ISO8859-15/LC_NUMERIC | 1 + locale/locale/it_IT.ISO8859-15/LC_TIME | 1 + locale/locale/it_IT.UTF-8/LC_COLLATE | 1 + locale/locale/it_IT.UTF-8/LC_CTYPE | 1 + .../it_IT.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/it_IT.UTF-8/LC_MONETARY | 1 + locale/locale/it_IT.UTF-8/LC_NUMERIC | 1 + locale/locale/it_IT.UTF-8/LC_TIME | 58 + locale/locale/it_IT/LC_COLLATE | 1 + locale/locale/it_IT/LC_CTYPE | 1 + locale/locale/it_IT/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/it_IT/LC_MONETARY | 1 + locale/locale/it_IT/LC_NUMERIC | 1 + locale/locale/it_IT/LC_TIME | 58 + locale/locale/ja/LC_MESSAGES/texinfo.mo | Bin 0 -> 46062 bytes locale/locale/ja_JP.SJIS/LC_COLLATE | 1 + locale/locale/ja_JP.SJIS/LC_CTYPE | Bin 0 -> 6156 bytes .../locale/ja_JP.SJIS/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/ja_JP.SJIS/LC_MONETARY | 1 + locale/locale/ja_JP.SJIS/LC_NUMERIC | 1 + locale/locale/ja_JP.SJIS/LC_TIME | 58 + locale/locale/ja_JP.UTF-8/LC_COLLATE | 1 + locale/locale/ja_JP.UTF-8/LC_CTYPE | 1 + .../ja_JP.UTF-8/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/ja_JP.UTF-8/LC_MONETARY | 15 + locale/locale/ja_JP.UTF-8/LC_NUMERIC | 1 + locale/locale/ja_JP.UTF-8/LC_TIME | 58 + locale/locale/ja_JP.eucJP/LC_COLLATE | 1 + locale/locale/ja_JP.eucJP/LC_CTYPE | Bin 0 -> 5395 bytes .../ja_JP.eucJP/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/ja_JP.eucJP/LC_MONETARY | 15 + locale/locale/ja_JP.eucJP/LC_NUMERIC | 3 + locale/locale/ja_JP.eucJP/LC_TIME | 58 + locale/locale/ja_JP/LC_COLLATE | 1 + locale/locale/ja_JP/LC_CTYPE | 1 + locale/locale/ja_JP/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/ja_JP/LC_MONETARY | 15 + locale/locale/ja_JP/LC_NUMERIC | 1 + locale/locale/ja_JP/LC_TIME | 58 + locale/locale/kk_KZ.PT154/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/kk_KZ.PT154/LC_CTYPE | Bin 0 -> 3218 bytes .../kk_KZ.PT154/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/kk_KZ.PT154/LC_MONETARY | 15 + locale/locale/kk_KZ.PT154/LC_NUMERIC | 3 + locale/locale/kk_KZ.PT154/LC_TIME | 58 + locale/locale/kk_KZ.UTF-8/LC_COLLATE | 1 + locale/locale/kk_KZ.UTF-8/LC_CTYPE | 1 + .../kk_KZ.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/kk_KZ.UTF-8/LC_MONETARY | 15 + locale/locale/kk_KZ.UTF-8/LC_NUMERIC | 1 + locale/locale/kk_KZ.UTF-8/LC_TIME | 58 + locale/locale/kk_KZ/LC_COLLATE | 1 + locale/locale/kk_KZ/LC_CTYPE | 1 + locale/locale/kk_KZ/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/kk_KZ/LC_MONETARY | 15 + locale/locale/kk_KZ/LC_NUMERIC | 1 + locale/locale/kk_KZ/LC_TIME | 58 + locale/locale/ko_KR.CP949/LC_COLLATE | 1 + locale/locale/ko_KR.CP949/LC_CTYPE | Bin 0 -> 134508 bytes .../ko_KR.CP949/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/ko_KR.CP949/LC_MONETARY | 1 + locale/locale/ko_KR.CP949/LC_NUMERIC | 1 + locale/locale/ko_KR.CP949/LC_TIME | 1 + locale/locale/ko_KR.UTF-8/LC_COLLATE | 1 + locale/locale/ko_KR.UTF-8/LC_CTYPE | 1 + .../ko_KR.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/ko_KR.UTF-8/LC_MONETARY | 15 + locale/locale/ko_KR.UTF-8/LC_NUMERIC | 1 + locale/locale/ko_KR.UTF-8/LC_TIME | 58 + locale/locale/ko_KR.eucKR/LC_COLLATE | 1 + locale/locale/ko_KR.eucKR/LC_CTYPE | Bin 0 -> 99027 bytes .../ko_KR.eucKR/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/ko_KR.eucKR/LC_MONETARY | 15 + locale/locale/ko_KR.eucKR/LC_NUMERIC | 3 + locale/locale/ko_KR.eucKR/LC_TIME | 58 + locale/locale/ko_KR/LC_COLLATE | 1 + locale/locale/ko_KR/LC_CTYPE | 1 + locale/locale/ko_KR/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/ko_KR/LC_MONETARY | 15 + locale/locale/ko_KR/LC_NUMERIC | 1 + locale/locale/ko_KR/LC_TIME | 58 + locale/locale/la_LN.ISO8859-1/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/la_LN.ISO8859-1/LC_CTYPE | Bin 0 -> 3204 bytes locale/locale/la_LN.ISO8859-1/LC_TIME | 58 + locale/locale/la_LN.ISO8859-15/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/la_LN.ISO8859-15/LC_CTYPE | Bin 0 -> 3205 bytes locale/locale/la_LN.ISO8859-15/LC_TIME | 1 + locale/locale/la_LN.ISO8859-2/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/la_LN.ISO8859-2/LC_CTYPE | Bin 0 -> 3204 bytes locale/locale/la_LN.ISO8859-2/LC_TIME | 1 + locale/locale/la_LN.ISO8859-4/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/la_LN.ISO8859-4/LC_CTYPE | Bin 0 -> 3204 bytes locale/locale/la_LN.ISO8859-4/LC_TIME | 1 + locale/locale/la_LN.US-ASCII/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/la_LN.US-ASCII/LC_CTYPE | Bin 0 -> 3199 bytes locale/locale/la_LN.US-ASCII/LC_TIME | 1 + locale/locale/locale.alias | 80 + locale/locale/lt_LT.ISO8859-13/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/lt_LT.ISO8859-13/LC_CTYPE | Bin 0 -> 3205 bytes .../lt_LT.ISO8859-13/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/lt_LT.ISO8859-13/LC_MONETARY | 15 + locale/locale/lt_LT.ISO8859-13/LC_NUMERIC | 3 + locale/locale/lt_LT.ISO8859-13/LC_TIME | 58 + locale/locale/lt_LT.ISO8859-4/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/lt_LT.ISO8859-4/LC_CTYPE | 1 + .../lt_LT.ISO8859-4/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/lt_LT.ISO8859-4/LC_MONETARY | 1 + locale/locale/lt_LT.ISO8859-4/LC_NUMERIC | 1 + locale/locale/lt_LT.ISO8859-4/LC_TIME | 58 + locale/locale/lt_LT.UTF-8/LC_COLLATE | 1 + locale/locale/lt_LT.UTF-8/LC_CTYPE | 1 + .../lt_LT.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/lt_LT.UTF-8/LC_MONETARY | 1 + locale/locale/lt_LT.UTF-8/LC_NUMERIC | 1 + locale/locale/lt_LT.UTF-8/LC_TIME | 58 + locale/locale/lt_LT/LC_COLLATE | 1 + locale/locale/lt_LT/LC_CTYPE | 1 + locale/locale/lt_LT/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/lt_LT/LC_MONETARY | 1 + locale/locale/lt_LT/LC_NUMERIC | 1 + locale/locale/lt_LT/LC_TIME | 58 + locale/locale/nb/LC_MESSAGES/texinfo.mo | Bin 0 -> 73021 bytes locale/locale/nl/LC_MESSAGES/texinfo.mo | Bin 0 -> 25421 bytes locale/locale/nl_BE.ISO8859-1/LC_COLLATE | 1 + locale/locale/nl_BE.ISO8859-1/LC_CTYPE | 1 + .../nl_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/nl_BE.ISO8859-1/LC_MONETARY | 15 + locale/locale/nl_BE.ISO8859-1/LC_NUMERIC | 1 + locale/locale/nl_BE.ISO8859-1/LC_TIME | 1 + locale/locale/nl_BE.ISO8859-15/LC_COLLATE | 1 + locale/locale/nl_BE.ISO8859-15/LC_CTYPE | 1 + .../nl_BE.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/nl_BE.ISO8859-15/LC_MONETARY | 1 + locale/locale/nl_BE.ISO8859-15/LC_NUMERIC | 1 + locale/locale/nl_BE.ISO8859-15/LC_TIME | 1 + locale/locale/nl_BE.UTF-8/LC_COLLATE | 1 + locale/locale/nl_BE.UTF-8/LC_CTYPE | 1 + .../nl_BE.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/nl_BE.UTF-8/LC_MONETARY | 1 + locale/locale/nl_BE.UTF-8/LC_NUMERIC | 1 + locale/locale/nl_BE.UTF-8/LC_TIME | 1 + locale/locale/nl_BE/LC_COLLATE | 1 + locale/locale/nl_BE/LC_CTYPE | 1 + locale/locale/nl_BE/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/nl_BE/LC_MONETARY | 1 + locale/locale/nl_BE/LC_NUMERIC | 1 + locale/locale/nl_BE/LC_TIME | 1 + locale/locale/nl_NL.ISO8859-1/LC_COLLATE | 1 + locale/locale/nl_NL.ISO8859-1/LC_CTYPE | 1 + .../nl_NL.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/nl_NL.ISO8859-1/LC_MONETARY | 15 + locale/locale/nl_NL.ISO8859-1/LC_NUMERIC | 3 + locale/locale/nl_NL.ISO8859-1/LC_TIME | 58 + locale/locale/nl_NL.ISO8859-15/LC_COLLATE | 1 + locale/locale/nl_NL.ISO8859-15/LC_CTYPE | 1 + .../nl_NL.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/nl_NL.ISO8859-15/LC_MONETARY | 1 + locale/locale/nl_NL.ISO8859-15/LC_NUMERIC | 1 + locale/locale/nl_NL.ISO8859-15/LC_TIME | 1 + locale/locale/nl_NL.UTF-8/LC_COLLATE | 1 + locale/locale/nl_NL.UTF-8/LC_CTYPE | 1 + .../nl_NL.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/nl_NL.UTF-8/LC_MONETARY | 1 + locale/locale/nl_NL.UTF-8/LC_NUMERIC | 1 + locale/locale/nl_NL.UTF-8/LC_TIME | 1 + locale/locale/nl_NL/LC_COLLATE | 1 + locale/locale/nl_NL/LC_CTYPE | 1 + locale/locale/nl_NL/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/nl_NL/LC_MONETARY | 1 + locale/locale/nl_NL/LC_NUMERIC | 1 + locale/locale/nl_NL/LC_TIME | 1 + locale/locale/no/LC_MESSAGES/texinfo.mo | Bin 0 -> 63334 bytes locale/locale/no_NO.ISO8859-1/LC_COLLATE | 1 + locale/locale/no_NO.ISO8859-1/LC_CTYPE | 1 + .../no_NO.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/no_NO.ISO8859-1/LC_MONETARY | 15 + locale/locale/no_NO.ISO8859-1/LC_NUMERIC | 3 + locale/locale/no_NO.ISO8859-1/LC_TIME | 58 + locale/locale/no_NO.ISO8859-15/LC_COLLATE | 1 + locale/locale/no_NO.ISO8859-15/LC_CTYPE | 1 + .../no_NO.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/no_NO.ISO8859-15/LC_MONETARY | 1 + locale/locale/no_NO.ISO8859-15/LC_NUMERIC | 1 + locale/locale/no_NO.ISO8859-15/LC_TIME | 1 + locale/locale/no_NO.UTF-8/LC_COLLATE | 1 + locale/locale/no_NO.UTF-8/LC_CTYPE | 1 + .../no_NO.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/no_NO.UTF-8/LC_MONETARY | 1 + locale/locale/no_NO.UTF-8/LC_NUMERIC | 1 + locale/locale/no_NO.UTF-8/LC_TIME | 58 + locale/locale/no_NO/LC_COLLATE | 1 + locale/locale/no_NO/LC_CTYPE | 1 + locale/locale/no_NO/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/no_NO/LC_MONETARY | 1 + locale/locale/no_NO/LC_NUMERIC | 1 + locale/locale/no_NO/LC_TIME | 58 + locale/locale/pl/LC_MESSAGES/texinfo.mo | Bin 0 -> 75698 bytes locale/locale/pl_PL.ISO8859-2/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/pl_PL.ISO8859-2/LC_CTYPE | 1 + .../pl_PL.ISO8859-2/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/pl_PL.ISO8859-2/LC_MONETARY | 15 + locale/locale/pl_PL.ISO8859-2/LC_NUMERIC | 3 + locale/locale/pl_PL.ISO8859-2/LC_TIME | 58 + locale/locale/pl_PL.UTF-8/LC_COLLATE | 1 + locale/locale/pl_PL.UTF-8/LC_CTYPE | 1 + .../pl_PL.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/pl_PL.UTF-8/LC_MONETARY | 15 + locale/locale/pl_PL.UTF-8/LC_NUMERIC | 1 + locale/locale/pl_PL.UTF-8/LC_TIME | 58 + locale/locale/pl_PL/LC_COLLATE | 1 + locale/locale/pl_PL/LC_CTYPE | 1 + locale/locale/pl_PL/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/pl_PL/LC_MONETARY | 15 + locale/locale/pl_PL/LC_NUMERIC | 1 + locale/locale/pl_PL/LC_TIME | 58 + locale/locale/pt_BR.ISO8859-1/LC_COLLATE | 1 + locale/locale/pt_BR.ISO8859-1/LC_CTYPE | 1 + .../pt_BR.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/pt_BR.ISO8859-1/LC_MONETARY | 15 + locale/locale/pt_BR.ISO8859-1/LC_NUMERIC | 3 + locale/locale/pt_BR.ISO8859-1/LC_TIME | 58 + locale/locale/pt_BR.UTF-8/LC_COLLATE | 1 + locale/locale/pt_BR.UTF-8/LC_CTYPE | 1 + .../pt_BR.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/pt_BR.UTF-8/LC_MONETARY | 1 + locale/locale/pt_BR.UTF-8/LC_NUMERIC | 1 + locale/locale/pt_BR.UTF-8/LC_TIME | 58 + locale/locale/pt_BR/LC_COLLATE | 1 + locale/locale/pt_BR/LC_CTYPE | 1 + locale/locale/pt_BR/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/pt_BR/LC_MONETARY | 1 + locale/locale/pt_BR/LC_NUMERIC | 1 + locale/locale/pt_BR/LC_TIME | 58 + locale/locale/pt_PT.ISO8859-1/LC_COLLATE | 1 + locale/locale/pt_PT.ISO8859-1/LC_CTYPE | 1 + .../pt_PT.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/pt_PT.ISO8859-1/LC_MONETARY | 15 + locale/locale/pt_PT.ISO8859-1/LC_NUMERIC | 3 + locale/locale/pt_PT.ISO8859-1/LC_TIME | 58 + locale/locale/pt_PT.ISO8859-15/LC_COLLATE | 1 + locale/locale/pt_PT.ISO8859-15/LC_CTYPE | 1 + .../pt_PT.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/pt_PT.ISO8859-15/LC_MONETARY | 1 + locale/locale/pt_PT.ISO8859-15/LC_NUMERIC | 1 + locale/locale/pt_PT.ISO8859-15/LC_TIME | 1 + locale/locale/pt_PT.UTF-8/LC_COLLATE | 1 + locale/locale/pt_PT.UTF-8/LC_CTYPE | 1 + .../pt_PT.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/pt_PT.UTF-8/LC_MONETARY | 1 + locale/locale/pt_PT.UTF-8/LC_NUMERIC | 1 + locale/locale/pt_PT.UTF-8/LC_TIME | 58 + locale/locale/pt_PT/LC_COLLATE | 1 + locale/locale/pt_PT/LC_CTYPE | 1 + locale/locale/pt_PT/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/pt_PT/LC_MONETARY | 1 + locale/locale/pt_PT/LC_NUMERIC | 1 + locale/locale/pt_PT/LC_TIME | 58 + locale/locale/ro/LC_MESSAGES/texinfo.mo | Bin 0 -> 75177 bytes locale/locale/ro_RO.ISO8859-2/LC_COLLATE | 1 + locale/locale/ro_RO.ISO8859-2/LC_CTYPE | 1 + .../ro_RO.ISO8859-2/LC_MESSAGES/LC_MESSAGES | 3 + locale/locale/ro_RO.ISO8859-2/LC_MONETARY | 15 + locale/locale/ro_RO.ISO8859-2/LC_NUMERIC | 3 + locale/locale/ro_RO.ISO8859-2/LC_TIME | 58 + locale/locale/ro_RO.UTF-8/LC_COLLATE | 1 + locale/locale/ro_RO.UTF-8/LC_CTYPE | 1 + .../ro_RO.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/ro_RO.UTF-8/LC_MONETARY | 1 + locale/locale/ro_RO.UTF-8/LC_NUMERIC | 1 + locale/locale/ro_RO.UTF-8/LC_TIME | 58 + locale/locale/ro_RO/LC_COLLATE | 1 + locale/locale/ro_RO/LC_CTYPE | 1 + locale/locale/ro_RO/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/ro_RO/LC_MONETARY | 1 + locale/locale/ro_RO/LC_NUMERIC | 1 + locale/locale/ro_RO/LC_TIME | 58 + locale/locale/ru/LC_MESSAGES/texinfo.mo | Bin 0 -> 75348 bytes locale/locale/ru_RU.CP1251/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/ru_RU.CP1251/LC_CTYPE | 1 + .../ru_RU.CP1251/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/ru_RU.CP1251/LC_MONETARY | 15 + locale/locale/ru_RU.CP1251/LC_NUMERIC | 1 + locale/locale/ru_RU.CP1251/LC_TIME | 58 + locale/locale/ru_RU.CP866/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/ru_RU.CP866/LC_CTYPE | Bin 0 -> 3233 bytes .../ru_RU.CP866/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/ru_RU.CP866/LC_MONETARY | 15 + locale/locale/ru_RU.CP866/LC_NUMERIC | 1 + locale/locale/ru_RU.CP866/LC_TIME | 58 + locale/locale/ru_RU.ISO8859-5/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/ru_RU.ISO8859-5/LC_CTYPE | Bin 0 -> 3231 bytes .../ru_RU.ISO8859-5/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/ru_RU.ISO8859-5/LC_MONETARY | 15 + locale/locale/ru_RU.ISO8859-5/LC_NUMERIC | 1 + locale/locale/ru_RU.ISO8859-5/LC_TIME | 58 + locale/locale/ru_RU.KOI8-R/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/ru_RU.KOI8-R/LC_CTYPE | Bin 0 -> 3223 bytes .../ru_RU.KOI8-R/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/ru_RU.KOI8-R/LC_MONETARY | 15 + locale/locale/ru_RU.KOI8-R/LC_NUMERIC | 3 + locale/locale/ru_RU.KOI8-R/LC_TIME | 58 + locale/locale/ru_RU.UTF-8/LC_COLLATE | 1 + locale/locale/ru_RU.UTF-8/LC_CTYPE | 1 + .../ru_RU.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/ru_RU.UTF-8/LC_MONETARY | 15 + locale/locale/ru_RU.UTF-8/LC_NUMERIC | 1 + locale/locale/ru_RU.UTF-8/LC_TIME | 58 + locale/locale/ru_RU/LC_COLLATE | 1 + locale/locale/ru_RU/LC_CTYPE | 1 + locale/locale/ru_RU/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/ru_RU/LC_MONETARY | 15 + locale/locale/ru_RU/LC_NUMERIC | 1 + locale/locale/ru_RU/LC_TIME | 58 + locale/locale/sk_SK.ISO8859-2/LC_COLLATE | 1 + locale/locale/sk_SK.ISO8859-2/LC_CTYPE | 1 + .../sk_SK.ISO8859-2/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/sk_SK.ISO8859-2/LC_MONETARY | 15 + locale/locale/sk_SK.ISO8859-2/LC_NUMERIC | 3 + locale/locale/sk_SK.ISO8859-2/LC_TIME | 58 + locale/locale/sk_SK.UTF-8/LC_COLLATE | 1 + locale/locale/sk_SK.UTF-8/LC_CTYPE | 1 + .../sk_SK.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/sk_SK.UTF-8/LC_MONETARY | 1 + locale/locale/sk_SK.UTF-8/LC_NUMERIC | 1 + locale/locale/sk_SK.UTF-8/LC_TIME | 58 + locale/locale/sk_SK/LC_COLLATE | 1 + locale/locale/sk_SK/LC_CTYPE | 1 + locale/locale/sk_SK/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/sk_SK/LC_MONETARY | 1 + locale/locale/sk_SK/LC_NUMERIC | 1 + locale/locale/sk_SK/LC_TIME | 58 + locale/locale/sl_SI.ISO8859-2/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/sl_SI.ISO8859-2/LC_CTYPE | 1 + .../sl_SI.ISO8859-2/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/sl_SI.ISO8859-2/LC_MONETARY | 15 + locale/locale/sl_SI.ISO8859-2/LC_NUMERIC | 3 + locale/locale/sl_SI.ISO8859-2/LC_TIME | 58 + locale/locale/sl_SI.UTF-8/LC_COLLATE | 1 + locale/locale/sl_SI.UTF-8/LC_CTYPE | 1 + .../sl_SI.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/sl_SI.UTF-8/LC_MONETARY | 1 + locale/locale/sl_SI.UTF-8/LC_NUMERIC | 1 + locale/locale/sl_SI.UTF-8/LC_TIME | 58 + locale/locale/sl_SI/LC_COLLATE | 1 + locale/locale/sl_SI/LC_CTYPE | 1 + locale/locale/sl_SI/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/sl_SI/LC_MONETARY | 1 + locale/locale/sl_SI/LC_NUMERIC | 1 + locale/locale/sl_SI/LC_TIME | 58 + locale/locale/sr_YU.ISO8859-2/LC_COLLATE | 1 + locale/locale/sr_YU.ISO8859-2/LC_CTYPE | 1 + .../sr_YU.ISO8859-2/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/sr_YU.ISO8859-2/LC_MONETARY | 15 + locale/locale/sr_YU.ISO8859-2/LC_NUMERIC | 3 + locale/locale/sr_YU.ISO8859-2/LC_TIME | 58 + locale/locale/sr_YU.ISO8859-5/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/sr_YU.ISO8859-5/LC_CTYPE | 1 + .../sr_YU.ISO8859-5/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/sr_YU.ISO8859-5/LC_MONETARY | 15 + locale/locale/sr_YU.ISO8859-5/LC_NUMERIC | 3 + locale/locale/sr_YU.ISO8859-5/LC_TIME | 58 + locale/locale/sr_YU.UTF-8/LC_COLLATE | 1 + locale/locale/sr_YU.UTF-8/LC_CTYPE | 1 + .../sr_YU.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/sr_YU.UTF-8/LC_MONETARY | 1 + locale/locale/sr_YU.UTF-8/LC_NUMERIC | 1 + locale/locale/sr_YU.UTF-8/LC_TIME | 58 + locale/locale/sr_YU/LC_COLLATE | 1 + locale/locale/sr_YU/LC_CTYPE | 1 + locale/locale/sr_YU/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/sr_YU/LC_MONETARY | 1 + locale/locale/sr_YU/LC_NUMERIC | 1 + locale/locale/sr_YU/LC_TIME | 58 + locale/locale/sv/LC_MESSAGES/texinfo.mo | Bin 0 -> 73730 bytes locale/locale/sv_SE.ISO8859-1/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/sv_SE.ISO8859-1/LC_CTYPE | 1 + .../sv_SE.ISO8859-1/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/sv_SE.ISO8859-1/LC_MONETARY | 15 + locale/locale/sv_SE.ISO8859-1/LC_NUMERIC | 3 + locale/locale/sv_SE.ISO8859-1/LC_TIME | 58 + locale/locale/sv_SE.ISO8859-15/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/sv_SE.ISO8859-15/LC_CTYPE | 1 + .../sv_SE.ISO8859-15/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/sv_SE.ISO8859-15/LC_MONETARY | 1 + locale/locale/sv_SE.ISO8859-15/LC_NUMERIC | 1 + locale/locale/sv_SE.ISO8859-15/LC_TIME | 1 + locale/locale/sv_SE.UTF-8/LC_COLLATE | 1 + locale/locale/sv_SE.UTF-8/LC_CTYPE | 1 + .../sv_SE.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/sv_SE.UTF-8/LC_MONETARY | 1 + locale/locale/sv_SE.UTF-8/LC_NUMERIC | 1 + locale/locale/sv_SE.UTF-8/LC_TIME | 58 + locale/locale/sv_SE/LC_COLLATE | 1 + locale/locale/sv_SE/LC_CTYPE | 1 + locale/locale/sv_SE/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/sv_SE/LC_MONETARY | 1 + locale/locale/sv_SE/LC_NUMERIC | 1 + locale/locale/sv_SE/LC_TIME | 58 + locale/locale/tr/LC_MESSAGES/texinfo.mo | Bin 0 -> 73295 bytes locale/locale/tr_TR.ISO8859-9/LC_COLLATE | 1 + locale/locale/tr_TR.ISO8859-9/LC_CTYPE | 1 + .../tr_TR.ISO8859-9/LC_MESSAGES/LC_MESSAGES | 2 + locale/locale/tr_TR.ISO8859-9/LC_MONETARY | 15 + locale/locale/tr_TR.ISO8859-9/LC_NUMERIC | 3 + locale/locale/tr_TR.ISO8859-9/LC_TIME | 58 + locale/locale/tr_TR.UTF-8/LC_COLLATE | 1 + locale/locale/tr_TR.UTF-8/LC_CTYPE | 1 + .../tr_TR.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/tr_TR.UTF-8/LC_MONETARY | 1 + locale/locale/tr_TR.UTF-8/LC_NUMERIC | 1 + locale/locale/tr_TR.UTF-8/LC_TIME | 58 + locale/locale/tr_TR/LC_COLLATE | 1 + locale/locale/tr_TR/LC_CTYPE | 1 + locale/locale/tr_TR/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/tr_TR/LC_MONETARY | 1 + locale/locale/tr_TR/LC_NUMERIC | 1 + locale/locale/tr_TR/LC_TIME | 58 + locale/locale/uk_UA.ISO8859-5/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/uk_UA.ISO8859-5/LC_CTYPE | 1 + .../uk_UA.ISO8859-5/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/uk_UA.ISO8859-5/LC_MONETARY | 15 + locale/locale/uk_UA.ISO8859-5/LC_NUMERIC | 1 + locale/locale/uk_UA.ISO8859-5/LC_TIME | 58 + locale/locale/uk_UA.KOI8-U/LC_COLLATE | Bin 0 -> 2086 bytes locale/locale/uk_UA.KOI8-U/LC_CTYPE | Bin 0 -> 3202 bytes .../uk_UA.KOI8-U/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/uk_UA.KOI8-U/LC_MONETARY | 15 + locale/locale/uk_UA.KOI8-U/LC_NUMERIC | 3 + locale/locale/uk_UA.KOI8-U/LC_TIME | 58 + locale/locale/uk_UA.UTF-8/LC_COLLATE | 1 + locale/locale/uk_UA.UTF-8/LC_CTYPE | 1 + .../uk_UA.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/uk_UA.UTF-8/LC_MONETARY | 15 + locale/locale/uk_UA.UTF-8/LC_NUMERIC | 1 + locale/locale/uk_UA.UTF-8/LC_TIME | 58 + locale/locale/uk_UA/LC_COLLATE | 1 + locale/locale/uk_UA/LC_CTYPE | 1 + locale/locale/uk_UA/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/uk_UA/LC_MONETARY | 15 + locale/locale/uk_UA/LC_NUMERIC | 1 + locale/locale/uk_UA/LC_TIME | 58 + locale/locale/zh_CN.GB18030/LC_COLLATE | 1 + locale/locale/zh_CN.GB18030/LC_CTYPE | Bin 0 -> 98220 bytes .../zh_CN.GB18030/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/zh_CN.GB18030/LC_MONETARY | 15 + locale/locale/zh_CN.GB18030/LC_NUMERIC | 1 + locale/locale/zh_CN.GB18030/LC_TIME | 58 + locale/locale/zh_CN.GB2312/LC_COLLATE | 1 + locale/locale/zh_CN.GB2312/LC_CTYPE | Bin 0 -> 8604 bytes .../zh_CN.GB2312/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/zh_CN.GB2312/LC_MONETARY | 15 + locale/locale/zh_CN.GB2312/LC_NUMERIC | 1 + locale/locale/zh_CN.GB2312/LC_TIME | 58 + locale/locale/zh_CN.GBK/LC_COLLATE | 1 + locale/locale/zh_CN.GBK/LC_CTYPE | Bin 0 -> 8844 bytes .../locale/zh_CN.GBK/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/zh_CN.GBK/LC_MONETARY | 1 + locale/locale/zh_CN.GBK/LC_NUMERIC | 1 + locale/locale/zh_CN.GBK/LC_TIME | 1 + locale/locale/zh_CN.UTF-8/LC_COLLATE | 1 + locale/locale/zh_CN.UTF-8/LC_CTYPE | 1 + .../zh_CN.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/zh_CN.UTF-8/LC_MONETARY | 15 + locale/locale/zh_CN.UTF-8/LC_NUMERIC | 1 + locale/locale/zh_CN.UTF-8/LC_TIME | 58 + locale/locale/zh_CN.eucCN/LC_COLLATE | 1 + locale/locale/zh_CN.eucCN/LC_CTYPE | Bin 0 -> 5795 bytes .../zh_CN.eucCN/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/zh_CN.eucCN/LC_MONETARY | 15 + locale/locale/zh_CN.eucCN/LC_NUMERIC | 3 + locale/locale/zh_CN.eucCN/LC_TIME | 58 + locale/locale/zh_CN/LC_COLLATE | 1 + locale/locale/zh_CN/LC_CTYPE | 1 + locale/locale/zh_CN/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/zh_CN/LC_MESSAGES/texinfo.mo | Bin 0 -> 50487 bytes locale/locale/zh_CN/LC_MONETARY | 15 + locale/locale/zh_CN/LC_NUMERIC | 1 + locale/locale/zh_CN/LC_TIME | 58 + locale/locale/zh_HK.Big5HKSCS/LC_COLLATE | 1 + locale/locale/zh_HK.Big5HKSCS/LC_CTYPE | Bin 0 -> 11712 bytes .../zh_HK.Big5HKSCS/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/zh_HK.Big5HKSCS/LC_MONETARY | 1 + locale/locale/zh_HK.Big5HKSCS/LC_NUMERIC | 1 + locale/locale/zh_HK.Big5HKSCS/LC_TIME | 1 + locale/locale/zh_HK.UTF-8/LC_COLLATE | 1 + locale/locale/zh_HK.UTF-8/LC_CTYPE | 1 + .../zh_HK.UTF-8/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/zh_HK.UTF-8/LC_MONETARY | 15 + locale/locale/zh_HK.UTF-8/LC_NUMERIC | 1 + locale/locale/zh_HK.UTF-8/LC_TIME | 1 + locale/locale/zh_HK/LC_COLLATE | 1 + locale/locale/zh_HK/LC_CTYPE | 1 + locale/locale/zh_HK/LC_MESSAGES/LC_MESSAGES | 1 + locale/locale/zh_HK/LC_MONETARY | 15 + locale/locale/zh_HK/LC_NUMERIC | 1 + locale/locale/zh_HK/LC_TIME | 1 + locale/locale/zh_TW.Big5/LC_COLLATE | 1 + locale/locale/zh_TW.Big5/LC_CTYPE | Bin 0 -> 8980 bytes .../locale/zh_TW.Big5/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/zh_TW.Big5/LC_MONETARY | 15 + locale/locale/zh_TW.Big5/LC_NUMERIC | 1 + locale/locale/zh_TW.Big5/LC_TIME | 58 + locale/locale/zh_TW.UTF-8/LC_COLLATE | 1 + locale/locale/zh_TW.UTF-8/LC_CTYPE | 1 + .../zh_TW.UTF-8/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/zh_TW.UTF-8/LC_MONETARY | 1 + locale/locale/zh_TW.UTF-8/LC_NUMERIC | 1 + locale/locale/zh_TW.UTF-8/LC_TIME | 58 + locale/locale/zh_TW/LC_COLLATE | 1 + locale/locale/zh_TW/LC_CTYPE | 1 + locale/locale/zh_TW/LC_MESSAGES/LC_MESSAGES | 4 + locale/locale/zh_TW/LC_MESSAGES/texinfo.mo | Bin 0 -> 31062 bytes locale/locale/zh_TW/LC_MONETARY | 1 + locale/locale/zh_TW/LC_NUMERIC | 1 + locale/locale/zh_TW/LC_TIME | 58 + locale/mbrune.3 | 176 + locale/mbrune.c | 133 + locale/newlocale.3 | 88 + locale/querylocale.3 | 31 + locale/rune.3 | 286 + locale/runedepreciated.c | 114 + locale/runedepreciated.h | 33 + locale/setinvalidrune.c | 67 + locale/uselocale.3 | 31 + locale/utf2.5 | 94 + locale/wcstod_l.3 | 66 + locale/wcstol_l.3 | 112 + locale/xlocale.3 | 250 + locale/xlocale.c | 498 + locale/xlocale_private.h | 233 + man/FreeBSD/environ.7 | 291 + man/FreeBSD/stdarg.3 | 245 + man/assert.3 | 96 + man/bitstring.3 | 191 + man/gethostuuid.2 | 55 + man/manpages.lst | 372 + man/style.3 | 1482 ++ man/utmp.5 | 234 + nbsdcompat/_nbsd_compat_.h | 29 + nbsdcompat/namespace.h | 25 + net/CMakeLists.txt | 49 + net/FreeBSD/addr2ascii.3 | 232 + net/FreeBSD/addr2ascii.c | 101 + net/FreeBSD/ascii2addr.c | 75 + net/FreeBSD/inet.3 | 318 + net/FreeBSD/inet_addr.c | 233 + net/FreeBSD/inet_lnaof.c | 70 + net/FreeBSD/inet_makeaddr.c | 73 + net/FreeBSD/inet_net.3 | 167 + net/FreeBSD/inet_net_ntop.c | 288 + net/FreeBSD/inet_net_pton.c | 420 + net/FreeBSD/inet_neta.c | 98 + net/FreeBSD/inet_netof.c | 69 + net/FreeBSD/inet_network.c | 119 + net/FreeBSD/inet_ntoa.c | 80 + net/FreeBSD/linkaddr.3 | 134 + net/FreeBSD/linkaddr.c | 168 + net/FreeBSD/nsap_addr.c | 132 + net/FreeBSD/recv.c | 60 + net/FreeBSD/send.c | 60 + net/FreeBSD/sockatmark.3 | 123 + net/FreeBSD/sockatmark.c | 36 + net/FreeBSD/sourcefilter.3 | 238 + net/FreeBSD/sourcefilter.c | 410 + net/byteorder.3 | 85 + net/ethers.3 | 197 + net/inet_ntop.c | 209 + net/inet_pton.c | 292 + nls/CMakeLists.txt | 11 + nls/FreeBSD/catclose.3 | 64 + nls/FreeBSD/catgets.3 | 82 + nls/FreeBSD/catopen.3 | 157 + nls/FreeBSD/msgcat.c | 478 + nls/FreeBSD/msgcat.h | 152 + os/CMakeLists.txt | 8 + os/api.h | 109 + os/assumes.c | 408 + os/assumes.h | 559 + os/debug_private.c | 304 + os/debug_private.h | 79 + os/linker_set.h | 252 + os/variant_private.h | 250 + posix1e/CMakeLists.txt | 14 + posix1e/acl.3 | 215 + posix1e/acl.c | 122 + posix1e/acl_add_flag_np.3 | 79 + posix1e/acl_add_perm.3 | 80 + posix1e/acl_clear_flags_np.3 | 67 + posix1e/acl_clear_perms.3 | 70 + posix1e/acl_copy_entry.3 | 76 + posix1e/acl_copy_ext.3 | 174 + posix1e/acl_create_entry.3 | 109 + posix1e/acl_delete.3 | 114 + posix1e/acl_delete_entry.3 | 73 + posix1e/acl_delete_flag_np.3 | 75 + posix1e/acl_delete_perm.3 | 83 + posix1e/acl_dup.3 | 94 + posix1e/acl_entry.c | 219 + posix1e/acl_file.c | 187 + posix1e/acl_flag.c | 123 + posix1e/acl_free.3 | 75 + posix1e/acl_from_text.3 | 95 + posix1e/acl_get.3 | 140 + posix1e/acl_get_entry.3 | 137 + posix1e/acl_get_fd.3 | 141 + posix1e/acl_get_flagset_np.3 | 71 + posix1e/acl_get_perm_np.3 | 85 + posix1e/acl_get_permset.3 | 74 + posix1e/acl_get_permset_mask_np.3 | 93 + posix1e/acl_get_qualifier.3 | 121 + posix1e/acl_get_tag_type.3 | 76 + posix1e/acl_init.3 | 93 + posix1e/acl_perm.c | 168 + posix1e/acl_set.3 | 134 + posix1e/acl_set_flagset_np.3 | 72 + posix1e/acl_set_permset.3 | 72 + posix1e/acl_set_qualifier.3 | 93 + posix1e/acl_set_tag_type.3 | 71 + posix1e/acl_to_text.3 | 103 + posix1e/acl_translate.c | 723 + posix1e/acl_valid.3 | 132 + posix1e/aclvar.h | 161 + private-include/_ctype.h | 452 + private-include/dirent.h | 253 + private-include/fnmatch.h | 90 + private-include/fts.h | 241 + private-include/ftw.h | 78 + private-include/glob.h | 148 + private-include/regex.h | 225 + private-include/signal.h | 185 + private-include/stdio.h | 484 + private-include/stdlib.h | 467 + private-include/string.h | 207 + private-include/sys/rbtree.h | 113 + private-include/time.h | 266 + private-include/unistd.h | 992 + private-include/wchar.h | 262 + private-include/wctype.h | 143 + private-include/xlocale.h | 117 + private-include/xlocale/_ctype.h | 255 + private-include/xlocale/_time.h | 61 + private-include/xlocale/_wchar.h | 155 + regex/CMakeLists.txt | 33 + regex/FreeBSD/COPYRIGHT | 56 + regex/FreeBSD/WHATSNEW | 94 + regex/FreeBSD/cname.h | 140 + regex/FreeBSD/re_format.7 | 826 + regex/FreeBSD/regerror.c | 174 + regex/FreeBSD/regex.3 | 943 + regex/FreeBSD/utils.h | 54 + regex/TRE/config.h | 262 + regex/TRE/lib/regcomp.c | 203 + regex/TRE/lib/regexec.c | 563 + regex/TRE/lib/tre-ast.c | 226 + regex/TRE/lib/tre-ast.h | 141 + regex/TRE/lib/tre-compile.c | 3482 ++++ regex/TRE/lib/tre-compile.h | 27 + regex/TRE/lib/tre-internal.h | 356 + regex/TRE/lib/tre-match-backtrack.c | 789 + regex/TRE/lib/tre-match-parallel.c | 631 + regex/TRE/lib/tre-match-utils.h | 631 + regex/TRE/lib/tre-mem.c | 155 + regex/TRE/lib/tre-mem.h | 68 + regex/TRE/lib/tre-parse.c | 2336 +++ regex/TRE/lib/tre-parse.h | 62 + regex/TRE/lib/tre-stack.c | 125 + regex/TRE/lib/tre-stack.h | 77 + regex/TRE/lib/tre.h | 328 + regex/TRE/lib/xmalloc.h | 77 + regex/TRE/tre-0.8.0.tar.bz2 | Bin 0 -> 380714 bytes regex/TRE/tre-config.h | 44 + regex/TRE/tre-last-matched.h | 109 + secure/CMakeLists.txt | 31 + secure/chk_fail.c | 111 + secure/memccpy_chk.c | 48 + secure/memcpy_chk.c | 41 + secure/memmove_chk.c | 35 + secure/memset_chk.c | 35 + secure/secure.h | 39 + secure/snprintf_chk.c | 66 + secure/sprintf_chk.c | 72 + secure/stpcpy_chk.c | 41 + secure/stpncpy_chk.c | 49 + secure/strcat_chk.c | 44 + secure/strcpy_chk.c | 41 + secure/strlcat_chk.c | 55 + secure/strlcpy_chk.c | 44 + secure/strncat_chk.c | 46 + secure/strncpy_chk.c | 48 + secure/vsnprintf_chk.c | 42 + secure/vsprintf_chk.c | 46 + stdio/CMakeLists.txt | 166 + stdio/FreeBSD/_flock_stub.c | 97 + stdio/FreeBSD/asprintf.c | 63 + stdio/FreeBSD/clrerr.c | 61 + stdio/FreeBSD/dprintf.c | 59 + stdio/FreeBSD/fclose.3 | 111 + stdio/FreeBSD/fclose.c | 77 + stdio/FreeBSD/fdopen.c | 107 + stdio/FreeBSD/feof.c | 63 + stdio/FreeBSD/ferror.3 | 131 + stdio/FreeBSD/ferror.c | 63 + stdio/FreeBSD/fflush.3 | 118 + stdio/FreeBSD/fflush.c | 178 + stdio/FreeBSD/fgetc.c | 56 + stdio/FreeBSD/fgetln.3 | 128 + stdio/FreeBSD/fgetln.c | 170 + stdio/FreeBSD/fgetpos.c | 51 + stdio/FreeBSD/fgets.3 | 158 + stdio/FreeBSD/fgets.c | 112 + stdio/FreeBSD/fgetwc.c | 114 + stdio/FreeBSD/fgetwln.3 | 129 + stdio/FreeBSD/fgetwln.c | 73 + stdio/FreeBSD/fgetws.3 | 146 + stdio/FreeBSD/fgetws.c | 113 + stdio/FreeBSD/fileno.c | 64 + stdio/FreeBSD/findfp.c | 298 + stdio/FreeBSD/flags.c | 97 + stdio/FreeBSD/floatio.h | 54 + stdio/FreeBSD/flockfile.3 | 105 + stdio/FreeBSD/fmemopen.c | 262 + stdio/FreeBSD/fopen.3 | 360 + stdio/FreeBSD/fopen.c | 108 + stdio/FreeBSD/fprintf.c | 67 + stdio/FreeBSD/fpurge.c | 70 + stdio/FreeBSD/fputc.c | 57 + stdio/FreeBSD/fputs.3 | 127 + stdio/FreeBSD/fputs.c | 78 + stdio/FreeBSD/fputwc.c | 103 + stdio/FreeBSD/fputws.3 | 110 + stdio/FreeBSD/fputws.c | 84 + stdio/FreeBSD/fread.3 | 107 + stdio/FreeBSD/fread.c | 166 + stdio/FreeBSD/freopen.c | 248 + stdio/FreeBSD/fscanf.c | 75 + stdio/FreeBSD/fseek.3 | 305 + stdio/FreeBSD/fseek.c | 309 + stdio/FreeBSD/fsetpos.c | 51 + stdio/FreeBSD/ftell.c | 141 + stdio/FreeBSD/funopen.3 | 176 + stdio/FreeBSD/funopen.c | 77 + stdio/FreeBSD/fvwrite.c | 207 + stdio/FreeBSD/fvwrite.h | 49 + stdio/FreeBSD/fwalk.c | 67 + stdio/FreeBSD/fwide.3 | 99 + stdio/FreeBSD/fwide.c | 51 + stdio/FreeBSD/fwprintf.c | 61 + stdio/FreeBSD/fwrite.c | 99 + stdio/FreeBSD/fwscanf.c | 61 + stdio/FreeBSD/getc.3 | 170 + stdio/FreeBSD/getc.c | 65 + stdio/FreeBSD/getchar.c | 68 + stdio/FreeBSD/getdelim.c | 168 + stdio/FreeBSD/getline.3 | 136 + stdio/FreeBSD/getline.c | 39 + stdio/FreeBSD/gets.c | 77 + stdio/FreeBSD/getw.c | 48 + stdio/FreeBSD/getwc.3 | 121 + stdio/FreeBSD/getwc.c | 58 + stdio/FreeBSD/getwchar.c | 57 + stdio/FreeBSD/glue.h | 45 + stdio/FreeBSD/local.h | 161 + stdio/FreeBSD/makebuf.c | 241 + stdio/FreeBSD/mktemp.3 | 381 + stdio/FreeBSD/mktemp.c | 335 + stdio/FreeBSD/open_memstream.3 | 155 + stdio/FreeBSD/open_memstream.c | 223 + stdio/FreeBSD/open_wmemstream.c | 274 + stdio/FreeBSD/perror.c | 76 + stdio/FreeBSD/printf-pos.c | 798 + stdio/FreeBSD/printf.3 | 957 + stdio/FreeBSD/printf.c | 67 + stdio/FreeBSD/printfcommon.h | 301 + stdio/FreeBSD/printflocal.h | 123 + stdio/FreeBSD/putc.3 | 181 + stdio/FreeBSD/putc.c | 67 + stdio/FreeBSD/putchar.c | 71 + stdio/FreeBSD/puts.c | 77 + stdio/FreeBSD/putw.c | 62 + stdio/FreeBSD/putwc.3 | 118 + stdio/FreeBSD/putwc.c | 58 + stdio/FreeBSD/putwchar.c | 57 + stdio/FreeBSD/refill.c | 162 + stdio/FreeBSD/remove.3 | 83 + stdio/FreeBSD/remove.c | 55 + stdio/FreeBSD/rewind.c | 60 + stdio/FreeBSD/rget.c | 55 + stdio/FreeBSD/scanf.3 | 540 + stdio/FreeBSD/scanf.c | 75 + stdio/FreeBSD/setbuf.3 | 242 + stdio/FreeBSD/setbuf.c | 46 + stdio/FreeBSD/setbuffer.c | 60 + stdio/FreeBSD/setvbuf.c | 161 + stdio/FreeBSD/snprintf.c | 70 + stdio/FreeBSD/sprintf.c | 68 + stdio/FreeBSD/sscanf.c | 68 + stdio/FreeBSD/stdio.3 | 366 + stdio/FreeBSD/stdio.c | 187 + stdio/FreeBSD/swprintf.c | 62 + stdio/FreeBSD/swscanf.c | 62 + stdio/FreeBSD/tempnam.c | 115 + stdio/FreeBSD/tmpfile.c | 95 + stdio/FreeBSD/tmpnam.3 | 264 + stdio/FreeBSD/tmpnam.c | 75 + stdio/FreeBSD/ungetc.3 | 101 + stdio/FreeBSD/ungetc.c | 168 + stdio/FreeBSD/ungetwc.3 | 118 + stdio/FreeBSD/ungetwc.c | 93 + stdio/FreeBSD/vasprintf.c | 82 + stdio/FreeBSD/vdprintf.c | 82 + stdio/FreeBSD/vfprintf.c | 1461 ++ stdio/FreeBSD/vfscanf.c | 1200 ++ stdio/FreeBSD/vfwprintf.c | 1478 ++ stdio/FreeBSD/vfwscanf.c | 946 + stdio/FreeBSD/vprintf.c | 56 + stdio/FreeBSD/vscanf.c | 73 + stdio/FreeBSD/vsnprintf.c | 98 + stdio/FreeBSD/vsprintf.c | 69 + stdio/FreeBSD/vsscanf.c | 91 + stdio/FreeBSD/vswprintf.c | 108 + stdio/FreeBSD/vswscanf.c | 110 + stdio/FreeBSD/vwprintf.c | 49 + stdio/FreeBSD/vwscanf.c | 49 + stdio/FreeBSD/wbuf.c | 94 + stdio/FreeBSD/wprintf.3 | 637 + stdio/FreeBSD/wprintf.c | 61 + stdio/FreeBSD/wscanf.3 | 509 + stdio/FreeBSD/wscanf.c | 61 + stdio/FreeBSD/wsetup.c | 92 + stdio/FreeBSD/xprintf.c | 1199 ++ stdio/FreeBSD/xprintf_errno.c | 66 + stdio/FreeBSD/xprintf_float.c | 446 + stdio/FreeBSD/xprintf_hexdump.c | 98 + stdio/FreeBSD/xprintf_int.c | 498 + stdio/FreeBSD/xprintf_private.h | 171 + stdio/FreeBSD/xprintf_quote.c | 99 + stdio/FreeBSD/xprintf_str.c | 201 + stdio/FreeBSD/xprintf_time.c | 123 + stdio/FreeBSD/xprintf_vis.c | 79 + stdio/getwc_l.3 | 78 + stdio/printf_l.3 | 182 + stdio/putwc_l.3 | 78 + stdio/scanf_l.3 | 120 + stdio/wprintf_l.3 | 89 + stdio/wscanf_l.3 | 122 + stdio/xprintf.3 | 64 + stdio/xprintf.5 | 533 + stdio/xprintf_all_in_one.c | 129 + stdio/xprintf_comp.3 | 66 + stdio/xprintf_comp.c | 91 + stdio/xprintf_domain.3 | 219 + stdio/xprintf_domain.c | 250 + stdio/xprintf_domain.h | 63 + stdio/xprintf_exec.3 | 57 + stdio/xprintf_exec.c | 181 + stdlib/CMakeLists.txt | 108 + stdlib/FreeBSD/_Exit_.c | 22 + stdlib/FreeBSD/abort.3 | 86 + stdlib/FreeBSD/abort.c | 177 + stdlib/FreeBSD/abs.3 | 73 + stdlib/FreeBSD/abs.c | 43 + stdlib/FreeBSD/alloca.3 | 89 + stdlib/FreeBSD/atexit.3 | 120 + stdlib/FreeBSD/atexit.c | 332 + stdlib/FreeBSD/atexit.h | 44 + stdlib/FreeBSD/atof.3 | 114 + stdlib/FreeBSD/atof.c | 54 + stdlib/FreeBSD/atoi.3 | 110 + stdlib/FreeBSD/atoi.c | 54 + stdlib/FreeBSD/atol.3 | 162 + stdlib/FreeBSD/atol.c | 54 + stdlib/FreeBSD/atoll.c | 51 + stdlib/FreeBSD/bsearch.3 | 114 + stdlib/FreeBSD/bsearch.c | 107 + stdlib/FreeBSD/div.3 | 70 + stdlib/FreeBSD/div.c | 77 + stdlib/FreeBSD/exit.3 | 130 + stdlib/FreeBSD/exit.c | 69 + stdlib/FreeBSD/getenv.3 | 243 + stdlib/FreeBSD/getenv.c | 129 + stdlib/FreeBSD/getopt.3 | 306 + stdlib/FreeBSD/getopt.c | 149 + stdlib/FreeBSD/getopt_long.3 | 507 + stdlib/FreeBSD/getopt_long.c | 625 + stdlib/FreeBSD/getsubopt.3 | 149 + stdlib/FreeBSD/getsubopt.c | 97 + stdlib/FreeBSD/hcreate.3 | 258 + stdlib/FreeBSD/hcreate.c | 185 + stdlib/FreeBSD/heapsort.c | 185 + stdlib/FreeBSD/heapsort_b.c | 181 + stdlib/FreeBSD/heapsort_r.c | 186 + stdlib/FreeBSD/imaxabs.3 | 62 + stdlib/FreeBSD/imaxabs.c | 36 + stdlib/FreeBSD/imaxdiv.3 | 73 + stdlib/FreeBSD/imaxdiv.c | 45 + stdlib/FreeBSD/insque.3 | 61 + stdlib/FreeBSD/insque.c | 47 + stdlib/FreeBSD/labs.3 | 67 + stdlib/FreeBSD/labs.c | 43 + stdlib/FreeBSD/ldiv.3 | 72 + stdlib/FreeBSD/ldiv.c | 56 + stdlib/FreeBSD/llabs.3 | 62 + stdlib/FreeBSD/llabs.c | 36 + stdlib/FreeBSD/lldiv.3 | 73 + stdlib/FreeBSD/lldiv.c | 45 + stdlib/FreeBSD/lsearch.3 | 105 + stdlib/FreeBSD/lsearch.c | 64 + stdlib/FreeBSD/memory.3 | 136 + stdlib/FreeBSD/merge.c | 356 + stdlib/FreeBSD/merge_b.c | 356 + stdlib/FreeBSD/psort.3 | 177 + stdlib/FreeBSD/psort.c | 431 + stdlib/FreeBSD/psort_b.c | 431 + stdlib/FreeBSD/psort_r.c | 431 + stdlib/FreeBSD/putenv.c | 109 + stdlib/FreeBSD/qsort.3 | 364 + stdlib/FreeBSD/qsort.c | 321 + stdlib/FreeBSD/qsort_r.c | 8 + stdlib/FreeBSD/radixsort.3 | 160 + stdlib/FreeBSD/radixsort.c | 352 + stdlib/FreeBSD/rand.3 | 126 + stdlib/FreeBSD/rand.c | 167 + stdlib/FreeBSD/random.3 | 236 + stdlib/FreeBSD/random.c | 511 + stdlib/FreeBSD/reallocf.c | 48 + stdlib/FreeBSD/realpath.3 | 160 + stdlib/FreeBSD/realpath.c | 381 + stdlib/FreeBSD/remque.c | 30 + stdlib/FreeBSD/setenv.c | 529 + stdlib/FreeBSD/strhash.c | 410 + stdlib/FreeBSD/strtod.3 | 216 + stdlib/FreeBSD/strtoimax.c | 150 + stdlib/FreeBSD/strtol.3 | 257 + stdlib/FreeBSD/strtol.c | 150 + stdlib/FreeBSD/strtoll.c | 150 + stdlib/FreeBSD/strtoq.c | 58 + stdlib/FreeBSD/strtoul.3 | 254 + stdlib/FreeBSD/strtoul.c | 128 + stdlib/FreeBSD/strtoull.c | 128 + stdlib/FreeBSD/strtoumax.c | 128 + stdlib/FreeBSD/strtouq.c | 58 + stdlib/FreeBSD/system.3 | 99 + stdlib/FreeBSD/system.c | 163 + stdlib/FreeBSD/tdelete.c | 71 + stdlib/FreeBSD/tfind.c | 48 + stdlib/FreeBSD/tsearch.3 | 181 + stdlib/FreeBSD/tsearch.c | 58 + stdlib/FreeBSD/twalk.c | 58 + stdlib/NetBSD/strfmon.3 | 208 + stdlib/NetBSD/strfmon.c | 659 + stdlib/OpenBSD/ecvt.3 | 165 + stdlib/OpenBSD/ecvt.c | 108 + stdlib/OpenBSD/gcvt.c | 113 + stdlib/a64l.3 | 144 + stdlib/a64l.c | 47 + stdlib/grantpt.3 | 281 + stdlib/grantpt.c | 146 + stdlib/l64a.c | 57 + stdlib/qsort_b.c | 17 + stdlib/strtod_l.3 | 75 + stdlib/strtol_l.3 | 107 + stdtime/CMakeLists.txt | 35 + stdtime/FreeBSD/asctime.c | 141 + stdtime/FreeBSD/ctime.3 | 395 + stdtime/FreeBSD/difftime.c | 73 + stdtime/FreeBSD/ftime.3 | 93 + stdtime/FreeBSD/ftime.c | 54 + stdtime/FreeBSD/localtime.c | 2816 +++ stdtime/FreeBSD/private.h | 327 + stdtime/FreeBSD/strftime.3 | 299 + stdtime/FreeBSD/strftime.c | 663 + stdtime/FreeBSD/strptime.3 | 189 + stdtime/FreeBSD/strptime.c | 820 + stdtime/FreeBSD/time2posix.3 | 123 + stdtime/FreeBSD/time32.c | 100 + stdtime/FreeBSD/timelocal.c | 154 + stdtime/FreeBSD/timelocal.h | 57 + stdtime/FreeBSD/tzfile.5 | 152 + stdtime/FreeBSD/tzfile.h | 200 + stdtime/getdate.3 | 401 + stdtime/getdate.c | 273 + stdtime/timezone_unix03.c | 38 + string/CMakeLists.txt | 99 + string/FreeBSD/bcmp.3 | 78 + string/FreeBSD/bcopy.3 | 83 + string/FreeBSD/bstring.3 | 152 + string/FreeBSD/bzero.3 | 80 + string/FreeBSD/index.3 | 102 + string/FreeBSD/memccpy.3 | 80 + string/FreeBSD/memchr.3 | 83 + string/FreeBSD/memcmp.3 | 90 + string/FreeBSD/memcpy.3 | 90 + string/FreeBSD/memmem.3 | 86 + string/FreeBSD/memmem.c | 65 + string/FreeBSD/memmove.3 | 75 + string/FreeBSD/memset.3 | 74 + string/FreeBSD/rindex.3 | 92 + string/FreeBSD/rindex.c | 62 + string/FreeBSD/rpmatch.3 | 65 + string/FreeBSD/rpmatch.c | 57 + string/FreeBSD/strcasecmp.3 | 137 + string/FreeBSD/strcasecmp.c | 91 + string/FreeBSD/strcasestr.c | 71 + string/FreeBSD/strcat.3 | 167 + string/FreeBSD/strchr.3 | 102 + string/FreeBSD/strcmp.3 | 108 + string/FreeBSD/strcoll.3 | 96 + string/FreeBSD/strcoll.c | 68 + string/FreeBSD/strcpy.3 | 215 + string/FreeBSD/strcspn.c | 72 + string/FreeBSD/strdup.3 | 88 + string/FreeBSD/strdup.c | 51 + string/FreeBSD/strerror.3 | 194 + string/FreeBSD/strerror.c | 149 + string/FreeBSD/string.3 | 223 + string/FreeBSD/strlcpy.3 | 200 + string/FreeBSD/strlen.3 | 92 + string/FreeBSD/strmode.3 | 145 + string/FreeBSD/strmode.c | 148 + string/FreeBSD/strndup.c | 53 + string/FreeBSD/strnstr.c | 65 + string/FreeBSD/strpbrk.3 | 77 + string/FreeBSD/strpbrk.c | 53 + string/FreeBSD/strrchr.c | 5 + string/FreeBSD/strsep.3 | 135 + string/FreeBSD/strsep.c | 75 + string/FreeBSD/strsignal.c | 148 + string/FreeBSD/strspn.3 | 111 + string/FreeBSD/strspn.c | 71 + string/FreeBSD/strstr.3 | 158 + string/FreeBSD/strtok.3 | 179 + string/FreeBSD/strtok.c | 136 + string/FreeBSD/strxfrm.3 | 119 + string/FreeBSD/strxfrm.c | 145 + string/FreeBSD/swab.3 | 81 + string/FreeBSD/swab.c | 61 + string/FreeBSD/timingsafe_bcmp.3 | 65 + string/FreeBSD/timingsafe_bcmp.c | 35 + string/FreeBSD/wcpcpy.c | 46 + string/FreeBSD/wcpncpy.c | 45 + string/FreeBSD/wcscasecmp.c | 53 + string/FreeBSD/wcscat.c | 51 + string/FreeBSD/wcschr.c | 41 + string/FreeBSD/wcscmp.c | 56 + string/FreeBSD/wcscoll.3 | 129 + string/FreeBSD/wcscoll.c | 247 + string/FreeBSD/wcscpy.c | 49 + string/FreeBSD/wcscspn.c | 58 + string/FreeBSD/wcsdup.c | 43 + string/FreeBSD/wcslcat.c | 74 + string/FreeBSD/wcslcpy.c | 70 + string/FreeBSD/wcslen.c | 49 + string/FreeBSD/wcsncasecmp.c | 57 + string/FreeBSD/wcsncat.c | 57 + string/FreeBSD/wcsncmp.c | 57 + string/FreeBSD/wcsncpy.c | 64 + string/FreeBSD/wcsnlen.c | 42 + string/FreeBSD/wcspbrk.c | 58 + string/FreeBSD/wcsrchr.c | 47 + string/FreeBSD/wcsspn.c | 60 + string/FreeBSD/wcsstr.c | 63 + string/FreeBSD/wcstok.3 | 137 + string/FreeBSD/wcstok.c | 86 + string/FreeBSD/wcswidth.3 | 83 + string/FreeBSD/wcswidth.c | 67 + string/FreeBSD/wcsxfrm.3 | 144 + string/FreeBSD/wcsxfrm.c | 109 + string/FreeBSD/wmemchr.3 | 186 + string/FreeBSD/wmemchr.c | 52 + string/FreeBSD/wmemcmp.c | 53 + string/FreeBSD/wmemcpy.c | 44 + string/FreeBSD/wmemmove.c | 44 + string/FreeBSD/wmemset.c | 51 + string/NetBSD/memset_s.3 | 147 + string/NetBSD/memset_s.c | 71 + string/bcopy.c | 28 + string/memset_pattern.3 | 43 + string/stpcpy.c | 35 + string/stpncpy.c | 48 + string/strcat.c | 37 + string/strncat.c | 42 + sys/CMakeLists.txt | 55 + sys/OSMemoryNotification.c | 31 + sys/OSThermalNotification.c | 124 + sys/OpenBSD/stack_protector.c | 132 + sys/_libc_fork_child.c | 50 + sys/_libc_init.c | 81 + sys/chmodx_np.c | 173 + sys/crt_externs.c | 152 + sys/fork.c | 74 + sys/getgroups.c | 58 + sys/gettimeofday.c | 74 + sys/msgctl.c | 105 + sys/nanosleep.2 | 105 + sys/openx_np.c | 132 + sys/posix_spawn.c | 180 + sys/semctl.c | 122 + sys/settimeofday.c | 59 + sys/shmctl.c | 86 + sys/sigaction.c | 73 + sys/sigwait.2 | 87 + sys/statx_np.c | 220 + sys/umaskx_np.c | 51 + util/CMakeLists.txt | 17 + util/fparseln.3 | 156 + util/fparseln.c | 233 + util/login.3 | 112 + util/login.c | 77 + util/login_tty.c | 54 + util/logout.c | 109 + util/logwtmp.c | 104 + util/mkpath_np.3 | 80 + util/mkpath_np.c | 236 + util/opendev.3 | 104 + util/opendev.c | 107 + util/openpty.3 | 159 + util/pty.c | 140 + uuid/CMakeLists.txt | 19 + uuid/namespace.h | 31 + uuid/uuid-config.h | 36 + uuid/uuidman.sed | 3 + uuid/uuidsrc/clear.c | 43 + uuid/uuidsrc/compare.c | 55 + uuid/uuidsrc/copy.c | 45 + uuid/uuidsrc/gen_uuid.c | 257 + uuid/uuidsrc/isnull.c | 48 + uuid/uuidsrc/libuuid.3.in | 66 + uuid/uuidsrc/pack.c | 69 + uuid/uuidsrc/parse.c | 79 + uuid/uuidsrc/unpack.c | 63 + uuid/uuidsrc/unparse.c | 86 + uuid/uuidsrc/uuidP.h | 78 + uuid/uuidsrc/uuid_clear.3.in | 60 + uuid/uuidsrc/uuid_compare.3.in | 66 + uuid/uuidsrc/uuid_copy.3.in | 62 + uuid/uuidsrc/uuid_generate.3.in | 103 + uuid/uuidsrc/uuid_is_null.3.in | 61 + uuid/uuidsrc/uuid_parse.3.in | 70 + uuid/uuidsrc/uuid_unparse.3.in | 87 + weak_reference.h | 1 + x86_64/CMakeLists.txt | 23 + x86_64/gen/mcount.S | 52 + xcodescripts/Libc.order | 100 + xcodescripts/abort_unsupported.sh | 11 + xcodescripts/alias.list | 22 + xcodescripts/build_linklists.sh | 44 + xcodescripts/eos.xcconfig | 33 + xcodescripts/force_libc_to_build.sh | 13 + xcodescripts/generate_features.pl | 219 + xcodescripts/headers.sh | 352 + xcodescripts/legacy_alias.list | 19 + xcodescripts/libc.xcconfig | 170 + xcodescripts/libc_static.xcconfig | 21 + xcodescripts/manpages.sh | 69 + xcodescripts/patch_headers_variants.pl | 129 + xcodescripts/sanitise_headers.sh | 21 + xcodescripts/sim-compat-symlink.sh | 9 + xcodescripts/skip_installhdrs.sh | 11 + xcodescripts/strip-header.ed | 2 + xcodescripts/variants.xcconfig | 82 + 2545 files changed, 235614 insertions(+) create mode 100644 .gitignore create mode 100755 .upstream_base_commits create mode 100644 APPLE_LICENSE create mode 100644 CMakeLists.txt create mode 100644 Libc.xcodeproj/project.pbxproj create mode 100644 Platforms/appletvos/Makefile.inc create mode 100644 Platforms/bridgeos/Makefile.inc create mode 100644 Platforms/driverkit/Makefile.inc create mode 100644 Platforms/iphoneos/Makefile.inc create mode 100644 Platforms/macosx/Makefile.inc create mode 100644 Platforms/watchos/Makefile.inc create mode 100644 compat-43/CMakeLists.txt create mode 100644 compat-43/FreeBSD/creat.2 create mode 100644 compat-43/FreeBSD/creat.c create mode 100644 compat-43/FreeBSD/gethostid.3 create mode 100644 compat-43/FreeBSD/gethostid.c create mode 100644 compat-43/FreeBSD/getwd.c create mode 100644 compat-43/FreeBSD/killpg.2 create mode 100644 compat-43/FreeBSD/killpg.c create mode 100644 compat-43/FreeBSD/sethostid.c create mode 100644 compat-43/FreeBSD/setpgrp.c create mode 100644 compat-43/FreeBSD/setrgid.c create mode 100644 compat-43/FreeBSD/setruid.3 create mode 100644 compat-43/FreeBSD/setruid.c create mode 100644 compat-43/setregid.c create mode 100644 compat-43/setreuid.c create mode 100644 compat-43/sigaltstk.c create mode 100644 compat-43/sigblock.2 create mode 100644 compat-43/sigcompat.c create mode 100644 compat-43/sigpause.2 create mode 100644 compat-43/sigsetmask.2 create mode 100644 compat-43/sigvec.2 create mode 100755 darling-scripts/generate-derived.sh create mode 100755 darling-scripts/replace-libc-comments.sh create mode 100644 darwin/CMakeLists.txt create mode 100644 darwin/atexit_receipt.c create mode 100644 darwin/compatibility_hacks.c create mode 100644 darwin/darling_hacks.c create mode 100644 darwin/forceLibcToBuild.c create mode 100644 darwin/kvm.c create mode 100644 darwin/libc_private.h create mode 100644 db/CMakeLists.txt create mode 100644 db/btree/FreeBSD/bt_close.c create mode 100644 db/btree/FreeBSD/bt_conv.c create mode 100644 db/btree/FreeBSD/bt_debug.c create mode 100644 db/btree/FreeBSD/bt_delete.c create mode 100644 db/btree/FreeBSD/bt_extern.h create mode 100644 db/btree/FreeBSD/bt_get.c create mode 100644 db/btree/FreeBSD/bt_open.c create mode 100644 db/btree/FreeBSD/bt_overflow.c create mode 100644 db/btree/FreeBSD/bt_page.c create mode 100644 db/btree/FreeBSD/bt_put.c create mode 100644 db/btree/FreeBSD/bt_search.c create mode 100644 db/btree/FreeBSD/bt_seq.c create mode 100644 db/btree/FreeBSD/bt_split.c create mode 100644 db/btree/FreeBSD/bt_utils.c create mode 100644 db/btree/FreeBSD/btree.h create mode 100644 db/db/FreeBSD/db.c create mode 100644 db/hash/FreeBSD/hash.c create mode 100644 db/hash/FreeBSD/hash.h create mode 100644 db/hash/FreeBSD/hash_bigkey.c create mode 100644 db/hash/FreeBSD/hash_buf.c create mode 100644 db/hash/FreeBSD/hash_extern.h create mode 100644 db/hash/FreeBSD/hash_func.c create mode 100644 db/hash/FreeBSD/hash_log2.c create mode 100644 db/hash/FreeBSD/hash_page.c create mode 100644 db/hash/FreeBSD/ndbm.c create mode 100644 db/hash/FreeBSD/page.h create mode 100644 db/man/FreeBSD/btree.3 create mode 100644 db/man/FreeBSD/dbm.3 create mode 100644 db/man/FreeBSD/dbopen.3 create mode 100644 db/man/FreeBSD/hash.3 create mode 100644 db/man/FreeBSD/mpool.3 create mode 100644 db/man/FreeBSD/recno.3 create mode 100644 db/mpool/FreeBSD/mpool.c create mode 100644 db/recno/FreeBSD/rec_close.c create mode 100644 db/recno/FreeBSD/rec_delete.c create mode 100644 db/recno/FreeBSD/rec_extern.h create mode 100644 db/recno/FreeBSD/rec_get.c create mode 100644 db/recno/FreeBSD/rec_open.c create mode 100644 db/recno/FreeBSD/rec_put.c create mode 100644 db/recno/FreeBSD/rec_search.c create mode 100644 db/recno/FreeBSD/rec_seq.c create mode 100644 db/recno/FreeBSD/rec_utils.c create mode 100644 db/recno/FreeBSD/recno.h create mode 100644 derived/arm/libc-features.h create mode 100644 derived/arm64/libc-features.h create mode 100644 derived/i386/libc-features.h create mode 100644 derived/libc-features.h create mode 100644 derived/ppc/libc-features.h create mode 100644 derived/x86_64/libc-features.h create mode 100644 empty.c create mode 100644 emulated/CMakeLists.txt create mode 100644 emulated/brk.2 create mode 100644 emulated/brk.c create mode 100644 emulated/bsd_signal.3 create mode 100644 emulated/bsd_signal.c create mode 100644 emulated/lchflags.3 create mode 100644 emulated/lchflags.c create mode 100644 emulated/lchmod.3 create mode 100644 emulated/lchmod.c create mode 100644 emulated/lutimes.3 create mode 100644 emulated/lutimes.c create mode 100644 emulated/statvfs.3 create mode 100644 emulated/statvfs.c create mode 100644 emulated/tcgetsid.3 create mode 100644 emulated/tcgetsid.c create mode 100644 fbsdcompat/_fbsd_compat_.h create mode 100644 fbsdcompat/_fpmath.h create mode 100644 fbsdcompat/fpmath.h create mode 100644 fbsdcompat/machine/atomic.h create mode 100644 fbsdcompat/namespace.h create mode 100644 fbsdcompat/port_after.h create mode 100644 fbsdcompat/port_before.h create mode 100644 fbsdcompat/reentrant.h create mode 100644 fbsdcompat/spinlock.h create mode 100644 fbsdcompat/sys/cdefs.h create mode 100644 fbsdcompat/sys/endian.h create mode 100644 fbsdcompat/un-namespace.h create mode 100644 gdtoa/CMakeLists.txt create mode 100644 gdtoa/FreeBSD/_hdtoa.c create mode 100644 gdtoa/FreeBSD/_ldtoa.c create mode 100644 gdtoa/FreeBSD/gdtoa-dmisc.c create mode 100644 gdtoa/FreeBSD/gdtoa-dtoa.c create mode 100644 gdtoa/FreeBSD/gdtoa-gdtoa.c create mode 100644 gdtoa/FreeBSD/gdtoa-gethex.c create mode 100644 gdtoa/FreeBSD/gdtoa-gmisc.c create mode 100644 gdtoa/FreeBSD/gdtoa-hd_init.c create mode 100644 gdtoa/FreeBSD/gdtoa-hexnan.c create mode 100644 gdtoa/FreeBSD/gdtoa-misc.c create mode 100644 gdtoa/FreeBSD/gdtoa-smisc.c create mode 100644 gdtoa/FreeBSD/gdtoa-strtoIg.c create mode 100644 gdtoa/FreeBSD/gdtoa-strtod.c create mode 100644 gdtoa/FreeBSD/gdtoa-strtodg.c create mode 100644 gdtoa/FreeBSD/gdtoa-strtof.c create mode 100644 gdtoa/FreeBSD/gdtoa-strtopdd.c create mode 100644 gdtoa/FreeBSD/gdtoa-strtopx.c create mode 100644 gdtoa/FreeBSD/gdtoa-strtord.c create mode 100644 gdtoa/FreeBSD/gdtoa-sum.c create mode 100644 gdtoa/FreeBSD/gdtoa-ulp.c create mode 100644 gdtoa/FreeBSD/gdtoa.h create mode 100644 gdtoa/FreeBSD/gdtoa_fltrnds.h create mode 100644 gdtoa/FreeBSD/gdtoaimp.h create mode 100644 gdtoa/FreeBSD/glue.c create mode 100644 gdtoa/FreeBSD/machdep_ldisQ.c create mode 100644 gdtoa/FreeBSD/machdep_ldisd.c create mode 100644 gdtoa/FreeBSD/machdep_ldisdd.c create mode 100644 gdtoa/FreeBSD/machdep_ldisx.c create mode 100644 gdtoa/_ldbl_util.c create mode 100644 gdtoa/arith.h create mode 100644 gdtoa/gd_qnan.h create mode 100644 gdtoa/gdtoa.tgz create mode 100644 gen/CMakeLists.txt create mode 100644 gen/FreeBSD/_rand48.c create mode 100644 gen/FreeBSD/alarm.3 create mode 100644 gen/FreeBSD/alarm.c create mode 100644 gen/FreeBSD/arc4random.3 create mode 100644 gen/FreeBSD/arc4random.c create mode 100644 gen/FreeBSD/assert.c create mode 100644 gen/FreeBSD/basename.3 create mode 100644 gen/FreeBSD/basename.c create mode 100644 gen/FreeBSD/clock.3 create mode 100644 gen/FreeBSD/clock.c create mode 100644 gen/FreeBSD/closedir.c create mode 100644 gen/FreeBSD/ctermid.3 create mode 100644 gen/FreeBSD/ctermid.c create mode 100644 gen/FreeBSD/daemon.3 create mode 100644 gen/FreeBSD/daemon.c create mode 100644 gen/FreeBSD/dirname.3 create mode 100644 gen/FreeBSD/dirname.c create mode 100644 gen/FreeBSD/drand48.c create mode 100644 gen/FreeBSD/erand48.c create mode 100644 gen/FreeBSD/err.3 create mode 100644 gen/FreeBSD/err.c create mode 100644 gen/FreeBSD/exec.3 create mode 100644 gen/FreeBSD/exec.c create mode 100644 gen/FreeBSD/fmtcheck.3 create mode 100644 gen/FreeBSD/fmtcheck.c create mode 100644 gen/FreeBSD/fmtmsg.3 create mode 100644 gen/FreeBSD/fmtmsg.c create mode 100644 gen/FreeBSD/fnmatch.3 create mode 100644 gen/FreeBSD/fnmatch.c create mode 100644 gen/FreeBSD/ftok.3 create mode 100644 gen/FreeBSD/ftok.c create mode 100644 gen/FreeBSD/getbsize.3 create mode 100644 gen/FreeBSD/getbsize.c create mode 100644 gen/FreeBSD/getcap.3 create mode 100644 gen/FreeBSD/getcap.c create mode 100644 gen/FreeBSD/getcwd.3 create mode 100644 gen/FreeBSD/getcwd.c create mode 100644 gen/FreeBSD/gethostname.3 create mode 100644 gen/FreeBSD/gethostname.c create mode 100644 gen/FreeBSD/getlogin.c create mode 100644 gen/FreeBSD/getmntinfo.3 create mode 100644 gen/FreeBSD/getmntinfo.c create mode 100644 gen/FreeBSD/getmntinfo64.c create mode 100644 gen/FreeBSD/getpagesize.3 create mode 100644 gen/FreeBSD/getpagesize.c create mode 100644 gen/FreeBSD/getpass.3 create mode 100644 gen/FreeBSD/getpeereid.3 create mode 100644 gen/FreeBSD/getpeereid.c create mode 100644 gen/FreeBSD/getprogname.3 create mode 100644 gen/FreeBSD/getprogname.c create mode 100644 gen/FreeBSD/glob.3 create mode 100644 gen/FreeBSD/glob.c create mode 100644 gen/FreeBSD/isatty.c create mode 100644 gen/FreeBSD/jrand48.c create mode 100644 gen/FreeBSD/lcong48.c create mode 100644 gen/FreeBSD/lockf.3 create mode 100644 gen/FreeBSD/lockf.c create mode 100644 gen/FreeBSD/lrand48.c create mode 100644 gen/FreeBSD/mrand48.c create mode 100644 gen/FreeBSD/nice.3 create mode 100644 gen/FreeBSD/nice.c create mode 100644 gen/FreeBSD/nrand48.c create mode 100644 gen/FreeBSD/opendir.c create mode 100644 gen/FreeBSD/pause.3 create mode 100644 gen/FreeBSD/pause.c create mode 100644 gen/FreeBSD/popen.3 create mode 100644 gen/FreeBSD/popen.c create mode 100644 gen/FreeBSD/psignal.3 create mode 100644 gen/FreeBSD/psignal.c create mode 100644 gen/FreeBSD/raise.3 create mode 100644 gen/FreeBSD/rand48.3 create mode 100644 gen/FreeBSD/rand48.h create mode 100644 gen/FreeBSD/readdir.c create mode 100644 gen/FreeBSD/readpassphrase.3 create mode 100644 gen/FreeBSD/readpassphrase.c create mode 100644 gen/FreeBSD/rewinddir.c create mode 100644 gen/FreeBSD/scandir.3 create mode 100644 gen/FreeBSD/scandir.c create mode 100644 gen/FreeBSD/scandir_b.c create mode 100644 gen/FreeBSD/seed48.c create mode 100644 gen/FreeBSD/seekdir.c create mode 100644 gen/FreeBSD/sethostname.c create mode 100644 gen/FreeBSD/setmode.3 create mode 100644 gen/FreeBSD/setmode.c create mode 100644 gen/FreeBSD/setprogname.c create mode 100644 gen/FreeBSD/siginterrupt.3 create mode 100644 gen/FreeBSD/siginterrupt.c create mode 100644 gen/FreeBSD/siglist.c create mode 100644 gen/FreeBSD/signal.3 create mode 100644 gen/FreeBSD/signal.c create mode 100644 gen/FreeBSD/signbit.3 create mode 100644 gen/FreeBSD/sleep.3 create mode 100644 gen/FreeBSD/sleep.c create mode 100644 gen/FreeBSD/srand48.c create mode 100644 gen/FreeBSD/stringlist.3 create mode 100644 gen/FreeBSD/stringlist.c create mode 100644 gen/FreeBSD/sysconf.3 create mode 100644 gen/FreeBSD/sysconf.c create mode 100644 gen/FreeBSD/sysctl.3 create mode 100644 gen/FreeBSD/sysctl.c create mode 100644 gen/FreeBSD/sysctlbyname.c create mode 100644 gen/FreeBSD/sysctlnametomib.c create mode 100644 gen/FreeBSD/telldir.c create mode 100644 gen/FreeBSD/telldir.h create mode 100644 gen/FreeBSD/termios.c create mode 100644 gen/FreeBSD/time.3 create mode 100644 gen/FreeBSD/time.c create mode 100644 gen/FreeBSD/times.3 create mode 100644 gen/FreeBSD/times.c create mode 100644 gen/FreeBSD/timespec_get.3 create mode 100644 gen/FreeBSD/timespec_get.c create mode 100644 gen/FreeBSD/timezone.3 create mode 100644 gen/FreeBSD/timezone.c create mode 100644 gen/FreeBSD/ttyname.3 create mode 100644 gen/FreeBSD/ttyname.c create mode 100644 gen/FreeBSD/ttyslot.c create mode 100644 gen/FreeBSD/ualarm.3 create mode 100644 gen/FreeBSD/ualarm.c create mode 100644 gen/FreeBSD/ulimit.3 create mode 100644 gen/FreeBSD/ulimit.c create mode 100644 gen/FreeBSD/unvis.3 create mode 100644 gen/FreeBSD/unvis.c create mode 100644 gen/FreeBSD/usleep.3 create mode 100644 gen/FreeBSD/usleep.c create mode 100644 gen/FreeBSD/utime.3 create mode 100644 gen/FreeBSD/utime.c create mode 100644 gen/FreeBSD/vis.3 create mode 100644 gen/FreeBSD/vis.c create mode 100644 gen/FreeBSD/wait.c create mode 100644 gen/FreeBSD/wait3.c create mode 100644 gen/FreeBSD/waitpid.c create mode 100644 gen/FreeBSD/wordexp.3 create mode 100644 gen/FreeBSD/wordexp.c create mode 100644 gen/NetBSD/endutxent.3 create mode 100644 gen/NetBSD/getlastlogx.3 create mode 100644 gen/NetBSD/rb.c create mode 100644 gen/NetBSD/rbtree.3 create mode 100644 gen/NetBSD/utmpx.5 create mode 100644 gen/NetBSD/utmpx.c create mode 100644 gen/__dirent.h create mode 100644 gen/authentication.c create mode 100644 gen/backtrace.3 create mode 100644 gen/backtrace.c create mode 100644 gen/clock_gettime.3 create mode 100644 gen/clock_gettime.c create mode 100644 gen/compat.5 create mode 100644 gen/confstr.3 create mode 100644 gen/confstr.c create mode 100644 gen/crypt.3 create mode 100644 gen/crypt.c create mode 100644 gen/devname.3 create mode 100644 gen/devname.c create mode 100644 gen/directory.3 create mode 100644 gen/dirfd.c create mode 100644 gen/disklabel.c create mode 100644 gen/errlst.c create mode 100644 gen/execinfo.h create mode 100644 gen/filesec.c create mode 100644 gen/fts.3 create mode 100644 gen/fts.c create mode 100644 gen/ftw.3 create mode 100644 gen/get_compat.c create mode 100644 gen/get_compat.h create mode 100644 gen/getdomainname.3 create mode 100644 gen/getloadavg.3 create mode 100644 gen/getloadavg.c create mode 100644 gen/getttyent.3 create mode 100644 gen/getttyent.c create mode 100644 gen/getusershell.3 create mode 100644 gen/getusershell.c create mode 100644 gen/getvfsbyname.3 create mode 100644 gen/getvfsbyname.c create mode 100644 gen/intro.3 create mode 100644 gen/nanosleep.c create mode 100644 gen/nftw.c create mode 100644 gen/nlist.3 create mode 100644 gen/nlist.c create mode 100644 gen/oldsyslog.c create mode 100644 gen/posix_memalign.3 create mode 100644 gen/pwcache.3 create mode 100644 gen/raise.c create mode 100644 gen/setlogin.c create mode 100644 gen/sigsetops.3 create mode 100644 gen/sigsetops.c create mode 100644 gen/strtofflags.3 create mode 100644 gen/strtofflags.c create mode 100644 gen/sync_volume_np.3 create mode 100644 gen/sync_volume_np.c create mode 100644 gen/tcgetpgrp.3 create mode 100644 gen/tcsendbreak.3 create mode 100644 gen/tcsetattr.3 create mode 100644 gen/tcsetpgrp.3 create mode 100644 gen/thread_stack_pcs.c create mode 100644 gen/thread_stack_pcs.h create mode 100644 gen/tzset.3 create mode 100644 gen/uname.3 create mode 100644 gen/uname.c create mode 100644 gen/utmpx-darwin.c create mode 100644 gen/utmpx-darwin.h create mode 100644 gen/utmpx_thread.h create mode 100644 gmon/CMakeLists.txt create mode 100644 gmon/gmon.c create mode 100644 gmon/moncontrol.3 create mode 100644 i386/CMakeLists.txt create mode 100644 i386/gen/mcount.S create mode 100644 include/FreeBSD/nl_types.h create mode 100644 include/NetBSD/utmpx.h create mode 100644 include/__wctype.h create mode 100644 include/_ctermid.h create mode 100644 include/_ctype.h create mode 100644 include/_locale.h create mode 100644 include/_regex.h create mode 100644 include/_stdio.h create mode 100644 include/_types.h create mode 100644 include/_types/_intmax_t.h create mode 100644 include/_types/_nl_item.h create mode 100644 include/_types/_uint16_t.h create mode 100644 include/_types/_uint32_t.h create mode 100644 include/_types/_uint64_t.h create mode 100644 include/_types/_uint8_t.h create mode 100644 include/_types/_uintmax_t.h create mode 100644 include/_types/_wctrans_t.h create mode 100644 include/_types/_wctype_t.h create mode 100644 include/_wctype.h create mode 100644 include/_xlocale.h create mode 100644 include/aio.h create mode 100644 include/alloca.h create mode 100644 include/ar.h create mode 100644 include/arpa/ftp.h create mode 100644 include/arpa/inet.h create mode 100644 include/arpa/nameser_compat.h create mode 100644 include/arpa/telnet.h create mode 100644 include/arpa/tftp.h create mode 100644 include/asm.h create mode 100644 include/assert.h create mode 100644 include/authentication.h create mode 100644 include/bitstring.h create mode 100644 include/cpio.h create mode 100644 include/crt_externs.h create mode 100644 include/ctype.h create mode 100644 include/db.h create mode 100644 include/dirent.h create mode 100644 include/disktab.h create mode 100644 include/err.h create mode 100644 include/errno.h create mode 120000 include/execinfo.h create mode 100644 include/fcntl.h create mode 100644 include/fmtmsg.h create mode 100644 include/fnmatch.h create mode 100644 include/fsproperties.h create mode 100644 include/fstab.h create mode 100644 include/fts.h create mode 100644 include/ftw.h create mode 120000 include/get_compat.h create mode 100644 include/getopt.h create mode 100644 include/glob.h create mode 100644 include/inttypes.h create mode 100644 include/iso646.h create mode 100644 include/kvm.h create mode 100644 include/langinfo.h create mode 100644 include/libc.h create mode 100644 include/libgen.h create mode 100644 include/libkern/OSThermalNotification.h create mode 100644 include/limits.h create mode 100644 include/locale.h create mode 100644 include/memory.h create mode 100644 include/monetary.h create mode 100644 include/monitor.h create mode 100644 include/mpool.h create mode 100644 include/ndbm.h create mode 100644 include/nlist.h create mode 120000 include/os/activity.h create mode 120000 include/os/alloc_once_private.h create mode 120000 include/os/assumes.h create mode 120000 include/os/debug_private.h create mode 120000 include/os/log.h create mode 120000 include/os/object.h create mode 120000 include/os/overflow.h create mode 100644 include/paths.h create mode 100644 include/poll.h create mode 100644 include/printf.h create mode 100644 include/protocols/routed.h create mode 100644 include/protocols/rwhod.h create mode 100644 include/protocols/talkd.h create mode 100644 include/protocols/timed.h create mode 120000 include/pthread_spinlock.h create mode 100644 include/ranlib.h create mode 100644 include/readpassphrase.h create mode 100644 include/regex.h create mode 100644 include/rune.h create mode 100644 include/runetype.h create mode 100644 include/search.h create mode 100644 include/secure/_common.h create mode 100644 include/secure/_stdio.h create mode 100644 include/secure/_string.h create mode 100644 include/secure/_strings.h create mode 100644 include/semaphore.h create mode 100644 include/sgtty.h create mode 100644 include/signal.h create mode 100644 include/stab.h create mode 100644 include/standards.h create mode 100644 include/stdbool.h create mode 100644 include/stddef.h create mode 100644 include/stdint.h create mode 100644 include/stdio.h create mode 100644 include/stdlib.h create mode 100644 include/strhash.h create mode 100644 include/string.h create mode 100644 include/stringlist.h create mode 100644 include/strings.h create mode 100644 include/struct.h create mode 100644 include/sys/acl.h create mode 100644 include/sys/cdefs.h create mode 100644 include/sys/rbtree.h create mode 100644 include/sys/statvfs.h create mode 100644 include/sysexits.3 create mode 100644 include/sysexits.h create mode 100644 include/syslog.h create mode 100644 include/tar.h create mode 100644 include/termios.h create mode 100644 include/time.h create mode 100644 include/timeconv.h create mode 100644 include/ttyent.h create mode 120000 include/tzfile.h create mode 100644 include/ulimit.h create mode 100644 include/unistd.h create mode 100644 include/util.h create mode 100644 include/utime.h create mode 100644 include/utmp.h create mode 100644 include/vis.h create mode 100644 include/wchar.h create mode 100644 include/wctype.h create mode 100644 include/wordexp.h create mode 100644 include/xlocale.h create mode 100644 include/xlocale/__wctype.h create mode 100644 include/xlocale/_ctype.h create mode 100644 include/xlocale/_inttypes.h create mode 100644 include/xlocale/_langinfo.h create mode 100644 include/xlocale/_monetary.h create mode 100644 include/xlocale/_regex.h create mode 100644 include/xlocale/_stdio.h create mode 100644 include/xlocale/_stdlib.h create mode 100644 include/xlocale/_string.h create mode 100644 include/xlocale/_time.h create mode 100644 include/xlocale/_wchar.h create mode 100644 include/xlocale/_wctype.h create mode 100644 libdarwin/AppleFactoryVariant.plist create mode 100644 libdarwin/AppleInternalVariant.plist create mode 100644 libdarwin/CMakeLists.txt create mode 100644 libdarwin/bsd.c create mode 100644 libdarwin/ctl.c create mode 100644 libdarwin/dirstat.c create mode 100644 libdarwin/dirstat_collection.c create mode 100644 libdarwin/err.c create mode 100644 libdarwin/exception.c create mode 100644 libdarwin/h/bsd.h create mode 100644 libdarwin/h/cleanup.h create mode 100644 libdarwin/h/ctl.h create mode 100644 libdarwin/h/dirstat.h create mode 100644 libdarwin/h/dirstat_collection.h create mode 100644 libdarwin/h/err.h create mode 100644 libdarwin/h/errno.h create mode 100644 libdarwin/h/libdarwin_init.h create mode 100644 libdarwin/h/mach_exception.h create mode 100644 libdarwin/h/mach_utils.h create mode 100644 libdarwin/h/stdio.h create mode 100644 libdarwin/h/stdlib.h create mode 100644 libdarwin/h/string.h create mode 100644 libdarwin/init.c create mode 100644 libdarwin/internal.h create mode 100644 libdarwin/mach.c create mode 100644 libdarwin/stdio.c create mode 100644 libdarwin/stdlib.c create mode 100644 libdarwin/string.c create mode 100644 libdarwin/tapi.h create mode 100644 libdarwin/variant.c create mode 100644 locale/CMakeLists.txt create mode 100644 locale/FreeBSD/ascii.c create mode 100644 locale/FreeBSD/big5.5 create mode 100644 locale/FreeBSD/big5.c create mode 100644 locale/FreeBSD/btowc.3 create mode 100644 locale/FreeBSD/btowc.c create mode 100644 locale/FreeBSD/collate.c create mode 100644 locale/FreeBSD/collate.h create mode 100644 locale/FreeBSD/collcmp.c create mode 100644 locale/FreeBSD/ctype.3 create mode 100644 locale/FreeBSD/digittoint.3 create mode 100644 locale/FreeBSD/euc.5 create mode 100644 locale/FreeBSD/euc.c create mode 100644 locale/FreeBSD/fix_grouping.c create mode 100644 locale/FreeBSD/gb18030.5 create mode 100644 locale/FreeBSD/gb18030.c create mode 100644 locale/FreeBSD/gb2312.5 create mode 100644 locale/FreeBSD/gb2312.c create mode 100644 locale/FreeBSD/gbk.5 create mode 100644 locale/FreeBSD/gbk.c create mode 100644 locale/FreeBSD/isalnum.3 create mode 100644 locale/FreeBSD/isalpha.3 create mode 100644 locale/FreeBSD/isascii.3 create mode 100644 locale/FreeBSD/isblank.3 create mode 100644 locale/FreeBSD/iscntrl.3 create mode 100644 locale/FreeBSD/isdigit.3 create mode 100644 locale/FreeBSD/isgraph.3 create mode 100644 locale/FreeBSD/isideogram.3 create mode 100644 locale/FreeBSD/islower.3 create mode 100644 locale/FreeBSD/isphonogram.3 create mode 100644 locale/FreeBSD/isprint.3 create mode 100644 locale/FreeBSD/ispunct.3 create mode 100644 locale/FreeBSD/isrune.3 create mode 100644 locale/FreeBSD/isspace.3 create mode 100644 locale/FreeBSD/isspecial.3 create mode 100644 locale/FreeBSD/isupper.3 create mode 100644 locale/FreeBSD/iswalnum.3 create mode 100644 locale/FreeBSD/isxdigit.3 create mode 100644 locale/FreeBSD/ldpart.c create mode 100644 locale/FreeBSD/ldpart.h create mode 100644 locale/FreeBSD/lmessages.c create mode 100644 locale/FreeBSD/lmessages.h create mode 100644 locale/FreeBSD/lmonetary.c create mode 100644 locale/FreeBSD/lmonetary.h create mode 100644 locale/FreeBSD/lnumeric.c create mode 100644 locale/FreeBSD/lnumeric.h create mode 100644 locale/FreeBSD/localeconv.3 create mode 100644 locale/FreeBSD/localeconv.c create mode 100644 locale/FreeBSD/mblen.3 create mode 100644 locale/FreeBSD/mblen.c create mode 100644 locale/FreeBSD/mblocal.h create mode 100644 locale/FreeBSD/mbrlen.3 create mode 100644 locale/FreeBSD/mbrlen.c create mode 100644 locale/FreeBSD/mbrtowc.3 create mode 100644 locale/FreeBSD/mbrtowc.c create mode 100644 locale/FreeBSD/mbsinit.3 create mode 100644 locale/FreeBSD/mbsinit.c create mode 100644 locale/FreeBSD/mbsnrtowcs.c create mode 100644 locale/FreeBSD/mbsrtowcs.3 create mode 100644 locale/FreeBSD/mbsrtowcs.c create mode 100644 locale/FreeBSD/mbstowcs.3 create mode 100644 locale/FreeBSD/mbstowcs.c create mode 100644 locale/FreeBSD/mbtowc.3 create mode 100644 locale/FreeBSD/mbtowc.c create mode 100644 locale/FreeBSD/mskanji.5 create mode 100644 locale/FreeBSD/mskanji.c create mode 100644 locale/FreeBSD/multibyte.3 create mode 100644 locale/FreeBSD/nextwctype.3 create mode 100644 locale/FreeBSD/nextwctype.c create mode 100644 locale/FreeBSD/nl_langinfo.3 create mode 100644 locale/FreeBSD/nl_langinfo.c create mode 100644 locale/FreeBSD/nomacros.c create mode 100644 locale/FreeBSD/none.c create mode 100644 locale/FreeBSD/rune.c create mode 100644 locale/FreeBSD/rune32.h create mode 100644 locale/FreeBSD/runetype.c create mode 100644 locale/FreeBSD/setlocale.3 create mode 100644 locale/FreeBSD/setlocale.c create mode 100644 locale/FreeBSD/setlocale.h create mode 100644 locale/FreeBSD/setrunelocale.c create mode 100644 locale/FreeBSD/table.c create mode 100644 locale/FreeBSD/toascii.3 create mode 100644 locale/FreeBSD/tolower.3 create mode 100644 locale/FreeBSD/tolower.c create mode 100644 locale/FreeBSD/toupper.3 create mode 100644 locale/FreeBSD/toupper.c create mode 100644 locale/FreeBSD/towlower.3 create mode 100644 locale/FreeBSD/towupper.3 create mode 100644 locale/FreeBSD/utf2.c create mode 100644 locale/FreeBSD/utf8.5 create mode 100644 locale/FreeBSD/utf8.c create mode 100644 locale/FreeBSD/wcrtomb.3 create mode 100644 locale/FreeBSD/wcrtomb.c create mode 100644 locale/FreeBSD/wcsftime.3 create mode 100644 locale/FreeBSD/wcsftime.c create mode 100644 locale/FreeBSD/wcsnrtombs.c create mode 100644 locale/FreeBSD/wcsrtombs.3 create mode 100644 locale/FreeBSD/wcsrtombs.c create mode 100644 locale/FreeBSD/wcstod.3 create mode 100644 locale/FreeBSD/wcstod.c create mode 100644 locale/FreeBSD/wcstof.c create mode 100644 locale/FreeBSD/wcstoimax.c create mode 100644 locale/FreeBSD/wcstol.3 create mode 100644 locale/FreeBSD/wcstol.c create mode 100644 locale/FreeBSD/wcstold.c create mode 100644 locale/FreeBSD/wcstoll.c create mode 100644 locale/FreeBSD/wcstombs.3 create mode 100644 locale/FreeBSD/wcstombs.c create mode 100644 locale/FreeBSD/wcstoul.c create mode 100644 locale/FreeBSD/wcstoull.c create mode 100644 locale/FreeBSD/wcstoumax.c create mode 100644 locale/FreeBSD/wctob.c create mode 100644 locale/FreeBSD/wctomb.3 create mode 100644 locale/FreeBSD/wctomb.c create mode 100644 locale/FreeBSD/wctrans.3 create mode 100644 locale/FreeBSD/wctrans.c create mode 100644 locale/FreeBSD/wctype.3 create mode 100644 locale/FreeBSD/wctype.c create mode 100644 locale/FreeBSD/wcwidth.3 create mode 100644 locale/FreeBSD/wcwidth.c create mode 100644 locale/ctype_l.3 create mode 100644 locale/duplocale.3 create mode 100644 locale/freelocale.3 create mode 100644 locale/frune.c create mode 100644 locale/isalnum_l.3 create mode 100644 locale/isctype.c create mode 100644 locale/iswalnum_l.3 create mode 100644 locale/iswctype.c create mode 100644 locale/lconv.c create mode 100644 locale/locale/UTF-8/LC_CTYPE create mode 120000 locale/locale/af_ZA.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/af_ZA.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/af_ZA.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/af_ZA.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/af_ZA.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/af_ZA.ISO8859-1/LC_TIME create mode 120000 locale/locale/af_ZA.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/af_ZA.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/af_ZA.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/af_ZA.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/af_ZA.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/af_ZA.ISO8859-15/LC_TIME create mode 120000 locale/locale/af_ZA.UTF-8/LC_COLLATE create mode 120000 locale/locale/af_ZA.UTF-8/LC_CTYPE create mode 120000 locale/locale/af_ZA.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/af_ZA.UTF-8/LC_MONETARY create mode 120000 locale/locale/af_ZA.UTF-8/LC_NUMERIC create mode 120000 locale/locale/af_ZA.UTF-8/LC_TIME create mode 120000 locale/locale/af_ZA/LC_COLLATE create mode 120000 locale/locale/af_ZA/LC_CTYPE create mode 120000 locale/locale/af_ZA/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/af_ZA/LC_MONETARY create mode 120000 locale/locale/af_ZA/LC_NUMERIC create mode 120000 locale/locale/af_ZA/LC_TIME create mode 120000 locale/locale/am_ET.UTF-8/LC_COLLATE create mode 100644 locale/locale/am_ET.UTF-8/LC_CTYPE create mode 100644 locale/locale/am_ET.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/am_ET.UTF-8/LC_MONETARY create mode 100644 locale/locale/am_ET.UTF-8/LC_NUMERIC create mode 100644 locale/locale/am_ET.UTF-8/LC_TIME create mode 120000 locale/locale/am_ET/LC_COLLATE create mode 100644 locale/locale/am_ET/LC_CTYPE create mode 100644 locale/locale/am_ET/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/am_ET/LC_MONETARY create mode 100644 locale/locale/am_ET/LC_NUMERIC create mode 100644 locale/locale/am_ET/LC_TIME create mode 100644 locale/locale/be_BY.CP1131/LC_COLLATE create mode 100644 locale/locale/be_BY.CP1131/LC_CTYPE create mode 100644 locale/locale/be_BY.CP1131/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/be_BY.CP1131/LC_MONETARY create mode 120000 locale/locale/be_BY.CP1131/LC_NUMERIC create mode 100644 locale/locale/be_BY.CP1131/LC_TIME create mode 100644 locale/locale/be_BY.CP1251/LC_COLLATE create mode 120000 locale/locale/be_BY.CP1251/LC_CTYPE create mode 100644 locale/locale/be_BY.CP1251/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/be_BY.CP1251/LC_MONETARY create mode 100644 locale/locale/be_BY.CP1251/LC_NUMERIC create mode 100644 locale/locale/be_BY.CP1251/LC_TIME create mode 100644 locale/locale/be_BY.ISO8859-5/LC_COLLATE create mode 120000 locale/locale/be_BY.ISO8859-5/LC_CTYPE create mode 100644 locale/locale/be_BY.ISO8859-5/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/be_BY.ISO8859-5/LC_MONETARY create mode 120000 locale/locale/be_BY.ISO8859-5/LC_NUMERIC create mode 100644 locale/locale/be_BY.ISO8859-5/LC_TIME create mode 120000 locale/locale/be_BY.UTF-8/LC_COLLATE create mode 120000 locale/locale/be_BY.UTF-8/LC_CTYPE create mode 100644 locale/locale/be_BY.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/be_BY.UTF-8/LC_MONETARY create mode 120000 locale/locale/be_BY.UTF-8/LC_NUMERIC create mode 100644 locale/locale/be_BY.UTF-8/LC_TIME create mode 120000 locale/locale/be_BY/LC_COLLATE create mode 120000 locale/locale/be_BY/LC_CTYPE create mode 100644 locale/locale/be_BY/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/be_BY/LC_MONETARY create mode 120000 locale/locale/be_BY/LC_NUMERIC create mode 100644 locale/locale/be_BY/LC_TIME create mode 100644 locale/locale/bg_BG.CP1251/LC_COLLATE create mode 100644 locale/locale/bg_BG.CP1251/LC_CTYPE create mode 100644 locale/locale/bg_BG.CP1251/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/bg_BG.CP1251/LC_MONETARY create mode 100644 locale/locale/bg_BG.CP1251/LC_NUMERIC create mode 100644 locale/locale/bg_BG.CP1251/LC_TIME create mode 120000 locale/locale/bg_BG.UTF-8/LC_COLLATE create mode 120000 locale/locale/bg_BG.UTF-8/LC_CTYPE create mode 100644 locale/locale/bg_BG.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/bg_BG.UTF-8/LC_MONETARY create mode 120000 locale/locale/bg_BG.UTF-8/LC_NUMERIC create mode 100644 locale/locale/bg_BG.UTF-8/LC_TIME create mode 120000 locale/locale/bg_BG/LC_COLLATE create mode 120000 locale/locale/bg_BG/LC_CTYPE create mode 100644 locale/locale/bg_BG/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/bg_BG/LC_MONETARY create mode 120000 locale/locale/bg_BG/LC_NUMERIC create mode 100644 locale/locale/bg_BG/LC_TIME create mode 100644 locale/locale/ca_ES.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/ca_ES.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/ca_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ca_ES.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/ca_ES.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/ca_ES.ISO8859-1/LC_TIME create mode 100644 locale/locale/ca_ES.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/ca_ES.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/ca_ES.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/ca_ES.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/ca_ES.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/ca_ES.ISO8859-15/LC_TIME create mode 120000 locale/locale/ca_ES.UTF-8/LC_COLLATE create mode 120000 locale/locale/ca_ES.UTF-8/LC_CTYPE create mode 120000 locale/locale/ca_ES.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/ca_ES.UTF-8/LC_MONETARY create mode 120000 locale/locale/ca_ES.UTF-8/LC_NUMERIC create mode 100644 locale/locale/ca_ES.UTF-8/LC_TIME create mode 120000 locale/locale/ca_ES/LC_COLLATE create mode 120000 locale/locale/ca_ES/LC_CTYPE create mode 120000 locale/locale/ca_ES/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/ca_ES/LC_MONETARY create mode 120000 locale/locale/ca_ES/LC_NUMERIC create mode 100644 locale/locale/ca_ES/LC_TIME create mode 100644 locale/locale/cs/LC_MESSAGES/texinfo.mo create mode 100644 locale/locale/cs_CZ.ISO8859-2/LC_COLLATE create mode 120000 locale/locale/cs_CZ.ISO8859-2/LC_CTYPE create mode 100644 locale/locale/cs_CZ.ISO8859-2/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/cs_CZ.ISO8859-2/LC_MONETARY create mode 100644 locale/locale/cs_CZ.ISO8859-2/LC_NUMERIC create mode 100644 locale/locale/cs_CZ.ISO8859-2/LC_TIME create mode 120000 locale/locale/cs_CZ.UTF-8/LC_COLLATE create mode 120000 locale/locale/cs_CZ.UTF-8/LC_CTYPE create mode 120000 locale/locale/cs_CZ.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/cs_CZ.UTF-8/LC_MONETARY create mode 120000 locale/locale/cs_CZ.UTF-8/LC_NUMERIC create mode 100644 locale/locale/cs_CZ.UTF-8/LC_TIME create mode 120000 locale/locale/cs_CZ/LC_COLLATE create mode 120000 locale/locale/cs_CZ/LC_CTYPE create mode 120000 locale/locale/cs_CZ/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/cs_CZ/LC_MONETARY create mode 120000 locale/locale/cs_CZ/LC_NUMERIC create mode 100644 locale/locale/cs_CZ/LC_TIME create mode 100644 locale/locale/da/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/da_DK.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/da_DK.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/da_DK.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/da_DK.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/da_DK.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/da_DK.ISO8859-1/LC_TIME create mode 120000 locale/locale/da_DK.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/da_DK.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/da_DK.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/da_DK.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/da_DK.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/da_DK.ISO8859-15/LC_TIME create mode 120000 locale/locale/da_DK.UTF-8/LC_COLLATE create mode 120000 locale/locale/da_DK.UTF-8/LC_CTYPE create mode 120000 locale/locale/da_DK.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/da_DK.UTF-8/LC_MONETARY create mode 120000 locale/locale/da_DK.UTF-8/LC_NUMERIC create mode 100644 locale/locale/da_DK.UTF-8/LC_TIME create mode 120000 locale/locale/da_DK/LC_COLLATE create mode 120000 locale/locale/da_DK/LC_CTYPE create mode 120000 locale/locale/da_DK/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/da_DK/LC_MONETARY create mode 120000 locale/locale/da_DK/LC_NUMERIC create mode 100644 locale/locale/da_DK/LC_TIME create mode 100644 locale/locale/de/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/de_AT.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/de_AT.ISO8859-1/LC_CTYPE create mode 120000 locale/locale/de_AT.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/de_AT.ISO8859-1/LC_MESSAGES/texinfo.mo create mode 100644 locale/locale/de_AT.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/de_AT.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/de_AT.ISO8859-1/LC_TIME create mode 120000 locale/locale/de_AT.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/de_AT.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/de_AT.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/de_AT.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/de_AT.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/de_AT.ISO8859-15/LC_TIME create mode 120000 locale/locale/de_AT.UTF-8/LC_COLLATE create mode 120000 locale/locale/de_AT.UTF-8/LC_CTYPE create mode 120000 locale/locale/de_AT.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/de_AT.UTF-8/LC_MONETARY create mode 120000 locale/locale/de_AT.UTF-8/LC_NUMERIC create mode 100644 locale/locale/de_AT.UTF-8/LC_TIME create mode 120000 locale/locale/de_AT/LC_COLLATE create mode 120000 locale/locale/de_AT/LC_CTYPE create mode 120000 locale/locale/de_AT/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/de_AT/LC_MONETARY create mode 120000 locale/locale/de_AT/LC_NUMERIC create mode 100644 locale/locale/de_AT/LC_TIME create mode 120000 locale/locale/de_CH.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/de_CH.ISO8859-1/LC_CTYPE create mode 120000 locale/locale/de_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/de_CH.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/de_CH.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/de_CH.ISO8859-1/LC_TIME create mode 120000 locale/locale/de_CH.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/de_CH.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/de_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/de_CH.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/de_CH.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/de_CH.ISO8859-15/LC_TIME create mode 120000 locale/locale/de_CH.UTF-8/LC_COLLATE create mode 120000 locale/locale/de_CH.UTF-8/LC_CTYPE create mode 120000 locale/locale/de_CH.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/de_CH.UTF-8/LC_MONETARY create mode 120000 locale/locale/de_CH.UTF-8/LC_NUMERIC create mode 120000 locale/locale/de_CH.UTF-8/LC_TIME create mode 120000 locale/locale/de_CH/LC_COLLATE create mode 120000 locale/locale/de_CH/LC_CTYPE create mode 120000 locale/locale/de_CH/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/de_CH/LC_MONETARY create mode 120000 locale/locale/de_CH/LC_NUMERIC create mode 120000 locale/locale/de_CH/LC_TIME create mode 100644 locale/locale/de_DE.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/de_DE.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/de_DE.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/de_DE.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/de_DE.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/de_DE.ISO8859-1/LC_TIME create mode 100644 locale/locale/de_DE.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/de_DE.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/de_DE.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/de_DE.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/de_DE.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/de_DE.ISO8859-15/LC_TIME create mode 120000 locale/locale/de_DE.UTF-8/LC_COLLATE create mode 120000 locale/locale/de_DE.UTF-8/LC_CTYPE create mode 120000 locale/locale/de_DE.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/de_DE.UTF-8/LC_MONETARY create mode 120000 locale/locale/de_DE.UTF-8/LC_NUMERIC create mode 100644 locale/locale/de_DE.UTF-8/LC_TIME create mode 120000 locale/locale/de_DE/LC_COLLATE create mode 120000 locale/locale/de_DE/LC_CTYPE create mode 120000 locale/locale/de_DE/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/de_DE/LC_MONETARY create mode 120000 locale/locale/de_DE/LC_NUMERIC create mode 100644 locale/locale/de_DE/LC_TIME create mode 100644 locale/locale/el_GR.ISO8859-7/LC_COLLATE create mode 100644 locale/locale/el_GR.ISO8859-7/LC_CTYPE create mode 100644 locale/locale/el_GR.ISO8859-7/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/el_GR.ISO8859-7/LC_MONETARY create mode 100644 locale/locale/el_GR.ISO8859-7/LC_NUMERIC create mode 100644 locale/locale/el_GR.ISO8859-7/LC_TIME create mode 120000 locale/locale/el_GR.UTF-8/LC_COLLATE create mode 120000 locale/locale/el_GR.UTF-8/LC_CTYPE create mode 100644 locale/locale/el_GR.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/el_GR.UTF-8/LC_MONETARY create mode 120000 locale/locale/el_GR.UTF-8/LC_NUMERIC create mode 100644 locale/locale/el_GR.UTF-8/LC_TIME create mode 120000 locale/locale/el_GR/LC_COLLATE create mode 120000 locale/locale/el_GR/LC_CTYPE create mode 100644 locale/locale/el_GR/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/el_GR/LC_MONETARY create mode 120000 locale/locale/el_GR/LC_NUMERIC create mode 100644 locale/locale/el_GR/LC_TIME create mode 120000 locale/locale/en_AU.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/en_AU.ISO8859-1/LC_CTYPE create mode 120000 locale/locale/en_AU.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/en_AU.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/en_AU.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/en_AU.ISO8859-1/LC_TIME create mode 120000 locale/locale/en_AU.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/en_AU.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/en_AU.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_AU.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/en_AU.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/en_AU.ISO8859-15/LC_TIME create mode 120000 locale/locale/en_AU.US-ASCII/LC_COLLATE create mode 120000 locale/locale/en_AU.US-ASCII/LC_CTYPE create mode 120000 locale/locale/en_AU.US-ASCII/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_AU.US-ASCII/LC_MONETARY create mode 120000 locale/locale/en_AU.US-ASCII/LC_NUMERIC create mode 120000 locale/locale/en_AU.US-ASCII/LC_TIME create mode 120000 locale/locale/en_AU.UTF-8/LC_COLLATE create mode 120000 locale/locale/en_AU.UTF-8/LC_CTYPE create mode 120000 locale/locale/en_AU.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_AU.UTF-8/LC_MONETARY create mode 120000 locale/locale/en_AU.UTF-8/LC_NUMERIC create mode 120000 locale/locale/en_AU.UTF-8/LC_TIME create mode 120000 locale/locale/en_AU/LC_COLLATE create mode 120000 locale/locale/en_AU/LC_CTYPE create mode 120000 locale/locale/en_AU/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_AU/LC_MONETARY create mode 120000 locale/locale/en_AU/LC_NUMERIC create mode 120000 locale/locale/en_AU/LC_TIME create mode 120000 locale/locale/en_CA.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/en_CA.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/en_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/en_CA.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/en_CA.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/en_CA.ISO8859-1/LC_TIME create mode 120000 locale/locale/en_CA.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/en_CA.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/en_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_CA.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/en_CA.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/en_CA.ISO8859-15/LC_TIME create mode 120000 locale/locale/en_CA.US-ASCII/LC_COLLATE create mode 120000 locale/locale/en_CA.US-ASCII/LC_CTYPE create mode 120000 locale/locale/en_CA.US-ASCII/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_CA.US-ASCII/LC_MONETARY create mode 120000 locale/locale/en_CA.US-ASCII/LC_NUMERIC create mode 120000 locale/locale/en_CA.US-ASCII/LC_TIME create mode 120000 locale/locale/en_CA.UTF-8/LC_COLLATE create mode 120000 locale/locale/en_CA.UTF-8/LC_CTYPE create mode 120000 locale/locale/en_CA.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_CA.UTF-8/LC_MONETARY create mode 120000 locale/locale/en_CA.UTF-8/LC_NUMERIC create mode 120000 locale/locale/en_CA.UTF-8/LC_TIME create mode 120000 locale/locale/en_CA/LC_COLLATE create mode 120000 locale/locale/en_CA/LC_CTYPE create mode 120000 locale/locale/en_CA/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_CA/LC_MONETARY create mode 120000 locale/locale/en_CA/LC_NUMERIC create mode 120000 locale/locale/en_CA/LC_TIME create mode 120000 locale/locale/en_GB.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/en_GB.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/en_GB.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/en_GB.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/en_GB.ISO8859-1/LC_TIME create mode 120000 locale/locale/en_GB.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/en_GB.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/en_GB.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_GB.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/en_GB.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/en_GB.ISO8859-15/LC_TIME create mode 120000 locale/locale/en_GB.US-ASCII/LC_COLLATE create mode 120000 locale/locale/en_GB.US-ASCII/LC_CTYPE create mode 120000 locale/locale/en_GB.US-ASCII/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_GB.US-ASCII/LC_MONETARY create mode 120000 locale/locale/en_GB.US-ASCII/LC_NUMERIC create mode 120000 locale/locale/en_GB.US-ASCII/LC_TIME create mode 120000 locale/locale/en_GB.UTF-8/LC_COLLATE create mode 120000 locale/locale/en_GB.UTF-8/LC_CTYPE create mode 120000 locale/locale/en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/en_GB.UTF-8/LC_MONETARY create mode 120000 locale/locale/en_GB.UTF-8/LC_NUMERIC create mode 120000 locale/locale/en_GB.UTF-8/LC_TIME create mode 120000 locale/locale/en_GB/LC_COLLATE create mode 120000 locale/locale/en_GB/LC_CTYPE create mode 120000 locale/locale/en_GB/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/en_GB/LC_MONETARY create mode 120000 locale/locale/en_GB/LC_NUMERIC create mode 120000 locale/locale/en_GB/LC_TIME create mode 120000 locale/locale/en_IE.UTF-8/LC_COLLATE create mode 120000 locale/locale/en_IE.UTF-8/LC_CTYPE create mode 120000 locale/locale/en_IE.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/en_IE.UTF-8/LC_MONETARY create mode 120000 locale/locale/en_IE.UTF-8/LC_NUMERIC create mode 120000 locale/locale/en_IE.UTF-8/LC_TIME create mode 120000 locale/locale/en_IE/LC_COLLATE create mode 120000 locale/locale/en_IE/LC_CTYPE create mode 120000 locale/locale/en_IE/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/en_IE/LC_MONETARY create mode 120000 locale/locale/en_IE/LC_NUMERIC create mode 120000 locale/locale/en_IE/LC_TIME create mode 120000 locale/locale/en_NZ.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/en_NZ.ISO8859-1/LC_CTYPE create mode 120000 locale/locale/en_NZ.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/en_NZ.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/en_NZ.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/en_NZ.ISO8859-1/LC_TIME create mode 120000 locale/locale/en_NZ.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/en_NZ.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/en_NZ.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_NZ.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/en_NZ.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/en_NZ.ISO8859-15/LC_TIME create mode 120000 locale/locale/en_NZ.US-ASCII/LC_COLLATE create mode 120000 locale/locale/en_NZ.US-ASCII/LC_CTYPE create mode 120000 locale/locale/en_NZ.US-ASCII/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_NZ.US-ASCII/LC_MONETARY create mode 120000 locale/locale/en_NZ.US-ASCII/LC_NUMERIC create mode 120000 locale/locale/en_NZ.US-ASCII/LC_TIME create mode 120000 locale/locale/en_NZ.UTF-8/LC_COLLATE create mode 120000 locale/locale/en_NZ.UTF-8/LC_CTYPE create mode 120000 locale/locale/en_NZ.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_NZ.UTF-8/LC_MONETARY create mode 120000 locale/locale/en_NZ.UTF-8/LC_NUMERIC create mode 120000 locale/locale/en_NZ.UTF-8/LC_TIME create mode 120000 locale/locale/en_NZ/LC_COLLATE create mode 120000 locale/locale/en_NZ/LC_CTYPE create mode 120000 locale/locale/en_NZ/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_NZ/LC_MONETARY create mode 120000 locale/locale/en_NZ/LC_NUMERIC create mode 120000 locale/locale/en_NZ/LC_TIME create mode 120000 locale/locale/en_US.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/en_US.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/en_US.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/en_US.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/en_US.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/en_US.ISO8859-1/LC_TIME create mode 120000 locale/locale/en_US.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/en_US.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/en_US.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_US.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/en_US.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/en_US.ISO8859-15/LC_TIME create mode 120000 locale/locale/en_US.US-ASCII/LC_COLLATE create mode 120000 locale/locale/en_US.US-ASCII/LC_CTYPE create mode 120000 locale/locale/en_US.US-ASCII/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_US.US-ASCII/LC_MONETARY create mode 120000 locale/locale/en_US.US-ASCII/LC_NUMERIC create mode 120000 locale/locale/en_US.US-ASCII/LC_TIME create mode 120000 locale/locale/en_US.UTF-8/LC_COLLATE create mode 120000 locale/locale/en_US.UTF-8/LC_CTYPE create mode 120000 locale/locale/en_US.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_US.UTF-8/LC_MONETARY create mode 120000 locale/locale/en_US.UTF-8/LC_NUMERIC create mode 120000 locale/locale/en_US.UTF-8/LC_TIME create mode 120000 locale/locale/en_US/LC_COLLATE create mode 120000 locale/locale/en_US/LC_CTYPE create mode 120000 locale/locale/en_US/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/en_US/LC_MONETARY create mode 120000 locale/locale/en_US/LC_NUMERIC create mode 120000 locale/locale/en_US/LC_TIME create mode 100644 locale/locale/eo/LC_MESSAGES/texinfo.mo create mode 100644 locale/locale/es_ES.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/es_ES.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/es_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/es_ES.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/es_ES.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/es_ES.ISO8859-1/LC_TIME create mode 100644 locale/locale/es_ES.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/es_ES.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/es_ES.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/es_ES.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/es_ES.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/es_ES.ISO8859-15/LC_TIME create mode 120000 locale/locale/es_ES.UTF-8/LC_COLLATE create mode 120000 locale/locale/es_ES.UTF-8/LC_CTYPE create mode 120000 locale/locale/es_ES.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/es_ES.UTF-8/LC_MONETARY create mode 120000 locale/locale/es_ES.UTF-8/LC_NUMERIC create mode 100644 locale/locale/es_ES.UTF-8/LC_TIME create mode 120000 locale/locale/es_ES/LC_COLLATE create mode 120000 locale/locale/es_ES/LC_CTYPE create mode 120000 locale/locale/es_ES/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/es_ES/LC_MONETARY create mode 120000 locale/locale/es_ES/LC_NUMERIC create mode 100644 locale/locale/es_ES/LC_TIME create mode 100644 locale/locale/et_EE.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/et_EE.ISO8859-15/LC_CTYPE create mode 100644 locale/locale/et_EE.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/et_EE.ISO8859-15/LC_MONETARY create mode 100644 locale/locale/et_EE.ISO8859-15/LC_NUMERIC create mode 100644 locale/locale/et_EE.ISO8859-15/LC_TIME create mode 120000 locale/locale/et_EE.UTF-8/LC_COLLATE create mode 120000 locale/locale/et_EE.UTF-8/LC_CTYPE create mode 120000 locale/locale/et_EE.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/et_EE.UTF-8/LC_MONETARY create mode 120000 locale/locale/et_EE.UTF-8/LC_NUMERIC create mode 100644 locale/locale/et_EE.UTF-8/LC_TIME create mode 120000 locale/locale/et_EE/LC_COLLATE create mode 120000 locale/locale/et_EE/LC_CTYPE create mode 120000 locale/locale/et_EE/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/et_EE/LC_MONETARY create mode 120000 locale/locale/et_EE/LC_NUMERIC create mode 100644 locale/locale/et_EE/LC_TIME create mode 120000 locale/locale/eu_ES.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/eu_ES.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/eu_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/eu_ES.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/eu_ES.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/eu_ES.ISO8859-1/LC_TIME create mode 120000 locale/locale/eu_ES.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/eu_ES.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/eu_ES.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/eu_ES.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/eu_ES.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/eu_ES.ISO8859-15/LC_TIME create mode 120000 locale/locale/eu_ES.UTF-8/LC_COLLATE create mode 120000 locale/locale/eu_ES.UTF-8/LC_CTYPE create mode 120000 locale/locale/eu_ES.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/eu_ES.UTF-8/LC_MONETARY create mode 120000 locale/locale/eu_ES.UTF-8/LC_NUMERIC create mode 120000 locale/locale/eu_ES.UTF-8/LC_TIME create mode 120000 locale/locale/eu_ES/LC_COLLATE create mode 120000 locale/locale/eu_ES/LC_CTYPE create mode 120000 locale/locale/eu_ES/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/eu_ES/LC_MONETARY create mode 120000 locale/locale/eu_ES/LC_NUMERIC create mode 120000 locale/locale/eu_ES/LC_TIME create mode 120000 locale/locale/fi_FI.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/fi_FI.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/fi_FI.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/fi_FI.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/fi_FI.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/fi_FI.ISO8859-1/LC_TIME create mode 120000 locale/locale/fi_FI.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/fi_FI.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/fi_FI.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fi_FI.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/fi_FI.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/fi_FI.ISO8859-15/LC_TIME create mode 120000 locale/locale/fi_FI.UTF-8/LC_COLLATE create mode 120000 locale/locale/fi_FI.UTF-8/LC_CTYPE create mode 120000 locale/locale/fi_FI.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fi_FI.UTF-8/LC_MONETARY create mode 120000 locale/locale/fi_FI.UTF-8/LC_NUMERIC create mode 100644 locale/locale/fi_FI.UTF-8/LC_TIME create mode 120000 locale/locale/fi_FI/LC_COLLATE create mode 120000 locale/locale/fi_FI/LC_CTYPE create mode 120000 locale/locale/fi_FI/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fi_FI/LC_MONETARY create mode 120000 locale/locale/fi_FI/LC_NUMERIC create mode 100644 locale/locale/fi_FI/LC_TIME create mode 100644 locale/locale/fr/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/fr_BE.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/fr_BE.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/fr_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/fr_BE.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/fr_BE.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/fr_BE.ISO8859-1/LC_TIME create mode 120000 locale/locale/fr_BE.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/fr_BE.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/fr_BE.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_BE.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/fr_BE.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/fr_BE.ISO8859-15/LC_TIME create mode 120000 locale/locale/fr_BE.UTF-8/LC_COLLATE create mode 120000 locale/locale/fr_BE.UTF-8/LC_CTYPE create mode 120000 locale/locale/fr_BE.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_BE.UTF-8/LC_MONETARY create mode 120000 locale/locale/fr_BE.UTF-8/LC_NUMERIC create mode 120000 locale/locale/fr_BE.UTF-8/LC_TIME create mode 120000 locale/locale/fr_BE/LC_COLLATE create mode 120000 locale/locale/fr_BE/LC_CTYPE create mode 120000 locale/locale/fr_BE/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_BE/LC_MONETARY create mode 120000 locale/locale/fr_BE/LC_NUMERIC create mode 120000 locale/locale/fr_BE/LC_TIME create mode 120000 locale/locale/fr_CA.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/fr_CA.ISO8859-1/LC_CTYPE create mode 120000 locale/locale/fr_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/fr_CA.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/fr_CA.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/fr_CA.ISO8859-1/LC_TIME create mode 120000 locale/locale/fr_CA.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/fr_CA.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/fr_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_CA.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/fr_CA.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/fr_CA.ISO8859-15/LC_TIME create mode 120000 locale/locale/fr_CA.UTF-8/LC_COLLATE create mode 120000 locale/locale/fr_CA.UTF-8/LC_CTYPE create mode 120000 locale/locale/fr_CA.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_CA.UTF-8/LC_MONETARY create mode 120000 locale/locale/fr_CA.UTF-8/LC_NUMERIC create mode 120000 locale/locale/fr_CA.UTF-8/LC_TIME create mode 120000 locale/locale/fr_CA/LC_COLLATE create mode 120000 locale/locale/fr_CA/LC_CTYPE create mode 120000 locale/locale/fr_CA/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_CA/LC_MONETARY create mode 120000 locale/locale/fr_CA/LC_NUMERIC create mode 120000 locale/locale/fr_CA/LC_TIME create mode 120000 locale/locale/fr_CH.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/fr_CH.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/fr_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_CH.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/fr_CH.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/fr_CH.ISO8859-1/LC_TIME create mode 120000 locale/locale/fr_CH.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/fr_CH.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/fr_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_CH.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/fr_CH.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/fr_CH.ISO8859-15/LC_TIME create mode 120000 locale/locale/fr_CH.UTF-8/LC_COLLATE create mode 120000 locale/locale/fr_CH.UTF-8/LC_CTYPE create mode 120000 locale/locale/fr_CH.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_CH.UTF-8/LC_MONETARY create mode 120000 locale/locale/fr_CH.UTF-8/LC_NUMERIC create mode 120000 locale/locale/fr_CH.UTF-8/LC_TIME create mode 120000 locale/locale/fr_CH/LC_COLLATE create mode 120000 locale/locale/fr_CH/LC_CTYPE create mode 120000 locale/locale/fr_CH/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_CH/LC_MONETARY create mode 120000 locale/locale/fr_CH/LC_NUMERIC create mode 120000 locale/locale/fr_CH/LC_TIME create mode 120000 locale/locale/fr_FR.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/fr_FR.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/fr_FR.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/fr_FR.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/fr_FR.ISO8859-1/LC_TIME create mode 120000 locale/locale/fr_FR.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/fr_FR.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/fr_FR.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_FR.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/fr_FR.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/fr_FR.ISO8859-15/LC_TIME create mode 120000 locale/locale/fr_FR.UTF-8/LC_COLLATE create mode 120000 locale/locale/fr_FR.UTF-8/LC_CTYPE create mode 120000 locale/locale/fr_FR.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_FR.UTF-8/LC_MONETARY create mode 120000 locale/locale/fr_FR.UTF-8/LC_NUMERIC create mode 100644 locale/locale/fr_FR.UTF-8/LC_TIME create mode 120000 locale/locale/fr_FR/LC_COLLATE create mode 120000 locale/locale/fr_FR/LC_CTYPE create mode 120000 locale/locale/fr_FR/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/fr_FR/LC_MONETARY create mode 120000 locale/locale/fr_FR/LC_NUMERIC create mode 100644 locale/locale/fr_FR/LC_TIME create mode 100644 locale/locale/he/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/he_IL.UTF-8/LC_COLLATE create mode 120000 locale/locale/he_IL.UTF-8/LC_CTYPE create mode 100644 locale/locale/he_IL.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/he_IL.UTF-8/LC_MONETARY create mode 120000 locale/locale/he_IL.UTF-8/LC_NUMERIC create mode 100644 locale/locale/he_IL.UTF-8/LC_TIME create mode 120000 locale/locale/he_IL/LC_COLLATE create mode 120000 locale/locale/he_IL/LC_CTYPE create mode 100644 locale/locale/he_IL/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/he_IL/LC_MONETARY create mode 120000 locale/locale/he_IL/LC_NUMERIC create mode 100644 locale/locale/he_IL/LC_TIME create mode 100644 locale/locale/hi_IN.ISCII-DEV/LC_COLLATE create mode 100644 locale/locale/hi_IN.ISCII-DEV/LC_CTYPE create mode 100644 locale/locale/hi_IN.ISCII-DEV/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/hi_IN.ISCII-DEV/LC_MONETARY create mode 100644 locale/locale/hi_IN.ISCII-DEV/LC_NUMERIC create mode 100644 locale/locale/hi_IN.ISCII-DEV/LC_TIME create mode 100644 locale/locale/hr/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/hr_HR.ISO8859-2/LC_COLLATE create mode 120000 locale/locale/hr_HR.ISO8859-2/LC_CTYPE create mode 100644 locale/locale/hr_HR.ISO8859-2/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/hr_HR.ISO8859-2/LC_MONETARY create mode 100644 locale/locale/hr_HR.ISO8859-2/LC_NUMERIC create mode 100644 locale/locale/hr_HR.ISO8859-2/LC_TIME create mode 120000 locale/locale/hr_HR.UTF-8/LC_COLLATE create mode 120000 locale/locale/hr_HR.UTF-8/LC_CTYPE create mode 120000 locale/locale/hr_HR.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/hr_HR.UTF-8/LC_MONETARY create mode 120000 locale/locale/hr_HR.UTF-8/LC_NUMERIC create mode 100644 locale/locale/hr_HR.UTF-8/LC_TIME create mode 120000 locale/locale/hr_HR/LC_COLLATE create mode 120000 locale/locale/hr_HR/LC_CTYPE create mode 120000 locale/locale/hr_HR/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/hr_HR/LC_MONETARY create mode 120000 locale/locale/hr_HR/LC_NUMERIC create mode 100644 locale/locale/hr_HR/LC_TIME create mode 120000 locale/locale/hu_HU.ISO8859-2/LC_COLLATE create mode 120000 locale/locale/hu_HU.ISO8859-2/LC_CTYPE create mode 100644 locale/locale/hu_HU.ISO8859-2/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/hu_HU.ISO8859-2/LC_MONETARY create mode 100644 locale/locale/hu_HU.ISO8859-2/LC_NUMERIC create mode 100644 locale/locale/hu_HU.ISO8859-2/LC_TIME create mode 120000 locale/locale/hu_HU.UTF-8/LC_COLLATE create mode 120000 locale/locale/hu_HU.UTF-8/LC_CTYPE create mode 120000 locale/locale/hu_HU.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/hu_HU.UTF-8/LC_MONETARY create mode 120000 locale/locale/hu_HU.UTF-8/LC_NUMERIC create mode 100644 locale/locale/hu_HU.UTF-8/LC_TIME create mode 120000 locale/locale/hu_HU/LC_COLLATE create mode 120000 locale/locale/hu_HU/LC_CTYPE create mode 120000 locale/locale/hu_HU/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/hu_HU/LC_MONETARY create mode 120000 locale/locale/hu_HU/LC_NUMERIC create mode 100644 locale/locale/hu_HU/LC_TIME create mode 100644 locale/locale/hy_AM.ARMSCII-8/LC_COLLATE create mode 100644 locale/locale/hy_AM.ARMSCII-8/LC_CTYPE create mode 100644 locale/locale/hy_AM.ARMSCII-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/hy_AM.ARMSCII-8/LC_MONETARY create mode 100644 locale/locale/hy_AM.ARMSCII-8/LC_NUMERIC create mode 100644 locale/locale/hy_AM.ARMSCII-8/LC_TIME create mode 120000 locale/locale/hy_AM.UTF-8/LC_COLLATE create mode 120000 locale/locale/hy_AM.UTF-8/LC_CTYPE create mode 100644 locale/locale/hy_AM.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/hy_AM.UTF-8/LC_MONETARY create mode 120000 locale/locale/hy_AM.UTF-8/LC_NUMERIC create mode 100644 locale/locale/hy_AM.UTF-8/LC_TIME create mode 120000 locale/locale/hy_AM/LC_COLLATE create mode 120000 locale/locale/hy_AM/LC_CTYPE create mode 100644 locale/locale/hy_AM/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/hy_AM/LC_MONETARY create mode 120000 locale/locale/hy_AM/LC_NUMERIC create mode 100644 locale/locale/hy_AM/LC_TIME create mode 100644 locale/locale/is_IS.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/is_IS.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/is_IS.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/is_IS.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/is_IS.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/is_IS.ISO8859-1/LC_TIME create mode 100644 locale/locale/is_IS.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/is_IS.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/is_IS.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/is_IS.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/is_IS.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/is_IS.ISO8859-15/LC_TIME create mode 120000 locale/locale/is_IS.UTF-8/LC_COLLATE create mode 120000 locale/locale/is_IS.UTF-8/LC_CTYPE create mode 120000 locale/locale/is_IS.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/is_IS.UTF-8/LC_MONETARY create mode 120000 locale/locale/is_IS.UTF-8/LC_NUMERIC create mode 100644 locale/locale/is_IS.UTF-8/LC_TIME create mode 120000 locale/locale/is_IS/LC_COLLATE create mode 120000 locale/locale/is_IS/LC_CTYPE create mode 120000 locale/locale/is_IS/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/is_IS/LC_MONETARY create mode 120000 locale/locale/is_IS/LC_NUMERIC create mode 100644 locale/locale/is_IS/LC_TIME create mode 120000 locale/locale/it_CH.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/it_CH.ISO8859-1/LC_CTYPE create mode 120000 locale/locale/it_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/it_CH.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/it_CH.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/it_CH.ISO8859-1/LC_TIME create mode 120000 locale/locale/it_CH.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/it_CH.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/it_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/it_CH.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/it_CH.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/it_CH.ISO8859-15/LC_TIME create mode 120000 locale/locale/it_CH.UTF-8/LC_COLLATE create mode 120000 locale/locale/it_CH.UTF-8/LC_CTYPE create mode 120000 locale/locale/it_CH.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/it_CH.UTF-8/LC_MONETARY create mode 120000 locale/locale/it_CH.UTF-8/LC_NUMERIC create mode 120000 locale/locale/it_CH.UTF-8/LC_TIME create mode 120000 locale/locale/it_CH/LC_COLLATE create mode 120000 locale/locale/it_CH/LC_CTYPE create mode 120000 locale/locale/it_CH/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/it_CH/LC_MONETARY create mode 120000 locale/locale/it_CH/LC_NUMERIC create mode 120000 locale/locale/it_CH/LC_TIME create mode 120000 locale/locale/it_IT.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/it_IT.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/it_IT.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/it_IT.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/it_IT.ISO8859-1/LC_TIME create mode 120000 locale/locale/it_IT.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/it_IT.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/it_IT.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/it_IT.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/it_IT.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/it_IT.ISO8859-15/LC_TIME create mode 120000 locale/locale/it_IT.UTF-8/LC_COLLATE create mode 120000 locale/locale/it_IT.UTF-8/LC_CTYPE create mode 120000 locale/locale/it_IT.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/it_IT.UTF-8/LC_MONETARY create mode 120000 locale/locale/it_IT.UTF-8/LC_NUMERIC create mode 100644 locale/locale/it_IT.UTF-8/LC_TIME create mode 120000 locale/locale/it_IT/LC_COLLATE create mode 120000 locale/locale/it_IT/LC_CTYPE create mode 120000 locale/locale/it_IT/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/it_IT/LC_MONETARY create mode 120000 locale/locale/it_IT/LC_NUMERIC create mode 100644 locale/locale/it_IT/LC_TIME create mode 100644 locale/locale/ja/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/ja_JP.SJIS/LC_COLLATE create mode 100644 locale/locale/ja_JP.SJIS/LC_CTYPE create mode 100644 locale/locale/ja_JP.SJIS/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/ja_JP.SJIS/LC_MONETARY create mode 120000 locale/locale/ja_JP.SJIS/LC_NUMERIC create mode 100644 locale/locale/ja_JP.SJIS/LC_TIME create mode 120000 locale/locale/ja_JP.UTF-8/LC_COLLATE create mode 120000 locale/locale/ja_JP.UTF-8/LC_CTYPE create mode 100644 locale/locale/ja_JP.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ja_JP.UTF-8/LC_MONETARY create mode 120000 locale/locale/ja_JP.UTF-8/LC_NUMERIC create mode 100644 locale/locale/ja_JP.UTF-8/LC_TIME create mode 120000 locale/locale/ja_JP.eucJP/LC_COLLATE create mode 100644 locale/locale/ja_JP.eucJP/LC_CTYPE create mode 100644 locale/locale/ja_JP.eucJP/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ja_JP.eucJP/LC_MONETARY create mode 100644 locale/locale/ja_JP.eucJP/LC_NUMERIC create mode 100644 locale/locale/ja_JP.eucJP/LC_TIME create mode 120000 locale/locale/ja_JP/LC_COLLATE create mode 120000 locale/locale/ja_JP/LC_CTYPE create mode 100644 locale/locale/ja_JP/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ja_JP/LC_MONETARY create mode 120000 locale/locale/ja_JP/LC_NUMERIC create mode 100644 locale/locale/ja_JP/LC_TIME create mode 100644 locale/locale/kk_KZ.PT154/LC_COLLATE create mode 100644 locale/locale/kk_KZ.PT154/LC_CTYPE create mode 100644 locale/locale/kk_KZ.PT154/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/kk_KZ.PT154/LC_MONETARY create mode 100644 locale/locale/kk_KZ.PT154/LC_NUMERIC create mode 100644 locale/locale/kk_KZ.PT154/LC_TIME create mode 120000 locale/locale/kk_KZ.UTF-8/LC_COLLATE create mode 120000 locale/locale/kk_KZ.UTF-8/LC_CTYPE create mode 100644 locale/locale/kk_KZ.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/kk_KZ.UTF-8/LC_MONETARY create mode 120000 locale/locale/kk_KZ.UTF-8/LC_NUMERIC create mode 100644 locale/locale/kk_KZ.UTF-8/LC_TIME create mode 120000 locale/locale/kk_KZ/LC_COLLATE create mode 120000 locale/locale/kk_KZ/LC_CTYPE create mode 100644 locale/locale/kk_KZ/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/kk_KZ/LC_MONETARY create mode 120000 locale/locale/kk_KZ/LC_NUMERIC create mode 100644 locale/locale/kk_KZ/LC_TIME create mode 120000 locale/locale/ko_KR.CP949/LC_COLLATE create mode 100644 locale/locale/ko_KR.CP949/LC_CTYPE create mode 120000 locale/locale/ko_KR.CP949/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/ko_KR.CP949/LC_MONETARY create mode 120000 locale/locale/ko_KR.CP949/LC_NUMERIC create mode 120000 locale/locale/ko_KR.CP949/LC_TIME create mode 120000 locale/locale/ko_KR.UTF-8/LC_COLLATE create mode 120000 locale/locale/ko_KR.UTF-8/LC_CTYPE create mode 120000 locale/locale/ko_KR.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ko_KR.UTF-8/LC_MONETARY create mode 120000 locale/locale/ko_KR.UTF-8/LC_NUMERIC create mode 100644 locale/locale/ko_KR.UTF-8/LC_TIME create mode 120000 locale/locale/ko_KR.eucKR/LC_COLLATE create mode 100644 locale/locale/ko_KR.eucKR/LC_CTYPE create mode 100644 locale/locale/ko_KR.eucKR/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ko_KR.eucKR/LC_MONETARY create mode 100644 locale/locale/ko_KR.eucKR/LC_NUMERIC create mode 100644 locale/locale/ko_KR.eucKR/LC_TIME create mode 120000 locale/locale/ko_KR/LC_COLLATE create mode 120000 locale/locale/ko_KR/LC_CTYPE create mode 120000 locale/locale/ko_KR/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ko_KR/LC_MONETARY create mode 120000 locale/locale/ko_KR/LC_NUMERIC create mode 100644 locale/locale/ko_KR/LC_TIME create mode 100644 locale/locale/la_LN.ISO8859-1/LC_COLLATE create mode 100644 locale/locale/la_LN.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/la_LN.ISO8859-1/LC_TIME create mode 100644 locale/locale/la_LN.ISO8859-15/LC_COLLATE create mode 100644 locale/locale/la_LN.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/la_LN.ISO8859-15/LC_TIME create mode 100644 locale/locale/la_LN.ISO8859-2/LC_COLLATE create mode 100644 locale/locale/la_LN.ISO8859-2/LC_CTYPE create mode 120000 locale/locale/la_LN.ISO8859-2/LC_TIME create mode 100644 locale/locale/la_LN.ISO8859-4/LC_COLLATE create mode 100644 locale/locale/la_LN.ISO8859-4/LC_CTYPE create mode 120000 locale/locale/la_LN.ISO8859-4/LC_TIME create mode 100644 locale/locale/la_LN.US-ASCII/LC_COLLATE create mode 100644 locale/locale/la_LN.US-ASCII/LC_CTYPE create mode 120000 locale/locale/la_LN.US-ASCII/LC_TIME create mode 100644 locale/locale/locale.alias create mode 100644 locale/locale/lt_LT.ISO8859-13/LC_COLLATE create mode 100644 locale/locale/lt_LT.ISO8859-13/LC_CTYPE create mode 100644 locale/locale/lt_LT.ISO8859-13/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/lt_LT.ISO8859-13/LC_MONETARY create mode 100644 locale/locale/lt_LT.ISO8859-13/LC_NUMERIC create mode 100644 locale/locale/lt_LT.ISO8859-13/LC_TIME create mode 100644 locale/locale/lt_LT.ISO8859-4/LC_COLLATE create mode 120000 locale/locale/lt_LT.ISO8859-4/LC_CTYPE create mode 120000 locale/locale/lt_LT.ISO8859-4/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/lt_LT.ISO8859-4/LC_MONETARY create mode 120000 locale/locale/lt_LT.ISO8859-4/LC_NUMERIC create mode 100644 locale/locale/lt_LT.ISO8859-4/LC_TIME create mode 120000 locale/locale/lt_LT.UTF-8/LC_COLLATE create mode 120000 locale/locale/lt_LT.UTF-8/LC_CTYPE create mode 120000 locale/locale/lt_LT.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/lt_LT.UTF-8/LC_MONETARY create mode 120000 locale/locale/lt_LT.UTF-8/LC_NUMERIC create mode 100644 locale/locale/lt_LT.UTF-8/LC_TIME create mode 120000 locale/locale/lt_LT/LC_COLLATE create mode 120000 locale/locale/lt_LT/LC_CTYPE create mode 120000 locale/locale/lt_LT/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/lt_LT/LC_MONETARY create mode 120000 locale/locale/lt_LT/LC_NUMERIC create mode 100644 locale/locale/lt_LT/LC_TIME create mode 100644 locale/locale/nb/LC_MESSAGES/texinfo.mo create mode 100644 locale/locale/nl/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/nl_BE.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/nl_BE.ISO8859-1/LC_CTYPE create mode 120000 locale/locale/nl_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/nl_BE.ISO8859-1/LC_MONETARY create mode 120000 locale/locale/nl_BE.ISO8859-1/LC_NUMERIC create mode 120000 locale/locale/nl_BE.ISO8859-1/LC_TIME create mode 120000 locale/locale/nl_BE.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/nl_BE.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/nl_BE.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/nl_BE.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/nl_BE.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/nl_BE.ISO8859-15/LC_TIME create mode 120000 locale/locale/nl_BE.UTF-8/LC_COLLATE create mode 120000 locale/locale/nl_BE.UTF-8/LC_CTYPE create mode 120000 locale/locale/nl_BE.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/nl_BE.UTF-8/LC_MONETARY create mode 120000 locale/locale/nl_BE.UTF-8/LC_NUMERIC create mode 120000 locale/locale/nl_BE.UTF-8/LC_TIME create mode 120000 locale/locale/nl_BE/LC_COLLATE create mode 120000 locale/locale/nl_BE/LC_CTYPE create mode 120000 locale/locale/nl_BE/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/nl_BE/LC_MONETARY create mode 120000 locale/locale/nl_BE/LC_NUMERIC create mode 120000 locale/locale/nl_BE/LC_TIME create mode 120000 locale/locale/nl_NL.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/nl_NL.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/nl_NL.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/nl_NL.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/nl_NL.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/nl_NL.ISO8859-1/LC_TIME create mode 120000 locale/locale/nl_NL.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/nl_NL.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/nl_NL.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/nl_NL.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/nl_NL.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/nl_NL.ISO8859-15/LC_TIME create mode 120000 locale/locale/nl_NL.UTF-8/LC_COLLATE create mode 120000 locale/locale/nl_NL.UTF-8/LC_CTYPE create mode 120000 locale/locale/nl_NL.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/nl_NL.UTF-8/LC_MONETARY create mode 120000 locale/locale/nl_NL.UTF-8/LC_NUMERIC create mode 120000 locale/locale/nl_NL.UTF-8/LC_TIME create mode 120000 locale/locale/nl_NL/LC_COLLATE create mode 120000 locale/locale/nl_NL/LC_CTYPE create mode 120000 locale/locale/nl_NL/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/nl_NL/LC_MONETARY create mode 120000 locale/locale/nl_NL/LC_NUMERIC create mode 120000 locale/locale/nl_NL/LC_TIME create mode 100644 locale/locale/no/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/no_NO.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/no_NO.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/no_NO.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/no_NO.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/no_NO.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/no_NO.ISO8859-1/LC_TIME create mode 120000 locale/locale/no_NO.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/no_NO.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/no_NO.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/no_NO.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/no_NO.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/no_NO.ISO8859-15/LC_TIME create mode 120000 locale/locale/no_NO.UTF-8/LC_COLLATE create mode 120000 locale/locale/no_NO.UTF-8/LC_CTYPE create mode 120000 locale/locale/no_NO.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/no_NO.UTF-8/LC_MONETARY create mode 120000 locale/locale/no_NO.UTF-8/LC_NUMERIC create mode 100644 locale/locale/no_NO.UTF-8/LC_TIME create mode 120000 locale/locale/no_NO/LC_COLLATE create mode 120000 locale/locale/no_NO/LC_CTYPE create mode 120000 locale/locale/no_NO/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/no_NO/LC_MONETARY create mode 120000 locale/locale/no_NO/LC_NUMERIC create mode 100644 locale/locale/no_NO/LC_TIME create mode 100644 locale/locale/pl/LC_MESSAGES/texinfo.mo create mode 100644 locale/locale/pl_PL.ISO8859-2/LC_COLLATE create mode 120000 locale/locale/pl_PL.ISO8859-2/LC_CTYPE create mode 100644 locale/locale/pl_PL.ISO8859-2/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/pl_PL.ISO8859-2/LC_MONETARY create mode 100644 locale/locale/pl_PL.ISO8859-2/LC_NUMERIC create mode 100644 locale/locale/pl_PL.ISO8859-2/LC_TIME create mode 120000 locale/locale/pl_PL.UTF-8/LC_COLLATE create mode 120000 locale/locale/pl_PL.UTF-8/LC_CTYPE create mode 120000 locale/locale/pl_PL.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/pl_PL.UTF-8/LC_MONETARY create mode 120000 locale/locale/pl_PL.UTF-8/LC_NUMERIC create mode 100644 locale/locale/pl_PL.UTF-8/LC_TIME create mode 120000 locale/locale/pl_PL/LC_COLLATE create mode 120000 locale/locale/pl_PL/LC_CTYPE create mode 120000 locale/locale/pl_PL/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/pl_PL/LC_MONETARY create mode 120000 locale/locale/pl_PL/LC_NUMERIC create mode 100644 locale/locale/pl_PL/LC_TIME create mode 120000 locale/locale/pt_BR.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/pt_BR.ISO8859-1/LC_CTYPE create mode 120000 locale/locale/pt_BR.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/pt_BR.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/pt_BR.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/pt_BR.ISO8859-1/LC_TIME create mode 120000 locale/locale/pt_BR.UTF-8/LC_COLLATE create mode 120000 locale/locale/pt_BR.UTF-8/LC_CTYPE create mode 120000 locale/locale/pt_BR.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/pt_BR.UTF-8/LC_MONETARY create mode 120000 locale/locale/pt_BR.UTF-8/LC_NUMERIC create mode 100644 locale/locale/pt_BR.UTF-8/LC_TIME create mode 120000 locale/locale/pt_BR/LC_COLLATE create mode 120000 locale/locale/pt_BR/LC_CTYPE create mode 120000 locale/locale/pt_BR/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/pt_BR/LC_MONETARY create mode 120000 locale/locale/pt_BR/LC_NUMERIC create mode 100644 locale/locale/pt_BR/LC_TIME create mode 120000 locale/locale/pt_PT.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/pt_PT.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/pt_PT.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/pt_PT.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/pt_PT.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/pt_PT.ISO8859-1/LC_TIME create mode 120000 locale/locale/pt_PT.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/pt_PT.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/pt_PT.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/pt_PT.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/pt_PT.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/pt_PT.ISO8859-15/LC_TIME create mode 120000 locale/locale/pt_PT.UTF-8/LC_COLLATE create mode 120000 locale/locale/pt_PT.UTF-8/LC_CTYPE create mode 120000 locale/locale/pt_PT.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/pt_PT.UTF-8/LC_MONETARY create mode 120000 locale/locale/pt_PT.UTF-8/LC_NUMERIC create mode 100644 locale/locale/pt_PT.UTF-8/LC_TIME create mode 120000 locale/locale/pt_PT/LC_COLLATE create mode 120000 locale/locale/pt_PT/LC_CTYPE create mode 120000 locale/locale/pt_PT/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/pt_PT/LC_MONETARY create mode 120000 locale/locale/pt_PT/LC_NUMERIC create mode 100644 locale/locale/pt_PT/LC_TIME create mode 100644 locale/locale/ro/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/ro_RO.ISO8859-2/LC_COLLATE create mode 120000 locale/locale/ro_RO.ISO8859-2/LC_CTYPE create mode 100644 locale/locale/ro_RO.ISO8859-2/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ro_RO.ISO8859-2/LC_MONETARY create mode 100644 locale/locale/ro_RO.ISO8859-2/LC_NUMERIC create mode 100644 locale/locale/ro_RO.ISO8859-2/LC_TIME create mode 120000 locale/locale/ro_RO.UTF-8/LC_COLLATE create mode 120000 locale/locale/ro_RO.UTF-8/LC_CTYPE create mode 120000 locale/locale/ro_RO.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/ro_RO.UTF-8/LC_MONETARY create mode 120000 locale/locale/ro_RO.UTF-8/LC_NUMERIC create mode 100644 locale/locale/ro_RO.UTF-8/LC_TIME create mode 120000 locale/locale/ro_RO/LC_COLLATE create mode 120000 locale/locale/ro_RO/LC_CTYPE create mode 120000 locale/locale/ro_RO/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/ro_RO/LC_MONETARY create mode 120000 locale/locale/ro_RO/LC_NUMERIC create mode 100644 locale/locale/ro_RO/LC_TIME create mode 100644 locale/locale/ru/LC_MESSAGES/texinfo.mo create mode 100644 locale/locale/ru_RU.CP1251/LC_COLLATE create mode 120000 locale/locale/ru_RU.CP1251/LC_CTYPE create mode 100644 locale/locale/ru_RU.CP1251/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ru_RU.CP1251/LC_MONETARY create mode 120000 locale/locale/ru_RU.CP1251/LC_NUMERIC create mode 100644 locale/locale/ru_RU.CP1251/LC_TIME create mode 100644 locale/locale/ru_RU.CP866/LC_COLLATE create mode 100644 locale/locale/ru_RU.CP866/LC_CTYPE create mode 100644 locale/locale/ru_RU.CP866/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ru_RU.CP866/LC_MONETARY create mode 120000 locale/locale/ru_RU.CP866/LC_NUMERIC create mode 100644 locale/locale/ru_RU.CP866/LC_TIME create mode 100644 locale/locale/ru_RU.ISO8859-5/LC_COLLATE create mode 100644 locale/locale/ru_RU.ISO8859-5/LC_CTYPE create mode 100644 locale/locale/ru_RU.ISO8859-5/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ru_RU.ISO8859-5/LC_MONETARY create mode 120000 locale/locale/ru_RU.ISO8859-5/LC_NUMERIC create mode 100644 locale/locale/ru_RU.ISO8859-5/LC_TIME create mode 100644 locale/locale/ru_RU.KOI8-R/LC_COLLATE create mode 100644 locale/locale/ru_RU.KOI8-R/LC_CTYPE create mode 100644 locale/locale/ru_RU.KOI8-R/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ru_RU.KOI8-R/LC_MONETARY create mode 100644 locale/locale/ru_RU.KOI8-R/LC_NUMERIC create mode 100644 locale/locale/ru_RU.KOI8-R/LC_TIME create mode 120000 locale/locale/ru_RU.UTF-8/LC_COLLATE create mode 120000 locale/locale/ru_RU.UTF-8/LC_CTYPE create mode 100644 locale/locale/ru_RU.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ru_RU.UTF-8/LC_MONETARY create mode 120000 locale/locale/ru_RU.UTF-8/LC_NUMERIC create mode 100644 locale/locale/ru_RU.UTF-8/LC_TIME create mode 120000 locale/locale/ru_RU/LC_COLLATE create mode 120000 locale/locale/ru_RU/LC_CTYPE create mode 100644 locale/locale/ru_RU/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/ru_RU/LC_MONETARY create mode 120000 locale/locale/ru_RU/LC_NUMERIC create mode 100644 locale/locale/ru_RU/LC_TIME create mode 120000 locale/locale/sk_SK.ISO8859-2/LC_COLLATE create mode 120000 locale/locale/sk_SK.ISO8859-2/LC_CTYPE create mode 120000 locale/locale/sk_SK.ISO8859-2/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/sk_SK.ISO8859-2/LC_MONETARY create mode 100644 locale/locale/sk_SK.ISO8859-2/LC_NUMERIC create mode 100644 locale/locale/sk_SK.ISO8859-2/LC_TIME create mode 120000 locale/locale/sk_SK.UTF-8/LC_COLLATE create mode 120000 locale/locale/sk_SK.UTF-8/LC_CTYPE create mode 120000 locale/locale/sk_SK.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/sk_SK.UTF-8/LC_MONETARY create mode 120000 locale/locale/sk_SK.UTF-8/LC_NUMERIC create mode 100644 locale/locale/sk_SK.UTF-8/LC_TIME create mode 120000 locale/locale/sk_SK/LC_COLLATE create mode 120000 locale/locale/sk_SK/LC_CTYPE create mode 120000 locale/locale/sk_SK/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/sk_SK/LC_MONETARY create mode 120000 locale/locale/sk_SK/LC_NUMERIC create mode 100644 locale/locale/sk_SK/LC_TIME create mode 100644 locale/locale/sl_SI.ISO8859-2/LC_COLLATE create mode 120000 locale/locale/sl_SI.ISO8859-2/LC_CTYPE create mode 100644 locale/locale/sl_SI.ISO8859-2/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/sl_SI.ISO8859-2/LC_MONETARY create mode 100644 locale/locale/sl_SI.ISO8859-2/LC_NUMERIC create mode 100644 locale/locale/sl_SI.ISO8859-2/LC_TIME create mode 120000 locale/locale/sl_SI.UTF-8/LC_COLLATE create mode 120000 locale/locale/sl_SI.UTF-8/LC_CTYPE create mode 120000 locale/locale/sl_SI.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/sl_SI.UTF-8/LC_MONETARY create mode 120000 locale/locale/sl_SI.UTF-8/LC_NUMERIC create mode 100644 locale/locale/sl_SI.UTF-8/LC_TIME create mode 120000 locale/locale/sl_SI/LC_COLLATE create mode 120000 locale/locale/sl_SI/LC_CTYPE create mode 120000 locale/locale/sl_SI/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/sl_SI/LC_MONETARY create mode 120000 locale/locale/sl_SI/LC_NUMERIC create mode 100644 locale/locale/sl_SI/LC_TIME create mode 120000 locale/locale/sr_YU.ISO8859-2/LC_COLLATE create mode 120000 locale/locale/sr_YU.ISO8859-2/LC_CTYPE create mode 100644 locale/locale/sr_YU.ISO8859-2/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/sr_YU.ISO8859-2/LC_MONETARY create mode 100644 locale/locale/sr_YU.ISO8859-2/LC_NUMERIC create mode 100644 locale/locale/sr_YU.ISO8859-2/LC_TIME create mode 100644 locale/locale/sr_YU.ISO8859-5/LC_COLLATE create mode 120000 locale/locale/sr_YU.ISO8859-5/LC_CTYPE create mode 100644 locale/locale/sr_YU.ISO8859-5/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/sr_YU.ISO8859-5/LC_MONETARY create mode 100644 locale/locale/sr_YU.ISO8859-5/LC_NUMERIC create mode 100644 locale/locale/sr_YU.ISO8859-5/LC_TIME create mode 120000 locale/locale/sr_YU.UTF-8/LC_COLLATE create mode 120000 locale/locale/sr_YU.UTF-8/LC_CTYPE create mode 100644 locale/locale/sr_YU.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/sr_YU.UTF-8/LC_MONETARY create mode 120000 locale/locale/sr_YU.UTF-8/LC_NUMERIC create mode 100644 locale/locale/sr_YU.UTF-8/LC_TIME create mode 120000 locale/locale/sr_YU/LC_COLLATE create mode 120000 locale/locale/sr_YU/LC_CTYPE create mode 100644 locale/locale/sr_YU/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/sr_YU/LC_MONETARY create mode 120000 locale/locale/sr_YU/LC_NUMERIC create mode 100644 locale/locale/sr_YU/LC_TIME create mode 100644 locale/locale/sv/LC_MESSAGES/texinfo.mo create mode 100644 locale/locale/sv_SE.ISO8859-1/LC_COLLATE create mode 120000 locale/locale/sv_SE.ISO8859-1/LC_CTYPE create mode 100644 locale/locale/sv_SE.ISO8859-1/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/sv_SE.ISO8859-1/LC_MONETARY create mode 100644 locale/locale/sv_SE.ISO8859-1/LC_NUMERIC create mode 100644 locale/locale/sv_SE.ISO8859-1/LC_TIME create mode 100644 locale/locale/sv_SE.ISO8859-15/LC_COLLATE create mode 120000 locale/locale/sv_SE.ISO8859-15/LC_CTYPE create mode 120000 locale/locale/sv_SE.ISO8859-15/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/sv_SE.ISO8859-15/LC_MONETARY create mode 120000 locale/locale/sv_SE.ISO8859-15/LC_NUMERIC create mode 120000 locale/locale/sv_SE.ISO8859-15/LC_TIME create mode 120000 locale/locale/sv_SE.UTF-8/LC_COLLATE create mode 120000 locale/locale/sv_SE.UTF-8/LC_CTYPE create mode 120000 locale/locale/sv_SE.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/sv_SE.UTF-8/LC_MONETARY create mode 120000 locale/locale/sv_SE.UTF-8/LC_NUMERIC create mode 100644 locale/locale/sv_SE.UTF-8/LC_TIME create mode 120000 locale/locale/sv_SE/LC_COLLATE create mode 120000 locale/locale/sv_SE/LC_CTYPE create mode 120000 locale/locale/sv_SE/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/sv_SE/LC_MONETARY create mode 120000 locale/locale/sv_SE/LC_NUMERIC create mode 100644 locale/locale/sv_SE/LC_TIME create mode 100644 locale/locale/tr/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/tr_TR.ISO8859-9/LC_COLLATE create mode 120000 locale/locale/tr_TR.ISO8859-9/LC_CTYPE create mode 100644 locale/locale/tr_TR.ISO8859-9/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/tr_TR.ISO8859-9/LC_MONETARY create mode 100644 locale/locale/tr_TR.ISO8859-9/LC_NUMERIC create mode 100644 locale/locale/tr_TR.ISO8859-9/LC_TIME create mode 120000 locale/locale/tr_TR.UTF-8/LC_COLLATE create mode 120000 locale/locale/tr_TR.UTF-8/LC_CTYPE create mode 120000 locale/locale/tr_TR.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/tr_TR.UTF-8/LC_MONETARY create mode 120000 locale/locale/tr_TR.UTF-8/LC_NUMERIC create mode 100644 locale/locale/tr_TR.UTF-8/LC_TIME create mode 120000 locale/locale/tr_TR/LC_COLLATE create mode 120000 locale/locale/tr_TR/LC_CTYPE create mode 120000 locale/locale/tr_TR/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/tr_TR/LC_MONETARY create mode 120000 locale/locale/tr_TR/LC_NUMERIC create mode 100644 locale/locale/tr_TR/LC_TIME create mode 100644 locale/locale/uk_UA.ISO8859-5/LC_COLLATE create mode 120000 locale/locale/uk_UA.ISO8859-5/LC_CTYPE create mode 100644 locale/locale/uk_UA.ISO8859-5/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/uk_UA.ISO8859-5/LC_MONETARY create mode 120000 locale/locale/uk_UA.ISO8859-5/LC_NUMERIC create mode 100644 locale/locale/uk_UA.ISO8859-5/LC_TIME create mode 100644 locale/locale/uk_UA.KOI8-U/LC_COLLATE create mode 100644 locale/locale/uk_UA.KOI8-U/LC_CTYPE create mode 100644 locale/locale/uk_UA.KOI8-U/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/uk_UA.KOI8-U/LC_MONETARY create mode 100644 locale/locale/uk_UA.KOI8-U/LC_NUMERIC create mode 100644 locale/locale/uk_UA.KOI8-U/LC_TIME create mode 120000 locale/locale/uk_UA.UTF-8/LC_COLLATE create mode 120000 locale/locale/uk_UA.UTF-8/LC_CTYPE create mode 100644 locale/locale/uk_UA.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/uk_UA.UTF-8/LC_MONETARY create mode 120000 locale/locale/uk_UA.UTF-8/LC_NUMERIC create mode 100644 locale/locale/uk_UA.UTF-8/LC_TIME create mode 120000 locale/locale/uk_UA/LC_COLLATE create mode 120000 locale/locale/uk_UA/LC_CTYPE create mode 100644 locale/locale/uk_UA/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/uk_UA/LC_MONETARY create mode 120000 locale/locale/uk_UA/LC_NUMERIC create mode 100644 locale/locale/uk_UA/LC_TIME create mode 120000 locale/locale/zh_CN.GB18030/LC_COLLATE create mode 100644 locale/locale/zh_CN.GB18030/LC_CTYPE create mode 100644 locale/locale/zh_CN.GB18030/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/zh_CN.GB18030/LC_MONETARY create mode 120000 locale/locale/zh_CN.GB18030/LC_NUMERIC create mode 100644 locale/locale/zh_CN.GB18030/LC_TIME create mode 120000 locale/locale/zh_CN.GB2312/LC_COLLATE create mode 100644 locale/locale/zh_CN.GB2312/LC_CTYPE create mode 100644 locale/locale/zh_CN.GB2312/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/zh_CN.GB2312/LC_MONETARY create mode 120000 locale/locale/zh_CN.GB2312/LC_NUMERIC create mode 100644 locale/locale/zh_CN.GB2312/LC_TIME create mode 120000 locale/locale/zh_CN.GBK/LC_COLLATE create mode 100644 locale/locale/zh_CN.GBK/LC_CTYPE create mode 120000 locale/locale/zh_CN.GBK/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/zh_CN.GBK/LC_MONETARY create mode 120000 locale/locale/zh_CN.GBK/LC_NUMERIC create mode 120000 locale/locale/zh_CN.GBK/LC_TIME create mode 120000 locale/locale/zh_CN.UTF-8/LC_COLLATE create mode 120000 locale/locale/zh_CN.UTF-8/LC_CTYPE create mode 100644 locale/locale/zh_CN.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/zh_CN.UTF-8/LC_MONETARY create mode 120000 locale/locale/zh_CN.UTF-8/LC_NUMERIC create mode 100644 locale/locale/zh_CN.UTF-8/LC_TIME create mode 120000 locale/locale/zh_CN.eucCN/LC_COLLATE create mode 100644 locale/locale/zh_CN.eucCN/LC_CTYPE create mode 100644 locale/locale/zh_CN.eucCN/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/zh_CN.eucCN/LC_MONETARY create mode 100644 locale/locale/zh_CN.eucCN/LC_NUMERIC create mode 100644 locale/locale/zh_CN.eucCN/LC_TIME create mode 120000 locale/locale/zh_CN/LC_COLLATE create mode 120000 locale/locale/zh_CN/LC_CTYPE create mode 100644 locale/locale/zh_CN/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/zh_CN/LC_MESSAGES/texinfo.mo create mode 100644 locale/locale/zh_CN/LC_MONETARY create mode 120000 locale/locale/zh_CN/LC_NUMERIC create mode 100644 locale/locale/zh_CN/LC_TIME create mode 120000 locale/locale/zh_HK.Big5HKSCS/LC_COLLATE create mode 100644 locale/locale/zh_HK.Big5HKSCS/LC_CTYPE create mode 120000 locale/locale/zh_HK.Big5HKSCS/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/zh_HK.Big5HKSCS/LC_MONETARY create mode 120000 locale/locale/zh_HK.Big5HKSCS/LC_NUMERIC create mode 120000 locale/locale/zh_HK.Big5HKSCS/LC_TIME create mode 120000 locale/locale/zh_HK.UTF-8/LC_COLLATE create mode 120000 locale/locale/zh_HK.UTF-8/LC_CTYPE create mode 120000 locale/locale/zh_HK.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/zh_HK.UTF-8/LC_MONETARY create mode 120000 locale/locale/zh_HK.UTF-8/LC_NUMERIC create mode 120000 locale/locale/zh_HK.UTF-8/LC_TIME create mode 120000 locale/locale/zh_HK/LC_COLLATE create mode 120000 locale/locale/zh_HK/LC_CTYPE create mode 120000 locale/locale/zh_HK/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/zh_HK/LC_MONETARY create mode 120000 locale/locale/zh_HK/LC_NUMERIC create mode 120000 locale/locale/zh_HK/LC_TIME create mode 120000 locale/locale/zh_TW.Big5/LC_COLLATE create mode 100644 locale/locale/zh_TW.Big5/LC_CTYPE create mode 100644 locale/locale/zh_TW.Big5/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/zh_TW.Big5/LC_MONETARY create mode 120000 locale/locale/zh_TW.Big5/LC_NUMERIC create mode 100644 locale/locale/zh_TW.Big5/LC_TIME create mode 120000 locale/locale/zh_TW.UTF-8/LC_COLLATE create mode 120000 locale/locale/zh_TW.UTF-8/LC_CTYPE create mode 100644 locale/locale/zh_TW.UTF-8/LC_MESSAGES/LC_MESSAGES create mode 120000 locale/locale/zh_TW.UTF-8/LC_MONETARY create mode 120000 locale/locale/zh_TW.UTF-8/LC_NUMERIC create mode 100644 locale/locale/zh_TW.UTF-8/LC_TIME create mode 120000 locale/locale/zh_TW/LC_COLLATE create mode 120000 locale/locale/zh_TW/LC_CTYPE create mode 100644 locale/locale/zh_TW/LC_MESSAGES/LC_MESSAGES create mode 100644 locale/locale/zh_TW/LC_MESSAGES/texinfo.mo create mode 120000 locale/locale/zh_TW/LC_MONETARY create mode 120000 locale/locale/zh_TW/LC_NUMERIC create mode 100644 locale/locale/zh_TW/LC_TIME create mode 100644 locale/mbrune.3 create mode 100644 locale/mbrune.c create mode 100644 locale/newlocale.3 create mode 100644 locale/querylocale.3 create mode 100644 locale/rune.3 create mode 100644 locale/runedepreciated.c create mode 100644 locale/runedepreciated.h create mode 100644 locale/setinvalidrune.c create mode 100644 locale/uselocale.3 create mode 100644 locale/utf2.5 create mode 100644 locale/wcstod_l.3 create mode 100644 locale/wcstol_l.3 create mode 100644 locale/xlocale.3 create mode 100644 locale/xlocale.c create mode 100644 locale/xlocale_private.h create mode 100644 man/FreeBSD/environ.7 create mode 100644 man/FreeBSD/stdarg.3 create mode 100644 man/assert.3 create mode 100644 man/bitstring.3 create mode 100644 man/gethostuuid.2 create mode 100644 man/manpages.lst create mode 100644 man/style.3 create mode 100644 man/utmp.5 create mode 100644 nbsdcompat/_nbsd_compat_.h create mode 100644 nbsdcompat/namespace.h create mode 100644 net/CMakeLists.txt create mode 100644 net/FreeBSD/addr2ascii.3 create mode 100644 net/FreeBSD/addr2ascii.c create mode 100644 net/FreeBSD/ascii2addr.c create mode 100644 net/FreeBSD/inet.3 create mode 100644 net/FreeBSD/inet_addr.c create mode 100644 net/FreeBSD/inet_lnaof.c create mode 100644 net/FreeBSD/inet_makeaddr.c create mode 100644 net/FreeBSD/inet_net.3 create mode 100644 net/FreeBSD/inet_net_ntop.c create mode 100644 net/FreeBSD/inet_net_pton.c create mode 100644 net/FreeBSD/inet_neta.c create mode 100644 net/FreeBSD/inet_netof.c create mode 100644 net/FreeBSD/inet_network.c create mode 100644 net/FreeBSD/inet_ntoa.c create mode 100644 net/FreeBSD/linkaddr.3 create mode 100644 net/FreeBSD/linkaddr.c create mode 100644 net/FreeBSD/nsap_addr.c create mode 100644 net/FreeBSD/recv.c create mode 100644 net/FreeBSD/send.c create mode 100644 net/FreeBSD/sockatmark.3 create mode 100644 net/FreeBSD/sockatmark.c create mode 100644 net/FreeBSD/sourcefilter.3 create mode 100644 net/FreeBSD/sourcefilter.c create mode 100644 net/byteorder.3 create mode 100644 net/ethers.3 create mode 100644 net/inet_ntop.c create mode 100644 net/inet_pton.c create mode 100644 nls/CMakeLists.txt create mode 100644 nls/FreeBSD/catclose.3 create mode 100644 nls/FreeBSD/catgets.3 create mode 100644 nls/FreeBSD/catopen.3 create mode 100644 nls/FreeBSD/msgcat.c create mode 100644 nls/FreeBSD/msgcat.h create mode 100644 os/CMakeLists.txt create mode 100644 os/api.h create mode 100644 os/assumes.c create mode 100644 os/assumes.h create mode 100644 os/debug_private.c create mode 100644 os/debug_private.h create mode 100644 os/linker_set.h create mode 100644 os/variant_private.h create mode 100644 posix1e/CMakeLists.txt create mode 100644 posix1e/acl.3 create mode 100644 posix1e/acl.c create mode 100644 posix1e/acl_add_flag_np.3 create mode 100644 posix1e/acl_add_perm.3 create mode 100644 posix1e/acl_clear_flags_np.3 create mode 100644 posix1e/acl_clear_perms.3 create mode 100644 posix1e/acl_copy_entry.3 create mode 100644 posix1e/acl_copy_ext.3 create mode 100644 posix1e/acl_create_entry.3 create mode 100644 posix1e/acl_delete.3 create mode 100644 posix1e/acl_delete_entry.3 create mode 100644 posix1e/acl_delete_flag_np.3 create mode 100644 posix1e/acl_delete_perm.3 create mode 100644 posix1e/acl_dup.3 create mode 100644 posix1e/acl_entry.c create mode 100644 posix1e/acl_file.c create mode 100644 posix1e/acl_flag.c create mode 100644 posix1e/acl_free.3 create mode 100644 posix1e/acl_from_text.3 create mode 100644 posix1e/acl_get.3 create mode 100644 posix1e/acl_get_entry.3 create mode 100644 posix1e/acl_get_fd.3 create mode 100644 posix1e/acl_get_flagset_np.3 create mode 100644 posix1e/acl_get_perm_np.3 create mode 100644 posix1e/acl_get_permset.3 create mode 100644 posix1e/acl_get_permset_mask_np.3 create mode 100644 posix1e/acl_get_qualifier.3 create mode 100644 posix1e/acl_get_tag_type.3 create mode 100644 posix1e/acl_init.3 create mode 100644 posix1e/acl_perm.c create mode 100644 posix1e/acl_set.3 create mode 100644 posix1e/acl_set_flagset_np.3 create mode 100644 posix1e/acl_set_permset.3 create mode 100644 posix1e/acl_set_qualifier.3 create mode 100644 posix1e/acl_set_tag_type.3 create mode 100644 posix1e/acl_to_text.3 create mode 100644 posix1e/acl_translate.c create mode 100644 posix1e/acl_valid.3 create mode 100644 posix1e/aclvar.h create mode 100644 private-include/_ctype.h create mode 100644 private-include/dirent.h create mode 100644 private-include/fnmatch.h create mode 100644 private-include/fts.h create mode 100644 private-include/ftw.h create mode 100644 private-include/glob.h create mode 100644 private-include/regex.h create mode 100644 private-include/signal.h create mode 100644 private-include/stdio.h create mode 100644 private-include/stdlib.h create mode 100644 private-include/string.h create mode 100644 private-include/sys/rbtree.h create mode 100644 private-include/time.h create mode 100644 private-include/unistd.h create mode 100644 private-include/wchar.h create mode 100644 private-include/wctype.h create mode 100644 private-include/xlocale.h create mode 100644 private-include/xlocale/_ctype.h create mode 100644 private-include/xlocale/_time.h create mode 100644 private-include/xlocale/_wchar.h create mode 100644 regex/CMakeLists.txt create mode 100644 regex/FreeBSD/COPYRIGHT create mode 100644 regex/FreeBSD/WHATSNEW create mode 100644 regex/FreeBSD/cname.h create mode 100644 regex/FreeBSD/re_format.7 create mode 100644 regex/FreeBSD/regerror.c create mode 100644 regex/FreeBSD/regex.3 create mode 100644 regex/FreeBSD/utils.h create mode 100644 regex/TRE/config.h create mode 100644 regex/TRE/lib/regcomp.c create mode 100644 regex/TRE/lib/regexec.c create mode 100644 regex/TRE/lib/tre-ast.c create mode 100644 regex/TRE/lib/tre-ast.h create mode 100644 regex/TRE/lib/tre-compile.c create mode 100644 regex/TRE/lib/tre-compile.h create mode 100644 regex/TRE/lib/tre-internal.h create mode 100644 regex/TRE/lib/tre-match-backtrack.c create mode 100644 regex/TRE/lib/tre-match-parallel.c create mode 100644 regex/TRE/lib/tre-match-utils.h create mode 100644 regex/TRE/lib/tre-mem.c create mode 100644 regex/TRE/lib/tre-mem.h create mode 100644 regex/TRE/lib/tre-parse.c create mode 100644 regex/TRE/lib/tre-parse.h create mode 100644 regex/TRE/lib/tre-stack.c create mode 100644 regex/TRE/lib/tre-stack.h create mode 100644 regex/TRE/lib/tre.h create mode 100644 regex/TRE/lib/xmalloc.h create mode 100644 regex/TRE/tre-0.8.0.tar.bz2 create mode 100644 regex/TRE/tre-config.h create mode 100644 regex/TRE/tre-last-matched.h create mode 100755 secure/CMakeLists.txt create mode 100644 secure/chk_fail.c create mode 100644 secure/memccpy_chk.c create mode 100644 secure/memcpy_chk.c create mode 100644 secure/memmove_chk.c create mode 100644 secure/memset_chk.c create mode 100644 secure/secure.h create mode 100644 secure/snprintf_chk.c create mode 100644 secure/sprintf_chk.c create mode 100644 secure/stpcpy_chk.c create mode 100644 secure/stpncpy_chk.c create mode 100644 secure/strcat_chk.c create mode 100644 secure/strcpy_chk.c create mode 100644 secure/strlcat_chk.c create mode 100644 secure/strlcpy_chk.c create mode 100644 secure/strncat_chk.c create mode 100644 secure/strncpy_chk.c create mode 100644 secure/vsnprintf_chk.c create mode 100644 secure/vsprintf_chk.c create mode 100644 stdio/CMakeLists.txt create mode 100644 stdio/FreeBSD/_flock_stub.c create mode 100644 stdio/FreeBSD/asprintf.c create mode 100644 stdio/FreeBSD/clrerr.c create mode 100644 stdio/FreeBSD/dprintf.c create mode 100644 stdio/FreeBSD/fclose.3 create mode 100644 stdio/FreeBSD/fclose.c create mode 100644 stdio/FreeBSD/fdopen.c create mode 100644 stdio/FreeBSD/feof.c create mode 100644 stdio/FreeBSD/ferror.3 create mode 100644 stdio/FreeBSD/ferror.c create mode 100644 stdio/FreeBSD/fflush.3 create mode 100644 stdio/FreeBSD/fflush.c create mode 100644 stdio/FreeBSD/fgetc.c create mode 100644 stdio/FreeBSD/fgetln.3 create mode 100644 stdio/FreeBSD/fgetln.c create mode 100644 stdio/FreeBSD/fgetpos.c create mode 100644 stdio/FreeBSD/fgets.3 create mode 100644 stdio/FreeBSD/fgets.c create mode 100644 stdio/FreeBSD/fgetwc.c create mode 100644 stdio/FreeBSD/fgetwln.3 create mode 100644 stdio/FreeBSD/fgetwln.c create mode 100644 stdio/FreeBSD/fgetws.3 create mode 100644 stdio/FreeBSD/fgetws.c create mode 100644 stdio/FreeBSD/fileno.c create mode 100644 stdio/FreeBSD/findfp.c create mode 100644 stdio/FreeBSD/flags.c create mode 100644 stdio/FreeBSD/floatio.h create mode 100644 stdio/FreeBSD/flockfile.3 create mode 100644 stdio/FreeBSD/fmemopen.c create mode 100644 stdio/FreeBSD/fopen.3 create mode 100644 stdio/FreeBSD/fopen.c create mode 100644 stdio/FreeBSD/fprintf.c create mode 100644 stdio/FreeBSD/fpurge.c create mode 100644 stdio/FreeBSD/fputc.c create mode 100644 stdio/FreeBSD/fputs.3 create mode 100644 stdio/FreeBSD/fputs.c create mode 100644 stdio/FreeBSD/fputwc.c create mode 100644 stdio/FreeBSD/fputws.3 create mode 100644 stdio/FreeBSD/fputws.c create mode 100644 stdio/FreeBSD/fread.3 create mode 100644 stdio/FreeBSD/fread.c create mode 100644 stdio/FreeBSD/freopen.c create mode 100644 stdio/FreeBSD/fscanf.c create mode 100644 stdio/FreeBSD/fseek.3 create mode 100644 stdio/FreeBSD/fseek.c create mode 100644 stdio/FreeBSD/fsetpos.c create mode 100644 stdio/FreeBSD/ftell.c create mode 100644 stdio/FreeBSD/funopen.3 create mode 100644 stdio/FreeBSD/funopen.c create mode 100644 stdio/FreeBSD/fvwrite.c create mode 100644 stdio/FreeBSD/fvwrite.h create mode 100644 stdio/FreeBSD/fwalk.c create mode 100644 stdio/FreeBSD/fwide.3 create mode 100644 stdio/FreeBSD/fwide.c create mode 100644 stdio/FreeBSD/fwprintf.c create mode 100644 stdio/FreeBSD/fwrite.c create mode 100644 stdio/FreeBSD/fwscanf.c create mode 100644 stdio/FreeBSD/getc.3 create mode 100644 stdio/FreeBSD/getc.c create mode 100644 stdio/FreeBSD/getchar.c create mode 100644 stdio/FreeBSD/getdelim.c create mode 100644 stdio/FreeBSD/getline.3 create mode 100644 stdio/FreeBSD/getline.c create mode 100644 stdio/FreeBSD/gets.c create mode 100644 stdio/FreeBSD/getw.c create mode 100644 stdio/FreeBSD/getwc.3 create mode 100644 stdio/FreeBSD/getwc.c create mode 100644 stdio/FreeBSD/getwchar.c create mode 100644 stdio/FreeBSD/glue.h create mode 100644 stdio/FreeBSD/local.h create mode 100644 stdio/FreeBSD/makebuf.c create mode 100644 stdio/FreeBSD/mktemp.3 create mode 100644 stdio/FreeBSD/mktemp.c create mode 100644 stdio/FreeBSD/open_memstream.3 create mode 100644 stdio/FreeBSD/open_memstream.c create mode 100644 stdio/FreeBSD/open_wmemstream.c create mode 100644 stdio/FreeBSD/perror.c create mode 100644 stdio/FreeBSD/printf-pos.c create mode 100644 stdio/FreeBSD/printf.3 create mode 100644 stdio/FreeBSD/printf.c create mode 100644 stdio/FreeBSD/printfcommon.h create mode 100644 stdio/FreeBSD/printflocal.h create mode 100644 stdio/FreeBSD/putc.3 create mode 100644 stdio/FreeBSD/putc.c create mode 100644 stdio/FreeBSD/putchar.c create mode 100644 stdio/FreeBSD/puts.c create mode 100644 stdio/FreeBSD/putw.c create mode 100644 stdio/FreeBSD/putwc.3 create mode 100644 stdio/FreeBSD/putwc.c create mode 100644 stdio/FreeBSD/putwchar.c create mode 100644 stdio/FreeBSD/refill.c create mode 100644 stdio/FreeBSD/remove.3 create mode 100644 stdio/FreeBSD/remove.c create mode 100644 stdio/FreeBSD/rewind.c create mode 100644 stdio/FreeBSD/rget.c create mode 100644 stdio/FreeBSD/scanf.3 create mode 100644 stdio/FreeBSD/scanf.c create mode 100644 stdio/FreeBSD/setbuf.3 create mode 100644 stdio/FreeBSD/setbuf.c create mode 100644 stdio/FreeBSD/setbuffer.c create mode 100644 stdio/FreeBSD/setvbuf.c create mode 100644 stdio/FreeBSD/snprintf.c create mode 100644 stdio/FreeBSD/sprintf.c create mode 100644 stdio/FreeBSD/sscanf.c create mode 100644 stdio/FreeBSD/stdio.3 create mode 100644 stdio/FreeBSD/stdio.c create mode 100644 stdio/FreeBSD/swprintf.c create mode 100644 stdio/FreeBSD/swscanf.c create mode 100644 stdio/FreeBSD/tempnam.c create mode 100644 stdio/FreeBSD/tmpfile.c create mode 100644 stdio/FreeBSD/tmpnam.3 create mode 100644 stdio/FreeBSD/tmpnam.c create mode 100644 stdio/FreeBSD/ungetc.3 create mode 100644 stdio/FreeBSD/ungetc.c create mode 100644 stdio/FreeBSD/ungetwc.3 create mode 100644 stdio/FreeBSD/ungetwc.c create mode 100644 stdio/FreeBSD/vasprintf.c create mode 100644 stdio/FreeBSD/vdprintf.c create mode 100644 stdio/FreeBSD/vfprintf.c create mode 100644 stdio/FreeBSD/vfscanf.c create mode 100644 stdio/FreeBSD/vfwprintf.c create mode 100644 stdio/FreeBSD/vfwscanf.c create mode 100644 stdio/FreeBSD/vprintf.c create mode 100644 stdio/FreeBSD/vscanf.c create mode 100644 stdio/FreeBSD/vsnprintf.c create mode 100644 stdio/FreeBSD/vsprintf.c create mode 100644 stdio/FreeBSD/vsscanf.c create mode 100644 stdio/FreeBSD/vswprintf.c create mode 100644 stdio/FreeBSD/vswscanf.c create mode 100644 stdio/FreeBSD/vwprintf.c create mode 100644 stdio/FreeBSD/vwscanf.c create mode 100644 stdio/FreeBSD/wbuf.c create mode 100644 stdio/FreeBSD/wprintf.3 create mode 100644 stdio/FreeBSD/wprintf.c create mode 100644 stdio/FreeBSD/wscanf.3 create mode 100644 stdio/FreeBSD/wscanf.c create mode 100644 stdio/FreeBSD/wsetup.c create mode 100644 stdio/FreeBSD/xprintf.c create mode 100644 stdio/FreeBSD/xprintf_errno.c create mode 100644 stdio/FreeBSD/xprintf_float.c create mode 100644 stdio/FreeBSD/xprintf_hexdump.c create mode 100644 stdio/FreeBSD/xprintf_int.c create mode 100644 stdio/FreeBSD/xprintf_private.h create mode 100644 stdio/FreeBSD/xprintf_quote.c create mode 100644 stdio/FreeBSD/xprintf_str.c create mode 100644 stdio/FreeBSD/xprintf_time.c create mode 100644 stdio/FreeBSD/xprintf_vis.c create mode 100644 stdio/getwc_l.3 create mode 100644 stdio/printf_l.3 create mode 100644 stdio/putwc_l.3 create mode 100644 stdio/scanf_l.3 create mode 100644 stdio/wprintf_l.3 create mode 100644 stdio/wscanf_l.3 create mode 100644 stdio/xprintf.3 create mode 100644 stdio/xprintf.5 create mode 100644 stdio/xprintf_all_in_one.c create mode 100644 stdio/xprintf_comp.3 create mode 100644 stdio/xprintf_comp.c create mode 100644 stdio/xprintf_domain.3 create mode 100644 stdio/xprintf_domain.c create mode 100644 stdio/xprintf_domain.h create mode 100644 stdio/xprintf_exec.3 create mode 100644 stdio/xprintf_exec.c create mode 100644 stdlib/CMakeLists.txt create mode 100644 stdlib/FreeBSD/_Exit_.c create mode 100644 stdlib/FreeBSD/abort.3 create mode 100644 stdlib/FreeBSD/abort.c create mode 100644 stdlib/FreeBSD/abs.3 create mode 100644 stdlib/FreeBSD/abs.c create mode 100644 stdlib/FreeBSD/alloca.3 create mode 100644 stdlib/FreeBSD/atexit.3 create mode 100644 stdlib/FreeBSD/atexit.c create mode 100644 stdlib/FreeBSD/atexit.h create mode 100644 stdlib/FreeBSD/atof.3 create mode 100644 stdlib/FreeBSD/atof.c create mode 100644 stdlib/FreeBSD/atoi.3 create mode 100644 stdlib/FreeBSD/atoi.c create mode 100644 stdlib/FreeBSD/atol.3 create mode 100644 stdlib/FreeBSD/atol.c create mode 100644 stdlib/FreeBSD/atoll.c create mode 100644 stdlib/FreeBSD/bsearch.3 create mode 100644 stdlib/FreeBSD/bsearch.c create mode 100644 stdlib/FreeBSD/div.3 create mode 100644 stdlib/FreeBSD/div.c create mode 100644 stdlib/FreeBSD/exit.3 create mode 100644 stdlib/FreeBSD/exit.c create mode 100644 stdlib/FreeBSD/getenv.3 create mode 100644 stdlib/FreeBSD/getenv.c create mode 100644 stdlib/FreeBSD/getopt.3 create mode 100644 stdlib/FreeBSD/getopt.c create mode 100644 stdlib/FreeBSD/getopt_long.3 create mode 100644 stdlib/FreeBSD/getopt_long.c create mode 100644 stdlib/FreeBSD/getsubopt.3 create mode 100644 stdlib/FreeBSD/getsubopt.c create mode 100644 stdlib/FreeBSD/hcreate.3 create mode 100644 stdlib/FreeBSD/hcreate.c create mode 100644 stdlib/FreeBSD/heapsort.c create mode 100644 stdlib/FreeBSD/heapsort_b.c create mode 100644 stdlib/FreeBSD/heapsort_r.c create mode 100644 stdlib/FreeBSD/imaxabs.3 create mode 100644 stdlib/FreeBSD/imaxabs.c create mode 100644 stdlib/FreeBSD/imaxdiv.3 create mode 100644 stdlib/FreeBSD/imaxdiv.c create mode 100644 stdlib/FreeBSD/insque.3 create mode 100644 stdlib/FreeBSD/insque.c create mode 100644 stdlib/FreeBSD/labs.3 create mode 100644 stdlib/FreeBSD/labs.c create mode 100644 stdlib/FreeBSD/ldiv.3 create mode 100644 stdlib/FreeBSD/ldiv.c create mode 100644 stdlib/FreeBSD/llabs.3 create mode 100644 stdlib/FreeBSD/llabs.c create mode 100644 stdlib/FreeBSD/lldiv.3 create mode 100644 stdlib/FreeBSD/lldiv.c create mode 100644 stdlib/FreeBSD/lsearch.3 create mode 100644 stdlib/FreeBSD/lsearch.c create mode 100644 stdlib/FreeBSD/memory.3 create mode 100644 stdlib/FreeBSD/merge.c create mode 100644 stdlib/FreeBSD/merge_b.c create mode 100644 stdlib/FreeBSD/psort.3 create mode 100644 stdlib/FreeBSD/psort.c create mode 100644 stdlib/FreeBSD/psort_b.c create mode 100644 stdlib/FreeBSD/psort_r.c create mode 100644 stdlib/FreeBSD/putenv.c create mode 100644 stdlib/FreeBSD/qsort.3 create mode 100644 stdlib/FreeBSD/qsort.c create mode 100644 stdlib/FreeBSD/qsort_r.c create mode 100644 stdlib/FreeBSD/radixsort.3 create mode 100644 stdlib/FreeBSD/radixsort.c create mode 100644 stdlib/FreeBSD/rand.3 create mode 100644 stdlib/FreeBSD/rand.c create mode 100644 stdlib/FreeBSD/random.3 create mode 100644 stdlib/FreeBSD/random.c create mode 100644 stdlib/FreeBSD/reallocf.c create mode 100644 stdlib/FreeBSD/realpath.3 create mode 100644 stdlib/FreeBSD/realpath.c create mode 100644 stdlib/FreeBSD/remque.c create mode 100644 stdlib/FreeBSD/setenv.c create mode 100644 stdlib/FreeBSD/strhash.c create mode 100644 stdlib/FreeBSD/strtod.3 create mode 100644 stdlib/FreeBSD/strtoimax.c create mode 100644 stdlib/FreeBSD/strtol.3 create mode 100644 stdlib/FreeBSD/strtol.c create mode 100644 stdlib/FreeBSD/strtoll.c create mode 100644 stdlib/FreeBSD/strtoq.c create mode 100644 stdlib/FreeBSD/strtoul.3 create mode 100644 stdlib/FreeBSD/strtoul.c create mode 100644 stdlib/FreeBSD/strtoull.c create mode 100644 stdlib/FreeBSD/strtoumax.c create mode 100644 stdlib/FreeBSD/strtouq.c create mode 100644 stdlib/FreeBSD/system.3 create mode 100644 stdlib/FreeBSD/system.c create mode 100644 stdlib/FreeBSD/tdelete.c create mode 100644 stdlib/FreeBSD/tfind.c create mode 100644 stdlib/FreeBSD/tsearch.3 create mode 100644 stdlib/FreeBSD/tsearch.c create mode 100644 stdlib/FreeBSD/twalk.c create mode 100644 stdlib/NetBSD/strfmon.3 create mode 100644 stdlib/NetBSD/strfmon.c create mode 100644 stdlib/OpenBSD/ecvt.3 create mode 100644 stdlib/OpenBSD/ecvt.c create mode 100644 stdlib/OpenBSD/gcvt.c create mode 100644 stdlib/a64l.3 create mode 100644 stdlib/a64l.c create mode 100644 stdlib/grantpt.3 create mode 100644 stdlib/grantpt.c create mode 100644 stdlib/l64a.c create mode 100644 stdlib/qsort_b.c create mode 100644 stdlib/strtod_l.3 create mode 100644 stdlib/strtol_l.3 create mode 100644 stdtime/CMakeLists.txt create mode 100644 stdtime/FreeBSD/asctime.c create mode 100644 stdtime/FreeBSD/ctime.3 create mode 100644 stdtime/FreeBSD/difftime.c create mode 100644 stdtime/FreeBSD/ftime.3 create mode 100644 stdtime/FreeBSD/ftime.c create mode 100644 stdtime/FreeBSD/localtime.c create mode 100644 stdtime/FreeBSD/private.h create mode 100644 stdtime/FreeBSD/strftime.3 create mode 100644 stdtime/FreeBSD/strftime.c create mode 100644 stdtime/FreeBSD/strptime.3 create mode 100644 stdtime/FreeBSD/strptime.c create mode 100644 stdtime/FreeBSD/time2posix.3 create mode 100644 stdtime/FreeBSD/time32.c create mode 100644 stdtime/FreeBSD/timelocal.c create mode 100644 stdtime/FreeBSD/timelocal.h create mode 100644 stdtime/FreeBSD/tzfile.5 create mode 100644 stdtime/FreeBSD/tzfile.h create mode 100644 stdtime/getdate.3 create mode 100644 stdtime/getdate.c create mode 100644 stdtime/timezone_unix03.c create mode 100644 string/CMakeLists.txt create mode 100644 string/FreeBSD/bcmp.3 create mode 100644 string/FreeBSD/bcopy.3 create mode 100644 string/FreeBSD/bstring.3 create mode 100644 string/FreeBSD/bzero.3 create mode 100644 string/FreeBSD/index.3 create mode 100644 string/FreeBSD/memccpy.3 create mode 100644 string/FreeBSD/memchr.3 create mode 100644 string/FreeBSD/memcmp.3 create mode 100644 string/FreeBSD/memcpy.3 create mode 100644 string/FreeBSD/memmem.3 create mode 100644 string/FreeBSD/memmem.c create mode 100644 string/FreeBSD/memmove.3 create mode 100644 string/FreeBSD/memset.3 create mode 100644 string/FreeBSD/rindex.3 create mode 100644 string/FreeBSD/rindex.c create mode 100644 string/FreeBSD/rpmatch.3 create mode 100644 string/FreeBSD/rpmatch.c create mode 100644 string/FreeBSD/strcasecmp.3 create mode 100644 string/FreeBSD/strcasecmp.c create mode 100644 string/FreeBSD/strcasestr.c create mode 100644 string/FreeBSD/strcat.3 create mode 100644 string/FreeBSD/strchr.3 create mode 100644 string/FreeBSD/strcmp.3 create mode 100644 string/FreeBSD/strcoll.3 create mode 100644 string/FreeBSD/strcoll.c create mode 100644 string/FreeBSD/strcpy.3 create mode 100644 string/FreeBSD/strcspn.c create mode 100644 string/FreeBSD/strdup.3 create mode 100644 string/FreeBSD/strdup.c create mode 100644 string/FreeBSD/strerror.3 create mode 100644 string/FreeBSD/strerror.c create mode 100644 string/FreeBSD/string.3 create mode 100644 string/FreeBSD/strlcpy.3 create mode 100644 string/FreeBSD/strlen.3 create mode 100644 string/FreeBSD/strmode.3 create mode 100644 string/FreeBSD/strmode.c create mode 100644 string/FreeBSD/strndup.c create mode 100644 string/FreeBSD/strnstr.c create mode 100644 string/FreeBSD/strpbrk.3 create mode 100644 string/FreeBSD/strpbrk.c create mode 100644 string/FreeBSD/strrchr.c create mode 100644 string/FreeBSD/strsep.3 create mode 100644 string/FreeBSD/strsep.c create mode 100644 string/FreeBSD/strsignal.c create mode 100644 string/FreeBSD/strspn.3 create mode 100644 string/FreeBSD/strspn.c create mode 100644 string/FreeBSD/strstr.3 create mode 100644 string/FreeBSD/strtok.3 create mode 100644 string/FreeBSD/strtok.c create mode 100644 string/FreeBSD/strxfrm.3 create mode 100644 string/FreeBSD/strxfrm.c create mode 100644 string/FreeBSD/swab.3 create mode 100644 string/FreeBSD/swab.c create mode 100644 string/FreeBSD/timingsafe_bcmp.3 create mode 100644 string/FreeBSD/timingsafe_bcmp.c create mode 100644 string/FreeBSD/wcpcpy.c create mode 100644 string/FreeBSD/wcpncpy.c create mode 100644 string/FreeBSD/wcscasecmp.c create mode 100644 string/FreeBSD/wcscat.c create mode 100644 string/FreeBSD/wcschr.c create mode 100644 string/FreeBSD/wcscmp.c create mode 100644 string/FreeBSD/wcscoll.3 create mode 100644 string/FreeBSD/wcscoll.c create mode 100644 string/FreeBSD/wcscpy.c create mode 100644 string/FreeBSD/wcscspn.c create mode 100644 string/FreeBSD/wcsdup.c create mode 100644 string/FreeBSD/wcslcat.c create mode 100644 string/FreeBSD/wcslcpy.c create mode 100644 string/FreeBSD/wcslen.c create mode 100644 string/FreeBSD/wcsncasecmp.c create mode 100644 string/FreeBSD/wcsncat.c create mode 100644 string/FreeBSD/wcsncmp.c create mode 100644 string/FreeBSD/wcsncpy.c create mode 100644 string/FreeBSD/wcsnlen.c create mode 100644 string/FreeBSD/wcspbrk.c create mode 100644 string/FreeBSD/wcsrchr.c create mode 100644 string/FreeBSD/wcsspn.c create mode 100644 string/FreeBSD/wcsstr.c create mode 100644 string/FreeBSD/wcstok.3 create mode 100644 string/FreeBSD/wcstok.c create mode 100644 string/FreeBSD/wcswidth.3 create mode 100644 string/FreeBSD/wcswidth.c create mode 100644 string/FreeBSD/wcsxfrm.3 create mode 100644 string/FreeBSD/wcsxfrm.c create mode 100644 string/FreeBSD/wmemchr.3 create mode 100644 string/FreeBSD/wmemchr.c create mode 100644 string/FreeBSD/wmemcmp.c create mode 100644 string/FreeBSD/wmemcpy.c create mode 100644 string/FreeBSD/wmemmove.c create mode 100644 string/FreeBSD/wmemset.c create mode 100644 string/NetBSD/memset_s.3 create mode 100644 string/NetBSD/memset_s.c create mode 100644 string/bcopy.c create mode 100644 string/memset_pattern.3 create mode 100644 string/stpcpy.c create mode 100644 string/stpncpy.c create mode 100644 string/strcat.c create mode 100644 string/strncat.c create mode 100644 sys/CMakeLists.txt create mode 100644 sys/OSMemoryNotification.c create mode 100644 sys/OSThermalNotification.c create mode 100644 sys/OpenBSD/stack_protector.c create mode 100644 sys/_libc_fork_child.c create mode 100644 sys/_libc_init.c create mode 100644 sys/chmodx_np.c create mode 100644 sys/crt_externs.c create mode 100644 sys/fork.c create mode 100644 sys/getgroups.c create mode 100644 sys/gettimeofday.c create mode 100644 sys/msgctl.c create mode 100644 sys/nanosleep.2 create mode 100644 sys/openx_np.c create mode 100644 sys/posix_spawn.c create mode 100644 sys/semctl.c create mode 100644 sys/settimeofday.c create mode 100644 sys/shmctl.c create mode 100644 sys/sigaction.c create mode 100644 sys/sigwait.2 create mode 100644 sys/statx_np.c create mode 100644 sys/umaskx_np.c create mode 100644 util/CMakeLists.txt create mode 100644 util/fparseln.3 create mode 100644 util/fparseln.c create mode 100644 util/login.3 create mode 100644 util/login.c create mode 100644 util/login_tty.c create mode 100644 util/logout.c create mode 100644 util/logwtmp.c create mode 100644 util/mkpath_np.3 create mode 100644 util/mkpath_np.c create mode 100644 util/opendev.3 create mode 100644 util/opendev.c create mode 100644 util/openpty.3 create mode 100644 util/pty.c create mode 100644 uuid/CMakeLists.txt create mode 100644 uuid/namespace.h create mode 100644 uuid/uuid-config.h create mode 100644 uuid/uuidman.sed create mode 100644 uuid/uuidsrc/clear.c create mode 100644 uuid/uuidsrc/compare.c create mode 100644 uuid/uuidsrc/copy.c create mode 100644 uuid/uuidsrc/gen_uuid.c create mode 100644 uuid/uuidsrc/isnull.c create mode 100644 uuid/uuidsrc/libuuid.3.in create mode 100644 uuid/uuidsrc/pack.c create mode 100644 uuid/uuidsrc/parse.c create mode 100644 uuid/uuidsrc/unpack.c create mode 100644 uuid/uuidsrc/unparse.c create mode 100644 uuid/uuidsrc/uuidP.h create mode 100644 uuid/uuidsrc/uuid_clear.3.in create mode 100644 uuid/uuidsrc/uuid_compare.3.in create mode 100644 uuid/uuidsrc/uuid_copy.3.in create mode 100644 uuid/uuidsrc/uuid_generate.3.in create mode 100644 uuid/uuidsrc/uuid_is_null.3.in create mode 100644 uuid/uuidsrc/uuid_parse.3.in create mode 100644 uuid/uuidsrc/uuid_unparse.3.in create mode 100644 weak_reference.h create mode 100644 x86_64/CMakeLists.txt create mode 100644 x86_64/gen/mcount.S create mode 100644 xcodescripts/Libc.order create mode 100644 xcodescripts/abort_unsupported.sh create mode 100644 xcodescripts/alias.list create mode 100755 xcodescripts/build_linklists.sh create mode 100644 xcodescripts/eos.xcconfig create mode 100755 xcodescripts/force_libc_to_build.sh create mode 100755 xcodescripts/generate_features.pl create mode 100755 xcodescripts/headers.sh create mode 100644 xcodescripts/legacy_alias.list create mode 100644 xcodescripts/libc.xcconfig create mode 100644 xcodescripts/libc_static.xcconfig create mode 100755 xcodescripts/manpages.sh create mode 100644 xcodescripts/patch_headers_variants.pl create mode 100755 xcodescripts/sanitise_headers.sh create mode 100755 xcodescripts/sim-compat-symlink.sh create mode 100755 xcodescripts/skip_installhdrs.sh create mode 100644 xcodescripts/strip-header.ed create mode 100644 xcodescripts/variants.xcconfig diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..12645b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +*~ +build/ +.DS_Store +*.xcodeproj/*.mode* +*.xcodeproj/*.pbxuser +*.xcodeproj/*.perspectivev3 + +# /Libc.xcodeproj/ +/Libc.xcodeproj/project.xcworkspace +/Libc.xcodeproj/xcuserdata +/Libc.xcodeproj/xcshareddata diff --git a/.upstream_base_commits b/.upstream_base_commits new file mode 100755 index 0000000..f1fa5e8 --- /dev/null +++ b/.upstream_base_commits @@ -0,0 +1,94 @@ +#freebsd = https://github.com/freebsd/freebsd.git +#openbsd = https://github.com/openbsd/src.git +#netbsd = https://github.com/NetBSD/src.git +gen/FreeBSD/basename.c freebsd lib/libc/gen/basename.c 26f49abeef12bd43e9671edee6df7b9905c97a47 +gen/FreeBSD/basename.3 freebsd lib/libc/gen/basename.3 26f49abeef12bd43e9671edee6df7b9905c97a47 +gen/FreeBSD/clock.3 freebsd lib/libc/gen/clock.3 5b882020081a138285227631c46a406c08e17bc8 +gen/FreeBSD/ctermid.3 freebsd lib/libc/gen/ctermid.3 5b882020081a138285227631c46a406c08e17bc8 +gen/FreeBSD/getbsize.c freebsd lib/libc/gen/getbsize.c 5b882020081a138285227631c46a406c08e17bc8 +gen/FreeBSD/getcwd.3 freebsd lib/libc/gen/getcwd.3 898928e8d0a0bab201c1ef232e01cafa27322dae +gen/FreeBSD/getpeereid.c freebsd lib/libc/gen/getpeereid.c 898928e8d0a0bab201c1ef232e01cafa27322dae +gen/FreeBSD/glob.c freebsd lib/libc/gen/glob.c ececcb3d95a00665500a1f799a118fc4eaf6750b +gen/FreeBSD/glob.3 freebsd lib/libc/gen/glob.3 ececcb3d95a00665500a1f799a118fc4eaf6750b +gen/FreeBSD/raise3 freebsd lib/libc/gen/raise.3 6b42c90c1ff5f7c35431eced41b6213401521d3d +gen/FreeBSD/readpassphrase.c freebsd lib/libc/gen/readpassphrase.c 1f19a8fc755a14865a5a5b67d5fa895c4b7cf622 +gen/FreeBSD/readpassphrase.3 freebsd lib/libc/gen/readpassphrase.3 e0a2d4f15ed9e93fcb62544ed65f7a98e2339c3b +gen/FreeBSD/times.3 freebsd lib/libc/gen/times.3 5b882020081a138285227631c46a406c08e17bc8 +gen/FreeBSD/timespec_get.c freebsd lib/libc/gen/timespec_get.c 7cbaa4254c0f10f7c00014ce9591ca60abfa57fb +gen/FreeBSD/timespec_get.3 freebsd lib/libc/gen/timespec_get.3 7cbaa4254c0f10f7c00014ce9591ca60abfa57fb +gen/FreeBSD/ttyname.3 freebsd lib/libc/gen/ttyname.3 84be924362c6e5f469564d418c928c5b1b4a2457 +gen/FreeBSD/ttyslot.c freebsd lib/libc/gen/ttyslot.c 898928e8d0a0bab201c1ef232e01cafa27322dae +gen/FreeBSD/unvis.c freebsd contrib/libc-vis/unvis.c 9e3e4b88576d01efe1f56469cac79e116bb62c67 +gen/FreeBSD/unvis.3 freebsd contrib/libc-vis/unvis.3 9e3e4b88576d01efe1f56469cac79e116bb62c67 +gen/FreeBSD/usleep.3 freebsd lib/libc/gen/usleep.3 5b882020081a138285227631c46a406c08e17bc8 +gen/FreeBSD/vis.c freebsd contrib/libc-vis/unvis.c 9e3e4b88576d01efe1f56469cac79e116bb62c67 +gen/FreeBSD/vis.3 freebsd contrib/libc-vis/unvis.3 9e3e4b88576d01efe1f56469cac79e116bb62c67 +gen/FreeBSD/vis.h freebsd contrib/libc-vis/unvis.3 9e3e4b88576d01efe1f56469cac79e116bb62c67 +gen/NetBSD/rbtree.3 netbsd share/man/man3/rbtree.3 a6d78d4a28be21d6006d3c609f31967c0e536779 +gen/directory.3 freebsd lib/libc/gen/directory.3 7cbaa4254c0f10f7c00014ce9591ca60abfa57fb +gen/fts.c openbsd gen/fts.c 9936a0e983044822375a0d5cdebec20c3623866c +include/glob.h freebsd include/glob.h ececcb3d95a00665500a1f799a118fc4eaf6750b +include/readpassphrase.h freebsd include/readpassphrase.h e0a2d4f15ed9e93fcb62544ed65f7a98e2339c3b +locale/FreeBSD/ascii.c freebsd lib/libc/locale/ascii.c 93e484e00e1e2dc498a7f4c45c0019e43b8ec5b2 +locale/FreeBSD/isspecial.3 freebsd freebsd/lib/libc/locale/isspecial.3 5b882020081a138285227631c46a406c08e17bc8 +locale/FreeBSD/none.c freebsd lib/libc/locale/ascii.c 93e484e00e1e2dc498a7f4c45c0019e43b8ec5b2 +locale/FreeBSD/setlocale.3 freebsd lib/libc/locale/setlocale.3 2131182e401759b74104a541a3b43cf2ee6a7434 +man/FreeBSD/environ.7 freebsd share/man/man7/environ.7 5b882020081a138285227631c46a406c08e17bc8 +net/FreeBSD/linkaddr.c freebsd lib/libc/net/linkaddr.c 9240f72512c0357636b2e19554d6141ee21edc5f +stdio/FreeBSD/fopen.3 freebsd lib/libc/stdio/fopen.3 89c1fcc0d088065021703b658ef547f46b5481f0 +stdio/FreeBSD/fmemopen.c freebsd lib/libc/stdio/fmemopen.c 89c1fcc0d088065021703b658ef547f46b5481f0 +stdio/FreeBSD/open_memstream.3 freebsd lib/libc/stdio/open_memstream.3 89c1fcc0d088065021703b658ef547f46b5481f0 +stdio/FreeBSD/open_memstream.c freebsd lib/libc/stdio/open_memstream.c 89c1fcc0d088065021703b658ef547f46b5481f0 +stdio/FreeBSD/open_wmemstream.c freebsd lib/libc/stdio/open_wmemstream.c 89c1fcc0d088065021703b658ef547f46b5481f0 +stdio/FreeBSD/makebuf.c freebsd lib/libc/stdio/makebuf.c c956a7530cd8282a920a11e1088adbb250169c06 +stdio/FreeBSD/makebuf.c netbsd lib/libc/stdio/makebuf.c 72b46443582ea9efbf25ede3b8f56c6646478d71 +stdio/FreeBSD/mktemp.3 freebsd lib/libc/stdio/mktemp.3 2895e1352cf3788606924d800c3a5c589520ea00 +stdio/FreeBSD/mktemp.c freebsd lib/libc/stdio/mktemp.c 2895e1352cf3788606924d800c3a5c589520ea00 +stdio/FreeBSD/printf.3 freebsd lib/libc/stdio/printf.3 cfc3df2b8f708ce8494d9d556e3472a5c8c21b8a +stdio/FreeBSD/wprintf.3 freebsd lib/libc/stdio/wprintf.3 5b882020081a138285227631c46a406c08e17bc8 +stdlib/FreeBSD/atexit.3 freebsd lib/libc/stdlib/atexit 956381ee95fa01eefc74c9228bdc474ba267750d +stdlib/FreeBSD/getenv.3 freebsd lib/libc/stdlib/getenv.3 3eb0ea4663f0ae19c4983e80963a121463224508 +stdlib/FreeBSD/getopt_long.3 freebsd lib/libc/stdlib/getopt_long.3 5b882020081a138285227631c46a406c08e17bc8 +stdlib/FreeBSD/qsort.c freebsd lib/libc/stdlib/qsort.c 4127dd6b50348062f74679dbb43008d0a2985a09 +stdlib/FreeBSD/reallocf.c freebsd lib/libc/stdlib/reallocf.c 3dc97c4341b6c5a0163c12badc7f50628cecf4e6 +stdtime/FreeBSD/localtime.c freebsd contrib/tzcode/stdtime/localtime.c a931eab7f4cf8a9614505540fb523b59f693cc6e +stdtime/FreeBSD/private.h freebsd contrib/tzcode/stdtime/private.h a931eab7f4cf8a9614505540fb523b59f693cc6e +stdtime/FreeBSD/strptime.c freebsd lib/libc/stdtime/strptime.c 52d53d171566c2cd975d2db86a291e516d34d9fe +stdtime/FreeBSD/strptime.3 freebsd lib/libc/stdtime/strptime.3 52d53d171566c2cd975d2db86a291e516d34d9fe +stdtime/FreeBSD/tzfile.h freebsd contrib/tzcode/stdtime/tzfile.h 000663e80955a044c229f9274011b828a788ee4b +stdtime/FreeBSD/tzfile.5 freebsd contrib/tzcode/stdtime/tzfile.5 000663e80955a044c229f9274011b828a788ee4b +string/FreeBSD/bcmp.3 freebsd lib/libc/string/bcmp.3 408f4a1ab49f89368c80edb4485895658fc81598 +string/FreeBSD/memcmp.3 freebsd lib/libc/string/memcmp.3 3eb0ea4663f0ae19c4983e80963a121463224508 +string/FreeBSD/rpmatch.c freebsd lib/libc/locale/rpmatch.c 8919cfa0b0054509fb3e01f3b22e140645bc6407 +string/FreeBSD/rpmatch.3 freebsd lib/libc/locale/rpmatch.3 8919cfa0b0054509fb3e01f3b22e140645bc6407 +string/FreeBSD/strcpy.3 freebsd lib/libc/string/strcpy.3 cfc3df2b8f708ce8494d9d556e3472a5c8c21b8a +string/FreeBSD/strlcpy.3 freebsd lib/libc/string/strlcpy.3 e3c83e4556db162d5b54833d2e9974a1152394eb +string/FreeBSD/strpbrk.3 freebsd lib/libc/string/strpbrk.3 5b882020081a138285227631c46a406c08e17bc8 +string/FreeBSD/strspn.3 freebsd lib/libc/string/strspn.3 5b882020081a138285227631c46a406c08e17bc8 +string/FreeBSD/strstr.3 freebsd lib/libc/string/strstr.3 cfc3df2b8f708ce8494d9d556e3472a5c8c21b8a +string/FreeBSD/timingsafe_bcmp.3 freebsd lib/libc/string/timingsafe_bcmp.3 408f4a1ab49f89368c80edb4485895658fc81598 +string/FreeBSD/timingsafe_bcmp.c freebsd lib/libc/string/timingsafe_bcmp.c 408f4a1ab49f89368c80edb4485895658fc81598 +tests/freebsd_fmemopen.c freebsd lib/libc/tests/stdio/fmemopen2_test.c 89c1fcc0d088065021703b658ef547f46b5481f0 +tests/freebsd_glob.c freebsd lib/libc/tests/gen/glob2_test.c ececcb3d95a00665500a1f799a118fc4eaf6750b +tests/freebsd_open_memstream.c freebsd lib/libc/tests/stdio/open_memstream2_test.c 89c1fcc0d088065021703b658ef547f46b5481f0 +tests/freebsd_open_wmemstream.c freebsd lib/libc/tests/stdio/open_wmemstream_test.c 89c1fcc0d088065021703b658ef547f46b5481f0 +tests/freebsd_qsort.c freebsd ./lib/libc/tests/stdlib/qsort_test.c 4127dd6b50348062f74679dbb43008d0a2985a09 +tests/freebsd_qsort.h freebsd ./lib/libc/tests/stdlib/test-sort.h 4127dd6b50348062f74679dbb43008d0a2985a09 +tests/netbsd_fmemopen.c freebsd contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c 89c1fcc0d088065021703b658ef547f46b5481f0 +tests/netbsd_open_memstream.c freebsd contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c 89c1fcc0d088065021703b658ef547f46b5481f0 +tests/netbsd_getcwd.c freebsd contrib/netbsd-tests/lib/libc/gen/t_getcwd.c 6f5b3c1fa3e9554a26cbf6401366ff8b0f0506fe +tests/netbsd_getenv_thread.c freebsd contrib/netbsd-tests/lib/libc/stdlib/t_getenv_thread.c 3f09b8d0af642c2aeb96a4d667cefb7fe3bce443 +tests/netbsd_glob.c freebsd contrib/netbsd-tests/lib/libc/gen/t_glob.c ececcb3d95a00665500a1f799a118fc4eaf6750b +tests/netbsd_printf.c freebsd contrib/netbsd-tests/lib/libc/stdio/t_printf.c 6ea6500b7eba4165c351cbbfcdec7f2fe776f8ac +tests/netbsd_stat.c freebsd contrib/netbsd-tests/lib/libc/sys/t_stat.c 6f5b3c1fa3e9554a26cbf6401366ff8b0f0506fe +tests/netbsd_strptime.c freebsd contrib/netbsd-tests/lib/libc/time/t_strptime.c 52d53d171566c2cd975d2db86a291e516d34d9fe +tests/netbsd_vis.c freebsd contrib/netbsd-tests/lib/libc/gen/t_vis.c 52d53d171566c2cd975d2db86a291e516d34d9fe +gen/FreeBSD/closedir.c freebsd lib/libc/gen/closedir.c b717fb9f083afdfbc50a14ced6ddc971ca583f02 +gen/FreeBSD/opendir.c freebsd lib/libc/gen/opendir.c 6e91d78151e10ed31c475cafe6a1e1f11950c1d9 +gen/FreeBSD/readdir.c freebsd lib/libc/gen/readdir.c 74c1506b3359ee725c9031331908b717460830dc +gen/FreeBSD/rewinddir.c freebsd lib/libc/gen/rewinddir.c 74c1506b3359ee725c9031331908b717460830dc +gen/FreeBSD/scandir.c freebsd lib/libc/gen/scandir.c 0127b103f27578fc7f9cc3389b299f221deb1d4c +gen/FreeBSD/scandir_b.c freebsd lib/libc/gen/scandir_b.c 0127b103f27578fc7f9cc3389b299f221deb1d4c +gen/FreeBSD/seekdir.c freebsd lib/libc/gen/seekdir.c 74c1506b3359ee725c9031331908b717460830dc +gen/FreeBSD/telldir.c freebsd lib/libc/gen/telldir.c 74c1506b3359ee725c9031331908b717460830dc +net/inet_ntop.c freebsd lib/libc/inet/inet_ntop.c f0171d33b464dee5ac308f1d13ede2ddd9d030a7 diff --git a/APPLE_LICENSE b/APPLE_LICENSE new file mode 100644 index 0000000..fe81a60 --- /dev/null +++ b/APPLE_LICENSE @@ -0,0 +1,367 @@ +APPLE PUBLIC SOURCE LICENSE +Version 2.0 - August 6, 2003 + +Please read this License carefully before downloading this software. +By downloading or using this software, you are agreeing to be bound by +the terms of this License. If you do not or cannot agree to the terms +of this License, please do not download or use the software. + +1. General; Definitions. This License applies to any program or other +work which Apple Computer, Inc. ("Apple") makes publicly available and +which contains a notice placed by Apple identifying such program or +work as "Original Code" and stating that it is subject to the terms of +this Apple Public Source License version 2.0 ("License"). As used in +this License: + +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is +the grantor of rights, (i) claims of patents that are now or hereafter +acquired, owned by or assigned to Apple and (ii) that cover subject +matter contained in the Original Code, but only to the extent +necessary to use, reproduce and/or distribute the Original Code +without infringement; and (b) in the case where You are the grantor of +rights, (i) claims of patents that are now or hereafter acquired, +owned by or assigned to You and (ii) that cover subject matter in Your +Modifications, taken alone or in combination with Original Code. + +1.2 "Contributor" means any person or entity that creates or +contributes to the creation of Modifications. + +1.3 "Covered Code" means the Original Code, Modifications, the +combination of Original Code and any Modifications, and/or any +respective portions thereof. + +1.4 "Externally Deploy" means: (a) to sublicense, distribute or +otherwise make Covered Code available, directly or indirectly, to +anyone other than You; and/or (b) to use Covered Code, alone or as +part of a Larger Work, in any way to provide a service, including but +not limited to delivery of content, through electronic communication +with a client other than You. + +1.5 "Larger Work" means a work which combines Covered Code or portions +thereof with code not governed by the terms of this License. + +1.6 "Modifications" mean any addition to, deletion from, and/or change +to, the substance and/or structure of the Original Code, any previous +Modifications, the combination of Original Code and any previous +Modifications, and/or any respective portions thereof. When code is +released as a series of files, a Modification is: (a) any addition to +or deletion from the contents of a file containing Covered Code; +and/or (b) any new file or other representation of computer program +statements that contains any part of Covered Code. + +1.7 "Original Code" means (a) the Source Code of a program or other +work as originally made available by Apple under this License, +including the Source Code of any updates or upgrades to such programs +or works made available by Apple under this License, and that has been +expressly identified by Apple as such in the header file(s) of such +work; and (b) the object code compiled from such Source Code and +originally made available by Apple under this License. + +1.8 "Source Code" means the human readable form of a program or other +work that is suitable for making modifications to it, including all +modules it contains, plus any associated interface definition files, +scripts used to control compilation and installation of an executable +(object code). + +1.9 "You" or "Your" means an individual or a legal entity exercising +rights under this License. For legal entities, "You" or "Your" +includes any entity which controls, is controlled by, or is under +common control with, You, where "control" means (a) the power, direct +or indirect, to cause the direction or management of such entity, +whether by contract or otherwise, or (b) ownership of fifty percent +(50%) or more of the outstanding shares or beneficial ownership of +such entity. + +2. Permitted Uses; Conditions & Restrictions. Subject to the terms +and conditions of this License, Apple hereby grants You, effective on +the date You accept this License and download the Original Code, a +world-wide, royalty-free, non-exclusive license, to the extent of +Apple's Applicable Patent Rights and copyrights covering the Original +Code, to do the following: + +2.1 Unmodified Code. You may use, reproduce, display, perform, +internally distribute within Your organization, and Externally Deploy +verbatim, unmodified copies of the Original Code, for commercial or +non-commercial purposes, provided that in each instance: + +(a) You must retain and reproduce in all copies of Original Code the +copyright and other proprietary notices and disclaimers of Apple as +they appear in the Original Code, and keep intact all notices in the +Original Code that refer to this License; and + +(b) You must include a copy of this License with every copy of Source +Code of Covered Code and documentation You distribute or Externally +Deploy, and You may not offer or impose any terms on such Source Code +that alter or restrict this License or the recipients' rights +hereunder, except as permitted under Section 6. + +2.2 Modified Code. You may modify Covered Code and use, reproduce, +display, perform, internally distribute within Your organization, and +Externally Deploy Your Modifications and Covered Code, for commercial +or non-commercial purposes, provided that in each instance You also +meet all of these conditions: + +(a) You must satisfy all the conditions of Section 2.1 with respect to +the Source Code of the Covered Code; + +(b) You must duplicate, to the extent it does not already exist, the +notice in Exhibit A in each file of the Source Code of all Your +Modifications, and cause the modified files to carry prominent notices +stating that You changed the files and the date of any change; and + +(c) If You Externally Deploy Your Modifications, You must make +Source Code of all Your Externally Deployed Modifications either +available to those to whom You have Externally Deployed Your +Modifications, or publicly available. Source Code of Your Externally +Deployed Modifications must be released under the terms set forth in +this License, including the license grants set forth in Section 3 +below, for as long as you Externally Deploy the Covered Code or twelve +(12) months from the date of initial External Deployment, whichever is +longer. You should preferably distribute the Source Code of Your +Externally Deployed Modifications electronically (e.g. download from a +web site). + +2.3 Distribution of Executable Versions. In addition, if You +Externally Deploy Covered Code (Original Code and/or Modifications) in +object code, executable form only, You must include a prominent +notice, in the code itself as well as in related documentation, +stating that Source Code of the Covered Code is available under the +terms of this License with information on how and where to obtain such +Source Code. + +2.4 Third Party Rights. You expressly acknowledge and agree that +although Apple and each Contributor grants the licenses to their +respective portions of the Covered Code set forth herein, no +assurances are provided by Apple or any Contributor that the Covered +Code does not infringe the patent or other intellectual property +rights of any other entity. Apple and each Contributor disclaim any +liability to You for claims brought by any other entity based on +infringement of intellectual property rights or otherwise. As a +condition to exercising the rights and licenses granted hereunder, You +hereby assume sole responsibility to secure any other intellectual +property rights needed, if any. For example, if a third party patent +license is required to allow You to distribute the Covered Code, it is +Your responsibility to acquire that license before distributing the +Covered Code. + +3. Your Grants. In consideration of, and as a condition to, the +licenses granted to You under this License, You hereby grant to any +person or entity receiving or distributing Covered Code under this +License a non-exclusive, royalty-free, perpetual, irrevocable license, +under Your Applicable Patent Rights and other intellectual property +rights (other than patent) owned or controlled by You, to use, +reproduce, display, perform, modify, sublicense, distribute and +Externally Deploy Your Modifications of the same scope and extent as +Apple's licenses under Sections 2.1 and 2.2 above. + +4. Larger Works. You may create a Larger Work by combining Covered +Code with other code not governed by the terms of this License and +distribute the Larger Work as a single product. In each such instance, +You must make sure the requirements of this License are fulfilled for +the Covered Code or any portion thereof. + +5. Limitations on Patent License. Except as expressly stated in +Section 2, no other patent rights, express or implied, are granted by +Apple herein. Modifications and/or Larger Works may require additional +patent licenses from Apple which Apple may grant in its sole +discretion. + +6. Additional Terms. You may choose to offer, and to charge a fee for, +warranty, support, indemnity or liability obligations and/or other +rights consistent with the scope of the license granted herein +("Additional Terms") to one or more recipients of Covered Code. +However, You may do so only on Your own behalf and as Your sole +responsibility, and not on behalf of Apple or any Contributor. You +must obtain the recipient's agreement that any such Additional Terms +are offered by You alone, and You hereby agree to indemnify, defend +and hold Apple and every Contributor harmless for any liability +incurred by or claims asserted against Apple or such Contributor by +reason of any such Additional Terms. + +7. Versions of the License. Apple may publish revised and/or new +versions of this License from time to time. Each version will be given +a distinguishing version number. Once Original Code has been published +under a particular version of this License, You may continue to use it +under the terms of that version. You may also choose to use such +Original Code under the terms of any subsequent version of this +License published by Apple. No one other than Apple has the right to +modify the terms applicable to Covered Code created under this +License. + +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in +part pre-release, untested, or not fully tested works. The Covered +Code may contain errors that could cause failures or loss of data, and +may be incomplete or contain inaccuracies. You expressly acknowledge +and agree that use of the Covered Code, or any portion thereof, is at +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. +You acknowledge that the Covered Code is not intended for use in the +operation of nuclear facilities, aircraft navigation, communication +systems, or air traffic control machines in which case the failure of +the Covered Code could lead to death, personal injury, or severe +physical or environmental damage. + +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY +TO YOU. In no event shall Apple's total liability to You for all +damages (other than as may be required by applicable law) under this +License exceed the amount of fifty dollars ($50.00). + +10. Trademarks. This License does not grant any rights to use the +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS", +"QuickTime", "QuickTime Streaming Server" or any other trademarks, +service marks, logos or trade names belonging to Apple (collectively +"Apple Marks") or to any trademark, service mark, logo or trade name +belonging to any Contributor. You agree not to use any Apple Marks in +or as part of the name of products derived from the Original Code or +to endorse or promote products derived from the Original Code other +than as expressly permitted by and in strict compliance at all times +with Apple's third party trademark usage guidelines which are posted +at http://www.apple.com/legal/guidelinesfor3rdparties.html. + +11. Ownership. Subject to the licenses granted under this License, +each Contributor retains all rights, title and interest in and to any +Modifications made by such Contributor. Apple retains all rights, +title and interest in and to the Original Code and any Modifications +made by or on behalf of Apple ("Apple Modifications"), and such Apple +Modifications will not be automatically subject to this License. Apple +may, at its sole discretion, choose to license such Apple +Modifications under this License, or on different terms from those +contained in this License or may choose not to license them at all. + +12. Termination. + +12.1 Termination. This License and the rights granted hereunder will +terminate: + +(a) automatically without notice from Apple if You fail to comply with +any term(s) of this License and fail to cure such breach within 30 +days of becoming aware of such breach; + +(b) immediately in the event of the circumstances described in Section +13.5(b); or + +(c) automatically without notice from Apple if You, at any time during +the term of this License, commence an action for patent infringement +against Apple; provided that Apple did not first commence +an action for patent infringement against You in that instance. + +12.2 Effect of Termination. Upon termination, You agree to immediately +stop any further use, reproduction, modification, sublicensing and +distribution of the Covered Code. All sublicenses to the Covered Code +which have been properly granted prior to termination shall survive +any termination of this License. Provisions which, by their nature, +should remain in effect beyond the termination of this License shall +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, +12.2 and 13. No party will be liable to any other for compensation, +indemnity or damages of any sort solely as a result of terminating +this License in accordance with its terms, and termination of this +License will be without prejudice to any other right or remedy of +any party. + +13. Miscellaneous. + +13.1 Government End Users. The Covered Code is a "commercial item" as +defined in FAR 2.101. Government software and technical data rights in +the Covered Code include only those rights customarily provided to the +public as defined in this License. This customary commercial license +in technical data and software is provided in accordance with FAR +12.211 (Technical Data) and 12.212 (Computer Software) and, for +Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- +Commercial Items) and 227.7202-3 (Rights in Commercial Computer +Software or Computer Software Documentation). Accordingly, all U.S. +Government End Users acquire Covered Code with only those rights set +forth herein. + +13.2 Relationship of Parties. This License will not be construed as +creating an agency, partnership, joint venture or any other form of +legal association between or among You, Apple or any Contributor, and +You will not represent to the contrary, whether expressly, by +implication, appearance or otherwise. + +13.3 Independent Development. Nothing in this License will impair +Apple's right to acquire, license, develop, have others develop for +it, market and/or distribute technology or products that perform the +same or similar functions as, or otherwise compete with, +Modifications, Larger Works, technology or products that You may +develop, produce, market or distribute. + +13.4 Waiver; Construction. Failure by Apple or any Contributor to +enforce any provision of this License will not be deemed a waiver of +future enforcement of that or any other provision. Any law or +regulation which provides that the language of a contract shall be +construed against the drafter will not apply to this License. + +13.5 Severability. (a) If for any reason a court of competent +jurisdiction finds any provision of this License, or portion thereof, +to be unenforceable, that provision of the License will be enforced to +the maximum extent permissible so as to effect the economic benefits +and intent of the parties, and the remainder of this License will +continue in full force and effect. (b) Notwithstanding the foregoing, +if applicable law prohibits or restricts You from fully and/or +specifically complying with Sections 2 and/or 3 or prevents the +enforceability of either of those Sections, this License will +immediately terminate and You must immediately discontinue any use of +the Covered Code and destroy all copies of it that are in your +possession or control. + +13.6 Dispute Resolution. Any litigation or other dispute resolution +between You and Apple relating to this License shall take place in the +Northern District of California, and You and Apple hereby consent to +the personal jurisdiction of, and venue in, the state and federal +courts within that District with respect to this License. The +application of the United Nations Convention on Contracts for the +International Sale of Goods is expressly excluded. + +13.7 Entire Agreement; Governing Law. This License constitutes the +entire agreement between the parties with respect to the subject +matter hereof. This License shall be governed by the laws of the +United States and the State of California, except that body of +California law concerning conflicts of law. + +Where You are located in the province of Quebec, Canada, the following +clause applies: The parties hereby confirm that they have requested +that this License and all related documents be drafted in English. Les +parties ont exige que le present contrat et tous les documents +connexes soient rediges en anglais. + +EXHIBIT A. + +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +Reserved. + +This file contains Original Code and/or Modifications of Original Code +as defined in and that are subject to the Apple Public Source License +Version 2.0 (the 'License'). You may not use this file except in +compliance with the License. Please obtain a copy of the License at +http://www.opensource.apple.com/apsl/ and read it before using this +file. + +The Original Code and all software distributed under the License are +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +Please see the License for the specific language governing rights and +limitations under the License." diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..fcfd060 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,250 @@ +project(darling-libsystem_c) + +cmake_minimum_required(VERSION 3.10) +if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) + cmake_policy(SET CMP0018 NEW) +endif(COMMAND cmake_policy) + +add_definitions(-DHAVE_STDINT_H=1) +add_definitions(-D__LIBC__ -D__DARWIN_UNIX03=1 -D__DARWIN_64_BIT_INO_T=1 -D__DARWIN_NON_CANCELABLE=1 -D__DARWIN_VERS_1050=1) +add_definitions("'-D__warn_references(name,warning)='") +add_definitions(-DBUILDING_LIBC -DPRIVATE) + +# Hide warnings that get spammed +add_definitions( + -Wno-gnu-include-next + -Wno-undef + -Wno-conversion + -Wno-unused-parameter + -Wno-sign-conversion + -Wno-macro-redefined +) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdinc -fPIC -w ") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/weak_reference.h") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -O0") # development flags +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -nostdlib -Wl,-bind_at_load") + +include_directories( + "${CMAKE_CURRENT_SOURCE_DIR}/fbsdcompat" + "${CMAKE_CURRENT_SOURCE_DIR}/darwin" + "${CMAKE_CURRENT_SOURCE_DIR}/derived" + "${CMAKE_CURRENT_SOURCE_DIR}/../external/libmalloc/src" + "${CMAKE_CURRENT_SOURCE_DIR}/../external/libmalloc/private" + "${CMAKE_CURRENT_SOURCE_DIR}/locale" + "${CMAKE_CURRENT_SOURCE_DIR}/gen" + "${CMAKE_CURRENT_SOURCE_DIR}/locale/FreeBSD" + "${CMAKE_CURRENT_SOURCE_DIR}/include/NetBSD" + "${CMAKE_CURRENT_SOURCE_DIR}/stdtime/FreeBSD" +) + +include_directories(BEFORE + "${CMAKE_CURRENT_SOURCE_DIR}/include" + "${CMAKE_CURRENT_SOURCE_DIR}/private-include" +) + +add_subdirectory(db) # produces libc-db +add_subdirectory(compat-43) # produces libc-compat +add_subdirectory(emulated) # produces libc-emulated +add_subdirectory(gdtoa) # produces libc-gdtoa +add_subdirectory(gen) +add_subdirectory(gmon) +add_subdirectory(os) +add_subdirectory(uuid) +add_subdirectory(util) +add_subdirectory(string) +add_subdirectory(stdtime) +add_subdirectory(sys) +add_subdirectory(stdlib) +add_subdirectory(stdio) +add_subdirectory(secure) +add_subdirectory(regex) +add_subdirectory(posix1e) +add_subdirectory(nls) +add_subdirectory(net) +add_subdirectory(locale) +add_subdirectory(darwin) +add_subdirectory(libdarwin) + +if (TARGET_i386) + add_subdirectory(i386) + set_property ( + TARGET + libc-stdio_legacy + libc-compat_legacy + libc-stdlib_legacy + libc-stdtime_legacy + libc-gen_legacy + libc-string_legacy + libc-gdtoa_legacy + libc-regex_legacy + libc-locale_legacy + libc-net_legacy + libc-i386 + APPEND_STRING PROPERTY COMPILE_FLAGS + " -arch i386" + ) +else (TARGET_i386) + add_library(libc-stdio_legacy OBJECT empty.c) + add_library(libc-compat_legacy OBJECT empty.c) + add_library(libc-stdlib_legacy OBJECT empty.c) + add_library(libc-stdtime_legacy OBJECT empty.c) + add_library(libc-gen_legacy OBJECT empty.c) + add_library(libc-string_legacy OBJECT empty.c) + add_library(libc-gdtoa_legacy OBJECT empty.c) + add_library(libc-regex_legacy OBJECT empty.c) + add_library(libc-locale_legacy OBJECT empty.c) + add_library(libc-net_legacy OBJECT empty.c) + add_library(libc-i386 OBJECT empty.c) +endif (TARGET_i386) + +if (TARGET_x86_64) + add_subdirectory(x86_64) + set_property ( + TARGET + libc-x86_64 + APPEND_STRING PROPERTY COMPILE_FLAGS + " -arch x86_64" + ) +else (TARGET_x86_64) + add_library(libc-x86_64 OBJECT empty.c) +endif (TARGET_x86_64) + +make_fat( + libc-db + libc-compat + libc-compat_cancelable + libc-emulated + libc-gdtoa + libc-gen + libc-gen_pre1050 + libc-gen_cancelable + libc-gen_noinode64 + libc-gen_extsn + libc-gmon + libc-os + libc-uuid + libc-util + libc-string + libc-stdtime + libc-sys + libc-sys_noinode64 + libc-stdlib + libc-stdlib_extsn + libc-stdlib_cancelable + libc-stdio + libc-stdio_extsn + libc-secure + libc-regex + libc-posix1e + libc-nls + libc-net + libc-net_cancelable + libc-locale + libc-gen_dyld + libc-stdlib_dyld + libc-string_dyld + libc-sys_dyld + libc-gdtoa_dyld +) + +set(DYLIB_INSTALL_NAME "/usr/lib/system/libsystem_c.dylib") +add_circular(system_c FAT OBJECTS + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + STRONG_SIBLINGS + platform + SIBLINGS + system_kernel + compiler_rt + system_dyld + system_malloc + system_pthread + system_blocks + system_m + platform + launch + system_notify + libdispatch_shared + system_info + macho + system_duct + system_asl + xpc + corecrypto + system_trace + LINK_FLAGS + "-Wl,-alias_list,${CMAKE_CURRENT_SOURCE_DIR}/xcodescripts/alias.list" +) +#target_link_libraries(system_c system_kernel system_m macho system_malloc platform system_blocks system_pthread compiler_rt) +#make_fat(system_c) +#set_property(TARGET system_c APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-alias_list,${CMAKE_CURRENT_SOURCE_DIR}/xcodescripts/alias.list -Wl,-sub_library,libsystem_platform") + +install(TARGETS system_c DESTINATION libexec/darling/usr/lib/system) + +include(darling_static_lib) +add_darling_static_library(libc_static SOURCES + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + ) +add_dependencies(libc_static ranlib ${APPLE_TARGET_TRIPLET_PRIMARY}-ar) +set_target_properties(libc_static PROPERTIES COMPILE_FLAGS "-ffunction-sections") + +add_library(libc_static64 STATIC $) +add_dependencies(libc_static64 ranlib ${APPLE_TARGET_TRIPLET_PRIMARY}-ar) +add_library(libc_static32 STATIC $) +add_dependencies(libc_static32 ranlib ${APPLE_TARGET_TRIPLET_PRIMARY}-ar) + diff --git a/Libc.xcodeproj/project.pbxproj b/Libc.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2423e7a --- /dev/null +++ b/Libc.xcodeproj/project.pbxproj @@ -0,0 +1,16625 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXAggregateTarget section */ + 925E7FE619E8945900AC7889 /* Libc_tests */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 925E7FF919E8945A00AC7889 /* Build configuration list for PBXAggregateTarget "Libc_tests" */; + buildPhases = ( + ); + dependencies = ( + 928F25D51BEAD2AE007B13C7 /* PBXTargetDependency */, + ); + name = Libc_tests; + productName = Libc_tests; + }; + 926F739D1E046E55001E049D /* Libc_darwin */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 926F739E1E046E56001E049D /* Build configuration list for PBXAggregateTarget "Libc_darwin" */; + buildPhases = ( + ); + dependencies = ( + 926F73A21E046E69001E049D /* PBXTargetDependency */, + ); + name = Libc_darwin; + productName = libdarwin; + }; + E47E980E22150EAD006E312E /* Libc */ = { + isa = PBXAggregateTarget; + buildConfigurationList = E47E981122150EAD006E312E /* Build configuration list for PBXAggregateTarget "Libc" */; + buildPhases = ( + ); + dependencies = ( + E47E981722150F0A006E312E /* PBXTargetDependency */, + E47E981922150F2C006E312E /* PBXTargetDependency */, + E47E981B22150F2F006E312E /* PBXTargetDependency */, + E47E981D22150F32006E312E /* PBXTargetDependency */, + ); + name = Libc; + productName = Libc; + }; + E47E981222150EBB006E312E /* Libc_driverkit */ = { + isa = PBXAggregateTarget; + buildConfigurationList = E47E981322150EBB006E312E /* Build configuration list for PBXAggregateTarget "Libc_driverkit" */; + buildPhases = ( + ); + dependencies = ( + E47E981F22150F3C006E312E /* PBXTargetDependency */, + ); + name = Libc_driverkit; + productName = Libc_driverkit; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 147CDFD91B7C232100831EC6 /* clock_gettime.c in Sources */ = {isa = PBXBuildFile; fileRef = 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */; }; + 147CDFDA1B7C232900831EC6 /* clock_gettime.c in Sources */ = {isa = PBXBuildFile; fileRef = 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */; }; + 147CDFDB1B7C232A00831EC6 /* clock_gettime.c in Sources */ = {isa = PBXBuildFile; fileRef = 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */; }; + 147CDFDC1B7C232F00831EC6 /* clock_gettime.c in Sources */ = {isa = PBXBuildFile; fileRef = 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */; }; + 147CDFDD1B7C233000831EC6 /* clock_gettime.c in Sources */ = {isa = PBXBuildFile; fileRef = 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */; }; + 147CDFDE1B7C233100831EC6 /* clock_gettime.c in Sources */ = {isa = PBXBuildFile; fileRef = 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */; }; + 147CDFDF1B7C233100831EC6 /* clock_gettime.c in Sources */ = {isa = PBXBuildFile; fileRef = 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */; }; + 147CDFE01B7C233200831EC6 /* clock_gettime.c in Sources */ = {isa = PBXBuildFile; fileRef = 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */; }; + 147CDFE11B7C233300831EC6 /* clock_gettime.c in Sources */ = {isa = PBXBuildFile; fileRef = 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */; }; + 2DF67CDE184F9CBE00B83A3D /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + 2DF67CDF184F9CBE00B83A3D /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + 2DF67CE0184F9CBE00B83A3D /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + 2DF67CE1184F9CBE00B83A3D /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + 2DF67CE2184F9CBE00B83A3D /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + 2DF67CE3184F9CBE00B83A3D /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + 2DF67CE4184F9CBE00B83A3D /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + 2DF67CE5184F9CBE00B83A3D /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + 2DF67CE6184F9CBE00B83A3D /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + 3F169A3E1643B7BA0029E851 /* memccpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F169A3C1643B7BA0029E851 /* memccpy_chk.c */; }; + 3F18DE21162A732C008B15AC /* memset_s.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F18DE20162A732C008B15AC /* memset_s.c */; }; + 3F267F38163FC8880089A0A6 /* rb.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F267F36163FC8880089A0A6 /* rb.c */; }; + 3F34A15D1C4AA80B000D4A82 /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + 3F51210416C317FD00AFB431 /* chk_fail.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B1E138D9E990028D27C /* chk_fail.c */; }; + 3F51210516C317FD00AFB431 /* memccpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F169A3C1643B7BA0029E851 /* memccpy_chk.c */; }; + 3F51210616C317FD00AFB431 /* memcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B20138D9E990028D27C /* memcpy_chk.c */; }; + 3F51210716C317FD00AFB431 /* memmove_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B21138D9E990028D27C /* memmove_chk.c */; }; + 3F51210816C317FD00AFB431 /* memset_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B22138D9E990028D27C /* memset_chk.c */; }; + 3F51210916C317FD00AFB431 /* snprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B23138D9E990028D27C /* snprintf_chk.c */; }; + 3F51210A16C317FD00AFB431 /* sprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B24138D9E990028D27C /* sprintf_chk.c */; }; + 3F51210B16C317FD00AFB431 /* stpcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B25138D9E990028D27C /* stpcpy_chk.c */; }; + 3F51210C16C317FD00AFB431 /* stpncpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B26138D9E990028D27C /* stpncpy_chk.c */; }; + 3F51210D16C317FD00AFB431 /* strcat_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B27138D9E990028D27C /* strcat_chk.c */; }; + 3F51210E16C317FD00AFB431 /* strcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B28138D9E990028D27C /* strcpy_chk.c */; }; + 3F51210F16C317FD00AFB431 /* strlcat_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FA8F3081643AB4300D37078 /* strlcat_chk.c */; }; + 3F51211016C317FD00AFB431 /* strlcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FA8F3091643AB4300D37078 /* strlcpy_chk.c */; }; + 3F51211116C317FD00AFB431 /* strncat_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B29138D9E990028D27C /* strncat_chk.c */; }; + 3F51211216C317FD00AFB431 /* strncpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2A138D9E990028D27C /* strncpy_chk.c */; }; + 3F51211316C317FD00AFB431 /* vsnprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2B138D9E990028D27C /* vsnprintf_chk.c */; }; + 3F51211416C317FD00AFB431 /* vsprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2C138D9E990028D27C /* vsprintf_chk.c */; }; + 3F76864713E91CBC00C94D25 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + 3F76864913E91CE800C94D25 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + 3F76864A13E91D3700C94D25 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + 3F76864B13E91D3F00C94D25 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + 3F76864C13E91D4B00C94D25 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + 3F76864D13E91D5500C94D25 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + 3F76864E13E91D5D00C94D25 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + 3F76864F13E91D6700C94D25 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + 3FA8F3251643AB8100D37078 /* strlcat_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FA8F3081643AB4300D37078 /* strlcat_chk.c */; }; + 3FA8F3261643AB8100D37078 /* strlcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FA8F3091643AB4300D37078 /* strlcpy_chk.c */; }; + 3FB7E1B5146EF2E000843438 /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + 3FB7E1B6146EF2E000843438 /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + 3FB7E1B7146EF2E000843438 /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + 3FB7E1B8146EF2E000843438 /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + 3FB7E1B9146EF2E000843438 /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + 3FB7E1BA146EF2E000843438 /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + 3FB7E1BB146EF2E000843438 /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + 3FD14574171D42B300B7BAF5 /* bcopy.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FD14572171D42B300B7BAF5 /* bcopy.c */; settings = {COMPILER_FLAGS = "-momit-leaf-frame-pointer"; }; }; + 3FD14575171D42B300B7BAF5 /* bcopy.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FD14572171D42B300B7BAF5 /* bcopy.c */; settings = {COMPILER_FLAGS = "-momit-leaf-frame-pointer"; }; }; + 3FD14576171D42B300B7BAF5 /* bcopy.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FD14572171D42B300B7BAF5 /* bcopy.c */; settings = {COMPILER_FLAGS = "-momit-leaf-frame-pointer"; }; }; + 3FD4D48E1472F4B200075CCE /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + 4B075C8E208BE9F200FD4F23 /* variant_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 926F73991E03E8D6001E049D /* variant_private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B0899BC2046258F001360A4 /* cleanup.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B0899B920460FAC001360A4 /* cleanup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B09323421C9C08F006063D6 /* mach_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B09323321C9C088006063D6 /* mach_utils.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B20DB4D202B81A4005C2327 /* bsd.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BA6E56A202ACF7A00F38D3A /* bsd.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B20DB50202B81A4005C2327 /* err.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BA6E563202AC0C200F38D3A /* err.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B20DB51202B81A4005C2327 /* errno.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BA6E55B202AB1F100F38D3A /* errno.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B20DB52202B81A4005C2327 /* stdio.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BA6E567202ACAFA00F38D3A /* stdio.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B20DB53202B81A4005C2327 /* stdlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BA6E564202AC43700F38D3A /* stdlib.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B20DB54202B81A4005C2327 /* string.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BA6E55D202AB31100F38D3A /* string.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B2C64A315519BC300342BFA /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + 4B2C64A415519BC400342BFA /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + 4B2C64A515519BC600342BFA /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + 4B2C64A615519BC600342BFA /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + 4B2C64A715519BC700342BFA /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + 4B2C64A815519BC700342BFA /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + 4B2C64A915519BC800342BFA /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + 4B2C64AA15519BCB00342BFA /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + 4B2C64BA1551B03700342BFA /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + 4B2D551E231706F9003DAFCE /* tapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2D551D2317040F003DAFCE /* tapi.h */; }; + 4B450FFB211A56DD0029AF5D /* ctl.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B450FFA211A56DC0029AF5D /* ctl.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B450FFD211A56EC0029AF5D /* ctl.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B450FFC211A56EC0029AF5D /* ctl.c */; }; + 4B4E643F2069E94A00C4D8D5 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2C50E41F8453FA005DA2B6 /* internal.h */; }; + 4B69E81320800D47008D13D2 /* libdarwin_init.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B69E81220800BE9008D13D2 /* libdarwin_init.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B6CFC042065B9FF0022DBAD /* mach.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B6CFC032065B9FF0022DBAD /* mach.c */; }; + 4B6D181D206DEFBD00C00E37 /* mach_exception.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6D181C206DEFBD00C00E37 /* mach_exception.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4B6D181F206DF1E200C00E37 /* exception.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B6D181E206DF1E200C00E37 /* exception.c */; }; + 4B782979208926A80070E1FF /* api.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B782978208926A70070E1FF /* api.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4BA6E55F202AB35900F38D3A /* string.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BA6E55E202AB35900F38D3A /* string.c */; }; + 4BA6E562202AC06300F38D3A /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BA6E561202AC06300F38D3A /* err.c */; }; + 4BA6E566202AC94800F38D3A /* stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BA6E565202AC94800F38D3A /* stdlib.c */; }; + 4BA6E569202ACDAA00F38D3A /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BA6E568202ACDAA00F38D3A /* stdio.c */; }; + 4BA6E56C202AD02900F38D3A /* bsd.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BA6E56B202AD02900F38D3A /* bsd.c */; }; + 4BCC350F20659AD500A4CBAA /* linker_set.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BCC350E20659AD500A4CBAA /* linker_set.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 63D4060613DDEDF10094DD56 /* stpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060513DDEDF10094DD56 /* stpcpy.c */; }; + 63D4060813DDEDFF0094DD56 /* stpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060513DDEDF10094DD56 /* stpcpy.c */; }; + 63D4060A13DDEEA20094DD56 /* stpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060913DDEEA10094DD56 /* stpncpy.c */; }; + 63D4060B13DDEEA20094DD56 /* stpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060913DDEEA10094DD56 /* stpncpy.c */; }; + 63D4060D13DDF26A0094DD56 /* strcat.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060C13DDF26A0094DD56 /* strcat.c */; }; + 63D4060E13DDF26A0094DD56 /* strcat.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060C13DDF26A0094DD56 /* strcat.c */; }; + 63D4061013DDF4340094DD56 /* strncat.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060F13DDF4340094DD56 /* strncat.c */; }; + 63D4061113DDF4340094DD56 /* strncat.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060F13DDF4340094DD56 /* strncat.c */; }; + 7756338822F3B539002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 7756338922F3B53A002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 7756338A22F3B53B002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 7756338B22F3B546002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 7756338C22F3B549002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 7756338D22F3B54A002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 7756338E22F3B54A002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 7756338F22F3B54B002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 7756339022F3B54E002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 7756339122F3B550002F1707 /* rpmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 7711D82422F37DB600E7296B /* rpmatch.c */; }; + 922D0C0A21BFA1530072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 922D0C0B21BFA19A0072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 922D0C0C21BFA19A0072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 922D0C0D21BFA19B0072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 922D0C0E21BFA1A10072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 922D0C0F21BFA1A20072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 922D0C1021BFA1A30072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 922D0C1121BFA1A30072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 922D0C1221BFA1A40072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 922D0C1321BFA1A40072834D /* timespec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 922D0C0921BFA1530072834D /* timespec_get.c */; }; + 926F73981E03E8C4001E049D /* variant.c in Sources */ = {isa = PBXBuildFile; fileRef = 926F73971E03E8C4001E049D /* variant.c */; }; + 92767C841E0A7E2700AB9C76 /* init.c in Sources */ = {isa = PBXBuildFile; fileRef = 92767C821E0A7E2100AB9C76 /* init.c */; }; + 928841361EA75555001064D1 /* dirstat_collection.c in Sources */ = {isa = PBXBuildFile; fileRef = 928841341EA7554D001064D1 /* dirstat_collection.c */; }; + 92888B161EA5BE7400BA923E /* fmemopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 92888B0F1EA5BE6D00BA923E /* fmemopen.c */; }; + 92888B171EA5BE8000BA923E /* open_memstream.c in Sources */ = {isa = PBXBuildFile; fileRef = 92888B111EA5BE6D00BA923E /* open_memstream.c */; }; + 92888B181EA5BE8600BA923E /* open_wmemstream.c in Sources */ = {isa = PBXBuildFile; fileRef = 92888B121EA5BE6D00BA923E /* open_wmemstream.c */; }; + 928BD1001D76072200EC01FC /* timingsafe_bcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */; }; + 928BD1011D76072200EC01FC /* timingsafe_bcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */; }; + 928BD1021D76072C00EC01FC /* timingsafe_bcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */; }; + 928BD1031D76073300EC01FC /* timingsafe_bcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */; }; + 928BD1041D76073400EC01FC /* timingsafe_bcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */; }; + 928BD1051D76073400EC01FC /* timingsafe_bcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */; }; + 928BD1061D76073500EC01FC /* timingsafe_bcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */; }; + 928BD1071D76073600EC01FC /* timingsafe_bcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */; }; + 928BD1081D76073600EC01FC /* timingsafe_bcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */; }; + 92ABC7E91D375FC2000DF880 /* compatibility_hacks.c in Sources */ = {isa = PBXBuildFile; fileRef = 92ABC7E81D375FC2000DF880 /* compatibility_hacks.c */; }; + 92D763E01EA6DA3A001467FC /* dirstat.c in Sources */ = {isa = PBXBuildFile; fileRef = 92D763DC1EA6D9FB001467FC /* dirstat.c */; }; + B10BC41C14338AEB005E4366 /* regcomp.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2B11432B95B00AF95D0 /* regcomp.c */; settings = {COMPILER_FLAGS = "-DHAVE_CONFIG_H -I$(SRCROOT)/regex/TRE -I$(SRCROOT)/regex/FreeBSD"; }; }; + B122F2C71432B95B00AF95D0 /* regcomp.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2B11432B95B00AF95D0 /* regcomp.c */; }; + B122F2C91432B95B00AF95D0 /* regexec.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2B21432B95B00AF95D0 /* regexec.c */; }; + B122F2CB1432B95B00AF95D0 /* tre-ast.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2B31432B95B00AF95D0 /* tre-ast.c */; }; + B122F2CD1432B95B00AF95D0 /* tre-compile.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2B51432B95B00AF95D0 /* tre-compile.c */; }; + B122F2CF1432B95B00AF95D0 /* tre-match-backtrack.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2B81432B95B00AF95D0 /* tre-match-backtrack.c */; }; + B122F2D11432B95B00AF95D0 /* tre-match-parallel.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2B91432B95B00AF95D0 /* tre-match-parallel.c */; }; + B122F2D31432B95B00AF95D0 /* tre-mem.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2BB1432B95B00AF95D0 /* tre-mem.c */; }; + B122F2D51432B95B00AF95D0 /* tre-parse.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2BD1432B95B00AF95D0 /* tre-parse.c */; }; + B122F2D71432B95B00AF95D0 /* tre-stack.c in Sources */ = {isa = PBXBuildFile; fileRef = B122F2BF1432B95B00AF95D0 /* tre-stack.c */; }; + B12613F8158818EC0077E3CC /* xprintf_errno.c in Sources */ = {isa = PBXBuildFile; fileRef = B12613EE158818EC0077E3CC /* xprintf_errno.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio"; }; }; + B12613F9158818EC0077E3CC /* xprintf_float.c in Sources */ = {isa = PBXBuildFile; fileRef = B12613EF158818EC0077E3CC /* xprintf_float.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio"; }; }; + B12613FA158818EC0077E3CC /* xprintf_hexdump.c in Sources */ = {isa = PBXBuildFile; fileRef = B12613F0158818EC0077E3CC /* xprintf_hexdump.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio"; }; }; + B12613FB158818EC0077E3CC /* xprintf_int.c in Sources */ = {isa = PBXBuildFile; fileRef = B12613F1158818EC0077E3CC /* xprintf_int.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio"; }; }; + B12613FC158818EC0077E3CC /* xprintf_quote.c in Sources */ = {isa = PBXBuildFile; fileRef = B12613F3158818EC0077E3CC /* xprintf_quote.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio"; }; }; + B12613FD158818EC0077E3CC /* xprintf_str.c in Sources */ = {isa = PBXBuildFile; fileRef = B12613F4158818EC0077E3CC /* xprintf_str.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio"; }; }; + B12613FE158818EC0077E3CC /* xprintf_time.c in Sources */ = {isa = PBXBuildFile; fileRef = B12613F5158818EC0077E3CC /* xprintf_time.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio"; }; }; + B12613FF158818EC0077E3CC /* xprintf_vis.c in Sources */ = {isa = PBXBuildFile; fileRef = B12613F6158818EC0077E3CC /* xprintf_vis.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio"; }; }; + B1261400158818EC0077E3CC /* xprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = B12613F7158818EC0077E3CC /* xprintf.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio"; }; }; + B126140515881A000077E3CC /* xprintf_comp.c in Sources */ = {isa = PBXBuildFile; fileRef = B126140215881A000077E3CC /* xprintf_comp.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio/FreeBSD"; }; }; + B126140615881A000077E3CC /* xprintf_domain.c in Sources */ = {isa = PBXBuildFile; fileRef = B126140315881A000077E3CC /* xprintf_domain.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio/FreeBSD"; }; }; + B17726CD185A9AD600668DCA /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + B1795373158B0E35008990E8 /* xprintf_all_in_one.c in Sources */ = {isa = PBXBuildFile; fileRef = B1795371158B0E35008990E8 /* xprintf_all_in_one.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio/FreeBSD"; }; }; + B1795374158B0E35008990E8 /* xprintf_exec.c in Sources */ = {isa = PBXBuildFile; fileRef = B1795372158B0E35008990E8 /* xprintf_exec.c */; settings = {COMPILER_FLAGS = "-I$(SRCROOT)/stdio/FreeBSD"; }; }; + B19C645C1450F90200032373 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + B19C645D1450F90200032373 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + B19C645E1450F90200032373 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + B19C645F1450F90200032373 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + B19C64601450F90200032373 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + B19C64611450F90200032373 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + B19C64621450F90200032373 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + B19C64631450F90200032373 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + C0E343921C582ECB00E749C2 /* mcount.s in Sources */ = {isa = PBXBuildFile; fileRef = C9B53819138D9E990028D27C /* mcount.s */; }; + C0E3439B1C582ECB00E749C2 /* mcount.s in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DF9138D9E9A0028D27C /* mcount.s */; }; + C0E343A11C582ECB00E749C2 /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CREAT"; }; }; + C0E343A21C582ECB00E749C2 /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C0E343A31C582ECB00E749C2 /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C0E343A41C582ECB00E749C2 /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_KILLPG"; }; }; + C0E343A51C582ECB00E749C2 /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C0E343A61C582ECB00E749C2 /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C0E343A71C582ECB00E749C2 /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C0E343A81C582ECB00E749C2 /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C0E343A91C582ECB00E749C2 /* setregid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360A138D9E980028D27C /* setregid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREGID"; }; }; + C0E343AA1C582ECB00E749C2 /* setreuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360B138D9E980028D27C /* setreuid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREUID"; }; }; + C0E343AB1C582ECB00E749C2 /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C0E343AC1C582ECB00E749C2 /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SIGPAUSE"; }; }; + C0E343AD1C582ECB00E749C2 /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C0E343AE1C582ECB00E749C2 /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C0E343AF1C582ECB00E749C2 /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; }; + C0E343B01C582ECB00E749C2 /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; }; + C0E343B11C582ECB00E749C2 /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; }; + C0E343B21C582ECB00E749C2 /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; }; + C0E343B31C582ECB00E749C2 /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; }; + C0E343B41C582ECB00E749C2 /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; }; + C0E343B51C582ECB00E749C2 /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; }; + C0E343B61C582ECB00E749C2 /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; }; + C0E343B71C582ECB00E749C2 /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; }; + C0E343B81C582ECB00E749C2 /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; }; + C0E343B91C582ECB00E749C2 /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; }; + C0E343BA1C582ECB00E749C2 /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; }; + C0E343BB1C582ECB00E749C2 /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; }; + C0E343BC1C582ECB00E749C2 /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; }; + C0E343BD1C582ECB00E749C2 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; }; + C0E343BE1C582ECB00E749C2 /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; }; + C0E343BF1C582ECB00E749C2 /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; }; + C0E343C01C582ECB00E749C2 /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; }; + C0E343C11C582ECB00E749C2 /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; }; + C0E343C21C582ECB00E749C2 /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; }; + C0E343C31C582ECB00E749C2 /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; }; + C0E343C41C582ECB00E749C2 /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; }; + C0E343C51C582ECB00E749C2 /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; }; + C0E343C61C582ECB00E749C2 /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; }; + C0E343C71C582ECB00E749C2 /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; }; + C0E343C81C582ECB00E749C2 /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; }; + C0E343C91C582ECB00E749C2 /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; }; + C0E343CA1C582ECB00E749C2 /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; }; + C0E343CB1C582ECB00E749C2 /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; }; + C0E343CC1C582ECB00E749C2 /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; }; + C0E343CD1C582ECB00E749C2 /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C0E343CE1C582ECB00E749C2 /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C0E343CF1C582ECB00E749C2 /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C0E343D01C582ECB00E749C2 /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C0E343D11C582ECB00E749C2 /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C0E343D21C582ECB00E749C2 /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C0E343D31C582ECB00E749C2 /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C0E343D41C582ECB00E749C2 /* _ldbl_util.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5368E138D9E980028D27C /* _ldbl_util.c */; }; + C0E343D51C582ECB00E749C2 /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C0E343D61C582ECB00E749C2 /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C0E343D71C582ECB00E749C2 /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C0E343D81C582ECB00E749C2 /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C0E343D91C582ECB00E749C2 /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C0E343DA1C582ECB00E749C2 /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C0E343DB1C582ECB00E749C2 /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C0E343DC1C582ECB00E749C2 /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C0E343DD1C582ECB00E749C2 /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C0E343DE1C582ECB00E749C2 /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C0E343DF1C582ECB00E749C2 /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C0E343E01C582ECB00E749C2 /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C0E343E11C582ECB00E749C2 /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C0E343E21C582ECB00E749C2 /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C0E343E31C582ECB00E749C2 /* gdtoa-strtoIg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */; }; + C0E343E41C582ECB00E749C2 /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C0E343E51C582ECB00E749C2 /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C0E343E61C582ECB00E749C2 /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C0E343E71C582ECB00E749C2 /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C0E343E81C582ECB00E749C2 /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C0E343E91C582ECB00E749C2 /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C0E343EA1C582ECB00E749C2 /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C0E343EB1C582ECB00E749C2 /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C0E343EC1C582ECB00E749C2 /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C0E343ED1C582ECB00E749C2 /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C0E343EE1C582ECB00E749C2 /* authentication.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D5138D9E990028D27C /* authentication.c */; }; + C0E343EF1C582ECB00E749C2 /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C0E343F01C582ECB00E749C2 /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_CONFSTR"; }; }; + C0E343F11C582ECB00E749C2 /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_ENCRYPT -DLIBC_ALIAS_SETKEY"; }; }; + C0E343F21C582ECB00E749C2 /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C0E343F31C582ECB00E749C2 /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C0E343F41C582ECB00E749C2 /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C0E343F51C582ECB00E749C2 /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C0E343F61C582ECB00E749C2 /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C0E343F71C582ECB00E749C2 /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C0E343F81C582ECB00E749C2 /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E343F91C582ECB00E749C2 /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C0E343FA1C582ECB00E749C2 /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C0E343FB1C582ECB00E749C2 /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOCK"; }; }; + C0E343FC1C582ECB00E749C2 /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOSEDIR -include gen/__dirent.h"; }; }; + C0E343FD1C582ECB00E749C2 /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C0E343FE1C582ECB00E749C2 /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E343FF1C582ECB00E749C2 /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E344001C582ECB00E749C2 /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C0E344011C582ECB00E749C2 /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C0E344021C582ECB00E749C2 /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C0E344031C582ECB00E749C2 /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C0E344041C582ECB00E749C2 /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C0E344051C582ECB00E749C2 /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C0E344061C582ECB00E749C2 /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FNMATCH"; }; }; + C0E344071C582ECB00E749C2 /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C0E344081C582ECB00E749C2 /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C0E344091C582ECB00E749C2 /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C0E3440A1C582ECB00E749C2 /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E3440B1C582ECB00E749C2 /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C0E3440C1C582ECB00E749C2 /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C0E3440D1C582ECB00E749C2 /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E3440E1C582ECB00E749C2 /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E3440F1C582ECB00E749C2 /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C0E344101C582ECB00E749C2 /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C0E344111C582ECB00E749C2 /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_GLOB"; }; }; + C0E344121C582ECB00E749C2 /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C0E344131C582ECB00E749C2 /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C0E344141C582ECB00E749C2 /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C0E344151C582ECB00E749C2 /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_LOCKF"; }; }; + C0E344161C582ECB00E749C2 /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C0E344171C582ECB00E749C2 /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C0E344181C582ECB00E749C2 /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_NICE"; }; }; + C0E344191C582ECB00E749C2 /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C0E3441A1C582ECB00E749C2 /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS___OPENDIR2 -DLIBC_ALIAS_OPENDIR -include gen/__dirent.h"; }; }; + C0E3441B1C582ECB00E749C2 /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PAUSE"; }; }; + C0E3441C1C582ECB00E749C2 /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_POPEN"; }; }; + C0E3441D1C582ECB00E749C2 /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C0E3441E1C582ECB00E749C2 /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + C0E3441F1C582ECB00E749C2 /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C0E344201C582ECB00E749C2 /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C0E344211C582ECB00E749C2 /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REWINDDIR -include gen/__dirent.h"; }; }; + C0E344221C582ECB00E749C2 /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C0E344231C582ECB00E749C2 /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C0E344241C582ECB00E749C2 /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEEKDIR -include gen/__dirent.h"; }; }; + C0E344251C582ECB00E749C2 /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C0E344261C582ECB00E749C2 /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SETMODE"; }; }; + C0E344271C582ECB00E749C2 /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C0E344281C582ECB00E749C2 /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C0E344291C582ECB00E749C2 /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C0E3442A1C582ECB00E749C2 /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C0E3442B1C582ECB00E749C2 /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SLEEP"; }; }; + C0E3442C1C582ECB00E749C2 /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C0E3442D1C582ECB00E749C2 /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C0E3442E1C582ECB00E749C2 /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C0E3442F1C582ECB00E749C2 /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E344301C582ECB00E749C2 /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E344311C582ECB00E749C2 /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C0E344321C582ECB00E749C2 /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS__SEEKDIR -DLIBC_ALIAS_TELLDIR -include gen/__dirent.h"; }; }; + C0E344331C582ECB00E749C2 /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TCDRAIN"; }; }; + C0E344341C582ECB00E749C2 /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C0E344351C582ECB00E749C2 /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C0E344361C582ECB00E749C2 /* timezone.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A4138D9E990028D27C /* timezone.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E344371C582ECB00E749C2 /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TTYNAME_R"; }; }; + C0E344381C582ECB00E749C2 /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C0E344391C582ECB00E749C2 /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C0E3443A1C582ECB00E749C2 /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C0E3443B1C582ECB00E749C2 /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C0E3443C1C582ECB00E749C2 /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_USLEEP"; }; }; + C0E3443D1C582ECB00E749C2 /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C0E3443E1C582ECB00E749C2 /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C0E3443F1C582ECB00E749C2 /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAIT"; }; }; + C0E344401C582ECB00E749C2 /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C0E344411C582ECB00E749C2 /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAITPID"; }; }; + C0E344421C582ECB00E749C2 /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_FTS_CHILDREN -DLIBC_ALIAS_FTS_CLOSE -DLIBC_ALIAS_FTS_OPEN -DLIBC_ALIAS_FTS_OPEN_B -DLIBC_ALIAS_FTS_READ -DLIBC_ALIAS_FTS_SET"; }; }; + C0E344431C582ECB00E749C2 /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C0E344441C582ECB00E749C2 /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C0E344451C582ECB00E749C2 /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C0E344461C582ECB00E749C2 /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C0E344471C582ECB00E749C2 /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C0E344481C582ECB00E749C2 /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_NANOSLEEP"; }; }; + C0E344491C582ECB00E749C2 /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C0E3444A1C582ECB00E749C2 /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_FTW -DLIBC_ALIAS_NFTW"; }; }; + C0E3444B1C582ECB00E749C2 /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C0E3444C1C582ECB00E749C2 /* oldsyslog.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537EA138D9E990028D27C /* oldsyslog.c */; }; + C0E3444D1C582ECB00E749C2 /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C0E3444E1C582ECB00E749C2 /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C0E3444F1C582ECB00E749C2 /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C0E344501C582ECB00E749C2 /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C0E344511C582ECB00E749C2 /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C0E344521C582ECB00E749C2 /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C0E344531C582ECB00E749C2 /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + C0E344541C582ECB00E749C2 /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C0E344551C582ECB00E749C2 /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C0E344561C582ECB00E749C2 /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C0E344571C582ECB00E749C2 /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C0E344581C582ECB00E749C2 /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; }; + C0E344591C582ECB00E749C2 /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C0E3445A1C582ECB00E749C2 /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C0E3445B1C582ECB00E749C2 /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C0E3445C1C582ECB00E749C2 /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C0E3445D1C582ECB00E749C2 /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C0E3445E1C582ECB00E749C2 /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C0E3445F1C582ECB00E749C2 /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C0E344601C582ECB00E749C2 /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C0E344611C582ECB00E749C2 /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C0E344621C582ECB00E749C2 /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C0E344631C582ECB00E749C2 /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C0E344641C582ECB00E749C2 /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C0E344651C582ECB00E749C2 /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C0E344661C582ECB00E749C2 /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C0E344671C582ECB00E749C2 /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C0E344681C582ECB00E749C2 /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C0E344691C582ECB00E749C2 /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C0E3446A1C582ECB00E749C2 /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C0E3446B1C582ECB00E749C2 /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C0E3446C1C582ECB00E749C2 /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C0E3446D1C582ECB00E749C2 /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C0E3446E1C582ECB00E749C2 /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C0E3446F1C582ECB00E749C2 /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C0E344701C582ECB00E749C2 /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C0E344711C582ECB00E749C2 /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C0E344721C582ECB00E749C2 /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C0E344731C582ECB00E749C2 /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C0E344741C582ECB00E749C2 /* debug_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DF67CDD184F9CBE00B83A3D /* debug_private.c */; }; + C0E344751C582ECB00E749C2 /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; }; + C0E344761C582ECB00E749C2 /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C0E344771C582ECB00E749C2 /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C0E344781C582ECB00E749C2 /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C0E344791C582ECB00E749C2 /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C0E3447A1C582ECB00E749C2 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C0E3447B1C582ECB00E749C2 /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C0E3447C1C582ECB00E749C2 /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WCSFTIME -DLIBC_ALIAS_WCSFTIME_L"; }; }; + C0E3447D1C582ECB00E749C2 /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C0E3447E1C582ECB00E749C2 /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C0E3447F1C582ECB00E749C2 /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C0E344801C582ECB00E749C2 /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C0E344811C582ECB00E749C2 /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C0E344821C582ECB00E749C2 /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C0E344831C582ECB00E749C2 /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C0E344841C582ECB00E749C2 /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C0E344851C582ECB00E749C2 /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C0E344861C582ECB00E749C2 /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C0E344871C582ECB00E749C2 /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C0E344881C582ECB00E749C2 /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C0E344891C582ECB00E749C2 /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C0E3448A1C582ECB00E749C2 /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C0E3448B1C582ECB00E749C2 /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C0E3448C1C582ECB00E749C2 /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C0E3448D1C582ECB00E749C2 /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C0E3448E1C582ECB00E749C2 /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; }; + C0E3448F1C582ECB00E749C2 /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C0E344901C582ECB00E749C2 /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C0E344911C582ECB00E749C2 /* lconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E8138D9E990028D27C /* lconv.c */; }; + C0E344921C582ECB00E749C2 /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; }; + C0E344931C582ECB00E749C2 /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; }; + C0E344941C582ECB00E749C2 /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; }; + C0E344951C582ECB00E749C2 /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C0E344961C582ECB00E749C2 /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C0E344971C582ECB00E749C2 /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C0E344981C582ECB00E749C2 /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C0E344991C582ECB00E749C2 /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C0E3449A1C582ECB00E749C2 /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C0E3449B1C582ECB00E749C2 /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C0E3449C1C582ECB00E749C2 /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C0E3449D1C582ECB00E749C2 /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C0E3449E1C582ECB00E749C2 /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C0E3449F1C582ECB00E749C2 /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C0E344A01C582ECB00E749C2 /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C0E344A11C582ECB00E749C2 /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C0E344A21C582ECB00E749C2 /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C0E344A31C582ECB00E749C2 /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_RECV"; }; }; + C0E344A41C582ECB00E749C2 /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEND"; }; }; + C0E344A51C582ECB00E749C2 /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C0E344A61C582ECB00E749C2 /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C0E344A71C582ECB00E749C2 /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C0E344A81C582ECB00E749C2 /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C0E344A91C582ECB00E749C2 /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C0E344AA1C582ECB00E749C2 /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C0E344AB1C582ECB00E749C2 /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C0E344AC1C582ECB00E749C2 /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C0E344AD1C582ECB00E749C2 /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C0E344AE1C582ECB00E749C2 /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C0E344AF1C582ECB00E749C2 /* chk_fail.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B1E138D9E990028D27C /* chk_fail.c */; }; + C0E344B01C582ECB00E749C2 /* memcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B20138D9E990028D27C /* memcpy_chk.c */; }; + C0E344B11C582ECB00E749C2 /* memmove_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B21138D9E990028D27C /* memmove_chk.c */; }; + C0E344B21C582ECB00E749C2 /* memset_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B22138D9E990028D27C /* memset_chk.c */; }; + C0E344B31C582ECB00E749C2 /* snprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B23138D9E990028D27C /* snprintf_chk.c */; }; + C0E344B41C582ECB00E749C2 /* sprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B24138D9E990028D27C /* sprintf_chk.c */; }; + C0E344B51C582ECB00E749C2 /* stpcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B25138D9E990028D27C /* stpcpy_chk.c */; }; + C0E344B61C582ECB00E749C2 /* stpncpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B26138D9E990028D27C /* stpncpy_chk.c */; }; + C0E344B71C582ECB00E749C2 /* strcat_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B27138D9E990028D27C /* strcat_chk.c */; }; + C0E344B81C582ECB00E749C2 /* strcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B28138D9E990028D27C /* strcpy_chk.c */; }; + C0E344B91C582ECB00E749C2 /* strlcat_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FA8F3081643AB4300D37078 /* strlcat_chk.c */; }; + C0E344BA1C582ECB00E749C2 /* strlcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FA8F3091643AB4300D37078 /* strlcpy_chk.c */; }; + C0E344BB1C582ECB00E749C2 /* strncat_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B29138D9E990028D27C /* strncat_chk.c */; }; + C0E344BC1C582ECB00E749C2 /* strncpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2A138D9E990028D27C /* strncpy_chk.c */; }; + C0E344BD1C582ECB00E749C2 /* vsnprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2B138D9E990028D27C /* vsnprintf_chk.c */; }; + C0E344BE1C582ECB00E749C2 /* vsprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2C138D9E990028D27C /* vsprintf_chk.c */; }; + C0E344BF1C582ECB00E749C2 /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C0E344C01C582ECB00E749C2 /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C0E344C11C582ECB00E749C2 /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C0E344C21C582ECB00E749C2 /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C0E344C31C582ECB00E749C2 /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C0E344C41C582ECB00E749C2 /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FDOPEN"; }; }; + C0E344C51C582ECB00E749C2 /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C0E344C61C582ECB00E749C2 /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C0E344C71C582ECB00E749C2 /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C0E344C81C582ECB00E749C2 /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C0E344C91C582ECB00E749C2 /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C0E344CA1C582ECB00E749C2 /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C0E344CB1C582ECB00E749C2 /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C0E344CC1C582ECB00E749C2 /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C0E344CD1C582ECB00E749C2 /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C0E344CE1C582ECB00E749C2 /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C0E344CF1C582ECB00E749C2 /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C0E344D01C582ECB00E749C2 /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C0E344D11C582ECB00E749C2 /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C0E344D21C582ECB00E749C2 /* bcopy.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FD14572171D42B300B7BAF5 /* bcopy.c */; settings = {COMPILER_FLAGS = "-momit-leaf-frame-pointer"; }; }; + C0E344D31C582ECB00E749C2 /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FOPEN"; }; }; + C0E344D41C582ECB00E749C2 /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C0E344D51C582ECB00E749C2 /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C0E344D61C582ECB00E749C2 /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C0E344D71C582ECB00E749C2 /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FPUTS"; }; }; + C0E344D81C582ECB00E749C2 /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C0E344D91C582ECB00E749C2 /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C0E344DA1C582ECB00E749C2 /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C0E344DB1C582ECB00E749C2 /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FREOPEN"; }; }; + C0E344DC1C582ECB00E749C2 /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C0E344DD1C582ECB00E749C2 /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C0E344DE1C582ECB00E749C2 /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C0E344DF1C582ECB00E749C2 /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C0E344E01C582ECB00E749C2 /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C0E344E11C582ECB00E749C2 /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C0E344E21C582ECB00E749C2 /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C0E344E31C582ECB00E749C2 /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C0E344E41C582ECB00E749C2 /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C0E344E51C582ECB00E749C2 /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FWRITE"; }; }; + C0E344E61C582ECB00E749C2 /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C0E344E71C582ECB00E749C2 /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C0E344E81C582ECB00E749C2 /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C0E344E91C582ECB00E749C2 /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C0E344EA1C582ECB00E749C2 /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C0E344EB1C582ECB00E749C2 /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C0E344EC1C582ECB00E749C2 /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C0E344ED1C582ECB00E749C2 /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C0E344EE1C582ECB00E749C2 /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C0E344EF1C582ECB00E749C2 /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C0E344F01C582ECB00E749C2 /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C0E344F11C582ECB00E749C2 /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C0E344F21C582ECB00E749C2 /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C0E344F31C582ECB00E749C2 /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C0E344F41C582ECB00E749C2 /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C0E344F51C582ECB00E749C2 /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C0E344F61C582ECB00E749C2 /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C0E344F71C582ECB00E749C2 /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C0E344F81C582ECB00E749C2 /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C0E344F91C582ECB00E749C2 /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C0E344FA1C582ECB00E749C2 /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C0E344FB1C582ECB00E749C2 /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C0E344FC1C582ECB00E749C2 /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C0E344FD1C582ECB00E749C2 /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C0E344FE1C582ECB00E749C2 /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C0E344FF1C582ECB00E749C2 /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C0E345001C582ECB00E749C2 /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C0E345011C582ECB00E749C2 /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C0E345021C582ECB00E749C2 /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C0E345031C582ECB00E749C2 /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C0E345041C582ECB00E749C2 /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C0E345051C582ECB00E749C2 /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C0E345061C582ECB00E749C2 /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C0E345071C582ECB00E749C2 /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C0E345081C582ECB00E749C2 /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TEMPNAM"; }; }; + C0E345091C582ECB00E749C2 /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -D_DARWIN_UNLIMITED_STREAMS"; }; }; + C0E3450A1C582ECB00E749C2 /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C0E3450B1C582ECB00E749C2 /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C0E3450C1C582ECB00E749C2 /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C0E3450D1C582ECB00E749C2 /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C0E3450E1C582ECB00E749C2 /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C0E3450F1C582ECB00E749C2 /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C0E345101C582ECB00E749C2 /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C0E345111C582ECB00E749C2 /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C0E345121C582ECB00E749C2 /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C0E345131C582ECB00E749C2 /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C0E345141C582ECB00E749C2 /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C0E345151C582ECB00E749C2 /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C0E345161C582ECB00E749C2 /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C0E345171C582ECB00E749C2 /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C0E345181C582ECB00E749C2 /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C0E345191C582ECB00E749C2 /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C0E3451A1C582ECB00E749C2 /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C0E3451B1C582ECB00E749C2 /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C0E3451C1C582ECB00E749C2 /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C0E3451D1C582ECB00E749C2 /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C0E3451E1C582ECB00E749C2 /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C0E3451F1C582ECB00E749C2 /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C0E345201C582ECB00E749C2 /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C0E345211C582ECB00E749C2 /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C0E345221C582ECB00E749C2 /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C0E345231C582ECB00E749C2 /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C0E345241C582ECB00E749C2 /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E345251C582ECB00E749C2 /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C0E345261C582ECB00E749C2 /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C0E345271C582ECB00E749C2 /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C0E345281C582ECB00E749C2 /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C0E345291C582ECB00E749C2 /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C0E3452A1C582ECB00E749C2 /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C0E3452B1C582ECB00E749C2 /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E3452C1C582ECB00E749C2 /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C0E3452D1C582ECB00E749C2 /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_GETOPT"; }; }; + C0E3452E1C582ECB00E749C2 /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C0E3452F1C582ECB00E749C2 /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C0E345301C582ECB00E749C2 /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C0E345311C582ECB00E749C2 /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E345321C582ECB00E749C2 /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C0E345331C582ECB00E749C2 /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C0E345341C582ECB00E749C2 /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C0E345351C582ECB00E749C2 /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C0E345361C582ECB00E749C2 /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C0E345371C582ECB00E749C2 /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C0E345381C582ECB00E749C2 /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C0E345391C582ECB00E749C2 /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C0E3453A1C582ECB00E749C2 /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C0E3453B1C582ECB00E749C2 /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C0E3453C1C582ECB00E749C2 /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E3453D1C582ECB00E749C2 /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PUTENV"; }; }; + C0E3453E1C582ECB00E749C2 /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E3453F1C582ECB00E749C2 /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C0E345401C582ECB00E749C2 /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C0E345411C582ECB00E749C2 /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C0E345421C582ECB00E749C2 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C0E345431C582ECB00E749C2 /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E345441C582ECB00E749C2 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C0E345451C582ECB00E749C2 /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C0E345461C582ECB00E749C2 /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C0E345471C582ECB00E749C2 /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C0E345481C582ECB00E749C2 /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C0E345491C582ECB00E749C2 /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C0E3454A1C582ECB00E749C2 /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C0E3454B1C582ECB00E749C2 /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C0E3454C1C582ECB00E749C2 /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C0E3454D1C582ECB00E749C2 /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C0E3454E1C582ECB00E749C2 /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C0E3454F1C582ECB00E749C2 /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C0E345501C582ECB00E749C2 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SYSTEM"; }; }; + C0E345511C582ECB00E749C2 /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C0E345521C582ECB00E749C2 /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C0E345531C582ECB00E749C2 /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C0E345541C582ECB00E749C2 /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C0E345551C582ECB00E749C2 /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C0E345561C582ECB00E749C2 /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C0E345571C582ECB00E749C2 /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + C0E345581C582ECB00E749C2 /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C0E345591C582ECB00E749C2 /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C0E3455A1C582ECB00E749C2 /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C0E3455B1C582ECB00E749C2 /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C0E3455C1C582ECB00E749C2 /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C0E3455D1C582ECB00E749C2 /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C0E3455E1C582ECB00E749C2 /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_MKTIME"; }; }; + C0E3455F1C582ECB00E749C2 /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRFTIME -DLIBC_ALIAS_STRFTIME_L"; }; }; + C0E345601C582ECB00E749C2 /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRPTIME -DLIBC_ALIAS_STRPTIME_L"; }; }; + C0E345611C582ECB00E749C2 /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C0E345621C582ECB00E749C2 /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C0E345631C582ECB00E749C2 /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; settings = {COMPILER_FLAGS = "-D_DARWIN_UNLIMITED_STREAMS"; }; }; + C0E345641C582ECB00E749C2 /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C0E345661C582ECB00E749C2 /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C0E345671C582ECB00E749C2 /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C0E345681C582ECB00E749C2 /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C0E345691C582ECB00E749C2 /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C0E3456A1C582ECB00E749C2 /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C0E3456B1C582ECB00E749C2 /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C0E3456C1C582ECB00E749C2 /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E3456D1C582ECB00E749C2 /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRERROR"; }; }; + C0E3456F1C582ECB00E749C2 /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C0E345701C582ECB00E749C2 /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C0E345721C582ECB00E749C2 /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C0E345731C582ECB00E749C2 /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C0E345741C582ECB00E749C2 /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C0E345751C582ECB00E749C2 /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C0E345761C582ECB00E749C2 /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C0E345771C582ECB00E749C2 /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C0E345791C582ECB00E749C2 /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C0E3457A1C582ECB00E749C2 /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C0E3457B1C582ECB00E749C2 /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C0E3457C1C582ECB00E749C2 /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C0E3457D1C582ECB00E749C2 /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C0E3457E1C582ECB00E749C2 /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C0E3457F1C582ECB00E749C2 /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C0E345801C582ECB00E749C2 /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C0E345811C582ECB00E749C2 /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C0E345821C582ECB00E749C2 /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C0E345831C582ECB00E749C2 /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C0E345841C582ECB00E749C2 /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C0E345851C582ECB00E749C2 /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C0E345861C582ECB00E749C2 /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C0E345871C582ECB00E749C2 /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C0E345881C582ECB00E749C2 /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C0E345891C582ECB00E749C2 /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C0E3458A1C582ECB00E749C2 /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C0E3458B1C582ECB00E749C2 /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C0E3458C1C582ECB00E749C2 /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C0E3458D1C582ECB00E749C2 /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C0E3458E1C582ECB00E749C2 /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C0E3458F1C582ECB00E749C2 /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C0E345901C582ECB00E749C2 /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C0E345911C582ECB00E749C2 /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C0E345921C582ECB00E749C2 /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C0E345931C582ECB00E749C2 /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C0E345941C582ECB00E749C2 /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C0E345951C582ECB00E749C2 /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C0E345961C582ECB00E749C2 /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C0E345971C582ECB00E749C2 /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C0E345981C582ECB00E749C2 /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C0E345991C582ECB00E749C2 /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C0E3459A1C582ECB00E749C2 /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C0E3459B1C582ECB00E749C2 /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C0E3459C1C582ECB00E749C2 /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C0E3459D1C582ECB00E749C2 /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C0E3459E1C582ECB00E749C2 /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C0E3459F1C582ECB00E749C2 /* getgroups.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9F138D9E9A0028D27C /* getgroups.c */; }; + C0E345A01C582ECB00E749C2 /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C0E345A11C582ECB00E749C2 /* msgctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA6138D9E9A0028D27C /* msgctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_MSGCTL -DKERNEL"; }; }; + C0E345A21C582ECB00E749C2 /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; }; + C0E345A31C582ECB00E749C2 /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C0E345A41C582ECB00E749C2 /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C0E345A51C582ECB00E749C2 /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C0E345A61C582ECB00E749C2 /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C0E345A71C582ECB00E749C2 /* semctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB2138D9E9A0028D27C /* semctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SEMCTL -DKERNEL"; }; }; + C0E345A81C582ECB00E749C2 /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C0E345A91C582ECB00E749C2 /* shmctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB4138D9E9A0028D27C /* shmctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SHMCTL -DKERNEL"; }; }; + C0E345AA1C582ECB00E749C2 /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C0E345AB1C582ECB00E749C2 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C0E345AC1C582ECB00E749C2 /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C0E345AD1C582ECB00E749C2 /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C0E345AE1C582ECB00E749C2 /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; }; + C0E345AF1C582ECB00E749C2 /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C0E345B01C582ECB00E749C2 /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C0E345B11C582ECB00E749C2 /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C0E345B21C582ECB00E749C2 /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C0E345B31C582ECB00E749C2 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + C0E345B41C582ECB00E749C2 /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C0E345B51C582ECB00E749C2 /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C0E345B61C582ECB00E749C2 /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; }; + C0E345B71C582ECB00E749C2 /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; }; + C0E345B81C582ECB00E749C2 /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; }; + C0E345B91C582ECB00E749C2 /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; }; + C0E345BA1C582ECB00E749C2 /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; }; + C0E345BB1C582ECB00E749C2 /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; }; + C0E345BC1C582ECB00E749C2 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; }; + C0E345BD1C582ECB00E749C2 /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; }; + C0E345BE1C582ECB00E749C2 /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; }; + C0E345BF1C582ECB00E749C2 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C0E345C01C582ECB00E749C2 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C0E345C11C582ECB00E749C2 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C0E345C21C582ECB00E749C2 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C0E345C31C582ECB00E749C2 /* scandir_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB350E138F769B0075BB52 /* scandir_b.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C0E345CD1C582ECB00E749C2 /* stpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060513DDEDF10094DD56 /* stpcpy.c */; }; + C0E345CE1C582ECB00E749C2 /* stpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060913DDEEA10094DD56 /* stpncpy.c */; }; + C0E345CF1C582ECB00E749C2 /* strcat.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060C13DDF26A0094DD56 /* strcat.c */; }; + C0E345D01C582ECB00E749C2 /* strncat.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060F13DDF4340094DD56 /* strncat.c */; }; + C0E345D21C582ECB00E749C2 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + C0E345D31C582ECB00E749C2 /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + C0E345D41C582ECB00E749C2 /* eos_stubs.c in Sources */ = {isa = PBXBuildFile; fileRef = C925D1FB151805C6003D315B /* eos_stubs.c */; }; + C0E345D61C582ECB00E749C2 /* assumes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C64A215519BAF00342BFA /* assumes.c */; }; + C0E345D71C582ECB00E749C2 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + C0E345D81C582ECB00E749C2 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; + C0E345D91C582ECB00E749C2 /* memccpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F169A3C1643B7BA0029E851 /* memccpy_chk.c */; }; + C0E345DB1C582ECB00E749C2 /* libBase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C9C2A94D138DFFD900287F00 /* libBase.a */; }; + C0E345DC1C582ECB00E749C2 /* libFreeBSD.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C9257ED0138E1B5000B3107C /* libFreeBSD.a */; }; + C0E345DD1C582ECB00E749C2 /* libvCancelable.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C9D94360138EC3E300FB7ACC /* libvCancelable.a */; }; + C0E345DE1C582ECB00E749C2 /* libTRE.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B122F2AD1432B8E600AF95D0 /* libTRE.a */; }; + C9257ED5138E1C2E00B3107C /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; }; + C9257ED6138E1C2E00B3107C /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C9257ED7138E1C2E00B3107C /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C9257ED8138E1C2E00B3107C /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; }; + C9257ED9138E1C2E00B3107C /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C9257EDA138E1C2E00B3107C /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C9257EDB138E1C2E00B3107C /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C9257EDC138E1C2E00B3107C /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C9257EDD138E1C5D00B3107C /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EDE138E1C5D00B3107C /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EDF138E1C5D00B3107C /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EE0138E1C5D00B3107C /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EE1138E1C5D00B3107C /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EE2138E1C5D00B3107C /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE -UDEBUG"; }; }; + C9257EE3138E1C5D00B3107C /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE -UDEBUG"; }; }; + C9257EE4138E1C5D00B3107C /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EE5138E1C5D00B3107C /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EE6138E1C5D00B3107C /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EE7138E1C5D00B3107C /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EE8138E1C5D00B3107C /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EE9138E1C5D00B3107C /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EEA138E1C5D00B3107C /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EEB138E1C5D00B3107C /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE -UDEBUG"; }; }; + C9257EEC138E1C5D00B3107C /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE -UDEBUG"; }; }; + C9257EED138E1C5D00B3107C /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE -UDEBUG"; }; }; + C9257EEE138E1C5D00B3107C /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EEF138E1C5D00B3107C /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EF0138E1C5D00B3107C /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE -UDEBUG"; }; }; + C9257EF1138E1C5D00B3107C /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EF2138E1C5D00B3107C /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE -UDEBUG"; }; }; + C9257EF3138E1C5D00B3107C /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EF4138E1C5D00B3107C /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EF5138E1C5D00B3107C /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EF6138E1C5D00B3107C /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE -D_DARWIN_UNLIMITED_STREAMS"; }; }; + C9257EF7138E1C5D00B3107C /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EF8138E1C5D00B3107C /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EF9138E1C5D00B3107C /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EFA138E1C5D00B3107C /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; settings = {COMPILER_FLAGS = "-D__DBINTERFACE_PRIVATE"; }; }; + C9257EFB138E1C6A00B3107C /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C9257EFC138E1C6A00B3107C /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C9257EFD138E1C6A00B3107C /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C9257EFE138E1C6A00B3107C /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C9257EFF138E1C6A00B3107C /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C9257F00138E1C6A00B3107C /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C9257F01138E1C6A00B3107C /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C9257F02138E1C6A00B3107C /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C9257F03138E1C6A00B3107C /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C9257F04138E1C6A00B3107C /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C9257F05138E1C6A00B3107C /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C9257F06138E1C6A00B3107C /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C9257F07138E1C6A00B3107C /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C9257F09138E1C6A00B3107C /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C9257F0A138E1C6A00B3107C /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C9257F0B138E1C6A00B3107C /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C9257F0C138E1C6A00B3107C /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C9257F0D138E1C6A00B3107C /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C9257F0E138E1C6A00B3107C /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C9257F0F138E1C8200B3107C /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C9257F10138E1C8200B3107C /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C9257F11138E1C8200B3107C /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; }; + C9257F12138E1C8200B3107C /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C9257F13138E1C8200B3107C /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C9257F14138E1C8200B3107C /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; }; + C9257F15138E1C8200B3107C /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; settings = {COMPILER_FLAGS = "-include gen/__dirent.h"; }; }; + C9257F16138E1C8200B3107C /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C9257F17138E1C8200B3107C /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; }; + C9257F18138E1C8200B3107C /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; }; + C9257F19138E1C8200B3107C /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C9257F1A138E1C8200B3107C /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C9257F1B138E1C8200B3107C /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C9257F1C138E1C8200B3107C /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C9257F1D138E1C8200B3107C /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C9257F1E138E1C8200B3107C /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C9257F1F138E1C8200B3107C /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; }; + C9257F20138E1C8200B3107C /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C9257F21138E1C8200B3107C /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C9257F22138E1C8200B3107C /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C9257F23138E1C8200B3107C /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; }; + C9257F24138E1C8200B3107C /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C9257F25138E1C8200B3107C /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C9257F26138E1C8200B3107C /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; }; + C9257F27138E1C8200B3107C /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; }; + C9257F28138E1C8200B3107C /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C9257F29138E1C8200B3107C /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C9257F2A138E1C8200B3107C /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; }; + C9257F2B138E1C8200B3107C /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C9257F2C138E1C8200B3107C /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C9257F2D138E1C8200B3107C /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C9257F2E138E1C8200B3107C /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; }; + C9257F2F138E1C8200B3107C /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C9257F30138E1C8200B3107C /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C9257F31138E1C8200B3107C /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; }; + C9257F32138E1C8200B3107C /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C9257F33138E1C8200B3107C /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; settings = {COMPILER_FLAGS = "-include gen/__dirent.h"; }; }; + C9257F34138E1C8200B3107C /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; }; + C9257F35138E1C8200B3107C /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; }; + C9257F37138E1C8200B3107C /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C9257F39138E1C8200B3107C /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; settings = {COMPILER_FLAGS = "-include gen/__dirent.h"; }; }; + C9257F3A138E1C8200B3107C /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C9257F3B138E1C8200B3107C /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; settings = {COMPILER_FLAGS = "-include gen/__dirent.h"; }; }; + C9257F3C138E1C8200B3107C /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; settings = {COMPILER_FLAGS = "-include gen/__dirent.h"; }; }; + C9257F3D138E1C8200B3107C /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C9257F3E138E1C8200B3107C /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; settings = {COMPILER_FLAGS = "-include gen/__dirent.h"; }; }; + C9257F3F138E1C8200B3107C /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C9257F40138E1C8200B3107C /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; }; + C9257F41138E1C8200B3107C /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C9257F42138E1C8200B3107C /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C9257F43138E1C8200B3107C /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C9257F44138E1C8200B3107C /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C9257F45138E1C8200B3107C /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; }; + C9257F46138E1C8200B3107C /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C9257F47138E1C8200B3107C /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C9257F48138E1C8200B3107C /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C9257F49138E1C8200B3107C /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; }; + C9257F4A138E1C8200B3107C /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; }; + C9257F4B138E1C8200B3107C /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C9257F4C138E1C8200B3107C /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; settings = {COMPILER_FLAGS = "-include gen/__dirent.h"; }; }; + C9257F4D138E1C8200B3107C /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; }; + C9257F4E138E1C8200B3107C /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C9257F4F138E1C8200B3107C /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C9257F51138E1C8200B3107C /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; }; + C9257F52138E1C8200B3107C /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C9257F53138E1C8200B3107C /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C9257F54138E1C8200B3107C /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C9257F55138E1C8200B3107C /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C9257F56138E1C8200B3107C /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; }; + C9257F57138E1C8200B3107C /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C9257F58138E1C8200B3107C /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C9257F59138E1C8200B3107C /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; }; + C9257F5A138E1C8200B3107C /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C9257F5B138E1C8200B3107C /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; }; + C9257F5C138E1C9700B3107C /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C9257F5D138E1C9700B3107C /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C9257F5E138E1C9700B3107C /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C9257F5F138E1C9700B3107C /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; settings = {COMPILER_FLAGS = "-D_DARWIN_UNLIMITED_STREAMS"; }; }; + C9257F60138E1C9700B3107C /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C9257F61138E1C9700B3107C /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C9257F62138E1C9700B3107C /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C9257F63138E1C9700B3107C /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C9257F64138E1C9700B3107C /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C9257F65138E1C9700B3107C /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C9257F66138E1C9700B3107C /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C9257F67138E1C9700B3107C /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C9257F68138E1C9700B3107C /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C9257F69138E1C9700B3107C /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C9257F6A138E1C9700B3107C /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C9257F6B138E1C9700B3107C /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C9257F6C138E1C9700B3107C /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C9257F6D138E1C9700B3107C /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C9257F6E138E1C9700B3107C /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C9257F6F138E1C9700B3107C /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C9257F70138E1C9700B3107C /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C9257F71138E1C9700B3107C /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C9257F72138E1C9700B3107C /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C9257F73138E1C9700B3107C /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C9257F74138E1C9700B3107C /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C9257F75138E1C9700B3107C /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C9257F76138E1C9700B3107C /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C9257F77138E1C9700B3107C /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C9257F79138E1C9700B3107C /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C9257F7A138E1C9700B3107C /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C9257F7B138E1C9700B3107C /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; settings = {COMPILER_FLAGS = "-D_DARWIN_UNLIMITED_STREAMS"; }; }; + C9257F7C138E1C9700B3107C /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C9257F7D138E1C9700B3107C /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C9257F7E138E1C9700B3107C /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C9257F7F138E1C9700B3107C /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C9257F80138E1C9700B3107C /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C9257F81138E1C9700B3107C /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; }; + C9257F82138E1C9700B3107C /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C9257F83138E1C9700B3107C /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C9257F84138E1C9700B3107C /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C9257F85138E1C9700B3107C /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C9257F86138E1C9700B3107C /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C9257F87138E1C9700B3107C /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C9257F88138E1C9700B3107C /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C9257F89138E1C9700B3107C /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C9257F8A138E1C9700B3107C /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C9257F8B138E1C9700B3107C /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C9257F8C138E1C9700B3107C /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C9257F8D138E1C9700B3107C /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C9257F8E138E1C9700B3107C /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C9257F8F138E1C9700B3107C /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C9257F90138E1C9700B3107C /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C9257F91138E1C9700B3107C /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C9257F92138E1C9700B3107C /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C9257F93138E1C9700B3107C /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C9257F94138E1C9700B3107C /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C9257F95138E1C9700B3107C /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C9257F96138E1C9700B3107C /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C9257F97138E1C9700B3107C /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C9257F98138E1C9700B3107C /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C9257F99138E1C9700B3107C /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C9257F9A138E1C9700B3107C /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C9257F9B138E1C9700B3107C /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C9257F9C138E1C9700B3107C /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C9257F9D138E1C9700B3107C /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C9257F9E138E1C9700B3107C /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C9257F9F138E1C9700B3107C /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C9257FA0138E1C9700B3107C /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; }; + C9257FA1138E1C9700B3107C /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; }; + C9257FA2138E1C9700B3107C /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C9257FA3138E1C9700B3107C /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C9257FA4138E1C9700B3107C /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C9257FA5138E1CC000B3107C /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C9257FA6138E1CC000B3107C /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C9257FA7138E1CC000B3107C /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C9257FA8138E1CC000B3107C /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C9257FA9138E1CC000B3107C /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C9257FAA138E1CC000B3107C /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; }; + C9257FAB138E1CC000B3107C /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C9257FAC138E1CC000B3107C /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C9257FAD138E1CC000B3107C /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C9257FAE138E1CC000B3107C /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C9257FAF138E1CC000B3107C /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C9257FB0138E1CC000B3107C /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C9257FB1138E1CC000B3107C /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C9257FB2138E1CC000B3107C /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C9257FB3138E1CC000B3107C /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C9257FB4138E1CC000B3107C /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C9257FB5138E1CC000B3107C /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C9257FB6138E1CC000B3107C /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C9257FB7138E1CC000B3107C /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C9257FB8138E1CC000B3107C /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; }; + C9257FB9138E1CC000B3107C /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C9257FBA138E1CC000B3107C /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C9257FBB138E1CC000B3107C /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C9257FBC138E1CC000B3107C /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; }; + C9257FBD138E1CC000B3107C /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C9257FBE138E1CC000B3107C /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C9257FBF138E1CC000B3107C /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C9257FC0138E1CC000B3107C /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; }; + C9257FC1138E1CC000B3107C /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C9257FC2138E1CC000B3107C /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C9257FC3138E1CC000B3107C /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C9257FC4138E1CC000B3107C /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C9257FC5138E1CC000B3107C /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C9257FC6138E1CC000B3107C /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C9257FC7138E1CC000B3107C /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C9257FC8138E1CC000B3107C /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C9257FC9138E1CC000B3107C /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C9257FCA138E1CC000B3107C /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; }; + C9257FCB138E1CC000B3107C /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C9257FCC138E1CC000B3107C /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C9257FCD138E1CC000B3107C /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C9257FCE138E1CC000B3107C /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C9257FCF138E1CC000B3107C /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C9257FD0138E1CC000B3107C /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C9257FD1138E1CC000B3107C /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C9257FD2138E1CC000B3107C /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C9257FD3138E1CC000B3107C /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C9257FD4138E1CC000B3107C /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C9257FD5138E1CC000B3107C /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C9257FD6138E1CC000B3107C /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C9257FD7138E1CC000B3107C /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C9257FD8138E1CC000B3107C /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C9257FD9138E1CC000B3107C /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C9257FDA138E1CC000B3107C /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C9257FDB138E1CC000B3107C /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C9257FDC138E1CC000B3107C /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C9257FDD138E1CC000B3107C /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C9257FDE138E1CC000B3107C /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C9257FDF138E1CC000B3107C /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C9257FE0138E1CC000B3107C /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C9257FE1138E1CC000B3107C /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C9257FE2138E1CC000B3107C /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C9257FE3138E1CC000B3107C /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C9257FE4138E1CC000B3107C /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C9257FE5138E1CC000B3107C /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C9257FE6138E1CC000B3107C /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C9257FE7138E1CC000B3107C /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C9257FE8138E1CC000B3107C /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C9257FE9138E1CC000B3107C /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C9257FEA138E1CC000B3107C /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C9257FEB138E1CC000B3107C /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C9257FEC138E1CC000B3107C /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C9257FED138E1CC000B3107C /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; }; + C9257FEE138E1CC000B3107C /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; }; + C9257FEF138E1CC000B3107C /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C9257FF0138E1CC000B3107C /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C9257FF1138E1CC000B3107C /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C9257FF2138E1CC000B3107C /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C9257FF3138E1CC000B3107C /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C9257FF4138E1CC000B3107C /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C9257FF5138E1CC000B3107C /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C9257FF6138E1CC000B3107C /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C9257FF7138E1CC000B3107C /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C9257FF8138E1CC000B3107C /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C9257FF9138E1CC000B3107C /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C9257FFA138E1CC000B3107C /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C9257FFB138E1CC000B3107C /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C9257FFC138E1CC000B3107C /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C9257FFD138E1CC000B3107C /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C9257FFE138E1CC000B3107C /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C9257FFF138E1CC000B3107C /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C9258000138E1CC000B3107C /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C9258001138E1CC000B3107C /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C9258002138E1CC000B3107C /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C9258003138E1CC000B3107C /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C9258004138E1CC000B3107C /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C9258005138E1CC000B3107C /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C9258006138E1CC000B3107C /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C9258007138E1CC000B3107C /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C9258008138E1CC000B3107C /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; }; + C9258009138E1CC000B3107C /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; }; + C925800A138E1CC000B3107C /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; }; + C925800B138E1CC000B3107C /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C925800C138E1CC000B3107C /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C9258015138E1CD200B3107C /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C9258018138E1CD200B3107C /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C925801B138E1CD200B3107C /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C925801C138E1CD200B3107C /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C9258020138E1CD200B3107C /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C9258022138E1CD200B3107C /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C9258023138E1CD200B3107C /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; }; + C9258024138E1CD200B3107C /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; }; + C9258028138E1CD200B3107C /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C925802C138E1CD200B3107C /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C925802E138E1CD200B3107C /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C925802F138E1CD200B3107C /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C9258030138E1CD200B3107C /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; }; + C9258031138E1CD200B3107C /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C9258032138E1CD200B3107C /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C9258033138E1CD200B3107C /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C9258035138E1CD200B3107C /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C9258036138E1CD200B3107C /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C9258037138E1CD200B3107C /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C9258038138E1CD200B3107C /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C9258039138E1CD200B3107C /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C925803A138E1CD200B3107C /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C925803B138E1CD200B3107C /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C925803C138E1CD200B3107C /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C925803D138E1CD200B3107C /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C925803E138E1CD200B3107C /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C925803F138E1CD200B3107C /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C9258040138E1CD200B3107C /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C9258041138E1CD200B3107C /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C9258042138E1CD200B3107C /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C9258043138E1CD200B3107C /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C9258044138E1CD200B3107C /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C9258045138E1CD200B3107C /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C9258046138E1CD200B3107C /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C9258047138E1CD200B3107C /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C9258048138E1CD200B3107C /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C9258049138E1CD200B3107C /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C925804A138E1CD200B3107C /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C925804B138E1CD200B3107C /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C925804C138E1CD200B3107C /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C925804D138E1CD200B3107C /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C925804E138E1CD200B3107C /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C925804F138E1CD200B3107C /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C9258050138E1CD200B3107C /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C9258051138E1CD200B3107C /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C9258052138E1CD200B3107C /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C9258053138E1CD200B3107C /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C9258054138E1CD200B3107C /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C9258055138E1CD200B3107C /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C9258058138E1CDD00B3107C /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C92580CC138E2D3100B3107C /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C925D1FD1518F4A2003D315B /* eos_stubs.c in Sources */ = {isa = PBXBuildFile; fileRef = C925D1FB151805C6003D315B /* eos_stubs.c */; }; + C9421014138F23CA004BA536 /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; settings = {COMPILER_FLAGS = "-D__FBSDID=__RCSID"; }; }; + C9421015138F23CA004BA536 /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; settings = {COMPILER_FLAGS = "-D__FBSDID=__RCSID"; }; }; + C9421016138F23CA004BA536 /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; settings = {COMPILER_FLAGS = "-D__FBSDID=__RCSID"; }; }; + C9421017138F23CA004BA536 /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; settings = {COMPILER_FLAGS = "-D__FBSDID=__RCSID"; }; }; + C9421021138F2602004BA536 /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C9421022138F2661004BA536 /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C9421023138F2661004BA536 /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C9421024138F2661004BA536 /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C9421025138F2661004BA536 /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C942103913900C8A004BA536 /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CREAT"; }; }; + C942103A13900C8A004BA536 /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C942103B13900C8A004BA536 /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C942103C13900C8A004BA536 /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_KILLPG"; }; }; + C942103D13900C8A004BA536 /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C942103E13900C8A004BA536 /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C942103F13900C8A004BA536 /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C942104013900C8A004BA536 /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C942104113900C8A004BA536 /* setregid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360A138D9E980028D27C /* setregid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREGID"; }; }; + C942104213900C8A004BA536 /* setreuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360B138D9E980028D27C /* setreuid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREUID"; }; }; + C942104313900C8A004BA536 /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C942104413900C8A004BA536 /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SIGPAUSE"; }; }; + C942104613900C8A004BA536 /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C942104A13900C8A004BA536 /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C942104B13900C8A004BA536 /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; }; + C942104C13900C8A004BA536 /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; }; + C942104D13900C8A004BA536 /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; }; + C942104E13900C8A004BA536 /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; }; + C942104F13900C8A004BA536 /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; }; + C942105013900C8A004BA536 /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; }; + C942105113900C8A004BA536 /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; }; + C942105213900C8A004BA536 /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; }; + C942105313900C8A004BA536 /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; }; + C942105413900C8A004BA536 /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; }; + C942105513900C8A004BA536 /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; }; + C942105613900C8A004BA536 /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; }; + C942105713900C8A004BA536 /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; }; + C942105813900C8A004BA536 /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; }; + C942105913900C8A004BA536 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; }; + C942105A13900C8A004BA536 /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; }; + C942105B13900C8A004BA536 /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; }; + C942105C13900C8A004BA536 /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; }; + C942105D13900C8A004BA536 /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; }; + C942105E13900C8A004BA536 /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; }; + C942105F13900C8A004BA536 /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; }; + C942106013900C8A004BA536 /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; }; + C942106113900C8A004BA536 /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; }; + C942106213900C8A004BA536 /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; }; + C942106313900C8A004BA536 /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; }; + C942106413900C8A004BA536 /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; }; + C942106513900C8A004BA536 /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; }; + C942106613900C8A004BA536 /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; }; + C942106713900C8A004BA536 /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; }; + C942106813900C8A004BA536 /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; }; + C942106913900C8A004BA536 /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C942106A13900C8A004BA536 /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C942106B13900C8A004BA536 /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C942106C13900C8A004BA536 /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C942106D13900C8A004BA536 /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C942106E13900C8A004BA536 /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C942106F13900C8A004BA536 /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C942107013900C8A004BA536 /* _ldbl_util.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5368E138D9E980028D27C /* _ldbl_util.c */; }; + C942107113900C8A004BA536 /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C942107213900C8A004BA536 /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C942107313900C8A004BA536 /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C942107413900C8A004BA536 /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C942107513900C8A004BA536 /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C942107613900C8A004BA536 /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C942107713900C8A004BA536 /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C942107813900C8A004BA536 /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C942107913900C8A004BA536 /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C942107A13900C8A004BA536 /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C942107B13900C8A004BA536 /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C942107C13900C8A004BA536 /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C942107D13900C8A004BA536 /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C942107E13900C8A004BA536 /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C942107F13900C8A004BA536 /* gdtoa-strtoIg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */; }; + C942108013900C8A004BA536 /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C942108113900C8A004BA536 /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C942108213900C8A004BA536 /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C942108313900C8A004BA536 /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C942108413900C8A004BA536 /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C942108513900C8A004BA536 /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C942108613900C8A004BA536 /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C942108713900C8A004BA536 /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C942108813900C8A004BA536 /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C942108913900C8A004BA536 /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C942109313900C8A004BA536 /* authentication.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D5138D9E990028D27C /* authentication.c */; }; + C942109413900C8A004BA536 /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C942109613900C8A004BA536 /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_CONFSTR"; }; }; + C942109713900C8A004BA536 /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_ENCRYPT -DLIBC_ALIAS_SETKEY"; }; }; + C942109813900C8A004BA536 /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C942109913900C8A004BA536 /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C942109A13900C8A004BA536 /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C942109B13900C8A004BA536 /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C942109C13900C8A004BA536 /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C942109D13900C8A004BA536 /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C942109E13900C8A004BA536 /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C942109F13900C8A004BA536 /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C94210A013900C8A004BA536 /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C94210A113900C8A004BA536 /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOCK"; }; }; + C94210A213900C8A004BA536 /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOSEDIR -include gen/__dirent.h"; }; }; + C94210A313900C8A004BA536 /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C94210A413900C8A004BA536 /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C94210A513900C8A004BA536 /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C94210A613900C8A004BA536 /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C94210A713900C8A004BA536 /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C94210A813900C8A004BA536 /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C94210A913900C8A004BA536 /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C94210AA13900C8A004BA536 /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C94210AB13900C8A004BA536 /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C94210AC13900C8A004BA536 /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FNMATCH"; }; }; + C94210AD13900C8A004BA536 /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C94210AE13900C8A004BA536 /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C94210AF13900C8A004BA536 /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C94210B013900C8A004BA536 /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C94210B113900C8A004BA536 /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C94210B213900C8A004BA536 /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C94210B313900C8A004BA536 /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C94210B413900C8A004BA536 /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C94210B513900C8A004BA536 /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C94210B613900C8A004BA536 /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C94210B713900C8A004BA536 /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_GLOB"; }; }; + C94210B813900C8A004BA536 /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C94210B913900C8A004BA536 /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C94210BA13900C8A004BA536 /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C94210BB13900C8A004BA536 /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_LOCKF"; }; }; + C94210BC13900C8A004BA536 /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C94210BD13900C8A004BA536 /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C94210BE13900C8A004BA536 /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_NICE"; }; }; + C94210BF13900C8A004BA536 /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C94210C013900C8A004BA536 /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS___OPENDIR2 -DLIBC_ALIAS_OPENDIR -include gen/__dirent.h"; }; }; + C94210C113900C8A004BA536 /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PAUSE"; }; }; + C94210C213900C8A004BA536 /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_POPEN"; }; }; + C94210C413900C8A004BA536 /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C94210C513900C8A004BA536 /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + C94210C613900C8A004BA536 /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C94210C713900C8A004BA536 /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C94210C813900C8A004BA536 /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REWINDDIR -include gen/__dirent.h"; }; }; + C94210C913900C8A004BA536 /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C94210CA13900C8A004BA536 /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C94210CB13900C8A004BA536 /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEEKDIR -include gen/__dirent.h"; }; }; + C94210CC13900C8A004BA536 /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C94210CD13900C8A004BA536 /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SETMODE"; }; }; + C94210CE13900C8A004BA536 /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C94210CF13900C8A004BA536 /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C94210D013900C8A004BA536 /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C94210D113900C8A004BA536 /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C94210D213900C8A004BA536 /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SLEEP"; }; }; + C94210D313900C8A004BA536 /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C94210D413900C8A004BA536 /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C94210D513900C8A004BA536 /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C94210D613900C8A004BA536 /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C94210D713900C8A004BA536 /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C94210D813900C8A004BA536 /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C94210D913900C8A004BA536 /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS__SEEKDIR -DLIBC_ALIAS_TELLDIR -include gen/__dirent.h"; }; }; + C94210DA13900C8A004BA536 /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TCDRAIN"; }; }; + C94210DB13900C8A004BA536 /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C94210DC13900C8A004BA536 /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C94210DD13900C8A004BA536 /* timezone.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A4138D9E990028D27C /* timezone.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C94210DE13900C8A004BA536 /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TTYNAME_R"; }; }; + C94210DF13900C8A004BA536 /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C94210E013900C8A004BA536 /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C94210E113900C8A004BA536 /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C94210E213900C8A004BA536 /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C94210E313900C8A004BA536 /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_USLEEP"; }; }; + C94210E413900C8A004BA536 /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C94210E513900C8A004BA536 /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C94210E613900C8A004BA536 /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAIT"; }; }; + C94210E713900C8A004BA536 /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C94210E813900C8A004BA536 /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAITPID"; }; }; + C94210E913900C8A004BA536 /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_FTS_CHILDREN -DLIBC_ALIAS_FTS_CLOSE -DLIBC_ALIAS_FTS_OPEN -DLIBC_ALIAS_FTS_OPEN_B -DLIBC_ALIAS_FTS_READ -DLIBC_ALIAS_FTS_SET"; }; }; + C94210EA13900C8A004BA536 /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C94210EB13900C8A004BA536 /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C94210EC13900C8A004BA536 /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C94210ED13900C8A004BA536 /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C94210EE13900C8A004BA536 /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C94210F313900C8A004BA536 /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_NANOSLEEP"; }; }; + C94210F413900C8A004BA536 /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C94210F513900C8A004BA536 /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_FTW -DLIBC_ALIAS_NFTW"; }; }; + C94210F613900C8A004BA536 /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C94210F813900C8A004BA536 /* oldsyslog.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537EA138D9E990028D27C /* oldsyslog.c */; }; + C94210FB13900C8A004BA536 /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C94210FC13900C8A004BA536 /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C94210FF13900C8A004BA536 /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C942110113900C8A004BA536 /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C942110213900C8A004BA536 /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C942110313900C8A004BA536 /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C942110413900C8A004BA536 /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + C942110613900C8A004BA536 /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C942112613900C8A004BA536 /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C942112713900C8A004BA536 /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C942112813900C8A004BA536 /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C942112913900C8A004BA536 /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; }; + C942112A13900C8A004BA536 /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C942112B13900C8A004BA536 /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C942112C13900C8A004BA536 /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C942112D13900C8A004BA536 /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C942112E13900C8A004BA536 /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C942112F13900C8A004BA536 /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C942113013900C8A004BA536 /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C942113113900C8A004BA536 /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C942113213900C8A004BA536 /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C942113313900C8A004BA536 /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C942113413900C8A004BA536 /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C942113513900C8A004BA536 /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C942113613900C8A004BA536 /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C942113713900C8A004BA536 /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C942113813900C8A004BA536 /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C942113913900C8A004BA536 /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C942113A13900C8A004BA536 /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C942113B13900C8A004BA536 /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C942113C13900C8A004BA536 /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C942113D13900C8A004BA536 /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C942113E13900C8A004BA536 /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C942113F13900C8A004BA536 /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C942114013900C8A004BA536 /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C942114113900C8A004BA536 /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C942114213900C8A004BA536 /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C942114313900C8A004BA536 /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C942114413900C8A004BA536 /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C942114513900C8A004BA536 /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; }; + C942114613900C8A004BA536 /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C942114713900C8A004BA536 /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C942114813900C8A004BA536 /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C942114913900C8A004BA536 /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C942114A13900C8A004BA536 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C942114B13900C8A004BA536 /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C942114C13900C8A004BA536 /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WCSFTIME -DLIBC_ALIAS_WCSFTIME_L"; }; }; + C942114D13900C8A004BA536 /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C942114E13900C8A004BA536 /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C942114F13900C8A004BA536 /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C942115013900C8A004BA536 /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C942115113900C8A004BA536 /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C942115213900C8A004BA536 /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C942115313900C8A004BA536 /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C942115413900C8A004BA536 /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C942115513900C8A004BA536 /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C942115613900C8A004BA536 /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C942115713900C8A004BA536 /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C942115813900C8A004BA536 /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C942115913900C8A004BA536 /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C942115A13900C8A004BA536 /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C942115B13900C8A004BA536 /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C942115C13900C8A004BA536 /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C942115D13900C8A004BA536 /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C942115E13900C8A004BA536 /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; }; + C942115F13900C8A004BA536 /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C942116013900C8A004BA536 /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C942116113900C8A004BA536 /* lconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E8138D9E990028D27C /* lconv.c */; }; + C942116213900C8A004BA536 /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; }; + C942116313900C8A004BA536 /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; }; + C942116413900C8A004BA536 /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; }; + C942116513900C8A004BA536 /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C942116613900C8A004BA536 /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C942116713900C8A004BA536 /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C942116813900C8A004BA536 /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C942116913900C8A004BA536 /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C942116A13900C8A004BA536 /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C942116B13900C8A004BA536 /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C942116C13900C8A004BA536 /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C942116D13900C8A004BA536 /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C942116E13900C8A004BA536 /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C942116F13900C8A004BA536 /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C942117013900C8A004BA536 /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C942117113900C8A004BA536 /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C942117213900C8A004BA536 /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C942117313900C8A004BA536 /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_RECV"; }; }; + C942117413900C8A004BA536 /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEND"; }; }; + C942117513900C8A004BA536 /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C942117613900C8A004BA536 /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C942117713900C8A004BA536 /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C942117813900C8A004BA536 /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C942117913900C8A004BA536 /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C942117A13900C8A004BA536 /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C942117B13900C8A004BA536 /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C942117C13900C8A004BA536 /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C942117D13900C8A004BA536 /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C942119113900C8A004BA536 /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C94211A213900C8A004BA536 /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C94211A313900C8A004BA536 /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C94211A413900C8A004BA536 /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C94211A513900C8A004BA536 /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C94211A613900C8A004BA536 /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C94211A713900C8A004BA536 /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FDOPEN"; }; }; + C94211A813900C8A004BA536 /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C94211A913900C8A004BA536 /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C94211AA13900C8A004BA536 /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C94211AB13900C8A004BA536 /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C94211AC13900C8A004BA536 /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C94211AD13900C8A004BA536 /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C94211AE13900C8A004BA536 /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C94211AF13900C8A004BA536 /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C94211B013900C8A004BA536 /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C94211B113900C8A004BA536 /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C94211B213900C8A004BA536 /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C94211B313900C8A004BA536 /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C94211B413900C8A004BA536 /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C94211B513900C8A004BA536 /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FOPEN"; }; }; + C94211B613900C8A004BA536 /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C94211B713900C8A004BA536 /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C94211B813900C8A004BA536 /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C94211B913900C8A004BA536 /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FPUTS"; }; }; + C94211BA13900C8A004BA536 /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C94211BB13900C8A004BA536 /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C94211BC13900C8A004BA536 /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C94211BD13900C8A004BA536 /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FREOPEN"; }; }; + C94211BE13900C8A004BA536 /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C94211BF13900C8A004BA536 /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C94211C013900C8A004BA536 /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C94211C113900C8A004BA536 /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C94211C213900C8A004BA536 /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C94211C313900C8A004BA536 /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C94211C413900C8A004BA536 /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C94211C513900C8A004BA536 /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C94211C613900C8A004BA536 /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C94211C713900C8A004BA536 /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FWRITE"; }; }; + C94211C813900C8A004BA536 /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C94211C913900C8A004BA536 /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C94211CA13900C8A004BA536 /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C94211CB13900C8A004BA536 /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C94211CC13900C8A004BA536 /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C94211CD13900C8A004BA536 /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C94211CE13900C8A004BA536 /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C94211CF13900C8A004BA536 /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C94211D013900C8A004BA536 /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C94211D113900C8A004BA536 /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C94211D213900C8A004BA536 /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C94211D313900C8A004BA536 /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C94211D413900C8A004BA536 /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C94211D513900C8A004BA536 /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C94211D613900C8A004BA536 /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C94211D713900C8A004BA536 /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C94211D813900C8A004BA536 /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C94211D913900C8A004BA536 /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C94211DA13900C8A004BA536 /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C94211DB13900C8A004BA536 /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C94211DC13900C8A004BA536 /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C94211DD13900C8A004BA536 /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C94211DE13900C8A004BA536 /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C94211DF13900C8A004BA536 /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C94211E013900C8A004BA536 /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C94211E113900C8A004BA536 /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C94211E213900C8A004BA536 /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C94211E313900C8A004BA536 /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C94211E413900C8A004BA536 /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C94211E513900C8A004BA536 /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C94211E613900C8A004BA536 /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C94211E713900C8A004BA536 /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C94211E813900C8A004BA536 /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C94211E913900C8A004BA536 /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C94211EA13900C8A004BA536 /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TEMPNAM"; }; }; + C94211EB13900C8A004BA536 /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -D_DARWIN_UNLIMITED_STREAMS"; }; }; + C94211EC13900C8A004BA536 /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C94211ED13900C8A004BA536 /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C94211EE13900C8A004BA536 /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C94211EF13900C8A004BA536 /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C94211F013900C8A004BA536 /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C94211F113900C8A004BA536 /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C94211F213900C8A004BA536 /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C94211F313900C8A004BA536 /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C94211F413900C8A004BA536 /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C94211F513900C8A004BA536 /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C94211F613900C8A004BA536 /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C94211F713900C8A004BA536 /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C94211F813900C8A004BA536 /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C94211F913900C8A004BA536 /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C94211FA13900C8A004BA536 /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C94211FB13900C8A004BA536 /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C94211FC13900C8A004BA536 /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C94211FD13900C8A004BA536 /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C94211FE13900C8A004BA536 /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C94211FF13900C8A004BA536 /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C942120013900C8A004BA536 /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C942120113900C8A004BA536 /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C942120213900C8A004BA536 /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C942120313900C8A004BA536 /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C942120413900C8A004BA536 /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C942120513900C8A004BA536 /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C942120613900C8A004BA536 /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C942120713900C8A004BA536 /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C942120813900C8A004BA536 /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C942120913900C8A004BA536 /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C942120A13900C8A004BA536 /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C942120B13900C8A004BA536 /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C942120C13900C8A004BA536 /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C942120D13900C8A004BA536 /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C942120E13900C8A004BA536 /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C942120F13900C8A004BA536 /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_GETOPT"; }; }; + C942121013900C8A004BA536 /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C942121113900C8A004BA536 /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C942121213900C8A004BA536 /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C942121313900C8A004BA536 /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C942121413900C8A004BA536 /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C942121513900C8A004BA536 /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C942121613900C8A004BA536 /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C942121713900C8A004BA536 /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C942121813900C8A004BA536 /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C942121913900C8A004BA536 /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C942121A13900C8A004BA536 /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C942121B13900C8A004BA536 /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C942121C13900C8A004BA536 /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C942121D13900C8A004BA536 /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C942121E13900C8A004BA536 /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C942121F13900C8A004BA536 /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PUTENV"; }; }; + C942122013900C8A004BA536 /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C942122113900C8A004BA536 /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C942122213900C8A004BA536 /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C942122313900C8A004BA536 /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C942122413900C8A004BA536 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C942122513900C8A004BA536 /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C942122613900C8A004BA536 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C942122713900C8A004BA536 /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C942122813900C8A004BA536 /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C942122913900C8A004BA536 /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C942122A13900C8A004BA536 /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C942122B13900C8A004BA536 /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C942122C13900C8A004BA536 /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C942122D13900C8A004BA536 /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C942122E13900C8A004BA536 /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C942122F13900C8A004BA536 /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C942123013900C8A004BA536 /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C942123113900C8A004BA536 /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C942123213900C8A004BA536 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SYSTEM"; }; }; + C942123313900C8A004BA536 /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C942123413900C8A004BA536 /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C942123513900C8A004BA536 /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C942123613900C8A004BA536 /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C942123713900C8A004BA536 /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C942123813900C8A004BA536 /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C942123913900C8A004BA536 /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + C942123A13900C8A004BA536 /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C942123B13900C8A004BA536 /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C942123C13900C8A004BA536 /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C942123D13900C8A004BA536 /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C942123E13900C8A004BA536 /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C942123F13900C8A004BA536 /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C942124013900C8A004BA536 /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_MKTIME"; }; }; + C942124113900C8A004BA536 /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRFTIME -DLIBC_ALIAS_STRFTIME_L"; }; }; + C942124213900C8A004BA536 /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRPTIME -DLIBC_ALIAS_STRPTIME_L"; }; }; + C942124313900C8A004BA536 /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C942124413900C8A004BA536 /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C942124513900C8A004BA536 /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; settings = {COMPILER_FLAGS = "-D_DARWIN_UNLIMITED_STREAMS"; }; }; + C942124613900C8A004BA536 /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C942124F13900C8A004BA536 /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C942125213900C8A004BA536 /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C942125513900C8A004BA536 /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C942125613900C8A004BA536 /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C942125A13900C8A004BA536 /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C942125C13900C8A004BA536 /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C942125D13900C8A004BA536 /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C942125E13900C8A004BA536 /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRERROR"; }; }; + C942126213900C8A004BA536 /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C942126613900C8A004BA536 /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C942126813900C8A004BA536 /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C942126913900C8A004BA536 /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C942126A13900C8A004BA536 /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C942126B13900C8A004BA536 /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C942126C13900C8A004BA536 /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C942126D13900C8A004BA536 /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C942126F13900C8A004BA536 /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C942127013900C8A004BA536 /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C942127113900C8A004BA536 /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C942127213900C8A004BA536 /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C942127313900C8A004BA536 /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C942127413900C8A004BA536 /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C942127513900C8A004BA536 /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C942127613900C8A004BA536 /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C942127713900C8A004BA536 /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C942127813900C8A004BA536 /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C942127913900C8A004BA536 /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C942127A13900C8A004BA536 /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C942127B13900C8A004BA536 /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C942127C13900C8A004BA536 /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C942127D13900C8A004BA536 /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C942127E13900C8A004BA536 /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C942127F13900C8A004BA536 /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C942128013900C8A004BA536 /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C942128113900C8A004BA536 /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C942128213900C8A004BA536 /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C942128313900C8A004BA536 /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C942128413900C8A004BA536 /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C942128513900C8A004BA536 /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C942128613900C8A004BA536 /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C942128713900C8A004BA536 /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C942128813900C8A004BA536 /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C942128913900C8A004BA536 /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C942128A13900C8A004BA536 /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C942128B13900C8A004BA536 /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C942128C13900C8A004BA536 /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C942128D13900C8A004BA536 /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C942128E13900C8A004BA536 /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C942128F13900C8A004BA536 /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C942129013900C8A004BA536 /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C942129113900C8A004BA536 /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C942129213900C8A004BA536 /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C942129413900C8A004BA536 /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C942129613900C8A004BA536 /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C942129713900C8A004BA536 /* getgroups.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9F138D9E9A0028D27C /* getgroups.c */; }; + C942129913900C8A004BA536 /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C942129A13900C8A004BA536 /* msgctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA6138D9E9A0028D27C /* msgctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_MSGCTL -DKERNEL"; }; }; + C942129B13900C8A004BA536 /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; }; + C942129C13900C8A004BA536 /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C942129D13900C8A004BA536 /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C942129E13900C8A004BA536 /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C942129F13900C8A004BA536 /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C94212A013900C8A004BA536 /* semctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB2138D9E9A0028D27C /* semctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SEMCTL -DKERNEL"; }; }; + C94212A113900C8A004BA536 /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C94212A213900C8A004BA536 /* shmctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB4138D9E9A0028D27C /* shmctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SHMCTL -DKERNEL"; }; }; + C94212A313900C8A004BA536 /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C94212A713900C8A004BA536 /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C94212A813900C8A004BA536 /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C94212AC13900C8A004BA536 /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; }; + C94212AD13900C8A004BA536 /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C94212AE13900C8A004BA536 /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C94212AF13900C8A004BA536 /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C94212B013900C8A004BA536 /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C94212B113900C8A004BA536 /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C94212B213900C8A004BA536 /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C94212B313900C8A004BA536 /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; }; + C94212B413900C8A004BA536 /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; }; + C94212B513900C8A004BA536 /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; }; + C94212B613900C8A004BA536 /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; }; + C94212B713900C8A004BA536 /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; }; + C94212B813900C8A004BA536 /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; }; + C94212B913900C8A004BA536 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; }; + C94212BA13900C8A004BA536 /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; }; + C94212BB13900C8A004BA536 /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; }; + C94212C613900C8A004BA536 /* scandir_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB350E138F769B0075BB52 /* scandir_b.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C94212E413901595004BA536 /* mcount.s in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DF9138D9E9A0028D27C /* mcount.s */; }; + C94213361390396E004BA536 /* mcount.s in Sources */ = {isa = PBXBuildFile; fileRef = C9B53819138D9E990028D27C /* mcount.s */; }; + C95B7ED7138F3BEA004311DA /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C95B7EE4138F3C55004311DA /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CREAT"; }; }; + C95B7EE5138F3C55004311DA /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C95B7EE6138F3C55004311DA /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C95B7EE7138F3C55004311DA /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; }; + C95B7EE8138F3C55004311DA /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C95B7EE9138F3C55004311DA /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C95B7EEA138F3C55004311DA /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C95B7EEB138F3C55004311DA /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C95B7EEC138F3C55004311DA /* setregid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360A138D9E980028D27C /* setregid.c */; }; + C95B7EED138F3C55004311DA /* setreuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360B138D9E980028D27C /* setreuid.c */; }; + C95B7EEE138F3C55004311DA /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C95B7EEF138F3C55004311DA /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SIGPAUSE"; }; }; + C95B7EF1138F3C55004311DA /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C95B7EF5138F3C55004311DA /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C95B7EF6138F3C55004311DA /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; }; + C95B7EF7138F3C55004311DA /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; }; + C95B7EF8138F3C55004311DA /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; }; + C95B7EF9138F3C55004311DA /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; }; + C95B7EFA138F3C55004311DA /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; }; + C95B7EFB138F3C55004311DA /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; }; + C95B7EFC138F3C55004311DA /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; }; + C95B7EFD138F3C55004311DA /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; }; + C95B7EFE138F3C55004311DA /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; }; + C95B7EFF138F3C55004311DA /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; }; + C95B7F00138F3C55004311DA /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; }; + C95B7F01138F3C55004311DA /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; }; + C95B7F02138F3C55004311DA /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; }; + C95B7F03138F3C55004311DA /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; }; + C95B7F04138F3C55004311DA /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; }; + C95B7F05138F3C55004311DA /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; }; + C95B7F06138F3C55004311DA /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; }; + C95B7F07138F3C55004311DA /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; }; + C95B7F08138F3C55004311DA /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; }; + C95B7F09138F3C55004311DA /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; }; + C95B7F0A138F3C55004311DA /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; }; + C95B7F0B138F3C55004311DA /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; }; + C95B7F0C138F3C55004311DA /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; }; + C95B7F0D138F3C55004311DA /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; }; + C95B7F0E138F3C55004311DA /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; }; + C95B7F0F138F3C55004311DA /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; }; + C95B7F10138F3C55004311DA /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; }; + C95B7F11138F3C55004311DA /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; }; + C95B7F12138F3C55004311DA /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; }; + C95B7F13138F3C55004311DA /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; }; + C95B7F14138F3C55004311DA /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C95B7F15138F3C55004311DA /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C95B7F16138F3C55004311DA /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C95B7F17138F3C55004311DA /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C95B7F18138F3C55004311DA /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C95B7F19138F3C55004311DA /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C95B7F1A138F3C55004311DA /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C95B7F1B138F3C55004311DA /* _ldbl_util.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5368E138D9E980028D27C /* _ldbl_util.c */; }; + C95B7F1C138F3C55004311DA /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C95B7F1D138F3C55004311DA /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C95B7F1E138F3C55004311DA /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C95B7F1F138F3C55004311DA /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C95B7F20138F3C55004311DA /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C95B7F21138F3C55004311DA /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C95B7F22138F3C55004311DA /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C95B7F23138F3C55004311DA /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C95B7F24138F3C55004311DA /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C95B7F25138F3C55004311DA /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C95B7F26138F3C55004311DA /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C95B7F27138F3C55004311DA /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C95B7F28138F3C55004311DA /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C95B7F29138F3C55004311DA /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C95B7F2A138F3C55004311DA /* gdtoa-strtoIg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */; }; + C95B7F2B138F3C55004311DA /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C95B7F2C138F3C55004311DA /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C95B7F2D138F3C55004311DA /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C95B7F2E138F3C55004311DA /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C95B7F2F138F3C55004311DA /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C95B7F30138F3C55004311DA /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C95B7F31138F3C55004311DA /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C95B7F32138F3C55004311DA /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C95B7F33138F3C55004311DA /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C95B7F34138F3C55004311DA /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C95B7F3E138F3C55004311DA /* authentication.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D5138D9E990028D27C /* authentication.c */; }; + C95B7F3F138F3C55004311DA /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C95B7F41138F3C55004311DA /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; }; + C95B7F42138F3C55004311DA /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; }; + C95B7F43138F3C55004311DA /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C95B7F44138F3C55004311DA /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C95B7F45138F3C55004311DA /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C95B7F46138F3C55004311DA /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C95B7F47138F3C55004311DA /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C95B7F48138F3C55004311DA /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C95B7F49138F3C55004311DA /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; }; + C95B7F4A138F3C55004311DA /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C95B7F4B138F3C55004311DA /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C95B7F4C138F3C55004311DA /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; }; + C95B7F4D138F3C55004311DA /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; }; + C95B7F4E138F3C55004311DA /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C95B7F4F138F3C55004311DA /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; }; + C95B7F50138F3C55004311DA /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; }; + C95B7F51138F3C55004311DA /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C95B7F52138F3C55004311DA /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C95B7F53138F3C55004311DA /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C95B7F54138F3C55004311DA /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C95B7F55138F3C55004311DA /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C95B7F56138F3C55004311DA /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C95B7F57138F3C55004311DA /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; }; + C95B7F58138F3C55004311DA /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C95B7F59138F3C55004311DA /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C95B7F5A138F3C55004311DA /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C95B7F5B138F3C55004311DA /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; }; + C95B7F5C138F3C55004311DA /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C95B7F5D138F3C55004311DA /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C95B7F5E138F3C55004311DA /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; }; + C95B7F5F138F3C55004311DA /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; }; + C95B7F60138F3C55004311DA /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C95B7F61138F3C55004311DA /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C95B7F62138F3C55004311DA /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; }; + C95B7F63138F3C55004311DA /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C95B7F64138F3C55004311DA /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C95B7F65138F3C55004311DA /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C95B7F66138F3C55004311DA /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_LOCKF"; }; }; + C95B7F67138F3C55004311DA /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C95B7F68138F3C55004311DA /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C95B7F69138F3C55004311DA /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; }; + C95B7F6A138F3C55004311DA /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C95B7F6B138F3C55004311DA /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; }; + C95B7F6C138F3C55004311DA /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PAUSE"; }; }; + C95B7F6D138F3C55004311DA /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_POPEN"; }; }; + C95B7F6F138F3C55004311DA /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C95B7F70138F3C55004311DA /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + C95B7F71138F3C55004311DA /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; }; + C95B7F72138F3C55004311DA /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C95B7F73138F3C55004311DA /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; }; + C95B7F74138F3C55004311DA /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; }; + C95B7F75138F3C55004311DA /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C95B7F76138F3C55004311DA /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; }; + C95B7F77138F3C55004311DA /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C95B7F78138F3C55004311DA /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; }; + C95B7F79138F3C55004311DA /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C95B7F7A138F3C55004311DA /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C95B7F7B138F3C55004311DA /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C95B7F7C138F3C55004311DA /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C95B7F7D138F3C55004311DA /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SLEEP"; }; }; + C95B7F7E138F3C55004311DA /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C95B7F7F138F3C55004311DA /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C95B7F80138F3C55004311DA /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C95B7F81138F3C55004311DA /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; }; + C95B7F82138F3C55004311DA /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; }; + C95B7F83138F3C55004311DA /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C95B7F84138F3C55004311DA /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; }; + C95B7F85138F3C55004311DA /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TCDRAIN"; }; }; + C95B7F86138F3C55004311DA /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C95B7F87138F3C55004311DA /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C95B7F88138F3C55004311DA /* timezone.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A4138D9E990028D27C /* timezone.c */; }; + C95B7F89138F3C55004311DA /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; }; + C95B7F8A138F3C55004311DA /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C95B7F8B138F3C55004311DA /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C95B7F8C138F3C55004311DA /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C95B7F8D138F3C55004311DA /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C95B7F8E138F3C55004311DA /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_USLEEP"; }; }; + C95B7F8F138F3C55004311DA /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C95B7F90138F3C55004311DA /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C95B7F91138F3C55004311DA /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAIT"; }; }; + C95B7F92138F3C55004311DA /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C95B7F93138F3C55004311DA /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAITPID"; }; }; + C95B7F94138F3C55004311DA /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; }; + C95B7F95138F3C55004311DA /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C95B7F96138F3C55004311DA /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C95B7F97138F3C55004311DA /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C95B7F98138F3C55004311DA /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C95B7F99138F3C55004311DA /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C95B7F9E138F3C55004311DA /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_NANOSLEEP"; }; }; + C95B7F9F138F3C55004311DA /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C95B7FA0138F3C55004311DA /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; }; + C95B7FA1138F3C55004311DA /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C95B7FA3138F3C55004311DA /* oldsyslog.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537EA138D9E990028D27C /* oldsyslog.c */; }; + C95B7FA6138F3C55004311DA /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C95B7FA7138F3C55004311DA /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C95B7FAA138F3C55004311DA /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C95B7FAC138F3C55004311DA /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C95B7FAD138F3C55004311DA /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C95B7FAE138F3C55004311DA /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C95B7FAF138F3C55004311DA /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + C95B7FB1138F3C55004311DA /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C95B7FD1138F3C55004311DA /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C95B7FD2138F3C55004311DA /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C95B7FD3138F3C55004311DA /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C95B7FD4138F3C55004311DA /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; }; + C95B7FD5138F3C55004311DA /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C95B7FD6138F3C55004311DA /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C95B7FD7138F3C55004311DA /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C95B7FD8138F3C55004311DA /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C95B7FD9138F3C55004311DA /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C95B7FDA138F3C55004311DA /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C95B7FDB138F3C55004311DA /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C95B7FDC138F3C55004311DA /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C95B7FDD138F3C55004311DA /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C95B7FDE138F3C55004311DA /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C95B7FDF138F3C55004311DA /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C95B7FE0138F3C55004311DA /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C95B7FE1138F3C55004311DA /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C95B7FE2138F3C55004311DA /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C95B7FE3138F3C55004311DA /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C95B7FE4138F3C55004311DA /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C95B7FE5138F3C55004311DA /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C95B7FE6138F3C55004311DA /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C95B7FE7138F3C55004311DA /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C95B7FE8138F3C55004311DA /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C95B7FE9138F3C55004311DA /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C95B7FEA138F3C55004311DA /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C95B7FEB138F3C55004311DA /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C95B7FEC138F3C55004311DA /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C95B7FED138F3C55004311DA /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C95B7FEE138F3C55004311DA /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C95B7FEF138F3C55004311DA /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C95B7FF0138F3C55004311DA /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; }; + C95B7FF1138F3C55004311DA /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C95B7FF2138F3C55004311DA /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C95B7FF3138F3C55004311DA /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C95B7FF4138F3C55004311DA /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C95B7FF5138F3C55004311DA /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C95B7FF6138F3C55004311DA /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C95B7FF7138F3C55004311DA /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; }; + C95B7FF8138F3C55004311DA /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C95B7FF9138F3C55004311DA /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C95B7FFA138F3C55004311DA /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C95B7FFB138F3C55004311DA /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C95B7FFC138F3C55004311DA /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C95B7FFD138F3C55004311DA /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C95B7FFE138F3C55004311DA /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C95B7FFF138F3C55004311DA /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C95B8000138F3C55004311DA /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C95B8001138F3C55004311DA /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C95B8002138F3C55004311DA /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C95B8003138F3C55004311DA /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C95B8004138F3C55004311DA /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C95B8005138F3C55004311DA /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C95B8006138F3C55004311DA /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C95B8007138F3C55004311DA /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C95B8008138F3C55004311DA /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C95B8009138F3C55004311DA /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; }; + C95B800A138F3C55004311DA /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C95B800B138F3C55004311DA /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C95B800C138F3C55004311DA /* lconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E8138D9E990028D27C /* lconv.c */; }; + C95B800D138F3C55004311DA /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; }; + C95B800E138F3C55004311DA /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; }; + C95B800F138F3C55004311DA /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; }; + C95B8010138F3C55004311DA /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C95B8011138F3C55004311DA /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C95B8012138F3C55004311DA /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C95B8013138F3C55004311DA /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C95B8014138F3C55004311DA /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C95B8015138F3C55004311DA /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C95B8016138F3C55004311DA /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C95B8017138F3C55004311DA /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C95B8018138F3C55004311DA /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C95B8019138F3C55004311DA /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C95B801A138F3C55004311DA /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C95B801B138F3C55004311DA /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C95B801C138F3C55004311DA /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C95B801D138F3C55004311DA /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C95B801E138F3C55004311DA /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_RECV"; }; }; + C95B801F138F3C55004311DA /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEND"; }; }; + C95B8020138F3C55004311DA /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C95B8021138F3C55004311DA /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C95B8022138F3C55004311DA /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C95B8023138F3C55004311DA /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C95B8024138F3C55004311DA /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C95B8025138F3C55004311DA /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C95B8026138F3C55004311DA /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C95B8027138F3C55004311DA /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C95B8028138F3C55004311DA /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C95B803C138F3C55004311DA /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C95B804D138F3C55004311DA /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C95B804E138F3C55004311DA /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C95B804F138F3C55004311DA /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C95B8050138F3C55004311DA /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C95B8051138F3C55004311DA /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C95B8052138F3C55004311DA /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FDOPEN"; }; }; + C95B8053138F3C55004311DA /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C95B8054138F3C55004311DA /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C95B8055138F3C55004311DA /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C95B8056138F3C55004311DA /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C95B8057138F3C55004311DA /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C95B8058138F3C55004311DA /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C95B8059138F3C55004311DA /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C95B805A138F3C55004311DA /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C95B805B138F3C55004311DA /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C95B805C138F3C55004311DA /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C95B805D138F3C55004311DA /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C95B805E138F3C55004311DA /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C95B805F138F3C55004311DA /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C95B8060138F3C55004311DA /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FOPEN"; }; }; + C95B8061138F3C55004311DA /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C95B8062138F3C55004311DA /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C95B8063138F3C55004311DA /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C95B8064138F3C55004311DA /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; }; + C95B8065138F3C55004311DA /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C95B8066138F3C55004311DA /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C95B8067138F3C55004311DA /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C95B8068138F3C55004311DA /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; }; + C95B8069138F3C55004311DA /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C95B806A138F3C55004311DA /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C95B806B138F3C55004311DA /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C95B806C138F3C55004311DA /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C95B806D138F3C55004311DA /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C95B806E138F3C55004311DA /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C95B806F138F3C55004311DA /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C95B8070138F3C55004311DA /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C95B8071138F3C55004311DA /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C95B8072138F3C55004311DA /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; }; + C95B8073138F3C55004311DA /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C95B8074138F3C55004311DA /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C95B8075138F3C55004311DA /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C95B8076138F3C55004311DA /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C95B8077138F3C55004311DA /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C95B8078138F3C55004311DA /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C95B8079138F3C55004311DA /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C95B807A138F3C55004311DA /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C95B807B138F3C55004311DA /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C95B807C138F3C55004311DA /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C95B807D138F3C55004311DA /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C95B807E138F3C55004311DA /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C95B807F138F3C55004311DA /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C95B8080138F3C55004311DA /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C95B8081138F3C55004311DA /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C95B8082138F3C55004311DA /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C95B8083138F3C55004311DA /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C95B8084138F3C55004311DA /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C95B8085138F3C55004311DA /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C95B8086138F3C55004311DA /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C95B8087138F3C55004311DA /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C95B8088138F3C55004311DA /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C95B8089138F3C55004311DA /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C95B808A138F3C55004311DA /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C95B808B138F3C55004311DA /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C95B808C138F3C55004311DA /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C95B808D138F3C55004311DA /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C95B808E138F3C55004311DA /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C95B808F138F3C55004311DA /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C95B8090138F3C55004311DA /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C95B8091138F3C55004311DA /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C95B8092138F3C55004311DA /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C95B8093138F3C55004311DA /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C95B8094138F3C55004311DA /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C95B8095138F3C55004311DA /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; }; + C95B8096138F3C55004311DA /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; }; + C95B8097138F3C55004311DA /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C95B8098138F3C55004311DA /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C95B8099138F3C55004311DA /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C95B809A138F3C55004311DA /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C95B809B138F3C55004311DA /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C95B809C138F3C55004311DA /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C95B809D138F3C55004311DA /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C95B809E138F3C55004311DA /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C95B809F138F3C55004311DA /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C95B80A0138F3C55004311DA /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C95B80A1138F3C55004311DA /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C95B80A2138F3C55004311DA /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C95B80A3138F3C55004311DA /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C95B80A4138F3C55004311DA /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C95B80A5138F3C55004311DA /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C95B80A6138F3C55004311DA /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C95B80A7138F3C55004311DA /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C95B80A8138F3C55004311DA /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C95B80A9138F3C55004311DA /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C95B80AA138F3C55004311DA /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C95B80AB138F3C55004311DA /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C95B80AC138F3C55004311DA /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C95B80AD138F3C55004311DA /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C95B80AE138F3C55004311DA /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C95B80AF138F3C55004311DA /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C95B80B0138F3C55004311DA /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C95B80B1138F3C55004311DA /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; }; + C95B80B2138F3C55004311DA /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C95B80B3138F3C55004311DA /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C95B80B4138F3C55004311DA /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C95B80B5138F3C55004311DA /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C95B80B6138F3C55004311DA /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C95B80B7138F3C55004311DA /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C95B80B8138F3C55004311DA /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; }; + C95B80B9138F3C55004311DA /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C95B80BA138F3C55004311DA /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; }; + C95B80BB138F3C55004311DA /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C95B80BC138F3C55004311DA /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C95B80BD138F3C55004311DA /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C95B80BE138F3C55004311DA /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; }; + C95B80BF138F3C55004311DA /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C95B80C0138F3C55004311DA /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C95B80C1138F3C55004311DA /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C95B80C2138F3C55004311DA /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C95B80C3138F3C55004311DA /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C95B80C4138F3C55004311DA /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C95B80C5138F3C55004311DA /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C95B80C6138F3C55004311DA /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C95B80C7138F3C55004311DA /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C95B80C8138F3C55004311DA /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C95B80C9138F3C55004311DA /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; }; + C95B80CA138F3C55004311DA /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; }; + C95B80CB138F3C55004311DA /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; }; + C95B80CC138F3C55004311DA /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C95B80CD138F3C55004311DA /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C95B80CE138F3C55004311DA /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C95B80CF138F3C55004311DA /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C95B80D0138F3C55004311DA /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; }; + C95B80D1138F3C55004311DA /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C95B80D2138F3C55004311DA /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C95B80D3138F3C55004311DA /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; }; + C95B80D4138F3C55004311DA /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C95B80D5138F3C55004311DA /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C95B80D6138F3C55004311DA /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C95B80D7138F3C55004311DA /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C95B80D8138F3C55004311DA /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C95B80D9138F3C55004311DA /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C95B80DA138F3C55004311DA /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C95B80DB138F3C55004311DA /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C95B80DC138F3C55004311DA /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C95B80DD138F3C55004311DA /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SYSTEM"; }; }; + C95B80DE138F3C55004311DA /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C95B80DF138F3C55004311DA /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C95B80E0138F3C55004311DA /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C95B80E1138F3C55004311DA /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C95B80E2138F3C55004311DA /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C95B80E3138F3C55004311DA /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C95B80E4138F3C55004311DA /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + C95B80E5138F3C55004311DA /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C95B80E6138F3C55004311DA /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C95B80E7138F3C55004311DA /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C95B80E8138F3C55004311DA /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C95B80E9138F3C55004311DA /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C95B80EA138F3C55004311DA /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C95B80EB138F3C55004311DA /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; }; + C95B80EC138F3C55004311DA /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; }; + C95B80ED138F3C55004311DA /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; }; + C95B80EE138F3C55004311DA /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C95B80EF138F3C55004311DA /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C95B80F0138F3C55004311DA /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; }; + C95B80F1138F3C55004311DA /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C95B80FA138F3C55004311DA /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C95B80FD138F3C55004311DA /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C95B8100138F3C55004311DA /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C95B8101138F3C55004311DA /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C95B8105138F3C55004311DA /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C95B8107138F3C55004311DA /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C95B8108138F3C55004311DA /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; }; + C95B8109138F3C55004311DA /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; }; + C95B810D138F3C55004311DA /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C95B8111138F3C55004311DA /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C95B8113138F3C55004311DA /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C95B8114138F3C55004311DA /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C95B8115138F3C55004311DA /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; }; + C95B8116138F3C55004311DA /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C95B8117138F3C55004311DA /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C95B8118138F3C55004311DA /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C95B811A138F3C55004311DA /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C95B811B138F3C55004311DA /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C95B811C138F3C55004311DA /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C95B811D138F3C55004311DA /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C95B811E138F3C55004311DA /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C95B811F138F3C55004311DA /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C95B8120138F3C55004311DA /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C95B8121138F3C55004311DA /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C95B8122138F3C55004311DA /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C95B8123138F3C55004311DA /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C95B8124138F3C55004311DA /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C95B8125138F3C55004311DA /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C95B8126138F3C55004311DA /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C95B8127138F3C55004311DA /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C95B8128138F3C55004311DA /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C95B8129138F3C55004311DA /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C95B812A138F3C55004311DA /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C95B812B138F3C55004311DA /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C95B812C138F3C55004311DA /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C95B812D138F3C55004311DA /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C95B812E138F3C55004311DA /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C95B812F138F3C55004311DA /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C95B8130138F3C55004311DA /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C95B8131138F3C55004311DA /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C95B8132138F3C55004311DA /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C95B8133138F3C55004311DA /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C95B8134138F3C55004311DA /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C95B8135138F3C55004311DA /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C95B8136138F3C55004311DA /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C95B8137138F3C55004311DA /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C95B8138138F3C55004311DA /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C95B8139138F3C55004311DA /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C95B813A138F3C55004311DA /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C95B813B138F3C55004311DA /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C95B813C138F3C55004311DA /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C95B813D138F3C55004311DA /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C95B813F138F3C55004311DA /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C95B8141138F3C55004311DA /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C95B8142138F3C55004311DA /* getgroups.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9F138D9E9A0028D27C /* getgroups.c */; }; + C95B8144138F3C55004311DA /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C95B8145138F3C55004311DA /* msgctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA6138D9E9A0028D27C /* msgctl.c */; }; + C95B8146138F3C55004311DA /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; }; + C95B8147138F3C55004311DA /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C95B8148138F3C55004311DA /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C95B8149138F3C55004311DA /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C95B814A138F3C55004311DA /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C95B814B138F3C55004311DA /* semctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB2138D9E9A0028D27C /* semctl.c */; }; + C95B814C138F3C55004311DA /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C95B814D138F3C55004311DA /* shmctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB4138D9E9A0028D27C /* shmctl.c */; }; + C95B814E138F3C55004311DA /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C95B8152138F3C55004311DA /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C95B8153138F3C55004311DA /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C95B8157138F3C55004311DA /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; }; + C95B8158138F3C55004311DA /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C95B8159138F3C55004311DA /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C95B815A138F3C55004311DA /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C95B815B138F3C55004311DA /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C95B815C138F3C55004311DA /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C95B815D138F3C55004311DA /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C95B815E138F3C55004311DA /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; }; + C95B815F138F3C55004311DA /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; }; + C95B8160138F3C55004311DA /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; }; + C95B8161138F3C55004311DA /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; }; + C95B8162138F3C55004311DA /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; }; + C95B8163138F3C55004311DA /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; }; + C95B8164138F3C55004311DA /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; }; + C95B8165138F3C55004311DA /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; }; + C95B8166138F3C55004311DA /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; }; + C95B818F138F52B0004311DA /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CREAT"; }; }; + C95B8190138F52B0004311DA /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C95B8191138F52B0004311DA /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C95B8192138F52B0004311DA /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; }; + C95B8193138F52B0004311DA /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C95B8194138F52B0004311DA /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C95B8195138F52B0004311DA /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C95B8196138F52B0004311DA /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C95B8197138F52B0004311DA /* setregid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360A138D9E980028D27C /* setregid.c */; }; + C95B8198138F52B0004311DA /* setreuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360B138D9E980028D27C /* setreuid.c */; }; + C95B8199138F52B0004311DA /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C95B819A138F52B0004311DA /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SIGPAUSE"; }; }; + C95B819C138F52B0004311DA /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C95B81A0138F52B0004311DA /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C95B81A1138F52B0004311DA /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; }; + C95B81A2138F52B0004311DA /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; }; + C95B81A3138F52B0004311DA /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; }; + C95B81A4138F52B0004311DA /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; }; + C95B81A5138F52B0004311DA /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; }; + C95B81A6138F52B0004311DA /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; }; + C95B81A7138F52B0004311DA /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; }; + C95B81A8138F52B0004311DA /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; }; + C95B81A9138F52B0004311DA /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; }; + C95B81AA138F52B0004311DA /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; }; + C95B81AB138F52B0004311DA /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; }; + C95B81AC138F52B0004311DA /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; }; + C95B81AD138F52B0004311DA /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; }; + C95B81AE138F52B0004311DA /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; }; + C95B81AF138F52B0004311DA /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; }; + C95B81B0138F52B0004311DA /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; }; + C95B81B1138F52B0004311DA /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; }; + C95B81B2138F52B0004311DA /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; }; + C95B81B3138F52B0004311DA /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; }; + C95B81B4138F52B0004311DA /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; }; + C95B81B5138F52B0004311DA /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; }; + C95B81B6138F52B0004311DA /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; }; + C95B81B7138F52B0004311DA /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; }; + C95B81B8138F52B0004311DA /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; }; + C95B81B9138F52B0004311DA /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; }; + C95B81BA138F52B0004311DA /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; }; + C95B81BB138F52B0004311DA /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; }; + C95B81BC138F52B0004311DA /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; }; + C95B81BD138F52B0004311DA /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; }; + C95B81BE138F52B0004311DA /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; }; + C95B81BF138F52B0004311DA /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C95B81C0138F52B0004311DA /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C95B81C1138F52B0004311DA /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C95B81C2138F52B0004311DA /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C95B81C3138F52B0004311DA /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C95B81C4138F52B0004311DA /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C95B81C5138F52B0004311DA /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C95B81C6138F52B0004311DA /* _ldbl_util.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5368E138D9E980028D27C /* _ldbl_util.c */; }; + C95B81C7138F52B0004311DA /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C95B81C8138F52B0004311DA /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C95B81C9138F52B0004311DA /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C95B81CA138F52B0004311DA /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C95B81CB138F52B0004311DA /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C95B81CC138F52B0004311DA /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C95B81CD138F52B0004311DA /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C95B81CE138F52B0004311DA /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C95B81CF138F52B0004311DA /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C95B81D0138F52B0004311DA /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C95B81D1138F52B0004311DA /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C95B81D2138F52B0004311DA /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C95B81D3138F52B0004311DA /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C95B81D4138F52B0004311DA /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C95B81D5138F52B0004311DA /* gdtoa-strtoIg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */; }; + C95B81D6138F52B0004311DA /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C95B81D7138F52B0004311DA /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C95B81D8138F52B0004311DA /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C95B81D9138F52B0004311DA /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C95B81DA138F52B0004311DA /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C95B81DB138F52B0004311DA /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C95B81DC138F52B0004311DA /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C95B81DD138F52B0004311DA /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C95B81DE138F52B0004311DA /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C95B81DF138F52B0004311DA /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C95B81E9138F52B0004311DA /* authentication.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D5138D9E990028D27C /* authentication.c */; }; + C95B81EA138F52B0004311DA /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C95B81EC138F52B0004311DA /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; }; + C95B81ED138F52B0004311DA /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; }; + C95B81EE138F52B0004311DA /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C95B81EF138F52B0004311DA /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C95B81F0138F52B0004311DA /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C95B81F1138F52B0004311DA /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C95B81F2138F52B0004311DA /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C95B81F3138F52B0004311DA /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C95B81F4138F52B0004311DA /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; }; + C95B81F5138F52B0004311DA /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C95B81F6138F52B0004311DA /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C95B81F7138F52B0004311DA /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; }; + C95B81F8138F52B0004311DA /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; }; + C95B81F9138F52B0004311DA /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C95B81FA138F52B0004311DA /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; }; + C95B81FB138F52B0004311DA /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; }; + C95B81FC138F52B0004311DA /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C95B81FD138F52B0004311DA /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C95B81FE138F52B0004311DA /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C95B81FF138F52B0004311DA /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C95B8200138F52B0004311DA /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C95B8201138F52B0004311DA /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C95B8202138F52B0004311DA /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; }; + C95B8203138F52B0004311DA /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C95B8204138F52B0004311DA /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C95B8205138F52B0004311DA /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C95B8206138F52B0004311DA /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; }; + C95B8207138F52B0004311DA /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C95B8208138F52B0004311DA /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C95B8209138F52B0004311DA /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; }; + C95B820A138F52B0004311DA /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; }; + C95B820B138F52B0004311DA /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C95B820C138F52B0004311DA /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C95B820D138F52B0004311DA /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; }; + C95B820E138F52B0004311DA /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C95B820F138F52B0004311DA /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C95B8210138F52B0004311DA /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C95B8211138F52B0004311DA /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_LOCKF"; }; }; + C95B8212138F52B0004311DA /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C95B8213138F52B0004311DA /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C95B8214138F52B0004311DA /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; }; + C95B8215138F52B0004311DA /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C95B8216138F52B0004311DA /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; }; + C95B8217138F52B0004311DA /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PAUSE"; }; }; + C95B8218138F52B0004311DA /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_POPEN"; }; }; + C95B821A138F52B0004311DA /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C95B821B138F52B0004311DA /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + C95B821C138F52B0004311DA /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; }; + C95B821D138F52B0004311DA /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C95B821E138F52B0004311DA /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; }; + C95B821F138F52B0004311DA /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; }; + C95B8220138F52B0004311DA /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C95B8221138F52B0004311DA /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; }; + C95B8222138F52B0004311DA /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C95B8223138F52B0004311DA /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; }; + C95B8224138F52B0004311DA /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C95B8225138F52B0004311DA /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C95B8226138F52B0004311DA /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C95B8227138F52B0004311DA /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C95B8228138F52B0004311DA /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SLEEP"; }; }; + C95B8229138F52B0004311DA /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C95B822A138F52B0004311DA /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C95B822B138F52B0004311DA /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C95B822C138F52B0004311DA /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; }; + C95B822D138F52B0004311DA /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; }; + C95B822E138F52B0004311DA /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C95B822F138F52B0004311DA /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; }; + C95B8230138F52B0004311DA /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TCDRAIN"; }; }; + C95B8231138F52B0004311DA /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C95B8232138F52B0004311DA /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C95B8233138F52B0004311DA /* timezone.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A4138D9E990028D27C /* timezone.c */; }; + C95B8234138F52B0004311DA /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; }; + C95B8235138F52B0004311DA /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C95B8236138F52B0004311DA /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C95B8237138F52B0004311DA /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C95B8238138F52B0004311DA /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C95B8239138F52B0004311DA /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_USLEEP"; }; }; + C95B823A138F52B0004311DA /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C95B823B138F52B0004311DA /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C95B823C138F52B0004311DA /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAIT"; }; }; + C95B823D138F52B0004311DA /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C95B823E138F52B0004311DA /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAITPID"; }; }; + C95B823F138F52B0004311DA /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; }; + C95B8240138F52B0004311DA /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C95B8241138F52B0004311DA /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C95B8242138F52B0004311DA /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C95B8243138F52B0004311DA /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C95B8244138F52B0004311DA /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C95B8249138F52B0004311DA /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_NANOSLEEP"; }; }; + C95B824A138F52B0004311DA /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C95B824B138F52B0004311DA /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; }; + C95B824C138F52B0004311DA /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C95B824E138F52B0004311DA /* oldsyslog.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537EA138D9E990028D27C /* oldsyslog.c */; }; + C95B8251138F52B0004311DA /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C95B8252138F52B0004311DA /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C95B8255138F52B0004311DA /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C95B8257138F52B0004311DA /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C95B8258138F52B0004311DA /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C95B8259138F52B0004311DA /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C95B825A138F52B0004311DA /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + C95B825C138F52B0004311DA /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C95B827C138F52B0004311DA /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C95B827D138F52B0004311DA /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C95B827E138F52B0004311DA /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C95B827F138F52B0004311DA /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; }; + C95B8280138F52B0004311DA /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C95B8281138F52B0004311DA /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C95B8282138F52B0004311DA /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C95B8283138F52B0004311DA /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C95B8284138F52B0004311DA /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C95B8285138F52B0004311DA /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C95B8286138F52B0004311DA /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C95B8287138F52B0004311DA /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C95B8288138F52B0004311DA /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C95B8289138F52B0004311DA /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C95B828A138F52B0004311DA /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C95B828B138F52B0004311DA /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C95B828C138F52B0004311DA /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C95B828D138F52B0004311DA /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C95B828E138F52B0004311DA /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C95B828F138F52B0004311DA /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C95B8290138F52B0004311DA /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C95B8291138F52B0004311DA /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C95B8292138F52B0004311DA /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C95B8293138F52B0004311DA /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C95B8294138F52B0004311DA /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C95B8295138F52B0004311DA /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C95B8296138F52B0004311DA /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C95B8297138F52B0004311DA /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C95B8298138F52B0004311DA /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C95B8299138F52B0004311DA /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C95B829A138F52B0004311DA /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C95B829B138F52B0004311DA /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; }; + C95B829C138F52B0004311DA /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C95B829D138F52B0004311DA /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C95B829E138F52B0004311DA /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C95B829F138F52B0004311DA /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C95B82A0138F52B0004311DA /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C95B82A1138F52B0004311DA /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C95B82A2138F52B0004311DA /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; }; + C95B82A3138F52B0004311DA /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C95B82A4138F52B0004311DA /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C95B82A5138F52B0004311DA /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C95B82A6138F52B0004311DA /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C95B82A7138F52B0004311DA /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C95B82A8138F52B0004311DA /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C95B82A9138F52B0004311DA /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C95B82AA138F52B0004311DA /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C95B82AB138F52B0004311DA /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C95B82AC138F52B0004311DA /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C95B82AD138F52B0004311DA /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C95B82AE138F52B0004311DA /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C95B82AF138F52B0004311DA /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C95B82B0138F52B0004311DA /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C95B82B1138F52B0004311DA /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C95B82B2138F52B0004311DA /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C95B82B3138F52B0004311DA /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C95B82B4138F52B0004311DA /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; }; + C95B82B5138F52B0004311DA /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C95B82B6138F52B0004311DA /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C95B82B7138F52B0004311DA /* lconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E8138D9E990028D27C /* lconv.c */; }; + C95B82B8138F52B0004311DA /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; }; + C95B82B9138F52B0004311DA /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; }; + C95B82BA138F52B0004311DA /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; }; + C95B82BB138F52B0004311DA /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C95B82BC138F52B0004311DA /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C95B82BD138F52B0004311DA /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C95B82BE138F52B0004311DA /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C95B82BF138F52B0004311DA /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C95B82C0138F52B0004311DA /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C95B82C1138F52B0004311DA /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C95B82C2138F52B0004311DA /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C95B82C3138F52B0004311DA /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C95B82C4138F52B0004311DA /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C95B82C5138F52B0004311DA /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C95B82C6138F52B0004311DA /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C95B82C7138F52B0004311DA /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C95B82C8138F52B0004311DA /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C95B82C9138F52B0004311DA /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_RECV"; }; }; + C95B82CA138F52B0004311DA /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEND"; }; }; + C95B82CB138F52B0004311DA /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C95B82CC138F52B0004311DA /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C95B82CD138F52B0004311DA /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C95B82CE138F52B0004311DA /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C95B82CF138F52B0004311DA /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C95B82D0138F52B0004311DA /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C95B82D1138F52B0004311DA /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C95B82D2138F52B0004311DA /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C95B82D3138F52B0004311DA /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C95B82E7138F52B0004311DA /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C95B82F8138F52B0004311DA /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C95B82F9138F52B0004311DA /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C95B82FA138F52B0004311DA /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C95B82FB138F52B0004311DA /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C95B82FC138F52B0004311DA /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C95B82FD138F52B0004311DA /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FDOPEN"; }; }; + C95B82FE138F52B0004311DA /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C95B82FF138F52B0004311DA /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C95B8300138F52B0004311DA /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C95B8301138F52B0004311DA /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C95B8302138F52B0004311DA /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C95B8303138F52B0004311DA /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C95B8304138F52B0004311DA /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C95B8305138F52B0004311DA /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C95B8306138F52B0004311DA /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C95B8307138F52B0004311DA /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C95B8308138F52B0004311DA /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C95B8309138F52B0004311DA /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C95B830A138F52B0004311DA /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C95B830B138F52B0004311DA /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FOPEN"; }; }; + C95B830C138F52B0004311DA /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C95B830D138F52B0004311DA /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C95B830E138F52B0004311DA /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C95B830F138F52B0004311DA /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; }; + C95B8310138F52B0004311DA /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C95B8311138F52B0004311DA /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C95B8312138F52B0004311DA /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C95B8313138F52B0004311DA /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; }; + C95B8314138F52B0004311DA /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C95B8315138F52B0004311DA /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C95B8316138F52B0004311DA /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C95B8317138F52B0004311DA /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C95B8318138F52B0004311DA /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C95B8319138F52B0004311DA /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C95B831A138F52B0004311DA /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C95B831B138F52B0004311DA /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C95B831C138F52B0004311DA /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C95B831D138F52B0004311DA /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; }; + C95B831E138F52B0004311DA /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C95B831F138F52B0004311DA /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C95B8320138F52B0004311DA /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C95B8321138F52B0004311DA /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C95B8322138F52B0004311DA /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C95B8323138F52B0004311DA /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C95B8324138F52B0004311DA /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C95B8325138F52B0004311DA /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C95B8326138F52B0004311DA /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C95B8327138F52B0004311DA /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C95B8328138F52B0004311DA /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C95B8329138F52B0004311DA /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C95B832A138F52B0004311DA /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C95B832B138F52B0004311DA /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C95B832C138F52B0004311DA /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C95B832D138F52B0004311DA /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C95B832E138F52B0004311DA /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C95B832F138F52B0004311DA /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C95B8330138F52B0004311DA /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C95B8331138F52B0004311DA /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C95B8332138F52B0004311DA /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C95B8333138F52B0004311DA /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C95B8334138F52B0004311DA /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C95B8335138F52B0004311DA /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C95B8336138F52B0004311DA /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C95B8337138F52B0004311DA /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C95B8338138F52B0004311DA /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C95B8339138F52B0004311DA /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C95B833A138F52B0004311DA /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C95B833B138F52B0004311DA /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C95B833C138F52B0004311DA /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C95B833D138F52B0004311DA /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C95B833E138F52B0004311DA /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C95B833F138F52B0004311DA /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C95B8340138F52B0004311DA /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; }; + C95B8341138F52B0004311DA /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; }; + C95B8342138F52B0004311DA /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C95B8343138F52B0004311DA /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C95B8344138F52B0004311DA /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C95B8345138F52B0004311DA /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C95B8346138F52B0004311DA /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C95B8347138F52B0004311DA /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C95B8348138F52B0004311DA /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C95B8349138F52B0004311DA /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C95B834A138F52B0004311DA /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C95B834B138F52B0004311DA /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C95B834C138F52B0004311DA /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C95B834D138F52B0004311DA /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C95B834E138F52B0004311DA /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C95B834F138F52B0004311DA /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C95B8350138F52B0004311DA /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C95B8351138F52B0004311DA /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C95B8352138F52B0004311DA /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C95B8353138F52B0004311DA /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C95B8354138F52B0004311DA /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C95B8355138F52B0004311DA /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C95B8356138F52B0004311DA /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C95B8357138F52B0004311DA /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C95B8358138F52B0004311DA /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C95B8359138F52B0004311DA /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C95B835A138F52B0004311DA /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C95B835B138F52B0004311DA /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C95B835C138F52B0004311DA /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; }; + C95B835D138F52B0004311DA /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C95B835E138F52B0004311DA /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C95B835F138F52B0004311DA /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C95B8360138F52B0004311DA /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C95B8361138F52B0004311DA /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C95B8362138F52B0004311DA /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C95B8363138F52B0004311DA /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; }; + C95B8364138F52B0004311DA /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C95B8365138F52B0004311DA /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; }; + C95B8366138F52B0004311DA /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C95B8367138F52B0004311DA /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C95B8368138F52B0004311DA /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C95B8369138F52B0004311DA /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; }; + C95B836A138F52B0004311DA /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C95B836B138F52B0004311DA /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C95B836C138F52B0004311DA /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C95B836D138F52B0004311DA /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C95B836E138F52B0004311DA /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C95B836F138F52B0004311DA /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C95B8370138F52B0004311DA /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C95B8371138F52B0004311DA /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C95B8372138F52B0004311DA /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C95B8373138F52B0004311DA /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C95B8374138F52B0004311DA /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; }; + C95B8375138F52B0004311DA /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; }; + C95B8376138F52B0004311DA /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; }; + C95B8377138F52B0004311DA /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C95B8378138F52B0004311DA /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C95B8379138F52B0004311DA /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C95B837A138F52B0004311DA /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C95B837B138F52B0004311DA /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; }; + C95B837C138F52B0004311DA /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C95B837D138F52B0004311DA /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C95B837E138F52B0004311DA /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; }; + C95B837F138F52B0004311DA /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C95B8380138F52B0004311DA /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C95B8381138F52B0004311DA /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C95B8382138F52B0004311DA /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C95B8383138F52B0004311DA /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C95B8384138F52B0004311DA /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C95B8385138F52B0004311DA /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C95B8386138F52B0004311DA /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C95B8387138F52B0004311DA /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C95B8388138F52B0004311DA /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SYSTEM"; }; }; + C95B8389138F52B0004311DA /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C95B838A138F52B0004311DA /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C95B838B138F52B0004311DA /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C95B838C138F52B0004311DA /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C95B838D138F52B0004311DA /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C95B838E138F52B0004311DA /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C95B838F138F52B0004311DA /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + C95B8390138F52B0004311DA /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C95B8391138F52B0004311DA /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C95B8392138F52B0004311DA /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C95B8393138F52B0004311DA /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C95B8394138F52B0004311DA /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C95B8395138F52B0004311DA /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C95B8396138F52B0004311DA /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; }; + C95B8397138F52B0004311DA /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; }; + C95B8398138F52B0004311DA /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; }; + C95B8399138F52B0004311DA /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C95B839A138F52B0004311DA /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C95B839B138F52B0004311DA /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; }; + C95B839C138F52B0004311DA /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C95B83A5138F52B0004311DA /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C95B83A8138F52B0004311DA /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C95B83AB138F52B0004311DA /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C95B83AC138F52B0004311DA /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C95B83B0138F52B0004311DA /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C95B83B2138F52B0004311DA /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C95B83B3138F52B0004311DA /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; }; + C95B83B4138F52B0004311DA /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; }; + C95B83B8138F52B0004311DA /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C95B83BC138F52B0004311DA /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C95B83BE138F52B0004311DA /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C95B83BF138F52B0004311DA /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C95B83C0138F52B0004311DA /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; }; + C95B83C1138F52B0004311DA /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C95B83C2138F52B0004311DA /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C95B83C3138F52B0004311DA /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C95B83C5138F52B0004311DA /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C95B83C6138F52B0004311DA /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C95B83C7138F52B0004311DA /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C95B83C8138F52B0004311DA /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C95B83C9138F52B0004311DA /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C95B83CA138F52B0004311DA /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C95B83CB138F52B0004311DA /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C95B83CC138F52B0004311DA /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C95B83CD138F52B0004311DA /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C95B83CE138F52B0004311DA /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C95B83CF138F52B0004311DA /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C95B83D0138F52B0004311DA /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C95B83D1138F52B0004311DA /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C95B83D2138F52B0004311DA /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C95B83D3138F52B0004311DA /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C95B83D4138F52B0004311DA /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C95B83D5138F52B0004311DA /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C95B83D6138F52B0004311DA /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C95B83D7138F52B0004311DA /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C95B83D8138F52B0004311DA /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C95B83D9138F52B0004311DA /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C95B83DA138F52B0004311DA /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C95B83DB138F52B0004311DA /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C95B83DC138F52B0004311DA /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C95B83DD138F52B0004311DA /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C95B83DE138F52B0004311DA /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C95B83DF138F52B0004311DA /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C95B83E0138F52B0004311DA /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C95B83E1138F52B0004311DA /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C95B83E2138F52B0004311DA /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C95B83E3138F52B0004311DA /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C95B83E4138F52B0004311DA /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C95B83E5138F52B0004311DA /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C95B83E6138F52B0004311DA /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C95B83E7138F52B0004311DA /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C95B83E8138F52B0004311DA /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C95B83EA138F52B0004311DA /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C95B83EC138F52B0004311DA /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C95B83ED138F52B0004311DA /* getgroups.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9F138D9E9A0028D27C /* getgroups.c */; }; + C95B83EF138F52B0004311DA /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C95B83F0138F52B0004311DA /* msgctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA6138D9E9A0028D27C /* msgctl.c */; }; + C95B83F1138F52B0004311DA /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; }; + C95B83F2138F52B0004311DA /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C95B83F3138F52B0004311DA /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C95B83F4138F52B0004311DA /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C95B83F5138F52B0004311DA /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C95B83F6138F52B0004311DA /* semctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB2138D9E9A0028D27C /* semctl.c */; }; + C95B83F7138F52B0004311DA /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C95B83F8138F52B0004311DA /* shmctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB4138D9E9A0028D27C /* shmctl.c */; }; + C95B83F9138F52B0004311DA /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C95B83FD138F52B0004311DA /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C95B83FE138F52B0004311DA /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C95B8402138F52B0004311DA /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; }; + C95B8403138F52B0004311DA /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C95B8404138F52B0004311DA /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C95B8405138F52B0004311DA /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C95B8406138F52B0004311DA /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C95B8407138F52B0004311DA /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C95B8408138F52B0004311DA /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C95B8409138F52B0004311DA /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; }; + C95B840A138F52B0004311DA /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; }; + C95B840B138F52B0004311DA /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; }; + C95B840C138F52B0004311DA /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; }; + C95B840D138F52B0004311DA /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; }; + C95B840E138F52B0004311DA /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; }; + C95B840F138F52B0004311DA /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; }; + C95B8410138F52B0004311DA /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; }; + C95B8411138F52B0004311DA /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; }; + C95B8435138F53DB004311DA /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CREAT"; }; }; + C95B8436138F53DB004311DA /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C95B8437138F53DB004311DA /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C95B8438138F53DB004311DA /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; }; + C95B8439138F53DB004311DA /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C95B843A138F53DB004311DA /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C95B843B138F53DB004311DA /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C95B843C138F53DB004311DA /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C95B843D138F53DB004311DA /* setregid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360A138D9E980028D27C /* setregid.c */; }; + C95B843E138F53DB004311DA /* setreuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360B138D9E980028D27C /* setreuid.c */; }; + C95B843F138F53DB004311DA /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C95B8440138F53DB004311DA /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SIGPAUSE"; }; }; + C95B8442138F53DB004311DA /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C95B8446138F53DB004311DA /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C95B8447138F53DB004311DA /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; }; + C95B8448138F53DB004311DA /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; }; + C95B8449138F53DB004311DA /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; }; + C95B844A138F53DB004311DA /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; }; + C95B844B138F53DB004311DA /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; }; + C95B844C138F53DB004311DA /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; }; + C95B844D138F53DB004311DA /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; }; + C95B844E138F53DB004311DA /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; }; + C95B844F138F53DB004311DA /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; }; + C95B8450138F53DB004311DA /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; }; + C95B8451138F53DB004311DA /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; }; + C95B8452138F53DB004311DA /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; }; + C95B8453138F53DB004311DA /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; }; + C95B8454138F53DB004311DA /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; }; + C95B8455138F53DB004311DA /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; }; + C95B8456138F53DB004311DA /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; }; + C95B8457138F53DB004311DA /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; }; + C95B8458138F53DB004311DA /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; }; + C95B8459138F53DB004311DA /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; }; + C95B845A138F53DB004311DA /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; }; + C95B845B138F53DB004311DA /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; }; + C95B845C138F53DB004311DA /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; }; + C95B845D138F53DB004311DA /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; }; + C95B845E138F53DB004311DA /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; }; + C95B845F138F53DB004311DA /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; }; + C95B8460138F53DB004311DA /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; }; + C95B8461138F53DB004311DA /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; }; + C95B8462138F53DB004311DA /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; }; + C95B8463138F53DB004311DA /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; }; + C95B8464138F53DB004311DA /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; }; + C95B8465138F53DB004311DA /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C95B8466138F53DB004311DA /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C95B8467138F53DB004311DA /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C95B8468138F53DB004311DA /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C95B8469138F53DB004311DA /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C95B846A138F53DB004311DA /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C95B846B138F53DB004311DA /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C95B846C138F53DB004311DA /* _ldbl_util.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5368E138D9E980028D27C /* _ldbl_util.c */; }; + C95B846D138F53DB004311DA /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C95B846E138F53DB004311DA /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C95B846F138F53DB004311DA /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C95B8470138F53DB004311DA /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C95B8471138F53DB004311DA /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C95B8472138F53DB004311DA /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C95B8473138F53DB004311DA /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C95B8474138F53DB004311DA /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C95B8475138F53DB004311DA /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C95B8476138F53DB004311DA /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C95B8477138F53DB004311DA /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C95B8478138F53DB004311DA /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C95B8479138F53DB004311DA /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C95B847A138F53DB004311DA /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C95B847B138F53DB004311DA /* gdtoa-strtoIg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */; }; + C95B847C138F53DB004311DA /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C95B847D138F53DB004311DA /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C95B847E138F53DB004311DA /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C95B847F138F53DB004311DA /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C95B8480138F53DB004311DA /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C95B8481138F53DB004311DA /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C95B8482138F53DB004311DA /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C95B8483138F53DB004311DA /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C95B8484138F53DB004311DA /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C95B8485138F53DB004311DA /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C95B848F138F53DB004311DA /* authentication.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D5138D9E990028D27C /* authentication.c */; }; + C95B8490138F53DB004311DA /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C95B8492138F53DB004311DA /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; }; + C95B8493138F53DB004311DA /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; }; + C95B8494138F53DB004311DA /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C95B8495138F53DB004311DA /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C95B8496138F53DB004311DA /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C95B8497138F53DB004311DA /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C95B8498138F53DB004311DA /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C95B8499138F53DB004311DA /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C95B849A138F53DB004311DA /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; }; + C95B849B138F53DB004311DA /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C95B849C138F53DB004311DA /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C95B849D138F53DB004311DA /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; }; + C95B849E138F53DB004311DA /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; }; + C95B849F138F53DB004311DA /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C95B84A0138F53DB004311DA /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C95B84A1138F53DB004311DA /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; }; + C95B84A2138F53DB004311DA /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C95B84A3138F53DB004311DA /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C95B84A4138F53DB004311DA /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C95B84A5138F53DB004311DA /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C95B84A6138F53DB004311DA /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C95B84A7138F53DB004311DA /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C95B84A8138F53DB004311DA /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; }; + C95B84A9138F53DB004311DA /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C95B84AA138F53DB004311DA /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C95B84AB138F53DB004311DA /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C95B84AC138F53DB004311DA /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; }; + C95B84AD138F53DB004311DA /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C95B84AE138F53DB004311DA /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C95B84AF138F53DB004311DA /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; }; + C95B84B0138F53DB004311DA /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; }; + C95B84B1138F53DB004311DA /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C95B84B2138F53DB004311DA /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C95B84B3138F53DB004311DA /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; }; + C95B84B4138F53DB004311DA /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C95B84B5138F53DB004311DA /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C95B84B6138F53DB004311DA /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C95B84B7138F53DB004311DA /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_LOCKF"; }; }; + C95B84B8138F53DB004311DA /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C95B84B9138F53DB004311DA /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C95B84BA138F53DB004311DA /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; }; + C95B84BB138F53DB004311DA /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C95B84BC138F53DB004311DA /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; }; + C95B84BD138F53DB004311DA /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PAUSE"; }; }; + C95B84BE138F53DB004311DA /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_POPEN"; }; }; + C95B84C0138F53DB004311DA /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C95B84C1138F53DB004311DA /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + C95B84C2138F53DB004311DA /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; }; + C95B84C3138F53DB004311DA /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C95B84C4138F53DB004311DA /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; }; + C95B84C5138F53DB004311DA /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; }; + C95B84C6138F53DB004311DA /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C95B84C7138F53DB004311DA /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; }; + C95B84C8138F53DB004311DA /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C95B84C9138F53DB004311DA /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; }; + C95B84CA138F53DB004311DA /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C95B84CB138F53DB004311DA /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C95B84CC138F53DB004311DA /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C95B84CD138F53DB004311DA /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C95B84CE138F53DB004311DA /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SLEEP"; }; }; + C95B84CF138F53DB004311DA /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C95B84D0138F53DB004311DA /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C95B84D1138F53DB004311DA /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C95B84D2138F53DB004311DA /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; }; + C95B84D3138F53DB004311DA /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; }; + C95B84D4138F53DB004311DA /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C95B84D5138F53DB004311DA /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; }; + C95B84D6138F53DB004311DA /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TCDRAIN"; }; }; + C95B84D7138F53DB004311DA /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C95B84D8138F53DB004311DA /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C95B84D9138F53DB004311DA /* timezone.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A4138D9E990028D27C /* timezone.c */; }; + C95B84DA138F53DB004311DA /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; }; + C95B84DB138F53DB004311DA /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C95B84DC138F53DB004311DA /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C95B84DD138F53DB004311DA /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C95B84DE138F53DB004311DA /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C95B84DF138F53DB004311DA /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_USLEEP"; }; }; + C95B84E0138F53DB004311DA /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C95B84E1138F53DB004311DA /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C95B84E2138F53DB004311DA /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAIT"; }; }; + C95B84E3138F53DB004311DA /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C95B84E4138F53DB004311DA /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAITPID"; }; }; + C95B84E5138F53DB004311DA /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; }; + C95B84E6138F53DB004311DA /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C95B84E7138F53DB004311DA /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C95B84E8138F53DB004311DA /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C95B84E9138F53DB004311DA /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C95B84EA138F53DB004311DA /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C95B84EF138F53DB004311DA /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_NANOSLEEP"; }; }; + C95B84F0138F53DB004311DA /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C95B84F1138F53DB004311DA /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; }; + C95B84F2138F53DB004311DA /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C95B84F4138F53DB004311DA /* oldsyslog.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537EA138D9E990028D27C /* oldsyslog.c */; }; + C95B84F7138F53DB004311DA /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C95B84F8138F53DB004311DA /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C95B84FB138F53DB004311DA /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C95B84FD138F53DB004311DA /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C95B84FE138F53DB004311DA /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C95B84FF138F53DB004311DA /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C95B8500138F53DB004311DA /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + C95B8502138F53DB004311DA /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C95B8522138F53DB004311DA /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C95B8523138F53DB004311DA /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C95B8524138F53DB004311DA /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C95B8525138F53DB004311DA /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; }; + C95B8526138F53DB004311DA /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C95B8527138F53DB004311DA /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C95B8528138F53DB004311DA /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C95B8529138F53DB004311DA /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C95B852A138F53DB004311DA /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C95B852B138F53DB004311DA /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C95B852C138F53DB004311DA /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C95B852D138F53DB004311DA /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C95B852E138F53DB004311DA /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C95B852F138F53DB004311DA /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C95B8530138F53DB004311DA /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C95B8531138F53DB004311DA /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C95B8532138F53DB004311DA /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C95B8533138F53DB004311DA /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C95B8534138F53DB004311DA /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C95B8535138F53DB004311DA /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C95B8536138F53DB004311DA /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C95B8537138F53DB004311DA /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C95B8538138F53DB004311DA /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C95B8539138F53DB004311DA /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C95B853A138F53DB004311DA /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C95B853B138F53DB004311DA /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C95B853C138F53DB004311DA /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C95B853D138F53DB004311DA /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C95B853E138F53DB004311DA /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C95B853F138F53DB004311DA /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C95B8540138F53DB004311DA /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C95B8541138F53DB004311DA /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; }; + C95B8542138F53DB004311DA /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C95B8543138F53DB004311DA /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C95B8544138F53DB004311DA /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C95B8545138F53DB004311DA /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C95B8546138F53DB004311DA /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C95B8547138F53DB004311DA /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C95B8548138F53DB004311DA /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; }; + C95B8549138F53DB004311DA /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C95B854A138F53DB004311DA /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C95B854B138F53DB004311DA /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C95B854C138F53DB004311DA /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C95B854D138F53DB004311DA /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C95B854E138F53DB004311DA /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C95B854F138F53DB004311DA /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C95B8550138F53DB004311DA /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C95B8551138F53DB004311DA /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C95B8552138F53DB004311DA /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C95B8553138F53DB004311DA /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C95B8554138F53DB004311DA /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C95B8555138F53DB004311DA /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C95B8556138F53DB004311DA /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C95B8557138F53DB004311DA /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C95B8558138F53DB004311DA /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C95B8559138F53DB004311DA /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C95B855A138F53DB004311DA /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; }; + C95B855B138F53DB004311DA /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C95B855C138F53DB004311DA /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C95B855D138F53DB004311DA /* lconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E8138D9E990028D27C /* lconv.c */; }; + C95B855E138F53DB004311DA /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; }; + C95B855F138F53DB004311DA /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; }; + C95B8560138F53DB004311DA /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; }; + C95B8561138F53DB004311DA /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C95B8562138F53DB004311DA /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C95B8563138F53DB004311DA /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C95B8564138F53DB004311DA /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C95B8565138F53DB004311DA /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C95B8566138F53DB004311DA /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C95B8567138F53DB004311DA /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C95B8568138F53DB004311DA /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C95B8569138F53DB004311DA /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C95B856A138F53DB004311DA /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C95B856B138F53DB004311DA /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C95B856C138F53DB004311DA /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C95B856D138F53DB004311DA /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C95B856E138F53DB004311DA /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C95B856F138F53DB004311DA /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_RECV"; }; }; + C95B8570138F53DB004311DA /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEND"; }; }; + C95B8571138F53DB004311DA /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C95B8572138F53DB004311DA /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C95B8573138F53DB004311DA /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C95B8574138F53DB004311DA /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C95B8575138F53DB004311DA /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C95B8576138F53DB004311DA /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C95B8577138F53DB004311DA /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C95B8578138F53DB004311DA /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C95B8579138F53DB004311DA /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C95B858D138F53DB004311DA /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C95B859E138F53DB004311DA /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C95B859F138F53DB004311DA /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C95B85A0138F53DB004311DA /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C95B85A1138F53DB004311DA /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C95B85A2138F53DB004311DA /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C95B85A3138F53DB004311DA /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FDOPEN"; }; }; + C95B85A4138F53DB004311DA /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C95B85A5138F53DB004311DA /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C95B85A6138F53DB004311DA /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C95B85A7138F53DB004311DA /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C95B85A8138F53DB004311DA /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C95B85A9138F53DB004311DA /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C95B85AA138F53DB004311DA /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C95B85AB138F53DB004311DA /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C95B85AC138F53DB004311DA /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C95B85AD138F53DB004311DA /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C95B85AE138F53DB004311DA /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C95B85AF138F53DB004311DA /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C95B85B0138F53DB004311DA /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C95B85B1138F53DB004311DA /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FOPEN"; }; }; + C95B85B2138F53DB004311DA /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C95B85B3138F53DB004311DA /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C95B85B4138F53DB004311DA /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C95B85B5138F53DB004311DA /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; }; + C95B85B6138F53DB004311DA /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C95B85B7138F53DB004311DA /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C95B85B8138F53DB004311DA /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C95B85B9138F53DB004311DA /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; }; + C95B85BA138F53DB004311DA /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C95B85BB138F53DB004311DA /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C95B85BC138F53DB004311DA /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C95B85BD138F53DB004311DA /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C95B85BE138F53DB004311DA /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C95B85BF138F53DB004311DA /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C95B85C0138F53DB004311DA /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C95B85C1138F53DB004311DA /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C95B85C2138F53DB004311DA /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C95B85C3138F53DB004311DA /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; }; + C95B85C4138F53DB004311DA /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C95B85C5138F53DB004311DA /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C95B85C6138F53DB004311DA /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C95B85C7138F53DB004311DA /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C95B85C8138F53DB004311DA /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C95B85C9138F53DB004311DA /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C95B85CA138F53DB004311DA /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C95B85CB138F53DB004311DA /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C95B85CC138F53DB004311DA /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C95B85CD138F53DB004311DA /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C95B85CE138F53DB004311DA /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C95B85CF138F53DB004311DA /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C95B85D0138F53DB004311DA /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C95B85D1138F53DB004311DA /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C95B85D2138F53DB004311DA /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C95B85D3138F53DB004311DA /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C95B85D4138F53DB004311DA /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C95B85D5138F53DB004311DA /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C95B85D6138F53DB004311DA /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C95B85D7138F53DB004311DA /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C95B85D8138F53DB004311DA /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C95B85D9138F53DB004311DA /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C95B85DA138F53DB004311DA /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C95B85DB138F53DB004311DA /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C95B85DC138F53DB004311DA /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C95B85DD138F53DB004311DA /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C95B85DE138F53DB004311DA /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C95B85DF138F53DB004311DA /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C95B85E0138F53DB004311DA /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C95B85E1138F53DB004311DA /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C95B85E2138F53DB004311DA /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C95B85E3138F53DB004311DA /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C95B85E4138F53DB004311DA /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C95B85E5138F53DB004311DA /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C95B85E6138F53DB004311DA /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; }; + C95B85E7138F53DB004311DA /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; }; + C95B85E8138F53DB004311DA /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C95B85E9138F53DB004311DA /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C95B85EA138F53DB004311DA /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C95B85EB138F53DB004311DA /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C95B85EC138F53DB004311DA /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C95B85ED138F53DB004311DA /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C95B85EE138F53DB004311DA /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C95B85EF138F53DB004311DA /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C95B85F0138F53DB004311DA /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C95B85F1138F53DB004311DA /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C95B85F2138F53DB004311DA /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C95B85F3138F53DB004311DA /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C95B85F4138F53DB004311DA /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C95B85F5138F53DB004311DA /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C95B85F6138F53DB004311DA /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C95B85F7138F53DB004311DA /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C95B85F8138F53DB004311DA /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C95B85F9138F53DB004311DA /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C95B85FA138F53DB004311DA /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C95B85FB138F53DB004311DA /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C95B85FC138F53DB004311DA /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C95B85FD138F53DB004311DA /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C95B85FE138F53DB004311DA /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C95B85FF138F53DB004311DA /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C95B8600138F53DB004311DA /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C95B8601138F53DB004311DA /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C95B8602138F53DB004311DA /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; }; + C95B8603138F53DB004311DA /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C95B8604138F53DB004311DA /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C95B8605138F53DB004311DA /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C95B8606138F53DB004311DA /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C95B8607138F53DB004311DA /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C95B8608138F53DB004311DA /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C95B8609138F53DB004311DA /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; }; + C95B860A138F53DB004311DA /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C95B860B138F53DB004311DA /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; }; + C95B860C138F53DB004311DA /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C95B860D138F53DB004311DA /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C95B860E138F53DB004311DA /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C95B860F138F53DB004311DA /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; }; + C95B8610138F53DB004311DA /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C95B8611138F53DB004311DA /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C95B8612138F53DB004311DA /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C95B8613138F53DB004311DA /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C95B8614138F53DB004311DA /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C95B8615138F53DB004311DA /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C95B8616138F53DB004311DA /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C95B8617138F53DB004311DA /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C95B8618138F53DB004311DA /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C95B8619138F53DB004311DA /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C95B861A138F53DB004311DA /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; }; + C95B861B138F53DB004311DA /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; }; + C95B861C138F53DB004311DA /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; }; + C95B861D138F53DB004311DA /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C95B861E138F53DB004311DA /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C95B861F138F53DB004311DA /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C95B8620138F53DB004311DA /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C95B8621138F53DB004311DA /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; }; + C95B8622138F53DB004311DA /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C95B8623138F53DB004311DA /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C95B8624138F53DB004311DA /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; }; + C95B8625138F53DB004311DA /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C95B8626138F53DB004311DA /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C95B8627138F53DB004311DA /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C95B8628138F53DB004311DA /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C95B8629138F53DB004311DA /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C95B862A138F53DB004311DA /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C95B862B138F53DB004311DA /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C95B862C138F53DB004311DA /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C95B862D138F53DB004311DA /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C95B862E138F53DB004311DA /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SYSTEM"; }; }; + C95B862F138F53DB004311DA /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C95B8630138F53DB004311DA /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C95B8631138F53DB004311DA /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C95B8632138F53DB004311DA /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C95B8633138F53DB004311DA /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C95B8634138F53DB004311DA /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C95B8635138F53DB004311DA /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + C95B8636138F53DB004311DA /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C95B8637138F53DB004311DA /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C95B8638138F53DB004311DA /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C95B8639138F53DB004311DA /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C95B863A138F53DB004311DA /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C95B863B138F53DB004311DA /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C95B863C138F53DB004311DA /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; }; + C95B863D138F53DB004311DA /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; }; + C95B863E138F53DB004311DA /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; }; + C95B863F138F53DB004311DA /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C95B8640138F53DB004311DA /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C95B8641138F53DB004311DA /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; }; + C95B8642138F53DB004311DA /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C95B864B138F53DB004311DA /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C95B864E138F53DB004311DA /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C95B8651138F53DB004311DA /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C95B8652138F53DB004311DA /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C95B8656138F53DB004311DA /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C95B8658138F53DB004311DA /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C95B8659138F53DB004311DA /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; }; + C95B865A138F53DB004311DA /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; }; + C95B865E138F53DB004311DA /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C95B8662138F53DB004311DA /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C95B8664138F53DB004311DA /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C95B8665138F53DB004311DA /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C95B8666138F53DB004311DA /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; }; + C95B8667138F53DB004311DA /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C95B8668138F53DB004311DA /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C95B8669138F53DB004311DA /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C95B866B138F53DB004311DA /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C95B866C138F53DB004311DA /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C95B866D138F53DB004311DA /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C95B866E138F53DB004311DA /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C95B866F138F53DB004311DA /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C95B8670138F53DB004311DA /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C95B8671138F53DB004311DA /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C95B8672138F53DB004311DA /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C95B8673138F53DB004311DA /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C95B8674138F53DB004311DA /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C95B8675138F53DB004311DA /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C95B8676138F53DB004311DA /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C95B8677138F53DB004311DA /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C95B8678138F53DB004311DA /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C95B8679138F53DB004311DA /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C95B867A138F53DB004311DA /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C95B867B138F53DB004311DA /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C95B867C138F53DB004311DA /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C95B867D138F53DB004311DA /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C95B867E138F53DB004311DA /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C95B867F138F53DB004311DA /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C95B8680138F53DB004311DA /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C95B8681138F53DB004311DA /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C95B8682138F53DB004311DA /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C95B8683138F53DB004311DA /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C95B8684138F53DB004311DA /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C95B8685138F53DB004311DA /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C95B8686138F53DB004311DA /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C95B8687138F53DB004311DA /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C95B8688138F53DB004311DA /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C95B8689138F53DB004311DA /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C95B868A138F53DB004311DA /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C95B868B138F53DB004311DA /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C95B868C138F53DB004311DA /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C95B868D138F53DB004311DA /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C95B868E138F53DB004311DA /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C95B8690138F53DB004311DA /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C95B8692138F53DB004311DA /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C95B8693138F53DB004311DA /* getgroups.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9F138D9E9A0028D27C /* getgroups.c */; }; + C95B8695138F53DB004311DA /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C95B8696138F53DB004311DA /* msgctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA6138D9E9A0028D27C /* msgctl.c */; }; + C95B8697138F53DB004311DA /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; }; + C95B8698138F53DB004311DA /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C95B8699138F53DB004311DA /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C95B869A138F53DB004311DA /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C95B869B138F53DB004311DA /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C95B869C138F53DB004311DA /* semctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB2138D9E9A0028D27C /* semctl.c */; }; + C95B869D138F53DB004311DA /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C95B869E138F53DB004311DA /* shmctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB4138D9E9A0028D27C /* shmctl.c */; }; + C95B869F138F53DB004311DA /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C95B86A3138F53DB004311DA /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C95B86A4138F53DB004311DA /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C95B86A8138F53DB004311DA /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; }; + C95B86A9138F53DB004311DA /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C95B86AA138F53DB004311DA /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C95B86AB138F53DB004311DA /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C95B86AC138F53DB004311DA /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C95B86AD138F53DB004311DA /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C95B86AE138F53DB004311DA /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C95B86AF138F53DB004311DA /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; }; + C95B86B0138F53DB004311DA /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; }; + C95B86B1138F53DB004311DA /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; }; + C95B86B2138F53DB004311DA /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; }; + C95B86B3138F53DB004311DA /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; }; + C95B86B4138F53DB004311DA /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; }; + C95B86B5138F53DB004311DA /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; }; + C95B86B6138F53DB004311DA /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; }; + C95B86B7138F53DB004311DA /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; }; + C9765EB9138EC61900741512 /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CREAT"; }; }; + C9765EBA138EC61900741512 /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C9765EBB138EC61900741512 /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C9765EBC138EC61900741512 /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; }; + C9765EBD138EC61900741512 /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C9765EBE138EC61900741512 /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C9765EBF138EC61900741512 /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C9765EC0138EC61900741512 /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C9765EC1138EC61900741512 /* setregid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360A138D9E980028D27C /* setregid.c */; }; + C9765EC2138EC61900741512 /* setreuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360B138D9E980028D27C /* setreuid.c */; }; + C9765EC3138EC61900741512 /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C9765EC4138EC61900741512 /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SIGPAUSE"; }; }; + C9765EC6138EC61900741512 /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C9765ECA138EC61900741512 /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C9765ECB138EC61900741512 /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; }; + C9765ECC138EC61900741512 /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; }; + C9765ECD138EC61900741512 /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; }; + C9765ECE138EC61900741512 /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; }; + C9765ECF138EC61900741512 /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; }; + C9765ED0138EC61900741512 /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; }; + C9765ED1138EC61900741512 /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; }; + C9765ED2138EC61900741512 /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; }; + C9765ED3138EC61900741512 /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; }; + C9765ED4138EC61900741512 /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; }; + C9765ED5138EC61900741512 /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; }; + C9765ED6138EC61900741512 /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; }; + C9765ED7138EC61900741512 /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; }; + C9765ED8138EC61900741512 /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; }; + C9765ED9138EC61900741512 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; }; + C9765EDA138EC61900741512 /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; }; + C9765EDB138EC61900741512 /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; }; + C9765EDC138EC61900741512 /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; }; + C9765EDD138EC61900741512 /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; }; + C9765EDE138EC61900741512 /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; }; + C9765EDF138EC61900741512 /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; }; + C9765EE0138EC61900741512 /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; }; + C9765EE1138EC61900741512 /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; }; + C9765EE2138EC61900741512 /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; }; + C9765EE3138EC61900741512 /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; }; + C9765EE4138EC61900741512 /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; }; + C9765EE5138EC61900741512 /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; }; + C9765EE6138EC61900741512 /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; }; + C9765EE7138EC61900741512 /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; }; + C9765EE8138EC61900741512 /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; }; + C9765EE9138EC61900741512 /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C9765EEA138EC61900741512 /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C9765EEB138EC61900741512 /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C9765EEC138EC61900741512 /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C9765EED138EC61900741512 /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C9765EEE138EC61900741512 /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C9765EEF138EC61900741512 /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C9765EF0138EC61900741512 /* _ldbl_util.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5368E138D9E980028D27C /* _ldbl_util.c */; }; + C9765EF1138EC61900741512 /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C9765EF2138EC61900741512 /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C9765EF3138EC61900741512 /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C9765EF4138EC61900741512 /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C9765EF5138EC61900741512 /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C9765EF6138EC61900741512 /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C9765EF7138EC61900741512 /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C9765EF8138EC61900741512 /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C9765EF9138EC61900741512 /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C9765EFA138EC61900741512 /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C9765EFB138EC61900741512 /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C9765EFC138EC61900741512 /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C9765EFD138EC61900741512 /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C9765EFE138EC61900741512 /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C9765EFF138EC61900741512 /* gdtoa-strtoIg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */; }; + C9765F00138EC61900741512 /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C9765F01138EC61900741512 /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C9765F02138EC61900741512 /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C9765F03138EC61900741512 /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C9765F04138EC61900741512 /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C9765F05138EC61900741512 /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C9765F06138EC61900741512 /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C9765F07138EC61900741512 /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C9765F08138EC61900741512 /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C9765F09138EC61900741512 /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C9765F13138EC61900741512 /* authentication.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D5138D9E990028D27C /* authentication.c */; }; + C9765F14138EC61900741512 /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C9765F16138EC61900741512 /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; }; + C9765F17138EC61900741512 /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; }; + C9765F18138EC61900741512 /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C9765F19138EC61900741512 /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C9765F1A138EC61900741512 /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C9765F1B138EC61900741512 /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C9765F1C138EC61900741512 /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C9765F1D138EC61900741512 /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C9765F1E138EC61900741512 /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; }; + C9765F1F138EC61900741512 /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C9765F20138EC61900741512 /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C9765F21138EC61900741512 /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; }; + C9765F22138EC61900741512 /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; }; + C9765F23138EC61900741512 /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C9765F24138EC61900741512 /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; }; + C9765F25138EC61900741512 /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; }; + C9765F26138EC61900741512 /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C9765F27138EC61900741512 /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C9765F28138EC61900741512 /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C9765F29138EC61900741512 /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C9765F2A138EC61900741512 /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C9765F2B138EC61900741512 /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C9765F2C138EC61900741512 /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; }; + C9765F2D138EC61900741512 /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C9765F2E138EC61900741512 /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C9765F2F138EC61900741512 /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C9765F30138EC61900741512 /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; }; + C9765F31138EC61900741512 /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C9765F32138EC61900741512 /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C9765F33138EC61900741512 /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; }; + C9765F34138EC61900741512 /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; }; + C9765F35138EC61900741512 /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C9765F36138EC61900741512 /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C9765F37138EC61900741512 /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; }; + C9765F38138EC61900741512 /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C9765F39138EC61900741512 /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C9765F3A138EC61900741512 /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C9765F3B138EC61900741512 /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_LOCKF"; }; }; + C9765F3C138EC61900741512 /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C9765F3D138EC61900741512 /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C9765F3E138EC61900741512 /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; }; + C9765F3F138EC61900741512 /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C9765F40138EC61900741512 /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; }; + C9765F41138EC61900741512 /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PAUSE -U__DARWIN_NON_CANCELABLE -D__DARWIN_NON_CANCELABLE=0"; }; }; + C9765F42138EC61900741512 /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; }; + C9765F44138EC61900741512 /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C9765F45138EC61900741512 /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + C9765F46138EC61900741512 /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; }; + C9765F47138EC61900741512 /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C9765F48138EC61900741512 /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; }; + C9765F49138EC61900741512 /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; }; + C9765F4A138EC61900741512 /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C9765F4B138EC61900741512 /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; }; + C9765F4C138EC61900741512 /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C9765F4D138EC61900741512 /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; }; + C9765F4E138EC61900741512 /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C9765F4F138EC61900741512 /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C9765F50138EC61900741512 /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C9765F51138EC61900741512 /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C9765F52138EC61900741512 /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SLEEP -U__DARWIN_NON_CANCELABLE -D__DARWIN_NON_CANCELABLE=0"; }; }; + C9765F53138EC61900741512 /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C9765F54138EC61900741512 /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C9765F55138EC61900741512 /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C9765F56138EC61900741512 /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; }; + C9765F57138EC61900741512 /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; }; + C9765F58138EC61900741512 /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C9765F59138EC61900741512 /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; }; + C9765F5A138EC61900741512 /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TCDRAIN -U__DARWIN_NON_CANCELABLE -D__DARWIN_NON_CANCELABLE=0"; }; }; + C9765F5B138EC61900741512 /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C9765F5C138EC61900741512 /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C9765F5D138EC61900741512 /* timezone.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A4138D9E990028D27C /* timezone.c */; }; + C9765F5E138EC61900741512 /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; }; + C9765F5F138EC61900741512 /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C9765F60138EC61900741512 /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C9765F61138EC61900741512 /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C9765F62138EC61900741512 /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C9765F63138EC61900741512 /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_USLEEP -U__DARWIN_NON_CANCELABLE -D__DARWIN_NON_CANCELABLE=0"; }; }; + C9765F64138EC61900741512 /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C9765F65138EC61900741512 /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C9765F66138EC61900741512 /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAIT -U__DARWIN_NON_CANCELABLE -D__DARWIN_NON_CANCELABLE=0"; }; }; + C9765F67138EC61900741512 /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C9765F68138EC61900741512 /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAITPID -U__DARWIN_NON_CANCELABLE -D__DARWIN_NON_CANCELABLE=0"; }; }; + C9765F69138EC61900741512 /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; }; + C9765F6A138EC61900741512 /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C9765F6B138EC61900741512 /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C9765F6C138EC61900741512 /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C9765F6D138EC61900741512 /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C9765F6E138EC61900741512 /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C9765F73138EC61900741512 /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_NANOSLEEP"; }; }; + C9765F74138EC61900741512 /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C9765F75138EC61900741512 /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; }; + C9765F76138EC61900741512 /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C9765F78138EC61900741512 /* oldsyslog.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537EA138D9E990028D27C /* oldsyslog.c */; }; + C9765F7B138EC61900741512 /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C9765F7C138EC61900741512 /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C9765F7F138EC61900741512 /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C9765F81138EC61900741512 /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C9765F82138EC61900741512 /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C9765F83138EC61900741512 /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C9765F84138EC61900741512 /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + C9765F86138EC61900741512 /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C9765FA6138EC61900741512 /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C9765FA7138EC61900741512 /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C9765FA8138EC61900741512 /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C9765FA9138EC61900741512 /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; }; + C9765FAA138EC61900741512 /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C9765FAB138EC61900741512 /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C9765FAC138EC61900741512 /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C9765FAD138EC61900741512 /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C9765FAE138EC61900741512 /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C9765FAF138EC61900741512 /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C9765FB0138EC61900741512 /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C9765FB1138EC61900741512 /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C9765FB2138EC61900741512 /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C9765FB3138EC61900741512 /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C9765FB4138EC61900741512 /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C9765FB5138EC61900741512 /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C9765FB6138EC61900741512 /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C9765FB7138EC61900741512 /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C9765FB8138EC61900741512 /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C9765FB9138EC61900741512 /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C9765FBA138EC61900741512 /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C9765FBB138EC61900741512 /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C9765FBC138EC61900741512 /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C9765FBD138EC61900741512 /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C9765FBE138EC61900741512 /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C9765FBF138EC61900741512 /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C9765FC0138EC61900741512 /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C9765FC1138EC61900741512 /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C9765FC2138EC61900741512 /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C9765FC3138EC61900741512 /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C9765FC4138EC61900741512 /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C9765FC5138EC61900741512 /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; }; + C9765FC6138EC61900741512 /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C9765FC7138EC61900741512 /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C9765FC8138EC61900741512 /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C9765FC9138EC61900741512 /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C9765FCA138EC61900741512 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C9765FCB138EC61900741512 /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C9765FCC138EC61900741512 /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; }; + C9765FCD138EC61900741512 /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C9765FCE138EC61900741512 /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C9765FCF138EC61900741512 /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C9765FD0138EC61900741512 /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C9765FD1138EC61900741512 /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C9765FD2138EC61900741512 /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C9765FD3138EC61900741512 /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C9765FD4138EC61900741512 /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C9765FD5138EC61900741512 /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C9765FD6138EC61900741512 /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C9765FD7138EC61900741512 /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C9765FD8138EC61900741512 /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C9765FD9138EC61900741512 /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C9765FDA138EC61900741512 /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C9765FDB138EC61900741512 /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C9765FDC138EC61900741512 /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C9765FDD138EC61900741512 /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C9765FDE138EC61900741512 /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; }; + C9765FDF138EC61900741512 /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C9765FE0138EC61900741512 /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C9765FE1138EC61900741512 /* lconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E8138D9E990028D27C /* lconv.c */; }; + C9765FE2138EC61900741512 /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; }; + C9765FE3138EC61900741512 /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; }; + C9765FE4138EC61900741512 /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; }; + C9765FE5138EC61900741512 /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C9765FE6138EC61900741512 /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C9765FE7138EC61900741512 /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C9765FE8138EC61900741512 /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C9765FE9138EC61900741512 /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C9765FEA138EC61900741512 /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C9765FEB138EC61900741512 /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C9765FEC138EC61900741512 /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C9765FED138EC61900741512 /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C9765FEE138EC61900741512 /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C9765FEF138EC61900741512 /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C9765FF0138EC61900741512 /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C9765FF1138EC61900741512 /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C9765FF2138EC61900741512 /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C9765FF3138EC61900741512 /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_RECV"; }; }; + C9765FF4138EC61900741512 /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEND"; }; }; + C9765FF5138EC61900741512 /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C9765FF6138EC61900741512 /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C9765FF7138EC61900741512 /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C9765FF8138EC61900741512 /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C9765FF9138EC61900741512 /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C9765FFA138EC61900741512 /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C9765FFB138EC61900741512 /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C9765FFC138EC61900741512 /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C9765FFD138EC61900741512 /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C9766011138EC61900741512 /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C9766022138EC61A00741512 /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C9766023138EC61A00741512 /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C9766024138EC61A00741512 /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C9766025138EC61A00741512 /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C9766026138EC61A00741512 /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C9766027138EC61A00741512 /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; }; + C9766028138EC61A00741512 /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C9766029138EC61A00741512 /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C976602A138EC61A00741512 /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C976602B138EC61A00741512 /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C976602C138EC61A00741512 /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C976602D138EC61A00741512 /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C976602E138EC61A00741512 /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C976602F138EC61A00741512 /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C9766030138EC61A00741512 /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C9766031138EC61A00741512 /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C9766032138EC61A00741512 /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C9766033138EC61A00741512 /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C9766034138EC61A00741512 /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C9766035138EC61A00741512 /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; }; + C9766036138EC61A00741512 /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C9766037138EC61A00741512 /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C9766038138EC61A00741512 /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C9766039138EC61A00741512 /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; }; + C976603A138EC61A00741512 /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C976603B138EC61A00741512 /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C976603C138EC61A00741512 /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C976603D138EC61A00741512 /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; }; + C976603E138EC61A00741512 /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C976603F138EC61A00741512 /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C9766040138EC61A00741512 /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C9766041138EC61A00741512 /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C9766042138EC61A00741512 /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C9766043138EC61A00741512 /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C9766044138EC61A00741512 /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C9766045138EC61A00741512 /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C9766046138EC61A00741512 /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C9766047138EC61A00741512 /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; }; + C9766048138EC61A00741512 /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C9766049138EC61A00741512 /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C976604A138EC61A00741512 /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C976604B138EC61A00741512 /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C976604C138EC61A00741512 /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C976604D138EC61A00741512 /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C976604E138EC61A00741512 /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C976604F138EC61A00741512 /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C9766050138EC61A00741512 /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C9766051138EC61A00741512 /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C9766052138EC61A00741512 /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C9766053138EC61A00741512 /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C9766054138EC61A00741512 /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C9766055138EC61A00741512 /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C9766056138EC61A00741512 /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C9766057138EC61A00741512 /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C9766058138EC61A00741512 /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C9766059138EC61A00741512 /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C976605A138EC61A00741512 /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C976605B138EC61A00741512 /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C976605C138EC61A00741512 /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C976605D138EC61A00741512 /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C976605E138EC61A00741512 /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C976605F138EC61A00741512 /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C9766060138EC61A00741512 /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C9766061138EC61A00741512 /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C9766062138EC61A00741512 /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C9766063138EC61A00741512 /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C9766064138EC61A00741512 /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C9766065138EC61A00741512 /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C9766066138EC61A00741512 /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C9766067138EC61A00741512 /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C9766068138EC61A00741512 /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C9766069138EC61A00741512 /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C976606A138EC61A00741512 /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; }; + C976606B138EC61A00741512 /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; }; + C976606C138EC61A00741512 /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C976606D138EC61A00741512 /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C976606E138EC61A00741512 /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C976606F138EC61A00741512 /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C9766070138EC61A00741512 /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C9766071138EC61A00741512 /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C9766072138EC61A00741512 /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C9766073138EC61A00741512 /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C9766074138EC61A00741512 /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C9766075138EC61A00741512 /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C9766076138EC61A00741512 /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C9766077138EC61A00741512 /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C9766078138EC61A00741512 /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C9766079138EC61A00741512 /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C976607A138EC61A00741512 /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C976607B138EC61A00741512 /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C976607C138EC61A00741512 /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C976607D138EC61A00741512 /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C976607E138EC61A00741512 /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C976607F138EC61A00741512 /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C9766080138EC61A00741512 /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C9766081138EC61A00741512 /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C9766082138EC61A00741512 /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C9766083138EC61A00741512 /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C9766084138EC61A00741512 /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C9766085138EC61A00741512 /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C9766086138EC61A00741512 /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; }; + C9766087138EC61A00741512 /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C9766088138EC61A00741512 /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C9766089138EC61A00741512 /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C976608A138EC61A00741512 /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C976608B138EC61A00741512 /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C976608C138EC61A00741512 /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C976608D138EC61A00741512 /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; }; + C976608E138EC61A00741512 /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C976608F138EC61A00741512 /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; }; + C9766090138EC61A00741512 /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C9766091138EC61A00741512 /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C9766092138EC61A00741512 /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C9766093138EC61A00741512 /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; }; + C9766094138EC61A00741512 /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C9766095138EC61A00741512 /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C9766096138EC61A00741512 /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C9766097138EC61A00741512 /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C9766098138EC61A00741512 /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C9766099138EC61A00741512 /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C976609A138EC61A00741512 /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C976609B138EC61A00741512 /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C976609C138EC61A00741512 /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C976609D138EC61A00741512 /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C976609E138EC61A00741512 /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; }; + C976609F138EC61A00741512 /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; }; + C97660A0138EC61A00741512 /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; }; + C97660A1138EC61A00741512 /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C97660A2138EC61A00741512 /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C97660A3138EC61A00741512 /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C97660A4138EC61A00741512 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C97660A5138EC61A00741512 /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; }; + C97660A6138EC61A00741512 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; }; + C97660A7138EC61A00741512 /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C97660A8138EC61A00741512 /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; }; + C97660A9138EC61A00741512 /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C97660AA138EC61A00741512 /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C97660AB138EC61A00741512 /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C97660AC138EC61A00741512 /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C97660AD138EC61A00741512 /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C97660AE138EC61A00741512 /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C97660AF138EC61A00741512 /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C97660B0138EC61A00741512 /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C97660B1138EC61A00741512 /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C97660B2138EC61A00741512 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SYSTEM"; }; }; + C97660B3138EC61A00741512 /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C97660B4138EC61A00741512 /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C97660B5138EC61A00741512 /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C97660B6138EC61A00741512 /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C97660B7138EC61A00741512 /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C97660B8138EC61A00741512 /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C97660B9138EC61A00741512 /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + C97660BA138EC61A00741512 /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C97660BB138EC61A00741512 /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C97660BC138EC61A00741512 /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C97660BD138EC61A00741512 /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C97660BE138EC61A00741512 /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C97660BF138EC61A00741512 /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C97660C0138EC61A00741512 /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; }; + C97660C1138EC61A00741512 /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; }; + C97660C2138EC61A00741512 /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; }; + C97660C3138EC61A00741512 /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C97660C4138EC61A00741512 /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C97660C5138EC61A00741512 /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; }; + C97660C6138EC61A00741512 /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C97660CF138EC61A00741512 /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C97660D2138EC61A00741512 /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C97660D5138EC61A00741512 /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C97660D6138EC61A00741512 /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C97660DA138EC61A00741512 /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C97660DC138EC61A00741512 /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C97660DD138EC61A00741512 /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; }; + C97660DE138EC61A00741512 /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; }; + C97660E2138EC61A00741512 /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C97660E6138EC61A00741512 /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C97660E8138EC61A00741512 /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C97660E9138EC61A00741512 /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C97660EA138EC61A00741512 /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; }; + C97660EB138EC61A00741512 /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C97660EC138EC61A00741512 /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C97660ED138EC61A00741512 /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C97660EF138EC61A00741512 /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C97660F0138EC61A00741512 /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C97660F1138EC61A00741512 /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C97660F2138EC61A00741512 /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C97660F3138EC61A00741512 /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C97660F4138EC61A00741512 /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C97660F5138EC61A00741512 /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C97660F6138EC61A00741512 /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C97660F7138EC61A00741512 /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C97660F8138EC61A00741512 /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C97660F9138EC61A00741512 /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C97660FA138EC61A00741512 /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C97660FB138EC61A00741512 /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C97660FC138EC61A00741512 /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C97660FD138EC61A00741512 /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C97660FE138EC61A00741512 /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C97660FF138EC61A00741512 /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C9766100138EC61A00741512 /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C9766101138EC61A00741512 /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C9766102138EC61A00741512 /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C9766103138EC61A00741512 /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C9766104138EC61A00741512 /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C9766105138EC61A00741512 /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C9766106138EC61A00741512 /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C9766107138EC61A00741512 /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C9766108138EC61A00741512 /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C9766109138EC61A00741512 /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C976610A138EC61A00741512 /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C976610B138EC61A00741512 /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C976610C138EC61A00741512 /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C976610D138EC61A00741512 /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C976610E138EC61A00741512 /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C976610F138EC61A00741512 /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C9766110138EC61A00741512 /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C9766111138EC61A00741512 /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C9766112138EC61A00741512 /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C9766114138EC61A00741512 /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C9766116138EC61A00741512 /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C9766117138EC61A00741512 /* getgroups.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9F138D9E9A0028D27C /* getgroups.c */; }; + C9766119138EC61A00741512 /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C976611A138EC61A00741512 /* msgctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA6138D9E9A0028D27C /* msgctl.c */; }; + C976611B138EC61A00741512 /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; }; + C976611C138EC61A00741512 /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C976611D138EC61A00741512 /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C976611E138EC61A00741512 /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C976611F138EC61A00741512 /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C9766120138EC61A00741512 /* semctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB2138D9E9A0028D27C /* semctl.c */; }; + C9766121138EC61A00741512 /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C9766122138EC61A00741512 /* shmctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB4138D9E9A0028D27C /* shmctl.c */; }; + C9766123138EC61A00741512 /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C9766127138EC61A00741512 /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C9766128138EC61A00741512 /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C976612C138EC61A00741512 /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; }; + C976612D138EC61A00741512 /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C976612E138EC61A00741512 /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C976612F138EC61A00741512 /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C9766130138EC61A00741512 /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C9766131138EC61A00741512 /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C9766132138EC61A00741512 /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C9766133138EC61A00741512 /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; }; + C9766134138EC61A00741512 /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; }; + C9766135138EC61A00741512 /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; }; + C9766136138EC61A00741512 /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; }; + C9766137138EC61A00741512 /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; }; + C9766138138EC61A00741512 /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; }; + C9766139138EC61A00741512 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; }; + C976613A138EC61A00741512 /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; }; + C976613B138EC61A00741512 /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; }; + C97A6F291517AF53005E1998 /* mcount.s in Sources */ = {isa = PBXBuildFile; fileRef = C9B53819138D9E990028D27C /* mcount.s */; }; + C97A6F6D1517AF53005E1998 /* mcount.s in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DF9138D9E9A0028D27C /* mcount.s */; }; + C97A6F761517AF53005E1998 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C97A6F791517AF53005E1998 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C97A6F7A1517AF53005E1998 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C97A6F7E1517AF53005E1998 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C97A6F961517AF53005E1998 /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CREAT"; }; }; + C97A6F971517AF53005E1998 /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C97A6F981517AF53005E1998 /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C97A6F991517AF53005E1998 /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_KILLPG"; }; }; + C97A6F9A1517AF53005E1998 /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C97A6F9B1517AF53005E1998 /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C97A6F9C1517AF53005E1998 /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C97A6F9D1517AF53005E1998 /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C97A6F9E1517AF53005E1998 /* setregid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360A138D9E980028D27C /* setregid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREGID"; }; }; + C97A6F9F1517AF53005E1998 /* setreuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360B138D9E980028D27C /* setreuid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREUID"; }; }; + C97A6FA01517AF53005E1998 /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C97A6FA11517AF53005E1998 /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SIGPAUSE"; }; }; + C97A6FA31517AF53005E1998 /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C97A6FA71517AF53005E1998 /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C97A6FA81517AF53005E1998 /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; }; + C97A6FA91517AF53005E1998 /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; }; + C97A6FAA1517AF53005E1998 /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; }; + C97A6FAB1517AF53005E1998 /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; }; + C97A6FAC1517AF53005E1998 /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; }; + C97A6FAD1517AF53005E1998 /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; }; + C97A6FAE1517AF53005E1998 /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; }; + C97A6FAF1517AF53005E1998 /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; }; + C97A6FB01517AF53005E1998 /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; }; + C97A6FB11517AF53005E1998 /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; }; + C97A6FB21517AF53005E1998 /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; }; + C97A6FB31517AF53005E1998 /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; }; + C97A6FB41517AF53005E1998 /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; }; + C97A6FB51517AF53005E1998 /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; }; + C97A6FB61517AF53005E1998 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; }; + C97A6FB71517AF53005E1998 /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; }; + C97A6FB81517AF53005E1998 /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; }; + C97A6FB91517AF53005E1998 /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; }; + C97A6FBA1517AF53005E1998 /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; }; + C97A6FBB1517AF53005E1998 /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; }; + C97A6FBC1517AF53005E1998 /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; }; + C97A6FBD1517AF53005E1998 /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; }; + C97A6FBE1517AF53005E1998 /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; }; + C97A6FBF1517AF53005E1998 /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; }; + C97A6FC01517AF53005E1998 /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; }; + C97A6FC11517AF53005E1998 /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; }; + C97A6FC21517AF53005E1998 /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; }; + C97A6FC31517AF53005E1998 /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; }; + C97A6FC41517AF53005E1998 /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; }; + C97A6FC51517AF53005E1998 /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; }; + C97A6FC61517AF53005E1998 /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C97A6FC71517AF53005E1998 /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C97A6FC81517AF53005E1998 /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C97A6FC91517AF53005E1998 /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C97A6FCA1517AF53005E1998 /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C97A6FCB1517AF53005E1998 /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C97A6FCC1517AF53005E1998 /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C97A6FCD1517AF53005E1998 /* _ldbl_util.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5368E138D9E980028D27C /* _ldbl_util.c */; }; + C97A6FCE1517AF53005E1998 /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C97A6FCF1517AF53005E1998 /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C97A6FD01517AF53005E1998 /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C97A6FD11517AF53005E1998 /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C97A6FD21517AF53005E1998 /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C97A6FD31517AF53005E1998 /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C97A6FD41517AF53005E1998 /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C97A6FD51517AF53005E1998 /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C97A6FD61517AF53005E1998 /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C97A6FD71517AF53005E1998 /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C97A6FD81517AF53005E1998 /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C97A6FD91517AF53005E1998 /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C97A6FDA1517AF53005E1998 /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C97A6FDB1517AF53005E1998 /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C97A6FDC1517AF53005E1998 /* gdtoa-strtoIg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */; }; + C97A6FDD1517AF53005E1998 /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C97A6FDE1517AF53005E1998 /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C97A6FDF1517AF53005E1998 /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C97A6FE01517AF53005E1998 /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C97A6FE11517AF53005E1998 /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C97A6FE21517AF53005E1998 /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C97A6FE31517AF53005E1998 /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C97A6FE41517AF53005E1998 /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C97A6FE51517AF53005E1998 /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C97A6FE61517AF53005E1998 /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C97A6FF01517AF53005E1998 /* authentication.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D5138D9E990028D27C /* authentication.c */; }; + C97A6FF11517AF53005E1998 /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C97A6FF31517AF53005E1998 /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_CONFSTR"; }; }; + C97A6FF41517AF53005E1998 /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_ENCRYPT -DLIBC_ALIAS_SETKEY"; }; }; + C97A6FF51517AF53005E1998 /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C97A6FF61517AF53005E1998 /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C97A6FF71517AF53005E1998 /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C97A6FF81517AF53005E1998 /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C97A6FF91517AF53005E1998 /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C97A6FFA1517AF53005E1998 /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C97A6FFB1517AF53005E1998 /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A6FFC1517AF53005E1998 /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C97A6FFD1517AF53005E1998 /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C97A6FFE1517AF53005E1998 /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOCK"; }; }; + C97A6FFF1517AF53005E1998 /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOSEDIR -include gen/__dirent.h"; }; }; + C97A70001517AF53005E1998 /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C97A70011517AF53005E1998 /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A70021517AF53005E1998 /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A70031517AF53005E1998 /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C97A70041517AF53005E1998 /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C97A70051517AF53005E1998 /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C97A70061517AF53005E1998 /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C97A70071517AF53005E1998 /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C97A70081517AF53005E1998 /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C97A70091517AF53005E1998 /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FNMATCH"; }; }; + C97A700A1517AF53005E1998 /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C97A700B1517AF53005E1998 /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C97A700C1517AF53005E1998 /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C97A700D1517AF53005E1998 /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A700E1517AF53005E1998 /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C97A700F1517AF53005E1998 /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C97A70101517AF53005E1998 /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A70111517AF53005E1998 /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A70121517AF53005E1998 /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C97A70131517AF53005E1998 /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C97A70141517AF53005E1998 /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_GLOB"; }; }; + C97A70151517AF53005E1998 /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C97A70161517AF53005E1998 /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C97A70171517AF53005E1998 /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C97A70181517AF53005E1998 /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_LOCKF"; }; }; + C97A70191517AF53005E1998 /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C97A701A1517AF53005E1998 /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C97A701B1517AF53005E1998 /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_NICE"; }; }; + C97A701C1517AF53005E1998 /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C97A701D1517AF53005E1998 /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS___OPENDIR2 -DLIBC_ALIAS_OPENDIR -include gen/__dirent.h"; }; }; + C97A701E1517AF53005E1998 /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PAUSE"; }; }; + C97A701F1517AF53005E1998 /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_POPEN"; }; }; + C97A70211517AF53005E1998 /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C97A70221517AF53005E1998 /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + C97A70231517AF53005E1998 /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C97A70241517AF53005E1998 /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C97A70251517AF53005E1998 /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REWINDDIR -include gen/__dirent.h"; }; }; + C97A70261517AF53005E1998 /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C97A70271517AF53005E1998 /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C97A70281517AF53005E1998 /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEEKDIR -include gen/__dirent.h"; }; }; + C97A70291517AF53005E1998 /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C97A702A1517AF53005E1998 /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SETMODE"; }; }; + C97A702B1517AF53005E1998 /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C97A702C1517AF53005E1998 /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C97A702D1517AF53005E1998 /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C97A702E1517AF53005E1998 /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C97A702F1517AF53005E1998 /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SLEEP"; }; }; + C97A70301517AF53005E1998 /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C97A70311517AF53005E1998 /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C97A70321517AF53005E1998 /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C97A70331517AF53005E1998 /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A70341517AF53005E1998 /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A70351517AF53005E1998 /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C97A70361517AF53005E1998 /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS__SEEKDIR -DLIBC_ALIAS_TELLDIR -include gen/__dirent.h"; }; }; + C97A70371517AF53005E1998 /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TCDRAIN"; }; }; + C97A70381517AF53005E1998 /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C97A70391517AF53005E1998 /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C97A703A1517AF53005E1998 /* timezone.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A4138D9E990028D27C /* timezone.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A703B1517AF53005E1998 /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TTYNAME_R"; }; }; + C97A703C1517AF53005E1998 /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C97A703D1517AF53005E1998 /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C97A703E1517AF53005E1998 /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C97A703F1517AF53005E1998 /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C97A70401517AF53005E1998 /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_USLEEP"; }; }; + C97A70411517AF53005E1998 /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C97A70421517AF53005E1998 /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C97A70431517AF53005E1998 /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAIT"; }; }; + C97A70441517AF53005E1998 /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C97A70451517AF53005E1998 /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAITPID"; }; }; + C97A70461517AF53005E1998 /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_FTS_CHILDREN -DLIBC_ALIAS_FTS_CLOSE -DLIBC_ALIAS_FTS_OPEN -DLIBC_ALIAS_FTS_OPEN_B -DLIBC_ALIAS_FTS_READ -DLIBC_ALIAS_FTS_SET"; }; }; + C97A70471517AF53005E1998 /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C97A70481517AF53005E1998 /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C97A70491517AF53005E1998 /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C97A704A1517AF53005E1998 /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C97A704B1517AF53005E1998 /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C97A70501517AF53005E1998 /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_NANOSLEEP"; }; }; + C97A70511517AF53005E1998 /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C97A70521517AF53005E1998 /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_FTW -DLIBC_ALIAS_NFTW"; }; }; + C97A70531517AF53005E1998 /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C97A70551517AF53005E1998 /* oldsyslog.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537EA138D9E990028D27C /* oldsyslog.c */; }; + C97A70581517AF53005E1998 /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C97A70591517AF53005E1998 /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C97A705C1517AF53005E1998 /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C97A705E1517AF53005E1998 /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C97A705F1517AF53005E1998 /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C97A70601517AF53005E1998 /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C97A70611517AF53005E1998 /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + C97A70621517AF53005E1998 /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C97A70701517AF53005E1998 /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C97A70711517AF53005E1998 /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C97A70721517AF53005E1998 /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C97A70731517AF53005E1998 /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; }; + C97A70741517AF53005E1998 /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C97A70751517AF53005E1998 /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C97A70761517AF53005E1998 /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C97A70771517AF53005E1998 /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C97A70781517AF53005E1998 /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C97A70791517AF53005E1998 /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C97A707A1517AF53005E1998 /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C97A707B1517AF53005E1998 /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C97A707C1517AF53005E1998 /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C97A707D1517AF53005E1998 /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C97A707E1517AF53005E1998 /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C97A707F1517AF53005E1998 /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C97A70801517AF53005E1998 /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C97A70811517AF53005E1998 /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C97A70821517AF53005E1998 /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C97A70831517AF53005E1998 /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C97A70841517AF53005E1998 /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C97A70851517AF53005E1998 /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C97A70861517AF53005E1998 /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C97A70871517AF53005E1998 /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C97A70881517AF53005E1998 /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C97A70891517AF53005E1998 /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C97A708A1517AF53005E1998 /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C97A708B1517AF53005E1998 /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C97A708C1517AF53005E1998 /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C97A708D1517AF53005E1998 /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C97A708E1517AF53005E1998 /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C97A708F1517AF53005E1998 /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; }; + C97A70901517AF53005E1998 /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C97A70911517AF53005E1998 /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C97A70921517AF53005E1998 /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C97A70931517AF53005E1998 /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C97A70941517AF53005E1998 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C97A70951517AF53005E1998 /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C97A70961517AF53005E1998 /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WCSFTIME -DLIBC_ALIAS_WCSFTIME_L"; }; }; + C97A70971517AF53005E1998 /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C97A70981517AF53005E1998 /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C97A70991517AF53005E1998 /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C97A709A1517AF53005E1998 /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C97A709B1517AF53005E1998 /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C97A709C1517AF53005E1998 /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C97A709D1517AF53005E1998 /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C97A709E1517AF53005E1998 /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C97A709F1517AF53005E1998 /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C97A70A01517AF53005E1998 /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C97A70A11517AF53005E1998 /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C97A70A21517AF53005E1998 /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C97A70A31517AF53005E1998 /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C97A70A41517AF53005E1998 /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C97A70A51517AF53005E1998 /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C97A70A61517AF53005E1998 /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C97A70A71517AF53005E1998 /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C97A70A81517AF53005E1998 /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; }; + C97A70A91517AF53005E1998 /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C97A70AA1517AF53005E1998 /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C97A70AB1517AF53005E1998 /* lconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E8138D9E990028D27C /* lconv.c */; }; + C97A70AC1517AF53005E1998 /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; }; + C97A70AD1517AF53005E1998 /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; }; + C97A70AE1517AF53005E1998 /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; }; + C97A70AF1517AF53005E1998 /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C97A70B01517AF53005E1998 /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C97A70B11517AF53005E1998 /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C97A70B21517AF53005E1998 /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C97A70B31517AF53005E1998 /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C97A70B41517AF53005E1998 /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C97A70B51517AF53005E1998 /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C97A70B61517AF53005E1998 /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C97A70B71517AF53005E1998 /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C97A70B81517AF53005E1998 /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C97A70B91517AF53005E1998 /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C97A70BA1517AF53005E1998 /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C97A70BB1517AF53005E1998 /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C97A70BC1517AF53005E1998 /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C97A70BD1517AF53005E1998 /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_RECV"; }; }; + C97A70BE1517AF53005E1998 /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEND"; }; }; + C97A70BF1517AF53005E1998 /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C97A70C01517AF53005E1998 /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C97A70C11517AF53005E1998 /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C97A70C21517AF53005E1998 /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C97A70C31517AF53005E1998 /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C97A70C41517AF53005E1998 /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C97A70C51517AF53005E1998 /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C97A70C61517AF53005E1998 /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C97A70C71517AF53005E1998 /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C97A70D11517AF53005E1998 /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C97A70D21517AF53005E1998 /* chk_fail.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B1E138D9E990028D27C /* chk_fail.c */; }; + C97A70D31517AF53005E1998 /* memcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B20138D9E990028D27C /* memcpy_chk.c */; }; + C97A70D41517AF53005E1998 /* memmove_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B21138D9E990028D27C /* memmove_chk.c */; }; + C97A70D51517AF53005E1998 /* memset_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B22138D9E990028D27C /* memset_chk.c */; }; + C97A70D61517AF53005E1998 /* snprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B23138D9E990028D27C /* snprintf_chk.c */; }; + C97A70D71517AF53005E1998 /* sprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B24138D9E990028D27C /* sprintf_chk.c */; }; + C97A70D81517AF53005E1998 /* stpcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B25138D9E990028D27C /* stpcpy_chk.c */; }; + C97A70D91517AF53005E1998 /* stpncpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B26138D9E990028D27C /* stpncpy_chk.c */; }; + C97A70DA1517AF53005E1998 /* strcat_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B27138D9E990028D27C /* strcat_chk.c */; }; + C97A70DB1517AF53005E1998 /* strcpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B28138D9E990028D27C /* strcpy_chk.c */; }; + C97A70DC1517AF53005E1998 /* strncat_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B29138D9E990028D27C /* strncat_chk.c */; }; + C97A70DD1517AF53005E1998 /* strncpy_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2A138D9E990028D27C /* strncpy_chk.c */; }; + C97A70DE1517AF53005E1998 /* vsnprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2B138D9E990028D27C /* vsnprintf_chk.c */; }; + C97A70DF1517AF53005E1998 /* vsprintf_chk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2C138D9E990028D27C /* vsprintf_chk.c */; }; + C97A70E01517AF53005E1998 /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C97A70E11517AF53005E1998 /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C97A70E21517AF53005E1998 /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C97A70E31517AF53005E1998 /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C97A70E41517AF53005E1998 /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C97A70E51517AF53005E1998 /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FDOPEN"; }; }; + C97A70E61517AF53005E1998 /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C97A70E71517AF53005E1998 /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C97A70E81517AF53005E1998 /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C97A70E91517AF53005E1998 /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C97A70EA1517AF53005E1998 /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C97A70EB1517AF53005E1998 /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C97A70EC1517AF53005E1998 /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C97A70ED1517AF53005E1998 /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C97A70EE1517AF53005E1998 /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C97A70EF1517AF53005E1998 /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C97A70F01517AF53005E1998 /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C97A70F11517AF53005E1998 /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C97A70F21517AF53005E1998 /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C97A70F31517AF53005E1998 /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FOPEN"; }; }; + C97A70F41517AF53005E1998 /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C97A70F51517AF53005E1998 /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C97A70F61517AF53005E1998 /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C97A70F71517AF53005E1998 /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FPUTS"; }; }; + C97A70F81517AF53005E1998 /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C97A70F91517AF53005E1998 /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C97A70FA1517AF53005E1998 /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C97A70FB1517AF53005E1998 /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FREOPEN"; }; }; + C97A70FC1517AF53005E1998 /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C97A70FD1517AF53005E1998 /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C97A70FE1517AF53005E1998 /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C97A70FF1517AF53005E1998 /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C97A71001517AF53005E1998 /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C97A71011517AF53005E1998 /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C97A71021517AF53005E1998 /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C97A71031517AF53005E1998 /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C97A71041517AF53005E1998 /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C97A71051517AF53005E1998 /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FWRITE"; }; }; + C97A71061517AF53005E1998 /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C97A71071517AF53005E1998 /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C97A71081517AF53005E1998 /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C97A71091517AF53005E1998 /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C97A710A1517AF53005E1998 /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C97A710B1517AF53005E1998 /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C97A710C1517AF53005E1998 /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C97A710D1517AF53005E1998 /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C97A710E1517AF53005E1998 /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C97A710F1517AF53005E1998 /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C97A71101517AF53005E1998 /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C97A71111517AF53005E1998 /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C97A71121517AF53005E1998 /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C97A71131517AF53005E1998 /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C97A71141517AF53005E1998 /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C97A71151517AF53005E1998 /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C97A71161517AF53005E1998 /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C97A71171517AF53005E1998 /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C97A71181517AF53005E1998 /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C97A71191517AF53005E1998 /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C97A711A1517AF53005E1998 /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C97A711B1517AF53005E1998 /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C97A711C1517AF53005E1998 /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C97A711D1517AF53005E1998 /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C97A711E1517AF53005E1998 /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C97A711F1517AF53005E1998 /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C97A71201517AF53005E1998 /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C97A71211517AF53005E1998 /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C97A71221517AF53005E1998 /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C97A71231517AF53005E1998 /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C97A71241517AF53005E1998 /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C97A71251517AF53005E1998 /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C97A71261517AF53005E1998 /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C97A71271517AF53005E1998 /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C97A71281517AF53005E1998 /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TEMPNAM"; }; }; + C97A71291517AF53005E1998 /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -D_DARWIN_UNLIMITED_STREAMS"; }; }; + C97A712A1517AF53005E1998 /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C97A712B1517AF53005E1998 /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C97A712C1517AF53005E1998 /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C97A712D1517AF53005E1998 /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C97A712E1517AF53005E1998 /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C97A712F1517AF53005E1998 /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C97A71301517AF53005E1998 /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C97A71311517AF53005E1998 /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C97A71321517AF53005E1998 /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C97A71331517AF53005E1998 /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C97A71341517AF53005E1998 /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C97A71351517AF53005E1998 /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C97A71361517AF53005E1998 /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C97A71371517AF53005E1998 /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C97A71381517AF53005E1998 /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C97A71391517AF53005E1998 /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C97A713A1517AF53005E1998 /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C97A713B1517AF53005E1998 /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C97A713C1517AF53005E1998 /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C97A713D1517AF53005E1998 /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C97A713E1517AF53005E1998 /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C97A713F1517AF53005E1998 /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C97A71401517AF53005E1998 /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C97A71411517AF53005E1998 /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C97A71421517AF53005E1998 /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C97A71431517AF53005E1998 /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C97A71441517AF53005E1998 /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A71451517AF53005E1998 /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C97A71461517AF53005E1998 /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C97A71471517AF53005E1998 /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C97A71481517AF53005E1998 /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C97A71491517AF53005E1998 /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C97A714A1517AF53005E1998 /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C97A714B1517AF53005E1998 /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A714C1517AF53005E1998 /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C97A714D1517AF53005E1998 /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_GETOPT"; }; }; + C97A714E1517AF53005E1998 /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C97A714F1517AF53005E1998 /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C97A71501517AF53005E1998 /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C97A71511517AF53005E1998 /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A71521517AF53005E1998 /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C97A71531517AF53005E1998 /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C97A71541517AF53005E1998 /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C97A71551517AF53005E1998 /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C97A71561517AF53005E1998 /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C97A71571517AF53005E1998 /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C97A71581517AF53005E1998 /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C97A71591517AF53005E1998 /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C97A715A1517AF53005E1998 /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C97A715B1517AF53005E1998 /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C97A715C1517AF53005E1998 /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A715D1517AF53005E1998 /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PUTENV"; }; }; + C97A715E1517AF53005E1998 /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A715F1517AF53005E1998 /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C97A71601517AF53005E1998 /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C97A71611517AF53005E1998 /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C97A71621517AF53005E1998 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C97A71631517AF53005E1998 /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A71641517AF53005E1998 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C97A71651517AF53005E1998 /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C97A71661517AF53005E1998 /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C97A71671517AF53005E1998 /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C97A71681517AF53005E1998 /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C97A71691517AF53005E1998 /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C97A716A1517AF53005E1998 /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C97A716B1517AF53005E1998 /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C97A716C1517AF53005E1998 /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C97A716D1517AF53005E1998 /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C97A716E1517AF53005E1998 /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C97A716F1517AF53005E1998 /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C97A71701517AF53005E1998 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SYSTEM"; }; }; + C97A71711517AF53005E1998 /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C97A71721517AF53005E1998 /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C97A71731517AF53005E1998 /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C97A71741517AF53005E1998 /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C97A71751517AF53005E1998 /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C97A71761517AF53005E1998 /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C97A71771517AF53005E1998 /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + C97A71781517AF53005E1998 /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C97A71791517AF53005E1998 /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C97A717A1517AF53005E1998 /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C97A717B1517AF53005E1998 /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C97A717C1517AF53005E1998 /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C97A717D1517AF53005E1998 /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C97A717E1517AF53005E1998 /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_MKTIME"; }; }; + C97A717F1517AF53005E1998 /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRFTIME -DLIBC_ALIAS_STRFTIME_L"; }; }; + C97A71801517AF53005E1998 /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRPTIME -DLIBC_ALIAS_STRPTIME_L"; }; }; + C97A71811517AF53005E1998 /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C97A71821517AF53005E1998 /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C97A71831517AF53005E1998 /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; settings = {COMPILER_FLAGS = "-D_DARWIN_UNLIMITED_STREAMS"; }; }; + C97A71841517AF53005E1998 /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C97A718D1517AF53005E1998 /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C97A71901517AF53005E1998 /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C97A71911517AF53005E1998 /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C97A71921517AF53005E1998 /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C97A71951517AF53005E1998 /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C97A71961517AF53005E1998 /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C97A71971517AF53005E1998 /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A71981517AF53005E1998 /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRERROR"; }; }; + C97A719A1517AF53005E1998 /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C97A719C1517AF53005E1998 /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C97A719E1517AF53005E1998 /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C97A719F1517AF53005E1998 /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C97A71A01517AF53005E1998 /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C97A71A11517AF53005E1998 /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C97A71A21517AF53005E1998 /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C97A71A31517AF53005E1998 /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C97A71A51517AF53005E1998 /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C97A71A61517AF53005E1998 /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C97A71A71517AF53005E1998 /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C97A71A81517AF53005E1998 /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C97A71A91517AF53005E1998 /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C97A71AA1517AF53005E1998 /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C97A71AB1517AF53005E1998 /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C97A71AC1517AF53005E1998 /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C97A71AD1517AF53005E1998 /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C97A71AE1517AF53005E1998 /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C97A71AF1517AF53005E1998 /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C97A71B01517AF53005E1998 /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C97A71B11517AF53005E1998 /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C97A71B21517AF53005E1998 /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C97A71B31517AF53005E1998 /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C97A71B41517AF53005E1998 /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C97A71B51517AF53005E1998 /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C97A71B61517AF53005E1998 /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C97A71B71517AF53005E1998 /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C97A71B81517AF53005E1998 /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C97A71B91517AF53005E1998 /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C97A71BA1517AF53005E1998 /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C97A71BB1517AF53005E1998 /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C97A71BC1517AF53005E1998 /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C97A71BD1517AF53005E1998 /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C97A71BE1517AF53005E1998 /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C97A71BF1517AF53005E1998 /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C97A71C01517AF53005E1998 /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C97A71C11517AF53005E1998 /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C97A71C21517AF53005E1998 /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C97A71C31517AF53005E1998 /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C97A71C41517AF53005E1998 /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C97A71C51517AF53005E1998 /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C97A71C61517AF53005E1998 /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C97A71C71517AF53005E1998 /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C97A71C81517AF53005E1998 /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C97A71CA1517AF53005E1998 /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C97A71CC1517AF53005E1998 /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C97A71CD1517AF53005E1998 /* getgroups.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9F138D9E9A0028D27C /* getgroups.c */; }; + C97A71CF1517AF53005E1998 /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C97A71D01517AF53005E1998 /* msgctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA6138D9E9A0028D27C /* msgctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_MSGCTL -DKERNEL"; }; }; + C97A71D11517AF53005E1998 /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; }; + C97A71D21517AF53005E1998 /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C97A71D31517AF53005E1998 /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C97A71D41517AF53005E1998 /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C97A71D51517AF53005E1998 /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C97A71D61517AF53005E1998 /* semctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB2138D9E9A0028D27C /* semctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SEMCTL -DKERNEL"; }; }; + C97A71D71517AF53005E1998 /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C97A71D81517AF53005E1998 /* shmctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB4138D9E9A0028D27C /* shmctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SHMCTL -DKERNEL"; }; }; + C97A71D91517AF53005E1998 /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C97A71DA1517AF53005E1998 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C97A71DD1517AF53005E1998 /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C97A71DE1517AF53005E1998 /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C97A71E21517AF53005E1998 /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; }; + C97A71E31517AF53005E1998 /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C97A71E41517AF53005E1998 /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C97A71E51517AF53005E1998 /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C97A71E61517AF53005E1998 /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C97A71E71517AF53005E1998 /* mkpath_np.c in Sources */ = {isa = PBXBuildFile; fileRef = 3F89F3DD13E9194C00F6856C /* mkpath_np.c */; }; + C97A71E81517AF53005E1998 /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C97A71E91517AF53005E1998 /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C97A71EA1517AF53005E1998 /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; }; + C97A71EB1517AF53005E1998 /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; }; + C97A71EC1517AF53005E1998 /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; }; + C97A71ED1517AF53005E1998 /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; }; + C97A71EE1517AF53005E1998 /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; }; + C97A71EF1517AF53005E1998 /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; }; + C97A71F01517AF53005E1998 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; }; + C97A71F11517AF53005E1998 /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; }; + C97A71F21517AF53005E1998 /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; }; + C97A71F71517AF53005E1998 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C97A71F81517AF53005E1998 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C97A71F91517AF53005E1998 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C97A71FA1517AF53005E1998 /* (null) in Sources */ = {isa = PBXBuildFile; }; + C97A71FD1517AF53005E1998 /* scandir_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB350E138F769B0075BB52 /* scandir_b.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C97A72101517AF53005E1998 /* stpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060513DDEDF10094DD56 /* stpcpy.c */; }; + C97A72111517AF53005E1998 /* stpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060913DDEEA10094DD56 /* stpncpy.c */; }; + C97A72121517AF53005E1998 /* strcat.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060C13DDF26A0094DD56 /* strcat.c */; }; + C97A72131517AF53005E1998 /* strncat.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D4060F13DDF4340094DD56 /* strncat.c */; }; + C97A72161517AF53005E1998 /* sync_volume_np.c in Sources */ = {isa = PBXBuildFile; fileRef = B19C645B1450F90200032373 /* sync_volume_np.c */; }; + C97A72171517AF53005E1998 /* dirfd.c in Sources */ = {isa = PBXBuildFile; fileRef = 3FB7E1B4146EF2E000843438 /* dirfd.c */; }; + C98373971395989E00E5C052 /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C98373981395989E00E5C052 /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C9A12853138E0BE00003880A /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C9A12854138E0C1C0003880A /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C9A12855138E0C1C0003880A /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C9A12856138E0C1C0003880A /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C9A128A0138E0CD10003880A /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C9A128A1138E0CD10003880A /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C9A128A2138E0CD10003880A /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C9A128A3138E0CD10003880A /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C9A128A4138E0CD10003880A /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C9A128A5138E0CD10003880A /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C9A12929138E0EF00003880A /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; }; + C9A1292A138E0EF00003880A /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C9A12977138E10C40003880A /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; settings = {COMPILER_FLAGS = " -D__FBSDID=__RCSID"; }; }; + C9A12978138E10C40003880A /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C9A12979138E10C40003880A /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C9A1297A138E10C40003880A /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C9A1297B138E10C40003880A /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C9A1297C138E10FB0003880A /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; settings = {COMPILER_FLAGS = "-include $(SRCROOT)/uuid/uuid-config.h"; }; }; + C9A1297D138E10FB0003880A /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; settings = {COMPILER_FLAGS = "-include $(SRCROOT)/uuid/uuid-config.h"; }; }; + C9A1297E138E10FB0003880A /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; settings = {COMPILER_FLAGS = "-include $(SRCROOT)/uuid/uuid-config.h"; }; }; + C9A1297F138E10FB0003880A /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; settings = {COMPILER_FLAGS = "-include $(SRCROOT)/uuid/uuid-config.h"; }; }; + C9A12980138E10FB0003880A /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; settings = {COMPILER_FLAGS = "-include $(SRCROOT)/uuid/uuid-config.h"; }; }; + C9A12981138E10FB0003880A /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; settings = {COMPILER_FLAGS = "-include $(SRCROOT)/uuid/uuid-config.h"; }; }; + C9A12982138E10FB0003880A /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; settings = {COMPILER_FLAGS = "-include $(SRCROOT)/uuid/uuid-config.h"; }; }; + C9A12983138E10FB0003880A /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; settings = {COMPILER_FLAGS = "-include $(SRCROOT)/uuid/uuid-config.h"; }; }; + C9A12984138E10FB0003880A /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; settings = {COMPILER_FLAGS = "-include $(SRCROOT)/uuid/uuid-config.h"; }; }; + C9AE91B51517D31A00A2626C /* libBase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C9C2A94D138DFFD900287F00 /* libBase.a */; }; + C9AE91B71517D31C00A2626C /* libFreeBSD.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C9257ED0138E1B5000B3107C /* libFreeBSD.a */; }; + C9AE91B81517D32200A2626C /* libvCancelable.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C9D94360138EC3E300FB7ACC /* libvCancelable.a */; }; + C9AE91B91517D32900A2626C /* libTRE.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B122F2AD1432B8E600AF95D0 /* libTRE.a */; }; + C9B53E5E138DA5910028D27C /* mcount.s in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DF9138D9E9A0028D27C /* mcount.s */; }; + C9C2A959138E025700287F00 /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C9C2A95A138E025700287F00 /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; }; + C9C2A97D138E058200287F00 /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C9C2A97E138E058200287F00 /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C9C2A97F138E058200287F00 /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C9C2A980138E058200287F00 /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C9C2A981138E058200287F00 /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C9C2A982138E058200287F00 /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C9C2A983138E058200287F00 /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C9C2A9A2138E06D900287F00 /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C9C2A9A4138E06D900287F00 /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; }; + C9C2A9A5138E06D900287F00 /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; }; + C9C2A9A6138E06D900287F00 /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C9C2A9A7138E06D900287F00 /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C9C2A9A8138E06D900287F00 /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C9C2A9A9138E06D900287F00 /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C9C2A9AA138E072500287F00 /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; }; + C9C2A9AB138E072500287F00 /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C9C2A9AC138E072500287F00 /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C9C2A9AD138E072500287F00 /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C9C2A9AE138E072500287F00 /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C9C2A9AF138E072500287F00 /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C9C2A9B5138E072500287F00 /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; }; + C9C2A9B6138E072500287F00 /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; }; + C9C2A9B8138E072500287F00 /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C9C2A9B9138E072600287F00 /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C9C2A9BC138E072600287F00 /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C9C2A9BE138E072600287F00 /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C9C2A9BF138E072600287F00 /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C9C2A9C0138E072600287F00 /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C9D94333138DB75B00FB7ACC /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C9D94359138EC0C600FB7ACC /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C9D9435A138EC0C600FB7ACC /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C9EB2F53138F68A80075BB52 /* mcount.s in Sources */ = {isa = PBXBuildFile; fileRef = C9B53819138D9E990028D27C /* mcount.s */; }; + C9EB2FC1138F6BB00075BB52 /* merge_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB2FC0138F6BB00075BB52 /* merge_b.c */; }; + C9EB2FC4138F6C5C0075BB52 /* psort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB2FC3138F6C5C0075BB52 /* psort.c */; }; + C9EB2FC7138F6CE10075BB52 /* psort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB2FC5138F6CE10075BB52 /* psort_b.c */; settings = {COMPILER_FLAGS = "-DI_AM_PSORT_B"; }; }; + C9EB2FC8138F6CE10075BB52 /* psort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB2FC6138F6CE10075BB52 /* psort_r.c */; settings = {COMPILER_FLAGS = "-DI_AM_PSORT_R"; }; }; + C9EB2FD4138F6D880075BB52 /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CREAT"; }; }; + C9EB2FD5138F6D880075BB52 /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C9EB2FD6138F6D880075BB52 /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C9EB2FD7138F6D880075BB52 /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_KILLPG"; }; }; + C9EB2FD8138F6D880075BB52 /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C9EB2FD9138F6D880075BB52 /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C9EB2FDA138F6D880075BB52 /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C9EB2FDB138F6D880075BB52 /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C9EB2FDC138F6D880075BB52 /* setregid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360A138D9E980028D27C /* setregid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREGID"; }; }; + C9EB2FDD138F6D880075BB52 /* setreuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360B138D9E980028D27C /* setreuid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREUID"; }; }; + C9EB2FDE138F6D880075BB52 /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C9EB2FDF138F6D880075BB52 /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SIGPAUSE"; }; }; + C9EB2FE1138F6D880075BB52 /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C9EB2FE5138F6D880075BB52 /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C9EB2FE6138F6D880075BB52 /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; }; + C9EB2FE7138F6D880075BB52 /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; }; + C9EB2FE8138F6D880075BB52 /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; }; + C9EB2FE9138F6D880075BB52 /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; }; + C9EB2FEA138F6D880075BB52 /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; }; + C9EB2FEB138F6D880075BB52 /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; }; + C9EB2FEC138F6D880075BB52 /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; }; + C9EB2FED138F6D880075BB52 /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; }; + C9EB2FEE138F6D880075BB52 /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; }; + C9EB2FEF138F6D880075BB52 /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; }; + C9EB2FF0138F6D880075BB52 /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; }; + C9EB2FF1138F6D880075BB52 /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; }; + C9EB2FF2138F6D880075BB52 /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; }; + C9EB2FF3138F6D880075BB52 /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; }; + C9EB2FF4138F6D880075BB52 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; }; + C9EB2FF5138F6D880075BB52 /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; }; + C9EB2FF6138F6D880075BB52 /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; }; + C9EB2FF7138F6D880075BB52 /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; }; + C9EB2FF8138F6D880075BB52 /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; }; + C9EB2FF9138F6D880075BB52 /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; }; + C9EB2FFA138F6D880075BB52 /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; }; + C9EB2FFB138F6D880075BB52 /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; }; + C9EB2FFC138F6D880075BB52 /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; }; + C9EB2FFD138F6D880075BB52 /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; }; + C9EB2FFE138F6D880075BB52 /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; }; + C9EB2FFF138F6D880075BB52 /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; }; + C9EB3000138F6D880075BB52 /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; }; + C9EB3001138F6D880075BB52 /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; }; + C9EB3002138F6D880075BB52 /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; }; + C9EB3003138F6D880075BB52 /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; }; + C9EB3004138F6D880075BB52 /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C9EB3005138F6D880075BB52 /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C9EB3006138F6D880075BB52 /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C9EB3007138F6D880075BB52 /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C9EB3008138F6D880075BB52 /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C9EB3009138F6D880075BB52 /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C9EB300A138F6D880075BB52 /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C9EB300B138F6D880075BB52 /* _ldbl_util.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5368E138D9E980028D27C /* _ldbl_util.c */; }; + C9EB300C138F6D880075BB52 /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C9EB300D138F6D880075BB52 /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C9EB300E138F6D880075BB52 /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C9EB300F138F6D880075BB52 /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C9EB3010138F6D880075BB52 /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C9EB3011138F6D880075BB52 /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C9EB3012138F6D880075BB52 /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C9EB3013138F6D880075BB52 /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C9EB3014138F6D880075BB52 /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C9EB3015138F6D880075BB52 /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C9EB3016138F6D880075BB52 /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C9EB3017138F6D880075BB52 /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C9EB3018138F6D880075BB52 /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C9EB3019138F6D880075BB52 /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C9EB301A138F6D880075BB52 /* gdtoa-strtoIg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */; }; + C9EB301B138F6D880075BB52 /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C9EB301C138F6D880075BB52 /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C9EB301D138F6D880075BB52 /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C9EB301E138F6D880075BB52 /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C9EB301F138F6D880075BB52 /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C9EB3020138F6D880075BB52 /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C9EB3021138F6D880075BB52 /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C9EB3022138F6D880075BB52 /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C9EB3023138F6D880075BB52 /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C9EB3024138F6D880075BB52 /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C9EB302E138F6D880075BB52 /* authentication.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D5138D9E990028D27C /* authentication.c */; }; + C9EB302F138F6D880075BB52 /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C9EB3031138F6D880075BB52 /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_CONFSTR"; }; }; + C9EB3032138F6D880075BB52 /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_ENCRYPT -DLIBC_ALIAS_SETKEY"; }; }; + C9EB3033138F6D880075BB52 /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C9EB3034138F6D880075BB52 /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C9EB3035138F6D880075BB52 /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C9EB3036138F6D880075BB52 /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C9EB3037138F6D880075BB52 /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C9EB3038138F6D880075BB52 /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C9EB3039138F6D880075BB52 /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; }; + C9EB303A138F6D880075BB52 /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C9EB303B138F6D880075BB52 /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C9EB303C138F6D880075BB52 /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOCK"; }; }; + C9EB303D138F6D880075BB52 /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOSEDIR -include gen/__dirent.h"; }; }; + C9EB303E138F6D880075BB52 /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C9EB303F138F6D880075BB52 /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C9EB3040138F6D880075BB52 /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C9EB3041138F6D880075BB52 /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C9EB3042138F6D880075BB52 /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C9EB3043138F6D880075BB52 /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C9EB3044138F6D880075BB52 /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C9EB3045138F6D880075BB52 /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C9EB3046138F6D880075BB52 /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C9EB3047138F6D880075BB52 /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FNMATCH"; }; }; + C9EB3048138F6D880075BB52 /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C9EB3049138F6D880075BB52 /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C9EB304A138F6D880075BB52 /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C9EB304B138F6D880075BB52 /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; }; + C9EB304C138F6D880075BB52 /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C9EB304D138F6D880075BB52 /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C9EB304E138F6D880075BB52 /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; }; + C9EB304F138F6D880075BB52 /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; }; + C9EB3050138F6D880075BB52 /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C9EB3051138F6D880075BB52 /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C9EB3052138F6D880075BB52 /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; }; + C9EB3053138F6D880075BB52 /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C9EB3054138F6D880075BB52 /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C9EB3055138F6D880075BB52 /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C9EB3056138F6D880075BB52 /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_LOCKF"; }; }; + C9EB3057138F6D880075BB52 /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C9EB3058138F6D880075BB52 /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C9EB3059138F6D880075BB52 /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_NICE"; }; }; + C9EB305A138F6D880075BB52 /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C9EB305B138F6D880075BB52 /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS___OPENDIR2 -DLIBC_ALIAS_OPENDIR -include gen/__dirent.h"; }; }; + C9EB305C138F6D880075BB52 /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PAUSE"; }; }; + C9EB305D138F6D880075BB52 /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_POPEN"; }; }; + C9EB305F138F6D880075BB52 /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C9EB3060138F6D880075BB52 /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + C9EB3061138F6D880075BB52 /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C9EB3062138F6D880075BB52 /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C9EB3063138F6D880075BB52 /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REWINDDIR -include gen/__dirent.h"; }; }; + C9EB3064138F6D880075BB52 /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C9EB3065138F6D880075BB52 /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C9EB3066138F6D880075BB52 /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEEKDIR -include gen/__dirent.h"; }; }; + C9EB3067138F6D880075BB52 /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C9EB3068138F6D880075BB52 /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SETMODE"; }; }; + C9EB3069138F6D880075BB52 /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C9EB306A138F6D880075BB52 /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C9EB306B138F6D880075BB52 /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C9EB306C138F6D880075BB52 /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C9EB306D138F6D880075BB52 /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SLEEP"; }; }; + C9EB306E138F6D880075BB52 /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C9EB306F138F6D880075BB52 /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C9EB3070138F6D880075BB52 /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C9EB3071138F6D880075BB52 /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; }; + C9EB3072138F6D880075BB52 /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; }; + C9EB3073138F6D880075BB52 /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C9EB3074138F6D880075BB52 /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS__SEEKDIR -DLIBC_ALIAS_TELLDIR -include gen/__dirent.h"; }; }; + C9EB3075138F6D880075BB52 /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TCDRAIN"; }; }; + C9EB3076138F6D880075BB52 /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C9EB3077138F6D880075BB52 /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C9EB3078138F6D880075BB52 /* timezone.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A4138D9E990028D27C /* timezone.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C9EB3079138F6D880075BB52 /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TTYNAME_R"; }; }; + C9EB307A138F6D880075BB52 /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C9EB307B138F6D880075BB52 /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C9EB307C138F6D880075BB52 /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C9EB307D138F6D880075BB52 /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C9EB307E138F6D880075BB52 /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_USLEEP"; }; }; + C9EB307F138F6D880075BB52 /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C9EB3080138F6D880075BB52 /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C9EB3081138F6D880075BB52 /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAIT"; }; }; + C9EB3082138F6D880075BB52 /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C9EB3083138F6D880075BB52 /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAITPID"; }; }; + C9EB3084138F6D880075BB52 /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; }; + C9EB3085138F6D880075BB52 /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C9EB3086138F6D880075BB52 /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C9EB3087138F6D880075BB52 /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C9EB3088138F6D880075BB52 /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C9EB3089138F6D880075BB52 /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C9EB308E138F6D880075BB52 /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_NANOSLEEP"; }; }; + C9EB308F138F6D880075BB52 /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C9EB3090138F6D880075BB52 /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_FTW -DLIBC_ALIAS_NFTW"; }; }; + C9EB3091138F6D880075BB52 /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C9EB3093138F6D880075BB52 /* oldsyslog.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537EA138D9E990028D27C /* oldsyslog.c */; }; + C9EB3096138F6D880075BB52 /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C9EB3097138F6D880075BB52 /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C9EB309A138F6D880075BB52 /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C9EB309C138F6D880075BB52 /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C9EB309D138F6D880075BB52 /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C9EB309E138F6D880075BB52 /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C9EB309F138F6D880075BB52 /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + C9EB30A1138F6D880075BB52 /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C9EB30C1138F6D880075BB52 /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C9EB30C2138F6D880075BB52 /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C9EB30C3138F6D880075BB52 /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C9EB30C4138F6D880075BB52 /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; }; + C9EB30C5138F6D880075BB52 /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C9EB30C6138F6D880075BB52 /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C9EB30C7138F6D880075BB52 /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C9EB30C8138F6D880075BB52 /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C9EB30C9138F6D880075BB52 /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C9EB30CA138F6D880075BB52 /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C9EB30CB138F6D880075BB52 /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C9EB30CC138F6D880075BB52 /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C9EB30CD138F6D880075BB52 /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C9EB30CE138F6D880075BB52 /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C9EB30CF138F6D880075BB52 /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C9EB30D0138F6D880075BB52 /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C9EB30D1138F6D880075BB52 /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C9EB30D2138F6D880075BB52 /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C9EB30D3138F6D880075BB52 /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C9EB30D4138F6D880075BB52 /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C9EB30D5138F6D880075BB52 /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C9EB30D6138F6D880075BB52 /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C9EB30D7138F6D880075BB52 /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C9EB30D8138F6D880075BB52 /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C9EB30D9138F6D880075BB52 /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C9EB30DA138F6D880075BB52 /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C9EB30DB138F6D880075BB52 /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C9EB30DC138F6D880075BB52 /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C9EB30DD138F6D880075BB52 /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C9EB30DE138F6D880075BB52 /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C9EB30DF138F6D880075BB52 /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C9EB30E0138F6D880075BB52 /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; }; + C9EB30E1138F6D880075BB52 /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C9EB30E2138F6D880075BB52 /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C9EB30E3138F6D880075BB52 /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C9EB30E4138F6D880075BB52 /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C9EB30E5138F6D880075BB52 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C9EB30E6138F6D880075BB52 /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C9EB30E7138F6D880075BB52 /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WCSFTIME -DLIBC_ALIAS_WCSFTIME_L"; }; }; + C9EB30E8138F6D880075BB52 /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C9EB30E9138F6D880075BB52 /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C9EB30EA138F6D880075BB52 /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C9EB30EB138F6D880075BB52 /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C9EB30EC138F6D880075BB52 /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C9EB30ED138F6D880075BB52 /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C9EB30EE138F6D880075BB52 /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C9EB30EF138F6D880075BB52 /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C9EB30F0138F6D880075BB52 /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C9EB30F1138F6D880075BB52 /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C9EB30F2138F6D880075BB52 /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C9EB30F3138F6D880075BB52 /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C9EB30F4138F6D880075BB52 /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C9EB30F5138F6D880075BB52 /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C9EB30F6138F6D880075BB52 /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C9EB30F7138F6D880075BB52 /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C9EB30F8138F6D880075BB52 /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C9EB30F9138F6D880075BB52 /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; }; + C9EB30FA138F6D880075BB52 /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C9EB30FB138F6D880075BB52 /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C9EB30FC138F6D880075BB52 /* lconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E8138D9E990028D27C /* lconv.c */; }; + C9EB30FD138F6D880075BB52 /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; }; + C9EB30FE138F6D880075BB52 /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; }; + C9EB30FF138F6D880075BB52 /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; }; + C9EB3100138F6D880075BB52 /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C9EB3101138F6D880075BB52 /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C9EB3102138F6D880075BB52 /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C9EB3103138F6D880075BB52 /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C9EB3104138F6D880075BB52 /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C9EB3105138F6D880075BB52 /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C9EB3106138F6D880075BB52 /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C9EB3107138F6D880075BB52 /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C9EB3108138F6D880075BB52 /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C9EB3109138F6D880075BB52 /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C9EB310A138F6D880075BB52 /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C9EB310B138F6D880075BB52 /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C9EB310C138F6D880075BB52 /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C9EB310D138F6D880075BB52 /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C9EB310E138F6D880075BB52 /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_RECV"; }; }; + C9EB310F138F6D880075BB52 /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEND"; }; }; + C9EB3110138F6D880075BB52 /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C9EB3111138F6D880075BB52 /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C9EB3112138F6D880075BB52 /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C9EB3113138F6D880075BB52 /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C9EB3114138F6D880075BB52 /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C9EB3115138F6D880075BB52 /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C9EB3116138F6D880075BB52 /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C9EB3117138F6D880075BB52 /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C9EB3118138F6D880075BB52 /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C9EB312C138F6D880075BB52 /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C9EB313D138F6D880075BB52 /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C9EB313E138F6D880075BB52 /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C9EB313F138F6D880075BB52 /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C9EB3140138F6D880075BB52 /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C9EB3141138F6D880075BB52 /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C9EB3142138F6D880075BB52 /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FDOPEN"; }; }; + C9EB3143138F6D880075BB52 /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C9EB3144138F6D880075BB52 /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C9EB3145138F6D880075BB52 /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C9EB3146138F6D880075BB52 /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C9EB3147138F6D880075BB52 /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C9EB3148138F6D880075BB52 /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C9EB3149138F6D880075BB52 /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C9EB314A138F6D880075BB52 /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C9EB314B138F6D880075BB52 /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C9EB314C138F6D880075BB52 /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C9EB314D138F6D880075BB52 /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C9EB314E138F6D880075BB52 /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C9EB314F138F6D880075BB52 /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C9EB3150138F6D880075BB52 /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FOPEN"; }; }; + C9EB3151138F6D880075BB52 /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C9EB3152138F6D880075BB52 /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C9EB3153138F6D880075BB52 /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C9EB3154138F6D880075BB52 /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FPUTS"; }; }; + C9EB3155138F6D880075BB52 /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C9EB3156138F6D880075BB52 /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C9EB3157138F6D880075BB52 /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C9EB3158138F6D880075BB52 /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FREOPEN"; }; }; + C9EB3159138F6D880075BB52 /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C9EB315A138F6D880075BB52 /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C9EB315B138F6D880075BB52 /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C9EB315C138F6D880075BB52 /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C9EB315D138F6D880075BB52 /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C9EB315E138F6D880075BB52 /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C9EB315F138F6D880075BB52 /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C9EB3160138F6D880075BB52 /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C9EB3161138F6D880075BB52 /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C9EB3162138F6D880075BB52 /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FWRITE"; }; }; + C9EB3163138F6D880075BB52 /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C9EB3164138F6D880075BB52 /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C9EB3165138F6D880075BB52 /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C9EB3166138F6D880075BB52 /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C9EB3167138F6D880075BB52 /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C9EB3168138F6D880075BB52 /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C9EB3169138F6D880075BB52 /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C9EB316A138F6D880075BB52 /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C9EB316B138F6D880075BB52 /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C9EB316C138F6D880075BB52 /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C9EB316D138F6D880075BB52 /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C9EB316E138F6D880075BB52 /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C9EB316F138F6D880075BB52 /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C9EB3170138F6D880075BB52 /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C9EB3171138F6D880075BB52 /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C9EB3172138F6D880075BB52 /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C9EB3173138F6D880075BB52 /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C9EB3174138F6D880075BB52 /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C9EB3175138F6D880075BB52 /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C9EB3176138F6D880075BB52 /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C9EB3177138F6D880075BB52 /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C9EB3178138F6D880075BB52 /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C9EB3179138F6D880075BB52 /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C9EB317A138F6D880075BB52 /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C9EB317B138F6D880075BB52 /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C9EB317C138F6D880075BB52 /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C9EB317D138F6D880075BB52 /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C9EB317E138F6D880075BB52 /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C9EB317F138F6D880075BB52 /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C9EB3180138F6D880075BB52 /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C9EB3181138F6D880075BB52 /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C9EB3182138F6D880075BB52 /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C9EB3183138F6D880075BB52 /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C9EB3184138F6D880075BB52 /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C9EB3185138F6D880075BB52 /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TEMPNAM"; }; }; + C9EB3186138F6D880075BB52 /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -D_DARWIN_UNLIMITED_STREAMS"; }; }; + C9EB3187138F6D880075BB52 /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C9EB3188138F6D880075BB52 /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C9EB3189138F6D880075BB52 /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C9EB318A138F6D880075BB52 /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C9EB318B138F6D880075BB52 /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C9EB318C138F6D880075BB52 /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C9EB318D138F6D880075BB52 /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C9EB318E138F6D880075BB52 /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C9EB318F138F6D880075BB52 /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C9EB3190138F6D880075BB52 /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C9EB3191138F6D880075BB52 /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C9EB3192138F6D880075BB52 /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C9EB3193138F6D880075BB52 /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C9EB3194138F6D880075BB52 /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C9EB3195138F6D880075BB52 /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C9EB3196138F6D880075BB52 /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C9EB3197138F6D880075BB52 /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C9EB3198138F6D880075BB52 /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C9EB3199138F6D880075BB52 /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C9EB319A138F6D880075BB52 /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C9EB319B138F6D880075BB52 /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C9EB319C138F6D880075BB52 /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C9EB319D138F6D880075BB52 /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C9EB319E138F6D880075BB52 /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C9EB319F138F6D880075BB52 /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C9EB31A0138F6D880075BB52 /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C9EB31A1138F6D880075BB52 /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; }; + C9EB31A2138F6D880075BB52 /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C9EB31A3138F6D880075BB52 /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C9EB31A4138F6D880075BB52 /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C9EB31A5138F6D880075BB52 /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C9EB31A6138F6D880075BB52 /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C9EB31A7138F6D880075BB52 /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C9EB31A8138F6D880075BB52 /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; }; + C9EB31A9138F6D880075BB52 /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C9EB31AA138F6D880075BB52 /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_GETOPT"; }; }; + C9EB31AB138F6D880075BB52 /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C9EB31AC138F6D880075BB52 /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C9EB31AD138F6D880075BB52 /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C9EB31AE138F6D880075BB52 /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; }; + C9EB31AF138F6D880075BB52 /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C9EB31B0138F6D880075BB52 /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C9EB31B1138F6D880075BB52 /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C9EB31B2138F6D880075BB52 /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C9EB31B3138F6D880075BB52 /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C9EB31B4138F6D880075BB52 /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C9EB31B5138F6D880075BB52 /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C9EB31B6138F6D880075BB52 /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C9EB31B7138F6D880075BB52 /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C9EB31B8138F6D880075BB52 /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C9EB31B9138F6D880075BB52 /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; }; + C9EB31BA138F6D880075BB52 /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PUTENV"; }; }; + C9EB31BB138F6D880075BB52 /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; }; + C9EB31BC138F6D880075BB52 /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C9EB31BD138F6D880075BB52 /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C9EB31BE138F6D880075BB52 /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C9EB31BF138F6D880075BB52 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C9EB31C0138F6D880075BB52 /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; }; + C9EB31C1138F6D880075BB52 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C9EB31C2138F6D880075BB52 /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C9EB31C3138F6D880075BB52 /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C9EB31C4138F6D880075BB52 /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C9EB31C5138F6D880075BB52 /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C9EB31C6138F6D880075BB52 /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C9EB31C7138F6D880075BB52 /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C9EB31C8138F6D880075BB52 /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C9EB31C9138F6D880075BB52 /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C9EB31CA138F6D880075BB52 /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C9EB31CB138F6D880075BB52 /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C9EB31CC138F6D880075BB52 /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C9EB31CD138F6D880075BB52 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SYSTEM"; }; }; + C9EB31CE138F6D880075BB52 /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C9EB31CF138F6D880075BB52 /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C9EB31D0138F6D880075BB52 /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C9EB31D1138F6D880075BB52 /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C9EB31D2138F6D880075BB52 /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C9EB31D3138F6D880075BB52 /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C9EB31D4138F6D880075BB52 /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + C9EB31D5138F6D880075BB52 /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C9EB31D6138F6D880075BB52 /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C9EB31D7138F6D880075BB52 /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C9EB31D8138F6D880075BB52 /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C9EB31D9138F6D880075BB52 /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C9EB31DA138F6D880075BB52 /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C9EB31DB138F6D880075BB52 /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_MKTIME"; }; }; + C9EB31DC138F6D880075BB52 /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRFTIME -DLIBC_ALIAS_STRFTIME_L"; }; }; + C9EB31DD138F6D880075BB52 /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRPTIME -DLIBC_ALIAS_STRPTIME_L"; }; }; + C9EB31DE138F6D880075BB52 /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C9EB31DF138F6D880075BB52 /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C9EB31E0138F6D880075BB52 /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; settings = {COMPILER_FLAGS = "-D_DARWIN_UNLIMITED_STREAMS"; }; }; + C9EB31E1138F6D880075BB52 /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C9EB31EA138F6D880075BB52 /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C9EB31ED138F6D880075BB52 /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C9EB31F0138F6D880075BB52 /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C9EB31F1138F6D880075BB52 /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C9EB31F5138F6D880075BB52 /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C9EB31F7138F6D880075BB52 /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C9EB31F8138F6D880075BB52 /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; }; + C9EB31F9138F6D880075BB52 /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRERROR"; }; }; + C9EB31FD138F6D880075BB52 /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C9EB3201138F6D880075BB52 /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C9EB3203138F6D880075BB52 /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C9EB3204138F6D880075BB52 /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C9EB3205138F6D880075BB52 /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; }; + C9EB3206138F6D880075BB52 /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C9EB3207138F6D880075BB52 /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C9EB3208138F6D880075BB52 /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C9EB320A138F6D880075BB52 /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C9EB320B138F6D880075BB52 /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C9EB320C138F6D880075BB52 /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C9EB320D138F6D880075BB52 /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C9EB320E138F6D880075BB52 /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C9EB320F138F6D880075BB52 /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C9EB3210138F6D880075BB52 /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C9EB3211138F6D880075BB52 /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C9EB3212138F6D880075BB52 /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C9EB3213138F6D880075BB52 /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C9EB3214138F6D880075BB52 /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C9EB3215138F6D880075BB52 /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C9EB3216138F6D880075BB52 /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C9EB3217138F6D880075BB52 /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C9EB3218138F6D880075BB52 /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C9EB3219138F6D880075BB52 /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C9EB321A138F6D880075BB52 /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C9EB321B138F6D880075BB52 /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C9EB321C138F6D880075BB52 /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C9EB321D138F6D880075BB52 /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C9EB321E138F6D880075BB52 /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C9EB321F138F6D880075BB52 /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C9EB3220138F6D880075BB52 /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C9EB3221138F6D880075BB52 /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C9EB3222138F6D880075BB52 /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C9EB3223138F6D880075BB52 /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C9EB3224138F6D880075BB52 /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C9EB3225138F6D880075BB52 /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C9EB3226138F6D880075BB52 /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C9EB3227138F6D880075BB52 /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C9EB3228138F6D880075BB52 /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C9EB3229138F6D880075BB52 /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C9EB322A138F6D880075BB52 /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C9EB322B138F6D880075BB52 /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C9EB322C138F6D880075BB52 /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C9EB322D138F6D880075BB52 /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C9EB322F138F6D880075BB52 /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C9EB3231138F6D880075BB52 /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C9EB3232138F6D880075BB52 /* getgroups.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9F138D9E9A0028D27C /* getgroups.c */; }; + C9EB3234138F6D880075BB52 /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C9EB3235138F6D880075BB52 /* msgctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA6138D9E9A0028D27C /* msgctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_MSGCTL -DKERNEL"; }; }; + C9EB3236138F6D880075BB52 /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; }; + C9EB3237138F6D880075BB52 /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C9EB3238138F6D880075BB52 /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C9EB3239138F6D880075BB52 /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C9EB323A138F6D880075BB52 /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C9EB323B138F6D880075BB52 /* semctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB2138D9E9A0028D27C /* semctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SEMCTL -DKERNEL"; }; }; + C9EB323C138F6D880075BB52 /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C9EB323D138F6D880075BB52 /* shmctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB4138D9E9A0028D27C /* shmctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SHMCTL -DKERNEL"; }; }; + C9EB323E138F6D880075BB52 /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C9EB3242138F6D880075BB52 /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C9EB3243138F6D880075BB52 /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C9EB3247138F6D880075BB52 /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; }; + C9EB3248138F6D880075BB52 /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C9EB3249138F6D880075BB52 /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C9EB324A138F6D880075BB52 /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C9EB324B138F6D880075BB52 /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C9EB324C138F6D880075BB52 /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C9EB324D138F6D880075BB52 /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C9EB324E138F6D880075BB52 /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; }; + C9EB324F138F6D880075BB52 /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; }; + C9EB3250138F6D880075BB52 /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; }; + C9EB3251138F6D880075BB52 /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; }; + C9EB3252138F6D880075BB52 /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; }; + C9EB3253138F6D880075BB52 /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; }; + C9EB3254138F6D880075BB52 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; }; + C9EB3255138F6D880075BB52 /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; }; + C9EB3256138F6D880075BB52 /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; }; + C9EB327B138F75580075BB52 /* creat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535F8138D9E980028D27C /* creat.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CREAT"; }; }; + C9EB327C138F75580075BB52 /* gethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FC138D9E980028D27C /* gethostid.c */; }; + C9EB327D138F75580075BB52 /* getwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B535FE138D9E980028D27C /* getwd.c */; }; + C9EB327E138F75580075BB52 /* killpg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53601138D9E980028D27C /* killpg.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_KILLPG"; }; }; + C9EB327F138F75580075BB52 /* sethostid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53603138D9E980028D27C /* sethostid.c */; }; + C9EB3280138F75580075BB52 /* setpgrp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53604138D9E980028D27C /* setpgrp.c */; }; + C9EB3281138F75580075BB52 /* setrgid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53606138D9E980028D27C /* setrgid.c */; }; + C9EB3282138F75580075BB52 /* setruid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53608138D9E980028D27C /* setruid.c */; }; + C9EB3283138F75580075BB52 /* setregid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360A138D9E980028D27C /* setregid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREGID"; }; }; + C9EB3284138F75580075BB52 /* setreuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360B138D9E980028D27C /* setreuid.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SETREUID"; }; }; + C9EB3285138F75580075BB52 /* sigaltstk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360C138D9E980028D27C /* sigaltstk.c */; }; + C9EB3286138F75580075BB52 /* sigcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5360E138D9E980028D27C /* sigcompat.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SIGPAUSE"; }; }; + C9EB3288138F75580075BB52 /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C9EB328C138F75580075BB52 /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + C9EB328D138F75580075BB52 /* bt_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53620138D9E980028D27C /* bt_close.c */; }; + C9EB328E138F75580075BB52 /* bt_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53621138D9E980028D27C /* bt_conv.c */; }; + C9EB328F138F75580075BB52 /* bt_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53622138D9E980028D27C /* bt_debug.c */; }; + C9EB3290138F75580075BB52 /* bt_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53623138D9E980028D27C /* bt_delete.c */; }; + C9EB3291138F75580075BB52 /* bt_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53624138D9E980028D27C /* bt_get.c */; }; + C9EB3292138F75580075BB52 /* bt_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53625138D9E980028D27C /* bt_open.c */; }; + C9EB3293138F75580075BB52 /* bt_overflow.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53626138D9E980028D27C /* bt_overflow.c */; }; + C9EB3294138F75580075BB52 /* bt_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53628138D9E980028D27C /* bt_page.c */; }; + C9EB3295138F75580075BB52 /* bt_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53629138D9E980028D27C /* bt_put.c */; }; + C9EB3296138F75580075BB52 /* bt_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362A138D9E980028D27C /* bt_search.c */; }; + C9EB3297138F75580075BB52 /* bt_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362B138D9E980028D27C /* bt_seq.c */; }; + C9EB3298138F75580075BB52 /* bt_split.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362D138D9E980028D27C /* bt_split.c */; }; + C9EB3299138F75580075BB52 /* bt_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5362F138D9E980028D27C /* bt_utils.c */; }; + C9EB329A138F75580075BB52 /* db.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53636138D9E980028D27C /* db.c */; }; + C9EB329B138F75580075BB52 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363B138D9E980028D27C /* hash.c */; }; + C9EB329C138F75580075BB52 /* hash_bigkey.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5363F138D9E980028D27C /* hash_bigkey.c */; }; + C9EB329D138F75580075BB52 /* hash_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53641138D9E980028D27C /* hash_buf.c */; }; + C9EB329E138F75580075BB52 /* hash_func.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53643138D9E980028D27C /* hash_func.c */; }; + C9EB329F138F75580075BB52 /* hash_log2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53645138D9E980028D27C /* hash_log2.c */; }; + C9EB32A0138F75580075BB52 /* hash_page.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53647138D9E980028D27C /* hash_page.c */; }; + C9EB32A1138F75580075BB52 /* ndbm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53649138D9E980028D27C /* ndbm.c */; }; + C9EB32A2138F75580075BB52 /* mpool.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5365A138D9E980028D27C /* mpool.c */; }; + C9EB32A3138F75580075BB52 /* rec_close.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53661138D9E980028D27C /* rec_close.c */; }; + C9EB32A4138F75580075BB52 /* rec_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53662138D9E980028D27C /* rec_delete.c */; }; + C9EB32A5138F75580075BB52 /* rec_get.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53663138D9E980028D27C /* rec_get.c */; }; + C9EB32A6138F75580075BB52 /* rec_open.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53664138D9E980028D27C /* rec_open.c */; }; + C9EB32A7138F75580075BB52 /* rec_put.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53665138D9E980028D27C /* rec_put.c */; }; + C9EB32A8138F75580075BB52 /* rec_search.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53666138D9E980028D27C /* rec_search.c */; }; + C9EB32A9138F75580075BB52 /* rec_seq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53667138D9E980028D27C /* rec_seq.c */; }; + C9EB32AA138F75580075BB52 /* rec_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53668138D9E980028D27C /* rec_utils.c */; }; + C9EB32AB138F75580075BB52 /* brk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5366E138D9E980028D27C /* brk.c */; }; + C9EB32AC138F75580075BB52 /* bsd_signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53670138D9E980028D27C /* bsd_signal.c */; }; + C9EB32AD138F75580075BB52 /* lchflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53672138D9E980028D27C /* lchflags.c */; }; + C9EB32AE138F75580075BB52 /* lchmod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53674138D9E980028D27C /* lchmod.c */; }; + C9EB32AF138F75580075BB52 /* lutimes.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53676138D9E980028D27C /* lutimes.c */; }; + C9EB32B0138F75580075BB52 /* statvfs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53679138D9E980028D27C /* statvfs.c */; }; + C9EB32B1138F75580075BB52 /* tcgetsid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5367B138D9E980028D27C /* tcgetsid.c */; }; + C9EB32B2138F75580075BB52 /* _ldbl_util.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5368E138D9E980028D27C /* _ldbl_util.c */; }; + C9EB32B3138F75580075BB52 /* _hdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53691138D9E980028D27C /* _hdtoa.c */; }; + C9EB32B4138F75580075BB52 /* _ldtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53693138D9E980028D27C /* _ldtoa.c */; }; + C9EB32B5138F75580075BB52 /* gdtoa-dmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53695138D9E980028D27C /* gdtoa-dmisc.c */; }; + C9EB32B6138F75580075BB52 /* gdtoa-dtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53696138D9E980028D27C /* gdtoa-dtoa.c */; }; + C9EB32B7138F75580075BB52 /* gdtoa-gdtoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */; }; + C9EB32B8138F75580075BB52 /* gdtoa-gethex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53698138D9E980028D27C /* gdtoa-gethex.c */; }; + C9EB32B9138F75580075BB52 /* gdtoa-gmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */; }; + C9EB32BA138F75580075BB52 /* gdtoa-hd_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */; }; + C9EB32BB138F75580075BB52 /* gdtoa-hexnan.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */; }; + C9EB32BC138F75580075BB52 /* gdtoa-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5369E138D9E980028D27C /* gdtoa-misc.c */; }; + C9EB32BD138F75580075BB52 /* gdtoa-smisc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A0138D9E980028D27C /* gdtoa-smisc.c */; }; + C9EB32BE138F75580075BB52 /* gdtoa-strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A1138D9E980028D27C /* gdtoa-strtod.c */; }; + C9EB32BF138F75580075BB52 /* gdtoa-strtodg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */; }; + C9EB32C0138F75580075BB52 /* gdtoa-strtof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A5138D9E980028D27C /* gdtoa-strtof.c */; }; + C9EB32C1138F75580075BB52 /* gdtoa-strtoIg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */; }; + C9EB32C2138F75580075BB52 /* gdtoa-strtopdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */; }; + C9EB32C3138F75580075BB52 /* gdtoa-strtopx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */; }; + C9EB32C4138F75580075BB52 /* gdtoa-strtord.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AC138D9E980028D27C /* gdtoa-strtord.c */; }; + C9EB32C5138F75580075BB52 /* gdtoa-sum.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AE138D9E980028D27C /* gdtoa-sum.c */; }; + C9EB32C6138F75580075BB52 /* gdtoa-ulp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536AF138D9E980028D27C /* gdtoa-ulp.c */; }; + C9EB32C7138F75580075BB52 /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B5138D9E980028D27C /* glue.c */; }; + C9EB32C8138F75580075BB52 /* machdep_ldisd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B6138D9E980028D27C /* machdep_ldisd.c */; }; + C9EB32C9138F75580075BB52 /* machdep_ldisdd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536B8138D9E980028D27C /* machdep_ldisdd.c */; }; + C9EB32CA138F75580075BB52 /* machdep_ldisQ.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BA138D9E980028D27C /* machdep_ldisQ.c */; }; + C9EB32CB138F75580075BB52 /* machdep_ldisx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536BB138D9E980028D27C /* machdep_ldisx.c */; }; + C9EB32D5138F75580075BB52 /* authentication.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D5138D9E990028D27C /* authentication.c */; }; + C9EB32D6138F75580075BB52 /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536D7138D9E990028D27C /* backtrace.c */; }; + C9EB32D8138F75580075BB52 /* confstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DB138D9E990028D27C /* confstr.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_CONFSTR"; }; }; + C9EB32D9138F75580075BB52 /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DD138D9E990028D27C /* crypt.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_ENCRYPT -DLIBC_ALIAS_SETKEY"; }; }; + C9EB32DA138F75580075BB52 /* devname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536DF138D9E990028D27C /* devname.c */; }; + C9EB32DB138F75580075BB52 /* disklabel.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E1138D9E990028D27C /* disklabel.c */; }; + C9EB32DC138F75580075BB52 /* errlst.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E2138D9E990028D27C /* errlst.c */; }; + C9EB32DD138F75580075BB52 /* filesec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E4138D9E990028D27C /* filesec.c */; }; + C9EB32DE138F75580075BB52 /* _rand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536E6138D9E990028D27C /* _rand48.c */; }; + C9EB32DF138F75580075BB52 /* alarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EA138D9E990028D27C /* alarm.c */; }; + C9EB32E0138F75580075BB52 /* arc4random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EC138D9E990028D27C /* arc4random.c */; }; + C9EB32E1138F75580075BB52 /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536EE138D9E990028D27C /* assert.c */; }; + C9EB32E2138F75580075BB52 /* basename.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F2138D9E990028D27C /* basename.c */; }; + C9EB32E3138F75580075BB52 /* clock.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F5138D9E990028D27C /* clock.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOCK"; }; }; + C9EB32E4138F75580075BB52 /* closedir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536F6138D9E990028D27C /* closedir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_CLOSEDIR -include gen/__dirent.h"; }; }; + C9EB32E5138F75580075BB52 /* ctermid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FA138D9E990028D27C /* ctermid.c */; }; + C9EB32E6138F75580075BB52 /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B536FD138D9E990028D27C /* daemon.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C9EB32E7138F75580075BB52 /* dirname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53701138D9E990028D27C /* dirname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C9EB32E8138F75580075BB52 /* drand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53703138D9E990028D27C /* drand48.c */; }; + C9EB32E9138F75580075BB52 /* erand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53705138D9E990028D27C /* erand48.c */; }; + C9EB32EA138F75580075BB52 /* err.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53709138D9E990028D27C /* err.c */; }; + C9EB32EB138F75580075BB52 /* exec.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5370D138D9E990028D27C /* exec.c */; }; + C9EB32EC138F75580075BB52 /* fmtcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53710138D9E990028D27C /* fmtcheck.c */; }; + C9EB32ED138F75580075BB52 /* fmtmsg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53712138D9E990028D27C /* fmtmsg.c */; }; + C9EB32EE138F75580075BB52 /* fnmatch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53716138D9E990028D27C /* fnmatch.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FNMATCH"; }; }; + C9EB32EF138F75580075BB52 /* ftok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371A138D9E990028D27C /* ftok.c */; }; + C9EB32F0138F75580075BB52 /* getbsize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371C138D9E990028D27C /* getbsize.c */; }; + C9EB32F1138F75580075BB52 /* getcap.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5371E138D9E990028D27C /* getcap.c */; }; + C9EB32F2138F75580075BB52 /* getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53722138D9E990028D27C /* getcwd.c */; }; + C9EB32F3138F75580075BB52 /* gethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53726138D9E990028D27C /* gethostname.c */; }; + C9EB32F4138F75580075BB52 /* getlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53728138D9E990028D27C /* getlogin.c */; }; + C9EB32F5138F75580075BB52 /* getmntinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372C138D9E990028D27C /* getmntinfo.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C9EB32F6138F75580075BB52 /* getpagesize.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5372F138D9E990028D27C /* getpagesize.c */; }; + C9EB32F7138F75580075BB52 /* getpeereid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53732138D9E990028D27C /* getpeereid.c */; }; + C9EB32F8138F75580075BB52 /* getprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53735138D9E990028D27C /* getprogname.c */; }; + C9EB32F9138F75580075BB52 /* glob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53739138D9E990028D27C /* glob.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_GLOB"; }; }; + C9EB32FA138F75580075BB52 /* isatty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373B138D9E990028D27C /* isatty.c */; }; + C9EB32FB138F75580075BB52 /* jrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373D138D9E990028D27C /* jrand48.c */; }; + C9EB32FC138F75580075BB52 /* lcong48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5373F138D9E990028D27C /* lcong48.c */; }; + C9EB32FD138F75580075BB52 /* lockf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53743138D9E990028D27C /* lockf.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_LOCKF"; }; }; + C9EB32FE138F75580075BB52 /* lrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53745138D9E990028D27C /* lrand48.c */; }; + C9EB32FF138F75580075BB52 /* mrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53749138D9E990028D27C /* mrand48.c */; }; + C9EB3300138F75580075BB52 /* nice.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374C138D9E990028D27C /* nice.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_NICE"; }; }; + C9EB3301138F75580075BB52 /* nrand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5374E138D9E990028D27C /* nrand48.c */; }; + C9EB3302138F75580075BB52 /* opendir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53750138D9E990028D27C /* opendir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS___OPENDIR2 -DLIBC_ALIAS_OPENDIR -include gen/__dirent.h"; }; }; + C9EB3303138F75580075BB52 /* pause.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53753138D9E990028D27C /* pause.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PAUSE"; }; }; + C9EB3304138F75580075BB52 /* popen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53757138D9E990028D27C /* popen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_POPEN"; }; }; + C9EB3306138F75580075BB52 /* psignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5375F138D9E990028D27C /* psignal.c */; }; + C9EB3307138F75580075BB52 /* raise.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53761138D9E990028D27C /* raise.c */; }; + C9EB3308138F75580075BB52 /* readdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53766138D9E990028D27C /* readdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C9EB3309138F75580075BB52 /* readpassphrase.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53769138D9E990028D27C /* readpassphrase.c */; }; + C9EB330A138F75580075BB52 /* rewinddir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376B138D9E990028D27C /* rewinddir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REWINDDIR -include gen/__dirent.h"; }; }; + C9EB330B138F75580075BB52 /* scandir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5376E138D9E990028D27C /* scandir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C9EB330C138F75580075BB52 /* seed48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53771138D9E990028D27C /* seed48.c */; }; + C9EB330D138F75580075BB52 /* seekdir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53773138D9E990028D27C /* seekdir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEEKDIR -include gen/__dirent.h"; }; }; + C9EB330E138F75580075BB52 /* sethostname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53774138D9E990028D27C /* sethostname.c */; }; + C9EB330F138F75580075BB52 /* setmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53776138D9E990028D27C /* setmode.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SETMODE"; }; }; + C9EB3310138F75580075BB52 /* setprogname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53778138D9E990028D27C /* setprogname.c */; }; + C9EB3311138F75580075BB52 /* siginterrupt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377C138D9E990028D27C /* siginterrupt.c */; }; + C9EB3312138F75580075BB52 /* siglist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5377D138D9E990028D27C /* siglist.c */; }; + C9EB3313138F75580075BB52 /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53781138D9E990028D27C /* signal.c */; }; + C9EB3314138F75580075BB52 /* sleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53787138D9E990028D27C /* sleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SLEEP"; }; }; + C9EB3315138F75580075BB52 /* srand48.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53789138D9E990028D27C /* srand48.c */; }; + C9EB3316138F75580075BB52 /* stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378C138D9E990028D27C /* stringlist.c */; }; + C9EB3317138F75580075BB52 /* sysconf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5378E138D9E990028D27C /* sysconf.c */; }; + C9EB3318138F75580075BB52 /* sysctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53792138D9E990028D27C /* sysctl.c */; }; + C9EB3319138F75580075BB52 /* sysctlbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53794138D9E990028D27C /* sysctlbyname.c */; }; + C9EB331A138F75580075BB52 /* sysctlnametomib.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53795138D9E990028D27C /* sysctlnametomib.c */; }; + C9EB331B138F75580075BB52 /* telldir.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53796138D9E990028D27C /* telldir.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS__SEEKDIR -DLIBC_ALIAS_TELLDIR -include gen/__dirent.h"; }; }; + C9EB331C138F75580075BB52 /* termios.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379A138D9E990028D27C /* termios.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TCDRAIN"; }; }; + C9EB331D138F75580075BB52 /* time.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5379E138D9E990028D27C /* time.c */; }; + C9EB331E138F75580075BB52 /* times.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A2138D9E990028D27C /* times.c */; }; + C9EB331F138F75580075BB52 /* timezone.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A4138D9E990028D27C /* timezone.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS)"; }; }; + C9EB3320138F75580075BB52 /* ttyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A7138D9E990028D27C /* ttyname.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TTYNAME_R"; }; }; + C9EB3321138F75580075BB52 /* ttyslot.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537A9138D9E990028D27C /* ttyslot.c */; }; + C9EB3322138F75580075BB52 /* ualarm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537AC138D9E990028D27C /* ualarm.c */; }; + C9EB3323138F75580075BB52 /* ulimit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B0138D9E990028D27C /* ulimit.c */; }; + C9EB3324138F75580075BB52 /* unvis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B2138D9E990028D27C /* unvis.c */; }; + C9EB3325138F75580075BB52 /* usleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537B6138D9E990028D27C /* usleep.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_USLEEP"; }; }; + C9EB3326138F75580075BB52 /* utime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BA138D9E990028D27C /* utime.c */; }; + C9EB3327138F75580075BB52 /* vis.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BC138D9E990028D27C /* vis.c */; }; + C9EB3328138F75580075BB52 /* wait.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537BE138D9E990028D27C /* wait.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAIT"; }; }; + C9EB3329138F75580075BB52 /* wait3.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C0138D9E990028D27C /* wait3.c */; }; + C9EB332A138F75580075BB52 /* waitpid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C1138D9E990028D27C /* waitpid.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WAITPID"; }; }; + C9EB332B138F75580075BB52 /* fts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C4138D9E990028D27C /* fts.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_FTS_CHILDREN -DLIBC_ALIAS_FTS_CLOSE -DLIBC_ALIAS_FTS_OPEN -DLIBC_ALIAS_FTS_OPEN_B -DLIBC_ALIAS_FTS_READ -DLIBC_ALIAS_FTS_SET"; }; }; + C9EB332C138F75580075BB52 /* get_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537C6138D9E990028D27C /* get_compat.c */; }; + C9EB332D138F75580075BB52 /* getloadavg.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CA138D9E990028D27C /* getloadavg.c */; }; + C9EB332E138F75580075BB52 /* getttyent.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CC138D9E990028D27C /* getttyent.c */; }; + C9EB332F138F75580075BB52 /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537CE138D9E990028D27C /* getusershell.c */; }; + C9EB3330138F75580075BB52 /* getvfsbyname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537D0138D9E990028D27C /* getvfsbyname.c */; }; + C9EB3335138F75580075BB52 /* nanosleep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537DC138D9E990028D27C /* nanosleep.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_NANOSLEEP"; }; }; + C9EB3336138F75580075BB52 /* utmpx.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E4138D9E990028D27C /* utmpx.c */; }; + C9EB3337138F75580075BB52 /* nftw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E6138D9E990028D27C /* nftw.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_FTW -DLIBC_ALIAS_NFTW"; }; }; + C9EB3338138F75580075BB52 /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C9EB333A138F75580075BB52 /* oldsyslog.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537EA138D9E990028D27C /* oldsyslog.c */; }; + C9EB333D138F75580075BB52 /* setlogin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F2138D9E990028D27C /* setlogin.c */; }; + C9EB333E138F75580075BB52 /* sigsetops.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F4138D9E990028D27C /* sigsetops.c */; }; + C9EB3341138F75580075BB52 /* strtofflags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537F9138D9E990028D27C /* strtofflags.c */; }; + C9EB3343138F75580075BB52 /* thread_stack_pcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53800138D9E990028D27C /* thread_stack_pcs.c */; }; + C9EB3344138F75580075BB52 /* uname.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53803138D9E990028D27C /* uname.c */; }; + C9EB3345138F75580075BB52 /* utmpx-darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53804138D9E990028D27C /* utmpx-darwin.c */; }; + C9EB3346138F75580075BB52 /* wordexp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53808138D9E990028D27C /* wordexp.c */; }; + C9EB3348138F75580075BB52 /* gmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5380B138D9E990028D27C /* gmon.c */; }; + C9EB3368138F75580075BB52 /* ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53902138D9E990028D27C /* ascii.c */; }; + C9EB3369138F75580075BB52 /* big5.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53905138D9E990028D27C /* big5.c */; }; + C9EB336A138F75580075BB52 /* btowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53909138D9E990028D27C /* btowc.c */; }; + C9EB336B138F75580075BB52 /* collate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390B138D9E990028D27C /* collate.c */; }; + C9EB336C138F75580075BB52 /* collcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5390F138D9E990028D27C /* collcmp.c */; }; + C9EB336D138F75580075BB52 /* euc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53916138D9E990028D27C /* euc.c */; }; + C9EB336E138F75580075BB52 /* fix_grouping.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53918138D9E990028D27C /* fix_grouping.c */; }; + C9EB336F138F75580075BB52 /* gb18030.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391B138D9E990028D27C /* gb18030.c */; }; + C9EB3370138F75580075BB52 /* gb2312.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5391E138D9E990028D27C /* gb2312.c */; }; + C9EB3371138F75580075BB52 /* gbk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53921138D9E990028D27C /* gbk.c */; }; + C9EB3372138F75580075BB52 /* ldpart.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53946138D9E990028D27C /* ldpart.c */; }; + C9EB3373138F75580075BB52 /* lmessages.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394A138D9E990028D27C /* lmessages.c */; }; + C9EB3374138F75580075BB52 /* lmonetary.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5394E138D9E990028D27C /* lmonetary.c */; }; + C9EB3375138F75580075BB52 /* lnumeric.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53952138D9E990028D27C /* lnumeric.c */; }; + C9EB3376138F75580075BB52 /* localeconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53958138D9E990028D27C /* localeconv.c */; }; + C9EB3377138F75580075BB52 /* mblen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5395C138D9E990028D27C /* mblen.c */; }; + C9EB3378138F75580075BB52 /* mbrlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53962138D9E990028D27C /* mbrlen.c */; }; + C9EB3379138F75580075BB52 /* mbrtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53966138D9E990028D27C /* mbrtowc.c */; }; + C9EB337A138F75580075BB52 /* mbsinit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396A138D9E990028D27C /* mbsinit.c */; }; + C9EB337B138F75580075BB52 /* mbsnrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5396C138D9E990028D27C /* mbsnrtowcs.c */; }; + C9EB337C138F75580075BB52 /* mbsrtowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53970138D9E990028D27C /* mbsrtowcs.c */; }; + C9EB337D138F75580075BB52 /* mbstowcs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53974138D9E990028D27C /* mbstowcs.c */; }; + C9EB337E138F75580075BB52 /* mbtowc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53978138D9E990028D27C /* mbtowc.c */; }; + C9EB337F138F75580075BB52 /* mskanji.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5397B138D9E990028D27C /* mskanji.c */; }; + C9EB3380138F75580075BB52 /* nextwctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53980138D9E990028D27C /* nextwctype.c */; }; + C9EB3381138F75580075BB52 /* nl_langinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53984138D9E990028D27C /* nl_langinfo.c */; }; + C9EB3382138F75580075BB52 /* nomacros.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53986138D9E990028D27C /* nomacros.c */; }; + C9EB3383138F75580075BB52 /* none.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53987138D9E990028D27C /* none.c */; }; + C9EB3384138F75580075BB52 /* rune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53989138D9E990028D27C /* rune.c */; }; + C9EB3385138F75580075BB52 /* runetype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398B138D9E990028D27C /* runetype.c */; }; + C9EB3386138F75580075BB52 /* setlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5398F138D9E990028D27C /* setlocale.c */; }; + C9EB3387138F75580075BB52 /* setrunelocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53993138D9E990028D27C /* setrunelocale.c */; }; + C9EB3388138F75580075BB52 /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53995138D9E990028D27C /* table.c */; }; + C9EB3389138F75580075BB52 /* tolower.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399A138D9E990028D27C /* tolower.c */; }; + C9EB338A138F75580075BB52 /* toupper.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B5399E138D9E990028D27C /* toupper.c */; }; + C9EB338B138F75580075BB52 /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C9EB338C138F75580075BB52 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539A6138D9E990028D27C /* utf8.c */; }; + C9EB338D138F75580075BB52 /* wcrtomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AA138D9E990028D27C /* wcrtomb.c */; }; + C9EB338E138F75580075BB52 /* wcsftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539AE138D9E990028D27C /* wcsftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_WCSFTIME -DLIBC_ALIAS_WCSFTIME_L"; }; }; + C9EB338F138F75580075BB52 /* wcsnrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B0138D9E990028D27C /* wcsnrtombs.c */; }; + C9EB3390138F75580075BB52 /* wcsrtombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B4138D9E990028D27C /* wcsrtombs.c */; }; + C9EB3391138F75580075BB52 /* wcstod.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539B8138D9E990028D27C /* wcstod.c */; }; + C9EB3392138F75580075BB52 /* wcstof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BA138D9E990028D27C /* wcstof.c */; }; + C9EB3393138F75580075BB52 /* wcstoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539BC138D9E990028D27C /* wcstoimax.c */; }; + C9EB3394138F75580075BB52 /* wcstol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C0138D9E990028D27C /* wcstol.c */; }; + C9EB3395138F75580075BB52 /* wcstold.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C2138D9E990028D27C /* wcstold.c */; }; + C9EB3396138F75580075BB52 /* wcstoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C4138D9E990028D27C /* wcstoll.c */; }; + C9EB3397138F75580075BB52 /* wcstombs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539C8138D9E990028D27C /* wcstombs.c */; }; + C9EB3398138F75580075BB52 /* wcstoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CA138D9E990028D27C /* wcstoul.c */; }; + C9EB3399138F75580075BB52 /* wcstoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CC138D9E990028D27C /* wcstoull.c */; }; + C9EB339A138F75580075BB52 /* wcstoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539CE138D9E990028D27C /* wcstoumax.c */; }; + C9EB339B138F75580075BB52 /* wctob.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D0138D9E990028D27C /* wctob.c */; }; + C9EB339C138F75580075BB52 /* wctomb.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D4138D9E990028D27C /* wctomb.c */; }; + C9EB339D138F75580075BB52 /* wctrans.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539D8138D9E990028D27C /* wctrans.c */; }; + C9EB339E138F75580075BB52 /* wctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539DC138D9E990028D27C /* wctype.c */; }; + C9EB339F138F75580075BB52 /* wcwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E0138D9E990028D27C /* wcwidth.c */; }; + C9EB33A0138F75580075BB52 /* frune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E3138D9E990028D27C /* frune.c */; }; + C9EB33A1138F75580075BB52 /* isctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E5138D9E990028D27C /* isctype.c */; }; + C9EB33A2138F75580075BB52 /* iswctype.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E7138D9E990028D27C /* iswctype.c */; }; + C9EB33A3138F75580075BB52 /* lconv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539E8138D9E990028D27C /* lconv.c */; }; + C9EB33A4138F75580075BB52 /* mbrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EB138D9E990028D27C /* mbrune.c */; }; + C9EB33A5138F75580075BB52 /* runedepreciated.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539EF138D9E990028D27C /* runedepreciated.c */; }; + C9EB33A6138F75580075BB52 /* setinvalidrune.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F1138D9E990028D27C /* setinvalidrune.c */; }; + C9EB33A7138F75580075BB52 /* xlocale.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B539F7138D9E990028D27C /* xlocale.c */; }; + C9EB33A8138F75580075BB52 /* addr2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A16138D9E990028D27C /* addr2ascii.c */; }; + C9EB33A9138F75580075BB52 /* ascii2addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A17138D9E990028D27C /* ascii2addr.c */; }; + C9EB33AA138F75580075BB52 /* inet_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1A138D9E990028D27C /* inet_addr.c */; }; + C9EB33AB138F75580075BB52 /* inet_lnaof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1C138D9E990028D27C /* inet_lnaof.c */; }; + C9EB33AC138F75580075BB52 /* inet_makeaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A1D138D9E990028D27C /* inet_makeaddr.c */; }; + C9EB33AD138F75580075BB52 /* inet_net_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A20138D9E990028D27C /* inet_net_ntop.c */; }; + C9EB33AE138F75580075BB52 /* inet_net_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A21138D9E990028D27C /* inet_net_pton.c */; }; + C9EB33AF138F75580075BB52 /* inet_neta.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A23138D9E990028D27C /* inet_neta.c */; }; + C9EB33B0138F75580075BB52 /* inet_netof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A24138D9E990028D27C /* inet_netof.c */; }; + C9EB33B1138F75580075BB52 /* inet_network.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A25138D9E990028D27C /* inet_network.c */; }; + C9EB33B2138F75580075BB52 /* inet_ntoa.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A27138D9E990028D27C /* inet_ntoa.c */; }; + C9EB33B3138F75580075BB52 /* linkaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2A138D9E990028D27C /* linkaddr.c */; }; + C9EB33B4138F75580075BB52 /* nsap_addr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2B138D9E990028D27C /* nsap_addr.c */; }; + C9EB33B5138F75580075BB52 /* recv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2D138D9E990028D27C /* recv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_RECV"; }; }; + C9EB33B6138F75580075BB52 /* send.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A2F138D9E990028D27C /* send.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SEND"; }; }; + C9EB33B7138F75580075BB52 /* sockatmark.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A33138D9E990028D27C /* sockatmark.c */; }; + C9EB33B8138F75580075BB52 /* sourcefilter.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A36138D9E990028D27C /* sourcefilter.c */; }; + C9EB33B9138F75580075BB52 /* msgcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A3F138D9E990028D27C /* msgcat.c */; }; + C9EB33BA138F75580075BB52 /* acl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A4C138D9E990028D27C /* acl.c */; }; + C9EB33BB138F75580075BB52 /* acl_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A59138D9E990028D27C /* acl_entry.c */; }; + C9EB33BC138F75580075BB52 /* acl_file.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5A138D9E990028D27C /* acl_file.c */; }; + C9EB33BD138F75580075BB52 /* acl_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A5B138D9E990028D27C /* acl_flag.c */; }; + C9EB33BE138F75580075BB52 /* acl_perm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A68138D9E990028D27C /* acl_perm.c */; }; + C9EB33BF138F75580075BB52 /* acl_translate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53A6F138D9E990028D27C /* acl_translate.c */; }; + C9EB33D3138F75580075BB52 /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B0E138D9E990028D27C /* regerror.c */; }; + C9EB33E4138F75580075BB52 /* _flock_stub.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B2F138D9E990028D27C /* _flock_stub.c */; }; + C9EB33E5138F75580075BB52 /* asprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B30138D9E990028D27C /* asprintf.c */; }; + C9EB33E6138F75580075BB52 /* clrerr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B32138D9E990028D27C /* clrerr.c */; }; + C9EB33E7138F75580075BB52 /* dprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B33138D9E990028D27C /* dprintf.c */; }; + C9EB33E8138F75580075BB52 /* fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B36138D9E990028D27C /* fclose.c */; }; + C9EB33E9138F75580075BB52 /* fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B38138D9E990028D27C /* fdopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FDOPEN"; }; }; + C9EB33EA138F75580075BB52 /* feof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3A138D9E990028D27C /* feof.c */; }; + C9EB33EB138F75580075BB52 /* ferror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3C138D9E990028D27C /* ferror.c */; }; + C9EB33EC138F75580075BB52 /* fflush.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B3E138D9E990028D27C /* fflush.c */; }; + C9EB33ED138F75580075BB52 /* fgetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B40138D9E990028D27C /* fgetc.c */; }; + C9EB33EE138F75580075BB52 /* fgetln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B43138D9E990028D27C /* fgetln.c */; }; + C9EB33EF138F75580075BB52 /* fgetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B45138D9E990028D27C /* fgetpos.c */; }; + C9EB33F0138F75580075BB52 /* fgets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B47138D9E990028D27C /* fgets.c */; }; + C9EB33F1138F75580075BB52 /* fgetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B48138D9E990028D27C /* fgetwc.c */; }; + C9EB33F2138F75580075BB52 /* fgetwln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B4C138D9E990028D27C /* fgetwln.c */; }; + C9EB33F3138F75580075BB52 /* fgetws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B50138D9E990028D27C /* fgetws.c */; }; + C9EB33F4138F75580075BB52 /* fileno.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B52138D9E990028D27C /* fileno.c */; }; + C9EB33F5138F75580075BB52 /* findfp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B53138D9E990028D27C /* findfp.c */; }; + C9EB33F6138F75580075BB52 /* flags.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B55138D9E990028D27C /* flags.c */; }; + C9EB33F7138F75580075BB52 /* fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5C138D9E990028D27C /* fopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FOPEN"; }; }; + C9EB33F8138F75580075BB52 /* fprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B5E138D9E990028D27C /* fprintf.c */; }; + C9EB33F9138F75580075BB52 /* fpurge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B60138D9E990028D27C /* fpurge.c */; }; + C9EB33FA138F75580075BB52 /* fputc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B61138D9E990028D27C /* fputc.c */; }; + C9EB33FB138F75580075BB52 /* fputs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B64138D9E990028D27C /* fputs.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FPUTS"; }; }; + C9EB33FC138F75580075BB52 /* fputwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B66138D9E990028D27C /* fputwc.c */; }; + C9EB33FD138F75580075BB52 /* fputws.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6A138D9E990028D27C /* fputws.c */; }; + C9EB33FE138F75580075BB52 /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B6E138D9E990028D27C /* fread.c */; }; + C9EB33FF138F75580075BB52 /* freopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B70138D9E990028D27C /* freopen.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FREOPEN"; }; }; + C9EB3400138F75580075BB52 /* fscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B72138D9E990028D27C /* fscanf.c */; }; + C9EB3401138F75580075BB52 /* fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B76138D9E990028D27C /* fseek.c */; }; + C9EB3402138F75580075BB52 /* fsetpos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B77138D9E990028D27C /* fsetpos.c */; }; + C9EB3403138F75580075BB52 /* ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B78138D9E990028D27C /* ftell.c */; }; + C9EB3404138F75580075BB52 /* funopen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7B138D9E990028D27C /* funopen.c */; }; + C9EB3405138F75580075BB52 /* fvwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7D138D9E990028D27C /* fvwrite.c */; }; + C9EB3406138F75580075BB52 /* fwalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B7F138D9E990028D27C /* fwalk.c */; }; + C9EB3407138F75580075BB52 /* fwide.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B82138D9E990028D27C /* fwide.c */; }; + C9EB3408138F75580075BB52 /* fwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B83138D9E990028D27C /* fwprintf.c */; }; + C9EB3409138F75580075BB52 /* fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B85138D9E990028D27C /* fwrite.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_FWRITE"; }; }; + C9EB340A138F75580075BB52 /* fwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B87138D9E990028D27C /* fwscanf.c */; }; + C9EB340B138F75580075BB52 /* getc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8B138D9E990028D27C /* getc.c */; }; + C9EB340C138F75580075BB52 /* getchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8C138D9E990028D27C /* getchar.c */; }; + C9EB340D138F75580075BB52 /* getdelim.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B8D138D9E990028D27C /* getdelim.c */; }; + C9EB340E138F75580075BB52 /* getline.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B90138D9E990028D27C /* getline.c */; }; + C9EB340F138F75580075BB52 /* gets.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B91138D9E990028D27C /* gets.c */; }; + C9EB3410138F75580075BB52 /* getw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B92138D9E990028D27C /* getw.c */; }; + C9EB3411138F75580075BB52 /* getwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B95138D9E990028D27C /* getwc.c */; }; + C9EB3412138F75580075BB52 /* getwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B97138D9E990028D27C /* getwchar.c */; }; + C9EB3413138F75580075BB52 /* makebuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53B9C138D9E990028D27C /* makebuf.c */; }; + C9EB3414138F75580075BB52 /* mktemp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA0138D9E990028D27C /* mktemp.c */; }; + C9EB3415138F75580075BB52 /* perror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA2138D9E990028D27C /* perror.c */; }; + C9EB3416138F75580075BB52 /* printf-pos.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA3138D9E990028D27C /* printf-pos.c */; }; + C9EB3417138F75580075BB52 /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BA7138D9E990028D27C /* printf.c */; }; + C9EB3418138F75580075BB52 /* putc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BAF138D9E990028D27C /* putc.c */; }; + C9EB3419138F75580075BB52 /* putchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB0138D9E990028D27C /* putchar.c */; }; + C9EB341A138F75580075BB52 /* puts.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB1138D9E990028D27C /* puts.c */; }; + C9EB341B138F75580075BB52 /* putw.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB3138D9E990028D27C /* putw.c */; }; + C9EB341C138F75580075BB52 /* putwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB6138D9E990028D27C /* putwc.c */; }; + C9EB341D138F75580075BB52 /* putwchar.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BB8138D9E990028D27C /* putwchar.c */; }; + C9EB341E138F75580075BB52 /* refill.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBA138D9E990028D27C /* refill.c */; }; + C9EB341F138F75580075BB52 /* remove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBE138D9E990028D27C /* remove.c */; }; + C9EB3420138F75580075BB52 /* rewind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BBF138D9E990028D27C /* rewind.c */; }; + C9EB3421138F75580075BB52 /* rget.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC1138D9E990028D27C /* rget.c */; }; + C9EB3422138F75580075BB52 /* scanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC4138D9E990028D27C /* scanf.c */; }; + C9EB3423138F75580075BB52 /* setbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC8138D9E990028D27C /* setbuf.c */; }; + C9EB3424138F75580075BB52 /* setbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BC9138D9E990028D27C /* setbuffer.c */; }; + C9EB3425138F75580075BB52 /* setvbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCA138D9E990028D27C /* setvbuf.c */; }; + C9EB3426138F75580075BB52 /* snprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCB138D9E990028D27C /* snprintf.c */; }; + C9EB3427138F75580075BB52 /* sprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCD138D9E990028D27C /* sprintf.c */; }; + C9EB3428138F75580075BB52 /* sscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BCF138D9E990028D27C /* sscanf.c */; }; + C9EB3429138F75580075BB52 /* stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD3138D9E990028D27C /* stdio.c */; }; + C9EB342A138F75580075BB52 /* swprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD4138D9E990028D27C /* swprintf.c */; }; + C9EB342B138F75580075BB52 /* swscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD6138D9E990028D27C /* swscanf.c */; }; + C9EB342C138F75580075BB52 /* tempnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BD8138D9E990028D27C /* tempnam.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_TEMPNAM"; }; }; + C9EB342D138F75580075BB52 /* tmpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDA138D9E990028D27C /* tmpfile.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -D_DARWIN_UNLIMITED_STREAMS"; }; }; + C9EB342E138F75580075BB52 /* tmpnam.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BDD138D9E990028D27C /* tmpnam.c */; }; + C9EB342F138F75580075BB52 /* ungetc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE1138D9E990028D27C /* ungetc.c */; }; + C9EB3430138F75580075BB52 /* ungetwc.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE4138D9E990028D27C /* ungetwc.c */; }; + C9EB3431138F75580075BB52 /* vasprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE6138D9E990028D27C /* vasprintf.c */; }; + C9EB3432138F75580075BB52 /* vdprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BE8138D9E990028D27C /* vdprintf.c */; }; + C9EB3433138F75580075BB52 /* vfprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEA138D9E990028D27C /* vfprintf.c */; }; + C9EB3434138F75580075BB52 /* vfscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEC138D9E990028D27C /* vfscanf.c */; }; + C9EB3435138F75580075BB52 /* vfwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BEE138D9E9A0028D27C /* vfwprintf.c */; }; + C9EB3436138F75580075BB52 /* vfwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF0138D9E9A0028D27C /* vfwscanf.c */; }; + C9EB3437138F75580075BB52 /* vprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF2138D9E9A0028D27C /* vprintf.c */; }; + C9EB3438138F75580075BB52 /* vscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF4138D9E9A0028D27C /* vscanf.c */; }; + C9EB3439138F75580075BB52 /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF6138D9E9A0028D27C /* vsnprintf.c */; }; + C9EB343A138F75580075BB52 /* vsprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BF8138D9E9A0028D27C /* vsprintf.c */; }; + C9EB343B138F75580075BB52 /* vsscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFA138D9E9A0028D27C /* vsscanf.c */; }; + C9EB343C138F75580075BB52 /* vswprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFC138D9E9A0028D27C /* vswprintf.c */; }; + C9EB343D138F75580075BB52 /* vswscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53BFE138D9E9A0028D27C /* vswscanf.c */; }; + C9EB343E138F75580075BB52 /* vwprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C00138D9E9A0028D27C /* vwprintf.c */; }; + C9EB343F138F75580075BB52 /* vwscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C02138D9E9A0028D27C /* vwscanf.c */; }; + C9EB3440138F75580075BB52 /* wbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C04138D9E9A0028D27C /* wbuf.c */; }; + C9EB3441138F75580075BB52 /* wprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C08138D9E9A0028D27C /* wprintf.c */; }; + C9EB3442138F75580075BB52 /* wscanf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0C138D9E9A0028D27C /* wscanf.c */; }; + C9EB3443138F75580075BB52 /* wsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C0E138D9E9A0028D27C /* wsetup.c */; }; + C9EB3444138F75580075BB52 /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C9EB3445138F75580075BB52 /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C9EB3446138F75580075BB52 /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C9EB3447138F75580075BB52 /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C9EB3448138F75580075BB52 /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; }; + C9EB3449138F75580075BB52 /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C9EB344A138F75580075BB52 /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C9EB344B138F75580075BB52 /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C9EB344C138F75580075BB52 /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C9EB344D138F75580075BB52 /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C9EB344E138F75580075BB52 /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C9EB344F138F75580075BB52 /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; }; + C9EB3450138F75580075BB52 /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C9EB3451138F75580075BB52 /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_GETOPT"; }; }; + C9EB3452138F75580075BB52 /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C9EB3453138F75580075BB52 /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C9EB3454138F75580075BB52 /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C9EB3455138F75580075BB52 /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; }; + C9EB3456138F75580075BB52 /* heapsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94357138EC0C600FB7ACC /* heapsort_b.c */; }; + C9EB3457138F75580075BB52 /* heapsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D94358138EC0C600FB7ACC /* heapsort_r.c */; }; + C9EB3458138F75580075BB52 /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C9EB3459138F75580075BB52 /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C9EB345A138F75580075BB52 /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C9EB345B138F75580075BB52 /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C9EB345C138F75580075BB52 /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C9EB345D138F75580075BB52 /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C9EB345E138F75580075BB52 /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C9EB345F138F75580075BB52 /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C9EB3460138F75580075BB52 /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; }; + C9EB3461138F75580075BB52 /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_PUTENV"; }; }; + C9EB3462138F75580075BB52 /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; }; + C9EB3463138F75580075BB52 /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C9EB3464138F75580075BB52 /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C9EB3465138F75580075BB52 /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C9EB3466138F75580075BB52 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C9EB3467138F75580075BB52 /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; }; + C9EB3468138F75580075BB52 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C9EB3469138F75580075BB52 /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C9EB346A138F75580075BB52 /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_REALPATH"; }; }; + C9EB346B138F75580075BB52 /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C9EB346C138F75580075BB52 /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C9EB346D138F75580075BB52 /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C9EB346E138F75580075BB52 /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C9EB346F138F75580075BB52 /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C9EB3470138F75580075BB52 /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C9EB3471138F75580075BB52 /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C9EB3472138F75580075BB52 /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C9EB3473138F75580075BB52 /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C9EB3474138F75580075BB52 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_SYSTEM"; }; }; + C9EB3475138F75580075BB52 /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C9EB3476138F75580075BB52 /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C9EB3477138F75580075BB52 /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C9EB3478138F75580075BB52 /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C9EB3479138F75580075BB52 /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C9EB347A138F75580075BB52 /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C9EB347B138F75580075BB52 /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + C9EB347C138F75580075BB52 /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C9EB347D138F75580075BB52 /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C9EB347E138F75580075BB52 /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C9EB347F138F75580075BB52 /* asctime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC2138D9E9A0028D27C /* asctime.c */; }; + C9EB3480138F75580075BB52 /* difftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC6138D9E9A0028D27C /* difftime.c */; }; + C9EB3481138F75580075BB52 /* ftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CC9138D9E9A0028D27C /* ftime.c */; }; + C9EB3482138F75580075BB52 /* localtime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCA138D9E9A0028D27C /* localtime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_MKTIME"; }; }; + C9EB3483138F75580075BB52 /* strftime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CCF138D9E9A0028D27C /* strftime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRFTIME -DLIBC_ALIAS_STRFTIME_L"; }; }; + C9EB3484138F75580075BB52 /* strptime.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD3138D9E9A0028D27C /* strptime.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRPTIME -DLIBC_ALIAS_STRPTIME_L"; }; }; + C9EB3485138F75580075BB52 /* time32.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD6138D9E9A0028D27C /* time32.c */; }; + C9EB3486138F75580075BB52 /* timelocal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CD7138D9E9A0028D27C /* timelocal.c */; }; + C9EB3487138F75580075BB52 /* getdate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE0138D9E9A0028D27C /* getdate.c */; settings = {COMPILER_FLAGS = "-D_DARWIN_UNLIMITED_STREAMS"; }; }; + C9EB3488138F75580075BB52 /* timezone_unix03.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */; }; + C9EB3491138F75580075BB52 /* memmem.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D06138D9E9A0028D27C /* memmem.c */; }; + C9EB3494138F75580075BB52 /* rindex.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D10138D9E9A0028D27C /* rindex.c */; }; + C9EB3497138F75580075BB52 /* strcasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D15138D9E9A0028D27C /* strcasecmp.c */; }; + C9EB3498138F75580075BB52 /* strcasestr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D17138D9E9A0028D27C /* strcasestr.c */; }; + C9EB349C138F75580075BB52 /* strcoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D26138D9E9A0028D27C /* strcoll.c */; }; + C9EB349E138F75580075BB52 /* strcspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D2D138D9E9A0028D27C /* strcspn.c */; }; + C9EB349F138F75580075BB52 /* strdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D30138D9E9A0028D27C /* strdup.c */; }; + C9EB34A0138F75580075BB52 /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D33138D9E9A0028D27C /* strerror.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -DLIBC_ALIAS_STRERROR"; }; }; + C9EB34A4138F75580075BB52 /* strmode.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D40138D9E9A0028D27C /* strmode.c */; }; + C9EB34A8138F75580075BB52 /* strndup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D44138D9E9A0028D27C /* strndup.c */; }; + C9EB34AA138F75580075BB52 /* strnstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D46138D9E9A0028D27C /* strnstr.c */; }; + C9EB34AB138F75580075BB52 /* strpbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D49138D9E9A0028D27C /* strpbrk.c */; }; + C9EB34AC138F75580075BB52 /* strrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4C138D9E9A0028D27C /* strrchr.c */; }; + C9EB34AD138F75580075BB52 /* strsep.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D4F138D9E9A0028D27C /* strsep.c */; }; + C9EB34AE138F75580075BB52 /* strsignal.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D50138D9E9A0028D27C /* strsignal.c */; }; + C9EB34AF138F75580075BB52 /* strspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D54138D9E9A0028D27C /* strspn.c */; }; + C9EB34B1138F75580075BB52 /* strtok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5A138D9E9A0028D27C /* strtok.c */; }; + C9EB34B2138F75580075BB52 /* strxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D5D138D9E9A0028D27C /* strxfrm.c */; }; + C9EB34B3138F75580075BB52 /* swab.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D61138D9E9A0028D27C /* swab.c */; }; + C9EB34B4138F75580075BB52 /* wcpcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D63138D9E9A0028D27C /* wcpcpy.c */; }; + C9EB34B5138F75580075BB52 /* wcpncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D64138D9E9A0028D27C /* wcpncpy.c */; }; + C9EB34B6138F75580075BB52 /* wcscasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D65138D9E9A0028D27C /* wcscasecmp.c */; }; + C9EB34B7138F75580075BB52 /* wcscat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D67138D9E9A0028D27C /* wcscat.c */; }; + C9EB34B8138F75580075BB52 /* wcschr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D68138D9E9A0028D27C /* wcschr.c */; }; + C9EB34B9138F75580075BB52 /* wcscmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D69138D9E9A0028D27C /* wcscmp.c */; }; + C9EB34BA138F75580075BB52 /* wcscoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6C138D9E9A0028D27C /* wcscoll.c */; }; + C9EB34BB138F75580075BB52 /* wcscpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6E138D9E9A0028D27C /* wcscpy.c */; }; + C9EB34BC138F75580075BB52 /* wcscspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D6F138D9E9A0028D27C /* wcscspn.c */; }; + C9EB34BD138F75580075BB52 /* wcsdup.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D70138D9E9A0028D27C /* wcsdup.c */; }; + C9EB34BE138F75580075BB52 /* wcslcat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D71138D9E9A0028D27C /* wcslcat.c */; }; + C9EB34BF138F75580075BB52 /* wcslcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D72138D9E9A0028D27C /* wcslcpy.c */; }; + C9EB34C0138F75580075BB52 /* wcslen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D73138D9E9A0028D27C /* wcslen.c */; }; + C9EB34C1138F75580075BB52 /* wcsncasecmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */; }; + C9EB34C2138F75580075BB52 /* wcsncat.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D76138D9E9A0028D27C /* wcsncat.c */; }; + C9EB34C3138F75580075BB52 /* wcsncmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D77138D9E9A0028D27C /* wcsncmp.c */; }; + C9EB34C4138F75580075BB52 /* wcsncpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D78138D9E9A0028D27C /* wcsncpy.c */; }; + C9EB34C5138F75580075BB52 /* wcsnlen.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D79138D9E9A0028D27C /* wcsnlen.c */; }; + C9EB34C6138F75580075BB52 /* wcspbrk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7A138D9E9A0028D27C /* wcspbrk.c */; }; + C9EB34C7138F75580075BB52 /* wcsrchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7B138D9E9A0028D27C /* wcsrchr.c */; }; + C9EB34C8138F75580075BB52 /* wcsspn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7C138D9E9A0028D27C /* wcsspn.c */; }; + C9EB34C9138F75580075BB52 /* wcsstr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D7D138D9E9A0028D27C /* wcsstr.c */; }; + C9EB34CA138F75580075BB52 /* wcstok.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D80138D9E9A0028D27C /* wcstok.c */; }; + C9EB34CB138F75580075BB52 /* wcswidth.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D83138D9E9A0028D27C /* wcswidth.c */; }; + C9EB34CC138F75580075BB52 /* wcsxfrm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D87138D9E9A0028D27C /* wcsxfrm.c */; }; + C9EB34CD138F75580075BB52 /* wmemchr.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8B138D9E9A0028D27C /* wmemchr.c */; }; + C9EB34CE138F75580075BB52 /* wmemcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8C138D9E9A0028D27C /* wmemcmp.c */; }; + C9EB34CF138F75580075BB52 /* wmemcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8D138D9E9A0028D27C /* wmemcpy.c */; }; + C9EB34D0138F75580075BB52 /* wmemmove.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8E138D9E9A0028D27C /* wmemmove.c */; }; + C9EB34D1138F75580075BB52 /* wmemset.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D8F138D9E9A0028D27C /* wmemset.c */; }; + C9EB34D2138F75580075BB52 /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C9EB34D3138F75580075BB52 /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C9EB34D4138F75580075BB52 /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C9EB34D6138F75580075BB52 /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C9EB34D8138F75580075BB52 /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C9EB34D9138F75580075BB52 /* getgroups.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9F138D9E9A0028D27C /* getgroups.c */; }; + C9EB34DB138F75580075BB52 /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C9EB34DC138F75580075BB52 /* msgctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA6138D9E9A0028D27C /* msgctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_MSGCTL -DKERNEL"; }; }; + C9EB34DD138F75580075BB52 /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; }; + C9EB34DE138F75580075BB52 /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C9EB34DF138F75580075BB52 /* OSMemoryNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */; }; + C9EB34E0138F75580075BB52 /* OSThermalNotification.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */; }; + C9EB34E1138F75580075BB52 /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C9EB34E2138F75580075BB52 /* semctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB2138D9E9A0028D27C /* semctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SEMCTL -DKERNEL"; }; }; + C9EB34E3138F75580075BB52 /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C9EB34E4138F75580075BB52 /* shmctl.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB4138D9E9A0028D27C /* shmctl.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_SHMCTL -DKERNEL"; }; }; + C9EB34E5138F75580075BB52 /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C9EB34E9138F75580075BB52 /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C9EB34EA138F75580075BB52 /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C9EB34EE138F75580075BB52 /* fparseln.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DC8138D9E9A0028D27C /* fparseln.c */; }; + C9EB34EF138F75580075BB52 /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C9EB34F0138F75580075BB52 /* login_tty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCB138D9E9A0028D27C /* login_tty.c */; }; + C9EB34F1138F75580075BB52 /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C9EB34F2138F75580075BB52 /* logwtmp.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCD138D9E9A0028D27C /* logwtmp.c */; }; + C9EB34F3138F75580075BB52 /* opendev.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD0138D9E9A0028D27C /* opendev.c */; }; + C9EB34F4138F75580075BB52 /* pty.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD2138D9E9A0028D27C /* pty.c */; }; + C9EB34F5138F75580075BB52 /* clear.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DD9138D9E9A0028D27C /* clear.c */; }; + C9EB34F6138F75580075BB52 /* compare.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDA138D9E9A0028D27C /* compare.c */; }; + C9EB34F7138F75580075BB52 /* copy.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDB138D9E9A0028D27C /* copy.c */; }; + C9EB34F8138F75580075BB52 /* gen_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDC138D9E9A0028D27C /* gen_uuid.c */; }; + C9EB34F9138F75580075BB52 /* isnull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DDE138D9E9A0028D27C /* isnull.c */; }; + C9EB34FA138F75580075BB52 /* pack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE0138D9E9A0028D27C /* pack.c */; }; + C9EB34FB138F75580075BB52 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE1138D9E9A0028D27C /* parse.c */; }; + C9EB34FC138F75580075BB52 /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE2138D9E9A0028D27C /* unpack.c */; }; + C9EB34FD138F75580075BB52 /* unparse.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DE3138D9E9A0028D27C /* unparse.c */; }; + C9EB350F138F769B0075BB52 /* scandir_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB350E138F769B0075BB52 /* scandir_b.c */; }; + C9EB3510138F76A10075BB52 /* scandir_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB350E138F769B0075BB52 /* scandir_b.c */; settings = {COMPILER_FLAGS = "$(FreeBSD_CFLAGS) -include gen/__dirent.h"; }; }; + C9EB3542138F7D0A0075BB52 /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCA138D9E9A0028D27C /* login.c */; }; + C9EB3543138F7D0A0075BB52 /* logout.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DCC138D9E9A0028D27C /* logout.c */; }; + C9EB3550138F7EA50075BB52 /* getmntinfo64.c in Sources */ = {isa = PBXBuildFile; fileRef = C9EB354F138F7EA50075BB52 /* getmntinfo64.c */; }; + C9EB3558138F7FF40075BB52 /* nlist.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B537E8138D9E990028D27C /* nlist.c */; }; + C9EB355C138F81A40075BB52 /* kvm.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53616138D9E980028D27C /* kvm.c */; }; + C9ECE2771950E384008E8672 /* atexit_receipt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9ECE2761950E384008E8672 /* atexit_receipt.c */; }; + C9FA32F4138E49550089A94B /* abort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1D138D9E9A0028D27C /* abort.c */; }; + C9FA32F9138E4A5C0089A94B /* utf2.c in Sources */ = {isa = PBXBuildFile; fileRef = C9FA32F8138E4A5C0089A94B /* utf2.c */; }; + C9FA32FB138E4BD00089A94B /* _libc_init.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D94138D9E9A0028D27C /* _libc_init.c */; }; + C9FA32FC138E4BD00089A94B /* _libc_fork_child.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */; }; + C9FA32FD138E4BD00089A94B /* chmodx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D99138D9E9A0028D27C /* chmodx_np.c */; }; + C9FA32FF138E4BD00089A94B /* crt_externs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9C138D9E9A0028D27C /* crt_externs.c */; }; + C9FA3301138E4BD00089A94B /* fork.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53D9E138D9E9A0028D27C /* fork.c */; }; + C9FA3303138E4BD00089A94B /* gettimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA2138D9E9A0028D27C /* gettimeofday.c */; }; + C9FA3304138E4BD00089A94B /* openx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAB138D9E9A0028D27C /* openx_np.c */; }; + C9FA3307138E4BD00089A94B /* posix_spawn.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DAE138D9E9A0028D27C /* posix_spawn.c */; }; + C9FA3308138E4BD00089A94B /* settimeofday.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB3138D9E9A0028D27C /* settimeofday.c */; }; + C9FA3309138E4BD00089A94B /* sigaction.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DB5138D9E9A0028D27C /* sigaction.c */; }; + C9FA330D138E4BD00089A94B /* statx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBC138D9E9A0028D27C /* statx_np.c */; }; + C9FA330E138E4BD00089A94B /* umaskx_np.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DBE138D9E9A0028D27C /* umaskx_np.c */; }; + C9FA3312138E4C490089A94B /* stack_protector.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53DA9138D9E9A0028D27C /* stack_protector.c */; settings = {COMPILER_FLAGS = "-fno-stack-protector"; }; }; + C9FA3315138E4D040089A94B /* a64l.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C18138D9E9A0028D27C /* a64l.c */; }; + C9FA3316138E4D040089A94B /* _Exit_.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C1A138D9E9A0028D27C /* _Exit_.c */; }; + C9FA3317138E4D040089A94B /* abs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C21138D9E9A0028D27C /* abs.c */; }; + C9FA3318138E4D040089A94B /* atexit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C26138D9E9A0028D27C /* atexit.c */; }; + C9FA3319138E4D040089A94B /* atof.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C2C138D9E9A0028D27C /* atof.c */; }; + C9FA331A138E4D040089A94B /* atoi.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C30138D9E9A0028D27C /* atoi.c */; }; + C9FA331B138E4D040089A94B /* atol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C34138D9E9A0028D27C /* atol.c */; }; + C9FA331C138E4D040089A94B /* atoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C36138D9E9A0028D27C /* atoll.c */; }; + C9FA331D138E4D040089A94B /* bsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3A138D9E9A0028D27C /* bsearch.c */; }; + C9FA331E138E4D040089A94B /* div.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C3E138D9E9A0028D27C /* div.c */; }; + C9FA331F138E4D040089A94B /* exit.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C40138D9E9A0028D27C /* exit.c */; }; + C9FA3320138E4D040089A94B /* getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C44138D9E9A0028D27C /* getenv.c */; }; + C9FA3321138E4D040089A94B /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C47138D9E9A0028D27C /* getopt.c */; }; + C9FA3322138E4D040089A94B /* getopt_long.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4A138D9E9A0028D27C /* getopt_long.c */; }; + C9FA3323138E4D040089A94B /* getsubopt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4D138D9E9A0028D27C /* getsubopt.c */; }; + C9FA3324138E4D040089A94B /* hcreate.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C4F138D9E9A0028D27C /* hcreate.c */; }; + C9FA3325138E4D040089A94B /* heapsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C50138D9E9A0028D27C /* heapsort.c */; }; + C9FA3326138E4D040089A94B /* imaxabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C54138D9E9A0028D27C /* imaxabs.c */; }; + C9FA3327138E4D040089A94B /* imaxdiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C57138D9E9A0028D27C /* imaxdiv.c */; }; + C9FA3328138E4D040089A94B /* insque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5A138D9E9A0028D27C /* insque.c */; }; + C9FA3329138E4D040089A94B /* labs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C5D138D9E9A0028D27C /* labs.c */; }; + C9FA332A138E4D040089A94B /* ldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C60138D9E9A0028D27C /* ldiv.c */; }; + C9FA332B138E4D040089A94B /* llabs.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C63138D9E9A0028D27C /* llabs.c */; }; + C9FA332C138E4D040089A94B /* lldiv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C66138D9E9A0028D27C /* lldiv.c */; }; + C9FA332D138E4D040089A94B /* lsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C69138D9E9A0028D27C /* lsearch.c */; }; + C9FA332E138E4D040089A94B /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6C138D9E9A0028D27C /* merge.c */; }; + C9FA332F138E4D040089A94B /* putenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C6F138D9E9A0028D27C /* putenv.c */; }; + C9FA3330138E4D040089A94B /* qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C73138D9E9A0028D27C /* qsort.c */; }; + C9FA3331138E4D040089A94B /* qsort_r.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C75138D9E9A0028D27C /* qsort_r.c */; }; + C9FA3332138E4D040089A94B /* radixsort.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C78138D9E9A0028D27C /* radixsort.c */; }; + C9FA3333138E4D040089A94B /* rand.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7C138D9E9A0028D27C /* rand.c */; }; + C9FA3334138E4D040089A94B /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C7F138D9E9A0028D27C /* random.c */; }; + C9FA3335138E4D040089A94B /* reallocf.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C81138D9E9A0028D27C /* reallocf.c */; }; + C9FA3336138E4D040089A94B /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C84138D9E9A0028D27C /* realpath.c */; settings = {COMPILER_FLAGS = "-DLIBC_ALIAS_REALPATH"; }; }; + C9FA3337138E4D040089A94B /* remque.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C86138D9E9A0028D27C /* remque.c */; }; + C9FA3338138E4D040089A94B /* setenv.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C87138D9E9A0028D27C /* setenv.c */; }; + C9FA3339138E4D040089A94B /* strhash.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C89138D9E9A0028D27C /* strhash.c */; }; + C9FA333A138E4D040089A94B /* strtoimax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C8D138D9E9A0028D27C /* strtoimax.c */; }; + C9FA333B138E4D040089A94B /* strtol.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C91138D9E9A0028D27C /* strtol.c */; }; + C9FA333C138E4D040089A94B /* strtoll.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C93138D9E9A0028D27C /* strtoll.c */; }; + C9FA333D138E4D040089A94B /* strtoq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C95138D9E9A0028D27C /* strtoq.c */; }; + C9FA333E138E4D040089A94B /* strtoul.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C99138D9E9A0028D27C /* strtoul.c */; }; + C9FA333F138E4D040089A94B /* strtoull.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9B138D9E9A0028D27C /* strtoull.c */; }; + C9FA3340138E4D040089A94B /* strtoumax.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9D138D9E9A0028D27C /* strtoumax.c */; }; + C9FA3341138E4D040089A94B /* strtouq.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53C9F138D9E9A0028D27C /* strtouq.c */; }; + C9FA3342138E4D040089A94B /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA3138D9E9A0028D27C /* system.c */; }; + C9FA3343138E4D040089A94B /* tdelete.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA5138D9E9A0028D27C /* tdelete.c */; }; + C9FA3344138E4D040089A94B /* tfind.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA6138D9E9A0028D27C /* tfind.c */; }; + C9FA3345138E4D040089A94B /* tsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CA9138D9E9A0028D27C /* tsearch.c */; }; + C9FA3346138E4D040089A94B /* twalk.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAA138D9E9A0028D27C /* twalk.c */; }; + C9FA3347138E4D040089A94B /* grantpt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAC138D9E9A0028D27C /* grantpt.c */; }; + C9FA3348138E4D040089A94B /* l64a.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CAD138D9E9A0028D27C /* l64a.c */; }; + C9FA334A138E4D040089A94B /* ecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB7138D9E9A0028D27C /* ecvt.c */; }; + C9FA334B138E4D040089A94B /* gcvt.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB9138D9E9A0028D27C /* gcvt.c */; }; + C9FA334C138E4D040089A94B /* qsort_b.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CBD138D9E9A0028D27C /* qsort_b.c */; }; + C9FA334D138E4D0C0089A94B /* strfmon.c in Sources */ = {isa = PBXBuildFile; fileRef = C9B53CB2138D9E9A0028D27C /* strfmon.c */; }; + E408425B20B585BF00CC87A7 /* forceLibcToBuild.c in Sources */ = {isa = PBXBuildFile; fileRef = C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */; }; + FC2ED610157D4BE80098EC69 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + FC2ED611157D4BE80098EC69 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + FC2ED612157D4BE80098EC69 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + FC2ED613157D4BE80098EC69 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + FC2ED614157D4BE80098EC69 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + FC2ED615157D4BE80098EC69 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + FC2ED616157D4BE80098EC69 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + FC2ED617157D4BE80098EC69 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + FC2ED618157D4BE80098EC69 /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60E157D4BE70098EC69 /* inet_ntop.c */; }; + FC2ED619157D4BE80098EC69 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; + FC2ED61A157D4BE80098EC69 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; + FC2ED61B157D4BE80098EC69 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; + FC2ED61C157D4BE80098EC69 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; + FC2ED61D157D4BE80098EC69 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; + FC2ED61E157D4BE80098EC69 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; + FC2ED61F157D4BE80098EC69 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; + FC2ED620157D4BE80098EC69 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; + FC2ED621157D4BE80098EC69 /* inet_pton.c in Sources */ = {isa = PBXBuildFile; fileRef = FC2ED60F157D4BE70098EC69 /* inet_pton.c */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 3F51211616C318EB00AFB431 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3F51206A16C3174300AFB431; + remoteInfo = FortifySource; + }; + 926F73A11E046E69001E049D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = 926F73911E03E2A3001E049D; + remoteInfo = libsystem_darwin.dylib; + }; + 928F25D41BEAD2AE007B13C7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = 928F25D01BEACED7007B13C7; + remoteInfo = darwintests; + }; + B122F2D81432BA8700AF95D0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = B122F0E71432B8E600AF95D0; + remoteInfo = TRE; + }; + C0E343851C582ECB00E749C2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9C2A94C138DFFD900287F00; + remoteInfo = Base; + }; + C0E343871C582ECB00E749C2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9257ECF138E1B5000B3107C; + remoteInfo = FreeBSD; + }; + C0E343891C582ECB00E749C2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = B122F0E71432B8E600AF95D0; + remoteInfo = TRE; + }; + C0E3438B1C582ECB00E749C2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9D9435F138EC3E300FB7ACC; + remoteInfo = Variant_Cancelable; + }; + C0E3438D1C582ECB00E749C2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C95B7ED9138F3C55004311DA; + remoteInfo = Variant_DarwinExtsn; + }; + C925D2001518FA5D003D315B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C95B7ED9138F3C55004311DA; + remoteInfo = Variant_DarwinExtsn; + }; + C95B817C138F3F72004311DA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C95B7ED9138F3C55004311DA; + remoteInfo = Variant_DarwinExtsn; + }; + C95B8427138F5388004311DA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C95B8184138F52B0004311DA; + remoteInfo = Variant_DarwinExtsn_Cancelable; + }; + C95B86CB138F546E004311DA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C95B842A138F53DB004311DA; + remoteInfo = Variant_Pre1050; + }; + C9AE91BA1517D33100A2626C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9C2A94C138DFFD900287F00; + remoteInfo = Base; + }; + C9AE91BC1517D33100A2626C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9257ECF138E1B5000B3107C; + remoteInfo = FreeBSD; + }; + C9AE91BE1517D33100A2626C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = B122F0E71432B8E600AF95D0; + remoteInfo = TRE; + }; + C9AE91C01517D33100A2626C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9D9435F138EC3E300FB7ACC; + remoteInfo = Variant_Cancelable; + }; + C9BD3C38138F16EE00B389FD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9D9435F138EC3E300FB7ACC; + remoteInfo = Variant_Cancelable; + }; + C9D94334138DB75F00FB7ACC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9B53E2B138DA0610028D27C; + remoteInfo = Platform; + }; + C9EB326C138F74D20075BB52 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9EB2FC9138F6D880075BB52; + remoteInfo = Variant_Legacy; + }; + C9EB3514138F771F0075BB52 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9EB326F138F75580075BB52; + remoteInfo = Variant_Inode32; + }; + C9FA32C7138E41800089A94B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9C2A94C138DFFD900287F00; + remoteInfo = Base; + }; + C9FA32C9138E41800089A94B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9257ECF138E1B5000B3107C; + remoteInfo = FreeBSD; + }; + C9FA32CB138E41800089A94B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9258093138E2D3100B3107C; + remoteInfo = NetBSD; + }; + E47E981622150F0A006E312E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9D9432E138DB73300FB7ACC; + remoteInfo = libsystem_c.dylib; + }; + E47E981822150F2C006E312E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C942102D13900C8A004BA536; + remoteInfo = libc_dyld; + }; + E47E981A22150F2F006E312E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C0E343831C582ECB00E749C2; + remoteInfo = libc_static; + }; + E47E981C22150F32006E312E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C97A6F1E1517AF53005E1998; + remoteInfo = libc_eOS.a; + }; + E47E981E22150F3C006E312E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C9B53597138D9A690028D27C /* Project object */; + proxyType = 1; + remoteGlobalIDString = C9D9432E138DB73300FB7ACC; + remoteInfo = libsystem_c.dylib; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 147CDFCF1B7C14FA00831EC6 /* clock_gettime.3 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = clock_gettime.3; sourceTree = ""; }; + 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = clock_gettime.c; sourceTree = ""; }; + 2B514AB3203E4D9500641A4B /* thread_stack_pcs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = thread_stack_pcs.h; sourceTree = ""; }; + 2DF67CDD184F9CBE00B83A3D /* debug_private.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = debug_private.c; path = os/debug_private.c; sourceTree = ""; }; + 2DF67CE7184F9CD000B83A3D /* debug_private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = debug_private.h; path = os/debug_private.h; sourceTree = ""; }; + 3006CB0E20BF7482003C5C79 /* _stdio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _stdio.h; sourceTree = ""; }; + 3F169A3C1643B7BA0029E851 /* memccpy_chk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memccpy_chk.c; sourceTree = ""; }; + 3F18DE1F162A732C008B15AC /* memset_s.3 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = memset_s.3; sourceTree = ""; }; + 3F18DE20162A732C008B15AC /* memset_s.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memset_s.c; sourceTree = ""; }; + 3F267F36163FC8880089A0A6 /* rb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rb.c; sourceTree = ""; }; + 3F267F37163FC8880089A0A6 /* rbtree.3 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rbtree.3; sourceTree = ""; }; + 3F267F39163FC8BD0089A0A6 /* rbtree.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rbtree.h; sourceTree = ""; }; + 3F45E3121A6DC12E00AFF01E /* abort_unsupported.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = abort_unsupported.sh; sourceTree = ""; }; + 3F5120F116C3174300AFB431 /* libFortifySource.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFortifySource.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F89F3DC13E9194C00F6856C /* mkpath_np.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mkpath_np.3; sourceTree = ""; }; + 3F89F3DD13E9194C00F6856C /* mkpath_np.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mkpath_np.c; sourceTree = ""; }; + 3FA8F3081643AB4300D37078 /* strlcat_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strlcat_chk.c; sourceTree = ""; }; + 3FA8F3091643AB4300D37078 /* strlcpy_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strlcpy_chk.c; sourceTree = ""; }; + 3FB7E1B4146EF2E000843438 /* dirfd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dirfd.c; sourceTree = ""; }; + 3FD14572171D42B300B7BAF5 /* bcopy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bcopy.c; sourceTree = ""; }; + 3FF283231A4764240098AD2C /* sim-compat-symlink.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "sim-compat-symlink.sh"; sourceTree = ""; }; + 4B0899B920460FAC001360A4 /* cleanup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cleanup.h; sourceTree = ""; }; + 4B09323321C9C088006063D6 /* mach_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_utils.h; sourceTree = ""; }; + 4B151E0B1F8574B400F3F52F /* style.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = style.3; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.man; }; + 4B2C50E41F8453FA005DA2B6 /* internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; + 4B2C64A215519BAF00342BFA /* assumes.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = assumes.c; path = os/assumes.c; sourceTree = ""; }; + 4B2C64AB15519C3400342BFA /* assumes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = assumes.h; path = os/assumes.h; sourceTree = ""; }; + 4B2D551D2317040F003DAFCE /* tapi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tapi.h; sourceTree = ""; }; + 4B450FFA211A56DC0029AF5D /* ctl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctl.h; sourceTree = ""; }; + 4B450FFC211A56EC0029AF5D /* ctl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ctl.c; sourceTree = ""; }; + 4B69E81220800BE9008D13D2 /* libdarwin_init.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libdarwin_init.h; sourceTree = ""; }; + 4B6CFC032065B9FF0022DBAD /* mach.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mach.c; sourceTree = ""; }; + 4B6D181C206DEFBD00C00E37 /* mach_exception.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mach_exception.h; sourceTree = ""; }; + 4B6D181E206DF1E200C00E37 /* exception.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = exception.c; sourceTree = ""; }; + 4B782978208926A70070E1FF /* api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = api.h; path = os/api.h; sourceTree = ""; }; + 4B8A6F3121C99A0E00D00D67 /* linker_set.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = linker_set.h; path = os/linker_set.h; sourceTree = ""; }; + 4BA6E55B202AB1F100F38D3A /* errno.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = errno.h; sourceTree = ""; }; + 4BA6E55D202AB31100F38D3A /* string.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = string.h; sourceTree = ""; }; + 4BA6E55E202AB35900F38D3A /* string.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = string.c; sourceTree = ""; }; + 4BA6E561202AC06300F38D3A /* err.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = err.c; sourceTree = ""; }; + 4BA6E563202AC0C200F38D3A /* err.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = err.h; sourceTree = ""; }; + 4BA6E564202AC43700F38D3A /* stdlib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stdlib.h; sourceTree = ""; }; + 4BA6E565202AC94800F38D3A /* stdlib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = stdlib.c; sourceTree = ""; }; + 4BA6E567202ACAFA00F38D3A /* stdio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stdio.h; sourceTree = ""; }; + 4BA6E568202ACDAA00F38D3A /* stdio.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = stdio.c; sourceTree = ""; }; + 4BA6E56A202ACF7A00F38D3A /* bsd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bsd.h; sourceTree = ""; }; + 4BA6E56B202AD02900F38D3A /* bsd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bsd.c; sourceTree = ""; }; + 4BCC350E20659AD500A4CBAA /* linker_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = linker_set.h; path = ../../os/linker_set.h; sourceTree = ""; }; + 63D4060513DDEDF10094DD56 /* stpcpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stpcpy.c; sourceTree = ""; }; + 63D4060913DDEEA10094DD56 /* stpncpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stpncpy.c; sourceTree = ""; }; + 63D4060C13DDF26A0094DD56 /* strcat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strcat.c; sourceTree = ""; }; + 63D4060F13DDF4340094DD56 /* strncat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strncat.c; sourceTree = ""; }; + 7711D82422F37DB600E7296B /* rpmatch.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rpmatch.c; sourceTree = ""; }; + 7711D82622F3A52400E7296B /* rpmatch.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = rpmatch.3; sourceTree = ""; }; + 922D0C0821BFA1520072834D /* timespec_get.3 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = timespec_get.3; sourceTree = ""; }; + 922D0C0921BFA1530072834D /* timespec_get.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = timespec_get.c; sourceTree = ""; }; + 926F73921E03E2A3001E049D /* libsystem_darwin.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libsystem_darwin.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + 926F73971E03E8C4001E049D /* variant.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = variant.c; sourceTree = ""; }; + 926F73991E03E8D6001E049D /* variant_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = variant_private.h; path = os/variant_private.h; sourceTree = ""; }; + 92767C821E0A7E2100AB9C76 /* init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = init.c; sourceTree = ""; }; + 9280EA171E59BC8A007A6F58 /* AppleInternalVariant.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = AppleInternalVariant.plist; sourceTree = ""; }; + 928841341EA7554D001064D1 /* dirstat_collection.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dirstat_collection.c; sourceTree = ""; }; + 92888B0F1EA5BE6D00BA923E /* fmemopen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fmemopen.c; sourceTree = ""; }; + 92888B101EA5BE6D00BA923E /* open_memstream.3 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_memstream.3; sourceTree = ""; }; + 92888B111EA5BE6D00BA923E /* open_memstream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = open_memstream.c; sourceTree = ""; }; + 92888B121EA5BE6D00BA923E /* open_wmemstream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = open_wmemstream.c; sourceTree = ""; }; + 928BD0FD1D7606EA00EC01FC /* timingsafe_bcmp.3 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = timingsafe_bcmp.3; sourceTree = ""; }; + 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = timingsafe_bcmp.c; sourceTree = ""; }; + 928BD1091D7608A400EC01FC /* environ.7 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = environ.7; sourceTree = ""; }; + 92ABC7E81D375FC2000DF880 /* compatibility_hacks.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = compatibility_hacks.c; sourceTree = ""; }; + 92D763DC1EA6D9FB001467FC /* dirstat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dirstat.c; sourceTree = ""; }; + 92D763E41EA6F887001467FC /* dirstat_collection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dirstat_collection.h; sourceTree = ""; }; + 92D763E51EA6F887001467FC /* dirstat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dirstat.h; sourceTree = ""; }; + B122F2AD1432B8E600AF95D0 /* libTRE.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTRE.a; sourceTree = BUILT_PRODUCTS_DIR; }; + B122F2AF1432B95B00AF95D0 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; + B122F2B11432B95B00AF95D0 /* regcomp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regcomp.c; sourceTree = ""; }; + B122F2B21432B95B00AF95D0 /* regexec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regexec.c; sourceTree = ""; }; + B122F2B31432B95B00AF95D0 /* tre-ast.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "tre-ast.c"; sourceTree = ""; }; + B122F2B41432B95B00AF95D0 /* tre-ast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tre-ast.h"; sourceTree = ""; }; + B122F2B51432B95B00AF95D0 /* tre-compile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "tre-compile.c"; sourceTree = ""; }; + B122F2B61432B95B00AF95D0 /* tre-compile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tre-compile.h"; sourceTree = ""; }; + B122F2B71432B95B00AF95D0 /* tre-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tre-internal.h"; sourceTree = ""; }; + B122F2B81432B95B00AF95D0 /* tre-match-backtrack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "tre-match-backtrack.c"; sourceTree = ""; }; + B122F2B91432B95B00AF95D0 /* tre-match-parallel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "tre-match-parallel.c"; sourceTree = ""; }; + B122F2BA1432B95B00AF95D0 /* tre-match-utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tre-match-utils.h"; sourceTree = ""; }; + B122F2BB1432B95B00AF95D0 /* tre-mem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "tre-mem.c"; sourceTree = ""; }; + B122F2BC1432B95B00AF95D0 /* tre-mem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tre-mem.h"; sourceTree = ""; }; + B122F2BD1432B95B00AF95D0 /* tre-parse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "tre-parse.c"; sourceTree = ""; }; + B122F2BE1432B95B00AF95D0 /* tre-parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tre-parse.h"; sourceTree = ""; }; + B122F2BF1432B95B00AF95D0 /* tre-stack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "tre-stack.c"; sourceTree = ""; }; + B122F2C01432B95B00AF95D0 /* tre-stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tre-stack.h"; sourceTree = ""; }; + B122F2C11432B95B00AF95D0 /* tre.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tre.h; sourceTree = ""; }; + B122F2C21432B95B00AF95D0 /* xmalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xmalloc.h; sourceTree = ""; }; + B122F2C31432B95B00AF95D0 /* tre-0.8.0.tar.bz2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = "tre-0.8.0.tar.bz2"; sourceTree = ""; }; + B122F2C41432B95B00AF95D0 /* tre-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tre-config.h"; sourceTree = ""; }; + B122F2C51432B95B00AF95D0 /* tre-last-matched.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "tre-last-matched.h"; sourceTree = ""; }; + B12613EE158818EC0077E3CC /* xprintf_errno.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_errno.c; sourceTree = ""; }; + B12613EF158818EC0077E3CC /* xprintf_float.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_float.c; sourceTree = ""; }; + B12613F0158818EC0077E3CC /* xprintf_hexdump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_hexdump.c; sourceTree = ""; }; + B12613F1158818EC0077E3CC /* xprintf_int.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_int.c; sourceTree = ""; }; + B12613F2158818EC0077E3CC /* xprintf_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xprintf_private.h; sourceTree = ""; }; + B12613F3158818EC0077E3CC /* xprintf_quote.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_quote.c; sourceTree = ""; }; + B12613F4158818EC0077E3CC /* xprintf_str.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_str.c; sourceTree = ""; }; + B12613F5158818EC0077E3CC /* xprintf_time.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_time.c; sourceTree = ""; }; + B12613F6158818EC0077E3CC /* xprintf_vis.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_vis.c; sourceTree = ""; }; + B12613F7158818EC0077E3CC /* xprintf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf.c; sourceTree = ""; }; + B126140215881A000077E3CC /* xprintf_comp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_comp.c; sourceTree = ""; }; + B126140315881A000077E3CC /* xprintf_domain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_domain.c; sourceTree = ""; }; + B126140415881A000077E3CC /* xprintf_domain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xprintf_domain.h; sourceTree = ""; }; + B126140715881A420077E3CC /* printf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = printf.h; sourceTree = ""; }; + B1795371158B0E35008990E8 /* xprintf_all_in_one.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_all_in_one.c; sourceTree = ""; }; + B1795372158B0E35008990E8 /* xprintf_exec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xprintf_exec.c; sourceTree = ""; }; + B19C64591450F8B900032373 /* sync_volume_np.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sync_volume_np.3; sourceTree = ""; }; + B19C645B1450F90200032373 /* sync_volume_np.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sync_volume_np.c; sourceTree = ""; }; + C06E02D11CA0C9CA00B07322 /* tests */ = {isa = PBXFileReference; lastKnownFileType = folder; path = tests; sourceTree = ""; }; + C0E343811C58299D00E749C2 /* skip_installhdrs.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = skip_installhdrs.sh; sourceTree = ""; }; + C0E345E21C582ECB00E749C2 /* libc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libc.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C0E345E31C58300F00E749C2 /* libc_static.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = libc_static.xcconfig; sourceTree = ""; }; + C9194B4C140E3BC700BE0C3A /* build_linklists.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build_linklists.sh; sourceTree = ""; }; + C9257ED0138E1B5000B3107C /* libFreeBSD.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFreeBSD.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C9258105138E2D3100B3107C /* libNetBSD.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNetBSD.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C925D1FB151805C6003D315B /* eos_stubs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = eos_stubs.c; sourceTree = ""; }; + C93D6150143D31E300EB9023 /* sanitise_headers.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = sanitise_headers.sh; sourceTree = ""; }; + C94212CC13900C8A004BA536 /* libc_dyld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libc_dyld.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C942135913904CBC004BA536 /* manpages.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = manpages.sh; sourceTree = ""; }; + C942135A13905D1C004BA536 /* manpages.lst */ = {isa = PBXFileReference; explicitFileType = text; path = manpages.lst; sourceTree = ""; }; + C95B7ED8138F3C11004311DA /* rune32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rune32.h; sourceTree = ""; }; + C95B8176138F3C55004311DA /* libvDarwinExtsn.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libvDarwinExtsn.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C95B8421138F52B0004311DA /* libvDarwinExtsnCancelable.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libvDarwinExtsnCancelable.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C95B86C7138F53DB004311DA /* libvPre1050.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libvPre1050.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C965CBF4143BC1BF003912CE /* force_libc_to_build.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = force_libc_to_build.sh; sourceTree = ""; }; + C9766150138EC9D400741512 /* patch_headers_variants.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = patch_headers_variants.pl; sourceTree = ""; }; + C9766153138ECF0000741512 /* variants.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = variants.xcconfig; sourceTree = ""; }; + C976616B138EF14100741512 /* generate_features.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = generate_features.pl; sourceTree = ""; }; + C97A721C1517AF53005E1998 /* libc_eOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libc_eOS.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C9950E6A1390D2CA009863B6 /* headers.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = headers.sh; sourceTree = ""; }; + C9A288A71ACDBA95004A33A7 /* Makefile.inc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.pascal; path = Makefile.inc; sourceTree = ""; }; + C9AE91AE1517CDAC00A2626C /* eos.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = eos.xcconfig; sourceTree = ""; }; + C9B535AE138D9E980028D27C /* APPLE_LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = APPLE_LICENSE; sourceTree = ""; }; + C9B535F7138D9E980028D27C /* creat.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = creat.2; sourceTree = ""; }; + C9B535F8138D9E980028D27C /* creat.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = creat.c; sourceTree = ""; }; + C9B535FA138D9E980028D27C /* gethostid.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = gethostid.3; sourceTree = ""; }; + C9B535FC138D9E980028D27C /* gethostid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gethostid.c; sourceTree = ""; }; + C9B535FE138D9E980028D27C /* getwd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getwd.c; sourceTree = ""; }; + C9B535FF138D9E980028D27C /* killpg.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = killpg.2; sourceTree = ""; }; + C9B53601138D9E980028D27C /* killpg.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = killpg.c; sourceTree = ""; }; + C9B53603138D9E980028D27C /* sethostid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sethostid.c; sourceTree = ""; }; + C9B53604138D9E980028D27C /* setpgrp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setpgrp.c; sourceTree = ""; }; + C9B53606138D9E980028D27C /* setrgid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setrgid.c; sourceTree = ""; }; + C9B53607138D9E980028D27C /* setruid.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = setruid.3; sourceTree = ""; }; + C9B53608138D9E980028D27C /* setruid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setruid.c; sourceTree = ""; }; + C9B5360A138D9E980028D27C /* setregid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setregid.c; sourceTree = ""; }; + C9B5360B138D9E980028D27C /* setreuid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setreuid.c; sourceTree = ""; }; + C9B5360C138D9E980028D27C /* sigaltstk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sigaltstk.c; sourceTree = ""; }; + C9B5360D138D9E980028D27C /* sigblock.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sigblock.2; sourceTree = ""; }; + C9B5360E138D9E980028D27C /* sigcompat.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sigcompat.c; sourceTree = ""; }; + C9B5360F138D9E980028D27C /* sigpause.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sigpause.2; sourceTree = ""; }; + C9B53610138D9E980028D27C /* sigsetmask.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sigsetmask.2; sourceTree = ""; }; + C9B53611138D9E980028D27C /* sigvec.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sigvec.2; sourceTree = ""; }; + C9B53616138D9E980028D27C /* kvm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = kvm.c; sourceTree = ""; }; + C9B53620138D9E980028D27C /* bt_close.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_close.c; sourceTree = ""; }; + C9B53621138D9E980028D27C /* bt_conv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_conv.c; sourceTree = ""; }; + C9B53622138D9E980028D27C /* bt_debug.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_debug.c; sourceTree = ""; }; + C9B53623138D9E980028D27C /* bt_delete.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_delete.c; sourceTree = ""; }; + C9B53624138D9E980028D27C /* bt_get.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_get.c; sourceTree = ""; }; + C9B53625138D9E980028D27C /* bt_open.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_open.c; sourceTree = ""; }; + C9B53626138D9E980028D27C /* bt_overflow.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_overflow.c; sourceTree = ""; }; + C9B53628138D9E980028D27C /* bt_page.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_page.c; sourceTree = ""; }; + C9B53629138D9E980028D27C /* bt_put.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_put.c; sourceTree = ""; }; + C9B5362A138D9E980028D27C /* bt_search.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_search.c; sourceTree = ""; }; + C9B5362B138D9E980028D27C /* bt_seq.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_seq.c; sourceTree = ""; }; + C9B5362D138D9E980028D27C /* bt_split.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_split.c; sourceTree = ""; }; + C9B5362F138D9E980028D27C /* bt_utils.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bt_utils.c; sourceTree = ""; }; + C9B53630138D9E980028D27C /* btree.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = btree.h; sourceTree = ""; }; + C9B53632138D9E980028D27C /* bt_extern.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bt_extern.h; sourceTree = ""; }; + C9B53636138D9E980028D27C /* db.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = db.c; sourceTree = ""; }; + C9B5363A138D9E980028D27C /* hash_extern.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = hash_extern.h; sourceTree = ""; }; + C9B5363B138D9E980028D27C /* hash.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hash.c; sourceTree = ""; }; + C9B5363D138D9E980028D27C /* hash.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = hash.h; sourceTree = ""; }; + C9B5363F138D9E980028D27C /* hash_bigkey.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hash_bigkey.c; sourceTree = ""; }; + C9B53641138D9E980028D27C /* hash_buf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hash_buf.c; sourceTree = ""; }; + C9B53643138D9E980028D27C /* hash_func.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hash_func.c; sourceTree = ""; }; + C9B53645138D9E980028D27C /* hash_log2.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hash_log2.c; sourceTree = ""; }; + C9B53647138D9E980028D27C /* hash_page.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hash_page.c; sourceTree = ""; }; + C9B53649138D9E980028D27C /* ndbm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ndbm.c; sourceTree = ""; }; + C9B5364B138D9E980028D27C /* page.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = page.h; sourceTree = ""; }; + C9B53650138D9E980028D27C /* btree.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = btree.3; sourceTree = ""; }; + C9B53651138D9E980028D27C /* dbm.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = dbm.3; sourceTree = ""; }; + C9B53653138D9E980028D27C /* dbopen.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = dbopen.3; sourceTree = ""; }; + C9B53654138D9E980028D27C /* hash.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = hash.3; sourceTree = ""; }; + C9B53655138D9E980028D27C /* mpool.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mpool.3; sourceTree = ""; }; + C9B53656138D9E980028D27C /* recno.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = recno.3; sourceTree = ""; }; + C9B5365A138D9E980028D27C /* mpool.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mpool.c; sourceTree = ""; }; + C9B5365F138D9E980028D27C /* rec_extern.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rec_extern.h; sourceTree = ""; }; + C9B53661138D9E980028D27C /* rec_close.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rec_close.c; sourceTree = ""; }; + C9B53662138D9E980028D27C /* rec_delete.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rec_delete.c; sourceTree = ""; }; + C9B53663138D9E980028D27C /* rec_get.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rec_get.c; sourceTree = ""; }; + C9B53664138D9E980028D27C /* rec_open.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rec_open.c; sourceTree = ""; }; + C9B53665138D9E980028D27C /* rec_put.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rec_put.c; sourceTree = ""; }; + C9B53666138D9E980028D27C /* rec_search.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rec_search.c; sourceTree = ""; }; + C9B53667138D9E980028D27C /* rec_seq.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rec_seq.c; sourceTree = ""; }; + C9B53668138D9E980028D27C /* rec_utils.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rec_utils.c; sourceTree = ""; }; + C9B53669138D9E980028D27C /* recno.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = recno.h; sourceTree = ""; }; + C9B5366D138D9E980028D27C /* brk.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = brk.2; sourceTree = ""; }; + C9B5366E138D9E980028D27C /* brk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = brk.c; sourceTree = ""; }; + C9B5366F138D9E980028D27C /* bsd_signal.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = bsd_signal.3; sourceTree = ""; }; + C9B53670138D9E980028D27C /* bsd_signal.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bsd_signal.c; sourceTree = ""; }; + C9B53671138D9E980028D27C /* lchflags.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = lchflags.3; sourceTree = ""; }; + C9B53672138D9E980028D27C /* lchflags.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lchflags.c; sourceTree = ""; }; + C9B53673138D9E980028D27C /* lchmod.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = lchmod.3; sourceTree = ""; }; + C9B53674138D9E980028D27C /* lchmod.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lchmod.c; sourceTree = ""; }; + C9B53675138D9E980028D27C /* lutimes.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = lutimes.3; sourceTree = ""; }; + C9B53676138D9E980028D27C /* lutimes.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lutimes.c; sourceTree = ""; }; + C9B53678138D9E980028D27C /* statvfs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = statvfs.3; sourceTree = ""; }; + C9B53679138D9E980028D27C /* statvfs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = statvfs.c; sourceTree = ""; }; + C9B5367A138D9E980028D27C /* tcgetsid.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tcgetsid.3; sourceTree = ""; }; + C9B5367B138D9E980028D27C /* tcgetsid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tcgetsid.c; sourceTree = ""; }; + C9B5367D138D9E980028D27C /* _fbsd_compat_.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _fbsd_compat_.h; sourceTree = ""; }; + C9B5367E138D9E980028D27C /* _fpmath.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _fpmath.h; sourceTree = ""; }; + C9B5367F138D9E980028D27C /* fpmath.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fpmath.h; sourceTree = ""; }; + C9B53682138D9E980028D27C /* atomic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = atomic.h; sourceTree = ""; }; + C9B53683138D9E980028D27C /* namespace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = namespace.h; sourceTree = ""; }; + C9B53684138D9E980028D27C /* port_after.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = port_after.h; sourceTree = ""; }; + C9B53685138D9E980028D27C /* port_before.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = port_before.h; sourceTree = ""; }; + C9B53686138D9E980028D27C /* reentrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = reentrant.h; sourceTree = ""; }; + C9B53687138D9E980028D27C /* spinlock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = spinlock.h; sourceTree = ""; }; + C9B53689138D9E980028D27C /* cdefs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cdefs.h; sourceTree = ""; }; + C9B5368A138D9E980028D27C /* endian.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = endian.h; sourceTree = ""; }; + C9B5368B138D9E980028D27C /* un-namespace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "un-namespace.h"; sourceTree = ""; }; + C9B5368E138D9E980028D27C /* _ldbl_util.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = _ldbl_util.c; sourceTree = ""; }; + C9B5368F138D9E980028D27C /* arith.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = arith.h; sourceTree = ""; }; + C9B53691138D9E980028D27C /* _hdtoa.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = _hdtoa.c; sourceTree = ""; }; + C9B53693138D9E980028D27C /* _ldtoa.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = _ldtoa.c; sourceTree = ""; }; + C9B53695138D9E980028D27C /* gdtoa-dmisc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-dmisc.c"; sourceTree = ""; }; + C9B53696138D9E980028D27C /* gdtoa-dtoa.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-dtoa.c"; sourceTree = ""; }; + C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-gdtoa.c"; sourceTree = ""; }; + C9B53698138D9E980028D27C /* gdtoa-gethex.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-gethex.c"; sourceTree = ""; }; + C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-gmisc.c"; sourceTree = ""; }; + C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-hd_init.c"; sourceTree = ""; }; + C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-hexnan.c"; sourceTree = ""; }; + C9B5369E138D9E980028D27C /* gdtoa-misc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-misc.c"; sourceTree = ""; }; + C9B536A0138D9E980028D27C /* gdtoa-smisc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-smisc.c"; sourceTree = ""; }; + C9B536A1138D9E980028D27C /* gdtoa-strtod.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-strtod.c"; sourceTree = ""; }; + C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-strtodg.c"; sourceTree = ""; }; + C9B536A5138D9E980028D27C /* gdtoa-strtof.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-strtof.c"; sourceTree = ""; }; + C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-strtoIg.c"; sourceTree = ""; }; + C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-strtopdd.c"; sourceTree = ""; }; + C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-strtopx.c"; sourceTree = ""; }; + C9B536AC138D9E980028D27C /* gdtoa-strtord.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-strtord.c"; sourceTree = ""; }; + C9B536AE138D9E980028D27C /* gdtoa-sum.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-sum.c"; sourceTree = ""; }; + C9B536AF138D9E980028D27C /* gdtoa-ulp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "gdtoa-ulp.c"; sourceTree = ""; }; + C9B536B0138D9E980028D27C /* gdtoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gdtoa.h; sourceTree = ""; }; + C9B536B2138D9E980028D27C /* gdtoa_fltrnds.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gdtoa_fltrnds.h; sourceTree = ""; }; + C9B536B3138D9E980028D27C /* gdtoaimp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gdtoaimp.h; sourceTree = ""; }; + C9B536B5138D9E980028D27C /* glue.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = glue.c; sourceTree = ""; }; + C9B536B6138D9E980028D27C /* machdep_ldisd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = machdep_ldisd.c; sourceTree = ""; }; + C9B536B8138D9E980028D27C /* machdep_ldisdd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = machdep_ldisdd.c; sourceTree = ""; }; + C9B536BA138D9E980028D27C /* machdep_ldisQ.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = machdep_ldisQ.c; sourceTree = ""; }; + C9B536BB138D9E980028D27C /* machdep_ldisx.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = machdep_ldisx.c; sourceTree = ""; }; + C9B536BD138D9E980028D27C /* gd_qnan.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gd_qnan.h; sourceTree = ""; }; + C9B536BE138D9E980028D27C /* gdtoa.tgz */ = {isa = PBXFileReference; lastKnownFileType = file; path = gdtoa.tgz; sourceTree = ""; }; + C9B536C1138D9E990028D27C /* __dirent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = __dirent.h; sourceTree = ""; }; + C9B536D5138D9E990028D27C /* authentication.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = authentication.c; sourceTree = ""; }; + C9B536D6138D9E990028D27C /* backtrace.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = backtrace.3; sourceTree = ""; }; + C9B536D7138D9E990028D27C /* backtrace.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = backtrace.c; sourceTree = ""; }; + C9B536D9138D9E990028D27C /* compat.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = compat.5; sourceTree = ""; }; + C9B536DA138D9E990028D27C /* confstr.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = confstr.3; sourceTree = ""; }; + C9B536DB138D9E990028D27C /* confstr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = confstr.c; sourceTree = ""; }; + C9B536DC138D9E990028D27C /* crypt.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = crypt.3; sourceTree = ""; }; + C9B536DD138D9E990028D27C /* crypt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = crypt.c; sourceTree = ""; }; + C9B536DE138D9E990028D27C /* devname.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = devname.3; sourceTree = ""; }; + C9B536DF138D9E990028D27C /* devname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = devname.c; sourceTree = ""; }; + C9B536E0138D9E990028D27C /* directory.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = directory.3; sourceTree = ""; }; + C9B536E1138D9E990028D27C /* disklabel.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = disklabel.c; sourceTree = ""; }; + C9B536E2138D9E990028D27C /* errlst.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = errlst.c; sourceTree = ""; }; + C9B536E3138D9E990028D27C /* execinfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = execinfo.h; sourceTree = ""; }; + C9B536E4138D9E990028D27C /* filesec.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = filesec.c; sourceTree = ""; }; + C9B536E6138D9E990028D27C /* _rand48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = _rand48.c; sourceTree = ""; }; + C9B536E8138D9E990028D27C /* alarm.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = alarm.3; sourceTree = ""; }; + C9B536EA138D9E990028D27C /* alarm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = alarm.c; sourceTree = ""; }; + C9B536EB138D9E990028D27C /* arc4random.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = arc4random.3; sourceTree = ""; }; + C9B536EC138D9E990028D27C /* arc4random.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = arc4random.c; sourceTree = ""; }; + C9B536EE138D9E990028D27C /* assert.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = assert.c; sourceTree = ""; }; + C9B536F0138D9E990028D27C /* basename.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = basename.3; sourceTree = ""; }; + C9B536F2138D9E990028D27C /* basename.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = basename.c; sourceTree = ""; }; + C9B536F4138D9E990028D27C /* clock.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = clock.3; sourceTree = ""; }; + C9B536F5138D9E990028D27C /* clock.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = clock.c; sourceTree = ""; }; + C9B536F6138D9E990028D27C /* closedir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = closedir.c; sourceTree = ""; }; + C9B536F8138D9E990028D27C /* ctermid.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ctermid.3; sourceTree = ""; }; + C9B536FA138D9E990028D27C /* ctermid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ctermid.c; sourceTree = ""; }; + C9B536FB138D9E990028D27C /* daemon.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = daemon.3; sourceTree = ""; }; + C9B536FD138D9E990028D27C /* daemon.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = daemon.c; sourceTree = ""; }; + C9B536FF138D9E990028D27C /* dirname.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = dirname.3; sourceTree = ""; }; + C9B53701138D9E990028D27C /* dirname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = dirname.c; sourceTree = ""; }; + C9B53703138D9E990028D27C /* drand48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = drand48.c; sourceTree = ""; }; + C9B53705138D9E990028D27C /* erand48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = erand48.c; sourceTree = ""; }; + C9B53707138D9E990028D27C /* err.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = err.3; sourceTree = ""; }; + C9B53709138D9E990028D27C /* err.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = err.c; sourceTree = ""; }; + C9B5370B138D9E990028D27C /* exec.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = exec.3; sourceTree = ""; }; + C9B5370D138D9E990028D27C /* exec.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = exec.c; sourceTree = ""; }; + C9B5370F138D9E990028D27C /* fmtcheck.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fmtcheck.3; sourceTree = ""; }; + C9B53710138D9E990028D27C /* fmtcheck.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fmtcheck.c; sourceTree = ""; }; + C9B53711138D9E990028D27C /* fmtmsg.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fmtmsg.3; sourceTree = ""; }; + C9B53712138D9E990028D27C /* fmtmsg.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fmtmsg.c; sourceTree = ""; }; + C9B53714138D9E990028D27C /* fnmatch.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fnmatch.3; sourceTree = ""; }; + C9B53716138D9E990028D27C /* fnmatch.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fnmatch.c; sourceTree = ""; }; + C9B53718138D9E990028D27C /* ftok.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ftok.3; sourceTree = ""; }; + C9B5371A138D9E990028D27C /* ftok.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ftok.c; sourceTree = ""; }; + C9B5371B138D9E990028D27C /* getbsize.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getbsize.3; sourceTree = ""; }; + C9B5371C138D9E990028D27C /* getbsize.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getbsize.c; sourceTree = ""; }; + C9B5371D138D9E990028D27C /* getcap.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getcap.3; sourceTree = ""; }; + C9B5371E138D9E990028D27C /* getcap.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getcap.c; sourceTree = ""; }; + C9B53721138D9E990028D27C /* getcwd.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getcwd.3; sourceTree = ""; }; + C9B53722138D9E990028D27C /* getcwd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getcwd.c; sourceTree = ""; }; + C9B53724138D9E990028D27C /* gethostname.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = gethostname.3; sourceTree = ""; }; + C9B53726138D9E990028D27C /* gethostname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gethostname.c; sourceTree = ""; }; + C9B53728138D9E990028D27C /* getlogin.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getlogin.c; sourceTree = ""; }; + C9B5372A138D9E990028D27C /* getmntinfo.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getmntinfo.3; sourceTree = ""; }; + C9B5372C138D9E990028D27C /* getmntinfo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getmntinfo.c; sourceTree = ""; }; + C9B5372E138D9E990028D27C /* getpagesize.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getpagesize.3; sourceTree = ""; }; + C9B5372F138D9E990028D27C /* getpagesize.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getpagesize.c; sourceTree = ""; }; + C9B53730138D9E990028D27C /* getpass.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getpass.3; sourceTree = ""; }; + C9B53731138D9E990028D27C /* getpeereid.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getpeereid.3; sourceTree = ""; }; + C9B53732138D9E990028D27C /* getpeereid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getpeereid.c; sourceTree = ""; }; + C9B53733138D9E990028D27C /* getprogname.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getprogname.3; sourceTree = ""; }; + C9B53735138D9E990028D27C /* getprogname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getprogname.c; sourceTree = ""; }; + C9B53737138D9E990028D27C /* glob.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = glob.3; sourceTree = ""; }; + C9B53739138D9E990028D27C /* glob.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = glob.c; sourceTree = ""; }; + C9B5373B138D9E990028D27C /* isatty.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = isatty.c; sourceTree = ""; }; + C9B5373D138D9E990028D27C /* jrand48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = jrand48.c; sourceTree = ""; }; + C9B5373F138D9E990028D27C /* lcong48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lcong48.c; sourceTree = ""; }; + C9B53741138D9E990028D27C /* lockf.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = lockf.3; sourceTree = ""; }; + C9B53743138D9E990028D27C /* lockf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lockf.c; sourceTree = ""; }; + C9B53745138D9E990028D27C /* lrand48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lrand48.c; sourceTree = ""; }; + C9B53749138D9E990028D27C /* mrand48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mrand48.c; sourceTree = ""; }; + C9B5374B138D9E990028D27C /* nice.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = nice.3; sourceTree = ""; }; + C9B5374C138D9E990028D27C /* nice.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = nice.c; sourceTree = ""; }; + C9B5374E138D9E990028D27C /* nrand48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = nrand48.c; sourceTree = ""; }; + C9B53750138D9E990028D27C /* opendir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = opendir.c; sourceTree = ""; }; + C9B53752138D9E990028D27C /* pause.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = pause.3; sourceTree = ""; }; + C9B53753138D9E990028D27C /* pause.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = pause.c; sourceTree = ""; }; + C9B53755138D9E990028D27C /* popen.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = popen.3; sourceTree = ""; }; + C9B53757138D9E990028D27C /* popen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = popen.c; sourceTree = ""; }; + C9B5375D138D9E990028D27C /* psignal.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = psignal.3; sourceTree = ""; }; + C9B5375F138D9E990028D27C /* psignal.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = psignal.c; sourceTree = ""; }; + C9B53760138D9E990028D27C /* raise.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = raise.3; sourceTree = ""; }; + C9B53761138D9E990028D27C /* raise.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = raise.c; sourceTree = ""; }; + C9B53762138D9E990028D27C /* rand48.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = rand48.3; sourceTree = ""; }; + C9B53764138D9E990028D27C /* rand48.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rand48.h; sourceTree = ""; }; + C9B53766138D9E990028D27C /* readdir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = readdir.c; sourceTree = ""; }; + C9B53768138D9E990028D27C /* readpassphrase.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = readpassphrase.3; sourceTree = ""; }; + C9B53769138D9E990028D27C /* readpassphrase.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = readpassphrase.c; sourceTree = ""; }; + C9B5376B138D9E990028D27C /* rewinddir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rewinddir.c; sourceTree = ""; }; + C9B5376C138D9E990028D27C /* scandir.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = scandir.3; sourceTree = ""; }; + C9B5376E138D9E990028D27C /* scandir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = scandir.c; sourceTree = ""; }; + C9B53771138D9E990028D27C /* seed48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = seed48.c; sourceTree = ""; }; + C9B53773138D9E990028D27C /* seekdir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = seekdir.c; sourceTree = ""; }; + C9B53774138D9E990028D27C /* sethostname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sethostname.c; sourceTree = ""; }; + C9B53775138D9E990028D27C /* setmode.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = setmode.3; sourceTree = ""; }; + C9B53776138D9E990028D27C /* setmode.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setmode.c; sourceTree = ""; }; + C9B53778138D9E990028D27C /* setprogname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setprogname.c; sourceTree = ""; }; + C9B5377A138D9E990028D27C /* siginterrupt.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = siginterrupt.3; sourceTree = ""; }; + C9B5377C138D9E990028D27C /* siginterrupt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = siginterrupt.c; sourceTree = ""; }; + C9B5377D138D9E990028D27C /* siglist.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = siglist.c; sourceTree = ""; }; + C9B5377F138D9E990028D27C /* signal.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = signal.3; sourceTree = ""; }; + C9B53781138D9E990028D27C /* signal.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = signal.c; sourceTree = ""; }; + C9B53783138D9E990028D27C /* signbit.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = signbit.3; sourceTree = ""; }; + C9B53785138D9E990028D27C /* sleep.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sleep.3; sourceTree = ""; }; + C9B53787138D9E990028D27C /* sleep.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sleep.c; sourceTree = ""; }; + C9B53789138D9E990028D27C /* srand48.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = srand48.c; sourceTree = ""; }; + C9B5378B138D9E990028D27C /* stringlist.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = stringlist.3; sourceTree = ""; }; + C9B5378C138D9E990028D27C /* stringlist.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = stringlist.c; sourceTree = ""; }; + C9B5378D138D9E990028D27C /* sysconf.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sysconf.3; sourceTree = ""; }; + C9B5378E138D9E990028D27C /* sysconf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sysconf.c; sourceTree = ""; }; + C9B53790138D9E990028D27C /* sysctl.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sysctl.3; sourceTree = ""; }; + C9B53792138D9E990028D27C /* sysctl.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sysctl.c; sourceTree = ""; }; + C9B53794138D9E990028D27C /* sysctlbyname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sysctlbyname.c; sourceTree = ""; }; + C9B53795138D9E990028D27C /* sysctlnametomib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sysctlnametomib.c; sourceTree = ""; }; + C9B53796138D9E990028D27C /* telldir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = telldir.c; sourceTree = ""; }; + C9B53798138D9E990028D27C /* telldir.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = telldir.h; sourceTree = ""; }; + C9B5379A138D9E990028D27C /* termios.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = termios.c; sourceTree = ""; }; + C9B5379C138D9E990028D27C /* time.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = time.3; sourceTree = ""; }; + C9B5379E138D9E990028D27C /* time.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = time.c; sourceTree = ""; }; + C9B537A0138D9E990028D27C /* times.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = times.3; sourceTree = ""; }; + C9B537A2138D9E990028D27C /* times.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = times.c; sourceTree = ""; }; + C9B537A3138D9E990028D27C /* timezone.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = timezone.3; sourceTree = ""; }; + C9B537A4138D9E990028D27C /* timezone.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = timezone.c; sourceTree = ""; }; + C9B537A5138D9E990028D27C /* ttyname.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ttyname.3; sourceTree = ""; }; + C9B537A7138D9E990028D27C /* ttyname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ttyname.c; sourceTree = ""; }; + C9B537A9138D9E990028D27C /* ttyslot.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ttyslot.c; sourceTree = ""; }; + C9B537AA138D9E990028D27C /* ualarm.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ualarm.3; sourceTree = ""; }; + C9B537AC138D9E990028D27C /* ualarm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ualarm.c; sourceTree = ""; }; + C9B537AE138D9E990028D27C /* ulimit.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ulimit.3; sourceTree = ""; }; + C9B537B0138D9E990028D27C /* ulimit.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ulimit.c; sourceTree = ""; }; + C9B537B1138D9E990028D27C /* unvis.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = unvis.3; sourceTree = ""; }; + C9B537B2138D9E990028D27C /* unvis.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = unvis.c; sourceTree = ""; }; + C9B537B4138D9E990028D27C /* usleep.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = usleep.3; sourceTree = ""; }; + C9B537B6138D9E990028D27C /* usleep.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = usleep.c; sourceTree = ""; }; + C9B537B8138D9E990028D27C /* utime.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = utime.3; sourceTree = ""; }; + C9B537BA138D9E990028D27C /* utime.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = utime.c; sourceTree = ""; }; + C9B537BB138D9E990028D27C /* vis.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = vis.3; sourceTree = ""; }; + C9B537BC138D9E990028D27C /* vis.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vis.c; sourceTree = ""; }; + C9B537BE138D9E990028D27C /* wait.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wait.c; sourceTree = ""; }; + C9B537C0138D9E990028D27C /* wait3.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wait3.c; sourceTree = ""; }; + C9B537C1138D9E990028D27C /* waitpid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = waitpid.c; sourceTree = ""; }; + C9B537C3138D9E990028D27C /* fts.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fts.3; sourceTree = ""; }; + C9B537C4138D9E990028D27C /* fts.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fts.c; sourceTree = ""; }; + C9B537C5138D9E990028D27C /* ftw.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ftw.3; sourceTree = ""; }; + C9B537C6138D9E990028D27C /* get_compat.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = get_compat.c; sourceTree = ""; }; + C9B537C7138D9E990028D27C /* get_compat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = get_compat.h; sourceTree = ""; }; + C9B537C8138D9E990028D27C /* getdomainname.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getdomainname.3; sourceTree = ""; }; + C9B537C9138D9E990028D27C /* getloadavg.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getloadavg.3; sourceTree = ""; }; + C9B537CA138D9E990028D27C /* getloadavg.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getloadavg.c; sourceTree = ""; }; + C9B537CB138D9E990028D27C /* getttyent.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getttyent.3; sourceTree = ""; }; + C9B537CC138D9E990028D27C /* getttyent.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getttyent.c; sourceTree = ""; }; + C9B537CD138D9E990028D27C /* getusershell.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getusershell.3; sourceTree = ""; }; + C9B537CE138D9E990028D27C /* getusershell.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getusershell.c; sourceTree = ""; }; + C9B537CF138D9E990028D27C /* getvfsbyname.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getvfsbyname.3; sourceTree = ""; }; + C9B537D0138D9E990028D27C /* getvfsbyname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getvfsbyname.c; sourceTree = ""; }; + C9B537D1138D9E990028D27C /* intro.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = intro.3; sourceTree = ""; }; + C9B537DC138D9E990028D27C /* nanosleep.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = nanosleep.c; sourceTree = ""; }; + C9B537DE138D9E990028D27C /* endutxent.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = endutxent.3; sourceTree = ""; }; + C9B537E0138D9E990028D27C /* getlastlogx.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getlastlogx.3; sourceTree = ""; }; + C9B537E2138D9E990028D27C /* utmpx.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = utmpx.5; sourceTree = ""; }; + C9B537E4138D9E990028D27C /* utmpx.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = utmpx.c; sourceTree = ""; }; + C9B537E6138D9E990028D27C /* nftw.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = nftw.c; sourceTree = ""; }; + C9B537E7138D9E990028D27C /* nlist.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = nlist.3; sourceTree = ""; }; + C9B537E8138D9E990028D27C /* nlist.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = nlist.c; sourceTree = ""; }; + C9B537EA138D9E990028D27C /* oldsyslog.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = oldsyslog.c; sourceTree = ""; }; + C9B537ED138D9E990028D27C /* posix_memalign.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = posix_memalign.3; sourceTree = ""; }; + C9B537EE138D9E990028D27C /* pwcache.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = pwcache.3; sourceTree = ""; }; + C9B537F2138D9E990028D27C /* setlogin.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setlogin.c; sourceTree = ""; }; + C9B537F3138D9E990028D27C /* sigsetops.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sigsetops.3; sourceTree = ""; }; + C9B537F4138D9E990028D27C /* sigsetops.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sigsetops.c; sourceTree = ""; }; + C9B537F8138D9E990028D27C /* strtofflags.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strtofflags.3; sourceTree = ""; }; + C9B537F9138D9E990028D27C /* strtofflags.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtofflags.c; sourceTree = ""; }; + C9B537FC138D9E990028D27C /* tcgetpgrp.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tcgetpgrp.3; sourceTree = ""; }; + C9B537FD138D9E990028D27C /* tcsendbreak.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tcsendbreak.3; sourceTree = ""; }; + C9B537FE138D9E990028D27C /* tcsetattr.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tcsetattr.3; sourceTree = ""; }; + C9B537FF138D9E990028D27C /* tcsetpgrp.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tcsetpgrp.3; sourceTree = ""; }; + C9B53800138D9E990028D27C /* thread_stack_pcs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = thread_stack_pcs.c; sourceTree = ""; }; + C9B53801138D9E990028D27C /* tzset.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tzset.3; sourceTree = ""; }; + C9B53802138D9E990028D27C /* uname.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = uname.3; sourceTree = ""; }; + C9B53803138D9E990028D27C /* uname.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = uname.c; sourceTree = ""; }; + C9B53804138D9E990028D27C /* utmpx-darwin.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "utmpx-darwin.c"; sourceTree = ""; }; + C9B53805138D9E990028D27C /* utmpx-darwin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "utmpx-darwin.h"; sourceTree = ""; }; + C9B53806138D9E990028D27C /* utmpx_thread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utmpx_thread.h; sourceTree = ""; }; + C9B53807138D9E990028D27C /* wordexp.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wordexp.3; sourceTree = ""; }; + C9B53808138D9E990028D27C /* wordexp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wordexp.c; sourceTree = ""; }; + C9B5380B138D9E990028D27C /* gmon.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gmon.c; sourceTree = ""; }; + C9B5380D138D9E990028D27C /* moncontrol.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = moncontrol.3; sourceTree = ""; }; + C9B53819138D9E990028D27C /* mcount.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = mcount.s; sourceTree = ""; }; + C9B53850138D9E990028D27C /* _locale.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _locale.h; sourceTree = ""; }; + C9B53852138D9E990028D27C /* _types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _types.h; sourceTree = ""; }; + C9B53853138D9E990028D27C /* _wctype.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _wctype.h; sourceTree = ""; }; + C9B53854138D9E990028D27C /* _xlocale.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _xlocale.h; sourceTree = ""; }; + C9B53855138D9E990028D27C /* aio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = aio.h; sourceTree = ""; }; + C9B53856138D9E990028D27C /* alloca.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = alloca.h; sourceTree = ""; }; + C9B53857138D9E990028D27C /* ar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ar.h; sourceTree = ""; }; + C9B53859138D9E990028D27C /* ftp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ftp.h; sourceTree = ""; }; + C9B5385B138D9E990028D27C /* nameser_compat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nameser_compat.h; sourceTree = ""; }; + C9B5385C138D9E990028D27C /* telnet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = telnet.h; sourceTree = ""; }; + C9B5385D138D9E990028D27C /* tftp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tftp.h; sourceTree = ""; }; + C9B5385F138D9E990028D27C /* asm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = ""; }; + C9B53860138D9E990028D27C /* assert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = assert.h; sourceTree = ""; }; + C9B53861138D9E990028D27C /* authentication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = authentication.h; sourceTree = ""; }; + C9B53862138D9E990028D27C /* bitstring.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bitstring.h; sourceTree = ""; }; + C9B53863138D9E990028D27C /* cpio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpio.h; sourceTree = ""; }; + C9B53865138D9E990028D27C /* crt_externs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = crt_externs.h; sourceTree = ""; }; + C9B53866138D9E990028D27C /* ctype.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ctype.h; sourceTree = ""; }; + C9B53867138D9E990028D27C /* db.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = db.h; sourceTree = ""; }; + C9B53868138D9E990028D27C /* dirent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dirent.h; sourceTree = ""; }; + C9B53869138D9E990028D27C /* disktab.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = disktab.h; sourceTree = ""; }; + C9B5386A138D9E990028D27C /* err.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = err.h; sourceTree = ""; }; + C9B5386B138D9E990028D27C /* errno.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = errno.h; sourceTree = ""; }; + C9B5386C138D9E990028D27C /* fcntl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fcntl.h; sourceTree = ""; }; + C9B5386D138D9E990028D27C /* fmtmsg.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fmtmsg.h; sourceTree = ""; }; + C9B5386E138D9E990028D27C /* fnmatch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fnmatch.h; sourceTree = ""; }; + C9B53870138D9E990028D27C /* nl_types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nl_types.h; sourceTree = ""; }; + C9B53872138D9E990028D27C /* fsproperties.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fsproperties.h; sourceTree = ""; }; + C9B53873138D9E990028D27C /* fstab.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fstab.h; sourceTree = ""; }; + C9B53874138D9E990028D27C /* fts.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fts.h; sourceTree = ""; }; + C9B53875138D9E990028D27C /* ftw.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ftw.h; sourceTree = ""; }; + C9B53876138D9E990028D27C /* getopt.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = getopt.h; sourceTree = ""; }; + C9B53877138D9E990028D27C /* glob.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = glob.h; sourceTree = ""; }; + C9B53879138D9E990028D27C /* inttypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = inttypes.h; sourceTree = ""; }; + C9B5387A138D9E990028D27C /* iso646.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = iso646.h; sourceTree = ""; }; + C9B5387B138D9E990028D27C /* kvm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = kvm.h; sourceTree = ""; }; + C9B5387C138D9E990028D27C /* langinfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = langinfo.h; sourceTree = ""; }; + C9B5387D138D9E990028D27C /* libc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libc.h; sourceTree = ""; }; + C9B5387E138D9E990028D27C /* libgen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libgen.h; sourceTree = ""; }; + C9B53884138D9E990028D27C /* OSThermalNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSThermalNotification.h; sourceTree = ""; }; + C9B53885138D9E990028D27C /* limits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = ""; }; + C9B53886138D9E990028D27C /* locale.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = locale.h; sourceTree = ""; }; + C9B5388B138D9E990028D27C /* memory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = ""; }; + C9B5388C138D9E990028D27C /* monetary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = monetary.h; sourceTree = ""; }; + C9B5388D138D9E990028D27C /* monitor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = monitor.h; sourceTree = ""; }; + C9B5388E138D9E990028D27C /* mpool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpool.h; sourceTree = ""; }; + C9B5388F138D9E990028D27C /* ndbm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ndbm.h; sourceTree = ""; }; + C9B53891138D9E990028D27C /* utmpx.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utmpx.h; sourceTree = ""; }; + C9B53893138D9E990028D27C /* nlist.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nlist.h; sourceTree = ""; }; + C9B53899138D9E990028D27C /* paths.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = paths.h; sourceTree = ""; }; + C9B5389A138D9E990028D27C /* poll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = poll.h; sourceTree = ""; }; + C9B5389D138D9E990028D27C /* routed.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = routed.h; sourceTree = ""; }; + C9B5389E138D9E990028D27C /* rwhod.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rwhod.h; sourceTree = ""; }; + C9B5389F138D9E990028D27C /* talkd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = talkd.h; sourceTree = ""; }; + C9B538A0138D9E990028D27C /* timed.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = timed.h; sourceTree = ""; }; + C9B538A2138D9E990028D27C /* ranlib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ranlib.h; sourceTree = ""; }; + C9B538A3138D9E990028D27C /* readpassphrase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = readpassphrase.h; sourceTree = ""; }; + C9B538A4138D9E990028D27C /* regex.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = regex.h; sourceTree = ""; }; + C9B538A5138D9E990028D27C /* rune.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rune.h; sourceTree = ""; }; + C9B538A6138D9E990028D27C /* runetype.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = runetype.h; sourceTree = ""; }; + C9B538A7138D9E990028D27C /* search.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = search.h; sourceTree = ""; }; + C9B538A9138D9E990028D27C /* _common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _common.h; sourceTree = ""; }; + C9B538AA138D9E990028D27C /* _stdio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _stdio.h; sourceTree = ""; }; + C9B538AB138D9E990028D27C /* _string.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _string.h; sourceTree = ""; }; + C9B538AD138D9E990028D27C /* semaphore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = semaphore.h; sourceTree = ""; }; + C9B538AF138D9E990028D27C /* sgtty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sgtty.h; sourceTree = ""; }; + C9B538B0138D9E990028D27C /* signal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = signal.h; sourceTree = ""; }; + C9B538B3138D9E990028D27C /* stab.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stab.h; sourceTree = ""; }; + C9B538B4138D9E990028D27C /* standards.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = standards.h; sourceTree = ""; }; + C9B538B6138D9E990028D27C /* stddef.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stddef.h; sourceTree = ""; }; + C9B538B7138D9E990028D27C /* stdint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stdint.h; sourceTree = ""; }; + C9B538B8138D9E990028D27C /* stdio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stdio.h; sourceTree = ""; }; + C9B538B9138D9E990028D27C /* stdlib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stdlib.h; sourceTree = ""; }; + C9B538BA138D9E990028D27C /* strhash.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = strhash.h; sourceTree = ""; }; + C9B538BB138D9E990028D27C /* string.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = string.h; sourceTree = ""; }; + C9B538BC138D9E990028D27C /* stringlist.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stringlist.h; sourceTree = ""; }; + C9B538BD138D9E990028D27C /* strings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = strings.h; sourceTree = ""; }; + C9B538BE138D9E990028D27C /* struct.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = struct.h; sourceTree = ""; }; + C9B538C0138D9E990028D27C /* acl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = acl.h; sourceTree = ""; }; + C9B538C1138D9E990028D27C /* cdefs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cdefs.h; sourceTree = ""; }; + C9B538C3138D9E990028D27C /* statvfs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = statvfs.h; sourceTree = ""; }; + C9B538C4138D9E990028D27C /* sysexits.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sysexits.3; sourceTree = ""; }; + C9B538C5138D9E990028D27C /* sysexits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sysexits.h; sourceTree = ""; }; + C9B538C6138D9E990028D27C /* syslog.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = syslog.h; sourceTree = ""; }; + C9B538C7138D9E990028D27C /* tar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tar.h; sourceTree = ""; }; + C9B538C8138D9E990028D27C /* termios.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = termios.h; sourceTree = ""; }; + C9B538C9138D9E990028D27C /* time.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = time.h; sourceTree = ""; }; + C9B538CA138D9E990028D27C /* timeconv.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = timeconv.h; sourceTree = ""; }; + C9B538CB138D9E990028D27C /* ttyent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ttyent.h; sourceTree = ""; }; + C9B538CD138D9E990028D27C /* ulimit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ulimit.h; sourceTree = ""; }; + C9B538CE138D9E990028D27C /* unistd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = unistd.h; sourceTree = ""; }; + C9B538CF138D9E990028D27C /* util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = ""; }; + C9B538D0138D9E990028D27C /* utime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utime.h; sourceTree = ""; }; + C9B538D1138D9E990028D27C /* utmp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utmp.h; sourceTree = ""; }; + C9B538D2138D9E990028D27C /* vis.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = vis.h; sourceTree = ""; }; + C9B538D3138D9E990028D27C /* wchar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wchar.h; sourceTree = ""; }; + C9B538D4138D9E990028D27C /* wctype.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wctype.h; sourceTree = ""; }; + C9B538D5138D9E990028D27C /* wordexp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wordexp.h; sourceTree = ""; }; + C9B538D7138D9E990028D27C /* __wctype.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = __wctype.h; sourceTree = ""; }; + C9B538D8138D9E990028D27C /* _ctype.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _ctype.h; sourceTree = ""; }; + C9B538D9138D9E990028D27C /* _inttypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _inttypes.h; sourceTree = ""; }; + C9B538DA138D9E990028D27C /* _langinfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _langinfo.h; sourceTree = ""; }; + C9B538DB138D9E990028D27C /* _monetary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _monetary.h; sourceTree = ""; }; + C9B538DC138D9E990028D27C /* _stdio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _stdio.h; sourceTree = ""; }; + C9B538DD138D9E990028D27C /* _stdlib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _stdlib.h; sourceTree = ""; }; + C9B538DE138D9E990028D27C /* _string.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _string.h; sourceTree = ""; }; + C9B538DF138D9E990028D27C /* _time.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _time.h; sourceTree = ""; }; + C9B538E0138D9E990028D27C /* _wchar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _wchar.h; sourceTree = ""; }; + C9B538E1138D9E990028D27C /* _wctype.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _wctype.h; sourceTree = ""; }; + C9B538E3138D9E990028D27C /* xlocale.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = xlocale.h; sourceTree = ""; }; + C9B538FF138D9E990028D27C /* ctype_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ctype_l.3; sourceTree = ""; }; + C9B53900138D9E990028D27C /* duplocale.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = duplocale.3; sourceTree = ""; }; + C9B53902138D9E990028D27C /* ascii.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ascii.c; sourceTree = ""; }; + C9B53904138D9E990028D27C /* big5.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = big5.5; sourceTree = ""; }; + C9B53905138D9E990028D27C /* big5.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = big5.c; sourceTree = ""; }; + C9B53907138D9E990028D27C /* btowc.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = btowc.3; sourceTree = ""; }; + C9B53909138D9E990028D27C /* btowc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = btowc.c; sourceTree = ""; }; + C9B5390B138D9E990028D27C /* collate.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = collate.c; sourceTree = ""; }; + C9B5390D138D9E990028D27C /* collate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = collate.h; sourceTree = ""; }; + C9B5390F138D9E990028D27C /* collcmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = collcmp.c; sourceTree = ""; }; + C9B53911138D9E990028D27C /* ctype.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ctype.3; sourceTree = ""; }; + C9B53913138D9E990028D27C /* digittoint.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = digittoint.3; sourceTree = ""; }; + C9B53915138D9E990028D27C /* euc.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = euc.5; sourceTree = ""; }; + C9B53916138D9E990028D27C /* euc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = euc.c; sourceTree = ""; }; + C9B53918138D9E990028D27C /* fix_grouping.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fix_grouping.c; sourceTree = ""; }; + C9B5391A138D9E990028D27C /* gb18030.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = gb18030.5; sourceTree = ""; }; + C9B5391B138D9E990028D27C /* gb18030.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gb18030.c; sourceTree = ""; }; + C9B5391D138D9E990028D27C /* gb2312.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = gb2312.5; sourceTree = ""; }; + C9B5391E138D9E990028D27C /* gb2312.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gb2312.c; sourceTree = ""; }; + C9B53920138D9E990028D27C /* gbk.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = gbk.5; sourceTree = ""; }; + C9B53921138D9E990028D27C /* gbk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gbk.c; sourceTree = ""; }; + C9B53923138D9E990028D27C /* isalnum.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isalnum.3; sourceTree = ""; }; + C9B53925138D9E990028D27C /* isalpha.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isalpha.3; sourceTree = ""; }; + C9B53927138D9E990028D27C /* isascii.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isascii.3; sourceTree = ""; }; + C9B53928138D9E990028D27C /* isblank.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isblank.3; sourceTree = ""; }; + C9B5392A138D9E990028D27C /* iscntrl.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = iscntrl.3; sourceTree = ""; }; + C9B5392C138D9E990028D27C /* isdigit.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isdigit.3; sourceTree = ""; }; + C9B5392E138D9E990028D27C /* isgraph.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isgraph.3; sourceTree = ""; }; + C9B53930138D9E990028D27C /* isideogram.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isideogram.3; sourceTree = ""; }; + C9B53932138D9E990028D27C /* islower.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = islower.3; sourceTree = ""; }; + C9B53934138D9E990028D27C /* isphonogram.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isphonogram.3; sourceTree = ""; }; + C9B53936138D9E990028D27C /* isprint.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isprint.3; sourceTree = ""; }; + C9B53938138D9E990028D27C /* ispunct.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ispunct.3; sourceTree = ""; }; + C9B5393A138D9E990028D27C /* isrune.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isrune.3; sourceTree = ""; }; + C9B5393C138D9E990028D27C /* isspace.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isspace.3; sourceTree = ""; }; + C9B5393E138D9E990028D27C /* isspecial.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isspecial.3; sourceTree = ""; }; + C9B53940138D9E990028D27C /* isupper.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isupper.3; sourceTree = ""; }; + C9B53942138D9E990028D27C /* iswalnum.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = iswalnum.3; sourceTree = ""; }; + C9B53944138D9E990028D27C /* isxdigit.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isxdigit.3; sourceTree = ""; }; + C9B53946138D9E990028D27C /* ldpart.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ldpart.c; sourceTree = ""; }; + C9B53948138D9E990028D27C /* ldpart.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ldpart.h; sourceTree = ""; }; + C9B5394A138D9E990028D27C /* lmessages.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lmessages.c; sourceTree = ""; }; + C9B5394C138D9E990028D27C /* lmessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lmessages.h; sourceTree = ""; }; + C9B5394E138D9E990028D27C /* lmonetary.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lmonetary.c; sourceTree = ""; }; + C9B53950138D9E990028D27C /* lmonetary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lmonetary.h; sourceTree = ""; }; + C9B53952138D9E990028D27C /* lnumeric.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lnumeric.c; sourceTree = ""; }; + C9B53954138D9E990028D27C /* lnumeric.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lnumeric.h; sourceTree = ""; }; + C9B53956138D9E990028D27C /* localeconv.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = localeconv.3; sourceTree = ""; }; + C9B53958138D9E990028D27C /* localeconv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = localeconv.c; sourceTree = ""; }; + C9B5395A138D9E990028D27C /* mblen.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mblen.3; sourceTree = ""; }; + C9B5395C138D9E990028D27C /* mblen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mblen.c; sourceTree = ""; }; + C9B5395E138D9E990028D27C /* mblocal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mblocal.h; sourceTree = ""; }; + C9B53960138D9E990028D27C /* mbrlen.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mbrlen.3; sourceTree = ""; }; + C9B53962138D9E990028D27C /* mbrlen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mbrlen.c; sourceTree = ""; }; + C9B53964138D9E990028D27C /* mbrtowc.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mbrtowc.3; sourceTree = ""; }; + C9B53966138D9E990028D27C /* mbrtowc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mbrtowc.c; sourceTree = ""; }; + C9B53968138D9E990028D27C /* mbsinit.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mbsinit.3; sourceTree = ""; }; + C9B5396A138D9E990028D27C /* mbsinit.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mbsinit.c; sourceTree = ""; }; + C9B5396C138D9E990028D27C /* mbsnrtowcs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mbsnrtowcs.c; sourceTree = ""; }; + C9B5396E138D9E990028D27C /* mbsrtowcs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mbsrtowcs.3; sourceTree = ""; }; + C9B53970138D9E990028D27C /* mbsrtowcs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mbsrtowcs.c; sourceTree = ""; }; + C9B53972138D9E990028D27C /* mbstowcs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mbstowcs.3; sourceTree = ""; }; + C9B53974138D9E990028D27C /* mbstowcs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mbstowcs.c; sourceTree = ""; }; + C9B53976138D9E990028D27C /* mbtowc.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mbtowc.3; sourceTree = ""; }; + C9B53978138D9E990028D27C /* mbtowc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mbtowc.c; sourceTree = ""; }; + C9B5397A138D9E990028D27C /* mskanji.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mskanji.5; sourceTree = ""; }; + C9B5397B138D9E990028D27C /* mskanji.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mskanji.c; sourceTree = ""; }; + C9B5397D138D9E990028D27C /* multibyte.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = multibyte.3; sourceTree = ""; }; + C9B5397E138D9E990028D27C /* nextwctype.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = nextwctype.3; sourceTree = ""; }; + C9B53980138D9E990028D27C /* nextwctype.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = nextwctype.c; sourceTree = ""; }; + C9B53982138D9E990028D27C /* nl_langinfo.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = nl_langinfo.3; sourceTree = ""; }; + C9B53984138D9E990028D27C /* nl_langinfo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = nl_langinfo.c; sourceTree = ""; }; + C9B53986138D9E990028D27C /* nomacros.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = nomacros.c; sourceTree = ""; }; + C9B53987138D9E990028D27C /* none.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = none.c; sourceTree = ""; }; + C9B53989138D9E990028D27C /* rune.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rune.c; sourceTree = ""; }; + C9B5398B138D9E990028D27C /* runetype.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = runetype.c; sourceTree = ""; }; + C9B5398D138D9E990028D27C /* setlocale.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = setlocale.3; sourceTree = ""; }; + C9B5398F138D9E990028D27C /* setlocale.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setlocale.c; sourceTree = ""; }; + C9B53991138D9E990028D27C /* setlocale.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = setlocale.h; sourceTree = ""; }; + C9B53993138D9E990028D27C /* setrunelocale.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setrunelocale.c; sourceTree = ""; }; + C9B53995138D9E990028D27C /* table.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = table.c; sourceTree = ""; }; + C9B53997138D9E990028D27C /* toascii.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = toascii.3; sourceTree = ""; }; + C9B53998138D9E990028D27C /* tolower.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tolower.3; sourceTree = ""; }; + C9B5399A138D9E990028D27C /* tolower.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tolower.c; sourceTree = ""; }; + C9B5399C138D9E990028D27C /* toupper.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = toupper.3; sourceTree = ""; }; + C9B5399E138D9E990028D27C /* toupper.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = toupper.c; sourceTree = ""; }; + C9B539A0138D9E990028D27C /* towlower.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = towlower.3; sourceTree = ""; }; + C9B539A2138D9E990028D27C /* towupper.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = towupper.3; sourceTree = ""; }; + C9B539A5138D9E990028D27C /* utf8.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = utf8.5; sourceTree = ""; }; + C9B539A6138D9E990028D27C /* utf8.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = utf8.c; sourceTree = ""; }; + C9B539A8138D9E990028D27C /* wcrtomb.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcrtomb.3; sourceTree = ""; }; + C9B539AA138D9E990028D27C /* wcrtomb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcrtomb.c; sourceTree = ""; }; + C9B539AC138D9E990028D27C /* wcsftime.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcsftime.3; sourceTree = ""; }; + C9B539AE138D9E990028D27C /* wcsftime.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsftime.c; sourceTree = ""; }; + C9B539B0138D9E990028D27C /* wcsnrtombs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsnrtombs.c; sourceTree = ""; }; + C9B539B2138D9E990028D27C /* wcsrtombs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcsrtombs.3; sourceTree = ""; }; + C9B539B4138D9E990028D27C /* wcsrtombs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsrtombs.c; sourceTree = ""; }; + C9B539B6138D9E990028D27C /* wcstod.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcstod.3; sourceTree = ""; }; + C9B539B8138D9E990028D27C /* wcstod.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstod.c; sourceTree = ""; }; + C9B539BA138D9E990028D27C /* wcstof.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstof.c; sourceTree = ""; }; + C9B539BC138D9E990028D27C /* wcstoimax.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstoimax.c; sourceTree = ""; }; + C9B539BE138D9E990028D27C /* wcstol.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcstol.3; sourceTree = ""; }; + C9B539C0138D9E990028D27C /* wcstol.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstol.c; sourceTree = ""; }; + C9B539C2138D9E990028D27C /* wcstold.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstold.c; sourceTree = ""; }; + C9B539C4138D9E990028D27C /* wcstoll.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstoll.c; sourceTree = ""; }; + C9B539C6138D9E990028D27C /* wcstombs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcstombs.3; sourceTree = ""; }; + C9B539C8138D9E990028D27C /* wcstombs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstombs.c; sourceTree = ""; }; + C9B539CA138D9E990028D27C /* wcstoul.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstoul.c; sourceTree = ""; }; + C9B539CC138D9E990028D27C /* wcstoull.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstoull.c; sourceTree = ""; }; + C9B539CE138D9E990028D27C /* wcstoumax.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstoumax.c; sourceTree = ""; }; + C9B539D0138D9E990028D27C /* wctob.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wctob.c; sourceTree = ""; }; + C9B539D2138D9E990028D27C /* wctomb.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wctomb.3; sourceTree = ""; }; + C9B539D4138D9E990028D27C /* wctomb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wctomb.c; sourceTree = ""; }; + C9B539D6138D9E990028D27C /* wctrans.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wctrans.3; sourceTree = ""; }; + C9B539D8138D9E990028D27C /* wctrans.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wctrans.c; sourceTree = ""; }; + C9B539DA138D9E990028D27C /* wctype.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wctype.3; sourceTree = ""; }; + C9B539DC138D9E990028D27C /* wctype.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wctype.c; sourceTree = ""; }; + C9B539DE138D9E990028D27C /* wcwidth.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcwidth.3; sourceTree = ""; }; + C9B539E0138D9E990028D27C /* wcwidth.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcwidth.c; sourceTree = ""; }; + C9B539E2138D9E990028D27C /* freelocale.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = freelocale.3; sourceTree = ""; }; + C9B539E3138D9E990028D27C /* frune.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = frune.c; sourceTree = ""; }; + C9B539E4138D9E990028D27C /* isalnum_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = isalnum_l.3; sourceTree = ""; }; + C9B539E5138D9E990028D27C /* isctype.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = isctype.c; sourceTree = ""; }; + C9B539E6138D9E990028D27C /* iswalnum_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = iswalnum_l.3; sourceTree = ""; }; + C9B539E7138D9E990028D27C /* iswctype.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = iswctype.c; sourceTree = ""; }; + C9B539E8138D9E990028D27C /* lconv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lconv.c; sourceTree = ""; }; + C9B539EA138D9E990028D27C /* mbrune.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mbrune.3; sourceTree = ""; }; + C9B539EB138D9E990028D27C /* mbrune.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mbrune.c; sourceTree = ""; }; + C9B539EC138D9E990028D27C /* newlocale.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = newlocale.3; sourceTree = ""; }; + C9B539ED138D9E990028D27C /* querylocale.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = querylocale.3; sourceTree = ""; }; + C9B539EE138D9E990028D27C /* rune.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = rune.3; sourceTree = ""; }; + C9B539EF138D9E990028D27C /* runedepreciated.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = runedepreciated.c; sourceTree = ""; }; + C9B539F0138D9E990028D27C /* runedepreciated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = runedepreciated.h; sourceTree = ""; }; + C9B539F1138D9E990028D27C /* setinvalidrune.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setinvalidrune.c; sourceTree = ""; }; + C9B539F2138D9E990028D27C /* uselocale.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = uselocale.3; sourceTree = ""; }; + C9B539F3138D9E990028D27C /* utf2.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = utf2.5; sourceTree = ""; }; + C9B539F4138D9E990028D27C /* wcstod_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcstod_l.3; sourceTree = ""; }; + C9B539F5138D9E990028D27C /* wcstol_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcstol_l.3; sourceTree = ""; }; + C9B539F6138D9E990028D27C /* xlocale.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = xlocale.3; sourceTree = ""; }; + C9B539F7138D9E990028D27C /* xlocale.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = xlocale.c; sourceTree = ""; }; + C9B539F8138D9E990028D27C /* xlocale_private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = xlocale_private.h; sourceTree = ""; }; + C9B53A05138D9E990028D27C /* assert.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = assert.3; sourceTree = ""; }; + C9B53A06138D9E990028D27C /* bitstring.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = bitstring.3; sourceTree = ""; }; + C9B53A09138D9E990028D27C /* stdarg.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = stdarg.3; sourceTree = ""; }; + C9B53A0B138D9E990028D27C /* gethostuuid.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = gethostuuid.2; sourceTree = ""; }; + C9B53A0D138D9E990028D27C /* utmp.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = utmp.5; sourceTree = ""; }; + C9B53A0F138D9E990028D27C /* _nbsd_compat_.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _nbsd_compat_.h; sourceTree = ""; }; + C9B53A10138D9E990028D27C /* namespace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = namespace.h; sourceTree = ""; }; + C9B53A12138D9E990028D27C /* byteorder.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = byteorder.3; sourceTree = ""; }; + C9B53A13138D9E990028D27C /* ethers.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ethers.3; sourceTree = ""; }; + C9B53A15138D9E990028D27C /* addr2ascii.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = addr2ascii.3; sourceTree = ""; }; + C9B53A16138D9E990028D27C /* addr2ascii.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = addr2ascii.c; sourceTree = ""; }; + C9B53A17138D9E990028D27C /* ascii2addr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ascii2addr.c; sourceTree = ""; }; + C9B53A18138D9E990028D27C /* inet.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = inet.3; sourceTree = ""; }; + C9B53A1A138D9E990028D27C /* inet_addr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = inet_addr.c; sourceTree = ""; }; + C9B53A1C138D9E990028D27C /* inet_lnaof.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = inet_lnaof.c; sourceTree = ""; }; + C9B53A1D138D9E990028D27C /* inet_makeaddr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = inet_makeaddr.c; sourceTree = ""; }; + C9B53A1E138D9E990028D27C /* inet_net.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = inet_net.3; sourceTree = ""; }; + C9B53A20138D9E990028D27C /* inet_net_ntop.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = inet_net_ntop.c; sourceTree = ""; }; + C9B53A21138D9E990028D27C /* inet_net_pton.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = inet_net_pton.c; sourceTree = ""; }; + C9B53A23138D9E990028D27C /* inet_neta.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = inet_neta.c; sourceTree = ""; }; + C9B53A24138D9E990028D27C /* inet_netof.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = inet_netof.c; sourceTree = ""; }; + C9B53A25138D9E990028D27C /* inet_network.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = inet_network.c; sourceTree = ""; }; + C9B53A27138D9E990028D27C /* inet_ntoa.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = inet_ntoa.c; sourceTree = ""; }; + C9B53A29138D9E990028D27C /* linkaddr.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = linkaddr.3; sourceTree = ""; }; + C9B53A2A138D9E990028D27C /* linkaddr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = linkaddr.c; sourceTree = ""; }; + C9B53A2B138D9E990028D27C /* nsap_addr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = nsap_addr.c; sourceTree = ""; }; + C9B53A2D138D9E990028D27C /* recv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = recv.c; sourceTree = ""; }; + C9B53A2F138D9E990028D27C /* send.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = send.c; sourceTree = ""; }; + C9B53A31138D9E990028D27C /* sockatmark.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sockatmark.3; sourceTree = ""; }; + C9B53A33138D9E990028D27C /* sockatmark.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sockatmark.c; sourceTree = ""; }; + C9B53A34138D9E990028D27C /* sourcefilter.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sourcefilter.3; sourceTree = ""; }; + C9B53A36138D9E990028D27C /* sourcefilter.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sourcefilter.c; sourceTree = ""; }; + C9B53A3C138D9E990028D27C /* catclose.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = catclose.3; sourceTree = ""; }; + C9B53A3D138D9E990028D27C /* catgets.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = catgets.3; sourceTree = ""; }; + C9B53A3E138D9E990028D27C /* catopen.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = catopen.3; sourceTree = ""; }; + C9B53A3F138D9E990028D27C /* msgcat.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = msgcat.c; sourceTree = ""; }; + C9B53A41138D9E990028D27C /* msgcat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = msgcat.h; sourceTree = ""; }; + C9B53A47138D9E990028D27C /* Makefile.inc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.pascal; path = Makefile.inc; sourceTree = ""; }; + C9B53A49138D9E990028D27C /* Makefile.inc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.pascal; path = Makefile.inc; sourceTree = ""; }; + C9B53A4B138D9E990028D27C /* acl.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl.3; sourceTree = ""; }; + C9B53A4C138D9E990028D27C /* acl.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = acl.c; sourceTree = ""; }; + C9B53A4D138D9E990028D27C /* acl_add_flag_np.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_add_flag_np.3; sourceTree = ""; }; + C9B53A4E138D9E990028D27C /* acl_add_perm.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_add_perm.3; sourceTree = ""; }; + C9B53A4F138D9E990028D27C /* acl_clear_flags_np.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_clear_flags_np.3; sourceTree = ""; }; + C9B53A50138D9E990028D27C /* acl_clear_perms.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_clear_perms.3; sourceTree = ""; }; + C9B53A51138D9E990028D27C /* acl_copy_entry.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_copy_entry.3; sourceTree = ""; }; + C9B53A52138D9E990028D27C /* acl_copy_ext.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_copy_ext.3; sourceTree = ""; }; + C9B53A53138D9E990028D27C /* acl_create_entry.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_create_entry.3; sourceTree = ""; }; + C9B53A54138D9E990028D27C /* acl_delete.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_delete.3; sourceTree = ""; }; + C9B53A55138D9E990028D27C /* acl_delete_entry.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_delete_entry.3; sourceTree = ""; }; + C9B53A56138D9E990028D27C /* acl_delete_flag_np.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_delete_flag_np.3; sourceTree = ""; }; + C9B53A57138D9E990028D27C /* acl_delete_perm.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_delete_perm.3; sourceTree = ""; }; + C9B53A58138D9E990028D27C /* acl_dup.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_dup.3; sourceTree = ""; }; + C9B53A59138D9E990028D27C /* acl_entry.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = acl_entry.c; sourceTree = ""; }; + C9B53A5A138D9E990028D27C /* acl_file.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = acl_file.c; sourceTree = ""; }; + C9B53A5B138D9E990028D27C /* acl_flag.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = acl_flag.c; sourceTree = ""; }; + C9B53A5C138D9E990028D27C /* acl_free.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_free.3; sourceTree = ""; }; + C9B53A5D138D9E990028D27C /* acl_from_text.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_from_text.3; sourceTree = ""; }; + C9B53A5E138D9E990028D27C /* acl_get.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_get.3; sourceTree = ""; }; + C9B53A5F138D9E990028D27C /* acl_get_entry.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_get_entry.3; sourceTree = ""; }; + C9B53A60138D9E990028D27C /* acl_get_fd.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_get_fd.3; sourceTree = ""; }; + C9B53A61138D9E990028D27C /* acl_get_flagset_np.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_get_flagset_np.3; sourceTree = ""; }; + C9B53A62138D9E990028D27C /* acl_get_perm_np.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_get_perm_np.3; sourceTree = ""; }; + C9B53A63138D9E990028D27C /* acl_get_permset.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_get_permset.3; sourceTree = ""; }; + C9B53A64138D9E990028D27C /* acl_get_permset_mask_np.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_get_permset_mask_np.3; sourceTree = ""; }; + C9B53A65138D9E990028D27C /* acl_get_qualifier.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_get_qualifier.3; sourceTree = ""; }; + C9B53A66138D9E990028D27C /* acl_get_tag_type.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_get_tag_type.3; sourceTree = ""; }; + C9B53A67138D9E990028D27C /* acl_init.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_init.3; sourceTree = ""; }; + C9B53A68138D9E990028D27C /* acl_perm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = acl_perm.c; sourceTree = ""; }; + C9B53A69138D9E990028D27C /* acl_set.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_set.3; sourceTree = ""; }; + C9B53A6A138D9E990028D27C /* acl_set_flagset_np.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_set_flagset_np.3; sourceTree = ""; }; + C9B53A6B138D9E990028D27C /* acl_set_permset.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_set_permset.3; sourceTree = ""; }; + C9B53A6C138D9E990028D27C /* acl_set_qualifier.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_set_qualifier.3; sourceTree = ""; }; + C9B53A6D138D9E990028D27C /* acl_set_tag_type.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_set_tag_type.3; sourceTree = ""; }; + C9B53A6E138D9E990028D27C /* acl_to_text.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_to_text.3; sourceTree = ""; }; + C9B53A6F138D9E990028D27C /* acl_translate.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = acl_translate.c; sourceTree = ""; }; + C9B53A70138D9E990028D27C /* acl_valid.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = acl_valid.3; sourceTree = ""; }; + C9B53A71138D9E990028D27C /* aclvar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = aclvar.h; sourceTree = ""; }; + C9B53B06138D9E990028D27C /* cname.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cname.h; sourceTree = ""; }; + C9B53B08138D9E990028D27C /* COPYRIGHT */ = {isa = PBXFileReference; lastKnownFileType = text; path = COPYRIGHT; sourceTree = ""; }; + C9B53B0B138D9E990028D27C /* re_format.7 */ = {isa = PBXFileReference; lastKnownFileType = text; path = re_format.7; sourceTree = ""; }; + C9B53B0E138D9E990028D27C /* regerror.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = regerror.c; sourceTree = ""; }; + C9B53B10138D9E990028D27C /* regex.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = regex.3; sourceTree = ""; }; + C9B53B18138D9E990028D27C /* utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utils.h; sourceTree = ""; }; + C9B53B19138D9E990028D27C /* WHATSNEW */ = {isa = PBXFileReference; lastKnownFileType = text; path = WHATSNEW; sourceTree = ""; }; + C9B53B1E138D9E990028D27C /* chk_fail.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = chk_fail.c; sourceTree = ""; }; + C9B53B20138D9E990028D27C /* memcpy_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memcpy_chk.c; sourceTree = ""; }; + C9B53B21138D9E990028D27C /* memmove_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memmove_chk.c; sourceTree = ""; }; + C9B53B22138D9E990028D27C /* memset_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memset_chk.c; sourceTree = ""; }; + C9B53B23138D9E990028D27C /* snprintf_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = snprintf_chk.c; sourceTree = ""; }; + C9B53B24138D9E990028D27C /* sprintf_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sprintf_chk.c; sourceTree = ""; }; + C9B53B25138D9E990028D27C /* stpcpy_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = stpcpy_chk.c; sourceTree = ""; }; + C9B53B26138D9E990028D27C /* stpncpy_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = stpncpy_chk.c; sourceTree = ""; }; + C9B53B27138D9E990028D27C /* strcat_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strcat_chk.c; sourceTree = ""; }; + C9B53B28138D9E990028D27C /* strcpy_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strcpy_chk.c; sourceTree = ""; }; + C9B53B29138D9E990028D27C /* strncat_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strncat_chk.c; sourceTree = ""; }; + C9B53B2A138D9E990028D27C /* strncpy_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strncpy_chk.c; sourceTree = ""; }; + C9B53B2B138D9E990028D27C /* vsnprintf_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vsnprintf_chk.c; sourceTree = ""; }; + C9B53B2C138D9E990028D27C /* vsprintf_chk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vsprintf_chk.c; sourceTree = ""; }; + C9B53B2F138D9E990028D27C /* _flock_stub.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = _flock_stub.c; sourceTree = ""; }; + C9B53B30138D9E990028D27C /* asprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = asprintf.c; sourceTree = ""; }; + C9B53B32138D9E990028D27C /* clrerr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = clrerr.c; sourceTree = ""; }; + C9B53B33138D9E990028D27C /* dprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = dprintf.c; sourceTree = ""; }; + C9B53B35138D9E990028D27C /* fclose.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fclose.3; sourceTree = ""; }; + C9B53B36138D9E990028D27C /* fclose.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fclose.c; sourceTree = ""; }; + C9B53B38138D9E990028D27C /* fdopen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fdopen.c; sourceTree = ""; }; + C9B53B3A138D9E990028D27C /* feof.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = feof.c; sourceTree = ""; }; + C9B53B3B138D9E990028D27C /* ferror.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ferror.3; sourceTree = ""; }; + C9B53B3C138D9E990028D27C /* ferror.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ferror.c; sourceTree = ""; }; + C9B53B3D138D9E990028D27C /* fflush.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fflush.3; sourceTree = ""; }; + C9B53B3E138D9E990028D27C /* fflush.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fflush.c; sourceTree = ""; }; + C9B53B40138D9E990028D27C /* fgetc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fgetc.c; sourceTree = ""; }; + C9B53B41138D9E990028D27C /* fgetln.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fgetln.3; sourceTree = ""; }; + C9B53B43138D9E990028D27C /* fgetln.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fgetln.c; sourceTree = ""; }; + C9B53B45138D9E990028D27C /* fgetpos.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fgetpos.c; sourceTree = ""; }; + C9B53B46138D9E990028D27C /* fgets.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fgets.3; sourceTree = ""; }; + C9B53B47138D9E990028D27C /* fgets.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fgets.c; sourceTree = ""; }; + C9B53B48138D9E990028D27C /* fgetwc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fgetwc.c; sourceTree = ""; }; + C9B53B4A138D9E990028D27C /* fgetwln.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fgetwln.3; sourceTree = ""; }; + C9B53B4C138D9E990028D27C /* fgetwln.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fgetwln.c; sourceTree = ""; }; + C9B53B4E138D9E990028D27C /* fgetws.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fgetws.3; sourceTree = ""; }; + C9B53B50138D9E990028D27C /* fgetws.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fgetws.c; sourceTree = ""; }; + C9B53B52138D9E990028D27C /* fileno.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fileno.c; sourceTree = ""; }; + C9B53B53138D9E990028D27C /* findfp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = findfp.c; sourceTree = ""; }; + C9B53B55138D9E990028D27C /* flags.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = flags.c; sourceTree = ""; }; + C9B53B57138D9E990028D27C /* floatio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = floatio.h; sourceTree = ""; }; + C9B53B58138D9E990028D27C /* flockfile.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = flockfile.3; sourceTree = ""; }; + C9B53B5A138D9E990028D27C /* fopen.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fopen.3; sourceTree = ""; }; + C9B53B5C138D9E990028D27C /* fopen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fopen.c; sourceTree = ""; }; + C9B53B5E138D9E990028D27C /* fprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fprintf.c; sourceTree = ""; }; + C9B53B60138D9E990028D27C /* fpurge.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fpurge.c; sourceTree = ""; }; + C9B53B61138D9E990028D27C /* fputc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fputc.c; sourceTree = ""; }; + C9B53B62138D9E990028D27C /* fputs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fputs.3; sourceTree = ""; }; + C9B53B64138D9E990028D27C /* fputs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fputs.c; sourceTree = ""; }; + C9B53B66138D9E990028D27C /* fputwc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fputwc.c; sourceTree = ""; }; + C9B53B68138D9E990028D27C /* fputws.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fputws.3; sourceTree = ""; }; + C9B53B6A138D9E990028D27C /* fputws.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fputws.c; sourceTree = ""; }; + C9B53B6C138D9E990028D27C /* fread.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fread.3; sourceTree = ""; }; + C9B53B6E138D9E990028D27C /* fread.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fread.c; sourceTree = ""; }; + C9B53B70138D9E990028D27C /* freopen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = freopen.c; sourceTree = ""; }; + C9B53B72138D9E990028D27C /* fscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fscanf.c; sourceTree = ""; }; + C9B53B74138D9E990028D27C /* fseek.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fseek.3; sourceTree = ""; }; + C9B53B76138D9E990028D27C /* fseek.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fseek.c; sourceTree = ""; }; + C9B53B77138D9E990028D27C /* fsetpos.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fsetpos.c; sourceTree = ""; }; + C9B53B78138D9E990028D27C /* ftell.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ftell.c; sourceTree = ""; }; + C9B53B7A138D9E990028D27C /* funopen.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = funopen.3; sourceTree = ""; }; + C9B53B7B138D9E990028D27C /* funopen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = funopen.c; sourceTree = ""; }; + C9B53B7D138D9E990028D27C /* fvwrite.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fvwrite.c; sourceTree = ""; }; + C9B53B7E138D9E990028D27C /* fvwrite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fvwrite.h; sourceTree = ""; }; + C9B53B7F138D9E990028D27C /* fwalk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fwalk.c; sourceTree = ""; }; + C9B53B80138D9E990028D27C /* fwide.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fwide.3; sourceTree = ""; }; + C9B53B82138D9E990028D27C /* fwide.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fwide.c; sourceTree = ""; }; + C9B53B83138D9E990028D27C /* fwprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fwprintf.c; sourceTree = ""; }; + C9B53B85138D9E990028D27C /* fwrite.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fwrite.c; sourceTree = ""; }; + C9B53B87138D9E990028D27C /* fwscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fwscanf.c; sourceTree = ""; }; + C9B53B89138D9E990028D27C /* getc.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getc.3; sourceTree = ""; }; + C9B53B8B138D9E990028D27C /* getc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getc.c; sourceTree = ""; }; + C9B53B8C138D9E990028D27C /* getchar.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getchar.c; sourceTree = ""; }; + C9B53B8D138D9E990028D27C /* getdelim.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getdelim.c; sourceTree = ""; }; + C9B53B8E138D9E990028D27C /* getline.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getline.3; sourceTree = ""; }; + C9B53B90138D9E990028D27C /* getline.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getline.c; sourceTree = ""; }; + C9B53B91138D9E990028D27C /* gets.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gets.c; sourceTree = ""; }; + C9B53B92138D9E990028D27C /* getw.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getw.c; sourceTree = ""; }; + C9B53B93138D9E990028D27C /* getwc.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getwc.3; sourceTree = ""; }; + C9B53B95138D9E990028D27C /* getwc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getwc.c; sourceTree = ""; }; + C9B53B97138D9E990028D27C /* getwchar.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getwchar.c; sourceTree = ""; }; + C9B53B99138D9E990028D27C /* glue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = glue.h; sourceTree = ""; }; + C9B53B9A138D9E990028D27C /* local.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = local.h; sourceTree = ""; }; + C9B53B9C138D9E990028D27C /* makebuf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = makebuf.c; sourceTree = ""; }; + C9B53B9E138D9E990028D27C /* mktemp.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = mktemp.3; sourceTree = ""; }; + C9B53BA0138D9E990028D27C /* mktemp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mktemp.c; sourceTree = ""; }; + C9B53BA2138D9E990028D27C /* perror.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = perror.c; sourceTree = ""; }; + C9B53BA3138D9E990028D27C /* printf-pos.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "printf-pos.c"; sourceTree = ""; }; + C9B53BA5138D9E990028D27C /* printf.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = printf.3; sourceTree = ""; }; + C9B53BA7138D9E990028D27C /* printf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = printf.c; sourceTree = ""; }; + C9B53BA9138D9E990028D27C /* printfcommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = printfcommon.h; sourceTree = ""; }; + C9B53BAB138D9E990028D27C /* printflocal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = printflocal.h; sourceTree = ""; }; + C9B53BAD138D9E990028D27C /* putc.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = putc.3; sourceTree = ""; }; + C9B53BAF138D9E990028D27C /* putc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = putc.c; sourceTree = ""; }; + C9B53BB0138D9E990028D27C /* putchar.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = putchar.c; sourceTree = ""; }; + C9B53BB1138D9E990028D27C /* puts.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = puts.c; sourceTree = ""; }; + C9B53BB3138D9E990028D27C /* putw.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = putw.c; sourceTree = ""; }; + C9B53BB4138D9E990028D27C /* putwc.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = putwc.3; sourceTree = ""; }; + C9B53BB6138D9E990028D27C /* putwc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = putwc.c; sourceTree = ""; }; + C9B53BB8138D9E990028D27C /* putwchar.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = putwchar.c; sourceTree = ""; }; + C9B53BBA138D9E990028D27C /* refill.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = refill.c; sourceTree = ""; }; + C9B53BBC138D9E990028D27C /* remove.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = remove.3; sourceTree = ""; }; + C9B53BBE138D9E990028D27C /* remove.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = remove.c; sourceTree = ""; }; + C9B53BBF138D9E990028D27C /* rewind.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rewind.c; sourceTree = ""; }; + C9B53BC1138D9E990028D27C /* rget.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rget.c; sourceTree = ""; }; + C9B53BC2138D9E990028D27C /* scanf.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = scanf.3; sourceTree = ""; }; + C9B53BC4138D9E990028D27C /* scanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = scanf.c; sourceTree = ""; }; + C9B53BC6138D9E990028D27C /* setbuf.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = setbuf.3; sourceTree = ""; }; + C9B53BC8138D9E990028D27C /* setbuf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setbuf.c; sourceTree = ""; }; + C9B53BC9138D9E990028D27C /* setbuffer.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setbuffer.c; sourceTree = ""; }; + C9B53BCA138D9E990028D27C /* setvbuf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setvbuf.c; sourceTree = ""; }; + C9B53BCB138D9E990028D27C /* snprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = snprintf.c; sourceTree = ""; }; + C9B53BCD138D9E990028D27C /* sprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sprintf.c; sourceTree = ""; }; + C9B53BCF138D9E990028D27C /* sscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sscanf.c; sourceTree = ""; }; + C9B53BD1138D9E990028D27C /* stdio.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = stdio.3; sourceTree = ""; }; + C9B53BD3138D9E990028D27C /* stdio.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = stdio.c; sourceTree = ""; }; + C9B53BD4138D9E990028D27C /* swprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = swprintf.c; sourceTree = ""; }; + C9B53BD6138D9E990028D27C /* swscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = swscanf.c; sourceTree = ""; }; + C9B53BD8138D9E990028D27C /* tempnam.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tempnam.c; sourceTree = ""; }; + C9B53BDA138D9E990028D27C /* tmpfile.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tmpfile.c; sourceTree = ""; }; + C9B53BDB138D9E990028D27C /* tmpnam.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tmpnam.3; sourceTree = ""; }; + C9B53BDD138D9E990028D27C /* tmpnam.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tmpnam.c; sourceTree = ""; }; + C9B53BDF138D9E990028D27C /* ungetc.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ungetc.3; sourceTree = ""; }; + C9B53BE1138D9E990028D27C /* ungetc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ungetc.c; sourceTree = ""; }; + C9B53BE2138D9E990028D27C /* ungetwc.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ungetwc.3; sourceTree = ""; }; + C9B53BE4138D9E990028D27C /* ungetwc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ungetwc.c; sourceTree = ""; }; + C9B53BE6138D9E990028D27C /* vasprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vasprintf.c; sourceTree = ""; }; + C9B53BE8138D9E990028D27C /* vdprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vdprintf.c; sourceTree = ""; }; + C9B53BEA138D9E990028D27C /* vfprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vfprintf.c; sourceTree = ""; }; + C9B53BEC138D9E990028D27C /* vfscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vfscanf.c; sourceTree = ""; }; + C9B53BEE138D9E9A0028D27C /* vfwprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vfwprintf.c; sourceTree = ""; }; + C9B53BF0138D9E9A0028D27C /* vfwscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vfwscanf.c; sourceTree = ""; }; + C9B53BF2138D9E9A0028D27C /* vprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vprintf.c; sourceTree = ""; }; + C9B53BF4138D9E9A0028D27C /* vscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vscanf.c; sourceTree = ""; }; + C9B53BF6138D9E9A0028D27C /* vsnprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vsnprintf.c; sourceTree = ""; }; + C9B53BF8138D9E9A0028D27C /* vsprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vsprintf.c; sourceTree = ""; }; + C9B53BFA138D9E9A0028D27C /* vsscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vsscanf.c; sourceTree = ""; }; + C9B53BFC138D9E9A0028D27C /* vswprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vswprintf.c; sourceTree = ""; }; + C9B53BFE138D9E9A0028D27C /* vswscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vswscanf.c; sourceTree = ""; }; + C9B53C00138D9E9A0028D27C /* vwprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vwprintf.c; sourceTree = ""; }; + C9B53C02138D9E9A0028D27C /* vwscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vwscanf.c; sourceTree = ""; }; + C9B53C04138D9E9A0028D27C /* wbuf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wbuf.c; sourceTree = ""; }; + C9B53C06138D9E9A0028D27C /* wprintf.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wprintf.3; sourceTree = ""; }; + C9B53C08138D9E9A0028D27C /* wprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wprintf.c; sourceTree = ""; }; + C9B53C0A138D9E9A0028D27C /* wscanf.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wscanf.3; sourceTree = ""; }; + C9B53C0C138D9E9A0028D27C /* wscanf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wscanf.c; sourceTree = ""; }; + C9B53C0E138D9E9A0028D27C /* wsetup.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wsetup.c; sourceTree = ""; }; + C9B53C0F138D9E9A0028D27C /* getwc_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getwc_l.3; sourceTree = ""; }; + C9B53C11138D9E9A0028D27C /* printf_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = printf_l.3; sourceTree = ""; }; + C9B53C12138D9E9A0028D27C /* putwc_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = putwc_l.3; sourceTree = ""; }; + C9B53C13138D9E9A0028D27C /* scanf_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = scanf_l.3; sourceTree = ""; }; + C9B53C14138D9E9A0028D27C /* wprintf_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wprintf_l.3; sourceTree = ""; }; + C9B53C15138D9E9A0028D27C /* wscanf_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wscanf_l.3; sourceTree = ""; }; + C9B53C17138D9E9A0028D27C /* a64l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = a64l.3; sourceTree = ""; }; + C9B53C18138D9E9A0028D27C /* a64l.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = a64l.c; sourceTree = ""; }; + C9B53C1A138D9E9A0028D27C /* _Exit_.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = _Exit_.c; sourceTree = ""; }; + C9B53C1B138D9E9A0028D27C /* abort.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = abort.3; sourceTree = ""; }; + C9B53C1D138D9E9A0028D27C /* abort.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = abort.c; sourceTree = ""; }; + C9B53C1F138D9E9A0028D27C /* abs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = abs.3; sourceTree = ""; }; + C9B53C21138D9E9A0028D27C /* abs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = abs.c; sourceTree = ""; }; + C9B53C22138D9E9A0028D27C /* alloca.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = alloca.3; sourceTree = ""; }; + C9B53C24138D9E9A0028D27C /* atexit.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = atexit.3; sourceTree = ""; }; + C9B53C26138D9E9A0028D27C /* atexit.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = atexit.c; sourceTree = ""; }; + C9B53C28138D9E9A0028D27C /* atexit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = atexit.h; sourceTree = ""; }; + C9B53C2A138D9E9A0028D27C /* atof.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = atof.3; sourceTree = ""; }; + C9B53C2C138D9E9A0028D27C /* atof.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = atof.c; sourceTree = ""; }; + C9B53C2E138D9E9A0028D27C /* atoi.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = atoi.3; sourceTree = ""; }; + C9B53C30138D9E9A0028D27C /* atoi.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = atoi.c; sourceTree = ""; }; + C9B53C32138D9E9A0028D27C /* atol.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = atol.3; sourceTree = ""; }; + C9B53C34138D9E9A0028D27C /* atol.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = atol.c; sourceTree = ""; }; + C9B53C36138D9E9A0028D27C /* atoll.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = atoll.c; sourceTree = ""; }; + C9B53C38138D9E9A0028D27C /* bsearch.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = bsearch.3; sourceTree = ""; }; + C9B53C3A138D9E9A0028D27C /* bsearch.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bsearch.c; sourceTree = ""; }; + C9B53C3C138D9E9A0028D27C /* div.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = div.3; sourceTree = ""; }; + C9B53C3E138D9E9A0028D27C /* div.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = div.c; sourceTree = ""; }; + C9B53C3F138D9E9A0028D27C /* exit.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = exit.3; sourceTree = ""; }; + C9B53C40138D9E9A0028D27C /* exit.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = exit.c; sourceTree = ""; }; + C9B53C42138D9E9A0028D27C /* getenv.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getenv.3; sourceTree = ""; }; + C9B53C44138D9E9A0028D27C /* getenv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getenv.c; sourceTree = ""; }; + C9B53C46138D9E9A0028D27C /* getopt.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getopt.3; sourceTree = ""; }; + C9B53C47138D9E9A0028D27C /* getopt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getopt.c; sourceTree = ""; }; + C9B53C49138D9E9A0028D27C /* getopt_long.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getopt_long.3; sourceTree = ""; }; + C9B53C4A138D9E9A0028D27C /* getopt_long.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getopt_long.c; sourceTree = ""; }; + C9B53C4B138D9E9A0028D27C /* getsubopt.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getsubopt.3; sourceTree = ""; }; + C9B53C4D138D9E9A0028D27C /* getsubopt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getsubopt.c; sourceTree = ""; }; + C9B53C4E138D9E9A0028D27C /* hcreate.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = hcreate.3; sourceTree = ""; }; + C9B53C4F138D9E9A0028D27C /* hcreate.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hcreate.c; sourceTree = ""; }; + C9B53C50138D9E9A0028D27C /* heapsort.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = heapsort.c; sourceTree = ""; }; + C9B53C53138D9E9A0028D27C /* imaxabs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = imaxabs.3; sourceTree = ""; }; + C9B53C54138D9E9A0028D27C /* imaxabs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = imaxabs.c; sourceTree = ""; }; + C9B53C55138D9E9A0028D27C /* imaxdiv.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = imaxdiv.3; sourceTree = ""; }; + C9B53C57138D9E9A0028D27C /* imaxdiv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = imaxdiv.c; sourceTree = ""; }; + C9B53C58138D9E9A0028D27C /* insque.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = insque.3; sourceTree = ""; }; + C9B53C5A138D9E9A0028D27C /* insque.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = insque.c; sourceTree = ""; }; + C9B53C5B138D9E9A0028D27C /* labs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = labs.3; sourceTree = ""; }; + C9B53C5D138D9E9A0028D27C /* labs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = labs.c; sourceTree = ""; }; + C9B53C5E138D9E9A0028D27C /* ldiv.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ldiv.3; sourceTree = ""; }; + C9B53C60138D9E9A0028D27C /* ldiv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ldiv.c; sourceTree = ""; }; + C9B53C61138D9E9A0028D27C /* llabs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = llabs.3; sourceTree = ""; }; + C9B53C63138D9E9A0028D27C /* llabs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = llabs.c; sourceTree = ""; }; + C9B53C64138D9E9A0028D27C /* lldiv.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = lldiv.3; sourceTree = ""; }; + C9B53C66138D9E9A0028D27C /* lldiv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lldiv.c; sourceTree = ""; }; + C9B53C67138D9E9A0028D27C /* lsearch.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = lsearch.3; sourceTree = ""; }; + C9B53C69138D9E9A0028D27C /* lsearch.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lsearch.c; sourceTree = ""; }; + C9B53C6A138D9E9A0028D27C /* memory.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = memory.3; sourceTree = ""; }; + C9B53C6C138D9E9A0028D27C /* merge.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = merge.c; sourceTree = ""; }; + C9B53C6F138D9E9A0028D27C /* putenv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = putenv.c; sourceTree = ""; }; + C9B53C71138D9E9A0028D27C /* qsort.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = qsort.3; sourceTree = ""; }; + C9B53C73138D9E9A0028D27C /* qsort.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = qsort.c; sourceTree = ""; }; + C9B53C75138D9E9A0028D27C /* qsort_r.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = qsort_r.c; sourceTree = ""; }; + C9B53C77138D9E9A0028D27C /* radixsort.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = radixsort.3; sourceTree = ""; }; + C9B53C78138D9E9A0028D27C /* radixsort.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = radixsort.c; sourceTree = ""; }; + C9B53C7A138D9E9A0028D27C /* rand.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = rand.3; sourceTree = ""; }; + C9B53C7C138D9E9A0028D27C /* rand.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rand.c; sourceTree = ""; }; + C9B53C7D138D9E9A0028D27C /* random.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = random.3; sourceTree = ""; }; + C9B53C7F138D9E9A0028D27C /* random.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = random.c; sourceTree = ""; }; + C9B53C81138D9E9A0028D27C /* reallocf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = reallocf.c; sourceTree = ""; }; + C9B53C82138D9E9A0028D27C /* realpath.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = realpath.3; sourceTree = ""; }; + C9B53C84138D9E9A0028D27C /* realpath.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = realpath.c; sourceTree = ""; }; + C9B53C86138D9E9A0028D27C /* remque.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = remque.c; sourceTree = ""; }; + C9B53C87138D9E9A0028D27C /* setenv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setenv.c; sourceTree = ""; }; + C9B53C89138D9E9A0028D27C /* strhash.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strhash.c; sourceTree = ""; }; + C9B53C8B138D9E9A0028D27C /* strtod.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strtod.3; sourceTree = ""; }; + C9B53C8D138D9E9A0028D27C /* strtoimax.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtoimax.c; sourceTree = ""; }; + C9B53C8F138D9E9A0028D27C /* strtol.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strtol.3; sourceTree = ""; }; + C9B53C91138D9E9A0028D27C /* strtol.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtol.c; sourceTree = ""; }; + C9B53C93138D9E9A0028D27C /* strtoll.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtoll.c; sourceTree = ""; }; + C9B53C95138D9E9A0028D27C /* strtoq.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtoq.c; sourceTree = ""; }; + C9B53C97138D9E9A0028D27C /* strtoul.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strtoul.3; sourceTree = ""; }; + C9B53C99138D9E9A0028D27C /* strtoul.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtoul.c; sourceTree = ""; }; + C9B53C9B138D9E9A0028D27C /* strtoull.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtoull.c; sourceTree = ""; }; + C9B53C9D138D9E9A0028D27C /* strtoumax.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtoumax.c; sourceTree = ""; }; + C9B53C9F138D9E9A0028D27C /* strtouq.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtouq.c; sourceTree = ""; }; + C9B53CA1138D9E9A0028D27C /* system.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = system.3; sourceTree = ""; }; + C9B53CA3138D9E9A0028D27C /* system.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = system.c; sourceTree = ""; }; + C9B53CA5138D9E9A0028D27C /* tdelete.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tdelete.c; sourceTree = ""; }; + C9B53CA6138D9E9A0028D27C /* tfind.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tfind.c; sourceTree = ""; }; + C9B53CA7138D9E9A0028D27C /* tsearch.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tsearch.3; sourceTree = ""; }; + C9B53CA9138D9E9A0028D27C /* tsearch.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tsearch.c; sourceTree = ""; }; + C9B53CAA138D9E9A0028D27C /* twalk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = twalk.c; sourceTree = ""; }; + C9B53CAB138D9E9A0028D27C /* grantpt.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = grantpt.3; sourceTree = ""; }; + C9B53CAC138D9E9A0028D27C /* grantpt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = grantpt.c; sourceTree = ""; }; + C9B53CAD138D9E9A0028D27C /* l64a.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = l64a.c; sourceTree = ""; }; + C9B53CB0138D9E9A0028D27C /* strfmon.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strfmon.3; sourceTree = ""; }; + C9B53CB2138D9E9A0028D27C /* strfmon.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strfmon.c; sourceTree = ""; }; + C9B53CB5138D9E9A0028D27C /* ecvt.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ecvt.3; sourceTree = ""; }; + C9B53CB7138D9E9A0028D27C /* ecvt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ecvt.c; sourceTree = ""; }; + C9B53CB9138D9E9A0028D27C /* gcvt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gcvt.c; sourceTree = ""; }; + C9B53CBD138D9E9A0028D27C /* qsort_b.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = qsort_b.c; sourceTree = ""; }; + C9B53CBE138D9E9A0028D27C /* strtod_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strtod_l.3; sourceTree = ""; }; + C9B53CBF138D9E9A0028D27C /* strtol_l.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strtol_l.3; sourceTree = ""; }; + C9B53CC2138D9E9A0028D27C /* asctime.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = asctime.c; sourceTree = ""; }; + C9B53CC4138D9E9A0028D27C /* ctime.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ctime.3; sourceTree = ""; }; + C9B53CC6138D9E9A0028D27C /* difftime.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = difftime.c; sourceTree = ""; }; + C9B53CC7138D9E9A0028D27C /* ftime.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ftime.3; sourceTree = ""; }; + C9B53CC9138D9E9A0028D27C /* ftime.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ftime.c; sourceTree = ""; }; + C9B53CCA138D9E9A0028D27C /* localtime.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = localtime.c; sourceTree = ""; }; + C9B53CCC138D9E9A0028D27C /* private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = private.h; sourceTree = ""; }; + C9B53CCD138D9E9A0028D27C /* strftime.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strftime.3; sourceTree = ""; }; + C9B53CCF138D9E9A0028D27C /* strftime.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strftime.c; sourceTree = ""; }; + C9B53CD1138D9E9A0028D27C /* strptime.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strptime.3; sourceTree = ""; }; + C9B53CD3138D9E9A0028D27C /* strptime.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strptime.c; sourceTree = ""; }; + C9B53CD5138D9E9A0028D27C /* time2posix.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = time2posix.3; sourceTree = ""; }; + C9B53CD6138D9E9A0028D27C /* time32.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = time32.c; sourceTree = ""; }; + C9B53CD7138D9E9A0028D27C /* timelocal.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = timelocal.c; sourceTree = ""; }; + C9B53CD9138D9E9A0028D27C /* timelocal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = timelocal.h; sourceTree = ""; }; + C9B53CDB138D9E9A0028D27C /* tzfile.5 */ = {isa = PBXFileReference; lastKnownFileType = text; path = tzfile.5; sourceTree = ""; }; + C9B53CDD138D9E9A0028D27C /* tzfile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tzfile.h; sourceTree = ""; }; + C9B53CDF138D9E9A0028D27C /* getdate.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getdate.3; sourceTree = ""; }; + C9B53CE0138D9E9A0028D27C /* getdate.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getdate.c; sourceTree = ""; }; + C9B53CE2138D9E9A0028D27C /* timegm.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = timegm.3; sourceTree = ""; }; + C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = timezone_unix03.c; sourceTree = ""; }; + C9B53CE6138D9E9A0028D27C /* bcmp.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = bcmp.3; sourceTree = ""; }; + C9B53CE9138D9E9A0028D27C /* bcopy.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = bcopy.3; sourceTree = ""; }; + C9B53CED138D9E9A0028D27C /* bstring.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = bstring.3; sourceTree = ""; }; + C9B53CEF138D9E9A0028D27C /* bzero.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = bzero.3; sourceTree = ""; }; + C9B53CF5138D9E9A0028D27C /* index.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = index.3; sourceTree = ""; }; + C9B53CF8138D9E9A0028D27C /* memccpy.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = memccpy.3; sourceTree = ""; }; + C9B53CFB138D9E9A0028D27C /* memchr.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = memchr.3; sourceTree = ""; }; + C9B53CFE138D9E9A0028D27C /* memcmp.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = memcmp.3; sourceTree = ""; }; + C9B53D01138D9E9A0028D27C /* memcpy.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = memcpy.3; sourceTree = ""; }; + C9B53D05138D9E9A0028D27C /* memmem.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = memmem.3; sourceTree = ""; }; + C9B53D06138D9E9A0028D27C /* memmem.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memmem.c; sourceTree = ""; }; + C9B53D07138D9E9A0028D27C /* memmove.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = memmove.3; sourceTree = ""; }; + C9B53D0B138D9E9A0028D27C /* memset.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = memset.3; sourceTree = ""; }; + C9B53D0E138D9E9A0028D27C /* rindex.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = rindex.3; sourceTree = ""; }; + C9B53D10138D9E9A0028D27C /* rindex.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rindex.c; sourceTree = ""; }; + C9B53D13138D9E9A0028D27C /* strcasecmp.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strcasecmp.3; sourceTree = ""; }; + C9B53D15138D9E9A0028D27C /* strcasecmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strcasecmp.c; sourceTree = ""; }; + C9B53D17138D9E9A0028D27C /* strcasestr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strcasestr.c; sourceTree = ""; }; + C9B53D19138D9E9A0028D27C /* strcat.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strcat.3; sourceTree = ""; }; + C9B53D1C138D9E9A0028D27C /* strchr.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strchr.3; sourceTree = ""; }; + C9B53D20138D9E9A0028D27C /* strcmp.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strcmp.3; sourceTree = ""; }; + C9B53D24138D9E9A0028D27C /* strcoll.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strcoll.3; sourceTree = ""; }; + C9B53D26138D9E9A0028D27C /* strcoll.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strcoll.c; sourceTree = ""; }; + C9B53D28138D9E9A0028D27C /* strcpy.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strcpy.3; sourceTree = ""; }; + C9B53D2D138D9E9A0028D27C /* strcspn.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strcspn.c; sourceTree = ""; }; + C9B53D2E138D9E9A0028D27C /* strdup.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strdup.3; sourceTree = ""; }; + C9B53D30138D9E9A0028D27C /* strdup.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strdup.c; sourceTree = ""; }; + C9B53D31138D9E9A0028D27C /* strerror.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strerror.3; sourceTree = ""; }; + C9B53D33138D9E9A0028D27C /* strerror.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strerror.c; sourceTree = ""; }; + C9B53D35138D9E9A0028D27C /* string.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = string.3; sourceTree = ""; }; + C9B53D38138D9E9A0028D27C /* strlcpy.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strlcpy.3; sourceTree = ""; }; + C9B53D3B138D9E9A0028D27C /* strlen.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strlen.3; sourceTree = ""; }; + C9B53D3E138D9E9A0028D27C /* strmode.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strmode.3; sourceTree = ""; }; + C9B53D40138D9E9A0028D27C /* strmode.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strmode.c; sourceTree = ""; }; + C9B53D44138D9E9A0028D27C /* strndup.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strndup.c; sourceTree = ""; }; + C9B53D46138D9E9A0028D27C /* strnstr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strnstr.c; sourceTree = ""; }; + C9B53D47138D9E9A0028D27C /* strpbrk.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strpbrk.3; sourceTree = ""; }; + C9B53D49138D9E9A0028D27C /* strpbrk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strpbrk.c; sourceTree = ""; }; + C9B53D4C138D9E9A0028D27C /* strrchr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strrchr.c; sourceTree = ""; }; + C9B53D4E138D9E9A0028D27C /* strsep.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strsep.3; sourceTree = ""; }; + C9B53D4F138D9E9A0028D27C /* strsep.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strsep.c; sourceTree = ""; }; + C9B53D50138D9E9A0028D27C /* strsignal.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strsignal.c; sourceTree = ""; }; + C9B53D52138D9E9A0028D27C /* strspn.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strspn.3; sourceTree = ""; }; + C9B53D54138D9E9A0028D27C /* strspn.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strspn.c; sourceTree = ""; }; + C9B53D55138D9E9A0028D27C /* strstr.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strstr.3; sourceTree = ""; }; + C9B53D58138D9E9A0028D27C /* strtok.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strtok.3; sourceTree = ""; }; + C9B53D5A138D9E9A0028D27C /* strtok.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strtok.c; sourceTree = ""; }; + C9B53D5B138D9E9A0028D27C /* strxfrm.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = strxfrm.3; sourceTree = ""; }; + C9B53D5D138D9E9A0028D27C /* strxfrm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strxfrm.c; sourceTree = ""; }; + C9B53D5F138D9E9A0028D27C /* swab.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = swab.3; sourceTree = ""; }; + C9B53D61138D9E9A0028D27C /* swab.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = swab.c; sourceTree = ""; }; + C9B53D63138D9E9A0028D27C /* wcpcpy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcpcpy.c; sourceTree = ""; }; + C9B53D64138D9E9A0028D27C /* wcpncpy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcpncpy.c; sourceTree = ""; }; + C9B53D65138D9E9A0028D27C /* wcscasecmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcscasecmp.c; sourceTree = ""; }; + C9B53D67138D9E9A0028D27C /* wcscat.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcscat.c; sourceTree = ""; }; + C9B53D68138D9E9A0028D27C /* wcschr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcschr.c; sourceTree = ""; }; + C9B53D69138D9E9A0028D27C /* wcscmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcscmp.c; sourceTree = ""; }; + C9B53D6A138D9E9A0028D27C /* wcscoll.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcscoll.3; sourceTree = ""; }; + C9B53D6C138D9E9A0028D27C /* wcscoll.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcscoll.c; sourceTree = ""; }; + C9B53D6E138D9E9A0028D27C /* wcscpy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcscpy.c; sourceTree = ""; }; + C9B53D6F138D9E9A0028D27C /* wcscspn.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcscspn.c; sourceTree = ""; }; + C9B53D70138D9E9A0028D27C /* wcsdup.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsdup.c; sourceTree = ""; }; + C9B53D71138D9E9A0028D27C /* wcslcat.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcslcat.c; sourceTree = ""; }; + C9B53D72138D9E9A0028D27C /* wcslcpy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcslcpy.c; sourceTree = ""; }; + C9B53D73138D9E9A0028D27C /* wcslen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcslen.c; sourceTree = ""; }; + C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsncasecmp.c; sourceTree = ""; }; + C9B53D76138D9E9A0028D27C /* wcsncat.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsncat.c; sourceTree = ""; }; + C9B53D77138D9E9A0028D27C /* wcsncmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsncmp.c; sourceTree = ""; }; + C9B53D78138D9E9A0028D27C /* wcsncpy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsncpy.c; sourceTree = ""; }; + C9B53D79138D9E9A0028D27C /* wcsnlen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsnlen.c; sourceTree = ""; }; + C9B53D7A138D9E9A0028D27C /* wcspbrk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcspbrk.c; sourceTree = ""; }; + C9B53D7B138D9E9A0028D27C /* wcsrchr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsrchr.c; sourceTree = ""; }; + C9B53D7C138D9E9A0028D27C /* wcsspn.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsspn.c; sourceTree = ""; }; + C9B53D7D138D9E9A0028D27C /* wcsstr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsstr.c; sourceTree = ""; }; + C9B53D7E138D9E9A0028D27C /* wcstok.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcstok.3; sourceTree = ""; }; + C9B53D80138D9E9A0028D27C /* wcstok.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcstok.c; sourceTree = ""; }; + C9B53D81138D9E9A0028D27C /* wcswidth.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcswidth.3; sourceTree = ""; }; + C9B53D83138D9E9A0028D27C /* wcswidth.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcswidth.c; sourceTree = ""; }; + C9B53D85138D9E9A0028D27C /* wcsxfrm.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wcsxfrm.3; sourceTree = ""; }; + C9B53D87138D9E9A0028D27C /* wcsxfrm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wcsxfrm.c; sourceTree = ""; }; + C9B53D89138D9E9A0028D27C /* wmemchr.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = wmemchr.3; sourceTree = ""; }; + C9B53D8B138D9E9A0028D27C /* wmemchr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wmemchr.c; sourceTree = ""; }; + C9B53D8C138D9E9A0028D27C /* wmemcmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wmemcmp.c; sourceTree = ""; }; + C9B53D8D138D9E9A0028D27C /* wmemcpy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wmemcpy.c; sourceTree = ""; }; + C9B53D8E138D9E9A0028D27C /* wmemmove.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wmemmove.c; sourceTree = ""; }; + C9B53D8F138D9E9A0028D27C /* wmemset.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wmemset.c; sourceTree = ""; }; + C9B53D91138D9E9A0028D27C /* memset_pattern.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = memset_pattern.3; sourceTree = ""; }; + C9B53D92138D9E9A0028D27C /* strip-header.ed */ = {isa = PBXFileReference; lastKnownFileType = text; path = "strip-header.ed"; sourceTree = ""; }; + C9B53D94138D9E9A0028D27C /* _libc_init.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = _libc_init.c; sourceTree = ""; }; + C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = _libc_fork_child.c; sourceTree = ""; }; + C9B53D99138D9E9A0028D27C /* chmodx_np.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = chmodx_np.c; sourceTree = ""; }; + C9B53D9C138D9E9A0028D27C /* crt_externs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = crt_externs.c; sourceTree = ""; }; + C9B53D9E138D9E9A0028D27C /* fork.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fork.c; sourceTree = ""; }; + C9B53D9F138D9E9A0028D27C /* getgroups.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getgroups.c; sourceTree = ""; }; + C9B53DA2138D9E9A0028D27C /* gettimeofday.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gettimeofday.c; sourceTree = ""; }; + C9B53DA6138D9E9A0028D27C /* msgctl.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = msgctl.c; sourceTree = ""; }; + C9B53DA7138D9E9A0028D27C /* nanosleep.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = nanosleep.2; sourceTree = ""; }; + C9B53DA9138D9E9A0028D27C /* stack_protector.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = stack_protector.c; sourceTree = ""; }; + C9B53DAB138D9E9A0028D27C /* openx_np.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = openx_np.c; sourceTree = ""; }; + C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = OSMemoryNotification.c; sourceTree = ""; }; + C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = OSThermalNotification.c; sourceTree = ""; }; + C9B53DAE138D9E9A0028D27C /* posix_spawn.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = posix_spawn.c; sourceTree = ""; }; + C9B53DB2138D9E9A0028D27C /* semctl.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = semctl.c; sourceTree = ""; }; + C9B53DB3138D9E9A0028D27C /* settimeofday.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = settimeofday.c; sourceTree = ""; }; + C9B53DB4138D9E9A0028D27C /* shmctl.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = shmctl.c; sourceTree = ""; }; + C9B53DB5138D9E9A0028D27C /* sigaction.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sigaction.c; sourceTree = ""; }; + C9B53DB9138D9E9A0028D27C /* sigwait.2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = sigwait.2; sourceTree = ""; }; + C9B53DBC138D9E9A0028D27C /* statx_np.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = statx_np.c; sourceTree = ""; }; + C9B53DBE138D9E9A0028D27C /* umaskx_np.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = umaskx_np.c; sourceTree = ""; }; + C9B53DC7138D9E9A0028D27C /* fparseln.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = fparseln.3; sourceTree = ""; }; + C9B53DC8138D9E9A0028D27C /* fparseln.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fparseln.c; sourceTree = ""; }; + C9B53DC9138D9E9A0028D27C /* login.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = login.3; sourceTree = ""; }; + C9B53DCA138D9E9A0028D27C /* login.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = login.c; sourceTree = ""; }; + C9B53DCB138D9E9A0028D27C /* login_tty.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = login_tty.c; sourceTree = ""; }; + C9B53DCC138D9E9A0028D27C /* logout.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = logout.c; sourceTree = ""; }; + C9B53DCD138D9E9A0028D27C /* logwtmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = logwtmp.c; sourceTree = ""; }; + C9B53DCF138D9E9A0028D27C /* opendev.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = opendev.3; sourceTree = ""; }; + C9B53DD0138D9E9A0028D27C /* opendev.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = opendev.c; sourceTree = ""; }; + C9B53DD1138D9E9A0028D27C /* openpty.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = openpty.3; sourceTree = ""; }; + C9B53DD2138D9E9A0028D27C /* pty.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = pty.c; sourceTree = ""; }; + C9B53DD5138D9E9A0028D27C /* namespace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = namespace.h; sourceTree = ""; }; + C9B53DD6138D9E9A0028D27C /* uuid-config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "uuid-config.h"; sourceTree = ""; }; + C9B53DD7138D9E9A0028D27C /* uuidman.sed */ = {isa = PBXFileReference; lastKnownFileType = text; path = uuidman.sed; sourceTree = ""; }; + C9B53DD9138D9E9A0028D27C /* clear.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = clear.c; sourceTree = ""; }; + C9B53DDA138D9E9A0028D27C /* compare.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = compare.c; sourceTree = ""; }; + C9B53DDB138D9E9A0028D27C /* copy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = copy.c; sourceTree = ""; }; + C9B53DDC138D9E9A0028D27C /* gen_uuid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gen_uuid.c; sourceTree = ""; }; + C9B53DDE138D9E9A0028D27C /* isnull.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = isnull.c; sourceTree = ""; }; + C9B53DDF138D9E9A0028D27C /* libuuid.3.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = libuuid.3.in; sourceTree = ""; }; + C9B53DE0138D9E9A0028D27C /* pack.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = pack.c; sourceTree = ""; }; + C9B53DE1138D9E9A0028D27C /* parse.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = parse.c; sourceTree = ""; }; + C9B53DE2138D9E9A0028D27C /* unpack.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = unpack.c; sourceTree = ""; }; + C9B53DE3138D9E9A0028D27C /* unparse.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = unparse.c; sourceTree = ""; }; + C9B53DE5138D9E9A0028D27C /* uuid_clear.3.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = uuid_clear.3.in; sourceTree = ""; }; + C9B53DE6138D9E9A0028D27C /* uuid_compare.3.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = uuid_compare.3.in; sourceTree = ""; }; + C9B53DE7138D9E9A0028D27C /* uuid_copy.3.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = uuid_copy.3.in; sourceTree = ""; }; + C9B53DE8138D9E9A0028D27C /* uuid_generate.3.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = uuid_generate.3.in; sourceTree = ""; }; + C9B53DE9138D9E9A0028D27C /* uuid_is_null.3.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = uuid_is_null.3.in; sourceTree = ""; }; + C9B53DEA138D9E9A0028D27C /* uuid_parse.3.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = uuid_parse.3.in; sourceTree = ""; }; + C9B53DEB138D9E9A0028D27C /* uuid_unparse.3.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = uuid_unparse.3.in; sourceTree = ""; }; + C9B53DED138D9E9A0028D27C /* uuidP.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uuidP.h; sourceTree = ""; }; + C9B53DF9138D9E9A0028D27C /* mcount.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = mcount.s; sourceTree = ""; }; + C9B53E2C138DA0610028D27C /* libPlatform.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPlatform.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C9C2A948138DF7DD00287F00 /* libc.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = libc.xcconfig; sourceTree = ""; }; + C9C2A94D138DFFD900287F00 /* libBase.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBase.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = forceLibcToBuild.c; sourceTree = ""; }; + C9D9432F138DB73300FB7ACC /* libsystem_c.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libsystem_c.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + C9D94357138EC0C600FB7ACC /* heapsort_b.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = heapsort_b.c; sourceTree = ""; }; + C9D94358138EC0C600FB7ACC /* heapsort_r.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = heapsort_r.c; sourceTree = ""; }; + C9D94360138EC3E300FB7ACC /* libvCancelable.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libvCancelable.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C9EB2FC0138F6BB00075BB52 /* merge_b.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = merge_b.c; sourceTree = ""; }; + C9EB2FC3138F6C5C0075BB52 /* psort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = psort.c; sourceTree = ""; }; + C9EB2FC5138F6CE10075BB52 /* psort_b.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = psort_b.c; sourceTree = ""; }; + C9EB2FC6138F6CE10075BB52 /* psort_r.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = psort_r.c; sourceTree = ""; }; + C9EB3266138F6D880075BB52 /* libvLegacy.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libvLegacy.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C9EB350D138F75580075BB52 /* libvInode32.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libvInode32.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C9EB350E138F769B0075BB52 /* scandir_b.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scandir_b.c; sourceTree = ""; }; + C9EB354F138F7EA50075BB52 /* getmntinfo64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getmntinfo64.c; sourceTree = ""; }; + C9ECE2761950E384008E8672 /* atexit_receipt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atexit_receipt.c; sourceTree = ""; }; + C9FA32F8138E4A5C0089A94B /* utf2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utf2.c; sourceTree = ""; }; + C9FACC591ACDBA54009F33F1 /* Makefile.inc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.pascal; name = Makefile.inc; path = Platforms/appletvos/Makefile.inc; sourceTree = SOURCE_ROOT; }; + E40EA6C01EAA8F9300B2FA36 /* _strings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _strings.h; sourceTree = ""; }; + E41BEA97178E72E100E348BB /* Libc.order */ = {isa = PBXFileReference; lastKnownFileType = text; path = Libc.order; sourceTree = ""; }; + E464104B224C5EA2001B23EF /* __wctype.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = __wctype.h; sourceTree = ""; }; + E464104C224C5F19001B23EF /* _ctype.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _ctype.h; sourceTree = ""; }; + E4A877A6174D82FB000DBB55 /* alias.list */ = {isa = PBXFileReference; lastKnownFileType = text; path = alias.list; sourceTree = ""; }; + E4EDB7262227DF25006A8322 /* Makefile.inc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.pascal; path = Makefile.inc; sourceTree = ""; }; + FC2ED60E157D4BE70098EC69 /* inet_ntop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inet_ntop.c; sourceTree = ""; }; + FC2ED60F157D4BE70098EC69 /* inet_pton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inet_pton.c; sourceTree = ""; }; + FC2ED623157D4DA90098EC69 /* inet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inet.h; sourceTree = ""; }; + FC60BAD116555A4A00033196 /* _intmax_t.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _intmax_t.h; sourceTree = ""; }; + FC60BAD216555A4A00033196 /* _nl_item.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _nl_item.h; sourceTree = ""; }; + FC60BAD316555A4A00033196 /* _uint16_t.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _uint16_t.h; sourceTree = ""; }; + FC60BAD416555A4A00033196 /* _uint32_t.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _uint32_t.h; sourceTree = ""; }; + FC60BAD516555A4A00033196 /* _uint64_t.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _uint64_t.h; sourceTree = ""; }; + FC60BAD616555A4A00033196 /* _uint8_t.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _uint8_t.h; sourceTree = ""; }; + FC60BAD716555A4A00033196 /* _uintmax_t.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _uintmax_t.h; sourceTree = ""; }; + FC60BAD816555A4A00033196 /* _wctrans_t.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _wctrans_t.h; sourceTree = ""; }; + FC60BAD916555A4A00033196 /* _wctype_t.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _wctype_t.h; sourceTree = ""; }; + FC960EF21850F33A005B9A9A /* libc_private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libc_private.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3F5120ED16C3174300AFB431 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 926F738F1E03E2A3001E049D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B122F2A91432B8E600AF95D0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C0E345DA1C582ECB00E749C2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C0E345DB1C582ECB00E749C2 /* libBase.a in Frameworks */, + C0E345DC1C582ECB00E749C2 /* libFreeBSD.a in Frameworks */, + C0E345DD1C582ECB00E749C2 /* libvCancelable.a in Frameworks */, + C0E345DE1C582ECB00E749C2 /* libTRE.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9257ECD138E1B5000B3107C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9258100138E2D3100B3107C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C94212C713900C8A004BA536 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C95B8171138F3C55004311DA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C95B841C138F52B0004311DA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C95B86C2138F53DB004311DA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C97A72181517AF53005E1998 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C9AE91B51517D31A00A2626C /* libBase.a in Frameworks */, + C9AE91B71517D31C00A2626C /* libFreeBSD.a in Frameworks */, + C9AE91B81517D32200A2626C /* libvCancelable.a in Frameworks */, + C9AE91B91517D32900A2626C /* libTRE.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9B53E29138DA0610028D27C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9C2A94A138DFFD900287F00 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9D9432C138DB73300FB7ACC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9D9435D138EC3E300FB7ACC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9EB3261138F6D880075BB52 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9EB3508138F75580075BB52 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3F18DE1E162A732C008B15AC /* NetBSD */ = { + isa = PBXGroup; + children = ( + 3F18DE1F162A732C008B15AC /* memset_s.3 */, + 3F18DE20162A732C008B15AC /* memset_s.c */, + ); + path = NetBSD; + sourceTree = ""; + }; + 4B2C50DE1F8453A6005DA2B6 /* h */ = { + isa = PBXGroup; + children = ( + 4BA6E56A202ACF7A00F38D3A /* bsd.h */, + 4B0899B920460FAC001360A4 /* cleanup.h */, + 4B450FFA211A56DC0029AF5D /* ctl.h */, + 4BA6E563202AC0C200F38D3A /* err.h */, + 4BA6E55B202AB1F100F38D3A /* errno.h */, + 4B6D181C206DEFBD00C00E37 /* mach_exception.h */, + 4B09323321C9C088006063D6 /* mach_utils.h */, + 4BCC350E20659AD500A4CBAA /* linker_set.h */, + 4BA6E567202ACAFA00F38D3A /* stdio.h */, + 4BA6E564202AC43700F38D3A /* stdlib.h */, + 4BA6E55D202AB31100F38D3A /* string.h */, + 92D763E41EA6F887001467FC /* dirstat_collection.h */, + 92D763E51EA6F887001467FC /* dirstat.h */, + 4B69E81220800BE9008D13D2 /* libdarwin_init.h */, + ); + path = h; + sourceTree = ""; + }; + 4B2C64A015519B0500342BFA /* os */ = { + isa = PBXGroup; + children = ( + 4B782978208926A70070E1FF /* api.h */, + 4B8A6F3121C99A0E00D00D67 /* linker_set.h */, + 926F73991E03E8D6001E049D /* variant_private.h */, + 2DF67CE7184F9CD000B83A3D /* debug_private.h */, + 2DF67CDD184F9CBE00B83A3D /* debug_private.c */, + 4B2C64AB15519C3400342BFA /* assumes.h */, + 4B2C64A215519BAF00342BFA /* assumes.c */, + ); + name = os; + sourceTree = ""; + }; + 926F73961E03E8C4001E049D /* libdarwin */ = { + isa = PBXGroup; + children = ( + 4B2C50DE1F8453A6005DA2B6 /* h */, + 9280EA171E59BC8A007A6F58 /* AppleInternalVariant.plist */, + 4B2C50E41F8453FA005DA2B6 /* internal.h */, + 4B2D551D2317040F003DAFCE /* tapi.h */, + 4BA6E56B202AD02900F38D3A /* bsd.c */, + 4B450FFC211A56EC0029AF5D /* ctl.c */, + 4B6D181E206DF1E200C00E37 /* exception.c */, + 4BA6E561202AC06300F38D3A /* err.c */, + 4B6CFC032065B9FF0022DBAD /* mach.c */, + 4BA6E568202ACDAA00F38D3A /* stdio.c */, + 4BA6E565202AC94800F38D3A /* stdlib.c */, + 4BA6E55E202AB35900F38D3A /* string.c */, + 92D763DC1EA6D9FB001467FC /* dirstat.c */, + 928841341EA7554D001064D1 /* dirstat_collection.c */, + 926F73971E03E8C4001E049D /* variant.c */, + 92767C821E0A7E2100AB9C76 /* init.c */, + ); + path = libdarwin; + sourceTree = ""; + }; + B122F2AE1432B95B00AF95D0 /* TRE */ = { + isa = PBXGroup; + children = ( + B122F2AF1432B95B00AF95D0 /* config.h */, + B122F2B01432B95B00AF95D0 /* lib */, + B122F2C31432B95B00AF95D0 /* tre-0.8.0.tar.bz2 */, + B122F2C41432B95B00AF95D0 /* tre-config.h */, + B122F2C51432B95B00AF95D0 /* tre-last-matched.h */, + ); + path = TRE; + sourceTree = ""; + }; + B122F2B01432B95B00AF95D0 /* lib */ = { + isa = PBXGroup; + children = ( + B122F2B11432B95B00AF95D0 /* regcomp.c */, + B122F2B21432B95B00AF95D0 /* regexec.c */, + B122F2B31432B95B00AF95D0 /* tre-ast.c */, + B122F2B41432B95B00AF95D0 /* tre-ast.h */, + B122F2B51432B95B00AF95D0 /* tre-compile.c */, + B122F2B61432B95B00AF95D0 /* tre-compile.h */, + B122F2B71432B95B00AF95D0 /* tre-internal.h */, + B122F2B81432B95B00AF95D0 /* tre-match-backtrack.c */, + B122F2B91432B95B00AF95D0 /* tre-match-parallel.c */, + B122F2BA1432B95B00AF95D0 /* tre-match-utils.h */, + B122F2BB1432B95B00AF95D0 /* tre-mem.c */, + B122F2BC1432B95B00AF95D0 /* tre-mem.h */, + B122F2BD1432B95B00AF95D0 /* tre-parse.c */, + B122F2BE1432B95B00AF95D0 /* tre-parse.h */, + B122F2BF1432B95B00AF95D0 /* tre-stack.c */, + B122F2C01432B95B00AF95D0 /* tre-stack.h */, + B122F2C11432B95B00AF95D0 /* tre.h */, + B122F2C21432B95B00AF95D0 /* xmalloc.h */, + ); + path = lib; + sourceTree = ""; + }; + C975E22B1A12ECA00093B345 /* appletv */ = { + isa = PBXGroup; + children = ( + C9FACC591ACDBA54009F33F1 /* Makefile.inc */, + ); + name = appletv; + path = watchos; + sourceTree = ""; + }; + C9A288A61ACDBA95004A33A7 /* watchos */ = { + isa = PBXGroup; + children = ( + C9A288A71ACDBA95004A33A7 /* Makefile.inc */, + ); + name = watchos; + path = Platforms/watchos; + sourceTree = SOURCE_ROOT; + }; + C9B53595138D9A690028D27C = { + isa = PBXGroup; + children = ( + C9B535AE138D9E980028D27C /* APPLE_LICENSE */, + C9B535AF138D9E980028D27C /* arm */, + C9B535F5138D9E980028D27C /* compat-43 */, + C9B53612138D9E980028D27C /* darwin */, + C9B5361D138D9E980028D27C /* db */, + C9B5366C138D9E980028D27C /* emulated */, + C9B5367C138D9E980028D27C /* fbsdcompat */, + C9B5368D138D9E980028D27C /* gdtoa */, + C9B536C0138D9E980028D27C /* gen */, + C9B5380A138D9E990028D27C /* gmon */, + C9B5380F138D9E990028D27C /* i386 */, + C9B5384F138D9E990028D27C /* include */, + 926F73961E03E8C4001E049D /* libdarwin */, + C9B538FE138D9E990028D27C /* locale */, + C9B53A04138D9E990028D27C /* man */, + C9B53A0E138D9E990028D27C /* nbsdcompat */, + C9B53A11138D9E990028D27C /* net */, + C9B53A3A138D9E990028D27C /* nls */, + 4B2C64A015519B0500342BFA /* os */, + C9B53A45138D9E990028D27C /* Platforms */, + C9B53A4A138D9E990028D27C /* posix1e */, + C9B53B03138D9E990028D27C /* regex */, + C9B53B1D138D9E990028D27C /* secure */, + C9B53B2D138D9E990028D27C /* stdio */, + C9B53C16138D9E9A0028D27C /* stdlib */, + C9B53CC0138D9E9A0028D27C /* stdtime */, + C9B53CE4138D9E9A0028D27C /* string */, + C9B53D93138D9E9A0028D27C /* sys */, + C9B53DC6138D9E9A0028D27C /* util */, + C9B53DD3138D9E9A0028D27C /* uuid */, + C9B53DEF138D9E9A0028D27C /* x86_64 */, + C9C2A946138DF66900287F00 /* xcodescripts */, + C9B535A9138D9E890028D27C /* Products */, + C06E02D11CA0C9CA00B07322 /* tests */, + ); + indentWidth = 4; + sourceTree = ""; + tabWidth = 4; + usesTabs = 1; + }; + C9B535A9138D9E890028D27C /* Products */ = { + isa = PBXGroup; + children = ( + C9B53E2C138DA0610028D27C /* libPlatform.a */, + C9D9432F138DB73300FB7ACC /* libsystem_c.dylib */, + C9C2A94D138DFFD900287F00 /* libBase.a */, + C9257ED0138E1B5000B3107C /* libFreeBSD.a */, + C9258105138E2D3100B3107C /* libNetBSD.a */, + C9D94360138EC3E300FB7ACC /* libvCancelable.a */, + C95B8176138F3C55004311DA /* libvDarwinExtsn.a */, + C95B8421138F52B0004311DA /* libvDarwinExtsnCancelable.a */, + C95B86C7138F53DB004311DA /* libvPre1050.a */, + C9EB3266138F6D880075BB52 /* libvLegacy.a */, + C9EB350D138F75580075BB52 /* libvInode32.a */, + C94212CC13900C8A004BA536 /* libc_dyld.a */, + B122F2AD1432B8E600AF95D0 /* libTRE.a */, + C97A721C1517AF53005E1998 /* libc_eOS.a */, + 3F5120F116C3174300AFB431 /* libFortifySource.a */, + C0E345E21C582ECB00E749C2 /* libc.a */, + 926F73921E03E2A3001E049D /* libsystem_darwin.dylib */, + ); + name = Products; + sourceTree = ""; + }; + C9B535AF138D9E980028D27C /* arm */ = { + isa = PBXGroup; + children = ( + C9B535B0138D9E980028D27C /* gen */, + ); + path = arm; + sourceTree = ""; + }; + C9B535B0138D9E980028D27C /* gen */ = { + isa = PBXGroup; + children = ( + C925D1FB151805C6003D315B /* eos_stubs.c */, + ); + path = gen; + sourceTree = ""; + }; + C9B535F5138D9E980028D27C /* compat-43 */ = { + isa = PBXGroup; + children = ( + C9B535F6138D9E980028D27C /* FreeBSD */, + C9B5360A138D9E980028D27C /* setregid.c */, + C9B5360B138D9E980028D27C /* setreuid.c */, + C9B5360C138D9E980028D27C /* sigaltstk.c */, + C9B5360D138D9E980028D27C /* sigblock.2 */, + C9B5360E138D9E980028D27C /* sigcompat.c */, + C9B5360F138D9E980028D27C /* sigpause.2 */, + C9B53610138D9E980028D27C /* sigsetmask.2 */, + C9B53611138D9E980028D27C /* sigvec.2 */, + ); + path = "compat-43"; + sourceTree = ""; + }; + C9B535F6138D9E980028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B535F7138D9E980028D27C /* creat.2 */, + C9B535FA138D9E980028D27C /* gethostid.3 */, + C9B535FF138D9E980028D27C /* killpg.2 */, + C9B53607138D9E980028D27C /* setruid.3 */, + C9B535F8138D9E980028D27C /* creat.c */, + C9B535FC138D9E980028D27C /* gethostid.c */, + C9B535FE138D9E980028D27C /* getwd.c */, + C9B53601138D9E980028D27C /* killpg.c */, + C9B53603138D9E980028D27C /* sethostid.c */, + C9B53604138D9E980028D27C /* setpgrp.c */, + C9B53606138D9E980028D27C /* setrgid.c */, + C9B53608138D9E980028D27C /* setruid.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53612138D9E980028D27C /* darwin */ = { + isa = PBXGroup; + children = ( + C9ECE2761950E384008E8672 /* atexit_receipt.c */, + 92ABC7E81D375FC2000DF880 /* compatibility_hacks.c */, + C9D9432A138DB72000FB7ACC /* forceLibcToBuild.c */, + C9B53616138D9E980028D27C /* kvm.c */, + FC960EF21850F33A005B9A9A /* libc_private.h */, + ); + path = darwin; + sourceTree = ""; + }; + C9B5361D138D9E980028D27C /* db */ = { + isa = PBXGroup; + children = ( + C9B5361E138D9E980028D27C /* btree */, + C9B53634138D9E980028D27C /* db */, + C9B53638138D9E980028D27C /* hash */, + C9B5364E138D9E980028D27C /* man */, + C9B53658138D9E980028D27C /* mpool */, + C9B5365D138D9E980028D27C /* recno */, + ); + path = db; + sourceTree = ""; + }; + C9B5361E138D9E980028D27C /* btree */ = { + isa = PBXGroup; + children = ( + C9B5361F138D9E980028D27C /* FreeBSD */, + ); + path = btree; + sourceTree = ""; + }; + C9B5361F138D9E980028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53620138D9E980028D27C /* bt_close.c */, + C9B53621138D9E980028D27C /* bt_conv.c */, + C9B53622138D9E980028D27C /* bt_debug.c */, + C9B53623138D9E980028D27C /* bt_delete.c */, + C9B53624138D9E980028D27C /* bt_get.c */, + C9B53625138D9E980028D27C /* bt_open.c */, + C9B53626138D9E980028D27C /* bt_overflow.c */, + C9B53628138D9E980028D27C /* bt_page.c */, + C9B53629138D9E980028D27C /* bt_put.c */, + C9B5362A138D9E980028D27C /* bt_search.c */, + C9B5362B138D9E980028D27C /* bt_seq.c */, + C9B5362D138D9E980028D27C /* bt_split.c */, + C9B5362F138D9E980028D27C /* bt_utils.c */, + C9B53630138D9E980028D27C /* btree.h */, + C9B53632138D9E980028D27C /* bt_extern.h */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53634138D9E980028D27C /* db */ = { + isa = PBXGroup; + children = ( + C9B53635138D9E980028D27C /* FreeBSD */, + ); + path = db; + sourceTree = ""; + }; + C9B53635138D9E980028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53636138D9E980028D27C /* db.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53638138D9E980028D27C /* hash */ = { + isa = PBXGroup; + children = ( + C9B53639138D9E980028D27C /* FreeBSD */, + ); + path = hash; + sourceTree = ""; + }; + C9B53639138D9E980028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B5363A138D9E980028D27C /* hash_extern.h */, + C9B5363B138D9E980028D27C /* hash.c */, + C9B5363D138D9E980028D27C /* hash.h */, + C9B5363F138D9E980028D27C /* hash_bigkey.c */, + C9B53641138D9E980028D27C /* hash_buf.c */, + C9B53643138D9E980028D27C /* hash_func.c */, + C9B53645138D9E980028D27C /* hash_log2.c */, + C9B53647138D9E980028D27C /* hash_page.c */, + C9B53649138D9E980028D27C /* ndbm.c */, + C9B5364B138D9E980028D27C /* page.h */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B5364E138D9E980028D27C /* man */ = { + isa = PBXGroup; + children = ( + C9B5364F138D9E980028D27C /* FreeBSD */, + ); + path = man; + sourceTree = ""; + }; + C9B5364F138D9E980028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53650138D9E980028D27C /* btree.3 */, + C9B53651138D9E980028D27C /* dbm.3 */, + C9B53653138D9E980028D27C /* dbopen.3 */, + C9B53654138D9E980028D27C /* hash.3 */, + C9B53655138D9E980028D27C /* mpool.3 */, + C9B53656138D9E980028D27C /* recno.3 */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53658138D9E980028D27C /* mpool */ = { + isa = PBXGroup; + children = ( + C9B53659138D9E980028D27C /* FreeBSD */, + ); + path = mpool; + sourceTree = ""; + }; + C9B53659138D9E980028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B5365A138D9E980028D27C /* mpool.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B5365D138D9E980028D27C /* recno */ = { + isa = PBXGroup; + children = ( + C9B5365E138D9E980028D27C /* FreeBSD */, + ); + path = recno; + sourceTree = ""; + }; + C9B5365E138D9E980028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B5365F138D9E980028D27C /* rec_extern.h */, + C9B53661138D9E980028D27C /* rec_close.c */, + C9B53662138D9E980028D27C /* rec_delete.c */, + C9B53663138D9E980028D27C /* rec_get.c */, + C9B53664138D9E980028D27C /* rec_open.c */, + C9B53665138D9E980028D27C /* rec_put.c */, + C9B53666138D9E980028D27C /* rec_search.c */, + C9B53667138D9E980028D27C /* rec_seq.c */, + C9B53668138D9E980028D27C /* rec_utils.c */, + C9B53669138D9E980028D27C /* recno.h */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B5366C138D9E980028D27C /* emulated */ = { + isa = PBXGroup; + children = ( + C9B5366D138D9E980028D27C /* brk.2 */, + C9B5366E138D9E980028D27C /* brk.c */, + C9B5366F138D9E980028D27C /* bsd_signal.3 */, + C9B53670138D9E980028D27C /* bsd_signal.c */, + C9B53671138D9E980028D27C /* lchflags.3 */, + C9B53672138D9E980028D27C /* lchflags.c */, + C9B53673138D9E980028D27C /* lchmod.3 */, + C9B53674138D9E980028D27C /* lchmod.c */, + C9B53675138D9E980028D27C /* lutimes.3 */, + C9B53676138D9E980028D27C /* lutimes.c */, + C9B53678138D9E980028D27C /* statvfs.3 */, + C9B53679138D9E980028D27C /* statvfs.c */, + C9B5367A138D9E980028D27C /* tcgetsid.3 */, + C9B5367B138D9E980028D27C /* tcgetsid.c */, + ); + path = emulated; + sourceTree = ""; + }; + C9B5367C138D9E980028D27C /* fbsdcompat */ = { + isa = PBXGroup; + children = ( + C9B5367D138D9E980028D27C /* _fbsd_compat_.h */, + C9B5367E138D9E980028D27C /* _fpmath.h */, + C9B5367F138D9E980028D27C /* fpmath.h */, + C9B53681138D9E980028D27C /* machine */, + C9B53683138D9E980028D27C /* namespace.h */, + C9B53684138D9E980028D27C /* port_after.h */, + C9B53685138D9E980028D27C /* port_before.h */, + C9B53686138D9E980028D27C /* reentrant.h */, + C9B53687138D9E980028D27C /* spinlock.h */, + C9B53688138D9E980028D27C /* sys */, + C9B5368B138D9E980028D27C /* un-namespace.h */, + ); + path = fbsdcompat; + sourceTree = ""; + }; + C9B53681138D9E980028D27C /* machine */ = { + isa = PBXGroup; + children = ( + C9B53682138D9E980028D27C /* atomic.h */, + ); + path = machine; + sourceTree = ""; + }; + C9B53688138D9E980028D27C /* sys */ = { + isa = PBXGroup; + children = ( + C9B53689138D9E980028D27C /* cdefs.h */, + C9B5368A138D9E980028D27C /* endian.h */, + ); + path = sys; + sourceTree = ""; + }; + C9B5368D138D9E980028D27C /* gdtoa */ = { + isa = PBXGroup; + children = ( + C9B5368E138D9E980028D27C /* _ldbl_util.c */, + C9B5368F138D9E980028D27C /* arith.h */, + C9B53690138D9E980028D27C /* FreeBSD */, + C9B536BD138D9E980028D27C /* gd_qnan.h */, + C9B536BE138D9E980028D27C /* gdtoa.tgz */, + ); + path = gdtoa; + sourceTree = ""; + }; + C9B53690138D9E980028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53691138D9E980028D27C /* _hdtoa.c */, + C9B53693138D9E980028D27C /* _ldtoa.c */, + C9B53695138D9E980028D27C /* gdtoa-dmisc.c */, + C9B53696138D9E980028D27C /* gdtoa-dtoa.c */, + C9B53697138D9E980028D27C /* gdtoa-gdtoa.c */, + C9B53698138D9E980028D27C /* gdtoa-gethex.c */, + C9B5369A138D9E980028D27C /* gdtoa-gmisc.c */, + C9B5369B138D9E980028D27C /* gdtoa-hd_init.c */, + C9B5369C138D9E980028D27C /* gdtoa-hexnan.c */, + C9B5369E138D9E980028D27C /* gdtoa-misc.c */, + C9B536A0138D9E980028D27C /* gdtoa-smisc.c */, + C9B536A1138D9E980028D27C /* gdtoa-strtod.c */, + C9B536A3138D9E980028D27C /* gdtoa-strtodg.c */, + C9B536A5138D9E980028D27C /* gdtoa-strtof.c */, + C9B536A7138D9E980028D27C /* gdtoa-strtoIg.c */, + C9B536A8138D9E980028D27C /* gdtoa-strtopdd.c */, + C9B536AA138D9E980028D27C /* gdtoa-strtopx.c */, + C9B536AC138D9E980028D27C /* gdtoa-strtord.c */, + C9B536AE138D9E980028D27C /* gdtoa-sum.c */, + C9B536AF138D9E980028D27C /* gdtoa-ulp.c */, + C9B536B0138D9E980028D27C /* gdtoa.h */, + C9B536B2138D9E980028D27C /* gdtoa_fltrnds.h */, + C9B536B3138D9E980028D27C /* gdtoaimp.h */, + C9B536B5138D9E980028D27C /* glue.c */, + C9B536B6138D9E980028D27C /* machdep_ldisd.c */, + C9B536B8138D9E980028D27C /* machdep_ldisdd.c */, + C9B536BA138D9E980028D27C /* machdep_ldisQ.c */, + C9B536BB138D9E980028D27C /* machdep_ldisx.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B536C0138D9E980028D27C /* gen */ = { + isa = PBXGroup; + children = ( + 147CDFCF1B7C14FA00831EC6 /* clock_gettime.3 */, + 147CDFD01B7C14FA00831EC6 /* clock_gettime.c */, + C9B536C1138D9E990028D27C /* __dirent.h */, + C9B536D5138D9E990028D27C /* authentication.c */, + C9B536D6138D9E990028D27C /* backtrace.3 */, + C9B536D7138D9E990028D27C /* backtrace.c */, + C9B536D9138D9E990028D27C /* compat.5 */, + C9B536DA138D9E990028D27C /* confstr.3 */, + C9B536DB138D9E990028D27C /* confstr.c */, + C9B536DC138D9E990028D27C /* crypt.3 */, + C9B536DD138D9E990028D27C /* crypt.c */, + C9B536DE138D9E990028D27C /* devname.3 */, + C9B536DF138D9E990028D27C /* devname.c */, + C9B536E0138D9E990028D27C /* directory.3 */, + 3FB7E1B4146EF2E000843438 /* dirfd.c */, + C9B536E1138D9E990028D27C /* disklabel.c */, + C9B536E2138D9E990028D27C /* errlst.c */, + C9B536E3138D9E990028D27C /* execinfo.h */, + C9B536E4138D9E990028D27C /* filesec.c */, + C9B536E5138D9E990028D27C /* FreeBSD */, + C9B537C3138D9E990028D27C /* fts.3 */, + C9B537C4138D9E990028D27C /* fts.c */, + C9B537C5138D9E990028D27C /* ftw.3 */, + C9B537C6138D9E990028D27C /* get_compat.c */, + C9B537C7138D9E990028D27C /* get_compat.h */, + C9B537C8138D9E990028D27C /* getdomainname.3 */, + C9B537C9138D9E990028D27C /* getloadavg.3 */, + C9B537CA138D9E990028D27C /* getloadavg.c */, + C9B537CB138D9E990028D27C /* getttyent.3 */, + C9B537CC138D9E990028D27C /* getttyent.c */, + C9B537CD138D9E990028D27C /* getusershell.3 */, + C9B537CE138D9E990028D27C /* getusershell.c */, + C9B537CF138D9E990028D27C /* getvfsbyname.3 */, + C9B537D0138D9E990028D27C /* getvfsbyname.c */, + C9B537D1138D9E990028D27C /* intro.3 */, + C9B537DC138D9E990028D27C /* nanosleep.c */, + C9B537DD138D9E990028D27C /* NetBSD */, + C9B537E6138D9E990028D27C /* nftw.c */, + C9B537E7138D9E990028D27C /* nlist.3 */, + C9B537E8138D9E990028D27C /* nlist.c */, + C9B537EA138D9E990028D27C /* oldsyslog.c */, + C9B537ED138D9E990028D27C /* posix_memalign.3 */, + C9B537EE138D9E990028D27C /* pwcache.3 */, + C9B53761138D9E990028D27C /* raise.c */, + C9B537F2138D9E990028D27C /* setlogin.c */, + C9B537F3138D9E990028D27C /* sigsetops.3 */, + C9B537F4138D9E990028D27C /* sigsetops.c */, + C9B537F8138D9E990028D27C /* strtofflags.3 */, + C9B537F9138D9E990028D27C /* strtofflags.c */, + B19C64591450F8B900032373 /* sync_volume_np.3 */, + B19C645B1450F90200032373 /* sync_volume_np.c */, + C9B537FC138D9E990028D27C /* tcgetpgrp.3 */, + C9B537FD138D9E990028D27C /* tcsendbreak.3 */, + C9B537FE138D9E990028D27C /* tcsetattr.3 */, + C9B537FF138D9E990028D27C /* tcsetpgrp.3 */, + C9B53800138D9E990028D27C /* thread_stack_pcs.c */, + 2B514AB3203E4D9500641A4B /* thread_stack_pcs.h */, + C9B53801138D9E990028D27C /* tzset.3 */, + C9B53802138D9E990028D27C /* uname.3 */, + C9B53803138D9E990028D27C /* uname.c */, + C9B53804138D9E990028D27C /* utmpx-darwin.c */, + C9B53805138D9E990028D27C /* utmpx-darwin.h */, + C9B53806138D9E990028D27C /* utmpx_thread.h */, + ); + path = gen; + sourceTree = ""; + }; + C9B536E5138D9E990028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9EB354F138F7EA50075BB52 /* getmntinfo64.c */, + C9EB350E138F769B0075BB52 /* scandir_b.c */, + C9B536E8138D9E990028D27C /* alarm.3 */, + C9B536EB138D9E990028D27C /* arc4random.3 */, + C9B536F0138D9E990028D27C /* basename.3 */, + C9B536F4138D9E990028D27C /* clock.3 */, + C9B536F8138D9E990028D27C /* ctermid.3 */, + C9B536FB138D9E990028D27C /* daemon.3 */, + C9B536FF138D9E990028D27C /* dirname.3 */, + C9B53707138D9E990028D27C /* err.3 */, + C9B5370B138D9E990028D27C /* exec.3 */, + C9B5370F138D9E990028D27C /* fmtcheck.3 */, + C9B53711138D9E990028D27C /* fmtmsg.3 */, + C9B53714138D9E990028D27C /* fnmatch.3 */, + C9B53718138D9E990028D27C /* ftok.3 */, + C9B5371B138D9E990028D27C /* getbsize.3 */, + C9B5371D138D9E990028D27C /* getcap.3 */, + C9B536E6138D9E990028D27C /* _rand48.c */, + C9B536EA138D9E990028D27C /* alarm.c */, + C9B536EC138D9E990028D27C /* arc4random.c */, + C9B536EE138D9E990028D27C /* assert.c */, + C9B536F2138D9E990028D27C /* basename.c */, + C9B536F5138D9E990028D27C /* clock.c */, + C9B536F6138D9E990028D27C /* closedir.c */, + C9B536FA138D9E990028D27C /* ctermid.c */, + C9B536FD138D9E990028D27C /* daemon.c */, + C9B53701138D9E990028D27C /* dirname.c */, + C9B53703138D9E990028D27C /* drand48.c */, + C9B53705138D9E990028D27C /* erand48.c */, + C9B53709138D9E990028D27C /* err.c */, + C9B5370D138D9E990028D27C /* exec.c */, + C9B53710138D9E990028D27C /* fmtcheck.c */, + C9B53712138D9E990028D27C /* fmtmsg.c */, + C9B53716138D9E990028D27C /* fnmatch.c */, + C9B5371A138D9E990028D27C /* ftok.c */, + C9B5371C138D9E990028D27C /* getbsize.c */, + C9B5371E138D9E990028D27C /* getcap.c */, + C9B53721138D9E990028D27C /* getcwd.3 */, + C9B53722138D9E990028D27C /* getcwd.c */, + C9B53724138D9E990028D27C /* gethostname.3 */, + C9B53726138D9E990028D27C /* gethostname.c */, + C9B53728138D9E990028D27C /* getlogin.c */, + C9B5372A138D9E990028D27C /* getmntinfo.3 */, + C9B5372C138D9E990028D27C /* getmntinfo.c */, + C9B5372E138D9E990028D27C /* getpagesize.3 */, + C9B5372F138D9E990028D27C /* getpagesize.c */, + C9B53730138D9E990028D27C /* getpass.3 */, + C9B53731138D9E990028D27C /* getpeereid.3 */, + C9B53732138D9E990028D27C /* getpeereid.c */, + C9B53733138D9E990028D27C /* getprogname.3 */, + C9B53735138D9E990028D27C /* getprogname.c */, + C9B53737138D9E990028D27C /* glob.3 */, + C9B53739138D9E990028D27C /* glob.c */, + C9B5373B138D9E990028D27C /* isatty.c */, + C9B5373D138D9E990028D27C /* jrand48.c */, + C9B5373F138D9E990028D27C /* lcong48.c */, + C9B53741138D9E990028D27C /* lockf.3 */, + C9B53743138D9E990028D27C /* lockf.c */, + C9B53745138D9E990028D27C /* lrand48.c */, + C9B53749138D9E990028D27C /* mrand48.c */, + C9B5374B138D9E990028D27C /* nice.3 */, + C9B5374C138D9E990028D27C /* nice.c */, + C9B5374E138D9E990028D27C /* nrand48.c */, + C9B53750138D9E990028D27C /* opendir.c */, + C9B53752138D9E990028D27C /* pause.3 */, + C9B53753138D9E990028D27C /* pause.c */, + C9B53755138D9E990028D27C /* popen.3 */, + C9B53757138D9E990028D27C /* popen.c */, + C9B5375D138D9E990028D27C /* psignal.3 */, + C9B5375F138D9E990028D27C /* psignal.c */, + C9B53760138D9E990028D27C /* raise.3 */, + C9B53762138D9E990028D27C /* rand48.3 */, + C9B53764138D9E990028D27C /* rand48.h */, + C9B53766138D9E990028D27C /* readdir.c */, + C9B53768138D9E990028D27C /* readpassphrase.3 */, + C9B53769138D9E990028D27C /* readpassphrase.c */, + C9B5376B138D9E990028D27C /* rewinddir.c */, + C9B5376C138D9E990028D27C /* scandir.3 */, + C9B5376E138D9E990028D27C /* scandir.c */, + C9B53771138D9E990028D27C /* seed48.c */, + C9B53773138D9E990028D27C /* seekdir.c */, + C9B53774138D9E990028D27C /* sethostname.c */, + C9B53775138D9E990028D27C /* setmode.3 */, + C9B53776138D9E990028D27C /* setmode.c */, + C9B53778138D9E990028D27C /* setprogname.c */, + C9B5377A138D9E990028D27C /* siginterrupt.3 */, + C9B5377C138D9E990028D27C /* siginterrupt.c */, + C9B5377D138D9E990028D27C /* siglist.c */, + C9B5377F138D9E990028D27C /* signal.3 */, + C9B53781138D9E990028D27C /* signal.c */, + C9B53783138D9E990028D27C /* signbit.3 */, + C9B53785138D9E990028D27C /* sleep.3 */, + C9B53787138D9E990028D27C /* sleep.c */, + C9B53789138D9E990028D27C /* srand48.c */, + C9B5378B138D9E990028D27C /* stringlist.3 */, + C9B5378C138D9E990028D27C /* stringlist.c */, + C9B5378D138D9E990028D27C /* sysconf.3 */, + C9B5378E138D9E990028D27C /* sysconf.c */, + C9B53790138D9E990028D27C /* sysctl.3 */, + C9B53792138D9E990028D27C /* sysctl.c */, + C9B53794138D9E990028D27C /* sysctlbyname.c */, + C9B53795138D9E990028D27C /* sysctlnametomib.c */, + C9B53796138D9E990028D27C /* telldir.c */, + C9B53798138D9E990028D27C /* telldir.h */, + C9B5379A138D9E990028D27C /* termios.c */, + C9B5379C138D9E990028D27C /* time.3 */, + C9B5379E138D9E990028D27C /* time.c */, + C9B537A0138D9E990028D27C /* times.3 */, + C9B537A2138D9E990028D27C /* times.c */, + 922D0C0821BFA1520072834D /* timespec_get.3 */, + 922D0C0921BFA1530072834D /* timespec_get.c */, + C9B537A3138D9E990028D27C /* timezone.3 */, + C9B537A4138D9E990028D27C /* timezone.c */, + C9B537A5138D9E990028D27C /* ttyname.3 */, + C9B537A7138D9E990028D27C /* ttyname.c */, + C9B537A9138D9E990028D27C /* ttyslot.c */, + C9B537AA138D9E990028D27C /* ualarm.3 */, + C9B537AC138D9E990028D27C /* ualarm.c */, + C9B537AE138D9E990028D27C /* ulimit.3 */, + C9B537B0138D9E990028D27C /* ulimit.c */, + C9B537B1138D9E990028D27C /* unvis.3 */, + C9B537B2138D9E990028D27C /* unvis.c */, + C9B537B4138D9E990028D27C /* usleep.3 */, + C9B537B6138D9E990028D27C /* usleep.c */, + C9B537B8138D9E990028D27C /* utime.3 */, + C9B537BA138D9E990028D27C /* utime.c */, + C9B537BB138D9E990028D27C /* vis.3 */, + C9B537BC138D9E990028D27C /* vis.c */, + C9B537BE138D9E990028D27C /* wait.c */, + C9B537C0138D9E990028D27C /* wait3.c */, + C9B537C1138D9E990028D27C /* waitpid.c */, + C9B53807138D9E990028D27C /* wordexp.3 */, + C9B53808138D9E990028D27C /* wordexp.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B537DD138D9E990028D27C /* NetBSD */ = { + isa = PBXGroup; + children = ( + 3F267F36163FC8880089A0A6 /* rb.c */, + 3F267F37163FC8880089A0A6 /* rbtree.3 */, + C9B537DE138D9E990028D27C /* endutxent.3 */, + C9B537E0138D9E990028D27C /* getlastlogx.3 */, + C9B537E2138D9E990028D27C /* utmpx.5 */, + C9B537E4138D9E990028D27C /* utmpx.c */, + ); + path = NetBSD; + sourceTree = ""; + }; + C9B5380A138D9E990028D27C /* gmon */ = { + isa = PBXGroup; + children = ( + C9B5380B138D9E990028D27C /* gmon.c */, + C9B5380D138D9E990028D27C /* moncontrol.3 */, + ); + path = gmon; + sourceTree = ""; + }; + C9B5380F138D9E990028D27C /* i386 */ = { + isa = PBXGroup; + children = ( + C9B53810138D9E990028D27C /* gen */, + ); + path = i386; + sourceTree = ""; + }; + C9B53810138D9E990028D27C /* gen */ = { + isa = PBXGroup; + children = ( + C9B53819138D9E990028D27C /* mcount.s */, + ); + path = gen; + sourceTree = ""; + }; + C9B5384F138D9E990028D27C /* include */ = { + isa = PBXGroup; + children = ( + E464104B224C5EA2001B23EF /* __wctype.h */, + E464104C224C5F19001B23EF /* _ctype.h */, + 3006CB0E20BF7482003C5C79 /* _stdio.h */, + C9B53850138D9E990028D27C /* _locale.h */, + FC60BAD016555A4A00033196 /* _types */, + C9B53852138D9E990028D27C /* _types.h */, + C9B53853138D9E990028D27C /* _wctype.h */, + C9B53854138D9E990028D27C /* _xlocale.h */, + C9B53855138D9E990028D27C /* aio.h */, + C9B53856138D9E990028D27C /* alloca.h */, + C9B53857138D9E990028D27C /* ar.h */, + C9B53858138D9E990028D27C /* arpa */, + C9B5385F138D9E990028D27C /* asm.h */, + C9B53860138D9E990028D27C /* assert.h */, + C9B53861138D9E990028D27C /* authentication.h */, + C9B53862138D9E990028D27C /* bitstring.h */, + C9B53863138D9E990028D27C /* cpio.h */, + C9B53865138D9E990028D27C /* crt_externs.h */, + C9B53866138D9E990028D27C /* ctype.h */, + C9B53867138D9E990028D27C /* db.h */, + C9B53868138D9E990028D27C /* dirent.h */, + C9B53869138D9E990028D27C /* disktab.h */, + C9B5386A138D9E990028D27C /* err.h */, + C9B5386B138D9E990028D27C /* errno.h */, + C9B5386C138D9E990028D27C /* fcntl.h */, + C9B5386D138D9E990028D27C /* fmtmsg.h */, + C9B5386E138D9E990028D27C /* fnmatch.h */, + C9B5386F138D9E990028D27C /* FreeBSD */, + C9B53872138D9E990028D27C /* fsproperties.h */, + C9B53873138D9E990028D27C /* fstab.h */, + C9B53874138D9E990028D27C /* fts.h */, + C9B53875138D9E990028D27C /* ftw.h */, + C9B53876138D9E990028D27C /* getopt.h */, + C9B53877138D9E990028D27C /* glob.h */, + C9B53879138D9E990028D27C /* inttypes.h */, + C9B5387A138D9E990028D27C /* iso646.h */, + C9B5387B138D9E990028D27C /* kvm.h */, + C9B5387C138D9E990028D27C /* langinfo.h */, + C9B5387D138D9E990028D27C /* libc.h */, + C9B5387E138D9E990028D27C /* libgen.h */, + C9B5387F138D9E990028D27C /* libkern */, + C9B53885138D9E990028D27C /* limits.h */, + C9B53886138D9E990028D27C /* locale.h */, + C9B5388B138D9E990028D27C /* memory.h */, + C9B5388C138D9E990028D27C /* monetary.h */, + C9B5388D138D9E990028D27C /* monitor.h */, + C9B5388E138D9E990028D27C /* mpool.h */, + C9B5388F138D9E990028D27C /* ndbm.h */, + C9B53890138D9E990028D27C /* NetBSD */, + C9B53893138D9E990028D27C /* nlist.h */, + C9B53899138D9E990028D27C /* paths.h */, + C9B5389A138D9E990028D27C /* poll.h */, + B126140715881A420077E3CC /* printf.h */, + C9B5389B138D9E990028D27C /* protocols */, + C9B538A2138D9E990028D27C /* ranlib.h */, + C9B538A3138D9E990028D27C /* readpassphrase.h */, + C9B538A4138D9E990028D27C /* regex.h */, + C9B538A5138D9E990028D27C /* rune.h */, + C9B538A6138D9E990028D27C /* runetype.h */, + C9B538A7138D9E990028D27C /* search.h */, + C9B538A8138D9E990028D27C /* secure */, + C9B538AD138D9E990028D27C /* semaphore.h */, + C9B538AF138D9E990028D27C /* sgtty.h */, + C9B538B0138D9E990028D27C /* signal.h */, + C9B538B3138D9E990028D27C /* stab.h */, + C9B538B4138D9E990028D27C /* standards.h */, + C9B538B6138D9E990028D27C /* stddef.h */, + C9B538B7138D9E990028D27C /* stdint.h */, + C9B538B8138D9E990028D27C /* stdio.h */, + C9B538B9138D9E990028D27C /* stdlib.h */, + C9B538BA138D9E990028D27C /* strhash.h */, + C9B538BB138D9E990028D27C /* string.h */, + C9B538BC138D9E990028D27C /* stringlist.h */, + C9B538BD138D9E990028D27C /* strings.h */, + C9B538BE138D9E990028D27C /* struct.h */, + C9B538BF138D9E990028D27C /* sys */, + C9B538C4138D9E990028D27C /* sysexits.3 */, + C9B538C5138D9E990028D27C /* sysexits.h */, + C9B538C6138D9E990028D27C /* syslog.h */, + C9B538C7138D9E990028D27C /* tar.h */, + C9B538C8138D9E990028D27C /* termios.h */, + C9B538C9138D9E990028D27C /* time.h */, + C9B538CA138D9E990028D27C /* timeconv.h */, + C9B538CB138D9E990028D27C /* ttyent.h */, + C9B538CD138D9E990028D27C /* ulimit.h */, + C9B538CE138D9E990028D27C /* unistd.h */, + C9B538CF138D9E990028D27C /* util.h */, + C9B538D0138D9E990028D27C /* utime.h */, + C9B538D1138D9E990028D27C /* utmp.h */, + C9B538D2138D9E990028D27C /* vis.h */, + C9B538D3138D9E990028D27C /* wchar.h */, + C9B538D4138D9E990028D27C /* wctype.h */, + C9B538D5138D9E990028D27C /* wordexp.h */, + C9B538D6138D9E990028D27C /* xlocale */, + C9B538E3138D9E990028D27C /* xlocale.h */, + ); + path = include; + sourceTree = ""; + }; + C9B53858138D9E990028D27C /* arpa */ = { + isa = PBXGroup; + children = ( + C9B53859138D9E990028D27C /* ftp.h */, + FC2ED623157D4DA90098EC69 /* inet.h */, + C9B5385B138D9E990028D27C /* nameser_compat.h */, + C9B5385C138D9E990028D27C /* telnet.h */, + C9B5385D138D9E990028D27C /* tftp.h */, + ); + path = arpa; + sourceTree = ""; + }; + C9B5386F138D9E990028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53870138D9E990028D27C /* nl_types.h */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B5387F138D9E990028D27C /* libkern */ = { + isa = PBXGroup; + children = ( + C9B53884138D9E990028D27C /* OSThermalNotification.h */, + ); + path = libkern; + sourceTree = ""; + }; + C9B53890138D9E990028D27C /* NetBSD */ = { + isa = PBXGroup; + children = ( + C9B53891138D9E990028D27C /* utmpx.h */, + ); + path = NetBSD; + sourceTree = ""; + }; + C9B5389B138D9E990028D27C /* protocols */ = { + isa = PBXGroup; + children = ( + C9B5389D138D9E990028D27C /* routed.h */, + C9B5389E138D9E990028D27C /* rwhod.h */, + C9B5389F138D9E990028D27C /* talkd.h */, + C9B538A0138D9E990028D27C /* timed.h */, + ); + path = protocols; + sourceTree = ""; + }; + C9B538A8138D9E990028D27C /* secure */ = { + isa = PBXGroup; + children = ( + C9B538A9138D9E990028D27C /* _common.h */, + C9B538AA138D9E990028D27C /* _stdio.h */, + C9B538AB138D9E990028D27C /* _string.h */, + E40EA6C01EAA8F9300B2FA36 /* _strings.h */, + ); + path = secure; + sourceTree = ""; + }; + C9B538BF138D9E990028D27C /* sys */ = { + isa = PBXGroup; + children = ( + C9B538C0138D9E990028D27C /* acl.h */, + C9B538C1138D9E990028D27C /* cdefs.h */, + 3F267F39163FC8BD0089A0A6 /* rbtree.h */, + C9B538C3138D9E990028D27C /* statvfs.h */, + ); + path = sys; + sourceTree = ""; + }; + C9B538D6138D9E990028D27C /* xlocale */ = { + isa = PBXGroup; + children = ( + C9B538D7138D9E990028D27C /* __wctype.h */, + C9B538D8138D9E990028D27C /* _ctype.h */, + C9B538D9138D9E990028D27C /* _inttypes.h */, + C9B538DA138D9E990028D27C /* _langinfo.h */, + C9B538DB138D9E990028D27C /* _monetary.h */, + C9B538DC138D9E990028D27C /* _stdio.h */, + C9B538DD138D9E990028D27C /* _stdlib.h */, + C9B538DE138D9E990028D27C /* _string.h */, + C9B538DF138D9E990028D27C /* _time.h */, + C9B538E0138D9E990028D27C /* _wchar.h */, + C9B538E1138D9E990028D27C /* _wctype.h */, + ); + path = xlocale; + sourceTree = ""; + }; + C9B538FE138D9E990028D27C /* locale */ = { + isa = PBXGroup; + children = ( + C9B538FF138D9E990028D27C /* ctype_l.3 */, + C9B53900138D9E990028D27C /* duplocale.3 */, + C9B53901138D9E990028D27C /* FreeBSD */, + C9B539E2138D9E990028D27C /* freelocale.3 */, + C9B539E3138D9E990028D27C /* frune.c */, + C9B539E4138D9E990028D27C /* isalnum_l.3 */, + C9B539E5138D9E990028D27C /* isctype.c */, + C9B539E6138D9E990028D27C /* iswalnum_l.3 */, + C9B539E7138D9E990028D27C /* iswctype.c */, + C9B539E8138D9E990028D27C /* lconv.c */, + C9B539EA138D9E990028D27C /* mbrune.3 */, + C9B539EB138D9E990028D27C /* mbrune.c */, + C9B539EC138D9E990028D27C /* newlocale.3 */, + C9B539ED138D9E990028D27C /* querylocale.3 */, + C9B539EE138D9E990028D27C /* rune.3 */, + C9B539EF138D9E990028D27C /* runedepreciated.c */, + C9B539F0138D9E990028D27C /* runedepreciated.h */, + C9B539F1138D9E990028D27C /* setinvalidrune.c */, + C9B539F2138D9E990028D27C /* uselocale.3 */, + C9B539F3138D9E990028D27C /* utf2.5 */, + C9B539F4138D9E990028D27C /* wcstod_l.3 */, + C9B539F5138D9E990028D27C /* wcstol_l.3 */, + C9B539F6138D9E990028D27C /* xlocale.3 */, + C9B539F7138D9E990028D27C /* xlocale.c */, + C9B539F8138D9E990028D27C /* xlocale_private.h */, + ); + path = locale; + sourceTree = ""; + }; + C9B53901138D9E990028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53902138D9E990028D27C /* ascii.c */, + C9B53904138D9E990028D27C /* big5.5 */, + C9B53905138D9E990028D27C /* big5.c */, + C9B53907138D9E990028D27C /* btowc.3 */, + C9B53909138D9E990028D27C /* btowc.c */, + C9B5390B138D9E990028D27C /* collate.c */, + C9B5390D138D9E990028D27C /* collate.h */, + C9B5390F138D9E990028D27C /* collcmp.c */, + C9B53911138D9E990028D27C /* ctype.3 */, + C9B53913138D9E990028D27C /* digittoint.3 */, + C9B53915138D9E990028D27C /* euc.5 */, + C9B53916138D9E990028D27C /* euc.c */, + C9B53918138D9E990028D27C /* fix_grouping.c */, + C9B5391A138D9E990028D27C /* gb18030.5 */, + C9B5391B138D9E990028D27C /* gb18030.c */, + C9B5391D138D9E990028D27C /* gb2312.5 */, + C9B5391E138D9E990028D27C /* gb2312.c */, + C9B53920138D9E990028D27C /* gbk.5 */, + C9B53921138D9E990028D27C /* gbk.c */, + C9B53923138D9E990028D27C /* isalnum.3 */, + C9B53925138D9E990028D27C /* isalpha.3 */, + C9B53927138D9E990028D27C /* isascii.3 */, + C9B53928138D9E990028D27C /* isblank.3 */, + C9B5392A138D9E990028D27C /* iscntrl.3 */, + C9B5392C138D9E990028D27C /* isdigit.3 */, + C9B5392E138D9E990028D27C /* isgraph.3 */, + C9B53930138D9E990028D27C /* isideogram.3 */, + C9B53932138D9E990028D27C /* islower.3 */, + C9B53934138D9E990028D27C /* isphonogram.3 */, + C9B53936138D9E990028D27C /* isprint.3 */, + C9B53938138D9E990028D27C /* ispunct.3 */, + C9B5393A138D9E990028D27C /* isrune.3 */, + C9B5393C138D9E990028D27C /* isspace.3 */, + C9B5393E138D9E990028D27C /* isspecial.3 */, + C9B53940138D9E990028D27C /* isupper.3 */, + C9B53942138D9E990028D27C /* iswalnum.3 */, + C9B53944138D9E990028D27C /* isxdigit.3 */, + C9B53946138D9E990028D27C /* ldpart.c */, + C9B53948138D9E990028D27C /* ldpart.h */, + C9B5394A138D9E990028D27C /* lmessages.c */, + C9B5394C138D9E990028D27C /* lmessages.h */, + C9B5394E138D9E990028D27C /* lmonetary.c */, + C9B53950138D9E990028D27C /* lmonetary.h */, + C9B53952138D9E990028D27C /* lnumeric.c */, + C9B53954138D9E990028D27C /* lnumeric.h */, + C9B53956138D9E990028D27C /* localeconv.3 */, + C9B53958138D9E990028D27C /* localeconv.c */, + C9B5395A138D9E990028D27C /* mblen.3 */, + C9B5395C138D9E990028D27C /* mblen.c */, + C9B5395E138D9E990028D27C /* mblocal.h */, + C9B53960138D9E990028D27C /* mbrlen.3 */, + C9B53962138D9E990028D27C /* mbrlen.c */, + C9B53964138D9E990028D27C /* mbrtowc.3 */, + C9B53966138D9E990028D27C /* mbrtowc.c */, + C9B53968138D9E990028D27C /* mbsinit.3 */, + C9B5396A138D9E990028D27C /* mbsinit.c */, + C9B5396C138D9E990028D27C /* mbsnrtowcs.c */, + C9B5396E138D9E990028D27C /* mbsrtowcs.3 */, + C9B53970138D9E990028D27C /* mbsrtowcs.c */, + C9B53972138D9E990028D27C /* mbstowcs.3 */, + C9B53974138D9E990028D27C /* mbstowcs.c */, + C9B53976138D9E990028D27C /* mbtowc.3 */, + C9B53978138D9E990028D27C /* mbtowc.c */, + C9B5397A138D9E990028D27C /* mskanji.5 */, + C9B5397B138D9E990028D27C /* mskanji.c */, + C9B5397D138D9E990028D27C /* multibyte.3 */, + C9B5397E138D9E990028D27C /* nextwctype.3 */, + C9B53980138D9E990028D27C /* nextwctype.c */, + C9B53982138D9E990028D27C /* nl_langinfo.3 */, + C9B53984138D9E990028D27C /* nl_langinfo.c */, + C9B53986138D9E990028D27C /* nomacros.c */, + C9B53987138D9E990028D27C /* none.c */, + C9B53989138D9E990028D27C /* rune.c */, + C95B7ED8138F3C11004311DA /* rune32.h */, + C9B5398B138D9E990028D27C /* runetype.c */, + C9B5398D138D9E990028D27C /* setlocale.3 */, + C9B5398F138D9E990028D27C /* setlocale.c */, + C9B53991138D9E990028D27C /* setlocale.h */, + C9B53993138D9E990028D27C /* setrunelocale.c */, + C9B53995138D9E990028D27C /* table.c */, + C9B53997138D9E990028D27C /* toascii.3 */, + C9B53998138D9E990028D27C /* tolower.3 */, + C9B5399A138D9E990028D27C /* tolower.c */, + C9B5399C138D9E990028D27C /* toupper.3 */, + C9B5399E138D9E990028D27C /* toupper.c */, + C9B539A0138D9E990028D27C /* towlower.3 */, + C9B539A2138D9E990028D27C /* towupper.3 */, + C9B539A5138D9E990028D27C /* utf8.5 */, + C9FA32F8138E4A5C0089A94B /* utf2.c */, + C9B539A6138D9E990028D27C /* utf8.c */, + C9B539A8138D9E990028D27C /* wcrtomb.3 */, + C9B539AA138D9E990028D27C /* wcrtomb.c */, + C9B539AC138D9E990028D27C /* wcsftime.3 */, + C9B539AE138D9E990028D27C /* wcsftime.c */, + C9B539B0138D9E990028D27C /* wcsnrtombs.c */, + C9B539B2138D9E990028D27C /* wcsrtombs.3 */, + C9B539B4138D9E990028D27C /* wcsrtombs.c */, + C9B539B6138D9E990028D27C /* wcstod.3 */, + C9B539B8138D9E990028D27C /* wcstod.c */, + C9B539BA138D9E990028D27C /* wcstof.c */, + C9B539BC138D9E990028D27C /* wcstoimax.c */, + C9B539BE138D9E990028D27C /* wcstol.3 */, + C9B539C0138D9E990028D27C /* wcstol.c */, + C9B539C2138D9E990028D27C /* wcstold.c */, + C9B539C4138D9E990028D27C /* wcstoll.c */, + C9B539C6138D9E990028D27C /* wcstombs.3 */, + C9B539C8138D9E990028D27C /* wcstombs.c */, + C9B539CA138D9E990028D27C /* wcstoul.c */, + C9B539CC138D9E990028D27C /* wcstoull.c */, + C9B539CE138D9E990028D27C /* wcstoumax.c */, + C9B539D0138D9E990028D27C /* wctob.c */, + C9B539D2138D9E990028D27C /* wctomb.3 */, + C9B539D4138D9E990028D27C /* wctomb.c */, + C9B539D6138D9E990028D27C /* wctrans.3 */, + C9B539D8138D9E990028D27C /* wctrans.c */, + C9B539DA138D9E990028D27C /* wctype.3 */, + C9B539DC138D9E990028D27C /* wctype.c */, + C9B539DE138D9E990028D27C /* wcwidth.3 */, + C9B539E0138D9E990028D27C /* wcwidth.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53A04138D9E990028D27C /* man */ = { + isa = PBXGroup; + children = ( + C9B53A05138D9E990028D27C /* assert.3 */, + C9B53A06138D9E990028D27C /* bitstring.3 */, + C9B53A08138D9E990028D27C /* FreeBSD */, + C9B53A0B138D9E990028D27C /* gethostuuid.2 */, + C9B53A0D138D9E990028D27C /* utmp.5 */, + C942135A13905D1C004BA536 /* manpages.lst */, + 4B151E0B1F8574B400F3F52F /* style.3 */, + ); + path = man; + sourceTree = ""; + }; + C9B53A08138D9E990028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + 928BD1091D7608A400EC01FC /* environ.7 */, + C9B53A09138D9E990028D27C /* stdarg.3 */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53A0E138D9E990028D27C /* nbsdcompat */ = { + isa = PBXGroup; + children = ( + C9B53A0F138D9E990028D27C /* _nbsd_compat_.h */, + C9B53A10138D9E990028D27C /* namespace.h */, + ); + path = nbsdcompat; + sourceTree = ""; + }; + C9B53A11138D9E990028D27C /* net */ = { + isa = PBXGroup; + children = ( + FC2ED60E157D4BE70098EC69 /* inet_ntop.c */, + FC2ED60F157D4BE70098EC69 /* inet_pton.c */, + C9B53A12138D9E990028D27C /* byteorder.3 */, + C9B53A13138D9E990028D27C /* ethers.3 */, + C9B53A14138D9E990028D27C /* FreeBSD */, + ); + path = net; + sourceTree = ""; + }; + C9B53A14138D9E990028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53A15138D9E990028D27C /* addr2ascii.3 */, + C9B53A16138D9E990028D27C /* addr2ascii.c */, + C9B53A17138D9E990028D27C /* ascii2addr.c */, + C9B53A18138D9E990028D27C /* inet.3 */, + C9B53A1A138D9E990028D27C /* inet_addr.c */, + C9B53A1C138D9E990028D27C /* inet_lnaof.c */, + C9B53A1D138D9E990028D27C /* inet_makeaddr.c */, + C9B53A1E138D9E990028D27C /* inet_net.3 */, + C9B53A20138D9E990028D27C /* inet_net_ntop.c */, + C9B53A21138D9E990028D27C /* inet_net_pton.c */, + C9B53A23138D9E990028D27C /* inet_neta.c */, + C9B53A24138D9E990028D27C /* inet_netof.c */, + C9B53A25138D9E990028D27C /* inet_network.c */, + C9B53A27138D9E990028D27C /* inet_ntoa.c */, + C9B53A29138D9E990028D27C /* linkaddr.3 */, + C9B53A2A138D9E990028D27C /* linkaddr.c */, + C9B53A2B138D9E990028D27C /* nsap_addr.c */, + C9B53A2D138D9E990028D27C /* recv.c */, + C9B53A2F138D9E990028D27C /* send.c */, + C9B53A31138D9E990028D27C /* sockatmark.3 */, + C9B53A33138D9E990028D27C /* sockatmark.c */, + C9B53A34138D9E990028D27C /* sourcefilter.3 */, + C9B53A36138D9E990028D27C /* sourcefilter.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53A3A138D9E990028D27C /* nls */ = { + isa = PBXGroup; + children = ( + C9B53A3B138D9E990028D27C /* FreeBSD */, + ); + path = nls; + sourceTree = ""; + }; + C9B53A3B138D9E990028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53A3C138D9E990028D27C /* catclose.3 */, + C9B53A3D138D9E990028D27C /* catgets.3 */, + C9B53A3E138D9E990028D27C /* catopen.3 */, + C9B53A3F138D9E990028D27C /* msgcat.c */, + C9B53A41138D9E990028D27C /* msgcat.h */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53A45138D9E990028D27C /* Platforms */ = { + isa = PBXGroup; + children = ( + C975E22B1A12ECA00093B345 /* appletv */, + E4EDB7252227DF25006A8322 /* driverkit */, + C9B53A46138D9E990028D27C /* iphoneos */, + C9B53A48138D9E990028D27C /* macosx */, + C9A288A61ACDBA95004A33A7 /* watchos */, + ); + path = Platforms; + sourceTree = ""; + }; + C9B53A46138D9E990028D27C /* iphoneos */ = { + isa = PBXGroup; + children = ( + C9B53A47138D9E990028D27C /* Makefile.inc */, + ); + path = iphoneos; + sourceTree = ""; + }; + C9B53A48138D9E990028D27C /* macosx */ = { + isa = PBXGroup; + children = ( + C9B53A49138D9E990028D27C /* Makefile.inc */, + ); + path = macosx; + sourceTree = ""; + }; + C9B53A4A138D9E990028D27C /* posix1e */ = { + isa = PBXGroup; + children = ( + C9B53A4B138D9E990028D27C /* acl.3 */, + C9B53A4C138D9E990028D27C /* acl.c */, + C9B53A4D138D9E990028D27C /* acl_add_flag_np.3 */, + C9B53A4E138D9E990028D27C /* acl_add_perm.3 */, + C9B53A4F138D9E990028D27C /* acl_clear_flags_np.3 */, + C9B53A50138D9E990028D27C /* acl_clear_perms.3 */, + C9B53A51138D9E990028D27C /* acl_copy_entry.3 */, + C9B53A52138D9E990028D27C /* acl_copy_ext.3 */, + C9B53A53138D9E990028D27C /* acl_create_entry.3 */, + C9B53A54138D9E990028D27C /* acl_delete.3 */, + C9B53A55138D9E990028D27C /* acl_delete_entry.3 */, + C9B53A56138D9E990028D27C /* acl_delete_flag_np.3 */, + C9B53A57138D9E990028D27C /* acl_delete_perm.3 */, + C9B53A58138D9E990028D27C /* acl_dup.3 */, + C9B53A59138D9E990028D27C /* acl_entry.c */, + C9B53A5A138D9E990028D27C /* acl_file.c */, + C9B53A5B138D9E990028D27C /* acl_flag.c */, + C9B53A5C138D9E990028D27C /* acl_free.3 */, + C9B53A5D138D9E990028D27C /* acl_from_text.3 */, + C9B53A5E138D9E990028D27C /* acl_get.3 */, + C9B53A5F138D9E990028D27C /* acl_get_entry.3 */, + C9B53A60138D9E990028D27C /* acl_get_fd.3 */, + C9B53A61138D9E990028D27C /* acl_get_flagset_np.3 */, + C9B53A62138D9E990028D27C /* acl_get_perm_np.3 */, + C9B53A63138D9E990028D27C /* acl_get_permset.3 */, + C9B53A64138D9E990028D27C /* acl_get_permset_mask_np.3 */, + C9B53A65138D9E990028D27C /* acl_get_qualifier.3 */, + C9B53A66138D9E990028D27C /* acl_get_tag_type.3 */, + C9B53A67138D9E990028D27C /* acl_init.3 */, + C9B53A68138D9E990028D27C /* acl_perm.c */, + C9B53A69138D9E990028D27C /* acl_set.3 */, + C9B53A6A138D9E990028D27C /* acl_set_flagset_np.3 */, + C9B53A6B138D9E990028D27C /* acl_set_permset.3 */, + C9B53A6C138D9E990028D27C /* acl_set_qualifier.3 */, + C9B53A6D138D9E990028D27C /* acl_set_tag_type.3 */, + C9B53A6E138D9E990028D27C /* acl_to_text.3 */, + C9B53A6F138D9E990028D27C /* acl_translate.c */, + C9B53A70138D9E990028D27C /* acl_valid.3 */, + C9B53A71138D9E990028D27C /* aclvar.h */, + ); + path = posix1e; + sourceTree = ""; + }; + C9B53B03138D9E990028D27C /* regex */ = { + isa = PBXGroup; + children = ( + C9B53B04138D9E990028D27C /* FreeBSD */, + B122F2AE1432B95B00AF95D0 /* TRE */, + ); + path = regex; + sourceTree = ""; + }; + C9B53B04138D9E990028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53B06138D9E990028D27C /* cname.h */, + C9B53B08138D9E990028D27C /* COPYRIGHT */, + C9B53B0B138D9E990028D27C /* re_format.7 */, + C9B53B0E138D9E990028D27C /* regerror.c */, + C9B53B10138D9E990028D27C /* regex.3 */, + C9B53B18138D9E990028D27C /* utils.h */, + C9B53B19138D9E990028D27C /* WHATSNEW */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53B1D138D9E990028D27C /* secure */ = { + isa = PBXGroup; + children = ( + C9B53B1E138D9E990028D27C /* chk_fail.c */, + 3F169A3C1643B7BA0029E851 /* memccpy_chk.c */, + C9B53B20138D9E990028D27C /* memcpy_chk.c */, + C9B53B21138D9E990028D27C /* memmove_chk.c */, + C9B53B22138D9E990028D27C /* memset_chk.c */, + C9B53B23138D9E990028D27C /* snprintf_chk.c */, + C9B53B24138D9E990028D27C /* sprintf_chk.c */, + C9B53B25138D9E990028D27C /* stpcpy_chk.c */, + C9B53B26138D9E990028D27C /* stpncpy_chk.c */, + C9B53B27138D9E990028D27C /* strcat_chk.c */, + C9B53B28138D9E990028D27C /* strcpy_chk.c */, + 3FA8F3081643AB4300D37078 /* strlcat_chk.c */, + 3FA8F3091643AB4300D37078 /* strlcpy_chk.c */, + C9B53B29138D9E990028D27C /* strncat_chk.c */, + C9B53B2A138D9E990028D27C /* strncpy_chk.c */, + C9B53B2B138D9E990028D27C /* vsnprintf_chk.c */, + C9B53B2C138D9E990028D27C /* vsprintf_chk.c */, + ); + path = secure; + sourceTree = ""; + }; + C9B53B2D138D9E990028D27C /* stdio */ = { + isa = PBXGroup; + children = ( + C9B53B2E138D9E990028D27C /* FreeBSD */, + C9B53C0F138D9E9A0028D27C /* getwc_l.3 */, + C9B53C11138D9E9A0028D27C /* printf_l.3 */, + C9B53C12138D9E9A0028D27C /* putwc_l.3 */, + C9B53C13138D9E9A0028D27C /* scanf_l.3 */, + C9B53C14138D9E9A0028D27C /* wprintf_l.3 */, + C9B53C15138D9E9A0028D27C /* wscanf_l.3 */, + B1795371158B0E35008990E8 /* xprintf_all_in_one.c */, + B126140215881A000077E3CC /* xprintf_comp.c */, + B126140315881A000077E3CC /* xprintf_domain.c */, + B126140415881A000077E3CC /* xprintf_domain.h */, + B1795372158B0E35008990E8 /* xprintf_exec.c */, + ); + path = stdio; + sourceTree = ""; + }; + C9B53B2E138D9E990028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53B2F138D9E990028D27C /* _flock_stub.c */, + C9B53B30138D9E990028D27C /* asprintf.c */, + C9B53B32138D9E990028D27C /* clrerr.c */, + C9B53B33138D9E990028D27C /* dprintf.c */, + C9B53B35138D9E990028D27C /* fclose.3 */, + C9B53B36138D9E990028D27C /* fclose.c */, + C9B53B38138D9E990028D27C /* fdopen.c */, + C9B53B3A138D9E990028D27C /* feof.c */, + C9B53B3B138D9E990028D27C /* ferror.3 */, + C9B53B3C138D9E990028D27C /* ferror.c */, + C9B53B3D138D9E990028D27C /* fflush.3 */, + C9B53B3E138D9E990028D27C /* fflush.c */, + C9B53B40138D9E990028D27C /* fgetc.c */, + C9B53B41138D9E990028D27C /* fgetln.3 */, + C9B53B43138D9E990028D27C /* fgetln.c */, + C9B53B45138D9E990028D27C /* fgetpos.c */, + C9B53B46138D9E990028D27C /* fgets.3 */, + C9B53B47138D9E990028D27C /* fgets.c */, + C9B53B48138D9E990028D27C /* fgetwc.c */, + C9B53B4A138D9E990028D27C /* fgetwln.3 */, + C9B53B4C138D9E990028D27C /* fgetwln.c */, + C9B53B4E138D9E990028D27C /* fgetws.3 */, + C9B53B50138D9E990028D27C /* fgetws.c */, + C9B53B52138D9E990028D27C /* fileno.c */, + C9B53B53138D9E990028D27C /* findfp.c */, + C9B53B55138D9E990028D27C /* flags.c */, + C9B53B57138D9E990028D27C /* floatio.h */, + C9B53B58138D9E990028D27C /* flockfile.3 */, + 92888B0F1EA5BE6D00BA923E /* fmemopen.c */, + C9B53B5A138D9E990028D27C /* fopen.3 */, + C9B53B5C138D9E990028D27C /* fopen.c */, + C9B53B5E138D9E990028D27C /* fprintf.c */, + C9B53B60138D9E990028D27C /* fpurge.c */, + C9B53B61138D9E990028D27C /* fputc.c */, + C9B53B62138D9E990028D27C /* fputs.3 */, + C9B53B64138D9E990028D27C /* fputs.c */, + C9B53B66138D9E990028D27C /* fputwc.c */, + C9B53B68138D9E990028D27C /* fputws.3 */, + C9B53B6A138D9E990028D27C /* fputws.c */, + C9B53B6C138D9E990028D27C /* fread.3 */, + C9B53B6E138D9E990028D27C /* fread.c */, + C9B53B70138D9E990028D27C /* freopen.c */, + C9B53B72138D9E990028D27C /* fscanf.c */, + C9B53B74138D9E990028D27C /* fseek.3 */, + C9B53B76138D9E990028D27C /* fseek.c */, + C9B53B77138D9E990028D27C /* fsetpos.c */, + C9B53B78138D9E990028D27C /* ftell.c */, + C9B53B7A138D9E990028D27C /* funopen.3 */, + C9B53B7B138D9E990028D27C /* funopen.c */, + C9B53B7D138D9E990028D27C /* fvwrite.c */, + C9B53B7E138D9E990028D27C /* fvwrite.h */, + C9B53B7F138D9E990028D27C /* fwalk.c */, + C9B53B80138D9E990028D27C /* fwide.3 */, + C9B53B82138D9E990028D27C /* fwide.c */, + C9B53B83138D9E990028D27C /* fwprintf.c */, + C9B53B85138D9E990028D27C /* fwrite.c */, + C9B53B87138D9E990028D27C /* fwscanf.c */, + C9B53B89138D9E990028D27C /* getc.3 */, + C9B53B8B138D9E990028D27C /* getc.c */, + C9B53B8C138D9E990028D27C /* getchar.c */, + C9B53B8D138D9E990028D27C /* getdelim.c */, + C9B53B8E138D9E990028D27C /* getline.3 */, + C9B53B90138D9E990028D27C /* getline.c */, + C9B53B91138D9E990028D27C /* gets.c */, + C9B53B92138D9E990028D27C /* getw.c */, + C9B53B93138D9E990028D27C /* getwc.3 */, + C9B53B95138D9E990028D27C /* getwc.c */, + C9B53B97138D9E990028D27C /* getwchar.c */, + C9B53B99138D9E990028D27C /* glue.h */, + C9B53B9A138D9E990028D27C /* local.h */, + C9B53B9C138D9E990028D27C /* makebuf.c */, + C9B53B9E138D9E990028D27C /* mktemp.3 */, + C9B53BA0138D9E990028D27C /* mktemp.c */, + 92888B101EA5BE6D00BA923E /* open_memstream.3 */, + 92888B111EA5BE6D00BA923E /* open_memstream.c */, + 92888B121EA5BE6D00BA923E /* open_wmemstream.c */, + C9B53BA2138D9E990028D27C /* perror.c */, + C9B53BA3138D9E990028D27C /* printf-pos.c */, + C9B53BA5138D9E990028D27C /* printf.3 */, + C9B53BA7138D9E990028D27C /* printf.c */, + C9B53BA9138D9E990028D27C /* printfcommon.h */, + C9B53BAB138D9E990028D27C /* printflocal.h */, + C9B53BAD138D9E990028D27C /* putc.3 */, + C9B53BAF138D9E990028D27C /* putc.c */, + C9B53BB0138D9E990028D27C /* putchar.c */, + C9B53BB1138D9E990028D27C /* puts.c */, + C9B53BB3138D9E990028D27C /* putw.c */, + C9B53BB4138D9E990028D27C /* putwc.3 */, + C9B53BB6138D9E990028D27C /* putwc.c */, + C9B53BB8138D9E990028D27C /* putwchar.c */, + C9B53BBA138D9E990028D27C /* refill.c */, + C9B53BBC138D9E990028D27C /* remove.3 */, + C9B53BBE138D9E990028D27C /* remove.c */, + C9B53BBF138D9E990028D27C /* rewind.c */, + C9B53BC1138D9E990028D27C /* rget.c */, + C9B53BC2138D9E990028D27C /* scanf.3 */, + C9B53BC4138D9E990028D27C /* scanf.c */, + C9B53BC6138D9E990028D27C /* setbuf.3 */, + C9B53BC8138D9E990028D27C /* setbuf.c */, + C9B53BC9138D9E990028D27C /* setbuffer.c */, + C9B53BCA138D9E990028D27C /* setvbuf.c */, + C9B53BCB138D9E990028D27C /* snprintf.c */, + C9B53BCD138D9E990028D27C /* sprintf.c */, + C9B53BCF138D9E990028D27C /* sscanf.c */, + C9B53BD1138D9E990028D27C /* stdio.3 */, + C9B53BD3138D9E990028D27C /* stdio.c */, + C9B53BD4138D9E990028D27C /* swprintf.c */, + C9B53BD6138D9E990028D27C /* swscanf.c */, + C9B53BD8138D9E990028D27C /* tempnam.c */, + C9B53BDA138D9E990028D27C /* tmpfile.c */, + C9B53BDB138D9E990028D27C /* tmpnam.3 */, + C9B53BDD138D9E990028D27C /* tmpnam.c */, + C9B53BDF138D9E990028D27C /* ungetc.3 */, + C9B53BE1138D9E990028D27C /* ungetc.c */, + C9B53BE2138D9E990028D27C /* ungetwc.3 */, + C9B53BE4138D9E990028D27C /* ungetwc.c */, + C9B53BE6138D9E990028D27C /* vasprintf.c */, + C9B53BE8138D9E990028D27C /* vdprintf.c */, + C9B53BEA138D9E990028D27C /* vfprintf.c */, + C9B53BEC138D9E990028D27C /* vfscanf.c */, + C9B53BEE138D9E9A0028D27C /* vfwprintf.c */, + C9B53BF0138D9E9A0028D27C /* vfwscanf.c */, + C9B53BF2138D9E9A0028D27C /* vprintf.c */, + C9B53BF4138D9E9A0028D27C /* vscanf.c */, + C9B53BF6138D9E9A0028D27C /* vsnprintf.c */, + C9B53BF8138D9E9A0028D27C /* vsprintf.c */, + C9B53BFA138D9E9A0028D27C /* vsscanf.c */, + C9B53BFC138D9E9A0028D27C /* vswprintf.c */, + C9B53BFE138D9E9A0028D27C /* vswscanf.c */, + C9B53C00138D9E9A0028D27C /* vwprintf.c */, + C9B53C02138D9E9A0028D27C /* vwscanf.c */, + C9B53C04138D9E9A0028D27C /* wbuf.c */, + C9B53C06138D9E9A0028D27C /* wprintf.3 */, + C9B53C08138D9E9A0028D27C /* wprintf.c */, + C9B53C0A138D9E9A0028D27C /* wscanf.3 */, + C9B53C0C138D9E9A0028D27C /* wscanf.c */, + C9B53C0E138D9E9A0028D27C /* wsetup.c */, + B12613EE158818EC0077E3CC /* xprintf_errno.c */, + B12613EF158818EC0077E3CC /* xprintf_float.c */, + B12613F0158818EC0077E3CC /* xprintf_hexdump.c */, + B12613F1158818EC0077E3CC /* xprintf_int.c */, + B12613F2158818EC0077E3CC /* xprintf_private.h */, + B12613F3158818EC0077E3CC /* xprintf_quote.c */, + B12613F4158818EC0077E3CC /* xprintf_str.c */, + B12613F5158818EC0077E3CC /* xprintf_time.c */, + B12613F6158818EC0077E3CC /* xprintf_vis.c */, + B12613F7158818EC0077E3CC /* xprintf.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53C16138D9E9A0028D27C /* stdlib */ = { + isa = PBXGroup; + children = ( + C9B53C17138D9E9A0028D27C /* a64l.3 */, + C9B53C18138D9E9A0028D27C /* a64l.c */, + C9B53C19138D9E9A0028D27C /* FreeBSD */, + C9B53CAB138D9E9A0028D27C /* grantpt.3 */, + C9B53CAC138D9E9A0028D27C /* grantpt.c */, + C9B53CAD138D9E9A0028D27C /* l64a.c */, + C9B53CAF138D9E9A0028D27C /* NetBSD */, + C9B53CB4138D9E9A0028D27C /* OpenBSD */, + C9B53CBD138D9E9A0028D27C /* qsort_b.c */, + C9B53CBE138D9E9A0028D27C /* strtod_l.3 */, + C9B53CBF138D9E9A0028D27C /* strtol_l.3 */, + ); + path = stdlib; + sourceTree = ""; + }; + C9B53C19138D9E9A0028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9EB2FC3138F6C5C0075BB52 /* psort.c */, + C9EB2FC5138F6CE10075BB52 /* psort_b.c */, + C9EB2FC6138F6CE10075BB52 /* psort_r.c */, + C9EB2FC0138F6BB00075BB52 /* merge_b.c */, + C9B53C1A138D9E9A0028D27C /* _Exit_.c */, + C9B53C1B138D9E9A0028D27C /* abort.3 */, + C9B53C1D138D9E9A0028D27C /* abort.c */, + C9B53C1F138D9E9A0028D27C /* abs.3 */, + C9B53C21138D9E9A0028D27C /* abs.c */, + C9B53C22138D9E9A0028D27C /* alloca.3 */, + C9B53C24138D9E9A0028D27C /* atexit.3 */, + C9B53C26138D9E9A0028D27C /* atexit.c */, + C9B53C28138D9E9A0028D27C /* atexit.h */, + C9B53C2A138D9E9A0028D27C /* atof.3 */, + C9B53C2C138D9E9A0028D27C /* atof.c */, + C9B53C2E138D9E9A0028D27C /* atoi.3 */, + C9B53C30138D9E9A0028D27C /* atoi.c */, + C9B53C32138D9E9A0028D27C /* atol.3 */, + C9B53C34138D9E9A0028D27C /* atol.c */, + C9B53C36138D9E9A0028D27C /* atoll.c */, + C9B53C38138D9E9A0028D27C /* bsearch.3 */, + C9B53C3A138D9E9A0028D27C /* bsearch.c */, + C9B53C3C138D9E9A0028D27C /* div.3 */, + C9B53C3E138D9E9A0028D27C /* div.c */, + C9B53C3F138D9E9A0028D27C /* exit.3 */, + C9B53C40138D9E9A0028D27C /* exit.c */, + C9B53C42138D9E9A0028D27C /* getenv.3 */, + C9B53C44138D9E9A0028D27C /* getenv.c */, + C9B53C46138D9E9A0028D27C /* getopt.3 */, + C9B53C47138D9E9A0028D27C /* getopt.c */, + C9B53C49138D9E9A0028D27C /* getopt_long.3 */, + C9B53C4A138D9E9A0028D27C /* getopt_long.c */, + C9B53C4B138D9E9A0028D27C /* getsubopt.3 */, + C9B53C4D138D9E9A0028D27C /* getsubopt.c */, + C9B53C4E138D9E9A0028D27C /* hcreate.3 */, + C9B53C4F138D9E9A0028D27C /* hcreate.c */, + C9B53C50138D9E9A0028D27C /* heapsort.c */, + C9D94357138EC0C600FB7ACC /* heapsort_b.c */, + C9D94358138EC0C600FB7ACC /* heapsort_r.c */, + C9B53C53138D9E9A0028D27C /* imaxabs.3 */, + C9B53C54138D9E9A0028D27C /* imaxabs.c */, + C9B53C55138D9E9A0028D27C /* imaxdiv.3 */, + C9B53C57138D9E9A0028D27C /* imaxdiv.c */, + C9B53C58138D9E9A0028D27C /* insque.3 */, + C9B53C5A138D9E9A0028D27C /* insque.c */, + C9B53C5B138D9E9A0028D27C /* labs.3 */, + C9B53C5D138D9E9A0028D27C /* labs.c */, + C9B53C5E138D9E9A0028D27C /* ldiv.3 */, + C9B53C60138D9E9A0028D27C /* ldiv.c */, + C9B53C61138D9E9A0028D27C /* llabs.3 */, + C9B53C63138D9E9A0028D27C /* llabs.c */, + C9B53C64138D9E9A0028D27C /* lldiv.3 */, + C9B53C66138D9E9A0028D27C /* lldiv.c */, + C9B53C67138D9E9A0028D27C /* lsearch.3 */, + C9B53C69138D9E9A0028D27C /* lsearch.c */, + C9B53C6A138D9E9A0028D27C /* memory.3 */, + C9B53C6C138D9E9A0028D27C /* merge.c */, + C9B53C6F138D9E9A0028D27C /* putenv.c */, + C9B53C71138D9E9A0028D27C /* qsort.3 */, + C9B53C73138D9E9A0028D27C /* qsort.c */, + C9B53C75138D9E9A0028D27C /* qsort_r.c */, + C9B53C77138D9E9A0028D27C /* radixsort.3 */, + C9B53C78138D9E9A0028D27C /* radixsort.c */, + C9B53C7A138D9E9A0028D27C /* rand.3 */, + C9B53C7C138D9E9A0028D27C /* rand.c */, + C9B53C7D138D9E9A0028D27C /* random.3 */, + C9B53C7F138D9E9A0028D27C /* random.c */, + C9B53C81138D9E9A0028D27C /* reallocf.c */, + C9B53C82138D9E9A0028D27C /* realpath.3 */, + C9B53C84138D9E9A0028D27C /* realpath.c */, + C9B53C86138D9E9A0028D27C /* remque.c */, + C9B53C87138D9E9A0028D27C /* setenv.c */, + C9B53C89138D9E9A0028D27C /* strhash.c */, + C9B53C8B138D9E9A0028D27C /* strtod.3 */, + C9B53C8D138D9E9A0028D27C /* strtoimax.c */, + C9B53C8F138D9E9A0028D27C /* strtol.3 */, + C9B53C91138D9E9A0028D27C /* strtol.c */, + C9B53C93138D9E9A0028D27C /* strtoll.c */, + C9B53C95138D9E9A0028D27C /* strtoq.c */, + C9B53C97138D9E9A0028D27C /* strtoul.3 */, + C9B53C99138D9E9A0028D27C /* strtoul.c */, + C9B53C9B138D9E9A0028D27C /* strtoull.c */, + C9B53C9D138D9E9A0028D27C /* strtoumax.c */, + C9B53C9F138D9E9A0028D27C /* strtouq.c */, + C9B53CA1138D9E9A0028D27C /* system.3 */, + C9B53CA3138D9E9A0028D27C /* system.c */, + C9B53CA5138D9E9A0028D27C /* tdelete.c */, + C9B53CA6138D9E9A0028D27C /* tfind.c */, + C9B53CA7138D9E9A0028D27C /* tsearch.3 */, + C9B53CA9138D9E9A0028D27C /* tsearch.c */, + C9B53CAA138D9E9A0028D27C /* twalk.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53CAF138D9E9A0028D27C /* NetBSD */ = { + isa = PBXGroup; + children = ( + C9B53CB0138D9E9A0028D27C /* strfmon.3 */, + C9B53CB2138D9E9A0028D27C /* strfmon.c */, + ); + path = NetBSD; + sourceTree = ""; + }; + C9B53CB4138D9E9A0028D27C /* OpenBSD */ = { + isa = PBXGroup; + children = ( + C9B53CB5138D9E9A0028D27C /* ecvt.3 */, + C9B53CB7138D9E9A0028D27C /* ecvt.c */, + C9B53CB9138D9E9A0028D27C /* gcvt.c */, + ); + path = OpenBSD; + sourceTree = ""; + }; + C9B53CC0138D9E9A0028D27C /* stdtime */ = { + isa = PBXGroup; + children = ( + C9B53CC1138D9E9A0028D27C /* FreeBSD */, + C9B53CDF138D9E9A0028D27C /* getdate.3 */, + C9B53CE0138D9E9A0028D27C /* getdate.c */, + C9B53CE2138D9E9A0028D27C /* timegm.3 */, + C9B53CE3138D9E9A0028D27C /* timezone_unix03.c */, + ); + path = stdtime; + sourceTree = ""; + }; + C9B53CC1138D9E9A0028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53CC2138D9E9A0028D27C /* asctime.c */, + C9B53CC4138D9E9A0028D27C /* ctime.3 */, + C9B53CC6138D9E9A0028D27C /* difftime.c */, + C9B53CC7138D9E9A0028D27C /* ftime.3 */, + C9B53CC9138D9E9A0028D27C /* ftime.c */, + C9B53CCA138D9E9A0028D27C /* localtime.c */, + C9B53CCC138D9E9A0028D27C /* private.h */, + C9B53CCD138D9E9A0028D27C /* strftime.3 */, + C9B53CCF138D9E9A0028D27C /* strftime.c */, + C9B53CD1138D9E9A0028D27C /* strptime.3 */, + C9B53CD3138D9E9A0028D27C /* strptime.c */, + C9B53CD5138D9E9A0028D27C /* time2posix.3 */, + C9B53CD6138D9E9A0028D27C /* time32.c */, + C9B53CD7138D9E9A0028D27C /* timelocal.c */, + C9B53CD9138D9E9A0028D27C /* timelocal.h */, + C9B53CDB138D9E9A0028D27C /* tzfile.5 */, + C9B53CDD138D9E9A0028D27C /* tzfile.h */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53CE4138D9E9A0028D27C /* string */ = { + isa = PBXGroup; + children = ( + 3F18DE1E162A732C008B15AC /* NetBSD */, + C9B53CE5138D9E9A0028D27C /* FreeBSD */, + C9B53D91138D9E9A0028D27C /* memset_pattern.3 */, + 3FD14572171D42B300B7BAF5 /* bcopy.c */, + 63D4060513DDEDF10094DD56 /* stpcpy.c */, + 63D4060913DDEEA10094DD56 /* stpncpy.c */, + 63D4060C13DDF26A0094DD56 /* strcat.c */, + 63D4060F13DDF4340094DD56 /* strncat.c */, + ); + path = string; + sourceTree = ""; + }; + C9B53CE5138D9E9A0028D27C /* FreeBSD */ = { + isa = PBXGroup; + children = ( + C9B53CE6138D9E9A0028D27C /* bcmp.3 */, + C9B53CE9138D9E9A0028D27C /* bcopy.3 */, + C9B53CED138D9E9A0028D27C /* bstring.3 */, + C9B53CEF138D9E9A0028D27C /* bzero.3 */, + C9B53CF5138D9E9A0028D27C /* index.3 */, + C9B53CF8138D9E9A0028D27C /* memccpy.3 */, + C9B53CFB138D9E9A0028D27C /* memchr.3 */, + C9B53CFE138D9E9A0028D27C /* memcmp.3 */, + C9B53D01138D9E9A0028D27C /* memcpy.3 */, + C9B53D05138D9E9A0028D27C /* memmem.3 */, + C9B53D06138D9E9A0028D27C /* memmem.c */, + C9B53D07138D9E9A0028D27C /* memmove.3 */, + C9B53D0B138D9E9A0028D27C /* memset.3 */, + C9B53D0E138D9E9A0028D27C /* rindex.3 */, + C9B53D10138D9E9A0028D27C /* rindex.c */, + 7711D82622F3A52400E7296B /* rpmatch.3 */, + 7711D82422F37DB600E7296B /* rpmatch.c */, + C9B53D13138D9E9A0028D27C /* strcasecmp.3 */, + C9B53D15138D9E9A0028D27C /* strcasecmp.c */, + C9B53D17138D9E9A0028D27C /* strcasestr.c */, + C9B53D19138D9E9A0028D27C /* strcat.3 */, + C9B53D1C138D9E9A0028D27C /* strchr.3 */, + C9B53D20138D9E9A0028D27C /* strcmp.3 */, + C9B53D24138D9E9A0028D27C /* strcoll.3 */, + C9B53D26138D9E9A0028D27C /* strcoll.c */, + C9B53D28138D9E9A0028D27C /* strcpy.3 */, + C9B53D2D138D9E9A0028D27C /* strcspn.c */, + C9B53D2E138D9E9A0028D27C /* strdup.3 */, + C9B53D30138D9E9A0028D27C /* strdup.c */, + C9B53D31138D9E9A0028D27C /* strerror.3 */, + C9B53D33138D9E9A0028D27C /* strerror.c */, + C9B53D35138D9E9A0028D27C /* string.3 */, + C9B53D38138D9E9A0028D27C /* strlcpy.3 */, + C9B53D3B138D9E9A0028D27C /* strlen.3 */, + C9B53D3E138D9E9A0028D27C /* strmode.3 */, + C9B53D40138D9E9A0028D27C /* strmode.c */, + C9B53D44138D9E9A0028D27C /* strndup.c */, + C9B53D46138D9E9A0028D27C /* strnstr.c */, + C9B53D47138D9E9A0028D27C /* strpbrk.3 */, + C9B53D49138D9E9A0028D27C /* strpbrk.c */, + C9B53D4C138D9E9A0028D27C /* strrchr.c */, + C9B53D4E138D9E9A0028D27C /* strsep.3 */, + C9B53D4F138D9E9A0028D27C /* strsep.c */, + C9B53D50138D9E9A0028D27C /* strsignal.c */, + C9B53D52138D9E9A0028D27C /* strspn.3 */, + C9B53D54138D9E9A0028D27C /* strspn.c */, + C9B53D55138D9E9A0028D27C /* strstr.3 */, + C9B53D58138D9E9A0028D27C /* strtok.3 */, + C9B53D5A138D9E9A0028D27C /* strtok.c */, + C9B53D5B138D9E9A0028D27C /* strxfrm.3 */, + C9B53D5D138D9E9A0028D27C /* strxfrm.c */, + C9B53D5F138D9E9A0028D27C /* swab.3 */, + C9B53D61138D9E9A0028D27C /* swab.c */, + 928BD0FD1D7606EA00EC01FC /* timingsafe_bcmp.3 */, + 928BD0FE1D7606EA00EC01FC /* timingsafe_bcmp.c */, + C9B53D63138D9E9A0028D27C /* wcpcpy.c */, + C9B53D64138D9E9A0028D27C /* wcpncpy.c */, + C9B53D65138D9E9A0028D27C /* wcscasecmp.c */, + C9B53D67138D9E9A0028D27C /* wcscat.c */, + C9B53D68138D9E9A0028D27C /* wcschr.c */, + C9B53D69138D9E9A0028D27C /* wcscmp.c */, + C9B53D6A138D9E9A0028D27C /* wcscoll.3 */, + C9B53D6C138D9E9A0028D27C /* wcscoll.c */, + C9B53D6E138D9E9A0028D27C /* wcscpy.c */, + C9B53D6F138D9E9A0028D27C /* wcscspn.c */, + C9B53D70138D9E9A0028D27C /* wcsdup.c */, + C9B53D71138D9E9A0028D27C /* wcslcat.c */, + C9B53D72138D9E9A0028D27C /* wcslcpy.c */, + C9B53D73138D9E9A0028D27C /* wcslen.c */, + C9B53D74138D9E9A0028D27C /* wcsncasecmp.c */, + C9B53D76138D9E9A0028D27C /* wcsncat.c */, + C9B53D77138D9E9A0028D27C /* wcsncmp.c */, + C9B53D78138D9E9A0028D27C /* wcsncpy.c */, + C9B53D79138D9E9A0028D27C /* wcsnlen.c */, + C9B53D7A138D9E9A0028D27C /* wcspbrk.c */, + C9B53D7B138D9E9A0028D27C /* wcsrchr.c */, + C9B53D7C138D9E9A0028D27C /* wcsspn.c */, + C9B53D7D138D9E9A0028D27C /* wcsstr.c */, + C9B53D7E138D9E9A0028D27C /* wcstok.3 */, + C9B53D80138D9E9A0028D27C /* wcstok.c */, + C9B53D81138D9E9A0028D27C /* wcswidth.3 */, + C9B53D83138D9E9A0028D27C /* wcswidth.c */, + C9B53D85138D9E9A0028D27C /* wcsxfrm.3 */, + C9B53D87138D9E9A0028D27C /* wcsxfrm.c */, + C9B53D89138D9E9A0028D27C /* wmemchr.3 */, + C9B53D8B138D9E9A0028D27C /* wmemchr.c */, + C9B53D8C138D9E9A0028D27C /* wmemcmp.c */, + C9B53D8D138D9E9A0028D27C /* wmemcpy.c */, + C9B53D8E138D9E9A0028D27C /* wmemmove.c */, + C9B53D8F138D9E9A0028D27C /* wmemset.c */, + ); + path = FreeBSD; + sourceTree = ""; + }; + C9B53D93138D9E9A0028D27C /* sys */ = { + isa = PBXGroup; + children = ( + C9B53D94138D9E9A0028D27C /* _libc_init.c */, + C9B53D95138D9E9A0028D27C /* _libc_fork_child.c */, + C9B53D99138D9E9A0028D27C /* chmodx_np.c */, + C9B53D9C138D9E9A0028D27C /* crt_externs.c */, + C9B53D9E138D9E9A0028D27C /* fork.c */, + C9B53D9F138D9E9A0028D27C /* getgroups.c */, + C9B53DA2138D9E9A0028D27C /* gettimeofday.c */, + C9B53DA6138D9E9A0028D27C /* msgctl.c */, + C9B53DA7138D9E9A0028D27C /* nanosleep.2 */, + C9B53DA8138D9E9A0028D27C /* OpenBSD */, + C9B53DAB138D9E9A0028D27C /* openx_np.c */, + C9B53DAC138D9E9A0028D27C /* OSMemoryNotification.c */, + C9B53DAD138D9E9A0028D27C /* OSThermalNotification.c */, + C9B53DAE138D9E9A0028D27C /* posix_spawn.c */, + C9B53DB2138D9E9A0028D27C /* semctl.c */, + C9B53DB3138D9E9A0028D27C /* settimeofday.c */, + C9B53DB4138D9E9A0028D27C /* shmctl.c */, + C9B53DB5138D9E9A0028D27C /* sigaction.c */, + C9B53DB9138D9E9A0028D27C /* sigwait.2 */, + C9B53DBC138D9E9A0028D27C /* statx_np.c */, + C9B53DBE138D9E9A0028D27C /* umaskx_np.c */, + ); + path = sys; + sourceTree = ""; + }; + C9B53DA8138D9E9A0028D27C /* OpenBSD */ = { + isa = PBXGroup; + children = ( + C9B53DA9138D9E9A0028D27C /* stack_protector.c */, + ); + path = OpenBSD; + sourceTree = ""; + }; + C9B53DC6138D9E9A0028D27C /* util */ = { + isa = PBXGroup; + children = ( + C9B53DC7138D9E9A0028D27C /* fparseln.3 */, + C9B53DC8138D9E9A0028D27C /* fparseln.c */, + C9B53DC9138D9E9A0028D27C /* login.3 */, + C9B53DCA138D9E9A0028D27C /* login.c */, + C9B53DCB138D9E9A0028D27C /* login_tty.c */, + C9B53DCC138D9E9A0028D27C /* logout.c */, + C9B53DCD138D9E9A0028D27C /* logwtmp.c */, + 3F89F3DC13E9194C00F6856C /* mkpath_np.3 */, + 3F89F3DD13E9194C00F6856C /* mkpath_np.c */, + C9B53DCF138D9E9A0028D27C /* opendev.3 */, + C9B53DD0138D9E9A0028D27C /* opendev.c */, + C9B53DD1138D9E9A0028D27C /* openpty.3 */, + C9B53DD2138D9E9A0028D27C /* pty.c */, + ); + path = util; + sourceTree = ""; + }; + C9B53DD3138D9E9A0028D27C /* uuid */ = { + isa = PBXGroup; + children = ( + C9B53DD5138D9E9A0028D27C /* namespace.h */, + C9B53DD6138D9E9A0028D27C /* uuid-config.h */, + C9B53DD7138D9E9A0028D27C /* uuidman.sed */, + C9B53DD8138D9E9A0028D27C /* uuidsrc */, + ); + path = uuid; + sourceTree = ""; + }; + C9B53DD8138D9E9A0028D27C /* uuidsrc */ = { + isa = PBXGroup; + children = ( + C9B53DD9138D9E9A0028D27C /* clear.c */, + C9B53DDA138D9E9A0028D27C /* compare.c */, + C9B53DDB138D9E9A0028D27C /* copy.c */, + C9B53DDC138D9E9A0028D27C /* gen_uuid.c */, + C9B53DDE138D9E9A0028D27C /* isnull.c */, + C9B53DDF138D9E9A0028D27C /* libuuid.3.in */, + C9B53DE0138D9E9A0028D27C /* pack.c */, + C9B53DE1138D9E9A0028D27C /* parse.c */, + C9B53DE2138D9E9A0028D27C /* unpack.c */, + C9B53DE3138D9E9A0028D27C /* unparse.c */, + C9B53DE5138D9E9A0028D27C /* uuid_clear.3.in */, + C9B53DE6138D9E9A0028D27C /* uuid_compare.3.in */, + C9B53DE7138D9E9A0028D27C /* uuid_copy.3.in */, + C9B53DE8138D9E9A0028D27C /* uuid_generate.3.in */, + C9B53DE9138D9E9A0028D27C /* uuid_is_null.3.in */, + C9B53DEA138D9E9A0028D27C /* uuid_parse.3.in */, + C9B53DEB138D9E9A0028D27C /* uuid_unparse.3.in */, + C9B53DED138D9E9A0028D27C /* uuidP.h */, + ); + path = uuidsrc; + sourceTree = ""; + }; + C9B53DEF138D9E9A0028D27C /* x86_64 */ = { + isa = PBXGroup; + children = ( + C9B53DF0138D9E9A0028D27C /* gen */, + ); + path = x86_64; + sourceTree = ""; + }; + C9B53DF0138D9E9A0028D27C /* gen */ = { + isa = PBXGroup; + children = ( + C9B53DF9138D9E9A0028D27C /* mcount.s */, + ); + path = gen; + sourceTree = ""; + }; + C9C2A946138DF66900287F00 /* xcodescripts */ = { + isa = PBXGroup; + children = ( + E4A877A6174D82FB000DBB55 /* alias.list */, + C9C2A948138DF7DD00287F00 /* libc.xcconfig */, + C9766153138ECF0000741512 /* variants.xcconfig */, + C9AE91AE1517CDAC00A2626C /* eos.xcconfig */, + C0E345E31C58300F00E749C2 /* libc_static.xcconfig */, + E41BEA97178E72E100E348BB /* Libc.order */, + 3F45E3121A6DC12E00AFF01E /* abort_unsupported.sh */, + C9194B4C140E3BC700BE0C3A /* build_linklists.sh */, + C9766150138EC9D400741512 /* patch_headers_variants.pl */, + C976616B138EF14100741512 /* generate_features.pl */, + C942135913904CBC004BA536 /* manpages.sh */, + C9950E6A1390D2CA009863B6 /* headers.sh */, + C9B53D92138D9E9A0028D27C /* strip-header.ed */, + C965CBF4143BC1BF003912CE /* force_libc_to_build.sh */, + C93D6150143D31E300EB9023 /* sanitise_headers.sh */, + 3FF283231A4764240098AD2C /* sim-compat-symlink.sh */, + C0E343811C58299D00E749C2 /* skip_installhdrs.sh */, + ); + path = xcodescripts; + sourceTree = ""; + }; + E4EDB7252227DF25006A8322 /* driverkit */ = { + isa = PBXGroup; + children = ( + E4EDB7262227DF25006A8322 /* Makefile.inc */, + ); + path = driverkit; + sourceTree = ""; + }; + FC60BAD016555A4A00033196 /* _types */ = { + isa = PBXGroup; + children = ( + FC60BAD116555A4A00033196 /* _intmax_t.h */, + FC60BAD216555A4A00033196 /* _nl_item.h */, + FC60BAD316555A4A00033196 /* _uint16_t.h */, + FC60BAD416555A4A00033196 /* _uint32_t.h */, + FC60BAD516555A4A00033196 /* _uint64_t.h */, + FC60BAD616555A4A00033196 /* _uint8_t.h */, + FC60BAD716555A4A00033196 /* _uintmax_t.h */, + FC60BAD816555A4A00033196 /* _wctrans_t.h */, + FC60BAD916555A4A00033196 /* _wctype_t.h */, + ); + path = _types; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 926F73901E03E2A3001E049D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B450FFB211A56DD0029AF5D /* ctl.h in Headers */, + 4B782979208926A80070E1FF /* api.h in Headers */, + 4B6D181D206DEFBD00C00E37 /* mach_exception.h in Headers */, + 4B20DB4D202B81A4005C2327 /* bsd.h in Headers */, + 4B20DB50202B81A4005C2327 /* err.h in Headers */, + 4B20DB51202B81A4005C2327 /* errno.h in Headers */, + 4B20DB52202B81A4005C2327 /* stdio.h in Headers */, + 4B0899BC2046258F001360A4 /* cleanup.h in Headers */, + 4BCC350F20659AD500A4CBAA /* linker_set.h in Headers */, + 4B20DB53202B81A4005C2327 /* stdlib.h in Headers */, + 4B09323421C9C08F006063D6 /* mach_utils.h in Headers */, + 4B2D551E231706F9003DAFCE /* tapi.h in Headers */, + 4B69E81320800D47008D13D2 /* libdarwin_init.h in Headers */, + 4B20DB54202B81A4005C2327 /* string.h in Headers */, + 4B075C8E208BE9F200FD4F23 /* variant_private.h in Headers */, + 4B4E643F2069E94A00C4D8D5 /* internal.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXLegacyTarget section */ + 928F25D01BEACED7007B13C7 /* darwintests */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "$(ACTION)"; + buildConfigurationList = 928F25D11BEACED7007B13C7 /* Build configuration list for PBXLegacyTarget "darwintests" */; + buildPhases = ( + ); + buildToolPath = /usr/bin/make; + buildWorkingDirectory = tests/; + dependencies = ( + ); + name = darwintests; + passBuildSettingsInEnvironment = 1; + productName = darwintests; + }; +/* End PBXLegacyTarget section */ + +/* Begin PBXNativeTarget section */ + 3F51206A16C3174300AFB431 /* FortifySource */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F5120EE16C3174300AFB431 /* Build configuration list for PBXNativeTarget "FortifySource" */; + buildPhases = ( + 3F51206B16C3174300AFB431 /* Generate libc-features.h */, + 3F51206C16C3174300AFB431 /* Sources */, + 3F5120ED16C3174300AFB431 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FortifySource; + productName = Base; + productReference = 3F5120F116C3174300AFB431 /* libFortifySource.a */; + productType = "com.apple.product-type.library.static"; + }; + 926F73911E03E2A3001E049D /* libsystem_darwin.dylib */ = { + isa = PBXNativeTarget; + buildConfigurationList = 926F73951E03E2A4001E049D /* Build configuration list for PBXNativeTarget "libsystem_darwin.dylib" */; + buildPhases = ( + 926F738E1E03E2A3001E049D /* Sources */, + 926F738F1E03E2A3001E049D /* Frameworks */, + 3F55A4D72062412800C15893 /* Create public header path (safe to remove once we start installing public headers) */, + 926F73901E03E2A3001E049D /* Headers */, + 9280EA241E5A5D6F007A6F58 /* Copy AppleFooVariant.plists */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = libsystem_darwin.dylib; + productName = libsystem_darwin; + productReference = 926F73921E03E2A3001E049D /* libsystem_darwin.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; + B122F0E71432B8E600AF95D0 /* TRE */ = { + isa = PBXNativeTarget; + buildConfigurationList = B122F2AA1432B8E600AF95D0 /* Build configuration list for PBXNativeTarget "TRE" */; + buildPhases = ( + B122F0E81432B8E600AF95D0 /* Generate libc-features.h */, + B122F0E91432B8E600AF95D0 /* Sources */, + B122F2A91432B8E600AF95D0 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TRE; + productName = FreeBSD; + productReference = B122F2AD1432B8E600AF95D0 /* libTRE.a */; + productType = "com.apple.product-type.library.static"; + }; + C0E343831C582ECB00E749C2 /* libc_static */ = { + isa = PBXNativeTarget; + buildConfigurationList = C0E345DF1C582ECB00E749C2 /* Build configuration list for PBXNativeTarget "libc_static" */; + buildPhases = ( + C0E3438E1C582ECB00E749C2 /* Build Link List */, + C0E3438F1C582ECB00E749C2 /* Generate libc-features.h */, + C0E343901C582ECB00E749C2 /* Patch Headers */, + C0E343911C582ECB00E749C2 /* Sources */, + C0E345DA1C582ECB00E749C2 /* Frameworks */, + C0E345E41C5830C200E749C2 /* Symlink libc.a to a loaderd path */, + ); + buildRules = ( + ); + dependencies = ( + C0E343841C582ECB00E749C2 /* PBXTargetDependency */, + C0E343861C582ECB00E749C2 /* PBXTargetDependency */, + C0E343881C582ECB00E749C2 /* PBXTargetDependency */, + C0E3438A1C582ECB00E749C2 /* PBXTargetDependency */, + C0E3438C1C582ECB00E749C2 /* PBXTargetDependency */, + ); + name = libc_static; + productName = "Variant Cancelable"; + productReference = C0E345E21C582ECB00E749C2 /* libc.a */; + productType = "com.apple.product-type.library.static"; + }; + C9257ECF138E1B5000B3107C /* FreeBSD */ = { + isa = PBXNativeTarget; + buildConfigurationList = C9257ED3138E1B5000B3107C /* Build configuration list for PBXNativeTarget "FreeBSD" */; + buildPhases = ( + C9BD3C3D138F189E00B389FD /* Generate libc-features.h */, + C9257ECC138E1B5000B3107C /* Sources */, + C9257ECD138E1B5000B3107C /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FreeBSD; + productName = FreeBSD; + productReference = C9257ED0138E1B5000B3107C /* libFreeBSD.a */; + productType = "com.apple.product-type.library.static"; + }; + C9258093138E2D3100B3107C /* NetBSD */ = { + isa = PBXNativeTarget; + buildConfigurationList = C9258102138E2D3100B3107C /* Build configuration list for PBXNativeTarget "NetBSD" */; + buildPhases = ( + C9BD3C3C138F189200B389FD /* Generate libc-features.h */, + C9258094138E2D3100B3107C /* Sources */, + C9258100138E2D3100B3107C /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = NetBSD; + productName = Base; + productReference = C9258105138E2D3100B3107C /* libNetBSD.a */; + productType = "com.apple.product-type.library.static"; + }; + C942102D13900C8A004BA536 /* libc_dyld */ = { + isa = PBXNativeTarget; + buildConfigurationList = C94212C913900C8A004BA536 /* Build configuration list for PBXNativeTarget "libc_dyld" */; + buildPhases = ( + C942102E13900C8A004BA536 /* Generate libc-features.h */, + C942103013900C8A004BA536 /* Patch Headers */, + C942103113900C8A004BA536 /* Sources */, + C94212C713900C8A004BA536 /* Frameworks */, + C0E343821C5829F500E749C2 /* Symlink libc_dyld.a to libc.a */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = libc_dyld; + productName = "Variant Cancelable"; + productReference = C94212CC13900C8A004BA536 /* libc_dyld.a */; + productType = "com.apple.product-type.library.static"; + }; + C95B7ED9138F3C55004311DA /* Variant_DarwinExtsn */ = { + isa = PBXNativeTarget; + buildConfigurationList = C95B8173138F3C55004311DA /* Build configuration list for PBXNativeTarget "Variant_DarwinExtsn" */; + buildPhases = ( + C95B7EDA138F3C55004311DA /* Generate libc-features.h */, + C95B7EDB138F3C55004311DA /* Patch Headers */, + C95B7EDC138F3C55004311DA /* Sources */, + C95B8171138F3C55004311DA /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Variant_DarwinExtsn; + productName = "Variant Cancelable"; + productReference = C95B8176138F3C55004311DA /* libvDarwinExtsn.a */; + productType = "com.apple.product-type.library.static"; + }; + C95B8184138F52B0004311DA /* Variant_DarwinExtsn_Cancelable */ = { + isa = PBXNativeTarget; + buildConfigurationList = C95B841E138F52B0004311DA /* Build configuration list for PBXNativeTarget "Variant_DarwinExtsn_Cancelable" */; + buildPhases = ( + C95B8185138F52B0004311DA /* Generate libc-features.h */, + C95B8186138F52B0004311DA /* Patch Headers */, + C95B8187138F52B0004311DA /* Sources */, + C95B841C138F52B0004311DA /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Variant_DarwinExtsn_Cancelable; + productName = "Variant Cancelable"; + productReference = C95B8421138F52B0004311DA /* libvDarwinExtsnCancelable.a */; + productType = "com.apple.product-type.library.static"; + }; + C95B842A138F53DB004311DA /* Variant_Pre1050 */ = { + isa = PBXNativeTarget; + buildConfigurationList = C95B86C4138F53DB004311DA /* Build configuration list for PBXNativeTarget "Variant_Pre1050" */; + buildPhases = ( + C95B842B138F53DB004311DA /* Generate libc-features.h */, + C95B842C138F53DB004311DA /* Patch Headers */, + C95B842D138F53DB004311DA /* Sources */, + C95B86C2138F53DB004311DA /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Variant_Pre1050; + productName = "Variant Cancelable"; + productReference = C95B86C7138F53DB004311DA /* libvPre1050.a */; + productType = "com.apple.product-type.library.static"; + }; + C97A6F1E1517AF53005E1998 /* libc_eOS.a */ = { + isa = PBXNativeTarget; + buildConfigurationList = C97A72191517AF53005E1998 /* Build configuration list for PBXNativeTarget "libc_eOS.a" */; + buildPhases = ( + C9AE91C21517E17600A2626C /* Build Link List */, + C97A6F1F1517AF53005E1998 /* Generate libc-features.h */, + C97A6F221517AF53005E1998 /* Patch Headers */, + C97A6F231517AF53005E1998 /* Sources */, + C97A72181517AF53005E1998 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + C9AE91BB1517D33100A2626C /* PBXTargetDependency */, + C9AE91BD1517D33100A2626C /* PBXTargetDependency */, + C9AE91BF1517D33100A2626C /* PBXTargetDependency */, + C9AE91C11517D33100A2626C /* PBXTargetDependency */, + C925D2011518FA5D003D315B /* PBXTargetDependency */, + ); + name = libc_eOS.a; + productName = "Variant Cancelable"; + productReference = C97A721C1517AF53005E1998 /* libc_eOS.a */; + productType = "com.apple.product-type.library.static"; + }; + C9B53E2B138DA0610028D27C /* Platform */ = { + isa = PBXNativeTarget; + buildConfigurationList = C9B53E2D138DA0610028D27C /* Build configuration list for PBXNativeTarget "Platform" */; + buildPhases = ( + C9BD3C3F138F18D200B389FD /* Generate libc-features.h */, + C9B53E28138DA0610028D27C /* Sources */, + C9B53E29138DA0610028D27C /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Platform; + productName = Platform; + productReference = C9B53E2C138DA0610028D27C /* libPlatform.a */; + productType = "com.apple.product-type.library.static"; + }; + C9C2A94C138DFFD900287F00 /* Base */ = { + isa = PBXNativeTarget; + buildConfigurationList = C9C2A94E138DFFDA00287F00 /* Build configuration list for PBXNativeTarget "Base" */; + buildPhases = ( + C9BD3C3E138F18B200B389FD /* Generate libc-features.h */, + C9C2A949138DFFD900287F00 /* Sources */, + C9C2A94A138DFFD900287F00 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Base; + productName = Base; + productReference = C9C2A94D138DFFD900287F00 /* libBase.a */; + productType = "com.apple.product-type.library.static"; + }; + C9D9432E138DB73300FB7ACC /* libsystem_c.dylib */ = { + isa = PBXNativeTarget; + buildConfigurationList = C9D94330138DB73300FB7ACC /* Build configuration list for PBXNativeTarget "libsystem_c.dylib" */; + buildPhases = ( + 3F45E3181A6DC13C00AFF01E /* Enforce SUPPORTED_PLATFORMS */, + C9950E6B1390D2DC009863B6 /* Install Headers */, + C9194B4B140E3A7100BE0C3A /* Build Link Lists */, + C9D9432B138DB73300FB7ACC /* Sources */, + C9D9432C138DB73300FB7ACC /* Frameworks */, + C942135B13905EB9004BA536 /* Install Manpages */, + C965CBF3143BBFF7003912CE /* Remove deps.c */, + C93D6152143D321000EB9023 /* Sanitise Headers (rdar://problem/10241868) */, + 3FF283291A4764370098AD2C /* Simulator Build Compat Symlink */, + ); + buildRules = ( + ); + dependencies = ( + C9FA32C8138E41800089A94B /* PBXTargetDependency */, + C9FA32CA138E41800089A94B /* PBXTargetDependency */, + C9FA32CC138E41800089A94B /* PBXTargetDependency */, + B122F2D91432BA8700AF95D0 /* PBXTargetDependency */, + C9D94335138DB75F00FB7ACC /* PBXTargetDependency */, + C9BD3C39138F16EE00B389FD /* PBXTargetDependency */, + C95B817D138F3F72004311DA /* PBXTargetDependency */, + C95B8428138F5388004311DA /* PBXTargetDependency */, + C95B86CC138F546E004311DA /* PBXTargetDependency */, + C9EB326D138F74D20075BB52 /* PBXTargetDependency */, + C9EB3515138F771F0075BB52 /* PBXTargetDependency */, + 3F51211716C318EB00AFB431 /* PBXTargetDependency */, + ); + name = libsystem_c.dylib; + productName = Libc; + productReference = C9D9432F138DB73300FB7ACC /* libsystem_c.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; + C9D9435F138EC3E300FB7ACC /* Variant_Cancelable */ = { + isa = PBXNativeTarget; + buildConfigurationList = C9D94361138EC3E300FB7ACC /* Build configuration list for PBXNativeTarget "Variant_Cancelable" */; + buildPhases = ( + C976616D138EF15900741512 /* Generate libc-features.h */, + C9766152138ECA3800741512 /* Patch Headers */, + C9D9435C138EC3E300FB7ACC /* Sources */, + C9D9435D138EC3E300FB7ACC /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Variant_Cancelable; + productName = "Variant Cancelable"; + productReference = C9D94360138EC3E300FB7ACC /* libvCancelable.a */; + productType = "com.apple.product-type.library.static"; + }; + C9EB2FC9138F6D880075BB52 /* Variant_Legacy */ = { + isa = PBXNativeTarget; + buildConfigurationList = C9EB3263138F6D880075BB52 /* Build configuration list for PBXNativeTarget "Variant_Legacy" */; + buildPhases = ( + C9EB2FCA138F6D880075BB52 /* Generate libc-features.h */, + C9EB2FCB138F6D880075BB52 /* Patch Headers */, + C9EB2FCC138F6D880075BB52 /* Sources */, + C9EB3261138F6D880075BB52 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Variant_Legacy; + productName = "Variant Cancelable"; + productReference = C9EB3266138F6D880075BB52 /* libvLegacy.a */; + productType = "com.apple.product-type.library.static"; + }; + C9EB326F138F75580075BB52 /* Variant_Inode32 */ = { + isa = PBXNativeTarget; + buildConfigurationList = C9EB350A138F75580075BB52 /* Build configuration list for PBXNativeTarget "Variant_Inode32" */; + buildPhases = ( + C9EB3270138F75580075BB52 /* Generate libc-features.h */, + C9EB3272138F75580075BB52 /* Patch Headers */, + C9EB3273138F75580075BB52 /* Sources */, + C9EB3508138F75580075BB52 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Variant_Inode32; + productName = "Variant Cancelable"; + productReference = C9EB350D138F75580075BB52 /* libvInode32.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C9B53597138D9A690028D27C /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1140; + TargetAttributes = { + 925E7FE619E8945900AC7889 = { + CreatedOnToolsVersion = 6.1; + }; + 926F73911E03E2A3001E049D = { + CreatedOnToolsVersion = 8.2; + ProvisioningStyle = Automatic; + }; + 926F739D1E046E55001E049D = { + CreatedOnToolsVersion = 8.2; + ProvisioningStyle = Automatic; + }; + 928F25D01BEACED7007B13C7 = { + CreatedOnToolsVersion = 7.1; + }; + E47E980E22150EAD006E312E = { + CreatedOnToolsVersion = 11.0; + }; + E47E981222150EBB006E312E = { + CreatedOnToolsVersion = 11.0; + }; + }; + }; + buildConfigurationList = C9B5359A138D9A690028D27C /* Build configuration list for PBXProject "Libc" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + English, + en, + ); + mainGroup = C9B53595138D9A690028D27C; + productRefGroup = C9B535A9138D9E890028D27C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + E47E980E22150EAD006E312E /* Libc */, + 926F739D1E046E55001E049D /* Libc_darwin */, + E47E981222150EBB006E312E /* Libc_driverkit */, + 925E7FE619E8945900AC7889 /* Libc_tests */, + C9D9432E138DB73300FB7ACC /* libsystem_c.dylib */, + C942102D13900C8A004BA536 /* libc_dyld */, + C0E343831C582ECB00E749C2 /* libc_static */, + C97A6F1E1517AF53005E1998 /* libc_eOS.a */, + C9B53E2B138DA0610028D27C /* Platform */, + C9C2A94C138DFFD900287F00 /* Base */, + C9257ECF138E1B5000B3107C /* FreeBSD */, + C9258093138E2D3100B3107C /* NetBSD */, + B122F0E71432B8E600AF95D0 /* TRE */, + C9D9435F138EC3E300FB7ACC /* Variant_Cancelable */, + C95B7ED9138F3C55004311DA /* Variant_DarwinExtsn */, + C95B8184138F52B0004311DA /* Variant_DarwinExtsn_Cancelable */, + C95B842A138F53DB004311DA /* Variant_Pre1050 */, + C9EB2FC9138F6D880075BB52 /* Variant_Legacy */, + C9EB326F138F75580075BB52 /* Variant_Inode32 */, + 3F51206A16C3174300AFB431 /* FortifySource */, + 926F73911E03E2A3001E049D /* libsystem_darwin.dylib */, + 928F25D01BEACED7007B13C7 /* darwintests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3F45E3181A6DC13C00AFF01E /* Enforce SUPPORTED_PLATFORMS */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/abort_unsupported.sh", + ); + name = "Enforce SUPPORTED_PLATFORMS"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = "/bin/bash -e -x"; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\""; + showEnvVarsInLog = 0; + }; + 3F51206B16C3174300AFB431 /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + 3F55A4D72062412800C15893 /* Create public header path (safe to remove once we start installing public headers) */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Create public header path (safe to remove once we start installing public headers)"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = "/bin/bash -e -x"; + shellScript = "mkdir -p ${TAPI_PUBLIC_HEADER_PATH}\n"; + showEnvVarsInLog = 0; + }; + 3FF283291A4764370098AD2C /* Simulator Build Compat Symlink */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/sim-compat-symlink.sh", + ); + name = "Simulator Build Compat Symlink"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/bash; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\""; + showEnvVarsInLog = 0; + }; + 9280EA241E5A5D6F007A6F58 /* Copy AppleFooVariant.plists */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + ); + name = "Copy AppleFooVariant.plists"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "set -ex\nINSTALL_PATH=${DSTROOT}/System/Library/CoreServices\n\nif [ \"${PLATFORM_NAME}\" = \"macosx\" ]; then\ninstall -d ${INSTALL_PATH}\ninstall -m 0444 ${SRCROOT}/libdarwin/AppleInternalVariant.plist ${INSTALL_PATH}\ninstall -m 0444 ${SRCROOT}/libdarwin/AppleFactoryVariant.plist ${INSTALL_PATH}\nfi\n"; + showEnvVarsInLog = 0; + }; + B122F0E81432B8E600AF95D0 /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C0E343821C5829F500E749C2 /* Symlink libc_dyld.a to libc.a */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/skip_installhdrs.sh", + ); + name = "Symlink libc_dyld.a to libc.a"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\" /bin/ln -sf libc_dyld.a ${DSTROOT}${INSTALL_PATH}/libc.a"; + showEnvVarsInLog = 0; + }; + C0E3438E1C582ECB00E749C2 /* Build Link List */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/build_linklists.sh", + ); + name = "Build Link List"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\""; + showEnvVarsInLog = 0; + }; + C0E3438F1C582ECB00E749C2 /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C0E343901C582ECB00E749C2 /* Patch Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Patch Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "perl \"${SRCROOT}/xcodescripts/patch_headers_variants.pl\" \\\n \"${SDK_SYSTEM_FRAMEWORK_HEADERS}\" \\\n \"${DERIVED_FILES_DIR}/System.framework/Versions/B\"\n"; + showEnvVarsInLog = 0; + }; + C0E345E41C5830C200E749C2 /* Symlink libc.a to a loaderd path */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/skip_installhdrs.sh", + ); + name = "Symlink libc.a to a loaderd path"; + outputPaths = ( + "${DSTROOT}/usr/local/lib/loaderd/libc.a", + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\" /bin/ln -sf ../../../../${INSTALL_PATH}/libc.a ${DSTROOT}/usr/local/lib/loaderd/libc.a"; + showEnvVarsInLog = 0; + }; + C9194B4B140E3A7100BE0C3A /* Build Link Lists */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/build_linklists.sh", + ); + name = "Build Link Lists"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\""; + showEnvVarsInLog = 0; + }; + C93D6152143D321000EB9023 /* Sanitise Headers (rdar://problem/10241868) */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/sanitise_headers.sh", + ); + name = "Sanitise Headers (rdar://problem/10241868)"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/bash; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\""; + showEnvVarsInLog = 0; + }; + C942102E13900C8A004BA536 /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C942103013900C8A004BA536 /* Patch Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Patch Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "perl \"${SRCROOT}/xcodescripts/patch_headers_variants.pl\" \\\n \"${SDK_SYSTEM_FRAMEWORK_HEADERS}\" \\\n \"${DERIVED_FILES_DIR}/System.framework/Versions/B\"\n"; + showEnvVarsInLog = 0; + }; + C942135B13905EB9004BA536 /* Install Manpages */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/skip_installhdrs.sh", + "$(SRCROOT)/xcodescripts/manpages.sh", + ); + name = "Install Manpages"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = "/bin/bash -e"; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\" \"${SCRIPT_INPUT_FILE_1}\""; + showEnvVarsInLog = 0; + }; + C95B7EDA138F3C55004311DA /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C95B7EDB138F3C55004311DA /* Patch Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Patch Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "perl \"${SRCROOT}/xcodescripts/patch_headers_variants.pl\" \\\n \"${SDK_SYSTEM_FRAMEWORK_HEADERS}\" \\\n \"${DERIVED_FILES_DIR}/System.framework/Versions/B\"\n"; + showEnvVarsInLog = 0; + }; + C95B8185138F52B0004311DA /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C95B8186138F52B0004311DA /* Patch Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Patch Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "perl \"${SRCROOT}/xcodescripts/patch_headers_variants.pl\" \\\n \"${SDK_SYSTEM_FRAMEWORK_HEADERS}\" \\\n \"${DERIVED_FILES_DIR}/System.framework/Versions/B\"\n"; + showEnvVarsInLog = 0; + }; + C95B842B138F53DB004311DA /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C95B842C138F53DB004311DA /* Patch Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Patch Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "perl \"${SRCROOT}/xcodescripts/patch_headers_variants.pl\" \\\n \"${SDK_SYSTEM_FRAMEWORK_HEADERS}\" \\\n \"${DERIVED_FILES_DIR}/System.framework/Versions/B\"\n"; + showEnvVarsInLog = 0; + }; + C965CBF3143BBFF7003912CE /* Remove deps.c */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/force_libc_to_build.sh", + ); + name = "Remove deps.c"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + C9766152138ECA3800741512 /* Patch Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Patch Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "perl \"${SRCROOT}/xcodescripts/patch_headers_variants.pl\" \\\n \"${SDK_SYSTEM_FRAMEWORK_HEADERS}\" \\\n \"${DERIVED_FILES_DIR}/System.framework/Versions/B\"\n"; + showEnvVarsInLog = 0; + }; + C976616D138EF15900741512 /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C97A6F1F1517AF53005E1998 /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C97A6F221517AF53005E1998 /* Patch Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Patch Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "perl \"${SRCROOT}/xcodescripts/patch_headers_variants.pl\" \\\n \"${SDK_SYSTEM_FRAMEWORK_HEADERS}\" \\\n \"${DERIVED_FILES_DIR}/System.framework/Versions/B\"\n"; + showEnvVarsInLog = 0; + }; + C9950E6B1390D2DC009863B6 /* Install Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/headers.sh", + ); + name = "Install Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = "/bin/bash -e"; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\""; + showEnvVarsInLog = 0; + }; + C9AE91C21517E17600A2626C /* Build Link List */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/xcodescripts/build_linklists.sh", + ); + name = "Build Link List"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = ". \"${SCRIPT_INPUT_FILE_0}\""; + showEnvVarsInLog = 0; + }; + C9BD3C3C138F189200B389FD /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C9BD3C3D138F189E00B389FD /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C9BD3C3E138F18B200B389FD /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C9BD3C3F138F18D200B389FD /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C9EB2FCA138F6D880075BB52 /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C9EB2FCB138F6D880075BB52 /* Patch Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Patch Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "perl \"${SRCROOT}/xcodescripts/patch_headers_variants.pl\" \\\n \"${SDK_SYSTEM_FRAMEWORK_HEADERS}\" \\\n \"${DERIVED_FILES_DIR}/System.framework/Versions/B\"\n"; + showEnvVarsInLog = 0; + }; + C9EB3270138F75580075BB52 /* Generate libc-features.h */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate libc-features.h"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "perl \"$SRCROOT/xcodescripts/generate_features.pl\""; + showEnvVarsInLog = 0; + }; + C9EB3272138F75580075BB52 /* Patch Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Patch Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "perl \"${SRCROOT}/xcodescripts/patch_headers_variants.pl\" \\\n \"${SDK_SYSTEM_FRAMEWORK_HEADERS}\" \\\n \"${DERIVED_FILES_DIR}/System.framework/Versions/B\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3F51206C16C3174300AFB431 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F51210F16C317FD00AFB431 /* strlcat_chk.c in Sources */, + 3F51210416C317FD00AFB431 /* chk_fail.c in Sources */, + 3F51210816C317FD00AFB431 /* memset_chk.c in Sources */, + 3F51211016C317FD00AFB431 /* strlcpy_chk.c in Sources */, + 3F51211116C317FD00AFB431 /* strncat_chk.c in Sources */, + 3F51211216C317FD00AFB431 /* strncpy_chk.c in Sources */, + 3F51210716C317FD00AFB431 /* memmove_chk.c in Sources */, + 3F51210E16C317FD00AFB431 /* strcpy_chk.c in Sources */, + 3F51210516C317FD00AFB431 /* memccpy_chk.c in Sources */, + 3F51210916C317FD00AFB431 /* snprintf_chk.c in Sources */, + 3F51210D16C317FD00AFB431 /* strcat_chk.c in Sources */, + 3F51211416C317FD00AFB431 /* vsprintf_chk.c in Sources */, + 3F51210B16C317FD00AFB431 /* stpcpy_chk.c in Sources */, + 3F51210A16C317FD00AFB431 /* sprintf_chk.c in Sources */, + 3F51210616C317FD00AFB431 /* memcpy_chk.c in Sources */, + 3F51210C16C317FD00AFB431 /* stpncpy_chk.c in Sources */, + 3F51211316C317FD00AFB431 /* vsnprintf_chk.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 926F738E1E03E2A3001E049D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B6CFC042065B9FF0022DBAD /* mach.c in Sources */, + 926F73981E03E8C4001E049D /* variant.c in Sources */, + 4BA6E566202AC94800F38D3A /* stdlib.c in Sources */, + 92D763E01EA6DA3A001467FC /* dirstat.c in Sources */, + 4B450FFD211A56EC0029AF5D /* ctl.c in Sources */, + 4BA6E569202ACDAA00F38D3A /* stdio.c in Sources */, + 4B6D181F206DF1E200C00E37 /* exception.c in Sources */, + 92767C841E0A7E2700AB9C76 /* init.c in Sources */, + 4BA6E562202AC06300F38D3A /* err.c in Sources */, + 4BA6E56C202AD02900F38D3A /* bsd.c in Sources */, + 928841361EA75555001064D1 /* dirstat_collection.c in Sources */, + 4BA6E55F202AB35900F38D3A /* string.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B122F0E91432B8E600AF95D0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B122F2C71432B95B00AF95D0 /* regcomp.c in Sources */, + B122F2C91432B95B00AF95D0 /* regexec.c in Sources */, + B122F2CB1432B95B00AF95D0 /* tre-ast.c in Sources */, + B122F2CD1432B95B00AF95D0 /* tre-compile.c in Sources */, + B122F2CF1432B95B00AF95D0 /* tre-match-backtrack.c in Sources */, + B122F2D11432B95B00AF95D0 /* tre-match-parallel.c in Sources */, + B122F2D31432B95B00AF95D0 /* tre-mem.c in Sources */, + B122F2D51432B95B00AF95D0 /* tre-parse.c in Sources */, + B122F2D71432B95B00AF95D0 /* tre-stack.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C0E343911C582ECB00E749C2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C0E343921C582ECB00E749C2 /* mcount.s in Sources */, + 928BD1011D76072200EC01FC /* timingsafe_bcmp.c in Sources */, + C0E3439B1C582ECB00E749C2 /* mcount.s in Sources */, + C0E343A11C582ECB00E749C2 /* creat.c in Sources */, + C0E343A21C582ECB00E749C2 /* gethostid.c in Sources */, + C0E343A31C582ECB00E749C2 /* getwd.c in Sources */, + C0E343A41C582ECB00E749C2 /* killpg.c in Sources */, + C0E343A51C582ECB00E749C2 /* sethostid.c in Sources */, + C0E343A61C582ECB00E749C2 /* setpgrp.c in Sources */, + C0E343A71C582ECB00E749C2 /* setrgid.c in Sources */, + C0E343A81C582ECB00E749C2 /* setruid.c in Sources */, + C0E343A91C582ECB00E749C2 /* setregid.c in Sources */, + C0E343AA1C582ECB00E749C2 /* setreuid.c in Sources */, + C0E343AB1C582ECB00E749C2 /* sigaltstk.c in Sources */, + C0E343AC1C582ECB00E749C2 /* sigcompat.c in Sources */, + C0E343AD1C582ECB00E749C2 /* kvm.c in Sources */, + C0E343AE1C582ECB00E749C2 /* forceLibcToBuild.c in Sources */, + C0E343AF1C582ECB00E749C2 /* bt_close.c in Sources */, + C0E343B01C582ECB00E749C2 /* bt_conv.c in Sources */, + C0E343B11C582ECB00E749C2 /* bt_debug.c in Sources */, + C0E343B21C582ECB00E749C2 /* bt_delete.c in Sources */, + C0E343B31C582ECB00E749C2 /* bt_get.c in Sources */, + C0E343B41C582ECB00E749C2 /* bt_open.c in Sources */, + C0E343B51C582ECB00E749C2 /* bt_overflow.c in Sources */, + C0E343B61C582ECB00E749C2 /* bt_page.c in Sources */, + C0E343B71C582ECB00E749C2 /* bt_put.c in Sources */, + C0E343B81C582ECB00E749C2 /* bt_search.c in Sources */, + C0E343B91C582ECB00E749C2 /* bt_seq.c in Sources */, + C0E343BA1C582ECB00E749C2 /* bt_split.c in Sources */, + C0E343BB1C582ECB00E749C2 /* bt_utils.c in Sources */, + C0E343BC1C582ECB00E749C2 /* db.c in Sources */, + C0E343BD1C582ECB00E749C2 /* hash.c in Sources */, + C0E343BE1C582ECB00E749C2 /* hash_bigkey.c in Sources */, + C0E343BF1C582ECB00E749C2 /* hash_buf.c in Sources */, + C0E343C01C582ECB00E749C2 /* hash_func.c in Sources */, + C0E343C11C582ECB00E749C2 /* hash_log2.c in Sources */, + C0E343C21C582ECB00E749C2 /* hash_page.c in Sources */, + C0E343C31C582ECB00E749C2 /* ndbm.c in Sources */, + C0E343C41C582ECB00E749C2 /* mpool.c in Sources */, + C0E343C51C582ECB00E749C2 /* rec_close.c in Sources */, + C0E343C61C582ECB00E749C2 /* rec_delete.c in Sources */, + C0E343C71C582ECB00E749C2 /* rec_get.c in Sources */, + C0E343C81C582ECB00E749C2 /* rec_open.c in Sources */, + C0E343C91C582ECB00E749C2 /* rec_put.c in Sources */, + C0E343CA1C582ECB00E749C2 /* rec_search.c in Sources */, + C0E343CB1C582ECB00E749C2 /* rec_seq.c in Sources */, + C0E343CC1C582ECB00E749C2 /* rec_utils.c in Sources */, + C0E343CD1C582ECB00E749C2 /* brk.c in Sources */, + C0E343CE1C582ECB00E749C2 /* bsd_signal.c in Sources */, + C0E343CF1C582ECB00E749C2 /* lchflags.c in Sources */, + C0E343D01C582ECB00E749C2 /* lchmod.c in Sources */, + C0E343D11C582ECB00E749C2 /* lutimes.c in Sources */, + C0E343D21C582ECB00E749C2 /* statvfs.c in Sources */, + C0E343D31C582ECB00E749C2 /* tcgetsid.c in Sources */, + C0E343D41C582ECB00E749C2 /* _ldbl_util.c in Sources */, + C0E343D51C582ECB00E749C2 /* _hdtoa.c in Sources */, + C0E343D61C582ECB00E749C2 /* _ldtoa.c in Sources */, + C0E343D71C582ECB00E749C2 /* gdtoa-dmisc.c in Sources */, + C0E343D81C582ECB00E749C2 /* gdtoa-dtoa.c in Sources */, + C0E343D91C582ECB00E749C2 /* gdtoa-gdtoa.c in Sources */, + C0E343DA1C582ECB00E749C2 /* gdtoa-gethex.c in Sources */, + C0E343DB1C582ECB00E749C2 /* gdtoa-gmisc.c in Sources */, + C0E343DC1C582ECB00E749C2 /* gdtoa-hd_init.c in Sources */, + C0E343DD1C582ECB00E749C2 /* gdtoa-hexnan.c in Sources */, + C0E343DE1C582ECB00E749C2 /* gdtoa-misc.c in Sources */, + C0E343DF1C582ECB00E749C2 /* gdtoa-smisc.c in Sources */, + C0E343E01C582ECB00E749C2 /* gdtoa-strtod.c in Sources */, + C0E343E11C582ECB00E749C2 /* gdtoa-strtodg.c in Sources */, + C0E343E21C582ECB00E749C2 /* gdtoa-strtof.c in Sources */, + C0E343E31C582ECB00E749C2 /* gdtoa-strtoIg.c in Sources */, + C0E343E41C582ECB00E749C2 /* gdtoa-strtopdd.c in Sources */, + C0E343E51C582ECB00E749C2 /* gdtoa-strtopx.c in Sources */, + C0E343E61C582ECB00E749C2 /* gdtoa-strtord.c in Sources */, + C0E343E71C582ECB00E749C2 /* gdtoa-sum.c in Sources */, + C0E343E81C582ECB00E749C2 /* gdtoa-ulp.c in Sources */, + C0E343E91C582ECB00E749C2 /* glue.c in Sources */, + C0E343EA1C582ECB00E749C2 /* machdep_ldisd.c in Sources */, + C0E343EB1C582ECB00E749C2 /* machdep_ldisdd.c in Sources */, + C0E343EC1C582ECB00E749C2 /* machdep_ldisQ.c in Sources */, + C0E343ED1C582ECB00E749C2 /* machdep_ldisx.c in Sources */, + C0E343EE1C582ECB00E749C2 /* authentication.c in Sources */, + C0E343EF1C582ECB00E749C2 /* backtrace.c in Sources */, + C0E343F01C582ECB00E749C2 /* confstr.c in Sources */, + C0E343F11C582ECB00E749C2 /* crypt.c in Sources */, + C0E343F21C582ECB00E749C2 /* devname.c in Sources */, + C0E343F31C582ECB00E749C2 /* disklabel.c in Sources */, + C0E343F41C582ECB00E749C2 /* errlst.c in Sources */, + C0E343F51C582ECB00E749C2 /* filesec.c in Sources */, + C0E343F61C582ECB00E749C2 /* _rand48.c in Sources */, + C0E343F71C582ECB00E749C2 /* alarm.c in Sources */, + C0E343F81C582ECB00E749C2 /* arc4random.c in Sources */, + C0E343F91C582ECB00E749C2 /* assert.c in Sources */, + C0E343FA1C582ECB00E749C2 /* basename.c in Sources */, + C0E343FB1C582ECB00E749C2 /* clock.c in Sources */, + C0E343FC1C582ECB00E749C2 /* closedir.c in Sources */, + C0E343FD1C582ECB00E749C2 /* ctermid.c in Sources */, + C0E343FE1C582ECB00E749C2 /* daemon.c in Sources */, + C0E343FF1C582ECB00E749C2 /* dirname.c in Sources */, + C0E344001C582ECB00E749C2 /* drand48.c in Sources */, + C0E344011C582ECB00E749C2 /* erand48.c in Sources */, + C0E344021C582ECB00E749C2 /* err.c in Sources */, + C0E344031C582ECB00E749C2 /* exec.c in Sources */, + C0E344041C582ECB00E749C2 /* fmtcheck.c in Sources */, + C0E344051C582ECB00E749C2 /* fmtmsg.c in Sources */, + C0E344061C582ECB00E749C2 /* fnmatch.c in Sources */, + C0E344071C582ECB00E749C2 /* ftok.c in Sources */, + C0E344081C582ECB00E749C2 /* getbsize.c in Sources */, + C0E344091C582ECB00E749C2 /* getcap.c in Sources */, + C0E3440A1C582ECB00E749C2 /* getcwd.c in Sources */, + C0E3440B1C582ECB00E749C2 /* gethostname.c in Sources */, + C0E3440C1C582ECB00E749C2 /* getlogin.c in Sources */, + C0E3440D1C582ECB00E749C2 /* getmntinfo.c in Sources */, + C0E3440E1C582ECB00E749C2 /* getpagesize.c in Sources */, + C0E3440F1C582ECB00E749C2 /* getpeereid.c in Sources */, + C0E344101C582ECB00E749C2 /* getprogname.c in Sources */, + C0E344111C582ECB00E749C2 /* glob.c in Sources */, + C0E344121C582ECB00E749C2 /* isatty.c in Sources */, + C0E344131C582ECB00E749C2 /* jrand48.c in Sources */, + C0E344141C582ECB00E749C2 /* lcong48.c in Sources */, + C0E344151C582ECB00E749C2 /* lockf.c in Sources */, + C0E344161C582ECB00E749C2 /* lrand48.c in Sources */, + C0E344171C582ECB00E749C2 /* mrand48.c in Sources */, + C0E344181C582ECB00E749C2 /* nice.c in Sources */, + C0E344191C582ECB00E749C2 /* nrand48.c in Sources */, + C0E3441A1C582ECB00E749C2 /* opendir.c in Sources */, + C0E3441B1C582ECB00E749C2 /* pause.c in Sources */, + C0E3441C1C582ECB00E749C2 /* popen.c in Sources */, + C0E3441D1C582ECB00E749C2 /* psignal.c in Sources */, + C0E3441E1C582ECB00E749C2 /* raise.c in Sources */, + C0E3441F1C582ECB00E749C2 /* readdir.c in Sources */, + C0E344201C582ECB00E749C2 /* readpassphrase.c in Sources */, + C0E344211C582ECB00E749C2 /* rewinddir.c in Sources */, + C0E344221C582ECB00E749C2 /* scandir.c in Sources */, + C0E344231C582ECB00E749C2 /* seed48.c in Sources */, + C0E344241C582ECB00E749C2 /* seekdir.c in Sources */, + C0E344251C582ECB00E749C2 /* sethostname.c in Sources */, + C0E344261C582ECB00E749C2 /* setmode.c in Sources */, + C0E344271C582ECB00E749C2 /* setprogname.c in Sources */, + C0E344281C582ECB00E749C2 /* siginterrupt.c in Sources */, + C0E344291C582ECB00E749C2 /* siglist.c in Sources */, + C0E3442A1C582ECB00E749C2 /* signal.c in Sources */, + C0E3442B1C582ECB00E749C2 /* sleep.c in Sources */, + C0E3442C1C582ECB00E749C2 /* srand48.c in Sources */, + C0E3442D1C582ECB00E749C2 /* stringlist.c in Sources */, + C0E3442E1C582ECB00E749C2 /* sysconf.c in Sources */, + C0E3442F1C582ECB00E749C2 /* sysctl.c in Sources */, + C0E344301C582ECB00E749C2 /* sysctlbyname.c in Sources */, + C0E344311C582ECB00E749C2 /* sysctlnametomib.c in Sources */, + C0E344321C582ECB00E749C2 /* telldir.c in Sources */, + C0E344331C582ECB00E749C2 /* termios.c in Sources */, + C0E344341C582ECB00E749C2 /* time.c in Sources */, + C0E344351C582ECB00E749C2 /* times.c in Sources */, + C0E344361C582ECB00E749C2 /* timezone.c in Sources */, + C0E344371C582ECB00E749C2 /* ttyname.c in Sources */, + C0E344381C582ECB00E749C2 /* ttyslot.c in Sources */, + C0E344391C582ECB00E749C2 /* ualarm.c in Sources */, + C0E3443A1C582ECB00E749C2 /* ulimit.c in Sources */, + C0E3443B1C582ECB00E749C2 /* unvis.c in Sources */, + C0E3443C1C582ECB00E749C2 /* usleep.c in Sources */, + C0E3443D1C582ECB00E749C2 /* utime.c in Sources */, + C0E3443E1C582ECB00E749C2 /* vis.c in Sources */, + C0E3443F1C582ECB00E749C2 /* wait.c in Sources */, + C0E344401C582ECB00E749C2 /* wait3.c in Sources */, + C0E344411C582ECB00E749C2 /* waitpid.c in Sources */, + C0E344421C582ECB00E749C2 /* fts.c in Sources */, + C0E344431C582ECB00E749C2 /* get_compat.c in Sources */, + C0E344441C582ECB00E749C2 /* getloadavg.c in Sources */, + C0E344451C582ECB00E749C2 /* getttyent.c in Sources */, + C0E344461C582ECB00E749C2 /* getusershell.c in Sources */, + C0E344471C582ECB00E749C2 /* getvfsbyname.c in Sources */, + C0E344481C582ECB00E749C2 /* nanosleep.c in Sources */, + C0E344491C582ECB00E749C2 /* utmpx.c in Sources */, + C0E3444A1C582ECB00E749C2 /* nftw.c in Sources */, + C0E3444B1C582ECB00E749C2 /* nlist.c in Sources */, + C0E3444C1C582ECB00E749C2 /* oldsyslog.c in Sources */, + C0E3444D1C582ECB00E749C2 /* setlogin.c in Sources */, + C0E3444E1C582ECB00E749C2 /* sigsetops.c in Sources */, + C0E3444F1C582ECB00E749C2 /* strtofflags.c in Sources */, + C0E344501C582ECB00E749C2 /* thread_stack_pcs.c in Sources */, + C0E344511C582ECB00E749C2 /* uname.c in Sources */, + C0E344521C582ECB00E749C2 /* utmpx-darwin.c in Sources */, + C0E344531C582ECB00E749C2 /* wordexp.c in Sources */, + C0E344541C582ECB00E749C2 /* gmon.c in Sources */, + C0E344551C582ECB00E749C2 /* ascii.c in Sources */, + C0E344561C582ECB00E749C2 /* big5.c in Sources */, + C0E344571C582ECB00E749C2 /* btowc.c in Sources */, + C0E344581C582ECB00E749C2 /* collate.c in Sources */, + C0E344591C582ECB00E749C2 /* collcmp.c in Sources */, + C0E3445A1C582ECB00E749C2 /* euc.c in Sources */, + C0E3445B1C582ECB00E749C2 /* fix_grouping.c in Sources */, + C0E3445C1C582ECB00E749C2 /* gb18030.c in Sources */, + C0E3445D1C582ECB00E749C2 /* gb2312.c in Sources */, + C0E3445E1C582ECB00E749C2 /* gbk.c in Sources */, + C0E3445F1C582ECB00E749C2 /* ldpart.c in Sources */, + C0E344601C582ECB00E749C2 /* lmessages.c in Sources */, + C0E344611C582ECB00E749C2 /* lmonetary.c in Sources */, + C0E344621C582ECB00E749C2 /* lnumeric.c in Sources */, + C0E344631C582ECB00E749C2 /* localeconv.c in Sources */, + C0E344641C582ECB00E749C2 /* mblen.c in Sources */, + C0E344651C582ECB00E749C2 /* mbrlen.c in Sources */, + C0E344661C582ECB00E749C2 /* mbrtowc.c in Sources */, + C0E344671C582ECB00E749C2 /* mbsinit.c in Sources */, + C0E344681C582ECB00E749C2 /* mbsnrtowcs.c in Sources */, + C0E344691C582ECB00E749C2 /* mbsrtowcs.c in Sources */, + C0E3446A1C582ECB00E749C2 /* mbstowcs.c in Sources */, + C0E3446B1C582ECB00E749C2 /* mbtowc.c in Sources */, + C0E3446C1C582ECB00E749C2 /* mskanji.c in Sources */, + C0E3446D1C582ECB00E749C2 /* nextwctype.c in Sources */, + C0E3446E1C582ECB00E749C2 /* nl_langinfo.c in Sources */, + C0E3446F1C582ECB00E749C2 /* nomacros.c in Sources */, + C0E344701C582ECB00E749C2 /* none.c in Sources */, + C0E344711C582ECB00E749C2 /* rune.c in Sources */, + C0E344721C582ECB00E749C2 /* runetype.c in Sources */, + C0E344731C582ECB00E749C2 /* setlocale.c in Sources */, + C0E344741C582ECB00E749C2 /* debug_private.c in Sources */, + C0E344751C582ECB00E749C2 /* setrunelocale.c in Sources */, + C0E344761C582ECB00E749C2 /* table.c in Sources */, + C0E344771C582ECB00E749C2 /* tolower.c in Sources */, + C0E344781C582ECB00E749C2 /* toupper.c in Sources */, + C0E344791C582ECB00E749C2 /* utf2.c in Sources */, + C0E3447A1C582ECB00E749C2 /* utf8.c in Sources */, + C0E3447B1C582ECB00E749C2 /* wcrtomb.c in Sources */, + C0E3447C1C582ECB00E749C2 /* wcsftime.c in Sources */, + C0E3447D1C582ECB00E749C2 /* wcsnrtombs.c in Sources */, + C0E3447E1C582ECB00E749C2 /* wcsrtombs.c in Sources */, + C0E3447F1C582ECB00E749C2 /* wcstod.c in Sources */, + C0E344801C582ECB00E749C2 /* wcstof.c in Sources */, + C0E344811C582ECB00E749C2 /* wcstoimax.c in Sources */, + C0E344821C582ECB00E749C2 /* wcstol.c in Sources */, + C0E344831C582ECB00E749C2 /* wcstold.c in Sources */, + C0E344841C582ECB00E749C2 /* wcstoll.c in Sources */, + C0E344851C582ECB00E749C2 /* wcstombs.c in Sources */, + C0E344861C582ECB00E749C2 /* wcstoul.c in Sources */, + C0E344871C582ECB00E749C2 /* wcstoull.c in Sources */, + C0E344881C582ECB00E749C2 /* wcstoumax.c in Sources */, + C0E344891C582ECB00E749C2 /* wctob.c in Sources */, + C0E3448A1C582ECB00E749C2 /* wctomb.c in Sources */, + C0E3448B1C582ECB00E749C2 /* wctrans.c in Sources */, + C0E3448C1C582ECB00E749C2 /* wctype.c in Sources */, + C0E3448D1C582ECB00E749C2 /* wcwidth.c in Sources */, + C0E3448E1C582ECB00E749C2 /* frune.c in Sources */, + C0E3448F1C582ECB00E749C2 /* isctype.c in Sources */, + C0E344901C582ECB00E749C2 /* iswctype.c in Sources */, + C0E344911C582ECB00E749C2 /* lconv.c in Sources */, + C0E344921C582ECB00E749C2 /* mbrune.c in Sources */, + C0E344931C582ECB00E749C2 /* runedepreciated.c in Sources */, + C0E344941C582ECB00E749C2 /* setinvalidrune.c in Sources */, + C0E344951C582ECB00E749C2 /* xlocale.c in Sources */, + C0E344961C582ECB00E749C2 /* addr2ascii.c in Sources */, + C0E344971C582ECB00E749C2 /* ascii2addr.c in Sources */, + C0E344981C582ECB00E749C2 /* inet_addr.c in Sources */, + C0E344991C582ECB00E749C2 /* inet_lnaof.c in Sources */, + C0E3449A1C582ECB00E749C2 /* inet_makeaddr.c in Sources */, + C0E3449B1C582ECB00E749C2 /* inet_net_ntop.c in Sources */, + C0E3449C1C582ECB00E749C2 /* inet_net_pton.c in Sources */, + C0E3449D1C582ECB00E749C2 /* inet_neta.c in Sources */, + C0E3449E1C582ECB00E749C2 /* inet_netof.c in Sources */, + C0E3449F1C582ECB00E749C2 /* inet_network.c in Sources */, + C0E344A01C582ECB00E749C2 /* inet_ntoa.c in Sources */, + C0E344A11C582ECB00E749C2 /* linkaddr.c in Sources */, + C0E344A21C582ECB00E749C2 /* nsap_addr.c in Sources */, + C0E344A31C582ECB00E749C2 /* recv.c in Sources */, + C0E344A41C582ECB00E749C2 /* send.c in Sources */, + C0E344A51C582ECB00E749C2 /* sockatmark.c in Sources */, + C0E344A61C582ECB00E749C2 /* sourcefilter.c in Sources */, + C0E344A71C582ECB00E749C2 /* msgcat.c in Sources */, + C0E344A81C582ECB00E749C2 /* acl.c in Sources */, + C0E344A91C582ECB00E749C2 /* acl_entry.c in Sources */, + C0E344AA1C582ECB00E749C2 /* acl_file.c in Sources */, + C0E344AB1C582ECB00E749C2 /* acl_flag.c in Sources */, + C0E344AC1C582ECB00E749C2 /* acl_perm.c in Sources */, + C0E344AD1C582ECB00E749C2 /* acl_translate.c in Sources */, + C0E344AE1C582ECB00E749C2 /* regerror.c in Sources */, + C0E344AF1C582ECB00E749C2 /* chk_fail.c in Sources */, + C0E344B01C582ECB00E749C2 /* memcpy_chk.c in Sources */, + C0E344B11C582ECB00E749C2 /* memmove_chk.c in Sources */, + C0E344B21C582ECB00E749C2 /* memset_chk.c in Sources */, + C0E344B31C582ECB00E749C2 /* snprintf_chk.c in Sources */, + C0E344B41C582ECB00E749C2 /* sprintf_chk.c in Sources */, + C0E344B51C582ECB00E749C2 /* stpcpy_chk.c in Sources */, + C0E344B61C582ECB00E749C2 /* stpncpy_chk.c in Sources */, + C0E344B71C582ECB00E749C2 /* strcat_chk.c in Sources */, + C0E344B81C582ECB00E749C2 /* strcpy_chk.c in Sources */, + C0E344B91C582ECB00E749C2 /* strlcat_chk.c in Sources */, + C0E344BA1C582ECB00E749C2 /* strlcpy_chk.c in Sources */, + C0E344BB1C582ECB00E749C2 /* strncat_chk.c in Sources */, + C0E344BC1C582ECB00E749C2 /* strncpy_chk.c in Sources */, + C0E344BD1C582ECB00E749C2 /* vsnprintf_chk.c in Sources */, + C0E344BE1C582ECB00E749C2 /* vsprintf_chk.c in Sources */, + C0E344BF1C582ECB00E749C2 /* _flock_stub.c in Sources */, + C0E344C01C582ECB00E749C2 /* asprintf.c in Sources */, + C0E344C11C582ECB00E749C2 /* clrerr.c in Sources */, + C0E344C21C582ECB00E749C2 /* dprintf.c in Sources */, + C0E344C31C582ECB00E749C2 /* fclose.c in Sources */, + C0E344C41C582ECB00E749C2 /* fdopen.c in Sources */, + C0E344C51C582ECB00E749C2 /* feof.c in Sources */, + C0E344C61C582ECB00E749C2 /* ferror.c in Sources */, + C0E344C71C582ECB00E749C2 /* fflush.c in Sources */, + C0E344C81C582ECB00E749C2 /* fgetc.c in Sources */, + C0E344C91C582ECB00E749C2 /* fgetln.c in Sources */, + C0E344CA1C582ECB00E749C2 /* fgetpos.c in Sources */, + C0E344CB1C582ECB00E749C2 /* fgets.c in Sources */, + C0E344CC1C582ECB00E749C2 /* fgetwc.c in Sources */, + C0E344CD1C582ECB00E749C2 /* fgetwln.c in Sources */, + C0E344CE1C582ECB00E749C2 /* fgetws.c in Sources */, + C0E344CF1C582ECB00E749C2 /* fileno.c in Sources */, + C0E344D01C582ECB00E749C2 /* findfp.c in Sources */, + C0E344D11C582ECB00E749C2 /* flags.c in Sources */, + C0E344D21C582ECB00E749C2 /* bcopy.c in Sources */, + C0E344D31C582ECB00E749C2 /* fopen.c in Sources */, + C0E344D41C582ECB00E749C2 /* fprintf.c in Sources */, + C0E344D51C582ECB00E749C2 /* fpurge.c in Sources */, + C0E344D61C582ECB00E749C2 /* fputc.c in Sources */, + C0E344D71C582ECB00E749C2 /* fputs.c in Sources */, + C0E344D81C582ECB00E749C2 /* fputwc.c in Sources */, + C0E344D91C582ECB00E749C2 /* fputws.c in Sources */, + C0E344DA1C582ECB00E749C2 /* fread.c in Sources */, + C0E344DB1C582ECB00E749C2 /* freopen.c in Sources */, + C0E344DC1C582ECB00E749C2 /* fscanf.c in Sources */, + C0E344DD1C582ECB00E749C2 /* fseek.c in Sources */, + C0E344DE1C582ECB00E749C2 /* fsetpos.c in Sources */, + C0E344DF1C582ECB00E749C2 /* ftell.c in Sources */, + C0E344E01C582ECB00E749C2 /* funopen.c in Sources */, + C0E344E11C582ECB00E749C2 /* fvwrite.c in Sources */, + 922D0C0C21BFA19A0072834D /* timespec_get.c in Sources */, + C0E344E21C582ECB00E749C2 /* fwalk.c in Sources */, + C0E344E31C582ECB00E749C2 /* fwide.c in Sources */, + C0E344E41C582ECB00E749C2 /* fwprintf.c in Sources */, + C0E344E51C582ECB00E749C2 /* fwrite.c in Sources */, + C0E344E61C582ECB00E749C2 /* fwscanf.c in Sources */, + C0E344E71C582ECB00E749C2 /* getc.c in Sources */, + C0E344E81C582ECB00E749C2 /* getchar.c in Sources */, + C0E344E91C582ECB00E749C2 /* getdelim.c in Sources */, + C0E344EA1C582ECB00E749C2 /* getline.c in Sources */, + C0E344EB1C582ECB00E749C2 /* gets.c in Sources */, + C0E344EC1C582ECB00E749C2 /* getw.c in Sources */, + C0E344ED1C582ECB00E749C2 /* getwc.c in Sources */, + C0E344EE1C582ECB00E749C2 /* getwchar.c in Sources */, + C0E344EF1C582ECB00E749C2 /* makebuf.c in Sources */, + C0E344F01C582ECB00E749C2 /* mktemp.c in Sources */, + C0E344F11C582ECB00E749C2 /* perror.c in Sources */, + C0E344F21C582ECB00E749C2 /* printf-pos.c in Sources */, + C0E344F31C582ECB00E749C2 /* printf.c in Sources */, + C0E344F41C582ECB00E749C2 /* putc.c in Sources */, + C0E344F51C582ECB00E749C2 /* putchar.c in Sources */, + C0E344F61C582ECB00E749C2 /* puts.c in Sources */, + C0E344F71C582ECB00E749C2 /* putw.c in Sources */, + C0E344F81C582ECB00E749C2 /* putwc.c in Sources */, + C0E344F91C582ECB00E749C2 /* putwchar.c in Sources */, + C0E344FA1C582ECB00E749C2 /* refill.c in Sources */, + C0E344FB1C582ECB00E749C2 /* remove.c in Sources */, + C0E344FC1C582ECB00E749C2 /* rewind.c in Sources */, + C0E344FD1C582ECB00E749C2 /* rget.c in Sources */, + C0E344FE1C582ECB00E749C2 /* scanf.c in Sources */, + C0E344FF1C582ECB00E749C2 /* setbuf.c in Sources */, + C0E345001C582ECB00E749C2 /* setbuffer.c in Sources */, + C0E345011C582ECB00E749C2 /* setvbuf.c in Sources */, + C0E345021C582ECB00E749C2 /* snprintf.c in Sources */, + C0E345031C582ECB00E749C2 /* sprintf.c in Sources */, + C0E345041C582ECB00E749C2 /* sscanf.c in Sources */, + C0E345051C582ECB00E749C2 /* stdio.c in Sources */, + C0E345061C582ECB00E749C2 /* swprintf.c in Sources */, + C0E345071C582ECB00E749C2 /* swscanf.c in Sources */, + C0E345081C582ECB00E749C2 /* tempnam.c in Sources */, + C0E345091C582ECB00E749C2 /* tmpfile.c in Sources */, + C0E3450A1C582ECB00E749C2 /* tmpnam.c in Sources */, + C0E3450B1C582ECB00E749C2 /* ungetc.c in Sources */, + C0E3450C1C582ECB00E749C2 /* ungetwc.c in Sources */, + C0E3450D1C582ECB00E749C2 /* vasprintf.c in Sources */, + C0E3450E1C582ECB00E749C2 /* vdprintf.c in Sources */, + C0E3450F1C582ECB00E749C2 /* vfprintf.c in Sources */, + C0E345101C582ECB00E749C2 /* vfscanf.c in Sources */, + C0E345111C582ECB00E749C2 /* vfwprintf.c in Sources */, + C0E345121C582ECB00E749C2 /* vfwscanf.c in Sources */, + C0E345131C582ECB00E749C2 /* vprintf.c in Sources */, + C0E345141C582ECB00E749C2 /* vscanf.c in Sources */, + C0E345151C582ECB00E749C2 /* vsnprintf.c in Sources */, + C0E345161C582ECB00E749C2 /* vsprintf.c in Sources */, + C0E345171C582ECB00E749C2 /* vsscanf.c in Sources */, + C0E345181C582ECB00E749C2 /* vswprintf.c in Sources */, + C0E345191C582ECB00E749C2 /* vswscanf.c in Sources */, + C0E3451A1C582ECB00E749C2 /* vwprintf.c in Sources */, + C0E3451B1C582ECB00E749C2 /* vwscanf.c in Sources */, + C0E3451C1C582ECB00E749C2 /* wbuf.c in Sources */, + C0E3451D1C582ECB00E749C2 /* wprintf.c in Sources */, + C0E3451E1C582ECB00E749C2 /* wscanf.c in Sources */, + C0E3451F1C582ECB00E749C2 /* wsetup.c in Sources */, + 7756338922F3B53A002F1707 /* rpmatch.c in Sources */, + C0E345201C582ECB00E749C2 /* a64l.c in Sources */, + C0E345211C582ECB00E749C2 /* _Exit_.c in Sources */, + C0E345221C582ECB00E749C2 /* abort.c in Sources */, + C0E345231C582ECB00E749C2 /* abs.c in Sources */, + C0E345241C582ECB00E749C2 /* atexit.c in Sources */, + C0E345251C582ECB00E749C2 /* atof.c in Sources */, + C0E345261C582ECB00E749C2 /* atoi.c in Sources */, + C0E345271C582ECB00E749C2 /* atol.c in Sources */, + C0E345281C582ECB00E749C2 /* atoll.c in Sources */, + C0E345291C582ECB00E749C2 /* bsearch.c in Sources */, + C0E3452A1C582ECB00E749C2 /* div.c in Sources */, + C0E3452B1C582ECB00E749C2 /* exit.c in Sources */, + C0E3452C1C582ECB00E749C2 /* getenv.c in Sources */, + C0E3452D1C582ECB00E749C2 /* getopt.c in Sources */, + C0E3452E1C582ECB00E749C2 /* getopt_long.c in Sources */, + C0E3452F1C582ECB00E749C2 /* getsubopt.c in Sources */, + C0E345301C582ECB00E749C2 /* hcreate.c in Sources */, + C0E345311C582ECB00E749C2 /* heapsort.c in Sources */, + C0E345321C582ECB00E749C2 /* heapsort_b.c in Sources */, + C0E345331C582ECB00E749C2 /* heapsort_r.c in Sources */, + C0E345341C582ECB00E749C2 /* imaxabs.c in Sources */, + C0E345351C582ECB00E749C2 /* imaxdiv.c in Sources */, + C0E345361C582ECB00E749C2 /* insque.c in Sources */, + C0E345371C582ECB00E749C2 /* labs.c in Sources */, + C0E345381C582ECB00E749C2 /* ldiv.c in Sources */, + C0E345391C582ECB00E749C2 /* llabs.c in Sources */, + C0E3453A1C582ECB00E749C2 /* lldiv.c in Sources */, + C0E3453B1C582ECB00E749C2 /* lsearch.c in Sources */, + C0E3453C1C582ECB00E749C2 /* merge.c in Sources */, + C0E3453D1C582ECB00E749C2 /* putenv.c in Sources */, + C0E3453E1C582ECB00E749C2 /* qsort.c in Sources */, + C0E3453F1C582ECB00E749C2 /* qsort_r.c in Sources */, + C0E345401C582ECB00E749C2 /* radixsort.c in Sources */, + C0E345411C582ECB00E749C2 /* rand.c in Sources */, + C0E345421C582ECB00E749C2 /* random.c in Sources */, + C0E345431C582ECB00E749C2 /* reallocf.c in Sources */, + C0E345441C582ECB00E749C2 /* realpath.c in Sources */, + C0E345451C582ECB00E749C2 /* remque.c in Sources */, + C0E345461C582ECB00E749C2 /* setenv.c in Sources */, + C0E345471C582ECB00E749C2 /* strhash.c in Sources */, + C0E345481C582ECB00E749C2 /* strtoimax.c in Sources */, + C0E345491C582ECB00E749C2 /* strtol.c in Sources */, + C0E3454A1C582ECB00E749C2 /* strtoll.c in Sources */, + C0E3454B1C582ECB00E749C2 /* strtoq.c in Sources */, + C0E3454C1C582ECB00E749C2 /* strtoul.c in Sources */, + C0E3454D1C582ECB00E749C2 /* strtoull.c in Sources */, + C0E3454E1C582ECB00E749C2 /* strtoumax.c in Sources */, + C0E3454F1C582ECB00E749C2 /* strtouq.c in Sources */, + C0E345501C582ECB00E749C2 /* system.c in Sources */, + C0E345511C582ECB00E749C2 /* tdelete.c in Sources */, + C0E345521C582ECB00E749C2 /* tfind.c in Sources */, + C0E345531C582ECB00E749C2 /* tsearch.c in Sources */, + C0E345541C582ECB00E749C2 /* twalk.c in Sources */, + C0E345551C582ECB00E749C2 /* grantpt.c in Sources */, + C0E345561C582ECB00E749C2 /* l64a.c in Sources */, + C0E345571C582ECB00E749C2 /* strfmon.c in Sources */, + C0E345581C582ECB00E749C2 /* ecvt.c in Sources */, + C0E345591C582ECB00E749C2 /* gcvt.c in Sources */, + C0E3455A1C582ECB00E749C2 /* qsort_b.c in Sources */, + C0E3455B1C582ECB00E749C2 /* asctime.c in Sources */, + C0E3455C1C582ECB00E749C2 /* difftime.c in Sources */, + C0E3455D1C582ECB00E749C2 /* ftime.c in Sources */, + C0E3455E1C582ECB00E749C2 /* localtime.c in Sources */, + C0E3455F1C582ECB00E749C2 /* strftime.c in Sources */, + C0E345601C582ECB00E749C2 /* strptime.c in Sources */, + C0E345611C582ECB00E749C2 /* time32.c in Sources */, + C0E345621C582ECB00E749C2 /* timelocal.c in Sources */, + C0E345631C582ECB00E749C2 /* getdate.c in Sources */, + C0E345641C582ECB00E749C2 /* timezone_unix03.c in Sources */, + C0E345661C582ECB00E749C2 /* memmem.c in Sources */, + C0E345671C582ECB00E749C2 /* rindex.c in Sources */, + C0E345681C582ECB00E749C2 /* strcasecmp.c in Sources */, + C0E345691C582ECB00E749C2 /* strcasestr.c in Sources */, + C0E3456A1C582ECB00E749C2 /* strcoll.c in Sources */, + C0E3456B1C582ECB00E749C2 /* strcspn.c in Sources */, + C0E3456C1C582ECB00E749C2 /* strdup.c in Sources */, + C0E3456D1C582ECB00E749C2 /* strerror.c in Sources */, + C0E3456F1C582ECB00E749C2 /* strmode.c in Sources */, + C0E345701C582ECB00E749C2 /* strndup.c in Sources */, + C0E345721C582ECB00E749C2 /* strnstr.c in Sources */, + C0E345731C582ECB00E749C2 /* strpbrk.c in Sources */, + C0E345741C582ECB00E749C2 /* strrchr.c in Sources */, + C0E345751C582ECB00E749C2 /* strsep.c in Sources */, + C0E345761C582ECB00E749C2 /* strsignal.c in Sources */, + C0E345771C582ECB00E749C2 /* strspn.c in Sources */, + C0E345791C582ECB00E749C2 /* strtok.c in Sources */, + C0E3457A1C582ECB00E749C2 /* strxfrm.c in Sources */, + C0E3457B1C582ECB00E749C2 /* swab.c in Sources */, + C0E3457C1C582ECB00E749C2 /* wcpcpy.c in Sources */, + C0E3457D1C582ECB00E749C2 /* wcpncpy.c in Sources */, + C0E3457E1C582ECB00E749C2 /* wcscasecmp.c in Sources */, + C0E3457F1C582ECB00E749C2 /* wcscat.c in Sources */, + C0E345801C582ECB00E749C2 /* wcschr.c in Sources */, + C0E345811C582ECB00E749C2 /* wcscmp.c in Sources */, + C0E345821C582ECB00E749C2 /* wcscoll.c in Sources */, + C0E345831C582ECB00E749C2 /* wcscpy.c in Sources */, + C0E345841C582ECB00E749C2 /* wcscspn.c in Sources */, + C0E345851C582ECB00E749C2 /* wcsdup.c in Sources */, + C0E345861C582ECB00E749C2 /* wcslcat.c in Sources */, + C0E345871C582ECB00E749C2 /* wcslcpy.c in Sources */, + C0E345881C582ECB00E749C2 /* wcslen.c in Sources */, + C0E345891C582ECB00E749C2 /* wcsncasecmp.c in Sources */, + C0E3458A1C582ECB00E749C2 /* wcsncat.c in Sources */, + C0E3458B1C582ECB00E749C2 /* wcsncmp.c in Sources */, + C0E3458C1C582ECB00E749C2 /* wcsncpy.c in Sources */, + C0E3458D1C582ECB00E749C2 /* wcsnlen.c in Sources */, + C0E3458E1C582ECB00E749C2 /* wcspbrk.c in Sources */, + C0E3458F1C582ECB00E749C2 /* wcsrchr.c in Sources */, + C0E345901C582ECB00E749C2 /* wcsspn.c in Sources */, + C0E345911C582ECB00E749C2 /* wcsstr.c in Sources */, + C0E345921C582ECB00E749C2 /* wcstok.c in Sources */, + C0E345931C582ECB00E749C2 /* wcswidth.c in Sources */, + C0E345941C582ECB00E749C2 /* wcsxfrm.c in Sources */, + C0E345951C582ECB00E749C2 /* wmemchr.c in Sources */, + C0E345961C582ECB00E749C2 /* wmemcmp.c in Sources */, + C0E345971C582ECB00E749C2 /* wmemcpy.c in Sources */, + C0E345981C582ECB00E749C2 /* wmemmove.c in Sources */, + C0E345991C582ECB00E749C2 /* wmemset.c in Sources */, + C0E3459A1C582ECB00E749C2 /* _libc_init.c in Sources */, + C0E3459B1C582ECB00E749C2 /* _libc_fork_child.c in Sources */, + C0E3459C1C582ECB00E749C2 /* chmodx_np.c in Sources */, + C0E3459D1C582ECB00E749C2 /* crt_externs.c in Sources */, + C0E3459E1C582ECB00E749C2 /* fork.c in Sources */, + C0E3459F1C582ECB00E749C2 /* getgroups.c in Sources */, + C0E345A01C582ECB00E749C2 /* gettimeofday.c in Sources */, + C0E345A11C582ECB00E749C2 /* msgctl.c in Sources */, + C0E345A21C582ECB00E749C2 /* stack_protector.c in Sources */, + C0E345A31C582ECB00E749C2 /* openx_np.c in Sources */, + C0E345A41C582ECB00E749C2 /* OSMemoryNotification.c in Sources */, + C0E345A51C582ECB00E749C2 /* OSThermalNotification.c in Sources */, + C0E345A61C582ECB00E749C2 /* posix_spawn.c in Sources */, + C0E345A71C582ECB00E749C2 /* semctl.c in Sources */, + C0E345A81C582ECB00E749C2 /* settimeofday.c in Sources */, + C0E345A91C582ECB00E749C2 /* shmctl.c in Sources */, + C0E345AA1C582ECB00E749C2 /* sigaction.c in Sources */, + C0E345AB1C582ECB00E749C2 /* (null) in Sources */, + C0E345AC1C582ECB00E749C2 /* statx_np.c in Sources */, + C0E345AD1C582ECB00E749C2 /* umaskx_np.c in Sources */, + C0E345AE1C582ECB00E749C2 /* fparseln.c in Sources */, + C0E345AF1C582ECB00E749C2 /* login.c in Sources */, + C0E345B01C582ECB00E749C2 /* login_tty.c in Sources */, + C0E345B11C582ECB00E749C2 /* logout.c in Sources */, + C0E345B21C582ECB00E749C2 /* logwtmp.c in Sources */, + C0E345B31C582ECB00E749C2 /* mkpath_np.c in Sources */, + C0E345B41C582ECB00E749C2 /* opendev.c in Sources */, + C0E345B51C582ECB00E749C2 /* pty.c in Sources */, + C0E345B61C582ECB00E749C2 /* clear.c in Sources */, + C0E345B71C582ECB00E749C2 /* compare.c in Sources */, + C0E345B81C582ECB00E749C2 /* copy.c in Sources */, + C0E345B91C582ECB00E749C2 /* gen_uuid.c in Sources */, + C0E345BA1C582ECB00E749C2 /* isnull.c in Sources */, + C0E345BB1C582ECB00E749C2 /* pack.c in Sources */, + C0E345BC1C582ECB00E749C2 /* parse.c in Sources */, + C0E345BD1C582ECB00E749C2 /* unpack.c in Sources */, + C0E345BE1C582ECB00E749C2 /* unparse.c in Sources */, + C0E345BF1C582ECB00E749C2 /* (null) in Sources */, + C0E345C01C582ECB00E749C2 /* (null) in Sources */, + C0E345C11C582ECB00E749C2 /* (null) in Sources */, + C0E345C21C582ECB00E749C2 /* (null) in Sources */, + C0E345C31C582ECB00E749C2 /* scandir_b.c in Sources */, + C0E345CD1C582ECB00E749C2 /* stpcpy.c in Sources */, + C0E345CE1C582ECB00E749C2 /* stpncpy.c in Sources */, + C0E345CF1C582ECB00E749C2 /* strcat.c in Sources */, + C0E345D01C582ECB00E749C2 /* strncat.c in Sources */, + C0E345D21C582ECB00E749C2 /* sync_volume_np.c in Sources */, + C0E345D31C582ECB00E749C2 /* dirfd.c in Sources */, + C0E345D41C582ECB00E749C2 /* eos_stubs.c in Sources */, + C0E345D61C582ECB00E749C2 /* assumes.c in Sources */, + C0E345D71C582ECB00E749C2 /* inet_ntop.c in Sources */, + C0E345D81C582ECB00E749C2 /* inet_pton.c in Sources */, + C0E345D91C582ECB00E749C2 /* memccpy_chk.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9257ECC138E1B5000B3107C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C9257ED5138E1C2E00B3107C /* creat.c in Sources */, + C9257ED6138E1C2E00B3107C /* gethostid.c in Sources */, + C9257ED7138E1C2E00B3107C /* getwd.c in Sources */, + C9257ED8138E1C2E00B3107C /* killpg.c in Sources */, + C9257ED9138E1C2E00B3107C /* sethostid.c in Sources */, + C9257EDA138E1C2E00B3107C /* setpgrp.c in Sources */, + C9257EDB138E1C2E00B3107C /* setrgid.c in Sources */, + C9257EDC138E1C2E00B3107C /* setruid.c in Sources */, + C9257EDD138E1C5D00B3107C /* bt_close.c in Sources */, + C9257EDE138E1C5D00B3107C /* bt_conv.c in Sources */, + C9257EDF138E1C5D00B3107C /* bt_debug.c in Sources */, + C9257EE0138E1C5D00B3107C /* bt_delete.c in Sources */, + C9257EE1138E1C5D00B3107C /* bt_get.c in Sources */, + C9257EE2138E1C5D00B3107C /* bt_open.c in Sources */, + C9257EE3138E1C5D00B3107C /* bt_overflow.c in Sources */, + C9257EE4138E1C5D00B3107C /* bt_page.c in Sources */, + C9257EE5138E1C5D00B3107C /* bt_put.c in Sources */, + C9257EE6138E1C5D00B3107C /* bt_search.c in Sources */, + C9257EE7138E1C5D00B3107C /* bt_seq.c in Sources */, + C9257EE8138E1C5D00B3107C /* bt_split.c in Sources */, + C9257EE9138E1C5D00B3107C /* bt_utils.c in Sources */, + C9257EEA138E1C5D00B3107C /* db.c in Sources */, + C9257EEB138E1C5D00B3107C /* hash.c in Sources */, + C9257EEC138E1C5D00B3107C /* hash_bigkey.c in Sources */, + C9257EED138E1C5D00B3107C /* hash_buf.c in Sources */, + C9257EEE138E1C5D00B3107C /* hash_func.c in Sources */, + C9257EEF138E1C5D00B3107C /* hash_log2.c in Sources */, + C9257EF0138E1C5D00B3107C /* hash_page.c in Sources */, + C9257EF1138E1C5D00B3107C /* ndbm.c in Sources */, + C9257EF2138E1C5D00B3107C /* mpool.c in Sources */, + C9257EF3138E1C5D00B3107C /* rec_close.c in Sources */, + C9257EF4138E1C5D00B3107C /* rec_delete.c in Sources */, + C9257EF5138E1C5D00B3107C /* rec_get.c in Sources */, + C9257EF6138E1C5D00B3107C /* rec_open.c in Sources */, + C9257EF7138E1C5D00B3107C /* rec_put.c in Sources */, + C9257EF8138E1C5D00B3107C /* rec_search.c in Sources */, + C9257EF9138E1C5D00B3107C /* rec_seq.c in Sources */, + C9257EFA138E1C5D00B3107C /* rec_utils.c in Sources */, + 928BD1021D76072C00EC01FC /* timingsafe_bcmp.c in Sources */, + C9257EFB138E1C6A00B3107C /* _hdtoa.c in Sources */, + C9257EFC138E1C6A00B3107C /* gdtoa-dmisc.c in Sources */, + C9257EFD138E1C6A00B3107C /* gdtoa-dtoa.c in Sources */, + C9257EFE138E1C6A00B3107C /* gdtoa-gdtoa.c in Sources */, + C9257EFF138E1C6A00B3107C /* gdtoa-gethex.c in Sources */, + C9257F00138E1C6A00B3107C /* gdtoa-gmisc.c in Sources */, + C9257F01138E1C6A00B3107C /* gdtoa-hd_init.c in Sources */, + C9257F02138E1C6A00B3107C /* gdtoa-hexnan.c in Sources */, + C9257F03138E1C6A00B3107C /* gdtoa-misc.c in Sources */, + C9257F04138E1C6A00B3107C /* gdtoa-smisc.c in Sources */, + C9257F05138E1C6A00B3107C /* gdtoa-strtod.c in Sources */, + C9257F06138E1C6A00B3107C /* gdtoa-strtodg.c in Sources */, + C9257F07138E1C6A00B3107C /* gdtoa-strtof.c in Sources */, + C9257F09138E1C6A00B3107C /* gdtoa-strtopdd.c in Sources */, + C9257F0A138E1C6A00B3107C /* gdtoa-strtopx.c in Sources */, + C9257F0B138E1C6A00B3107C /* gdtoa-strtord.c in Sources */, + C9257F0C138E1C6A00B3107C /* gdtoa-sum.c in Sources */, + C9257F0D138E1C6A00B3107C /* gdtoa-ulp.c in Sources */, + C9257F0E138E1C6A00B3107C /* glue.c in Sources */, + C9257F0F138E1C8200B3107C /* _rand48.c in Sources */, + C9257F10138E1C8200B3107C /* alarm.c in Sources */, + C9257F11138E1C8200B3107C /* arc4random.c in Sources */, + C9257F12138E1C8200B3107C /* assert.c in Sources */, + C9257F13138E1C8200B3107C /* basename.c in Sources */, + C9257F14138E1C8200B3107C /* clock.c in Sources */, + C9257F15138E1C8200B3107C /* closedir.c in Sources */, + C9257F16138E1C8200B3107C /* ctermid.c in Sources */, + C9257F17138E1C8200B3107C /* daemon.c in Sources */, + C9257F18138E1C8200B3107C /* dirname.c in Sources */, + C9257F19138E1C8200B3107C /* drand48.c in Sources */, + C9257F1A138E1C8200B3107C /* erand48.c in Sources */, + C9257F1B138E1C8200B3107C /* err.c in Sources */, + C9257F1C138E1C8200B3107C /* exec.c in Sources */, + C9257F1D138E1C8200B3107C /* fmtcheck.c in Sources */, + C9257F1E138E1C8200B3107C /* fmtmsg.c in Sources */, + C9257F1F138E1C8200B3107C /* fnmatch.c in Sources */, + C9257F20138E1C8200B3107C /* ftok.c in Sources */, + C9257F21138E1C8200B3107C /* getbsize.c in Sources */, + C9257F22138E1C8200B3107C /* getcap.c in Sources */, + C9257F23138E1C8200B3107C /* getcwd.c in Sources */, + C9257F24138E1C8200B3107C /* gethostname.c in Sources */, + C9257F25138E1C8200B3107C /* getlogin.c in Sources */, + C9257F26138E1C8200B3107C /* getmntinfo.c in Sources */, + C9257F27138E1C8200B3107C /* getpagesize.c in Sources */, + C9257F28138E1C8200B3107C /* getpeereid.c in Sources */, + C9257F29138E1C8200B3107C /* getprogname.c in Sources */, + C9257F2A138E1C8200B3107C /* glob.c in Sources */, + C9257F2B138E1C8200B3107C /* isatty.c in Sources */, + C9257F2C138E1C8200B3107C /* jrand48.c in Sources */, + C9257F2D138E1C8200B3107C /* lcong48.c in Sources */, + C9257F2E138E1C8200B3107C /* lockf.c in Sources */, + C9257F2F138E1C8200B3107C /* lrand48.c in Sources */, + C9257F30138E1C8200B3107C /* mrand48.c in Sources */, + C9257F31138E1C8200B3107C /* nice.c in Sources */, + C9257F32138E1C8200B3107C /* nrand48.c in Sources */, + C9257F33138E1C8200B3107C /* opendir.c in Sources */, + C9257F34138E1C8200B3107C /* pause.c in Sources */, + C9257F35138E1C8200B3107C /* popen.c in Sources */, + C9257F37138E1C8200B3107C /* psignal.c in Sources */, + C9257F39138E1C8200B3107C /* readdir.c in Sources */, + C9257F3A138E1C8200B3107C /* readpassphrase.c in Sources */, + C9257F3B138E1C8200B3107C /* rewinddir.c in Sources */, + C9257F3C138E1C8200B3107C /* scandir.c in Sources */, + C9257F3D138E1C8200B3107C /* seed48.c in Sources */, + C9257F3E138E1C8200B3107C /* seekdir.c in Sources */, + C9257F3F138E1C8200B3107C /* sethostname.c in Sources */, + C9257F40138E1C8200B3107C /* setmode.c in Sources */, + C9257F41138E1C8200B3107C /* setprogname.c in Sources */, + C9257F42138E1C8200B3107C /* siginterrupt.c in Sources */, + C9257F43138E1C8200B3107C /* siglist.c in Sources */, + C9257F44138E1C8200B3107C /* signal.c in Sources */, + C9257F45138E1C8200B3107C /* sleep.c in Sources */, + C9257F46138E1C8200B3107C /* srand48.c in Sources */, + C9257F47138E1C8200B3107C /* stringlist.c in Sources */, + C9257F48138E1C8200B3107C /* sysconf.c in Sources */, + C9257F49138E1C8200B3107C /* sysctl.c in Sources */, + C9257F4A138E1C8200B3107C /* sysctlbyname.c in Sources */, + C9257F4B138E1C8200B3107C /* sysctlnametomib.c in Sources */, + C9257F4C138E1C8200B3107C /* telldir.c in Sources */, + C9257F4D138E1C8200B3107C /* termios.c in Sources */, + C9257F4E138E1C8200B3107C /* time.c in Sources */, + C9257F4F138E1C8200B3107C /* times.c in Sources */, + C9257F51138E1C8200B3107C /* ttyname.c in Sources */, + C9257F52138E1C8200B3107C /* ttyslot.c in Sources */, + C9257F53138E1C8200B3107C /* ualarm.c in Sources */, + C9257F54138E1C8200B3107C /* ulimit.c in Sources */, + C9257F55138E1C8200B3107C /* unvis.c in Sources */, + C9257F56138E1C8200B3107C /* usleep.c in Sources */, + C9257F57138E1C8200B3107C /* utime.c in Sources */, + C9257F58138E1C8200B3107C /* vis.c in Sources */, + C9257F59138E1C8200B3107C /* wait.c in Sources */, + C9257F5A138E1C8200B3107C /* wait3.c in Sources */, + C9257F5B138E1C8200B3107C /* waitpid.c in Sources */, + C9257F5C138E1C9700B3107C /* ascii.c in Sources */, + C9257F5D138E1C9700B3107C /* big5.c in Sources */, + C9257F5E138E1C9700B3107C /* btowc.c in Sources */, + C9257F5F138E1C9700B3107C /* collate.c in Sources */, + C9257F60138E1C9700B3107C /* collcmp.c in Sources */, + C9257F61138E1C9700B3107C /* euc.c in Sources */, + C9257F62138E1C9700B3107C /* fix_grouping.c in Sources */, + C9257F63138E1C9700B3107C /* gb18030.c in Sources */, + C9257F64138E1C9700B3107C /* gb2312.c in Sources */, + C9257F65138E1C9700B3107C /* gbk.c in Sources */, + C9257F66138E1C9700B3107C /* ldpart.c in Sources */, + C9257F67138E1C9700B3107C /* lmessages.c in Sources */, + C9257F68138E1C9700B3107C /* lmonetary.c in Sources */, + C9257F69138E1C9700B3107C /* lnumeric.c in Sources */, + C9257F6A138E1C9700B3107C /* localeconv.c in Sources */, + C9257F6B138E1C9700B3107C /* mblen.c in Sources */, + C9257F6C138E1C9700B3107C /* mbrlen.c in Sources */, + C9257F6D138E1C9700B3107C /* mbrtowc.c in Sources */, + C9257F6E138E1C9700B3107C /* mbsinit.c in Sources */, + C9257F6F138E1C9700B3107C /* mbsnrtowcs.c in Sources */, + C9257F70138E1C9700B3107C /* mbsrtowcs.c in Sources */, + C9257F71138E1C9700B3107C /* mbstowcs.c in Sources */, + C9257F72138E1C9700B3107C /* mbtowc.c in Sources */, + C9257F73138E1C9700B3107C /* mskanji.c in Sources */, + C9257F74138E1C9700B3107C /* nextwctype.c in Sources */, + C9257F75138E1C9700B3107C /* nl_langinfo.c in Sources */, + C9257F76138E1C9700B3107C /* nomacros.c in Sources */, + C9257F77138E1C9700B3107C /* none.c in Sources */, + C9257F79138E1C9700B3107C /* runetype.c in Sources */, + C9257F7A138E1C9700B3107C /* setlocale.c in Sources */, + C9257F7B138E1C9700B3107C /* setrunelocale.c in Sources */, + C9257F7C138E1C9700B3107C /* table.c in Sources */, + C9257F7D138E1C9700B3107C /* tolower.c in Sources */, + C9257F7E138E1C9700B3107C /* toupper.c in Sources */, + C9257F7F138E1C9700B3107C /* utf8.c in Sources */, + C9257F80138E1C9700B3107C /* wcrtomb.c in Sources */, + C9257F81138E1C9700B3107C /* wcsftime.c in Sources */, + C9257F82138E1C9700B3107C /* wcsnrtombs.c in Sources */, + C9257F83138E1C9700B3107C /* wcsrtombs.c in Sources */, + C9257F84138E1C9700B3107C /* wcstod.c in Sources */, + C9257F85138E1C9700B3107C /* wcstof.c in Sources */, + C9257F86138E1C9700B3107C /* wcstoimax.c in Sources */, + C9257F87138E1C9700B3107C /* wcstol.c in Sources */, + C9257F88138E1C9700B3107C /* wcstold.c in Sources */, + C9257F89138E1C9700B3107C /* wcstoll.c in Sources */, + C9257F8A138E1C9700B3107C /* wcstombs.c in Sources */, + C9257F8B138E1C9700B3107C /* wcstoul.c in Sources */, + C9257F8C138E1C9700B3107C /* wcstoull.c in Sources */, + C9257F8D138E1C9700B3107C /* wcstoumax.c in Sources */, + C9257F8E138E1C9700B3107C /* wctob.c in Sources */, + C9257F8F138E1C9700B3107C /* wctomb.c in Sources */, + C9257F90138E1C9700B3107C /* wctrans.c in Sources */, + C9257F91138E1C9700B3107C /* wctype.c in Sources */, + C9257F92138E1C9700B3107C /* wcwidth.c in Sources */, + C9257F93138E1C9700B3107C /* addr2ascii.c in Sources */, + C9257F94138E1C9700B3107C /* ascii2addr.c in Sources */, + C9257F95138E1C9700B3107C /* inet_addr.c in Sources */, + 92888B171EA5BE8000BA923E /* open_memstream.c in Sources */, + C9257F96138E1C9700B3107C /* inet_lnaof.c in Sources */, + C9257F97138E1C9700B3107C /* inet_makeaddr.c in Sources */, + C9257F98138E1C9700B3107C /* inet_net_ntop.c in Sources */, + C9257F99138E1C9700B3107C /* inet_net_pton.c in Sources */, + C9257F9A138E1C9700B3107C /* inet_neta.c in Sources */, + C9257F9B138E1C9700B3107C /* inet_netof.c in Sources */, + C9257F9C138E1C9700B3107C /* inet_network.c in Sources */, + C9257F9D138E1C9700B3107C /* inet_ntoa.c in Sources */, + C9257F9E138E1C9700B3107C /* linkaddr.c in Sources */, + C9257F9F138E1C9700B3107C /* nsap_addr.c in Sources */, + C9257FA0138E1C9700B3107C /* recv.c in Sources */, + C9257FA1138E1C9700B3107C /* send.c in Sources */, + C9257FA2138E1C9700B3107C /* sockatmark.c in Sources */, + C9257FA3138E1C9700B3107C /* sourcefilter.c in Sources */, + C9257FA4138E1C9700B3107C /* msgcat.c in Sources */, + C9257FA5138E1CC000B3107C /* _flock_stub.c in Sources */, + C9257FA6138E1CC000B3107C /* asprintf.c in Sources */, + C9257FA7138E1CC000B3107C /* clrerr.c in Sources */, + C9257FA8138E1CC000B3107C /* dprintf.c in Sources */, + C9257FA9138E1CC000B3107C /* fclose.c in Sources */, + C9257FAA138E1CC000B3107C /* fdopen.c in Sources */, + C9257FAB138E1CC000B3107C /* feof.c in Sources */, + C9257FAC138E1CC000B3107C /* ferror.c in Sources */, + C9257FAD138E1CC000B3107C /* fflush.c in Sources */, + C9257FAE138E1CC000B3107C /* fgetc.c in Sources */, + C9257FAF138E1CC000B3107C /* fgetln.c in Sources */, + C9257FB0138E1CC000B3107C /* fgetpos.c in Sources */, + C9257FB1138E1CC000B3107C /* fgets.c in Sources */, + C9257FB2138E1CC000B3107C /* fgetwc.c in Sources */, + C9257FB3138E1CC000B3107C /* fgetwln.c in Sources */, + C9257FB4138E1CC000B3107C /* fgetws.c in Sources */, + C9257FB5138E1CC000B3107C /* fileno.c in Sources */, + C9257FB6138E1CC000B3107C /* findfp.c in Sources */, + C9257FB7138E1CC000B3107C /* flags.c in Sources */, + C9257FB8138E1CC000B3107C /* fopen.c in Sources */, + C9257FB9138E1CC000B3107C /* fprintf.c in Sources */, + C9257FBA138E1CC000B3107C /* fpurge.c in Sources */, + C9257FBB138E1CC000B3107C /* fputc.c in Sources */, + C9257FBC138E1CC000B3107C /* fputs.c in Sources */, + C9257FBD138E1CC000B3107C /* fputwc.c in Sources */, + C9257FBE138E1CC000B3107C /* fputws.c in Sources */, + C9257FBF138E1CC000B3107C /* fread.c in Sources */, + C9257FC0138E1CC000B3107C /* freopen.c in Sources */, + C9257FC1138E1CC000B3107C /* fscanf.c in Sources */, + C9257FC2138E1CC000B3107C /* fseek.c in Sources */, + C9257FC3138E1CC000B3107C /* fsetpos.c in Sources */, + C9257FC4138E1CC000B3107C /* ftell.c in Sources */, + C9257FC5138E1CC000B3107C /* funopen.c in Sources */, + C9257FC6138E1CC000B3107C /* fvwrite.c in Sources */, + C9257FC7138E1CC000B3107C /* fwalk.c in Sources */, + C9257FC8138E1CC000B3107C /* fwide.c in Sources */, + C9257FC9138E1CC000B3107C /* fwprintf.c in Sources */, + C9257FCA138E1CC000B3107C /* fwrite.c in Sources */, + C9257FCB138E1CC000B3107C /* fwscanf.c in Sources */, + C9257FCC138E1CC000B3107C /* getc.c in Sources */, + C9257FCD138E1CC000B3107C /* getchar.c in Sources */, + C9257FCE138E1CC000B3107C /* getdelim.c in Sources */, + C9257FCF138E1CC000B3107C /* getline.c in Sources */, + C9257FD0138E1CC000B3107C /* gets.c in Sources */, + C9257FD1138E1CC000B3107C /* getw.c in Sources */, + C9257FD2138E1CC000B3107C /* getwc.c in Sources */, + C9257FD3138E1CC000B3107C /* getwchar.c in Sources */, + C9257FD4138E1CC000B3107C /* makebuf.c in Sources */, + C9257FD5138E1CC000B3107C /* mktemp.c in Sources */, + C9257FD6138E1CC000B3107C /* perror.c in Sources */, + 7756338B22F3B546002F1707 /* rpmatch.c in Sources */, + C9257FD7138E1CC000B3107C /* printf-pos.c in Sources */, + C9257FD8138E1CC000B3107C /* printf.c in Sources */, + C9257FD9138E1CC000B3107C /* putc.c in Sources */, + C9257FDA138E1CC000B3107C /* putchar.c in Sources */, + C9257FDB138E1CC000B3107C /* puts.c in Sources */, + C9257FDC138E1CC000B3107C /* putw.c in Sources */, + C9257FDD138E1CC000B3107C /* putwc.c in Sources */, + C9257FDE138E1CC000B3107C /* putwchar.c in Sources */, + C9257FDF138E1CC000B3107C /* refill.c in Sources */, + C9257FE0138E1CC000B3107C /* remove.c in Sources */, + C9257FE1138E1CC000B3107C /* rewind.c in Sources */, + C9257FE2138E1CC000B3107C /* rget.c in Sources */, + C9257FE3138E1CC000B3107C /* scanf.c in Sources */, + C9257FE4138E1CC000B3107C /* setbuf.c in Sources */, + C9257FE5138E1CC000B3107C /* setbuffer.c in Sources */, + C9257FE6138E1CC000B3107C /* setvbuf.c in Sources */, + C9257FE7138E1CC000B3107C /* snprintf.c in Sources */, + C9257FE8138E1CC000B3107C /* sprintf.c in Sources */, + C9257FE9138E1CC000B3107C /* sscanf.c in Sources */, + C9257FEA138E1CC000B3107C /* stdio.c in Sources */, + C9257FEB138E1CC000B3107C /* swprintf.c in Sources */, + C9257FEC138E1CC000B3107C /* swscanf.c in Sources */, + C9257FED138E1CC000B3107C /* tempnam.c in Sources */, + C9257FEE138E1CC000B3107C /* tmpfile.c in Sources */, + C9257FEF138E1CC000B3107C /* tmpnam.c in Sources */, + C9257FF0138E1CC000B3107C /* ungetc.c in Sources */, + C9257FF1138E1CC000B3107C /* ungetwc.c in Sources */, + C9257FF2138E1CC000B3107C /* vasprintf.c in Sources */, + C9257FF3138E1CC000B3107C /* vdprintf.c in Sources */, + C9257FF4138E1CC000B3107C /* vfprintf.c in Sources */, + C9257FF5138E1CC000B3107C /* vfscanf.c in Sources */, + C9257FF6138E1CC000B3107C /* vfwprintf.c in Sources */, + C9257FF7138E1CC000B3107C /* vfwscanf.c in Sources */, + C9257FF8138E1CC000B3107C /* vprintf.c in Sources */, + C9257FF9138E1CC000B3107C /* vscanf.c in Sources */, + C9257FFA138E1CC000B3107C /* vsnprintf.c in Sources */, + C9257FFB138E1CC000B3107C /* vsprintf.c in Sources */, + C9257FFC138E1CC000B3107C /* vsscanf.c in Sources */, + C9257FFD138E1CC000B3107C /* vswprintf.c in Sources */, + C9257FFE138E1CC000B3107C /* vswscanf.c in Sources */, + C9257FFF138E1CC000B3107C /* vwprintf.c in Sources */, + C9258000138E1CC000B3107C /* vwscanf.c in Sources */, + C9258001138E1CC000B3107C /* wbuf.c in Sources */, + C9258002138E1CC000B3107C /* wprintf.c in Sources */, + C9258003138E1CC000B3107C /* wscanf.c in Sources */, + C9258004138E1CC000B3107C /* wsetup.c in Sources */, + 92888B181EA5BE8600BA923E /* open_wmemstream.c in Sources */, + C9258005138E1CC000B3107C /* asctime.c in Sources */, + C9258006138E1CC000B3107C /* difftime.c in Sources */, + C9258007138E1CC000B3107C /* ftime.c in Sources */, + C9258008138E1CC000B3107C /* localtime.c in Sources */, + C9258009138E1CC000B3107C /* strftime.c in Sources */, + C925800A138E1CC000B3107C /* strptime.c in Sources */, + C925800B138E1CC000B3107C /* time32.c in Sources */, + C925800C138E1CC000B3107C /* timelocal.c in Sources */, + C9258015138E1CD200B3107C /* memmem.c in Sources */, + C9258018138E1CD200B3107C /* rindex.c in Sources */, + C925801B138E1CD200B3107C /* strcasecmp.c in Sources */, + C925801C138E1CD200B3107C /* strcasestr.c in Sources */, + C9258020138E1CD200B3107C /* strcoll.c in Sources */, + C9258022138E1CD200B3107C /* strcspn.c in Sources */, + C9258023138E1CD200B3107C /* strdup.c in Sources */, + C9258024138E1CD200B3107C /* strerror.c in Sources */, + C9258028138E1CD200B3107C /* strmode.c in Sources */, + C925802C138E1CD200B3107C /* strndup.c in Sources */, + C925802E138E1CD200B3107C /* strnstr.c in Sources */, + C925802F138E1CD200B3107C /* strpbrk.c in Sources */, + C9258030138E1CD200B3107C /* strrchr.c in Sources */, + C9258031138E1CD200B3107C /* strsep.c in Sources */, + C9258032138E1CD200B3107C /* strsignal.c in Sources */, + C9258033138E1CD200B3107C /* strspn.c in Sources */, + C9258035138E1CD200B3107C /* strtok.c in Sources */, + C9258036138E1CD200B3107C /* strxfrm.c in Sources */, + C9258037138E1CD200B3107C /* swab.c in Sources */, + C9258038138E1CD200B3107C /* wcpcpy.c in Sources */, + C9258039138E1CD200B3107C /* wcpncpy.c in Sources */, + C925803A138E1CD200B3107C /* wcscasecmp.c in Sources */, + C925803B138E1CD200B3107C /* wcscat.c in Sources */, + C925803C138E1CD200B3107C /* wcschr.c in Sources */, + C925803D138E1CD200B3107C /* wcscmp.c in Sources */, + C925803E138E1CD200B3107C /* wcscoll.c in Sources */, + C925803F138E1CD200B3107C /* wcscpy.c in Sources */, + B17726CD185A9AD600668DCA /* wordexp.c in Sources */, + C9258040138E1CD200B3107C /* wcscspn.c in Sources */, + C9258041138E1CD200B3107C /* wcsdup.c in Sources */, + C9258042138E1CD200B3107C /* wcslcat.c in Sources */, + C9258043138E1CD200B3107C /* wcslcpy.c in Sources */, + C9258044138E1CD200B3107C /* wcslen.c in Sources */, + C9258045138E1CD200B3107C /* wcsncasecmp.c in Sources */, + C9258046138E1CD200B3107C /* wcsncat.c in Sources */, + C9258047138E1CD200B3107C /* wcsncmp.c in Sources */, + C9258048138E1CD200B3107C /* wcsncpy.c in Sources */, + C9258049138E1CD200B3107C /* wcsnlen.c in Sources */, + C925804A138E1CD200B3107C /* wcspbrk.c in Sources */, + C925804B138E1CD200B3107C /* wcsrchr.c in Sources */, + C925804C138E1CD200B3107C /* wcsspn.c in Sources */, + 92888B161EA5BE7400BA923E /* fmemopen.c in Sources */, + C925804D138E1CD200B3107C /* wcsstr.c in Sources */, + C925804E138E1CD200B3107C /* wcstok.c in Sources */, + C925804F138E1CD200B3107C /* wcswidth.c in Sources */, + C9258050138E1CD200B3107C /* wcsxfrm.c in Sources */, + C9258051138E1CD200B3107C /* wmemchr.c in Sources */, + C9258052138E1CD200B3107C /* wmemcmp.c in Sources */, + C9258053138E1CD200B3107C /* wmemcpy.c in Sources */, + C9258054138E1CD200B3107C /* wmemmove.c in Sources */, + C9258055138E1CD200B3107C /* wmemset.c in Sources */, + C9258058138E1CDD00B3107C /* regerror.c in Sources */, + C9FA32F4138E49550089A94B /* abort.c in Sources */, + C9FA32F9138E4A5C0089A94B /* utf2.c in Sources */, + C9FA3312138E4C490089A94B /* stack_protector.c in Sources */, + C9FA3315138E4D040089A94B /* a64l.c in Sources */, + C9FA3316138E4D040089A94B /* _Exit_.c in Sources */, + C9FA3317138E4D040089A94B /* abs.c in Sources */, + C9FA3318138E4D040089A94B /* atexit.c in Sources */, + C9FA3319138E4D040089A94B /* atof.c in Sources */, + C9FA331A138E4D040089A94B /* atoi.c in Sources */, + C9FA331B138E4D040089A94B /* atol.c in Sources */, + C9FA331C138E4D040089A94B /* atoll.c in Sources */, + C9FA331D138E4D040089A94B /* bsearch.c in Sources */, + C9FA331E138E4D040089A94B /* div.c in Sources */, + C9FA331F138E4D040089A94B /* exit.c in Sources */, + C9FA3320138E4D040089A94B /* getenv.c in Sources */, + C9FA3321138E4D040089A94B /* getopt.c in Sources */, + C9FA3322138E4D040089A94B /* getopt_long.c in Sources */, + C9FA3323138E4D040089A94B /* getsubopt.c in Sources */, + C9FA3324138E4D040089A94B /* hcreate.c in Sources */, + C9FA3325138E4D040089A94B /* heapsort.c in Sources */, + C9FA3326138E4D040089A94B /* imaxabs.c in Sources */, + C9FA3327138E4D040089A94B /* imaxdiv.c in Sources */, + C9FA3328138E4D040089A94B /* insque.c in Sources */, + C9FA3329138E4D040089A94B /* labs.c in Sources */, + C9FA332A138E4D040089A94B /* ldiv.c in Sources */, + C9FA332B138E4D040089A94B /* llabs.c in Sources */, + C9FA332C138E4D040089A94B /* lldiv.c in Sources */, + C9FA332D138E4D040089A94B /* lsearch.c in Sources */, + C9FA332E138E4D040089A94B /* merge.c in Sources */, + C9FA332F138E4D040089A94B /* putenv.c in Sources */, + C9FA3330138E4D040089A94B /* qsort.c in Sources */, + C9FA3331138E4D040089A94B /* qsort_r.c in Sources */, + C9FA3332138E4D040089A94B /* radixsort.c in Sources */, + C9FA3333138E4D040089A94B /* rand.c in Sources */, + C9FA3334138E4D040089A94B /* random.c in Sources */, + C9FA3335138E4D040089A94B /* reallocf.c in Sources */, + C9FA3336138E4D040089A94B /* realpath.c in Sources */, + C9FA3337138E4D040089A94B /* remque.c in Sources */, + C9FA3338138E4D040089A94B /* setenv.c in Sources */, + C9FA3339138E4D040089A94B /* strhash.c in Sources */, + C9FA333A138E4D040089A94B /* strtoimax.c in Sources */, + C9FA333B138E4D040089A94B /* strtol.c in Sources */, + C9FA333C138E4D040089A94B /* strtoll.c in Sources */, + C9FA333D138E4D040089A94B /* strtoq.c in Sources */, + C9FA333E138E4D040089A94B /* strtoul.c in Sources */, + C9FA333F138E4D040089A94B /* strtoull.c in Sources */, + C9FA3340138E4D040089A94B /* strtoumax.c in Sources */, + C9FA3341138E4D040089A94B /* strtouq.c in Sources */, + C9FA3342138E4D040089A94B /* system.c in Sources */, + C9FA3343138E4D040089A94B /* tdelete.c in Sources */, + C9FA3344138E4D040089A94B /* tfind.c in Sources */, + C9FA3345138E4D040089A94B /* tsearch.c in Sources */, + C9FA3346138E4D040089A94B /* twalk.c in Sources */, + C9FA3347138E4D040089A94B /* grantpt.c in Sources */, + C9FA3348138E4D040089A94B /* l64a.c in Sources */, + C9FA334A138E4D040089A94B /* ecvt.c in Sources */, + C9FA334B138E4D040089A94B /* gcvt.c in Sources */, + C9FA334C138E4D040089A94B /* qsort_b.c in Sources */, + C9D94359138EC0C600FB7ACC /* heapsort_b.c in Sources */, + C9D9435A138EC0C600FB7ACC /* heapsort_r.c in Sources */, + C9421021138F2602004BA536 /* _ldtoa.c in Sources */, + C9421022138F2661004BA536 /* machdep_ldisd.c in Sources */, + C9421023138F2661004BA536 /* machdep_ldisdd.c in Sources */, + C9421024138F2661004BA536 /* machdep_ldisQ.c in Sources */, + 922D0C0A21BFA1530072834D /* timespec_get.c in Sources */, + C9421025138F2661004BA536 /* machdep_ldisx.c in Sources */, + C95B7ED7138F3BEA004311DA /* rune.c in Sources */, + C9EB2FC1138F6BB00075BB52 /* merge_b.c in Sources */, + C9EB2FC4138F6C5C0075BB52 /* psort.c in Sources */, + C9EB2FC7138F6CE10075BB52 /* psort_b.c in Sources */, + C9EB2FC8138F6CE10075BB52 /* psort_r.c in Sources */, + C9EB350F138F769B0075BB52 /* scandir_b.c in Sources */, + C9EB3550138F7EA50075BB52 /* getmntinfo64.c in Sources */, + FC2ED612157D4BE80098EC69 /* inet_ntop.c in Sources */, + FC2ED61B157D4BE80098EC69 /* inet_pton.c in Sources */, + B12613F8158818EC0077E3CC /* xprintf_errno.c in Sources */, + B12613F9158818EC0077E3CC /* xprintf_float.c in Sources */, + B12613FA158818EC0077E3CC /* xprintf_hexdump.c in Sources */, + B12613FB158818EC0077E3CC /* xprintf_int.c in Sources */, + B12613FC158818EC0077E3CC /* xprintf_quote.c in Sources */, + B12613FD158818EC0077E3CC /* xprintf_str.c in Sources */, + B12613FE158818EC0077E3CC /* xprintf_time.c in Sources */, + B12613FF158818EC0077E3CC /* xprintf_vis.c in Sources */, + B1261400158818EC0077E3CC /* xprintf.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9258094138E2D3100B3107C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C92580CC138E2D3100B3107C /* utmpx.c in Sources */, + C9FA334D138E4D0C0089A94B /* strfmon.c in Sources */, + 3F18DE21162A732C008B15AC /* memset_s.c in Sources */, + 3F267F38163FC8880089A0A6 /* rb.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C942103113900C8A004BA536 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C94213361390396E004BA536 /* mcount.s in Sources */, + C94212E413901595004BA536 /* mcount.s in Sources */, + C942103913900C8A004BA536 /* creat.c in Sources */, + C942103A13900C8A004BA536 /* gethostid.c in Sources */, + C942103B13900C8A004BA536 /* getwd.c in Sources */, + C942103C13900C8A004BA536 /* killpg.c in Sources */, + C942103D13900C8A004BA536 /* sethostid.c in Sources */, + C942103E13900C8A004BA536 /* setpgrp.c in Sources */, + C942103F13900C8A004BA536 /* setrgid.c in Sources */, + C942104013900C8A004BA536 /* setruid.c in Sources */, + C942104113900C8A004BA536 /* setregid.c in Sources */, + C942104213900C8A004BA536 /* setreuid.c in Sources */, + C942104313900C8A004BA536 /* sigaltstk.c in Sources */, + C942104413900C8A004BA536 /* sigcompat.c in Sources */, + C942104613900C8A004BA536 /* kvm.c in Sources */, + C942104A13900C8A004BA536 /* forceLibcToBuild.c in Sources */, + C942104B13900C8A004BA536 /* bt_close.c in Sources */, + C942104C13900C8A004BA536 /* bt_conv.c in Sources */, + C942104D13900C8A004BA536 /* bt_debug.c in Sources */, + C942104E13900C8A004BA536 /* bt_delete.c in Sources */, + C942104F13900C8A004BA536 /* bt_get.c in Sources */, + C942105013900C8A004BA536 /* bt_open.c in Sources */, + C942105113900C8A004BA536 /* bt_overflow.c in Sources */, + C942105213900C8A004BA536 /* bt_page.c in Sources */, + C942105313900C8A004BA536 /* bt_put.c in Sources */, + C942105413900C8A004BA536 /* bt_search.c in Sources */, + C942105513900C8A004BA536 /* bt_seq.c in Sources */, + C942105613900C8A004BA536 /* bt_split.c in Sources */, + C942105713900C8A004BA536 /* bt_utils.c in Sources */, + C942105813900C8A004BA536 /* db.c in Sources */, + C942105913900C8A004BA536 /* hash.c in Sources */, + C942105A13900C8A004BA536 /* hash_bigkey.c in Sources */, + C942105B13900C8A004BA536 /* hash_buf.c in Sources */, + C942105C13900C8A004BA536 /* hash_func.c in Sources */, + C942105D13900C8A004BA536 /* hash_log2.c in Sources */, + C942105E13900C8A004BA536 /* hash_page.c in Sources */, + C942105F13900C8A004BA536 /* ndbm.c in Sources */, + C942106013900C8A004BA536 /* mpool.c in Sources */, + C942106113900C8A004BA536 /* rec_close.c in Sources */, + C942106213900C8A004BA536 /* rec_delete.c in Sources */, + C942106313900C8A004BA536 /* rec_get.c in Sources */, + C942106413900C8A004BA536 /* rec_open.c in Sources */, + C942106513900C8A004BA536 /* rec_put.c in Sources */, + C942106613900C8A004BA536 /* rec_search.c in Sources */, + C942106713900C8A004BA536 /* rec_seq.c in Sources */, + C942106813900C8A004BA536 /* rec_utils.c in Sources */, + C942106913900C8A004BA536 /* brk.c in Sources */, + C942106A13900C8A004BA536 /* bsd_signal.c in Sources */, + C942106B13900C8A004BA536 /* lchflags.c in Sources */, + C942106C13900C8A004BA536 /* lchmod.c in Sources */, + C942106D13900C8A004BA536 /* lutimes.c in Sources */, + C942106E13900C8A004BA536 /* statvfs.c in Sources */, + C942106F13900C8A004BA536 /* tcgetsid.c in Sources */, + C942107013900C8A004BA536 /* _ldbl_util.c in Sources */, + C942107113900C8A004BA536 /* _hdtoa.c in Sources */, + C942107213900C8A004BA536 /* _ldtoa.c in Sources */, + C942107313900C8A004BA536 /* gdtoa-dmisc.c in Sources */, + C942107413900C8A004BA536 /* gdtoa-dtoa.c in Sources */, + C942107513900C8A004BA536 /* gdtoa-gdtoa.c in Sources */, + C942107613900C8A004BA536 /* gdtoa-gethex.c in Sources */, + C942107713900C8A004BA536 /* gdtoa-gmisc.c in Sources */, + C942107813900C8A004BA536 /* gdtoa-hd_init.c in Sources */, + C942107913900C8A004BA536 /* gdtoa-hexnan.c in Sources */, + C942107A13900C8A004BA536 /* gdtoa-misc.c in Sources */, + C942107B13900C8A004BA536 /* gdtoa-smisc.c in Sources */, + C942107C13900C8A004BA536 /* gdtoa-strtod.c in Sources */, + C942107D13900C8A004BA536 /* gdtoa-strtodg.c in Sources */, + C942107E13900C8A004BA536 /* gdtoa-strtof.c in Sources */, + C942107F13900C8A004BA536 /* gdtoa-strtoIg.c in Sources */, + C942108013900C8A004BA536 /* gdtoa-strtopdd.c in Sources */, + C942108113900C8A004BA536 /* gdtoa-strtopx.c in Sources */, + C942108213900C8A004BA536 /* gdtoa-strtord.c in Sources */, + C942108313900C8A004BA536 /* gdtoa-sum.c in Sources */, + C942108413900C8A004BA536 /* gdtoa-ulp.c in Sources */, + C942108513900C8A004BA536 /* glue.c in Sources */, + C942108613900C8A004BA536 /* machdep_ldisd.c in Sources */, + C942108713900C8A004BA536 /* machdep_ldisdd.c in Sources */, + C942108813900C8A004BA536 /* machdep_ldisQ.c in Sources */, + C942108913900C8A004BA536 /* machdep_ldisx.c in Sources */, + C942109313900C8A004BA536 /* authentication.c in Sources */, + C942109413900C8A004BA536 /* backtrace.c in Sources */, + C942109613900C8A004BA536 /* confstr.c in Sources */, + C942109713900C8A004BA536 /* crypt.c in Sources */, + C942109813900C8A004BA536 /* devname.c in Sources */, + C942109913900C8A004BA536 /* disklabel.c in Sources */, + C942109A13900C8A004BA536 /* errlst.c in Sources */, + C942109B13900C8A004BA536 /* filesec.c in Sources */, + C942109C13900C8A004BA536 /* _rand48.c in Sources */, + C942109D13900C8A004BA536 /* alarm.c in Sources */, + C942109E13900C8A004BA536 /* arc4random.c in Sources */, + C942109F13900C8A004BA536 /* assert.c in Sources */, + C94210A013900C8A004BA536 /* basename.c in Sources */, + C94210A113900C8A004BA536 /* clock.c in Sources */, + C94210A213900C8A004BA536 /* closedir.c in Sources */, + C94210A313900C8A004BA536 /* ctermid.c in Sources */, + C94210A413900C8A004BA536 /* daemon.c in Sources */, + C94210A513900C8A004BA536 /* dirname.c in Sources */, + 3FD14574171D42B300B7BAF5 /* bcopy.c in Sources */, + C94210A613900C8A004BA536 /* drand48.c in Sources */, + C94210A713900C8A004BA536 /* erand48.c in Sources */, + C94210A813900C8A004BA536 /* err.c in Sources */, + C94210A913900C8A004BA536 /* exec.c in Sources */, + C94210AA13900C8A004BA536 /* fmtcheck.c in Sources */, + C94210AB13900C8A004BA536 /* fmtmsg.c in Sources */, + C94210AC13900C8A004BA536 /* fnmatch.c in Sources */, + C94210AD13900C8A004BA536 /* ftok.c in Sources */, + C94210AE13900C8A004BA536 /* getbsize.c in Sources */, + C94210AF13900C8A004BA536 /* getcap.c in Sources */, + C94210B013900C8A004BA536 /* getcwd.c in Sources */, + C94210B113900C8A004BA536 /* gethostname.c in Sources */, + C94210B213900C8A004BA536 /* getlogin.c in Sources */, + C94210B313900C8A004BA536 /* getmntinfo.c in Sources */, + C94210B413900C8A004BA536 /* getpagesize.c in Sources */, + C94210B513900C8A004BA536 /* getpeereid.c in Sources */, + C94210B613900C8A004BA536 /* getprogname.c in Sources */, + C94210B713900C8A004BA536 /* glob.c in Sources */, + C94210B813900C8A004BA536 /* isatty.c in Sources */, + C94210B913900C8A004BA536 /* jrand48.c in Sources */, + C94210BA13900C8A004BA536 /* lcong48.c in Sources */, + C94210BB13900C8A004BA536 /* lockf.c in Sources */, + C94210BC13900C8A004BA536 /* lrand48.c in Sources */, + C94210BD13900C8A004BA536 /* mrand48.c in Sources */, + C94210BE13900C8A004BA536 /* nice.c in Sources */, + C94210BF13900C8A004BA536 /* nrand48.c in Sources */, + C94210C013900C8A004BA536 /* opendir.c in Sources */, + C94210C113900C8A004BA536 /* pause.c in Sources */, + C94210C213900C8A004BA536 /* popen.c in Sources */, + C94210C413900C8A004BA536 /* psignal.c in Sources */, + C94210C513900C8A004BA536 /* raise.c in Sources */, + C94210C613900C8A004BA536 /* readdir.c in Sources */, + C94210C713900C8A004BA536 /* readpassphrase.c in Sources */, + C94210C813900C8A004BA536 /* rewinddir.c in Sources */, + C94210C913900C8A004BA536 /* scandir.c in Sources */, + C94210CA13900C8A004BA536 /* seed48.c in Sources */, + C94210CB13900C8A004BA536 /* seekdir.c in Sources */, + C94210CC13900C8A004BA536 /* sethostname.c in Sources */, + C94210CD13900C8A004BA536 /* setmode.c in Sources */, + C94210CE13900C8A004BA536 /* setprogname.c in Sources */, + C94210CF13900C8A004BA536 /* siginterrupt.c in Sources */, + C94210D013900C8A004BA536 /* siglist.c in Sources */, + C94210D113900C8A004BA536 /* signal.c in Sources */, + C94210D213900C8A004BA536 /* sleep.c in Sources */, + C94210D313900C8A004BA536 /* srand48.c in Sources */, + C94210D413900C8A004BA536 /* stringlist.c in Sources */, + 922D0C0B21BFA19A0072834D /* timespec_get.c in Sources */, + C94210D513900C8A004BA536 /* sysconf.c in Sources */, + C94210D613900C8A004BA536 /* sysctl.c in Sources */, + C94210D713900C8A004BA536 /* sysctlbyname.c in Sources */, + C94210D813900C8A004BA536 /* sysctlnametomib.c in Sources */, + C94210D913900C8A004BA536 /* telldir.c in Sources */, + C94210DA13900C8A004BA536 /* termios.c in Sources */, + C94210DB13900C8A004BA536 /* time.c in Sources */, + C94210DC13900C8A004BA536 /* times.c in Sources */, + C94210DD13900C8A004BA536 /* timezone.c in Sources */, + C94210DE13900C8A004BA536 /* ttyname.c in Sources */, + C94210DF13900C8A004BA536 /* ttyslot.c in Sources */, + C94210E013900C8A004BA536 /* ualarm.c in Sources */, + C94210E113900C8A004BA536 /* ulimit.c in Sources */, + C94210E213900C8A004BA536 /* unvis.c in Sources */, + C94210E313900C8A004BA536 /* usleep.c in Sources */, + C94210E413900C8A004BA536 /* utime.c in Sources */, + C94210E513900C8A004BA536 /* vis.c in Sources */, + C94210E613900C8A004BA536 /* wait.c in Sources */, + C94210E713900C8A004BA536 /* wait3.c in Sources */, + C94210E813900C8A004BA536 /* waitpid.c in Sources */, + C94210E913900C8A004BA536 /* fts.c in Sources */, + C94210EA13900C8A004BA536 /* get_compat.c in Sources */, + C94210EB13900C8A004BA536 /* getloadavg.c in Sources */, + C94210EC13900C8A004BA536 /* getttyent.c in Sources */, + C94210ED13900C8A004BA536 /* getusershell.c in Sources */, + C94210EE13900C8A004BA536 /* getvfsbyname.c in Sources */, + C94210F313900C8A004BA536 /* nanosleep.c in Sources */, + C94210F413900C8A004BA536 /* utmpx.c in Sources */, + 147CDFD91B7C232100831EC6 /* clock_gettime.c in Sources */, + C94210F513900C8A004BA536 /* nftw.c in Sources */, + C94210F613900C8A004BA536 /* nlist.c in Sources */, + C94210F813900C8A004BA536 /* oldsyslog.c in Sources */, + C94210FB13900C8A004BA536 /* setlogin.c in Sources */, + C94210FC13900C8A004BA536 /* sigsetops.c in Sources */, + C94210FF13900C8A004BA536 /* strtofflags.c in Sources */, + C942110113900C8A004BA536 /* thread_stack_pcs.c in Sources */, + C942110213900C8A004BA536 /* uname.c in Sources */, + C942110313900C8A004BA536 /* utmpx-darwin.c in Sources */, + C942110413900C8A004BA536 /* wordexp.c in Sources */, + C942110613900C8A004BA536 /* gmon.c in Sources */, + C942112613900C8A004BA536 /* ascii.c in Sources */, + C942112713900C8A004BA536 /* big5.c in Sources */, + C942112813900C8A004BA536 /* btowc.c in Sources */, + C942112913900C8A004BA536 /* collate.c in Sources */, + C942112A13900C8A004BA536 /* collcmp.c in Sources */, + C942112B13900C8A004BA536 /* euc.c in Sources */, + C942112C13900C8A004BA536 /* fix_grouping.c in Sources */, + C942112D13900C8A004BA536 /* gb18030.c in Sources */, + C942112E13900C8A004BA536 /* gb2312.c in Sources */, + C942112F13900C8A004BA536 /* gbk.c in Sources */, + C942113013900C8A004BA536 /* ldpart.c in Sources */, + C942113113900C8A004BA536 /* lmessages.c in Sources */, + C942113213900C8A004BA536 /* lmonetary.c in Sources */, + C942113313900C8A004BA536 /* lnumeric.c in Sources */, + C942113413900C8A004BA536 /* localeconv.c in Sources */, + C942113513900C8A004BA536 /* mblen.c in Sources */, + C942113613900C8A004BA536 /* mbrlen.c in Sources */, + C942113713900C8A004BA536 /* mbrtowc.c in Sources */, + C942113813900C8A004BA536 /* mbsinit.c in Sources */, + C942113913900C8A004BA536 /* mbsnrtowcs.c in Sources */, + C942113A13900C8A004BA536 /* mbsrtowcs.c in Sources */, + C942113B13900C8A004BA536 /* mbstowcs.c in Sources */, + C942113C13900C8A004BA536 /* mbtowc.c in Sources */, + C942113D13900C8A004BA536 /* mskanji.c in Sources */, + C942113E13900C8A004BA536 /* nextwctype.c in Sources */, + C942113F13900C8A004BA536 /* nl_langinfo.c in Sources */, + C942114013900C8A004BA536 /* nomacros.c in Sources */, + C942114113900C8A004BA536 /* none.c in Sources */, + C942114213900C8A004BA536 /* rune.c in Sources */, + C942114313900C8A004BA536 /* runetype.c in Sources */, + C942114413900C8A004BA536 /* setlocale.c in Sources */, + C942114513900C8A004BA536 /* setrunelocale.c in Sources */, + C942114613900C8A004BA536 /* table.c in Sources */, + C942114713900C8A004BA536 /* tolower.c in Sources */, + C942114813900C8A004BA536 /* toupper.c in Sources */, + C942114913900C8A004BA536 /* utf2.c in Sources */, + C942114A13900C8A004BA536 /* utf8.c in Sources */, + C942114B13900C8A004BA536 /* wcrtomb.c in Sources */, + C942114C13900C8A004BA536 /* wcsftime.c in Sources */, + C942114D13900C8A004BA536 /* wcsnrtombs.c in Sources */, + C942114E13900C8A004BA536 /* wcsrtombs.c in Sources */, + C942114F13900C8A004BA536 /* wcstod.c in Sources */, + C942115013900C8A004BA536 /* wcstof.c in Sources */, + C942115113900C8A004BA536 /* wcstoimax.c in Sources */, + C942115213900C8A004BA536 /* wcstol.c in Sources */, + C942115313900C8A004BA536 /* wcstold.c in Sources */, + C942115413900C8A004BA536 /* wcstoll.c in Sources */, + C942115513900C8A004BA536 /* wcstombs.c in Sources */, + C942115613900C8A004BA536 /* wcstoul.c in Sources */, + C942115713900C8A004BA536 /* wcstoull.c in Sources */, + C942115813900C8A004BA536 /* wcstoumax.c in Sources */, + C942115913900C8A004BA536 /* wctob.c in Sources */, + C942115A13900C8A004BA536 /* wctomb.c in Sources */, + C942115B13900C8A004BA536 /* wctrans.c in Sources */, + C942115C13900C8A004BA536 /* wctype.c in Sources */, + C942115D13900C8A004BA536 /* wcwidth.c in Sources */, + C942115E13900C8A004BA536 /* frune.c in Sources */, + C942115F13900C8A004BA536 /* isctype.c in Sources */, + C942116013900C8A004BA536 /* iswctype.c in Sources */, + C942116113900C8A004BA536 /* lconv.c in Sources */, + C942116213900C8A004BA536 /* mbrune.c in Sources */, + C942116313900C8A004BA536 /* runedepreciated.c in Sources */, + C942116413900C8A004BA536 /* setinvalidrune.c in Sources */, + C942116513900C8A004BA536 /* xlocale.c in Sources */, + C942116613900C8A004BA536 /* addr2ascii.c in Sources */, + C942116713900C8A004BA536 /* ascii2addr.c in Sources */, + C942116813900C8A004BA536 /* inet_addr.c in Sources */, + C942116913900C8A004BA536 /* inet_lnaof.c in Sources */, + 2DF67CDE184F9CBE00B83A3D /* debug_private.c in Sources */, + C942116A13900C8A004BA536 /* inet_makeaddr.c in Sources */, + C942116B13900C8A004BA536 /* inet_net_ntop.c in Sources */, + C942116C13900C8A004BA536 /* inet_net_pton.c in Sources */, + C942116D13900C8A004BA536 /* inet_neta.c in Sources */, + C942116E13900C8A004BA536 /* inet_netof.c in Sources */, + C942116F13900C8A004BA536 /* inet_network.c in Sources */, + C942117013900C8A004BA536 /* inet_ntoa.c in Sources */, + C942117113900C8A004BA536 /* linkaddr.c in Sources */, + C942117213900C8A004BA536 /* nsap_addr.c in Sources */, + C942117313900C8A004BA536 /* recv.c in Sources */, + C942117413900C8A004BA536 /* send.c in Sources */, + C942117513900C8A004BA536 /* sockatmark.c in Sources */, + C942117613900C8A004BA536 /* sourcefilter.c in Sources */, + C942117713900C8A004BA536 /* msgcat.c in Sources */, + C942117813900C8A004BA536 /* acl.c in Sources */, + C942117913900C8A004BA536 /* acl_entry.c in Sources */, + C942117A13900C8A004BA536 /* acl_file.c in Sources */, + C942117B13900C8A004BA536 /* acl_flag.c in Sources */, + C942117C13900C8A004BA536 /* acl_perm.c in Sources */, + C942117D13900C8A004BA536 /* acl_translate.c in Sources */, + C942119113900C8A004BA536 /* regerror.c in Sources */, + C94211A213900C8A004BA536 /* _flock_stub.c in Sources */, + C94211A313900C8A004BA536 /* asprintf.c in Sources */, + C94211A413900C8A004BA536 /* clrerr.c in Sources */, + C94211A513900C8A004BA536 /* dprintf.c in Sources */, + C94211A613900C8A004BA536 /* fclose.c in Sources */, + C94211A713900C8A004BA536 /* fdopen.c in Sources */, + C94211A813900C8A004BA536 /* feof.c in Sources */, + C94211A913900C8A004BA536 /* ferror.c in Sources */, + C94211AA13900C8A004BA536 /* fflush.c in Sources */, + C94211AB13900C8A004BA536 /* fgetc.c in Sources */, + C94211AC13900C8A004BA536 /* fgetln.c in Sources */, + C94211AD13900C8A004BA536 /* fgetpos.c in Sources */, + C94211AE13900C8A004BA536 /* fgets.c in Sources */, + C94211AF13900C8A004BA536 /* fgetwc.c in Sources */, + C94211B013900C8A004BA536 /* fgetwln.c in Sources */, + C94211B113900C8A004BA536 /* fgetws.c in Sources */, + C94211B213900C8A004BA536 /* fileno.c in Sources */, + C94211B313900C8A004BA536 /* findfp.c in Sources */, + C94211B413900C8A004BA536 /* flags.c in Sources */, + C94211B513900C8A004BA536 /* fopen.c in Sources */, + C94211B613900C8A004BA536 /* fprintf.c in Sources */, + C94211B713900C8A004BA536 /* fpurge.c in Sources */, + C94211B813900C8A004BA536 /* fputc.c in Sources */, + C94211B913900C8A004BA536 /* fputs.c in Sources */, + C94211BA13900C8A004BA536 /* fputwc.c in Sources */, + C94211BB13900C8A004BA536 /* fputws.c in Sources */, + C94211BC13900C8A004BA536 /* fread.c in Sources */, + C94211BD13900C8A004BA536 /* freopen.c in Sources */, + C94211BE13900C8A004BA536 /* fscanf.c in Sources */, + C94211BF13900C8A004BA536 /* fseek.c in Sources */, + C94211C013900C8A004BA536 /* fsetpos.c in Sources */, + C94211C113900C8A004BA536 /* ftell.c in Sources */, + C94211C213900C8A004BA536 /* funopen.c in Sources */, + C94211C313900C8A004BA536 /* fvwrite.c in Sources */, + C94211C413900C8A004BA536 /* fwalk.c in Sources */, + C94211C513900C8A004BA536 /* fwide.c in Sources */, + C94211C613900C8A004BA536 /* fwprintf.c in Sources */, + C94211C713900C8A004BA536 /* fwrite.c in Sources */, + C94211C813900C8A004BA536 /* fwscanf.c in Sources */, + C94211C913900C8A004BA536 /* getc.c in Sources */, + C94211CA13900C8A004BA536 /* getchar.c in Sources */, + C94211CB13900C8A004BA536 /* getdelim.c in Sources */, + C94211CC13900C8A004BA536 /* getline.c in Sources */, + 928BD1001D76072200EC01FC /* timingsafe_bcmp.c in Sources */, + C94211CD13900C8A004BA536 /* gets.c in Sources */, + C94211CE13900C8A004BA536 /* getw.c in Sources */, + C94211CF13900C8A004BA536 /* getwc.c in Sources */, + C94211D013900C8A004BA536 /* getwchar.c in Sources */, + C94211D113900C8A004BA536 /* makebuf.c in Sources */, + C94211D213900C8A004BA536 /* mktemp.c in Sources */, + C94211D313900C8A004BA536 /* perror.c in Sources */, + C94211D413900C8A004BA536 /* printf-pos.c in Sources */, + C94211D513900C8A004BA536 /* printf.c in Sources */, + C94211D613900C8A004BA536 /* putc.c in Sources */, + C94211D713900C8A004BA536 /* putchar.c in Sources */, + C94211D813900C8A004BA536 /* puts.c in Sources */, + C94211D913900C8A004BA536 /* putw.c in Sources */, + C94211DA13900C8A004BA536 /* putwc.c in Sources */, + C94211DB13900C8A004BA536 /* putwchar.c in Sources */, + C94211DC13900C8A004BA536 /* refill.c in Sources */, + C94211DD13900C8A004BA536 /* remove.c in Sources */, + C94211DE13900C8A004BA536 /* rewind.c in Sources */, + C94211DF13900C8A004BA536 /* rget.c in Sources */, + C94211E013900C8A004BA536 /* scanf.c in Sources */, + C94211E113900C8A004BA536 /* setbuf.c in Sources */, + C94211E213900C8A004BA536 /* setbuffer.c in Sources */, + C94211E313900C8A004BA536 /* setvbuf.c in Sources */, + C94211E413900C8A004BA536 /* snprintf.c in Sources */, + C94211E513900C8A004BA536 /* sprintf.c in Sources */, + C94211E613900C8A004BA536 /* sscanf.c in Sources */, + C94211E713900C8A004BA536 /* stdio.c in Sources */, + C94211E813900C8A004BA536 /* swprintf.c in Sources */, + C94211E913900C8A004BA536 /* swscanf.c in Sources */, + C94211EA13900C8A004BA536 /* tempnam.c in Sources */, + C94211EB13900C8A004BA536 /* tmpfile.c in Sources */, + C94211EC13900C8A004BA536 /* tmpnam.c in Sources */, + C94211ED13900C8A004BA536 /* ungetc.c in Sources */, + C94211EE13900C8A004BA536 /* ungetwc.c in Sources */, + C94211EF13900C8A004BA536 /* vasprintf.c in Sources */, + C94211F013900C8A004BA536 /* vdprintf.c in Sources */, + C94211F113900C8A004BA536 /* vfprintf.c in Sources */, + C94211F213900C8A004BA536 /* vfscanf.c in Sources */, + C94211F313900C8A004BA536 /* vfwprintf.c in Sources */, + C94211F413900C8A004BA536 /* vfwscanf.c in Sources */, + C94211F513900C8A004BA536 /* vprintf.c in Sources */, + C94211F613900C8A004BA536 /* vscanf.c in Sources */, + C94211F713900C8A004BA536 /* vsnprintf.c in Sources */, + C94211F813900C8A004BA536 /* vsprintf.c in Sources */, + C94211F913900C8A004BA536 /* vsscanf.c in Sources */, + C94211FA13900C8A004BA536 /* vswprintf.c in Sources */, + C94211FB13900C8A004BA536 /* vswscanf.c in Sources */, + C94211FC13900C8A004BA536 /* vwprintf.c in Sources */, + C94211FD13900C8A004BA536 /* vwscanf.c in Sources */, + C94211FE13900C8A004BA536 /* wbuf.c in Sources */, + C94211FF13900C8A004BA536 /* wprintf.c in Sources */, + C942120013900C8A004BA536 /* wscanf.c in Sources */, + C942120113900C8A004BA536 /* wsetup.c in Sources */, + C942120213900C8A004BA536 /* a64l.c in Sources */, + C942120313900C8A004BA536 /* _Exit_.c in Sources */, + C942120413900C8A004BA536 /* abort.c in Sources */, + C942120513900C8A004BA536 /* abs.c in Sources */, + C942120613900C8A004BA536 /* atexit.c in Sources */, + C942120713900C8A004BA536 /* atof.c in Sources */, + C942120813900C8A004BA536 /* atoi.c in Sources */, + C942120913900C8A004BA536 /* atol.c in Sources */, + C942120A13900C8A004BA536 /* atoll.c in Sources */, + C942120B13900C8A004BA536 /* bsearch.c in Sources */, + C942120C13900C8A004BA536 /* div.c in Sources */, + C942120D13900C8A004BA536 /* exit.c in Sources */, + C942120E13900C8A004BA536 /* getenv.c in Sources */, + C942120F13900C8A004BA536 /* getopt.c in Sources */, + C942121013900C8A004BA536 /* getopt_long.c in Sources */, + C942121113900C8A004BA536 /* getsubopt.c in Sources */, + C942121213900C8A004BA536 /* hcreate.c in Sources */, + C942121313900C8A004BA536 /* heapsort.c in Sources */, + C942121413900C8A004BA536 /* heapsort_b.c in Sources */, + C942121513900C8A004BA536 /* heapsort_r.c in Sources */, + C942121613900C8A004BA536 /* imaxabs.c in Sources */, + C942121713900C8A004BA536 /* imaxdiv.c in Sources */, + C942121813900C8A004BA536 /* insque.c in Sources */, + C942121913900C8A004BA536 /* labs.c in Sources */, + C942121A13900C8A004BA536 /* ldiv.c in Sources */, + C942121B13900C8A004BA536 /* llabs.c in Sources */, + C942121C13900C8A004BA536 /* lldiv.c in Sources */, + C942121D13900C8A004BA536 /* lsearch.c in Sources */, + C942121E13900C8A004BA536 /* merge.c in Sources */, + C942121F13900C8A004BA536 /* putenv.c in Sources */, + C942122013900C8A004BA536 /* qsort.c in Sources */, + C942122113900C8A004BA536 /* qsort_r.c in Sources */, + C942122213900C8A004BA536 /* radixsort.c in Sources */, + C942122313900C8A004BA536 /* rand.c in Sources */, + C942122413900C8A004BA536 /* random.c in Sources */, + C942122513900C8A004BA536 /* reallocf.c in Sources */, + C942122613900C8A004BA536 /* realpath.c in Sources */, + C942122713900C8A004BA536 /* remque.c in Sources */, + C942122813900C8A004BA536 /* setenv.c in Sources */, + C942122913900C8A004BA536 /* strhash.c in Sources */, + C942122A13900C8A004BA536 /* strtoimax.c in Sources */, + C942122B13900C8A004BA536 /* strtol.c in Sources */, + C942122C13900C8A004BA536 /* strtoll.c in Sources */, + C942122D13900C8A004BA536 /* strtoq.c in Sources */, + C942122E13900C8A004BA536 /* strtoul.c in Sources */, + C942122F13900C8A004BA536 /* strtoull.c in Sources */, + C942123013900C8A004BA536 /* strtoumax.c in Sources */, + C942123113900C8A004BA536 /* strtouq.c in Sources */, + C942123213900C8A004BA536 /* system.c in Sources */, + C942123313900C8A004BA536 /* tdelete.c in Sources */, + C942123413900C8A004BA536 /* tfind.c in Sources */, + C942123513900C8A004BA536 /* tsearch.c in Sources */, + C942123613900C8A004BA536 /* twalk.c in Sources */, + C942123713900C8A004BA536 /* grantpt.c in Sources */, + C942123813900C8A004BA536 /* l64a.c in Sources */, + C942123913900C8A004BA536 /* strfmon.c in Sources */, + C942123A13900C8A004BA536 /* ecvt.c in Sources */, + C942123B13900C8A004BA536 /* gcvt.c in Sources */, + C942123C13900C8A004BA536 /* qsort_b.c in Sources */, + C942123D13900C8A004BA536 /* asctime.c in Sources */, + C942123E13900C8A004BA536 /* difftime.c in Sources */, + C942123F13900C8A004BA536 /* ftime.c in Sources */, + C942124013900C8A004BA536 /* localtime.c in Sources */, + C942124113900C8A004BA536 /* strftime.c in Sources */, + C942124213900C8A004BA536 /* strptime.c in Sources */, + C942124313900C8A004BA536 /* time32.c in Sources */, + C942124413900C8A004BA536 /* timelocal.c in Sources */, + C942124513900C8A004BA536 /* getdate.c in Sources */, + C942124613900C8A004BA536 /* timezone_unix03.c in Sources */, + C942124F13900C8A004BA536 /* memmem.c in Sources */, + C942125213900C8A004BA536 /* rindex.c in Sources */, + C942125513900C8A004BA536 /* strcasecmp.c in Sources */, + C942125613900C8A004BA536 /* strcasestr.c in Sources */, + C942125A13900C8A004BA536 /* strcoll.c in Sources */, + C942125C13900C8A004BA536 /* strcspn.c in Sources */, + C942125D13900C8A004BA536 /* strdup.c in Sources */, + C942125E13900C8A004BA536 /* strerror.c in Sources */, + C942126213900C8A004BA536 /* strmode.c in Sources */, + C942126613900C8A004BA536 /* strndup.c in Sources */, + C942126813900C8A004BA536 /* strnstr.c in Sources */, + C942126913900C8A004BA536 /* strpbrk.c in Sources */, + C942126A13900C8A004BA536 /* strrchr.c in Sources */, + C942126B13900C8A004BA536 /* strsep.c in Sources */, + C942126C13900C8A004BA536 /* strsignal.c in Sources */, + C942126D13900C8A004BA536 /* strspn.c in Sources */, + C942126F13900C8A004BA536 /* strtok.c in Sources */, + C942127013900C8A004BA536 /* strxfrm.c in Sources */, + C942127113900C8A004BA536 /* swab.c in Sources */, + C942127213900C8A004BA536 /* wcpcpy.c in Sources */, + C942127313900C8A004BA536 /* wcpncpy.c in Sources */, + C942127413900C8A004BA536 /* wcscasecmp.c in Sources */, + C942127513900C8A004BA536 /* wcscat.c in Sources */, + C942127613900C8A004BA536 /* wcschr.c in Sources */, + C942127713900C8A004BA536 /* wcscmp.c in Sources */, + C942127813900C8A004BA536 /* wcscoll.c in Sources */, + C942127913900C8A004BA536 /* wcscpy.c in Sources */, + C942127A13900C8A004BA536 /* wcscspn.c in Sources */, + C942127B13900C8A004BA536 /* wcsdup.c in Sources */, + C942127C13900C8A004BA536 /* wcslcat.c in Sources */, + C942127D13900C8A004BA536 /* wcslcpy.c in Sources */, + C942127E13900C8A004BA536 /* wcslen.c in Sources */, + C942127F13900C8A004BA536 /* wcsncasecmp.c in Sources */, + C942128013900C8A004BA536 /* wcsncat.c in Sources */, + C942128113900C8A004BA536 /* wcsncmp.c in Sources */, + C942128213900C8A004BA536 /* wcsncpy.c in Sources */, + C942128313900C8A004BA536 /* wcsnlen.c in Sources */, + C942128413900C8A004BA536 /* wcspbrk.c in Sources */, + C942128513900C8A004BA536 /* wcsrchr.c in Sources */, + C942128613900C8A004BA536 /* wcsspn.c in Sources */, + C942128713900C8A004BA536 /* wcsstr.c in Sources */, + C942128813900C8A004BA536 /* wcstok.c in Sources */, + C942128913900C8A004BA536 /* wcswidth.c in Sources */, + C942128A13900C8A004BA536 /* wcsxfrm.c in Sources */, + C942128B13900C8A004BA536 /* wmemchr.c in Sources */, + C942128C13900C8A004BA536 /* wmemcmp.c in Sources */, + C942128D13900C8A004BA536 /* wmemcpy.c in Sources */, + C942128E13900C8A004BA536 /* wmemmove.c in Sources */, + C942128F13900C8A004BA536 /* wmemset.c in Sources */, + C942129013900C8A004BA536 /* _libc_init.c in Sources */, + C942129113900C8A004BA536 /* _libc_fork_child.c in Sources */, + C942129213900C8A004BA536 /* chmodx_np.c in Sources */, + C942129413900C8A004BA536 /* crt_externs.c in Sources */, + C942129613900C8A004BA536 /* fork.c in Sources */, + C942129713900C8A004BA536 /* getgroups.c in Sources */, + C942129913900C8A004BA536 /* gettimeofday.c in Sources */, + C942129A13900C8A004BA536 /* msgctl.c in Sources */, + C942129B13900C8A004BA536 /* stack_protector.c in Sources */, + C942129C13900C8A004BA536 /* openx_np.c in Sources */, + C942129D13900C8A004BA536 /* OSMemoryNotification.c in Sources */, + C942129E13900C8A004BA536 /* OSThermalNotification.c in Sources */, + C942129F13900C8A004BA536 /* posix_spawn.c in Sources */, + C94212A013900C8A004BA536 /* semctl.c in Sources */, + C94212A113900C8A004BA536 /* settimeofday.c in Sources */, + C94212A213900C8A004BA536 /* shmctl.c in Sources */, + C94212A313900C8A004BA536 /* sigaction.c in Sources */, + C94212A713900C8A004BA536 /* statx_np.c in Sources */, + C94212A813900C8A004BA536 /* umaskx_np.c in Sources */, + C94212AC13900C8A004BA536 /* fparseln.c in Sources */, + C94212AD13900C8A004BA536 /* login.c in Sources */, + C94212AE13900C8A004BA536 /* login_tty.c in Sources */, + C94212AF13900C8A004BA536 /* logout.c in Sources */, + C94212B013900C8A004BA536 /* logwtmp.c in Sources */, + 3F76864913E91CE800C94D25 /* mkpath_np.c in Sources */, + C94212B113900C8A004BA536 /* opendev.c in Sources */, + C94212B213900C8A004BA536 /* pty.c in Sources */, + C94212B313900C8A004BA536 /* clear.c in Sources */, + C94212B413900C8A004BA536 /* compare.c in Sources */, + C94212B513900C8A004BA536 /* copy.c in Sources */, + C94212B613900C8A004BA536 /* gen_uuid.c in Sources */, + C94212B713900C8A004BA536 /* isnull.c in Sources */, + C94212B813900C8A004BA536 /* pack.c in Sources */, + C94212B913900C8A004BA536 /* parse.c in Sources */, + C94212BA13900C8A004BA536 /* unpack.c in Sources */, + 7756338822F3B539002F1707 /* rpmatch.c in Sources */, + C94212BB13900C8A004BA536 /* unparse.c in Sources */, + C94212C613900C8A004BA536 /* scandir_b.c in Sources */, + 63D4060813DDEDFF0094DD56 /* stpcpy.c in Sources */, + 63D4060A13DDEEA20094DD56 /* stpncpy.c in Sources */, + 63D4060D13DDF26A0094DD56 /* strcat.c in Sources */, + 63D4061013DDF4340094DD56 /* strncat.c in Sources */, + B19C645C1450F90200032373 /* sync_volume_np.c in Sources */, + 3FD4D48E1472F4B200075CCE /* dirfd.c in Sources */, + 4B2C64A315519BC300342BFA /* assumes.c in Sources */, + FC2ED610157D4BE80098EC69 /* inet_ntop.c in Sources */, + FC2ED619157D4BE80098EC69 /* inet_pton.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C95B7EDC138F3C55004311DA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C95B7EE4138F3C55004311DA /* creat.c in Sources */, + C95B7EE5138F3C55004311DA /* gethostid.c in Sources */, + C95B7EE6138F3C55004311DA /* getwd.c in Sources */, + C95B7EE7138F3C55004311DA /* killpg.c in Sources */, + C95B7EE8138F3C55004311DA /* sethostid.c in Sources */, + C95B7EE9138F3C55004311DA /* setpgrp.c in Sources */, + C95B7EEA138F3C55004311DA /* setrgid.c in Sources */, + C95B7EEB138F3C55004311DA /* setruid.c in Sources */, + C95B7EEC138F3C55004311DA /* setregid.c in Sources */, + C95B7EED138F3C55004311DA /* setreuid.c in Sources */, + C95B7EEE138F3C55004311DA /* sigaltstk.c in Sources */, + C95B7EEF138F3C55004311DA /* sigcompat.c in Sources */, + C95B7EF1138F3C55004311DA /* kvm.c in Sources */, + C95B7EF5138F3C55004311DA /* forceLibcToBuild.c in Sources */, + C95B7EF6138F3C55004311DA /* bt_close.c in Sources */, + C95B7EF7138F3C55004311DA /* bt_conv.c in Sources */, + C95B7EF8138F3C55004311DA /* bt_debug.c in Sources */, + 7756338D22F3B54A002F1707 /* rpmatch.c in Sources */, + C95B7EF9138F3C55004311DA /* bt_delete.c in Sources */, + C95B7EFA138F3C55004311DA /* bt_get.c in Sources */, + C95B7EFB138F3C55004311DA /* bt_open.c in Sources */, + C95B7EFC138F3C55004311DA /* bt_overflow.c in Sources */, + C95B7EFD138F3C55004311DA /* bt_page.c in Sources */, + C95B7EFE138F3C55004311DA /* bt_put.c in Sources */, + C95B7EFF138F3C55004311DA /* bt_search.c in Sources */, + C95B7F00138F3C55004311DA /* bt_seq.c in Sources */, + C95B7F01138F3C55004311DA /* bt_split.c in Sources */, + C95B7F02138F3C55004311DA /* bt_utils.c in Sources */, + C95B7F03138F3C55004311DA /* db.c in Sources */, + C95B7F04138F3C55004311DA /* hash.c in Sources */, + C95B7F05138F3C55004311DA /* hash_bigkey.c in Sources */, + C95B7F06138F3C55004311DA /* hash_buf.c in Sources */, + C95B7F07138F3C55004311DA /* hash_func.c in Sources */, + C95B7F08138F3C55004311DA /* hash_log2.c in Sources */, + C95B7F09138F3C55004311DA /* hash_page.c in Sources */, + C95B7F0A138F3C55004311DA /* ndbm.c in Sources */, + C95B7F0B138F3C55004311DA /* mpool.c in Sources */, + C95B7F0C138F3C55004311DA /* rec_close.c in Sources */, + C95B7F0D138F3C55004311DA /* rec_delete.c in Sources */, + C95B7F0E138F3C55004311DA /* rec_get.c in Sources */, + C95B7F0F138F3C55004311DA /* rec_open.c in Sources */, + C95B7F10138F3C55004311DA /* rec_put.c in Sources */, + C95B7F11138F3C55004311DA /* rec_search.c in Sources */, + C95B7F12138F3C55004311DA /* rec_seq.c in Sources */, + C95B7F13138F3C55004311DA /* rec_utils.c in Sources */, + C95B7F14138F3C55004311DA /* brk.c in Sources */, + C95B7F15138F3C55004311DA /* bsd_signal.c in Sources */, + C95B7F16138F3C55004311DA /* lchflags.c in Sources */, + C95B7F17138F3C55004311DA /* lchmod.c in Sources */, + C95B7F18138F3C55004311DA /* lutimes.c in Sources */, + C95B7F19138F3C55004311DA /* statvfs.c in Sources */, + C95B7F1A138F3C55004311DA /* tcgetsid.c in Sources */, + C95B7F1B138F3C55004311DA /* _ldbl_util.c in Sources */, + C95B7F1C138F3C55004311DA /* _hdtoa.c in Sources */, + C95B7F1D138F3C55004311DA /* _ldtoa.c in Sources */, + C95B7F1E138F3C55004311DA /* gdtoa-dmisc.c in Sources */, + C95B7F1F138F3C55004311DA /* gdtoa-dtoa.c in Sources */, + C95B7F20138F3C55004311DA /* gdtoa-gdtoa.c in Sources */, + C95B7F21138F3C55004311DA /* gdtoa-gethex.c in Sources */, + C95B7F22138F3C55004311DA /* gdtoa-gmisc.c in Sources */, + C95B7F23138F3C55004311DA /* gdtoa-hd_init.c in Sources */, + C95B7F24138F3C55004311DA /* gdtoa-hexnan.c in Sources */, + C95B7F25138F3C55004311DA /* gdtoa-misc.c in Sources */, + C95B7F26138F3C55004311DA /* gdtoa-smisc.c in Sources */, + C95B7F27138F3C55004311DA /* gdtoa-strtod.c in Sources */, + C95B7F28138F3C55004311DA /* gdtoa-strtodg.c in Sources */, + C95B7F29138F3C55004311DA /* gdtoa-strtof.c in Sources */, + C95B7F2A138F3C55004311DA /* gdtoa-strtoIg.c in Sources */, + C95B7F2B138F3C55004311DA /* gdtoa-strtopdd.c in Sources */, + C95B7F2C138F3C55004311DA /* gdtoa-strtopx.c in Sources */, + C95B7F2D138F3C55004311DA /* gdtoa-strtord.c in Sources */, + C95B7F2E138F3C55004311DA /* gdtoa-sum.c in Sources */, + C95B7F2F138F3C55004311DA /* gdtoa-ulp.c in Sources */, + C95B7F30138F3C55004311DA /* glue.c in Sources */, + C95B7F31138F3C55004311DA /* machdep_ldisd.c in Sources */, + C95B7F32138F3C55004311DA /* machdep_ldisdd.c in Sources */, + C95B7F33138F3C55004311DA /* machdep_ldisQ.c in Sources */, + C95B7F34138F3C55004311DA /* machdep_ldisx.c in Sources */, + C95B7F3E138F3C55004311DA /* authentication.c in Sources */, + C95B7F3F138F3C55004311DA /* backtrace.c in Sources */, + C95B7F41138F3C55004311DA /* confstr.c in Sources */, + C95B7F42138F3C55004311DA /* crypt.c in Sources */, + C95B7F43138F3C55004311DA /* devname.c in Sources */, + C95B7F44138F3C55004311DA /* disklabel.c in Sources */, + C95B7F45138F3C55004311DA /* errlst.c in Sources */, + C95B7F46138F3C55004311DA /* filesec.c in Sources */, + 147CDFDD1B7C233000831EC6 /* clock_gettime.c in Sources */, + C95B7F47138F3C55004311DA /* _rand48.c in Sources */, + C95B7F48138F3C55004311DA /* alarm.c in Sources */, + C95B7F49138F3C55004311DA /* arc4random.c in Sources */, + C95B7F4A138F3C55004311DA /* assert.c in Sources */, + C95B7F4B138F3C55004311DA /* basename.c in Sources */, + C95B7F4C138F3C55004311DA /* clock.c in Sources */, + C95B7F4D138F3C55004311DA /* closedir.c in Sources */, + C95B7F4E138F3C55004311DA /* ctermid.c in Sources */, + C95B7F4F138F3C55004311DA /* daemon.c in Sources */, + C95B7F50138F3C55004311DA /* dirname.c in Sources */, + C95B7F51138F3C55004311DA /* drand48.c in Sources */, + C95B7F52138F3C55004311DA /* erand48.c in Sources */, + C95B7F53138F3C55004311DA /* err.c in Sources */, + C95B7F54138F3C55004311DA /* exec.c in Sources */, + C95B7F55138F3C55004311DA /* fmtcheck.c in Sources */, + C95B7F56138F3C55004311DA /* fmtmsg.c in Sources */, + C95B7F57138F3C55004311DA /* fnmatch.c in Sources */, + C95B7F58138F3C55004311DA /* ftok.c in Sources */, + C95B7F59138F3C55004311DA /* getbsize.c in Sources */, + C95B7F5A138F3C55004311DA /* getcap.c in Sources */, + C95B7F5B138F3C55004311DA /* getcwd.c in Sources */, + C95B7F5C138F3C55004311DA /* gethostname.c in Sources */, + C95B7F5D138F3C55004311DA /* getlogin.c in Sources */, + C95B7F5E138F3C55004311DA /* getmntinfo.c in Sources */, + C95B7F5F138F3C55004311DA /* getpagesize.c in Sources */, + C95B7F60138F3C55004311DA /* getpeereid.c in Sources */, + C95B7F61138F3C55004311DA /* getprogname.c in Sources */, + C95B7F62138F3C55004311DA /* glob.c in Sources */, + C95B7F63138F3C55004311DA /* isatty.c in Sources */, + C95B7F64138F3C55004311DA /* jrand48.c in Sources */, + C95B7F65138F3C55004311DA /* lcong48.c in Sources */, + C95B7F66138F3C55004311DA /* lockf.c in Sources */, + C95B7F67138F3C55004311DA /* lrand48.c in Sources */, + C95B7F68138F3C55004311DA /* mrand48.c in Sources */, + C95B7F69138F3C55004311DA /* nice.c in Sources */, + C95B7F6A138F3C55004311DA /* nrand48.c in Sources */, + C95B7F6B138F3C55004311DA /* opendir.c in Sources */, + C95B7F6C138F3C55004311DA /* pause.c in Sources */, + C95B7F6D138F3C55004311DA /* popen.c in Sources */, + C95B7F6F138F3C55004311DA /* psignal.c in Sources */, + C95B7F70138F3C55004311DA /* raise.c in Sources */, + C95B7F71138F3C55004311DA /* readdir.c in Sources */, + C95B7F72138F3C55004311DA /* readpassphrase.c in Sources */, + C95B7F73138F3C55004311DA /* rewinddir.c in Sources */, + C95B7F74138F3C55004311DA /* scandir.c in Sources */, + C95B7F75138F3C55004311DA /* seed48.c in Sources */, + C95B7F76138F3C55004311DA /* seekdir.c in Sources */, + C95B7F77138F3C55004311DA /* sethostname.c in Sources */, + C95B7F78138F3C55004311DA /* setmode.c in Sources */, + C95B7F79138F3C55004311DA /* setprogname.c in Sources */, + C95B7F7A138F3C55004311DA /* siginterrupt.c in Sources */, + C95B7F7B138F3C55004311DA /* siglist.c in Sources */, + C95B7F7C138F3C55004311DA /* signal.c in Sources */, + C95B7F7D138F3C55004311DA /* sleep.c in Sources */, + C95B7F7E138F3C55004311DA /* srand48.c in Sources */, + C95B7F7F138F3C55004311DA /* stringlist.c in Sources */, + C95B7F80138F3C55004311DA /* sysconf.c in Sources */, + C95B7F81138F3C55004311DA /* sysctl.c in Sources */, + C95B7F82138F3C55004311DA /* sysctlbyname.c in Sources */, + C95B7F83138F3C55004311DA /* sysctlnametomib.c in Sources */, + C95B7F84138F3C55004311DA /* telldir.c in Sources */, + C95B7F85138F3C55004311DA /* termios.c in Sources */, + C95B7F86138F3C55004311DA /* time.c in Sources */, + C95B7F87138F3C55004311DA /* times.c in Sources */, + C95B7F88138F3C55004311DA /* timezone.c in Sources */, + C95B7F89138F3C55004311DA /* ttyname.c in Sources */, + C95B7F8A138F3C55004311DA /* ttyslot.c in Sources */, + C95B7F8B138F3C55004311DA /* ualarm.c in Sources */, + C95B7F8C138F3C55004311DA /* ulimit.c in Sources */, + C95B7F8D138F3C55004311DA /* unvis.c in Sources */, + C95B7F8E138F3C55004311DA /* usleep.c in Sources */, + C95B7F8F138F3C55004311DA /* utime.c in Sources */, + C95B7F90138F3C55004311DA /* vis.c in Sources */, + C95B7F91138F3C55004311DA /* wait.c in Sources */, + C95B7F92138F3C55004311DA /* wait3.c in Sources */, + C95B7F93138F3C55004311DA /* waitpid.c in Sources */, + C95B7F94138F3C55004311DA /* fts.c in Sources */, + C95B7F95138F3C55004311DA /* get_compat.c in Sources */, + C95B7F96138F3C55004311DA /* getloadavg.c in Sources */, + C95B7F97138F3C55004311DA /* getttyent.c in Sources */, + C95B7F98138F3C55004311DA /* getusershell.c in Sources */, + C95B7F99138F3C55004311DA /* getvfsbyname.c in Sources */, + C95B7F9E138F3C55004311DA /* nanosleep.c in Sources */, + C95B7F9F138F3C55004311DA /* utmpx.c in Sources */, + C95B7FA0138F3C55004311DA /* nftw.c in Sources */, + C95B7FA1138F3C55004311DA /* nlist.c in Sources */, + C95B7FA3138F3C55004311DA /* oldsyslog.c in Sources */, + C95B7FA6138F3C55004311DA /* setlogin.c in Sources */, + C95B7FA7138F3C55004311DA /* sigsetops.c in Sources */, + C95B7FAA138F3C55004311DA /* strtofflags.c in Sources */, + C95B7FAC138F3C55004311DA /* thread_stack_pcs.c in Sources */, + C95B7FAD138F3C55004311DA /* uname.c in Sources */, + C95B7FAE138F3C55004311DA /* utmpx-darwin.c in Sources */, + C95B7FAF138F3C55004311DA /* wordexp.c in Sources */, + C95B7FB1138F3C55004311DA /* gmon.c in Sources */, + C95B7FD1138F3C55004311DA /* ascii.c in Sources */, + C95B7FD2138F3C55004311DA /* big5.c in Sources */, + C95B7FD3138F3C55004311DA /* btowc.c in Sources */, + C95B7FD4138F3C55004311DA /* collate.c in Sources */, + C95B7FD5138F3C55004311DA /* collcmp.c in Sources */, + C95B7FD6138F3C55004311DA /* euc.c in Sources */, + C95B7FD7138F3C55004311DA /* fix_grouping.c in Sources */, + C95B7FD8138F3C55004311DA /* gb18030.c in Sources */, + C95B7FD9138F3C55004311DA /* gb2312.c in Sources */, + C95B7FDA138F3C55004311DA /* gbk.c in Sources */, + C95B7FDB138F3C55004311DA /* ldpart.c in Sources */, + C95B7FDC138F3C55004311DA /* lmessages.c in Sources */, + C95B7FDD138F3C55004311DA /* lmonetary.c in Sources */, + C95B7FDE138F3C55004311DA /* lnumeric.c in Sources */, + C95B7FDF138F3C55004311DA /* localeconv.c in Sources */, + C95B7FE0138F3C55004311DA /* mblen.c in Sources */, + C95B7FE1138F3C55004311DA /* mbrlen.c in Sources */, + C95B7FE2138F3C55004311DA /* mbrtowc.c in Sources */, + C95B7FE3138F3C55004311DA /* mbsinit.c in Sources */, + C95B7FE4138F3C55004311DA /* mbsnrtowcs.c in Sources */, + C95B7FE5138F3C55004311DA /* mbsrtowcs.c in Sources */, + C95B7FE6138F3C55004311DA /* mbstowcs.c in Sources */, + C95B7FE7138F3C55004311DA /* mbtowc.c in Sources */, + C95B7FE8138F3C55004311DA /* mskanji.c in Sources */, + C95B7FE9138F3C55004311DA /* nextwctype.c in Sources */, + C95B7FEA138F3C55004311DA /* nl_langinfo.c in Sources */, + C95B7FEB138F3C55004311DA /* nomacros.c in Sources */, + C95B7FEC138F3C55004311DA /* none.c in Sources */, + C95B7FED138F3C55004311DA /* rune.c in Sources */, + C95B7FEE138F3C55004311DA /* runetype.c in Sources */, + C95B7FEF138F3C55004311DA /* setlocale.c in Sources */, + C95B7FF0138F3C55004311DA /* setrunelocale.c in Sources */, + C95B7FF1138F3C55004311DA /* table.c in Sources */, + C95B7FF2138F3C55004311DA /* tolower.c in Sources */, + C95B7FF3138F3C55004311DA /* toupper.c in Sources */, + C95B7FF4138F3C55004311DA /* utf2.c in Sources */, + C95B7FF5138F3C55004311DA /* utf8.c in Sources */, + C95B7FF6138F3C55004311DA /* wcrtomb.c in Sources */, + C95B7FF7138F3C55004311DA /* wcsftime.c in Sources */, + C95B7FF8138F3C55004311DA /* wcsnrtombs.c in Sources */, + C95B7FF9138F3C55004311DA /* wcsrtombs.c in Sources */, + C95B7FFA138F3C55004311DA /* wcstod.c in Sources */, + C95B7FFB138F3C55004311DA /* wcstof.c in Sources */, + C95B7FFC138F3C55004311DA /* wcstoimax.c in Sources */, + C95B7FFD138F3C55004311DA /* wcstol.c in Sources */, + C95B7FFE138F3C55004311DA /* wcstold.c in Sources */, + C95B7FFF138F3C55004311DA /* wcstoll.c in Sources */, + C95B8000138F3C55004311DA /* wcstombs.c in Sources */, + C95B8001138F3C55004311DA /* wcstoul.c in Sources */, + C95B8002138F3C55004311DA /* wcstoull.c in Sources */, + C95B8003138F3C55004311DA /* wcstoumax.c in Sources */, + C95B8004138F3C55004311DA /* wctob.c in Sources */, + C95B8005138F3C55004311DA /* wctomb.c in Sources */, + C95B8006138F3C55004311DA /* wctrans.c in Sources */, + C95B8007138F3C55004311DA /* wctype.c in Sources */, + C95B8008138F3C55004311DA /* wcwidth.c in Sources */, + C95B8009138F3C55004311DA /* frune.c in Sources */, + C95B800A138F3C55004311DA /* isctype.c in Sources */, + C95B800B138F3C55004311DA /* iswctype.c in Sources */, + C95B800C138F3C55004311DA /* lconv.c in Sources */, + C95B800D138F3C55004311DA /* mbrune.c in Sources */, + C95B800E138F3C55004311DA /* runedepreciated.c in Sources */, + C95B800F138F3C55004311DA /* setinvalidrune.c in Sources */, + C95B8010138F3C55004311DA /* xlocale.c in Sources */, + C95B8011138F3C55004311DA /* addr2ascii.c in Sources */, + C95B8012138F3C55004311DA /* ascii2addr.c in Sources */, + C95B8013138F3C55004311DA /* inet_addr.c in Sources */, + C95B8014138F3C55004311DA /* inet_lnaof.c in Sources */, + C95B8015138F3C55004311DA /* inet_makeaddr.c in Sources */, + C95B8016138F3C55004311DA /* inet_net_ntop.c in Sources */, + C95B8017138F3C55004311DA /* inet_net_pton.c in Sources */, + C95B8018138F3C55004311DA /* inet_neta.c in Sources */, + C95B8019138F3C55004311DA /* inet_netof.c in Sources */, + C95B801A138F3C55004311DA /* inet_network.c in Sources */, + C95B801B138F3C55004311DA /* inet_ntoa.c in Sources */, + C95B801C138F3C55004311DA /* linkaddr.c in Sources */, + C95B801D138F3C55004311DA /* nsap_addr.c in Sources */, + C95B801E138F3C55004311DA /* recv.c in Sources */, + C95B801F138F3C55004311DA /* send.c in Sources */, + C95B8020138F3C55004311DA /* sockatmark.c in Sources */, + C95B8021138F3C55004311DA /* sourcefilter.c in Sources */, + C95B8022138F3C55004311DA /* msgcat.c in Sources */, + C95B8023138F3C55004311DA /* acl.c in Sources */, + C95B8024138F3C55004311DA /* acl_entry.c in Sources */, + C95B8025138F3C55004311DA /* acl_file.c in Sources */, + C95B8026138F3C55004311DA /* acl_flag.c in Sources */, + C95B8027138F3C55004311DA /* acl_perm.c in Sources */, + C95B8028138F3C55004311DA /* acl_translate.c in Sources */, + C95B803C138F3C55004311DA /* regerror.c in Sources */, + C95B804D138F3C55004311DA /* _flock_stub.c in Sources */, + C95B804E138F3C55004311DA /* asprintf.c in Sources */, + C95B804F138F3C55004311DA /* clrerr.c in Sources */, + C95B8050138F3C55004311DA /* dprintf.c in Sources */, + C95B8051138F3C55004311DA /* fclose.c in Sources */, + C95B8052138F3C55004311DA /* fdopen.c in Sources */, + C95B8053138F3C55004311DA /* feof.c in Sources */, + C95B8054138F3C55004311DA /* ferror.c in Sources */, + C95B8055138F3C55004311DA /* fflush.c in Sources */, + C95B8056138F3C55004311DA /* fgetc.c in Sources */, + C95B8057138F3C55004311DA /* fgetln.c in Sources */, + C95B8058138F3C55004311DA /* fgetpos.c in Sources */, + C95B8059138F3C55004311DA /* fgets.c in Sources */, + C95B805A138F3C55004311DA /* fgetwc.c in Sources */, + C95B805B138F3C55004311DA /* fgetwln.c in Sources */, + C95B805C138F3C55004311DA /* fgetws.c in Sources */, + C95B805D138F3C55004311DA /* fileno.c in Sources */, + C95B805E138F3C55004311DA /* findfp.c in Sources */, + C95B805F138F3C55004311DA /* flags.c in Sources */, + C95B8060138F3C55004311DA /* fopen.c in Sources */, + C95B8061138F3C55004311DA /* fprintf.c in Sources */, + C95B8062138F3C55004311DA /* fpurge.c in Sources */, + C95B8063138F3C55004311DA /* fputc.c in Sources */, + C95B8064138F3C55004311DA /* fputs.c in Sources */, + C95B8065138F3C55004311DA /* fputwc.c in Sources */, + C95B8066138F3C55004311DA /* fputws.c in Sources */, + C95B8067138F3C55004311DA /* fread.c in Sources */, + C95B8068138F3C55004311DA /* freopen.c in Sources */, + C95B8069138F3C55004311DA /* fscanf.c in Sources */, + C95B806A138F3C55004311DA /* fseek.c in Sources */, + C95B806B138F3C55004311DA /* fsetpos.c in Sources */, + C95B806C138F3C55004311DA /* ftell.c in Sources */, + C95B806D138F3C55004311DA /* funopen.c in Sources */, + C95B806E138F3C55004311DA /* fvwrite.c in Sources */, + C95B806F138F3C55004311DA /* fwalk.c in Sources */, + C95B8070138F3C55004311DA /* fwide.c in Sources */, + C95B8071138F3C55004311DA /* fwprintf.c in Sources */, + C95B8072138F3C55004311DA /* fwrite.c in Sources */, + C95B8073138F3C55004311DA /* fwscanf.c in Sources */, + C95B8074138F3C55004311DA /* getc.c in Sources */, + C95B8075138F3C55004311DA /* getchar.c in Sources */, + C95B8076138F3C55004311DA /* getdelim.c in Sources */, + C95B8077138F3C55004311DA /* getline.c in Sources */, + 928BD1041D76073400EC01FC /* timingsafe_bcmp.c in Sources */, + C95B8078138F3C55004311DA /* gets.c in Sources */, + C95B8079138F3C55004311DA /* getw.c in Sources */, + C95B807A138F3C55004311DA /* getwc.c in Sources */, + C95B807B138F3C55004311DA /* getwchar.c in Sources */, + C95B807C138F3C55004311DA /* makebuf.c in Sources */, + C95B807D138F3C55004311DA /* mktemp.c in Sources */, + C95B807E138F3C55004311DA /* perror.c in Sources */, + C95B807F138F3C55004311DA /* printf-pos.c in Sources */, + C95B8080138F3C55004311DA /* printf.c in Sources */, + C95B8081138F3C55004311DA /* putc.c in Sources */, + C95B8082138F3C55004311DA /* putchar.c in Sources */, + C95B8083138F3C55004311DA /* puts.c in Sources */, + C95B8084138F3C55004311DA /* putw.c in Sources */, + C95B8085138F3C55004311DA /* putwc.c in Sources */, + C95B8086138F3C55004311DA /* putwchar.c in Sources */, + C95B8087138F3C55004311DA /* refill.c in Sources */, + C95B8088138F3C55004311DA /* remove.c in Sources */, + C95B8089138F3C55004311DA /* rewind.c in Sources */, + C95B808A138F3C55004311DA /* rget.c in Sources */, + C95B808B138F3C55004311DA /* scanf.c in Sources */, + C95B808C138F3C55004311DA /* setbuf.c in Sources */, + C95B808D138F3C55004311DA /* setbuffer.c in Sources */, + C95B808E138F3C55004311DA /* setvbuf.c in Sources */, + C95B808F138F3C55004311DA /* snprintf.c in Sources */, + C95B8090138F3C55004311DA /* sprintf.c in Sources */, + C95B8091138F3C55004311DA /* sscanf.c in Sources */, + C95B8092138F3C55004311DA /* stdio.c in Sources */, + C95B8093138F3C55004311DA /* swprintf.c in Sources */, + C95B8094138F3C55004311DA /* swscanf.c in Sources */, + C95B8095138F3C55004311DA /* tempnam.c in Sources */, + C95B8096138F3C55004311DA /* tmpfile.c in Sources */, + C95B8097138F3C55004311DA /* tmpnam.c in Sources */, + C95B8098138F3C55004311DA /* ungetc.c in Sources */, + C95B8099138F3C55004311DA /* ungetwc.c in Sources */, + C95B809A138F3C55004311DA /* vasprintf.c in Sources */, + C95B809B138F3C55004311DA /* vdprintf.c in Sources */, + C95B809C138F3C55004311DA /* vfprintf.c in Sources */, + C95B809D138F3C55004311DA /* vfscanf.c in Sources */, + C95B809E138F3C55004311DA /* vfwprintf.c in Sources */, + C95B809F138F3C55004311DA /* vfwscanf.c in Sources */, + C95B80A0138F3C55004311DA /* vprintf.c in Sources */, + C95B80A1138F3C55004311DA /* vscanf.c in Sources */, + C95B80A2138F3C55004311DA /* vsnprintf.c in Sources */, + C95B80A3138F3C55004311DA /* vsprintf.c in Sources */, + C95B80A4138F3C55004311DA /* vsscanf.c in Sources */, + C95B80A5138F3C55004311DA /* vswprintf.c in Sources */, + C95B80A6138F3C55004311DA /* vswscanf.c in Sources */, + C95B80A7138F3C55004311DA /* vwprintf.c in Sources */, + C95B80A8138F3C55004311DA /* vwscanf.c in Sources */, + C95B80A9138F3C55004311DA /* wbuf.c in Sources */, + C95B80AA138F3C55004311DA /* wprintf.c in Sources */, + C95B80AB138F3C55004311DA /* wscanf.c in Sources */, + C95B80AC138F3C55004311DA /* wsetup.c in Sources */, + C95B80AD138F3C55004311DA /* a64l.c in Sources */, + C95B80AE138F3C55004311DA /* _Exit_.c in Sources */, + C95B80AF138F3C55004311DA /* abort.c in Sources */, + C95B80B0138F3C55004311DA /* abs.c in Sources */, + C95B80B1138F3C55004311DA /* atexit.c in Sources */, + C95B80B2138F3C55004311DA /* atof.c in Sources */, + C95B80B3138F3C55004311DA /* atoi.c in Sources */, + C95B80B4138F3C55004311DA /* atol.c in Sources */, + C95B80B5138F3C55004311DA /* atoll.c in Sources */, + C95B80B6138F3C55004311DA /* bsearch.c in Sources */, + C95B80B7138F3C55004311DA /* div.c in Sources */, + C95B80B8138F3C55004311DA /* exit.c in Sources */, + C95B80B9138F3C55004311DA /* getenv.c in Sources */, + C95B80BA138F3C55004311DA /* getopt.c in Sources */, + C95B80BB138F3C55004311DA /* getopt_long.c in Sources */, + C95B80BC138F3C55004311DA /* getsubopt.c in Sources */, + C95B80BD138F3C55004311DA /* hcreate.c in Sources */, + C95B80BE138F3C55004311DA /* heapsort.c in Sources */, + C95B80BF138F3C55004311DA /* heapsort_b.c in Sources */, + C95B80C0138F3C55004311DA /* heapsort_r.c in Sources */, + C95B80C1138F3C55004311DA /* imaxabs.c in Sources */, + C95B80C2138F3C55004311DA /* imaxdiv.c in Sources */, + C95B80C3138F3C55004311DA /* insque.c in Sources */, + C95B80C4138F3C55004311DA /* labs.c in Sources */, + C95B80C5138F3C55004311DA /* ldiv.c in Sources */, + C95B80C6138F3C55004311DA /* llabs.c in Sources */, + C95B80C7138F3C55004311DA /* lldiv.c in Sources */, + C95B80C8138F3C55004311DA /* lsearch.c in Sources */, + C95B80C9138F3C55004311DA /* merge.c in Sources */, + C95B80CA138F3C55004311DA /* putenv.c in Sources */, + C95B80CB138F3C55004311DA /* qsort.c in Sources */, + C95B80CC138F3C55004311DA /* qsort_r.c in Sources */, + C95B80CD138F3C55004311DA /* radixsort.c in Sources */, + C95B80CE138F3C55004311DA /* rand.c in Sources */, + C95B80CF138F3C55004311DA /* random.c in Sources */, + C95B80D0138F3C55004311DA /* reallocf.c in Sources */, + C95B80D1138F3C55004311DA /* realpath.c in Sources */, + C95B80D2138F3C55004311DA /* remque.c in Sources */, + C95B80D3138F3C55004311DA /* setenv.c in Sources */, + C95B80D4138F3C55004311DA /* strhash.c in Sources */, + C95B80D5138F3C55004311DA /* strtoimax.c in Sources */, + 922D0C1021BFA1A30072834D /* timespec_get.c in Sources */, + C95B80D6138F3C55004311DA /* strtol.c in Sources */, + C95B80D7138F3C55004311DA /* strtoll.c in Sources */, + C95B80D8138F3C55004311DA /* strtoq.c in Sources */, + C95B80D9138F3C55004311DA /* strtoul.c in Sources */, + C95B80DA138F3C55004311DA /* strtoull.c in Sources */, + C95B80DB138F3C55004311DA /* strtoumax.c in Sources */, + C95B80DC138F3C55004311DA /* strtouq.c in Sources */, + C95B80DD138F3C55004311DA /* system.c in Sources */, + C95B80DE138F3C55004311DA /* tdelete.c in Sources */, + C95B80DF138F3C55004311DA /* tfind.c in Sources */, + C95B80E0138F3C55004311DA /* tsearch.c in Sources */, + C95B80E1138F3C55004311DA /* twalk.c in Sources */, + C95B80E2138F3C55004311DA /* grantpt.c in Sources */, + C95B80E3138F3C55004311DA /* l64a.c in Sources */, + C95B80E4138F3C55004311DA /* strfmon.c in Sources */, + C95B80E5138F3C55004311DA /* ecvt.c in Sources */, + C95B80E6138F3C55004311DA /* gcvt.c in Sources */, + C95B80E7138F3C55004311DA /* qsort_b.c in Sources */, + C95B80E8138F3C55004311DA /* asctime.c in Sources */, + C95B80E9138F3C55004311DA /* difftime.c in Sources */, + C95B80EA138F3C55004311DA /* ftime.c in Sources */, + C95B80EB138F3C55004311DA /* localtime.c in Sources */, + C95B80EC138F3C55004311DA /* strftime.c in Sources */, + C95B80ED138F3C55004311DA /* strptime.c in Sources */, + C95B80EE138F3C55004311DA /* time32.c in Sources */, + C95B80EF138F3C55004311DA /* timelocal.c in Sources */, + C95B80F0138F3C55004311DA /* getdate.c in Sources */, + C95B80F1138F3C55004311DA /* timezone_unix03.c in Sources */, + C95B80FA138F3C55004311DA /* memmem.c in Sources */, + C95B80FD138F3C55004311DA /* rindex.c in Sources */, + C95B8100138F3C55004311DA /* strcasecmp.c in Sources */, + C95B8101138F3C55004311DA /* strcasestr.c in Sources */, + C95B8105138F3C55004311DA /* strcoll.c in Sources */, + C95B8107138F3C55004311DA /* strcspn.c in Sources */, + C95B8108138F3C55004311DA /* strdup.c in Sources */, + C95B8109138F3C55004311DA /* strerror.c in Sources */, + C95B810D138F3C55004311DA /* strmode.c in Sources */, + C95B8111138F3C55004311DA /* strndup.c in Sources */, + C95B8113138F3C55004311DA /* strnstr.c in Sources */, + C95B8114138F3C55004311DA /* strpbrk.c in Sources */, + C95B8115138F3C55004311DA /* strrchr.c in Sources */, + C95B8116138F3C55004311DA /* strsep.c in Sources */, + C95B8117138F3C55004311DA /* strsignal.c in Sources */, + C95B8118138F3C55004311DA /* strspn.c in Sources */, + C95B811A138F3C55004311DA /* strtok.c in Sources */, + C95B811B138F3C55004311DA /* strxfrm.c in Sources */, + C95B811C138F3C55004311DA /* swab.c in Sources */, + C95B811D138F3C55004311DA /* wcpcpy.c in Sources */, + C95B811E138F3C55004311DA /* wcpncpy.c in Sources */, + C95B811F138F3C55004311DA /* wcscasecmp.c in Sources */, + C95B8120138F3C55004311DA /* wcscat.c in Sources */, + C95B8121138F3C55004311DA /* wcschr.c in Sources */, + C95B8122138F3C55004311DA /* wcscmp.c in Sources */, + C95B8123138F3C55004311DA /* wcscoll.c in Sources */, + C95B8124138F3C55004311DA /* wcscpy.c in Sources */, + C95B8125138F3C55004311DA /* wcscspn.c in Sources */, + C95B8126138F3C55004311DA /* wcsdup.c in Sources */, + C95B8127138F3C55004311DA /* wcslcat.c in Sources */, + C95B8128138F3C55004311DA /* wcslcpy.c in Sources */, + C95B8129138F3C55004311DA /* wcslen.c in Sources */, + C95B812A138F3C55004311DA /* wcsncasecmp.c in Sources */, + C95B812B138F3C55004311DA /* wcsncat.c in Sources */, + C95B812C138F3C55004311DA /* wcsncmp.c in Sources */, + C95B812D138F3C55004311DA /* wcsncpy.c in Sources */, + C95B812E138F3C55004311DA /* wcsnlen.c in Sources */, + C95B812F138F3C55004311DA /* wcspbrk.c in Sources */, + C95B8130138F3C55004311DA /* wcsrchr.c in Sources */, + C95B8131138F3C55004311DA /* wcsspn.c in Sources */, + C95B8132138F3C55004311DA /* wcsstr.c in Sources */, + C95B8133138F3C55004311DA /* wcstok.c in Sources */, + C95B8134138F3C55004311DA /* wcswidth.c in Sources */, + C95B8135138F3C55004311DA /* wcsxfrm.c in Sources */, + C95B8136138F3C55004311DA /* wmemchr.c in Sources */, + C95B8137138F3C55004311DA /* wmemcmp.c in Sources */, + C95B8138138F3C55004311DA /* wmemcpy.c in Sources */, + 2DF67CE2184F9CBE00B83A3D /* debug_private.c in Sources */, + C95B8139138F3C55004311DA /* wmemmove.c in Sources */, + C95B813A138F3C55004311DA /* wmemset.c in Sources */, + C95B813B138F3C55004311DA /* _libc_init.c in Sources */, + C95B813C138F3C55004311DA /* _libc_fork_child.c in Sources */, + C95B813D138F3C55004311DA /* chmodx_np.c in Sources */, + C95B813F138F3C55004311DA /* crt_externs.c in Sources */, + C95B8141138F3C55004311DA /* fork.c in Sources */, + C95B8142138F3C55004311DA /* getgroups.c in Sources */, + C95B8144138F3C55004311DA /* gettimeofday.c in Sources */, + C95B8145138F3C55004311DA /* msgctl.c in Sources */, + C95B8146138F3C55004311DA /* stack_protector.c in Sources */, + C95B8147138F3C55004311DA /* openx_np.c in Sources */, + C95B8148138F3C55004311DA /* OSMemoryNotification.c in Sources */, + C95B8149138F3C55004311DA /* OSThermalNotification.c in Sources */, + C95B814A138F3C55004311DA /* posix_spawn.c in Sources */, + C95B814B138F3C55004311DA /* semctl.c in Sources */, + C95B814C138F3C55004311DA /* settimeofday.c in Sources */, + C95B814D138F3C55004311DA /* shmctl.c in Sources */, + C95B814E138F3C55004311DA /* sigaction.c in Sources */, + C95B8152138F3C55004311DA /* statx_np.c in Sources */, + C95B8153138F3C55004311DA /* umaskx_np.c in Sources */, + C95B8157138F3C55004311DA /* fparseln.c in Sources */, + C95B8158138F3C55004311DA /* login.c in Sources */, + C95B8159138F3C55004311DA /* login_tty.c in Sources */, + C95B815A138F3C55004311DA /* logout.c in Sources */, + C95B815B138F3C55004311DA /* logwtmp.c in Sources */, + 3F76864E13E91D5D00C94D25 /* mkpath_np.c in Sources */, + C95B815C138F3C55004311DA /* opendev.c in Sources */, + C95B815D138F3C55004311DA /* pty.c in Sources */, + C95B815E138F3C55004311DA /* clear.c in Sources */, + C95B815F138F3C55004311DA /* compare.c in Sources */, + C95B8160138F3C55004311DA /* copy.c in Sources */, + C95B8161138F3C55004311DA /* gen_uuid.c in Sources */, + C95B8162138F3C55004311DA /* isnull.c in Sources */, + C95B8163138F3C55004311DA /* pack.c in Sources */, + C95B8164138F3C55004311DA /* parse.c in Sources */, + C95B8165138F3C55004311DA /* unpack.c in Sources */, + C95B8166138F3C55004311DA /* unparse.c in Sources */, + B19C645F1450F90200032373 /* sync_volume_np.c in Sources */, + 3FB7E1B7146EF2E000843438 /* dirfd.c in Sources */, + 4B2C64A615519BC600342BFA /* assumes.c in Sources */, + FC2ED614157D4BE80098EC69 /* inet_ntop.c in Sources */, + FC2ED61D157D4BE80098EC69 /* inet_pton.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C95B8187138F52B0004311DA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C95B818F138F52B0004311DA /* creat.c in Sources */, + C95B8190138F52B0004311DA /* gethostid.c in Sources */, + C95B8191138F52B0004311DA /* getwd.c in Sources */, + C95B8192138F52B0004311DA /* killpg.c in Sources */, + C95B8193138F52B0004311DA /* sethostid.c in Sources */, + C95B8194138F52B0004311DA /* setpgrp.c in Sources */, + C95B8195138F52B0004311DA /* setrgid.c in Sources */, + C95B8196138F52B0004311DA /* setruid.c in Sources */, + C95B8197138F52B0004311DA /* setregid.c in Sources */, + C95B8198138F52B0004311DA /* setreuid.c in Sources */, + C95B8199138F52B0004311DA /* sigaltstk.c in Sources */, + C95B819A138F52B0004311DA /* sigcompat.c in Sources */, + C95B819C138F52B0004311DA /* kvm.c in Sources */, + C95B81A0138F52B0004311DA /* forceLibcToBuild.c in Sources */, + C95B81A1138F52B0004311DA /* bt_close.c in Sources */, + C95B81A2138F52B0004311DA /* bt_conv.c in Sources */, + C95B81A3138F52B0004311DA /* bt_debug.c in Sources */, + 7756338E22F3B54A002F1707 /* rpmatch.c in Sources */, + C95B81A4138F52B0004311DA /* bt_delete.c in Sources */, + C95B81A5138F52B0004311DA /* bt_get.c in Sources */, + C95B81A6138F52B0004311DA /* bt_open.c in Sources */, + C95B81A7138F52B0004311DA /* bt_overflow.c in Sources */, + C95B81A8138F52B0004311DA /* bt_page.c in Sources */, + C95B81A9138F52B0004311DA /* bt_put.c in Sources */, + C95B81AA138F52B0004311DA /* bt_search.c in Sources */, + C95B81AB138F52B0004311DA /* bt_seq.c in Sources */, + C95B81AC138F52B0004311DA /* bt_split.c in Sources */, + C95B81AD138F52B0004311DA /* bt_utils.c in Sources */, + C95B81AE138F52B0004311DA /* db.c in Sources */, + C95B81AF138F52B0004311DA /* hash.c in Sources */, + C95B81B0138F52B0004311DA /* hash_bigkey.c in Sources */, + C95B81B1138F52B0004311DA /* hash_buf.c in Sources */, + C95B81B2138F52B0004311DA /* hash_func.c in Sources */, + C95B81B3138F52B0004311DA /* hash_log2.c in Sources */, + C95B81B4138F52B0004311DA /* hash_page.c in Sources */, + C95B81B5138F52B0004311DA /* ndbm.c in Sources */, + C95B81B6138F52B0004311DA /* mpool.c in Sources */, + C95B81B7138F52B0004311DA /* rec_close.c in Sources */, + C95B81B8138F52B0004311DA /* rec_delete.c in Sources */, + C95B81B9138F52B0004311DA /* rec_get.c in Sources */, + C95B81BA138F52B0004311DA /* rec_open.c in Sources */, + C95B81BB138F52B0004311DA /* rec_put.c in Sources */, + C95B81BC138F52B0004311DA /* rec_search.c in Sources */, + C95B81BD138F52B0004311DA /* rec_seq.c in Sources */, + C95B81BE138F52B0004311DA /* rec_utils.c in Sources */, + C95B81BF138F52B0004311DA /* brk.c in Sources */, + C95B81C0138F52B0004311DA /* bsd_signal.c in Sources */, + C95B81C1138F52B0004311DA /* lchflags.c in Sources */, + C95B81C2138F52B0004311DA /* lchmod.c in Sources */, + C95B81C3138F52B0004311DA /* lutimes.c in Sources */, + C95B81C4138F52B0004311DA /* statvfs.c in Sources */, + C95B81C5138F52B0004311DA /* tcgetsid.c in Sources */, + C95B81C6138F52B0004311DA /* _ldbl_util.c in Sources */, + C95B81C7138F52B0004311DA /* _hdtoa.c in Sources */, + C95B81C8138F52B0004311DA /* _ldtoa.c in Sources */, + C95B81C9138F52B0004311DA /* gdtoa-dmisc.c in Sources */, + C95B81CA138F52B0004311DA /* gdtoa-dtoa.c in Sources */, + C95B81CB138F52B0004311DA /* gdtoa-gdtoa.c in Sources */, + C95B81CC138F52B0004311DA /* gdtoa-gethex.c in Sources */, + C95B81CD138F52B0004311DA /* gdtoa-gmisc.c in Sources */, + C95B81CE138F52B0004311DA /* gdtoa-hd_init.c in Sources */, + C95B81CF138F52B0004311DA /* gdtoa-hexnan.c in Sources */, + C95B81D0138F52B0004311DA /* gdtoa-misc.c in Sources */, + C95B81D1138F52B0004311DA /* gdtoa-smisc.c in Sources */, + C95B81D2138F52B0004311DA /* gdtoa-strtod.c in Sources */, + C95B81D3138F52B0004311DA /* gdtoa-strtodg.c in Sources */, + C95B81D4138F52B0004311DA /* gdtoa-strtof.c in Sources */, + C95B81D5138F52B0004311DA /* gdtoa-strtoIg.c in Sources */, + C95B81D6138F52B0004311DA /* gdtoa-strtopdd.c in Sources */, + C95B81D7138F52B0004311DA /* gdtoa-strtopx.c in Sources */, + C95B81D8138F52B0004311DA /* gdtoa-strtord.c in Sources */, + C95B81D9138F52B0004311DA /* gdtoa-sum.c in Sources */, + C95B81DA138F52B0004311DA /* gdtoa-ulp.c in Sources */, + C95B81DB138F52B0004311DA /* glue.c in Sources */, + C95B81DC138F52B0004311DA /* machdep_ldisd.c in Sources */, + C95B81DD138F52B0004311DA /* machdep_ldisdd.c in Sources */, + C95B81DE138F52B0004311DA /* machdep_ldisQ.c in Sources */, + C95B81DF138F52B0004311DA /* machdep_ldisx.c in Sources */, + C95B81E9138F52B0004311DA /* authentication.c in Sources */, + C95B81EA138F52B0004311DA /* backtrace.c in Sources */, + C95B81EC138F52B0004311DA /* confstr.c in Sources */, + C95B81ED138F52B0004311DA /* crypt.c in Sources */, + C95B81EE138F52B0004311DA /* devname.c in Sources */, + C95B81EF138F52B0004311DA /* disklabel.c in Sources */, + C95B81F0138F52B0004311DA /* errlst.c in Sources */, + C95B81F1138F52B0004311DA /* filesec.c in Sources */, + 147CDFDE1B7C233100831EC6 /* clock_gettime.c in Sources */, + C95B81F2138F52B0004311DA /* _rand48.c in Sources */, + C95B81F3138F52B0004311DA /* alarm.c in Sources */, + C95B81F4138F52B0004311DA /* arc4random.c in Sources */, + C95B81F5138F52B0004311DA /* assert.c in Sources */, + C95B81F6138F52B0004311DA /* basename.c in Sources */, + C95B81F7138F52B0004311DA /* clock.c in Sources */, + C95B81F8138F52B0004311DA /* closedir.c in Sources */, + C95B81F9138F52B0004311DA /* ctermid.c in Sources */, + C95B81FA138F52B0004311DA /* daemon.c in Sources */, + C95B81FB138F52B0004311DA /* dirname.c in Sources */, + C95B81FC138F52B0004311DA /* drand48.c in Sources */, + C95B81FD138F52B0004311DA /* erand48.c in Sources */, + C95B81FE138F52B0004311DA /* err.c in Sources */, + C95B81FF138F52B0004311DA /* exec.c in Sources */, + C95B8200138F52B0004311DA /* fmtcheck.c in Sources */, + C95B8201138F52B0004311DA /* fmtmsg.c in Sources */, + C95B8202138F52B0004311DA /* fnmatch.c in Sources */, + C95B8203138F52B0004311DA /* ftok.c in Sources */, + C95B8204138F52B0004311DA /* getbsize.c in Sources */, + C95B8205138F52B0004311DA /* getcap.c in Sources */, + C95B8206138F52B0004311DA /* getcwd.c in Sources */, + C95B8207138F52B0004311DA /* gethostname.c in Sources */, + C95B8208138F52B0004311DA /* getlogin.c in Sources */, + C95B8209138F52B0004311DA /* getmntinfo.c in Sources */, + C95B820A138F52B0004311DA /* getpagesize.c in Sources */, + C95B820B138F52B0004311DA /* getpeereid.c in Sources */, + C95B820C138F52B0004311DA /* getprogname.c in Sources */, + C95B820D138F52B0004311DA /* glob.c in Sources */, + C95B820E138F52B0004311DA /* isatty.c in Sources */, + C95B820F138F52B0004311DA /* jrand48.c in Sources */, + C95B8210138F52B0004311DA /* lcong48.c in Sources */, + C95B8211138F52B0004311DA /* lockf.c in Sources */, + C95B8212138F52B0004311DA /* lrand48.c in Sources */, + C95B8213138F52B0004311DA /* mrand48.c in Sources */, + C95B8214138F52B0004311DA /* nice.c in Sources */, + C95B8215138F52B0004311DA /* nrand48.c in Sources */, + C95B8216138F52B0004311DA /* opendir.c in Sources */, + C95B8217138F52B0004311DA /* pause.c in Sources */, + C95B8218138F52B0004311DA /* popen.c in Sources */, + C95B821A138F52B0004311DA /* psignal.c in Sources */, + C95B821B138F52B0004311DA /* raise.c in Sources */, + C95B821C138F52B0004311DA /* readdir.c in Sources */, + C95B821D138F52B0004311DA /* readpassphrase.c in Sources */, + C95B821E138F52B0004311DA /* rewinddir.c in Sources */, + C95B821F138F52B0004311DA /* scandir.c in Sources */, + C95B8220138F52B0004311DA /* seed48.c in Sources */, + C95B8221138F52B0004311DA /* seekdir.c in Sources */, + C95B8222138F52B0004311DA /* sethostname.c in Sources */, + C95B8223138F52B0004311DA /* setmode.c in Sources */, + C95B8224138F52B0004311DA /* setprogname.c in Sources */, + C95B8225138F52B0004311DA /* siginterrupt.c in Sources */, + C95B8226138F52B0004311DA /* siglist.c in Sources */, + C95B8227138F52B0004311DA /* signal.c in Sources */, + C95B8228138F52B0004311DA /* sleep.c in Sources */, + C95B8229138F52B0004311DA /* srand48.c in Sources */, + C95B822A138F52B0004311DA /* stringlist.c in Sources */, + C95B822B138F52B0004311DA /* sysconf.c in Sources */, + C95B822C138F52B0004311DA /* sysctl.c in Sources */, + C95B822D138F52B0004311DA /* sysctlbyname.c in Sources */, + C95B822E138F52B0004311DA /* sysctlnametomib.c in Sources */, + C95B822F138F52B0004311DA /* telldir.c in Sources */, + C95B8230138F52B0004311DA /* termios.c in Sources */, + C95B8231138F52B0004311DA /* time.c in Sources */, + C95B8232138F52B0004311DA /* times.c in Sources */, + C95B8233138F52B0004311DA /* timezone.c in Sources */, + C95B8234138F52B0004311DA /* ttyname.c in Sources */, + C95B8235138F52B0004311DA /* ttyslot.c in Sources */, + C95B8236138F52B0004311DA /* ualarm.c in Sources */, + C95B8237138F52B0004311DA /* ulimit.c in Sources */, + C95B8238138F52B0004311DA /* unvis.c in Sources */, + C95B8239138F52B0004311DA /* usleep.c in Sources */, + C95B823A138F52B0004311DA /* utime.c in Sources */, + C95B823B138F52B0004311DA /* vis.c in Sources */, + C95B823C138F52B0004311DA /* wait.c in Sources */, + C95B823D138F52B0004311DA /* wait3.c in Sources */, + C95B823E138F52B0004311DA /* waitpid.c in Sources */, + C95B823F138F52B0004311DA /* fts.c in Sources */, + C95B8240138F52B0004311DA /* get_compat.c in Sources */, + C95B8241138F52B0004311DA /* getloadavg.c in Sources */, + C95B8242138F52B0004311DA /* getttyent.c in Sources */, + C95B8243138F52B0004311DA /* getusershell.c in Sources */, + C95B8244138F52B0004311DA /* getvfsbyname.c in Sources */, + C95B8249138F52B0004311DA /* nanosleep.c in Sources */, + C95B824A138F52B0004311DA /* utmpx.c in Sources */, + C95B824B138F52B0004311DA /* nftw.c in Sources */, + C95B824C138F52B0004311DA /* nlist.c in Sources */, + C95B824E138F52B0004311DA /* oldsyslog.c in Sources */, + C95B8251138F52B0004311DA /* setlogin.c in Sources */, + C95B8252138F52B0004311DA /* sigsetops.c in Sources */, + C95B8255138F52B0004311DA /* strtofflags.c in Sources */, + C95B8257138F52B0004311DA /* thread_stack_pcs.c in Sources */, + C95B8258138F52B0004311DA /* uname.c in Sources */, + C95B8259138F52B0004311DA /* utmpx-darwin.c in Sources */, + C95B825A138F52B0004311DA /* wordexp.c in Sources */, + C95B825C138F52B0004311DA /* gmon.c in Sources */, + C95B827C138F52B0004311DA /* ascii.c in Sources */, + C95B827D138F52B0004311DA /* big5.c in Sources */, + C95B827E138F52B0004311DA /* btowc.c in Sources */, + C95B827F138F52B0004311DA /* collate.c in Sources */, + C95B8280138F52B0004311DA /* collcmp.c in Sources */, + C95B8281138F52B0004311DA /* euc.c in Sources */, + C95B8282138F52B0004311DA /* fix_grouping.c in Sources */, + C95B8283138F52B0004311DA /* gb18030.c in Sources */, + C95B8284138F52B0004311DA /* gb2312.c in Sources */, + C95B8285138F52B0004311DA /* gbk.c in Sources */, + C95B8286138F52B0004311DA /* ldpart.c in Sources */, + C95B8287138F52B0004311DA /* lmessages.c in Sources */, + C95B8288138F52B0004311DA /* lmonetary.c in Sources */, + C95B8289138F52B0004311DA /* lnumeric.c in Sources */, + C95B828A138F52B0004311DA /* localeconv.c in Sources */, + C95B828B138F52B0004311DA /* mblen.c in Sources */, + C95B828C138F52B0004311DA /* mbrlen.c in Sources */, + C95B828D138F52B0004311DA /* mbrtowc.c in Sources */, + C95B828E138F52B0004311DA /* mbsinit.c in Sources */, + C95B828F138F52B0004311DA /* mbsnrtowcs.c in Sources */, + C95B8290138F52B0004311DA /* mbsrtowcs.c in Sources */, + C95B8291138F52B0004311DA /* mbstowcs.c in Sources */, + C95B8292138F52B0004311DA /* mbtowc.c in Sources */, + C95B8293138F52B0004311DA /* mskanji.c in Sources */, + C95B8294138F52B0004311DA /* nextwctype.c in Sources */, + C95B8295138F52B0004311DA /* nl_langinfo.c in Sources */, + C95B8296138F52B0004311DA /* nomacros.c in Sources */, + C95B8297138F52B0004311DA /* none.c in Sources */, + C95B8298138F52B0004311DA /* rune.c in Sources */, + C95B8299138F52B0004311DA /* runetype.c in Sources */, + C95B829A138F52B0004311DA /* setlocale.c in Sources */, + C95B829B138F52B0004311DA /* setrunelocale.c in Sources */, + C95B829C138F52B0004311DA /* table.c in Sources */, + C95B829D138F52B0004311DA /* tolower.c in Sources */, + C95B829E138F52B0004311DA /* toupper.c in Sources */, + C95B829F138F52B0004311DA /* utf2.c in Sources */, + C95B82A0138F52B0004311DA /* utf8.c in Sources */, + C95B82A1138F52B0004311DA /* wcrtomb.c in Sources */, + C95B82A2138F52B0004311DA /* wcsftime.c in Sources */, + C95B82A3138F52B0004311DA /* wcsnrtombs.c in Sources */, + C95B82A4138F52B0004311DA /* wcsrtombs.c in Sources */, + C95B82A5138F52B0004311DA /* wcstod.c in Sources */, + C95B82A6138F52B0004311DA /* wcstof.c in Sources */, + C95B82A7138F52B0004311DA /* wcstoimax.c in Sources */, + C95B82A8138F52B0004311DA /* wcstol.c in Sources */, + C95B82A9138F52B0004311DA /* wcstold.c in Sources */, + C95B82AA138F52B0004311DA /* wcstoll.c in Sources */, + C95B82AB138F52B0004311DA /* wcstombs.c in Sources */, + C95B82AC138F52B0004311DA /* wcstoul.c in Sources */, + C95B82AD138F52B0004311DA /* wcstoull.c in Sources */, + C95B82AE138F52B0004311DA /* wcstoumax.c in Sources */, + C95B82AF138F52B0004311DA /* wctob.c in Sources */, + C95B82B0138F52B0004311DA /* wctomb.c in Sources */, + C95B82B1138F52B0004311DA /* wctrans.c in Sources */, + C95B82B2138F52B0004311DA /* wctype.c in Sources */, + C95B82B3138F52B0004311DA /* wcwidth.c in Sources */, + C95B82B4138F52B0004311DA /* frune.c in Sources */, + C95B82B5138F52B0004311DA /* isctype.c in Sources */, + C95B82B6138F52B0004311DA /* iswctype.c in Sources */, + C95B82B7138F52B0004311DA /* lconv.c in Sources */, + C95B82B8138F52B0004311DA /* mbrune.c in Sources */, + C95B82B9138F52B0004311DA /* runedepreciated.c in Sources */, + C95B82BA138F52B0004311DA /* setinvalidrune.c in Sources */, + C95B82BB138F52B0004311DA /* xlocale.c in Sources */, + C95B82BC138F52B0004311DA /* addr2ascii.c in Sources */, + C95B82BD138F52B0004311DA /* ascii2addr.c in Sources */, + C95B82BE138F52B0004311DA /* inet_addr.c in Sources */, + C95B82BF138F52B0004311DA /* inet_lnaof.c in Sources */, + C95B82C0138F52B0004311DA /* inet_makeaddr.c in Sources */, + C95B82C1138F52B0004311DA /* inet_net_ntop.c in Sources */, + C95B82C2138F52B0004311DA /* inet_net_pton.c in Sources */, + C95B82C3138F52B0004311DA /* inet_neta.c in Sources */, + C95B82C4138F52B0004311DA /* inet_netof.c in Sources */, + C95B82C5138F52B0004311DA /* inet_network.c in Sources */, + C95B82C6138F52B0004311DA /* inet_ntoa.c in Sources */, + C95B82C7138F52B0004311DA /* linkaddr.c in Sources */, + C95B82C8138F52B0004311DA /* nsap_addr.c in Sources */, + C95B82C9138F52B0004311DA /* recv.c in Sources */, + C95B82CA138F52B0004311DA /* send.c in Sources */, + C95B82CB138F52B0004311DA /* sockatmark.c in Sources */, + C95B82CC138F52B0004311DA /* sourcefilter.c in Sources */, + C95B82CD138F52B0004311DA /* msgcat.c in Sources */, + C95B82CE138F52B0004311DA /* acl.c in Sources */, + C95B82CF138F52B0004311DA /* acl_entry.c in Sources */, + C95B82D0138F52B0004311DA /* acl_file.c in Sources */, + C95B82D1138F52B0004311DA /* acl_flag.c in Sources */, + C95B82D2138F52B0004311DA /* acl_perm.c in Sources */, + C95B82D3138F52B0004311DA /* acl_translate.c in Sources */, + C95B82E7138F52B0004311DA /* regerror.c in Sources */, + C95B82F8138F52B0004311DA /* _flock_stub.c in Sources */, + C95B82F9138F52B0004311DA /* asprintf.c in Sources */, + C95B82FA138F52B0004311DA /* clrerr.c in Sources */, + C95B82FB138F52B0004311DA /* dprintf.c in Sources */, + C95B82FC138F52B0004311DA /* fclose.c in Sources */, + C95B82FD138F52B0004311DA /* fdopen.c in Sources */, + C95B82FE138F52B0004311DA /* feof.c in Sources */, + C95B82FF138F52B0004311DA /* ferror.c in Sources */, + C95B8300138F52B0004311DA /* fflush.c in Sources */, + C95B8301138F52B0004311DA /* fgetc.c in Sources */, + C95B8302138F52B0004311DA /* fgetln.c in Sources */, + C95B8303138F52B0004311DA /* fgetpos.c in Sources */, + C95B8304138F52B0004311DA /* fgets.c in Sources */, + C95B8305138F52B0004311DA /* fgetwc.c in Sources */, + C95B8306138F52B0004311DA /* fgetwln.c in Sources */, + C95B8307138F52B0004311DA /* fgetws.c in Sources */, + C95B8308138F52B0004311DA /* fileno.c in Sources */, + C95B8309138F52B0004311DA /* findfp.c in Sources */, + C95B830A138F52B0004311DA /* flags.c in Sources */, + C95B830B138F52B0004311DA /* fopen.c in Sources */, + C95B830C138F52B0004311DA /* fprintf.c in Sources */, + C95B830D138F52B0004311DA /* fpurge.c in Sources */, + C95B830E138F52B0004311DA /* fputc.c in Sources */, + C95B830F138F52B0004311DA /* fputs.c in Sources */, + C95B8310138F52B0004311DA /* fputwc.c in Sources */, + C95B8311138F52B0004311DA /* fputws.c in Sources */, + C95B8312138F52B0004311DA /* fread.c in Sources */, + C95B8313138F52B0004311DA /* freopen.c in Sources */, + C95B8314138F52B0004311DA /* fscanf.c in Sources */, + C95B8315138F52B0004311DA /* fseek.c in Sources */, + C95B8316138F52B0004311DA /* fsetpos.c in Sources */, + C95B8317138F52B0004311DA /* ftell.c in Sources */, + C95B8318138F52B0004311DA /* funopen.c in Sources */, + C95B8319138F52B0004311DA /* fvwrite.c in Sources */, + C95B831A138F52B0004311DA /* fwalk.c in Sources */, + C95B831B138F52B0004311DA /* fwide.c in Sources */, + C95B831C138F52B0004311DA /* fwprintf.c in Sources */, + C95B831D138F52B0004311DA /* fwrite.c in Sources */, + C95B831E138F52B0004311DA /* fwscanf.c in Sources */, + C95B831F138F52B0004311DA /* getc.c in Sources */, + C95B8320138F52B0004311DA /* getchar.c in Sources */, + C95B8321138F52B0004311DA /* getdelim.c in Sources */, + C95B8322138F52B0004311DA /* getline.c in Sources */, + 928BD1051D76073400EC01FC /* timingsafe_bcmp.c in Sources */, + C95B8323138F52B0004311DA /* gets.c in Sources */, + C95B8324138F52B0004311DA /* getw.c in Sources */, + C95B8325138F52B0004311DA /* getwc.c in Sources */, + C95B8326138F52B0004311DA /* getwchar.c in Sources */, + C95B8327138F52B0004311DA /* makebuf.c in Sources */, + C95B8328138F52B0004311DA /* mktemp.c in Sources */, + C95B8329138F52B0004311DA /* perror.c in Sources */, + C95B832A138F52B0004311DA /* printf-pos.c in Sources */, + C95B832B138F52B0004311DA /* printf.c in Sources */, + C95B832C138F52B0004311DA /* putc.c in Sources */, + C95B832D138F52B0004311DA /* putchar.c in Sources */, + C95B832E138F52B0004311DA /* puts.c in Sources */, + C95B832F138F52B0004311DA /* putw.c in Sources */, + C95B8330138F52B0004311DA /* putwc.c in Sources */, + C95B8331138F52B0004311DA /* putwchar.c in Sources */, + C95B8332138F52B0004311DA /* refill.c in Sources */, + C95B8333138F52B0004311DA /* remove.c in Sources */, + C95B8334138F52B0004311DA /* rewind.c in Sources */, + C95B8335138F52B0004311DA /* rget.c in Sources */, + C95B8336138F52B0004311DA /* scanf.c in Sources */, + C95B8337138F52B0004311DA /* setbuf.c in Sources */, + C95B8338138F52B0004311DA /* setbuffer.c in Sources */, + C95B8339138F52B0004311DA /* setvbuf.c in Sources */, + C95B833A138F52B0004311DA /* snprintf.c in Sources */, + C95B833B138F52B0004311DA /* sprintf.c in Sources */, + C95B833C138F52B0004311DA /* sscanf.c in Sources */, + C95B833D138F52B0004311DA /* stdio.c in Sources */, + C95B833E138F52B0004311DA /* swprintf.c in Sources */, + C95B833F138F52B0004311DA /* swscanf.c in Sources */, + C95B8340138F52B0004311DA /* tempnam.c in Sources */, + C95B8341138F52B0004311DA /* tmpfile.c in Sources */, + C95B8342138F52B0004311DA /* tmpnam.c in Sources */, + C95B8343138F52B0004311DA /* ungetc.c in Sources */, + C95B8344138F52B0004311DA /* ungetwc.c in Sources */, + C95B8345138F52B0004311DA /* vasprintf.c in Sources */, + C95B8346138F52B0004311DA /* vdprintf.c in Sources */, + C95B8347138F52B0004311DA /* vfprintf.c in Sources */, + C95B8348138F52B0004311DA /* vfscanf.c in Sources */, + C95B8349138F52B0004311DA /* vfwprintf.c in Sources */, + C95B834A138F52B0004311DA /* vfwscanf.c in Sources */, + C95B834B138F52B0004311DA /* vprintf.c in Sources */, + C95B834C138F52B0004311DA /* vscanf.c in Sources */, + C95B834D138F52B0004311DA /* vsnprintf.c in Sources */, + C95B834E138F52B0004311DA /* vsprintf.c in Sources */, + C95B834F138F52B0004311DA /* vsscanf.c in Sources */, + C95B8350138F52B0004311DA /* vswprintf.c in Sources */, + C95B8351138F52B0004311DA /* vswscanf.c in Sources */, + C95B8352138F52B0004311DA /* vwprintf.c in Sources */, + C95B8353138F52B0004311DA /* vwscanf.c in Sources */, + C95B8354138F52B0004311DA /* wbuf.c in Sources */, + C95B8355138F52B0004311DA /* wprintf.c in Sources */, + C95B8356138F52B0004311DA /* wscanf.c in Sources */, + C95B8357138F52B0004311DA /* wsetup.c in Sources */, + C95B8358138F52B0004311DA /* a64l.c in Sources */, + C95B8359138F52B0004311DA /* _Exit_.c in Sources */, + C95B835A138F52B0004311DA /* abort.c in Sources */, + C95B835B138F52B0004311DA /* abs.c in Sources */, + C95B835C138F52B0004311DA /* atexit.c in Sources */, + C95B835D138F52B0004311DA /* atof.c in Sources */, + C95B835E138F52B0004311DA /* atoi.c in Sources */, + C95B835F138F52B0004311DA /* atol.c in Sources */, + C95B8360138F52B0004311DA /* atoll.c in Sources */, + C95B8361138F52B0004311DA /* bsearch.c in Sources */, + C95B8362138F52B0004311DA /* div.c in Sources */, + C95B8363138F52B0004311DA /* exit.c in Sources */, + C95B8364138F52B0004311DA /* getenv.c in Sources */, + C95B8365138F52B0004311DA /* getopt.c in Sources */, + C95B8366138F52B0004311DA /* getopt_long.c in Sources */, + C95B8367138F52B0004311DA /* getsubopt.c in Sources */, + C95B8368138F52B0004311DA /* hcreate.c in Sources */, + C95B8369138F52B0004311DA /* heapsort.c in Sources */, + C95B836A138F52B0004311DA /* heapsort_b.c in Sources */, + C95B836B138F52B0004311DA /* heapsort_r.c in Sources */, + C95B836C138F52B0004311DA /* imaxabs.c in Sources */, + C95B836D138F52B0004311DA /* imaxdiv.c in Sources */, + C95B836E138F52B0004311DA /* insque.c in Sources */, + C95B836F138F52B0004311DA /* labs.c in Sources */, + C95B8370138F52B0004311DA /* ldiv.c in Sources */, + C95B8371138F52B0004311DA /* llabs.c in Sources */, + C95B8372138F52B0004311DA /* lldiv.c in Sources */, + C95B8373138F52B0004311DA /* lsearch.c in Sources */, + C95B8374138F52B0004311DA /* merge.c in Sources */, + C95B8375138F52B0004311DA /* putenv.c in Sources */, + C95B8376138F52B0004311DA /* qsort.c in Sources */, + C95B8377138F52B0004311DA /* qsort_r.c in Sources */, + C95B8378138F52B0004311DA /* radixsort.c in Sources */, + C95B8379138F52B0004311DA /* rand.c in Sources */, + C95B837A138F52B0004311DA /* random.c in Sources */, + C95B837B138F52B0004311DA /* reallocf.c in Sources */, + C95B837C138F52B0004311DA /* realpath.c in Sources */, + C95B837D138F52B0004311DA /* remque.c in Sources */, + C95B837E138F52B0004311DA /* setenv.c in Sources */, + C95B837F138F52B0004311DA /* strhash.c in Sources */, + C95B8380138F52B0004311DA /* strtoimax.c in Sources */, + 922D0C1121BFA1A30072834D /* timespec_get.c in Sources */, + C95B8381138F52B0004311DA /* strtol.c in Sources */, + C95B8382138F52B0004311DA /* strtoll.c in Sources */, + C95B8383138F52B0004311DA /* strtoq.c in Sources */, + C95B8384138F52B0004311DA /* strtoul.c in Sources */, + C95B8385138F52B0004311DA /* strtoull.c in Sources */, + C95B8386138F52B0004311DA /* strtoumax.c in Sources */, + C95B8387138F52B0004311DA /* strtouq.c in Sources */, + C95B8388138F52B0004311DA /* system.c in Sources */, + C95B8389138F52B0004311DA /* tdelete.c in Sources */, + C95B838A138F52B0004311DA /* tfind.c in Sources */, + C95B838B138F52B0004311DA /* tsearch.c in Sources */, + C95B838C138F52B0004311DA /* twalk.c in Sources */, + C95B838D138F52B0004311DA /* grantpt.c in Sources */, + C95B838E138F52B0004311DA /* l64a.c in Sources */, + C95B838F138F52B0004311DA /* strfmon.c in Sources */, + C95B8390138F52B0004311DA /* ecvt.c in Sources */, + C95B8391138F52B0004311DA /* gcvt.c in Sources */, + C95B8392138F52B0004311DA /* qsort_b.c in Sources */, + C95B8393138F52B0004311DA /* asctime.c in Sources */, + C95B8394138F52B0004311DA /* difftime.c in Sources */, + C95B8395138F52B0004311DA /* ftime.c in Sources */, + C95B8396138F52B0004311DA /* localtime.c in Sources */, + C95B8397138F52B0004311DA /* strftime.c in Sources */, + C95B8398138F52B0004311DA /* strptime.c in Sources */, + C95B8399138F52B0004311DA /* time32.c in Sources */, + C95B839A138F52B0004311DA /* timelocal.c in Sources */, + C95B839B138F52B0004311DA /* getdate.c in Sources */, + C95B839C138F52B0004311DA /* timezone_unix03.c in Sources */, + C95B83A5138F52B0004311DA /* memmem.c in Sources */, + C95B83A8138F52B0004311DA /* rindex.c in Sources */, + C95B83AB138F52B0004311DA /* strcasecmp.c in Sources */, + C95B83AC138F52B0004311DA /* strcasestr.c in Sources */, + C95B83B0138F52B0004311DA /* strcoll.c in Sources */, + C95B83B2138F52B0004311DA /* strcspn.c in Sources */, + C95B83B3138F52B0004311DA /* strdup.c in Sources */, + C95B83B4138F52B0004311DA /* strerror.c in Sources */, + C95B83B8138F52B0004311DA /* strmode.c in Sources */, + C95B83BC138F52B0004311DA /* strndup.c in Sources */, + C95B83BE138F52B0004311DA /* strnstr.c in Sources */, + C95B83BF138F52B0004311DA /* strpbrk.c in Sources */, + C95B83C0138F52B0004311DA /* strrchr.c in Sources */, + C95B83C1138F52B0004311DA /* strsep.c in Sources */, + C95B83C2138F52B0004311DA /* strsignal.c in Sources */, + C95B83C3138F52B0004311DA /* strspn.c in Sources */, + C95B83C5138F52B0004311DA /* strtok.c in Sources */, + C95B83C6138F52B0004311DA /* strxfrm.c in Sources */, + C95B83C7138F52B0004311DA /* swab.c in Sources */, + C95B83C8138F52B0004311DA /* wcpcpy.c in Sources */, + C95B83C9138F52B0004311DA /* wcpncpy.c in Sources */, + C95B83CA138F52B0004311DA /* wcscasecmp.c in Sources */, + C95B83CB138F52B0004311DA /* wcscat.c in Sources */, + C95B83CC138F52B0004311DA /* wcschr.c in Sources */, + C95B83CD138F52B0004311DA /* wcscmp.c in Sources */, + C95B83CE138F52B0004311DA /* wcscoll.c in Sources */, + C95B83CF138F52B0004311DA /* wcscpy.c in Sources */, + C95B83D0138F52B0004311DA /* wcscspn.c in Sources */, + C95B83D1138F52B0004311DA /* wcsdup.c in Sources */, + C95B83D2138F52B0004311DA /* wcslcat.c in Sources */, + C95B83D3138F52B0004311DA /* wcslcpy.c in Sources */, + C95B83D4138F52B0004311DA /* wcslen.c in Sources */, + C95B83D5138F52B0004311DA /* wcsncasecmp.c in Sources */, + C95B83D6138F52B0004311DA /* wcsncat.c in Sources */, + C95B83D7138F52B0004311DA /* wcsncmp.c in Sources */, + C95B83D8138F52B0004311DA /* wcsncpy.c in Sources */, + C95B83D9138F52B0004311DA /* wcsnlen.c in Sources */, + C95B83DA138F52B0004311DA /* wcspbrk.c in Sources */, + C95B83DB138F52B0004311DA /* wcsrchr.c in Sources */, + C95B83DC138F52B0004311DA /* wcsspn.c in Sources */, + C95B83DD138F52B0004311DA /* wcsstr.c in Sources */, + C95B83DE138F52B0004311DA /* wcstok.c in Sources */, + C95B83DF138F52B0004311DA /* wcswidth.c in Sources */, + C95B83E0138F52B0004311DA /* wcsxfrm.c in Sources */, + C95B83E1138F52B0004311DA /* wmemchr.c in Sources */, + C95B83E2138F52B0004311DA /* wmemcmp.c in Sources */, + C95B83E3138F52B0004311DA /* wmemcpy.c in Sources */, + 2DF67CE3184F9CBE00B83A3D /* debug_private.c in Sources */, + C95B83E4138F52B0004311DA /* wmemmove.c in Sources */, + C95B83E5138F52B0004311DA /* wmemset.c in Sources */, + C95B83E6138F52B0004311DA /* _libc_init.c in Sources */, + C95B83E7138F52B0004311DA /* _libc_fork_child.c in Sources */, + C95B83E8138F52B0004311DA /* chmodx_np.c in Sources */, + C95B83EA138F52B0004311DA /* crt_externs.c in Sources */, + C95B83EC138F52B0004311DA /* fork.c in Sources */, + C95B83ED138F52B0004311DA /* getgroups.c in Sources */, + C95B83EF138F52B0004311DA /* gettimeofday.c in Sources */, + C95B83F0138F52B0004311DA /* msgctl.c in Sources */, + C95B83F1138F52B0004311DA /* stack_protector.c in Sources */, + C95B83F2138F52B0004311DA /* openx_np.c in Sources */, + C95B83F3138F52B0004311DA /* OSMemoryNotification.c in Sources */, + C95B83F4138F52B0004311DA /* OSThermalNotification.c in Sources */, + C95B83F5138F52B0004311DA /* posix_spawn.c in Sources */, + C95B83F6138F52B0004311DA /* semctl.c in Sources */, + C95B83F7138F52B0004311DA /* settimeofday.c in Sources */, + C95B83F8138F52B0004311DA /* shmctl.c in Sources */, + C95B83F9138F52B0004311DA /* sigaction.c in Sources */, + C95B83FD138F52B0004311DA /* statx_np.c in Sources */, + C95B83FE138F52B0004311DA /* umaskx_np.c in Sources */, + C95B8402138F52B0004311DA /* fparseln.c in Sources */, + C95B8403138F52B0004311DA /* login.c in Sources */, + C95B8404138F52B0004311DA /* login_tty.c in Sources */, + C95B8405138F52B0004311DA /* logout.c in Sources */, + C95B8406138F52B0004311DA /* logwtmp.c in Sources */, + 3F76864D13E91D5500C94D25 /* mkpath_np.c in Sources */, + C95B8407138F52B0004311DA /* opendev.c in Sources */, + C95B8408138F52B0004311DA /* pty.c in Sources */, + C95B8409138F52B0004311DA /* clear.c in Sources */, + C95B840A138F52B0004311DA /* compare.c in Sources */, + C95B840B138F52B0004311DA /* copy.c in Sources */, + C95B840C138F52B0004311DA /* gen_uuid.c in Sources */, + C95B840D138F52B0004311DA /* isnull.c in Sources */, + C95B840E138F52B0004311DA /* pack.c in Sources */, + C95B840F138F52B0004311DA /* parse.c in Sources */, + C95B8410138F52B0004311DA /* unpack.c in Sources */, + C95B8411138F52B0004311DA /* unparse.c in Sources */, + B19C64601450F90200032373 /* sync_volume_np.c in Sources */, + 3FB7E1B8146EF2E000843438 /* dirfd.c in Sources */, + 4B2C64A715519BC700342BFA /* assumes.c in Sources */, + FC2ED615157D4BE80098EC69 /* inet_ntop.c in Sources */, + FC2ED61E157D4BE80098EC69 /* inet_pton.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C95B842D138F53DB004311DA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C95B8435138F53DB004311DA /* creat.c in Sources */, + C95B8436138F53DB004311DA /* gethostid.c in Sources */, + C95B8437138F53DB004311DA /* getwd.c in Sources */, + C95B8438138F53DB004311DA /* killpg.c in Sources */, + C95B8439138F53DB004311DA /* sethostid.c in Sources */, + C95B843A138F53DB004311DA /* setpgrp.c in Sources */, + C95B843B138F53DB004311DA /* setrgid.c in Sources */, + C95B843C138F53DB004311DA /* setruid.c in Sources */, + C95B843D138F53DB004311DA /* setregid.c in Sources */, + C95B843E138F53DB004311DA /* setreuid.c in Sources */, + C95B843F138F53DB004311DA /* sigaltstk.c in Sources */, + C95B8440138F53DB004311DA /* sigcompat.c in Sources */, + C95B8442138F53DB004311DA /* kvm.c in Sources */, + C95B8446138F53DB004311DA /* forceLibcToBuild.c in Sources */, + C95B8447138F53DB004311DA /* bt_close.c in Sources */, + C95B8448138F53DB004311DA /* bt_conv.c in Sources */, + C95B8449138F53DB004311DA /* bt_debug.c in Sources */, + 7756338F22F3B54B002F1707 /* rpmatch.c in Sources */, + C95B844A138F53DB004311DA /* bt_delete.c in Sources */, + C95B844B138F53DB004311DA /* bt_get.c in Sources */, + C95B844C138F53DB004311DA /* bt_open.c in Sources */, + C95B844D138F53DB004311DA /* bt_overflow.c in Sources */, + C95B844E138F53DB004311DA /* bt_page.c in Sources */, + C95B844F138F53DB004311DA /* bt_put.c in Sources */, + C95B8450138F53DB004311DA /* bt_search.c in Sources */, + C95B8451138F53DB004311DA /* bt_seq.c in Sources */, + C95B8452138F53DB004311DA /* bt_split.c in Sources */, + C95B8453138F53DB004311DA /* bt_utils.c in Sources */, + C95B8454138F53DB004311DA /* db.c in Sources */, + C95B8455138F53DB004311DA /* hash.c in Sources */, + C95B8456138F53DB004311DA /* hash_bigkey.c in Sources */, + C95B8457138F53DB004311DA /* hash_buf.c in Sources */, + C95B8458138F53DB004311DA /* hash_func.c in Sources */, + C95B8459138F53DB004311DA /* hash_log2.c in Sources */, + C95B845A138F53DB004311DA /* hash_page.c in Sources */, + C95B845B138F53DB004311DA /* ndbm.c in Sources */, + C95B845C138F53DB004311DA /* mpool.c in Sources */, + C95B845D138F53DB004311DA /* rec_close.c in Sources */, + C95B845E138F53DB004311DA /* rec_delete.c in Sources */, + C95B845F138F53DB004311DA /* rec_get.c in Sources */, + C95B8460138F53DB004311DA /* rec_open.c in Sources */, + C95B8461138F53DB004311DA /* rec_put.c in Sources */, + C95B8462138F53DB004311DA /* rec_search.c in Sources */, + C95B8463138F53DB004311DA /* rec_seq.c in Sources */, + C95B8464138F53DB004311DA /* rec_utils.c in Sources */, + C95B8465138F53DB004311DA /* brk.c in Sources */, + C95B8466138F53DB004311DA /* bsd_signal.c in Sources */, + C95B8467138F53DB004311DA /* lchflags.c in Sources */, + C95B8468138F53DB004311DA /* lchmod.c in Sources */, + C95B8469138F53DB004311DA /* lutimes.c in Sources */, + C95B846A138F53DB004311DA /* statvfs.c in Sources */, + C95B846B138F53DB004311DA /* tcgetsid.c in Sources */, + C95B846C138F53DB004311DA /* _ldbl_util.c in Sources */, + C95B846D138F53DB004311DA /* _hdtoa.c in Sources */, + C95B846E138F53DB004311DA /* _ldtoa.c in Sources */, + C95B846F138F53DB004311DA /* gdtoa-dmisc.c in Sources */, + C95B8470138F53DB004311DA /* gdtoa-dtoa.c in Sources */, + C95B8471138F53DB004311DA /* gdtoa-gdtoa.c in Sources */, + C95B8472138F53DB004311DA /* gdtoa-gethex.c in Sources */, + C95B8473138F53DB004311DA /* gdtoa-gmisc.c in Sources */, + C95B8474138F53DB004311DA /* gdtoa-hd_init.c in Sources */, + C95B8475138F53DB004311DA /* gdtoa-hexnan.c in Sources */, + C95B8476138F53DB004311DA /* gdtoa-misc.c in Sources */, + C95B8477138F53DB004311DA /* gdtoa-smisc.c in Sources */, + C95B8478138F53DB004311DA /* gdtoa-strtod.c in Sources */, + C95B8479138F53DB004311DA /* gdtoa-strtodg.c in Sources */, + C95B847A138F53DB004311DA /* gdtoa-strtof.c in Sources */, + C95B847B138F53DB004311DA /* gdtoa-strtoIg.c in Sources */, + C95B847C138F53DB004311DA /* gdtoa-strtopdd.c in Sources */, + C95B847D138F53DB004311DA /* gdtoa-strtopx.c in Sources */, + C95B847E138F53DB004311DA /* gdtoa-strtord.c in Sources */, + C95B847F138F53DB004311DA /* gdtoa-sum.c in Sources */, + C95B8480138F53DB004311DA /* gdtoa-ulp.c in Sources */, + C95B8481138F53DB004311DA /* glue.c in Sources */, + C95B8482138F53DB004311DA /* machdep_ldisd.c in Sources */, + C95B8483138F53DB004311DA /* machdep_ldisdd.c in Sources */, + C95B8484138F53DB004311DA /* machdep_ldisQ.c in Sources */, + C95B8485138F53DB004311DA /* machdep_ldisx.c in Sources */, + C95B848F138F53DB004311DA /* authentication.c in Sources */, + C95B8490138F53DB004311DA /* backtrace.c in Sources */, + C95B8492138F53DB004311DA /* confstr.c in Sources */, + C95B8493138F53DB004311DA /* crypt.c in Sources */, + C95B8494138F53DB004311DA /* devname.c in Sources */, + C95B8495138F53DB004311DA /* disklabel.c in Sources */, + C95B8496138F53DB004311DA /* errlst.c in Sources */, + C95B8497138F53DB004311DA /* filesec.c in Sources */, + 147CDFDF1B7C233100831EC6 /* clock_gettime.c in Sources */, + C95B8498138F53DB004311DA /* _rand48.c in Sources */, + C95B8499138F53DB004311DA /* alarm.c in Sources */, + C95B849A138F53DB004311DA /* arc4random.c in Sources */, + C95B849B138F53DB004311DA /* assert.c in Sources */, + C95B849C138F53DB004311DA /* basename.c in Sources */, + C95B849D138F53DB004311DA /* clock.c in Sources */, + C95B849E138F53DB004311DA /* closedir.c in Sources */, + C95B849F138F53DB004311DA /* ctermid.c in Sources */, + C95B84A0138F53DB004311DA /* daemon.c in Sources */, + C95B84A1138F53DB004311DA /* dirname.c in Sources */, + C95B84A2138F53DB004311DA /* drand48.c in Sources */, + C95B84A3138F53DB004311DA /* erand48.c in Sources */, + C95B84A4138F53DB004311DA /* err.c in Sources */, + C95B84A5138F53DB004311DA /* exec.c in Sources */, + C95B84A6138F53DB004311DA /* fmtcheck.c in Sources */, + C95B84A7138F53DB004311DA /* fmtmsg.c in Sources */, + C95B84A8138F53DB004311DA /* fnmatch.c in Sources */, + C95B84A9138F53DB004311DA /* ftok.c in Sources */, + C95B84AA138F53DB004311DA /* getbsize.c in Sources */, + C95B84AB138F53DB004311DA /* getcap.c in Sources */, + C95B84AC138F53DB004311DA /* getcwd.c in Sources */, + C95B84AD138F53DB004311DA /* gethostname.c in Sources */, + C95B84AE138F53DB004311DA /* getlogin.c in Sources */, + C95B84AF138F53DB004311DA /* getmntinfo.c in Sources */, + C95B84B0138F53DB004311DA /* getpagesize.c in Sources */, + C95B84B1138F53DB004311DA /* getpeereid.c in Sources */, + C95B84B2138F53DB004311DA /* getprogname.c in Sources */, + C95B84B3138F53DB004311DA /* glob.c in Sources */, + C95B84B4138F53DB004311DA /* isatty.c in Sources */, + C95B84B5138F53DB004311DA /* jrand48.c in Sources */, + C95B84B6138F53DB004311DA /* lcong48.c in Sources */, + C95B84B7138F53DB004311DA /* lockf.c in Sources */, + C95B84B8138F53DB004311DA /* lrand48.c in Sources */, + C95B84B9138F53DB004311DA /* mrand48.c in Sources */, + C95B84BA138F53DB004311DA /* nice.c in Sources */, + C95B84BB138F53DB004311DA /* nrand48.c in Sources */, + C95B84BC138F53DB004311DA /* opendir.c in Sources */, + C95B84BD138F53DB004311DA /* pause.c in Sources */, + C95B84BE138F53DB004311DA /* popen.c in Sources */, + C95B84C0138F53DB004311DA /* psignal.c in Sources */, + C95B84C1138F53DB004311DA /* raise.c in Sources */, + C95B84C2138F53DB004311DA /* readdir.c in Sources */, + C95B84C3138F53DB004311DA /* readpassphrase.c in Sources */, + C95B84C4138F53DB004311DA /* rewinddir.c in Sources */, + C95B84C5138F53DB004311DA /* scandir.c in Sources */, + C95B84C6138F53DB004311DA /* seed48.c in Sources */, + C95B84C7138F53DB004311DA /* seekdir.c in Sources */, + C95B84C8138F53DB004311DA /* sethostname.c in Sources */, + C95B84C9138F53DB004311DA /* setmode.c in Sources */, + C95B84CA138F53DB004311DA /* setprogname.c in Sources */, + C95B84CB138F53DB004311DA /* siginterrupt.c in Sources */, + C95B84CC138F53DB004311DA /* siglist.c in Sources */, + C95B84CD138F53DB004311DA /* signal.c in Sources */, + C95B84CE138F53DB004311DA /* sleep.c in Sources */, + C95B84CF138F53DB004311DA /* srand48.c in Sources */, + C95B84D0138F53DB004311DA /* stringlist.c in Sources */, + C95B84D1138F53DB004311DA /* sysconf.c in Sources */, + C95B84D2138F53DB004311DA /* sysctl.c in Sources */, + C95B84D3138F53DB004311DA /* sysctlbyname.c in Sources */, + C95B84D4138F53DB004311DA /* sysctlnametomib.c in Sources */, + C95B84D5138F53DB004311DA /* telldir.c in Sources */, + C95B84D6138F53DB004311DA /* termios.c in Sources */, + C95B84D7138F53DB004311DA /* time.c in Sources */, + C95B84D8138F53DB004311DA /* times.c in Sources */, + C95B84D9138F53DB004311DA /* timezone.c in Sources */, + C95B84DA138F53DB004311DA /* ttyname.c in Sources */, + C95B84DB138F53DB004311DA /* ttyslot.c in Sources */, + C95B84DC138F53DB004311DA /* ualarm.c in Sources */, + C95B84DD138F53DB004311DA /* ulimit.c in Sources */, + C95B84DE138F53DB004311DA /* unvis.c in Sources */, + C95B84DF138F53DB004311DA /* usleep.c in Sources */, + C95B84E0138F53DB004311DA /* utime.c in Sources */, + C95B84E1138F53DB004311DA /* vis.c in Sources */, + C95B84E2138F53DB004311DA /* wait.c in Sources */, + C95B84E3138F53DB004311DA /* wait3.c in Sources */, + C95B84E4138F53DB004311DA /* waitpid.c in Sources */, + C95B84E5138F53DB004311DA /* fts.c in Sources */, + C95B84E6138F53DB004311DA /* get_compat.c in Sources */, + C95B84E7138F53DB004311DA /* getloadavg.c in Sources */, + C95B84E8138F53DB004311DA /* getttyent.c in Sources */, + C95B84E9138F53DB004311DA /* getusershell.c in Sources */, + C95B84EA138F53DB004311DA /* getvfsbyname.c in Sources */, + C95B84EF138F53DB004311DA /* nanosleep.c in Sources */, + C95B84F0138F53DB004311DA /* utmpx.c in Sources */, + C95B84F1138F53DB004311DA /* nftw.c in Sources */, + C95B84F2138F53DB004311DA /* nlist.c in Sources */, + C95B84F4138F53DB004311DA /* oldsyslog.c in Sources */, + C95B84F7138F53DB004311DA /* setlogin.c in Sources */, + C95B84F8138F53DB004311DA /* sigsetops.c in Sources */, + C95B84FB138F53DB004311DA /* strtofflags.c in Sources */, + C95B84FD138F53DB004311DA /* thread_stack_pcs.c in Sources */, + C95B84FE138F53DB004311DA /* uname.c in Sources */, + C95B84FF138F53DB004311DA /* utmpx-darwin.c in Sources */, + C95B8500138F53DB004311DA /* wordexp.c in Sources */, + C95B8502138F53DB004311DA /* gmon.c in Sources */, + C95B8522138F53DB004311DA /* ascii.c in Sources */, + C95B8523138F53DB004311DA /* big5.c in Sources */, + C95B8524138F53DB004311DA /* btowc.c in Sources */, + C95B8525138F53DB004311DA /* collate.c in Sources */, + C95B8526138F53DB004311DA /* collcmp.c in Sources */, + C95B8527138F53DB004311DA /* euc.c in Sources */, + C95B8528138F53DB004311DA /* fix_grouping.c in Sources */, + C95B8529138F53DB004311DA /* gb18030.c in Sources */, + C95B852A138F53DB004311DA /* gb2312.c in Sources */, + C95B852B138F53DB004311DA /* gbk.c in Sources */, + C95B852C138F53DB004311DA /* ldpart.c in Sources */, + C95B852D138F53DB004311DA /* lmessages.c in Sources */, + C95B852E138F53DB004311DA /* lmonetary.c in Sources */, + C95B852F138F53DB004311DA /* lnumeric.c in Sources */, + C95B8530138F53DB004311DA /* localeconv.c in Sources */, + C95B8531138F53DB004311DA /* mblen.c in Sources */, + C95B8532138F53DB004311DA /* mbrlen.c in Sources */, + C95B8533138F53DB004311DA /* mbrtowc.c in Sources */, + C95B8534138F53DB004311DA /* mbsinit.c in Sources */, + C95B8535138F53DB004311DA /* mbsnrtowcs.c in Sources */, + C95B8536138F53DB004311DA /* mbsrtowcs.c in Sources */, + C95B8537138F53DB004311DA /* mbstowcs.c in Sources */, + C95B8538138F53DB004311DA /* mbtowc.c in Sources */, + C95B8539138F53DB004311DA /* mskanji.c in Sources */, + C95B853A138F53DB004311DA /* nextwctype.c in Sources */, + C95B853B138F53DB004311DA /* nl_langinfo.c in Sources */, + C95B853C138F53DB004311DA /* nomacros.c in Sources */, + C95B853D138F53DB004311DA /* none.c in Sources */, + C95B853E138F53DB004311DA /* rune.c in Sources */, + C95B853F138F53DB004311DA /* runetype.c in Sources */, + C95B8540138F53DB004311DA /* setlocale.c in Sources */, + C95B8541138F53DB004311DA /* setrunelocale.c in Sources */, + C95B8542138F53DB004311DA /* table.c in Sources */, + C95B8543138F53DB004311DA /* tolower.c in Sources */, + C95B8544138F53DB004311DA /* toupper.c in Sources */, + C95B8545138F53DB004311DA /* utf2.c in Sources */, + C95B8546138F53DB004311DA /* utf8.c in Sources */, + C95B8547138F53DB004311DA /* wcrtomb.c in Sources */, + C95B8548138F53DB004311DA /* wcsftime.c in Sources */, + C95B8549138F53DB004311DA /* wcsnrtombs.c in Sources */, + C95B854A138F53DB004311DA /* wcsrtombs.c in Sources */, + C95B854B138F53DB004311DA /* wcstod.c in Sources */, + C95B854C138F53DB004311DA /* wcstof.c in Sources */, + C95B854D138F53DB004311DA /* wcstoimax.c in Sources */, + C95B854E138F53DB004311DA /* wcstol.c in Sources */, + C95B854F138F53DB004311DA /* wcstold.c in Sources */, + C95B8550138F53DB004311DA /* wcstoll.c in Sources */, + C95B8551138F53DB004311DA /* wcstombs.c in Sources */, + C95B8552138F53DB004311DA /* wcstoul.c in Sources */, + C95B8553138F53DB004311DA /* wcstoull.c in Sources */, + C95B8554138F53DB004311DA /* wcstoumax.c in Sources */, + C95B8555138F53DB004311DA /* wctob.c in Sources */, + C95B8556138F53DB004311DA /* wctomb.c in Sources */, + C95B8557138F53DB004311DA /* wctrans.c in Sources */, + C95B8558138F53DB004311DA /* wctype.c in Sources */, + C95B8559138F53DB004311DA /* wcwidth.c in Sources */, + C95B855A138F53DB004311DA /* frune.c in Sources */, + C95B855B138F53DB004311DA /* isctype.c in Sources */, + C95B855C138F53DB004311DA /* iswctype.c in Sources */, + C95B855D138F53DB004311DA /* lconv.c in Sources */, + C95B855E138F53DB004311DA /* mbrune.c in Sources */, + C95B855F138F53DB004311DA /* runedepreciated.c in Sources */, + C95B8560138F53DB004311DA /* setinvalidrune.c in Sources */, + C95B8561138F53DB004311DA /* xlocale.c in Sources */, + C95B8562138F53DB004311DA /* addr2ascii.c in Sources */, + C95B8563138F53DB004311DA /* ascii2addr.c in Sources */, + C95B8564138F53DB004311DA /* inet_addr.c in Sources */, + C95B8565138F53DB004311DA /* inet_lnaof.c in Sources */, + C95B8566138F53DB004311DA /* inet_makeaddr.c in Sources */, + C95B8567138F53DB004311DA /* inet_net_ntop.c in Sources */, + C95B8568138F53DB004311DA /* inet_net_pton.c in Sources */, + C95B8569138F53DB004311DA /* inet_neta.c in Sources */, + C95B856A138F53DB004311DA /* inet_netof.c in Sources */, + C95B856B138F53DB004311DA /* inet_network.c in Sources */, + C95B856C138F53DB004311DA /* inet_ntoa.c in Sources */, + C95B856D138F53DB004311DA /* linkaddr.c in Sources */, + C95B856E138F53DB004311DA /* nsap_addr.c in Sources */, + C95B856F138F53DB004311DA /* recv.c in Sources */, + C95B8570138F53DB004311DA /* send.c in Sources */, + C95B8571138F53DB004311DA /* sockatmark.c in Sources */, + C95B8572138F53DB004311DA /* sourcefilter.c in Sources */, + C95B8573138F53DB004311DA /* msgcat.c in Sources */, + C95B8574138F53DB004311DA /* acl.c in Sources */, + C95B8575138F53DB004311DA /* acl_entry.c in Sources */, + C95B8576138F53DB004311DA /* acl_file.c in Sources */, + C95B8577138F53DB004311DA /* acl_flag.c in Sources */, + C95B8578138F53DB004311DA /* acl_perm.c in Sources */, + C95B8579138F53DB004311DA /* acl_translate.c in Sources */, + C95B858D138F53DB004311DA /* regerror.c in Sources */, + C95B859E138F53DB004311DA /* _flock_stub.c in Sources */, + C95B859F138F53DB004311DA /* asprintf.c in Sources */, + C95B85A0138F53DB004311DA /* clrerr.c in Sources */, + C95B85A1138F53DB004311DA /* dprintf.c in Sources */, + C95B85A2138F53DB004311DA /* fclose.c in Sources */, + C95B85A3138F53DB004311DA /* fdopen.c in Sources */, + C95B85A4138F53DB004311DA /* feof.c in Sources */, + C95B85A5138F53DB004311DA /* ferror.c in Sources */, + C95B85A6138F53DB004311DA /* fflush.c in Sources */, + C95B85A7138F53DB004311DA /* fgetc.c in Sources */, + C95B85A8138F53DB004311DA /* fgetln.c in Sources */, + C95B85A9138F53DB004311DA /* fgetpos.c in Sources */, + C95B85AA138F53DB004311DA /* fgets.c in Sources */, + C95B85AB138F53DB004311DA /* fgetwc.c in Sources */, + C95B85AC138F53DB004311DA /* fgetwln.c in Sources */, + C95B85AD138F53DB004311DA /* fgetws.c in Sources */, + C95B85AE138F53DB004311DA /* fileno.c in Sources */, + C95B85AF138F53DB004311DA /* findfp.c in Sources */, + C95B85B0138F53DB004311DA /* flags.c in Sources */, + C95B85B1138F53DB004311DA /* fopen.c in Sources */, + C95B85B2138F53DB004311DA /* fprintf.c in Sources */, + C95B85B3138F53DB004311DA /* fpurge.c in Sources */, + C95B85B4138F53DB004311DA /* fputc.c in Sources */, + C95B85B5138F53DB004311DA /* fputs.c in Sources */, + C95B85B6138F53DB004311DA /* fputwc.c in Sources */, + C95B85B7138F53DB004311DA /* fputws.c in Sources */, + C95B85B8138F53DB004311DA /* fread.c in Sources */, + C95B85B9138F53DB004311DA /* freopen.c in Sources */, + C95B85BA138F53DB004311DA /* fscanf.c in Sources */, + C95B85BB138F53DB004311DA /* fseek.c in Sources */, + C95B85BC138F53DB004311DA /* fsetpos.c in Sources */, + C95B85BD138F53DB004311DA /* ftell.c in Sources */, + C95B85BE138F53DB004311DA /* funopen.c in Sources */, + C95B85BF138F53DB004311DA /* fvwrite.c in Sources */, + C95B85C0138F53DB004311DA /* fwalk.c in Sources */, + C95B85C1138F53DB004311DA /* fwide.c in Sources */, + C95B85C2138F53DB004311DA /* fwprintf.c in Sources */, + C95B85C3138F53DB004311DA /* fwrite.c in Sources */, + C95B85C4138F53DB004311DA /* fwscanf.c in Sources */, + C95B85C5138F53DB004311DA /* getc.c in Sources */, + C95B85C6138F53DB004311DA /* getchar.c in Sources */, + C95B85C7138F53DB004311DA /* getdelim.c in Sources */, + C95B85C8138F53DB004311DA /* getline.c in Sources */, + 928BD1061D76073500EC01FC /* timingsafe_bcmp.c in Sources */, + C95B85C9138F53DB004311DA /* gets.c in Sources */, + C95B85CA138F53DB004311DA /* getw.c in Sources */, + C95B85CB138F53DB004311DA /* getwc.c in Sources */, + C95B85CC138F53DB004311DA /* getwchar.c in Sources */, + C95B85CD138F53DB004311DA /* makebuf.c in Sources */, + C95B85CE138F53DB004311DA /* mktemp.c in Sources */, + C95B85CF138F53DB004311DA /* perror.c in Sources */, + C95B85D0138F53DB004311DA /* printf-pos.c in Sources */, + C95B85D1138F53DB004311DA /* printf.c in Sources */, + C95B85D2138F53DB004311DA /* putc.c in Sources */, + C95B85D3138F53DB004311DA /* putchar.c in Sources */, + C95B85D4138F53DB004311DA /* puts.c in Sources */, + C95B85D5138F53DB004311DA /* putw.c in Sources */, + C95B85D6138F53DB004311DA /* putwc.c in Sources */, + C95B85D7138F53DB004311DA /* putwchar.c in Sources */, + C95B85D8138F53DB004311DA /* refill.c in Sources */, + C95B85D9138F53DB004311DA /* remove.c in Sources */, + C95B85DA138F53DB004311DA /* rewind.c in Sources */, + C95B85DB138F53DB004311DA /* rget.c in Sources */, + C95B85DC138F53DB004311DA /* scanf.c in Sources */, + C95B85DD138F53DB004311DA /* setbuf.c in Sources */, + C95B85DE138F53DB004311DA /* setbuffer.c in Sources */, + C95B85DF138F53DB004311DA /* setvbuf.c in Sources */, + C95B85E0138F53DB004311DA /* snprintf.c in Sources */, + C95B85E1138F53DB004311DA /* sprintf.c in Sources */, + C95B85E2138F53DB004311DA /* sscanf.c in Sources */, + C95B85E3138F53DB004311DA /* stdio.c in Sources */, + C95B85E4138F53DB004311DA /* swprintf.c in Sources */, + C95B85E5138F53DB004311DA /* swscanf.c in Sources */, + C95B85E6138F53DB004311DA /* tempnam.c in Sources */, + C95B85E7138F53DB004311DA /* tmpfile.c in Sources */, + C95B85E8138F53DB004311DA /* tmpnam.c in Sources */, + C95B85E9138F53DB004311DA /* ungetc.c in Sources */, + C95B85EA138F53DB004311DA /* ungetwc.c in Sources */, + C95B85EB138F53DB004311DA /* vasprintf.c in Sources */, + C95B85EC138F53DB004311DA /* vdprintf.c in Sources */, + C95B85ED138F53DB004311DA /* vfprintf.c in Sources */, + C95B85EE138F53DB004311DA /* vfscanf.c in Sources */, + C95B85EF138F53DB004311DA /* vfwprintf.c in Sources */, + C95B85F0138F53DB004311DA /* vfwscanf.c in Sources */, + C95B85F1138F53DB004311DA /* vprintf.c in Sources */, + C95B85F2138F53DB004311DA /* vscanf.c in Sources */, + C95B85F3138F53DB004311DA /* vsnprintf.c in Sources */, + C95B85F4138F53DB004311DA /* vsprintf.c in Sources */, + C95B85F5138F53DB004311DA /* vsscanf.c in Sources */, + C95B85F6138F53DB004311DA /* vswprintf.c in Sources */, + C95B85F7138F53DB004311DA /* vswscanf.c in Sources */, + C95B85F8138F53DB004311DA /* vwprintf.c in Sources */, + C95B85F9138F53DB004311DA /* vwscanf.c in Sources */, + C95B85FA138F53DB004311DA /* wbuf.c in Sources */, + C95B85FB138F53DB004311DA /* wprintf.c in Sources */, + C95B85FC138F53DB004311DA /* wscanf.c in Sources */, + C95B85FD138F53DB004311DA /* wsetup.c in Sources */, + C95B85FE138F53DB004311DA /* a64l.c in Sources */, + C95B85FF138F53DB004311DA /* _Exit_.c in Sources */, + C95B8600138F53DB004311DA /* abort.c in Sources */, + C95B8601138F53DB004311DA /* abs.c in Sources */, + C95B8602138F53DB004311DA /* atexit.c in Sources */, + C95B8603138F53DB004311DA /* atof.c in Sources */, + C95B8604138F53DB004311DA /* atoi.c in Sources */, + C95B8605138F53DB004311DA /* atol.c in Sources */, + C95B8606138F53DB004311DA /* atoll.c in Sources */, + C95B8607138F53DB004311DA /* bsearch.c in Sources */, + C95B8608138F53DB004311DA /* div.c in Sources */, + C95B8609138F53DB004311DA /* exit.c in Sources */, + C95B860A138F53DB004311DA /* getenv.c in Sources */, + C95B860B138F53DB004311DA /* getopt.c in Sources */, + C95B860C138F53DB004311DA /* getopt_long.c in Sources */, + C95B860D138F53DB004311DA /* getsubopt.c in Sources */, + C95B860E138F53DB004311DA /* hcreate.c in Sources */, + C95B860F138F53DB004311DA /* heapsort.c in Sources */, + C95B8610138F53DB004311DA /* heapsort_b.c in Sources */, + C95B8611138F53DB004311DA /* heapsort_r.c in Sources */, + C95B8612138F53DB004311DA /* imaxabs.c in Sources */, + C95B8613138F53DB004311DA /* imaxdiv.c in Sources */, + C95B8614138F53DB004311DA /* insque.c in Sources */, + C95B8615138F53DB004311DA /* labs.c in Sources */, + C95B8616138F53DB004311DA /* ldiv.c in Sources */, + C95B8617138F53DB004311DA /* llabs.c in Sources */, + C95B8618138F53DB004311DA /* lldiv.c in Sources */, + C95B8619138F53DB004311DA /* lsearch.c in Sources */, + C95B861A138F53DB004311DA /* merge.c in Sources */, + C95B861B138F53DB004311DA /* putenv.c in Sources */, + C95B861C138F53DB004311DA /* qsort.c in Sources */, + C95B861D138F53DB004311DA /* qsort_r.c in Sources */, + C95B861E138F53DB004311DA /* radixsort.c in Sources */, + C95B861F138F53DB004311DA /* rand.c in Sources */, + C95B8620138F53DB004311DA /* random.c in Sources */, + C95B8621138F53DB004311DA /* reallocf.c in Sources */, + C95B8622138F53DB004311DA /* realpath.c in Sources */, + C95B8623138F53DB004311DA /* remque.c in Sources */, + C95B8624138F53DB004311DA /* setenv.c in Sources */, + C95B8625138F53DB004311DA /* strhash.c in Sources */, + C95B8626138F53DB004311DA /* strtoimax.c in Sources */, + 922D0C1221BFA1A40072834D /* timespec_get.c in Sources */, + C95B8627138F53DB004311DA /* strtol.c in Sources */, + C95B8628138F53DB004311DA /* strtoll.c in Sources */, + C95B8629138F53DB004311DA /* strtoq.c in Sources */, + C95B862A138F53DB004311DA /* strtoul.c in Sources */, + C95B862B138F53DB004311DA /* strtoull.c in Sources */, + C95B862C138F53DB004311DA /* strtoumax.c in Sources */, + C95B862D138F53DB004311DA /* strtouq.c in Sources */, + C95B862E138F53DB004311DA /* system.c in Sources */, + C95B862F138F53DB004311DA /* tdelete.c in Sources */, + C95B8630138F53DB004311DA /* tfind.c in Sources */, + C95B8631138F53DB004311DA /* tsearch.c in Sources */, + C95B8632138F53DB004311DA /* twalk.c in Sources */, + C95B8633138F53DB004311DA /* grantpt.c in Sources */, + C95B8634138F53DB004311DA /* l64a.c in Sources */, + C95B8635138F53DB004311DA /* strfmon.c in Sources */, + C95B8636138F53DB004311DA /* ecvt.c in Sources */, + C95B8637138F53DB004311DA /* gcvt.c in Sources */, + C95B8638138F53DB004311DA /* qsort_b.c in Sources */, + C95B8639138F53DB004311DA /* asctime.c in Sources */, + C95B863A138F53DB004311DA /* difftime.c in Sources */, + C95B863B138F53DB004311DA /* ftime.c in Sources */, + C95B863C138F53DB004311DA /* localtime.c in Sources */, + C95B863D138F53DB004311DA /* strftime.c in Sources */, + C95B863E138F53DB004311DA /* strptime.c in Sources */, + C95B863F138F53DB004311DA /* time32.c in Sources */, + C95B8640138F53DB004311DA /* timelocal.c in Sources */, + C95B8641138F53DB004311DA /* getdate.c in Sources */, + C95B8642138F53DB004311DA /* timezone_unix03.c in Sources */, + C95B864B138F53DB004311DA /* memmem.c in Sources */, + C95B864E138F53DB004311DA /* rindex.c in Sources */, + C95B8651138F53DB004311DA /* strcasecmp.c in Sources */, + C95B8652138F53DB004311DA /* strcasestr.c in Sources */, + C95B8656138F53DB004311DA /* strcoll.c in Sources */, + C95B8658138F53DB004311DA /* strcspn.c in Sources */, + C95B8659138F53DB004311DA /* strdup.c in Sources */, + C95B865A138F53DB004311DA /* strerror.c in Sources */, + C95B865E138F53DB004311DA /* strmode.c in Sources */, + C95B8662138F53DB004311DA /* strndup.c in Sources */, + C95B8664138F53DB004311DA /* strnstr.c in Sources */, + C95B8665138F53DB004311DA /* strpbrk.c in Sources */, + C95B8666138F53DB004311DA /* strrchr.c in Sources */, + C95B8667138F53DB004311DA /* strsep.c in Sources */, + C95B8668138F53DB004311DA /* strsignal.c in Sources */, + C95B8669138F53DB004311DA /* strspn.c in Sources */, + C95B866B138F53DB004311DA /* strtok.c in Sources */, + C95B866C138F53DB004311DA /* strxfrm.c in Sources */, + C95B866D138F53DB004311DA /* swab.c in Sources */, + C95B866E138F53DB004311DA /* wcpcpy.c in Sources */, + C95B866F138F53DB004311DA /* wcpncpy.c in Sources */, + C95B8670138F53DB004311DA /* wcscasecmp.c in Sources */, + C95B8671138F53DB004311DA /* wcscat.c in Sources */, + C95B8672138F53DB004311DA /* wcschr.c in Sources */, + C95B8673138F53DB004311DA /* wcscmp.c in Sources */, + C95B8674138F53DB004311DA /* wcscoll.c in Sources */, + C95B8675138F53DB004311DA /* wcscpy.c in Sources */, + C95B8676138F53DB004311DA /* wcscspn.c in Sources */, + C95B8677138F53DB004311DA /* wcsdup.c in Sources */, + C95B8678138F53DB004311DA /* wcslcat.c in Sources */, + C95B8679138F53DB004311DA /* wcslcpy.c in Sources */, + C95B867A138F53DB004311DA /* wcslen.c in Sources */, + C95B867B138F53DB004311DA /* wcsncasecmp.c in Sources */, + C95B867C138F53DB004311DA /* wcsncat.c in Sources */, + C95B867D138F53DB004311DA /* wcsncmp.c in Sources */, + C95B867E138F53DB004311DA /* wcsncpy.c in Sources */, + C95B867F138F53DB004311DA /* wcsnlen.c in Sources */, + C95B8680138F53DB004311DA /* wcspbrk.c in Sources */, + C95B8681138F53DB004311DA /* wcsrchr.c in Sources */, + C95B8682138F53DB004311DA /* wcsspn.c in Sources */, + C95B8683138F53DB004311DA /* wcsstr.c in Sources */, + C95B8684138F53DB004311DA /* wcstok.c in Sources */, + C95B8685138F53DB004311DA /* wcswidth.c in Sources */, + C95B8686138F53DB004311DA /* wcsxfrm.c in Sources */, + C95B8687138F53DB004311DA /* wmemchr.c in Sources */, + C95B8688138F53DB004311DA /* wmemcmp.c in Sources */, + C95B8689138F53DB004311DA /* wmemcpy.c in Sources */, + 2DF67CE4184F9CBE00B83A3D /* debug_private.c in Sources */, + C95B868A138F53DB004311DA /* wmemmove.c in Sources */, + C95B868B138F53DB004311DA /* wmemset.c in Sources */, + C95B868C138F53DB004311DA /* _libc_init.c in Sources */, + C95B868D138F53DB004311DA /* _libc_fork_child.c in Sources */, + C95B868E138F53DB004311DA /* chmodx_np.c in Sources */, + C95B8690138F53DB004311DA /* crt_externs.c in Sources */, + C95B8692138F53DB004311DA /* fork.c in Sources */, + C95B8693138F53DB004311DA /* getgroups.c in Sources */, + C95B8695138F53DB004311DA /* gettimeofday.c in Sources */, + C95B8696138F53DB004311DA /* msgctl.c in Sources */, + C95B8697138F53DB004311DA /* stack_protector.c in Sources */, + C95B8698138F53DB004311DA /* openx_np.c in Sources */, + C95B8699138F53DB004311DA /* OSMemoryNotification.c in Sources */, + C95B869A138F53DB004311DA /* OSThermalNotification.c in Sources */, + C95B869B138F53DB004311DA /* posix_spawn.c in Sources */, + C95B869C138F53DB004311DA /* semctl.c in Sources */, + C95B869D138F53DB004311DA /* settimeofday.c in Sources */, + C95B869E138F53DB004311DA /* shmctl.c in Sources */, + C95B869F138F53DB004311DA /* sigaction.c in Sources */, + C95B86A3138F53DB004311DA /* statx_np.c in Sources */, + C95B86A4138F53DB004311DA /* umaskx_np.c in Sources */, + C95B86A8138F53DB004311DA /* fparseln.c in Sources */, + C95B86A9138F53DB004311DA /* login.c in Sources */, + C95B86AA138F53DB004311DA /* login_tty.c in Sources */, + C95B86AB138F53DB004311DA /* logout.c in Sources */, + C95B86AC138F53DB004311DA /* logwtmp.c in Sources */, + 3F76864A13E91D3700C94D25 /* mkpath_np.c in Sources */, + C95B86AD138F53DB004311DA /* opendev.c in Sources */, + C95B86AE138F53DB004311DA /* pty.c in Sources */, + C95B86AF138F53DB004311DA /* clear.c in Sources */, + C95B86B0138F53DB004311DA /* compare.c in Sources */, + C95B86B1138F53DB004311DA /* copy.c in Sources */, + C95B86B2138F53DB004311DA /* gen_uuid.c in Sources */, + C95B86B3138F53DB004311DA /* isnull.c in Sources */, + C95B86B4138F53DB004311DA /* pack.c in Sources */, + C95B86B5138F53DB004311DA /* parse.c in Sources */, + C95B86B6138F53DB004311DA /* unpack.c in Sources */, + C95B86B7138F53DB004311DA /* unparse.c in Sources */, + B19C64611450F90200032373 /* sync_volume_np.c in Sources */, + 3FB7E1B9146EF2E000843438 /* dirfd.c in Sources */, + 4B2C64A815519BC700342BFA /* assumes.c in Sources */, + FC2ED616157D4BE80098EC69 /* inet_ntop.c in Sources */, + FC2ED61F157D4BE80098EC69 /* inet_pton.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C97A6F231517AF53005E1998 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C97A6F291517AF53005E1998 /* mcount.s in Sources */, + C97A6F6D1517AF53005E1998 /* mcount.s in Sources */, + C97A6F761517AF53005E1998 /* (null) in Sources */, + C97A6F791517AF53005E1998 /* (null) in Sources */, + C97A6F7A1517AF53005E1998 /* (null) in Sources */, + C97A6F7E1517AF53005E1998 /* (null) in Sources */, + C97A6F961517AF53005E1998 /* creat.c in Sources */, + C97A6F971517AF53005E1998 /* gethostid.c in Sources */, + C97A6F981517AF53005E1998 /* getwd.c in Sources */, + C97A6F991517AF53005E1998 /* killpg.c in Sources */, + C97A6F9A1517AF53005E1998 /* sethostid.c in Sources */, + C97A6F9B1517AF53005E1998 /* setpgrp.c in Sources */, + C97A6F9C1517AF53005E1998 /* setrgid.c in Sources */, + C97A6F9D1517AF53005E1998 /* setruid.c in Sources */, + C97A6F9E1517AF53005E1998 /* setregid.c in Sources */, + C97A6F9F1517AF53005E1998 /* setreuid.c in Sources */, + C97A6FA01517AF53005E1998 /* sigaltstk.c in Sources */, + C97A6FA11517AF53005E1998 /* sigcompat.c in Sources */, + C97A6FA31517AF53005E1998 /* kvm.c in Sources */, + C97A6FA71517AF53005E1998 /* forceLibcToBuild.c in Sources */, + C97A6FA81517AF53005E1998 /* bt_close.c in Sources */, + C97A6FA91517AF53005E1998 /* bt_conv.c in Sources */, + C97A6FAA1517AF53005E1998 /* bt_debug.c in Sources */, + C97A6FAB1517AF53005E1998 /* bt_delete.c in Sources */, + C97A6FAC1517AF53005E1998 /* bt_get.c in Sources */, + C97A6FAD1517AF53005E1998 /* bt_open.c in Sources */, + C97A6FAE1517AF53005E1998 /* bt_overflow.c in Sources */, + C97A6FAF1517AF53005E1998 /* bt_page.c in Sources */, + C97A6FB01517AF53005E1998 /* bt_put.c in Sources */, + C97A6FB11517AF53005E1998 /* bt_search.c in Sources */, + C97A6FB21517AF53005E1998 /* bt_seq.c in Sources */, + C97A6FB31517AF53005E1998 /* bt_split.c in Sources */, + C97A6FB41517AF53005E1998 /* bt_utils.c in Sources */, + C97A6FB51517AF53005E1998 /* db.c in Sources */, + C97A6FB61517AF53005E1998 /* hash.c in Sources */, + C97A6FB71517AF53005E1998 /* hash_bigkey.c in Sources */, + C97A6FB81517AF53005E1998 /* hash_buf.c in Sources */, + C97A6FB91517AF53005E1998 /* hash_func.c in Sources */, + C97A6FBA1517AF53005E1998 /* hash_log2.c in Sources */, + C97A6FBB1517AF53005E1998 /* hash_page.c in Sources */, + C97A6FBC1517AF53005E1998 /* ndbm.c in Sources */, + C97A6FBD1517AF53005E1998 /* mpool.c in Sources */, + C97A6FBE1517AF53005E1998 /* rec_close.c in Sources */, + C97A6FBF1517AF53005E1998 /* rec_delete.c in Sources */, + C97A6FC01517AF53005E1998 /* rec_get.c in Sources */, + C97A6FC11517AF53005E1998 /* rec_open.c in Sources */, + C97A6FC21517AF53005E1998 /* rec_put.c in Sources */, + C97A6FC31517AF53005E1998 /* rec_search.c in Sources */, + C97A6FC41517AF53005E1998 /* rec_seq.c in Sources */, + C97A6FC51517AF53005E1998 /* rec_utils.c in Sources */, + C97A6FC61517AF53005E1998 /* brk.c in Sources */, + C97A6FC71517AF53005E1998 /* bsd_signal.c in Sources */, + C97A6FC81517AF53005E1998 /* lchflags.c in Sources */, + C97A6FC91517AF53005E1998 /* lchmod.c in Sources */, + C97A6FCA1517AF53005E1998 /* lutimes.c in Sources */, + C97A6FCB1517AF53005E1998 /* statvfs.c in Sources */, + C97A6FCC1517AF53005E1998 /* tcgetsid.c in Sources */, + C97A6FCD1517AF53005E1998 /* _ldbl_util.c in Sources */, + C97A6FCE1517AF53005E1998 /* _hdtoa.c in Sources */, + C97A6FCF1517AF53005E1998 /* _ldtoa.c in Sources */, + C97A6FD01517AF53005E1998 /* gdtoa-dmisc.c in Sources */, + C97A6FD11517AF53005E1998 /* gdtoa-dtoa.c in Sources */, + C97A6FD21517AF53005E1998 /* gdtoa-gdtoa.c in Sources */, + C97A6FD31517AF53005E1998 /* gdtoa-gethex.c in Sources */, + C97A6FD41517AF53005E1998 /* gdtoa-gmisc.c in Sources */, + C97A6FD51517AF53005E1998 /* gdtoa-hd_init.c in Sources */, + C97A6FD61517AF53005E1998 /* gdtoa-hexnan.c in Sources */, + C97A6FD71517AF53005E1998 /* gdtoa-misc.c in Sources */, + C97A6FD81517AF53005E1998 /* gdtoa-smisc.c in Sources */, + C97A6FD91517AF53005E1998 /* gdtoa-strtod.c in Sources */, + C97A6FDA1517AF53005E1998 /* gdtoa-strtodg.c in Sources */, + C97A6FDB1517AF53005E1998 /* gdtoa-strtof.c in Sources */, + C97A6FDC1517AF53005E1998 /* gdtoa-strtoIg.c in Sources */, + C97A6FDD1517AF53005E1998 /* gdtoa-strtopdd.c in Sources */, + C97A6FDE1517AF53005E1998 /* gdtoa-strtopx.c in Sources */, + C97A6FDF1517AF53005E1998 /* gdtoa-strtord.c in Sources */, + C97A6FE01517AF53005E1998 /* gdtoa-sum.c in Sources */, + C97A6FE11517AF53005E1998 /* gdtoa-ulp.c in Sources */, + C97A6FE21517AF53005E1998 /* glue.c in Sources */, + C97A6FE31517AF53005E1998 /* machdep_ldisd.c in Sources */, + C97A6FE41517AF53005E1998 /* machdep_ldisdd.c in Sources */, + C97A6FE51517AF53005E1998 /* machdep_ldisQ.c in Sources */, + C97A6FE61517AF53005E1998 /* machdep_ldisx.c in Sources */, + C97A6FF01517AF53005E1998 /* authentication.c in Sources */, + C97A6FF11517AF53005E1998 /* backtrace.c in Sources */, + C97A6FF31517AF53005E1998 /* confstr.c in Sources */, + C97A6FF41517AF53005E1998 /* crypt.c in Sources */, + C97A6FF51517AF53005E1998 /* devname.c in Sources */, + C97A6FF61517AF53005E1998 /* disklabel.c in Sources */, + C97A6FF71517AF53005E1998 /* errlst.c in Sources */, + C97A6FF81517AF53005E1998 /* filesec.c in Sources */, + C97A6FF91517AF53005E1998 /* _rand48.c in Sources */, + C97A6FFA1517AF53005E1998 /* alarm.c in Sources */, + C97A6FFB1517AF53005E1998 /* arc4random.c in Sources */, + C97A6FFC1517AF53005E1998 /* assert.c in Sources */, + C97A6FFD1517AF53005E1998 /* basename.c in Sources */, + C97A6FFE1517AF53005E1998 /* clock.c in Sources */, + C97A6FFF1517AF53005E1998 /* closedir.c in Sources */, + C97A70001517AF53005E1998 /* ctermid.c in Sources */, + C97A70011517AF53005E1998 /* daemon.c in Sources */, + C97A70021517AF53005E1998 /* dirname.c in Sources */, + C97A70031517AF53005E1998 /* drand48.c in Sources */, + C97A70041517AF53005E1998 /* erand48.c in Sources */, + C97A70051517AF53005E1998 /* err.c in Sources */, + C97A70061517AF53005E1998 /* exec.c in Sources */, + C97A70071517AF53005E1998 /* fmtcheck.c in Sources */, + C97A70081517AF53005E1998 /* fmtmsg.c in Sources */, + C97A70091517AF53005E1998 /* fnmatch.c in Sources */, + C97A700A1517AF53005E1998 /* ftok.c in Sources */, + C97A700B1517AF53005E1998 /* getbsize.c in Sources */, + C97A700C1517AF53005E1998 /* getcap.c in Sources */, + C97A700D1517AF53005E1998 /* getcwd.c in Sources */, + C97A700E1517AF53005E1998 /* gethostname.c in Sources */, + C97A700F1517AF53005E1998 /* getlogin.c in Sources */, + C97A70101517AF53005E1998 /* getmntinfo.c in Sources */, + C97A70111517AF53005E1998 /* getpagesize.c in Sources */, + C97A70121517AF53005E1998 /* getpeereid.c in Sources */, + C97A70131517AF53005E1998 /* getprogname.c in Sources */, + C97A70141517AF53005E1998 /* glob.c in Sources */, + C97A70151517AF53005E1998 /* isatty.c in Sources */, + C97A70161517AF53005E1998 /* jrand48.c in Sources */, + C97A70171517AF53005E1998 /* lcong48.c in Sources */, + C97A70181517AF53005E1998 /* lockf.c in Sources */, + C97A70191517AF53005E1998 /* lrand48.c in Sources */, + C97A701A1517AF53005E1998 /* mrand48.c in Sources */, + C97A701B1517AF53005E1998 /* nice.c in Sources */, + C97A701C1517AF53005E1998 /* nrand48.c in Sources */, + C97A701D1517AF53005E1998 /* opendir.c in Sources */, + C97A701E1517AF53005E1998 /* pause.c in Sources */, + C97A701F1517AF53005E1998 /* popen.c in Sources */, + C97A70211517AF53005E1998 /* psignal.c in Sources */, + C97A70221517AF53005E1998 /* raise.c in Sources */, + C97A70231517AF53005E1998 /* readdir.c in Sources */, + C97A70241517AF53005E1998 /* readpassphrase.c in Sources */, + C97A70251517AF53005E1998 /* rewinddir.c in Sources */, + C97A70261517AF53005E1998 /* scandir.c in Sources */, + C97A70271517AF53005E1998 /* seed48.c in Sources */, + C97A70281517AF53005E1998 /* seekdir.c in Sources */, + C97A70291517AF53005E1998 /* sethostname.c in Sources */, + C97A702A1517AF53005E1998 /* setmode.c in Sources */, + C97A702B1517AF53005E1998 /* setprogname.c in Sources */, + C97A702C1517AF53005E1998 /* siginterrupt.c in Sources */, + C97A702D1517AF53005E1998 /* siglist.c in Sources */, + C97A702E1517AF53005E1998 /* signal.c in Sources */, + C97A702F1517AF53005E1998 /* sleep.c in Sources */, + C97A70301517AF53005E1998 /* srand48.c in Sources */, + C97A70311517AF53005E1998 /* stringlist.c in Sources */, + C97A70321517AF53005E1998 /* sysconf.c in Sources */, + C97A70331517AF53005E1998 /* sysctl.c in Sources */, + C97A70341517AF53005E1998 /* sysctlbyname.c in Sources */, + C97A70351517AF53005E1998 /* sysctlnametomib.c in Sources */, + C97A70361517AF53005E1998 /* telldir.c in Sources */, + C97A70371517AF53005E1998 /* termios.c in Sources */, + C97A70381517AF53005E1998 /* time.c in Sources */, + C97A70391517AF53005E1998 /* times.c in Sources */, + C97A703A1517AF53005E1998 /* timezone.c in Sources */, + C97A703B1517AF53005E1998 /* ttyname.c in Sources */, + C97A703C1517AF53005E1998 /* ttyslot.c in Sources */, + C97A703D1517AF53005E1998 /* ualarm.c in Sources */, + C97A703E1517AF53005E1998 /* ulimit.c in Sources */, + C97A703F1517AF53005E1998 /* unvis.c in Sources */, + C97A70401517AF53005E1998 /* usleep.c in Sources */, + C97A70411517AF53005E1998 /* utime.c in Sources */, + C97A70421517AF53005E1998 /* vis.c in Sources */, + C97A70431517AF53005E1998 /* wait.c in Sources */, + C97A70441517AF53005E1998 /* wait3.c in Sources */, + C97A70451517AF53005E1998 /* waitpid.c in Sources */, + C97A70461517AF53005E1998 /* fts.c in Sources */, + C97A70471517AF53005E1998 /* get_compat.c in Sources */, + C97A70481517AF53005E1998 /* getloadavg.c in Sources */, + C97A70491517AF53005E1998 /* getttyent.c in Sources */, + C97A704A1517AF53005E1998 /* getusershell.c in Sources */, + C97A704B1517AF53005E1998 /* getvfsbyname.c in Sources */, + C97A70501517AF53005E1998 /* nanosleep.c in Sources */, + C97A70511517AF53005E1998 /* utmpx.c in Sources */, + C97A70521517AF53005E1998 /* nftw.c in Sources */, + C97A70531517AF53005E1998 /* nlist.c in Sources */, + C97A70551517AF53005E1998 /* oldsyslog.c in Sources */, + C97A70581517AF53005E1998 /* setlogin.c in Sources */, + C97A70591517AF53005E1998 /* sigsetops.c in Sources */, + C97A705C1517AF53005E1998 /* strtofflags.c in Sources */, + C97A705E1517AF53005E1998 /* thread_stack_pcs.c in Sources */, + C97A705F1517AF53005E1998 /* uname.c in Sources */, + C97A70601517AF53005E1998 /* utmpx-darwin.c in Sources */, + C97A70611517AF53005E1998 /* wordexp.c in Sources */, + C97A70621517AF53005E1998 /* gmon.c in Sources */, + C97A70701517AF53005E1998 /* ascii.c in Sources */, + C97A70711517AF53005E1998 /* big5.c in Sources */, + C97A70721517AF53005E1998 /* btowc.c in Sources */, + C97A70731517AF53005E1998 /* collate.c in Sources */, + C97A70741517AF53005E1998 /* collcmp.c in Sources */, + C97A70751517AF53005E1998 /* euc.c in Sources */, + C97A70761517AF53005E1998 /* fix_grouping.c in Sources */, + C97A70771517AF53005E1998 /* gb18030.c in Sources */, + C97A70781517AF53005E1998 /* gb2312.c in Sources */, + C97A70791517AF53005E1998 /* gbk.c in Sources */, + C97A707A1517AF53005E1998 /* ldpart.c in Sources */, + C97A707B1517AF53005E1998 /* lmessages.c in Sources */, + C97A707C1517AF53005E1998 /* lmonetary.c in Sources */, + C97A707D1517AF53005E1998 /* lnumeric.c in Sources */, + C97A707E1517AF53005E1998 /* localeconv.c in Sources */, + C97A707F1517AF53005E1998 /* mblen.c in Sources */, + C97A70801517AF53005E1998 /* mbrlen.c in Sources */, + C97A70811517AF53005E1998 /* mbrtowc.c in Sources */, + C97A70821517AF53005E1998 /* mbsinit.c in Sources */, + C97A70831517AF53005E1998 /* mbsnrtowcs.c in Sources */, + C97A70841517AF53005E1998 /* mbsrtowcs.c in Sources */, + C97A70851517AF53005E1998 /* mbstowcs.c in Sources */, + C97A70861517AF53005E1998 /* mbtowc.c in Sources */, + C97A70871517AF53005E1998 /* mskanji.c in Sources */, + C97A70881517AF53005E1998 /* nextwctype.c in Sources */, + C97A70891517AF53005E1998 /* nl_langinfo.c in Sources */, + C97A708A1517AF53005E1998 /* nomacros.c in Sources */, + C97A708B1517AF53005E1998 /* none.c in Sources */, + C97A708C1517AF53005E1998 /* rune.c in Sources */, + C97A708D1517AF53005E1998 /* runetype.c in Sources */, + C97A708E1517AF53005E1998 /* setlocale.c in Sources */, + 2DF67CDF184F9CBE00B83A3D /* debug_private.c in Sources */, + C97A708F1517AF53005E1998 /* setrunelocale.c in Sources */, + C97A70901517AF53005E1998 /* table.c in Sources */, + C97A70911517AF53005E1998 /* tolower.c in Sources */, + C97A70921517AF53005E1998 /* toupper.c in Sources */, + C97A70931517AF53005E1998 /* utf2.c in Sources */, + C97A70941517AF53005E1998 /* utf8.c in Sources */, + C97A70951517AF53005E1998 /* wcrtomb.c in Sources */, + C97A70961517AF53005E1998 /* wcsftime.c in Sources */, + C97A70971517AF53005E1998 /* wcsnrtombs.c in Sources */, + C97A70981517AF53005E1998 /* wcsrtombs.c in Sources */, + C97A70991517AF53005E1998 /* wcstod.c in Sources */, + C97A709A1517AF53005E1998 /* wcstof.c in Sources */, + C97A709B1517AF53005E1998 /* wcstoimax.c in Sources */, + C97A709C1517AF53005E1998 /* wcstol.c in Sources */, + C97A709D1517AF53005E1998 /* wcstold.c in Sources */, + C97A709E1517AF53005E1998 /* wcstoll.c in Sources */, + C97A709F1517AF53005E1998 /* wcstombs.c in Sources */, + C97A70A01517AF53005E1998 /* wcstoul.c in Sources */, + C97A70A11517AF53005E1998 /* wcstoull.c in Sources */, + C97A70A21517AF53005E1998 /* wcstoumax.c in Sources */, + C97A70A31517AF53005E1998 /* wctob.c in Sources */, + C97A70A41517AF53005E1998 /* wctomb.c in Sources */, + C97A70A51517AF53005E1998 /* wctrans.c in Sources */, + C97A70A61517AF53005E1998 /* wctype.c in Sources */, + C97A70A71517AF53005E1998 /* wcwidth.c in Sources */, + C97A70A81517AF53005E1998 /* frune.c in Sources */, + C97A70A91517AF53005E1998 /* isctype.c in Sources */, + C97A70AA1517AF53005E1998 /* iswctype.c in Sources */, + C97A70AB1517AF53005E1998 /* lconv.c in Sources */, + C97A70AC1517AF53005E1998 /* mbrune.c in Sources */, + C97A70AD1517AF53005E1998 /* runedepreciated.c in Sources */, + C97A70AE1517AF53005E1998 /* setinvalidrune.c in Sources */, + 7756338A22F3B53B002F1707 /* rpmatch.c in Sources */, + C97A70AF1517AF53005E1998 /* xlocale.c in Sources */, + C97A70B01517AF53005E1998 /* addr2ascii.c in Sources */, + C97A70B11517AF53005E1998 /* ascii2addr.c in Sources */, + C97A70B21517AF53005E1998 /* inet_addr.c in Sources */, + C97A70B31517AF53005E1998 /* inet_lnaof.c in Sources */, + C97A70B41517AF53005E1998 /* inet_makeaddr.c in Sources */, + C97A70B51517AF53005E1998 /* inet_net_ntop.c in Sources */, + C97A70B61517AF53005E1998 /* inet_net_pton.c in Sources */, + C97A70B71517AF53005E1998 /* inet_neta.c in Sources */, + C97A70B81517AF53005E1998 /* inet_netof.c in Sources */, + C97A70B91517AF53005E1998 /* inet_network.c in Sources */, + C97A70BA1517AF53005E1998 /* inet_ntoa.c in Sources */, + C97A70BB1517AF53005E1998 /* linkaddr.c in Sources */, + C97A70BC1517AF53005E1998 /* nsap_addr.c in Sources */, + C97A70BD1517AF53005E1998 /* recv.c in Sources */, + C97A70BE1517AF53005E1998 /* send.c in Sources */, + C97A70BF1517AF53005E1998 /* sockatmark.c in Sources */, + C97A70C01517AF53005E1998 /* sourcefilter.c in Sources */, + C97A70C11517AF53005E1998 /* msgcat.c in Sources */, + C97A70C21517AF53005E1998 /* acl.c in Sources */, + C97A70C31517AF53005E1998 /* acl_entry.c in Sources */, + C97A70C41517AF53005E1998 /* acl_file.c in Sources */, + C97A70C51517AF53005E1998 /* acl_flag.c in Sources */, + C97A70C61517AF53005E1998 /* acl_perm.c in Sources */, + C97A70C71517AF53005E1998 /* acl_translate.c in Sources */, + C97A70D11517AF53005E1998 /* regerror.c in Sources */, + C97A70D21517AF53005E1998 /* chk_fail.c in Sources */, + C97A70D31517AF53005E1998 /* memcpy_chk.c in Sources */, + C97A70D41517AF53005E1998 /* memmove_chk.c in Sources */, + C97A70D51517AF53005E1998 /* memset_chk.c in Sources */, + C97A70D61517AF53005E1998 /* snprintf_chk.c in Sources */, + C97A70D71517AF53005E1998 /* sprintf_chk.c in Sources */, + C97A70D81517AF53005E1998 /* stpcpy_chk.c in Sources */, + C97A70D91517AF53005E1998 /* stpncpy_chk.c in Sources */, + C97A70DA1517AF53005E1998 /* strcat_chk.c in Sources */, + C97A70DB1517AF53005E1998 /* strcpy_chk.c in Sources */, + 922D0C0D21BFA19B0072834D /* timespec_get.c in Sources */, + 3FA8F3251643AB8100D37078 /* strlcat_chk.c in Sources */, + 3FA8F3261643AB8100D37078 /* strlcpy_chk.c in Sources */, + C97A70DC1517AF53005E1998 /* strncat_chk.c in Sources */, + C97A70DD1517AF53005E1998 /* strncpy_chk.c in Sources */, + C97A70DE1517AF53005E1998 /* vsnprintf_chk.c in Sources */, + C97A70DF1517AF53005E1998 /* vsprintf_chk.c in Sources */, + C97A70E01517AF53005E1998 /* _flock_stub.c in Sources */, + C97A70E11517AF53005E1998 /* asprintf.c in Sources */, + C97A70E21517AF53005E1998 /* clrerr.c in Sources */, + C97A70E31517AF53005E1998 /* dprintf.c in Sources */, + C97A70E41517AF53005E1998 /* fclose.c in Sources */, + C97A70E51517AF53005E1998 /* fdopen.c in Sources */, + C97A70E61517AF53005E1998 /* feof.c in Sources */, + C97A70E71517AF53005E1998 /* ferror.c in Sources */, + C97A70E81517AF53005E1998 /* fflush.c in Sources */, + C97A70E91517AF53005E1998 /* fgetc.c in Sources */, + C97A70EA1517AF53005E1998 /* fgetln.c in Sources */, + C97A70EB1517AF53005E1998 /* fgetpos.c in Sources */, + C97A70EC1517AF53005E1998 /* fgets.c in Sources */, + C97A70ED1517AF53005E1998 /* fgetwc.c in Sources */, + C97A70EE1517AF53005E1998 /* fgetwln.c in Sources */, + C97A70EF1517AF53005E1998 /* fgetws.c in Sources */, + C97A70F01517AF53005E1998 /* fileno.c in Sources */, + C97A70F11517AF53005E1998 /* findfp.c in Sources */, + C97A70F21517AF53005E1998 /* flags.c in Sources */, + 3FD14575171D42B300B7BAF5 /* bcopy.c in Sources */, + C97A70F31517AF53005E1998 /* fopen.c in Sources */, + C97A70F41517AF53005E1998 /* fprintf.c in Sources */, + C97A70F51517AF53005E1998 /* fpurge.c in Sources */, + C97A70F61517AF53005E1998 /* fputc.c in Sources */, + C97A70F71517AF53005E1998 /* fputs.c in Sources */, + C97A70F81517AF53005E1998 /* fputwc.c in Sources */, + C97A70F91517AF53005E1998 /* fputws.c in Sources */, + C97A70FA1517AF53005E1998 /* fread.c in Sources */, + C97A70FB1517AF53005E1998 /* freopen.c in Sources */, + C97A70FC1517AF53005E1998 /* fscanf.c in Sources */, + C97A70FD1517AF53005E1998 /* fseek.c in Sources */, + C97A70FE1517AF53005E1998 /* fsetpos.c in Sources */, + C97A70FF1517AF53005E1998 /* ftell.c in Sources */, + C97A71001517AF53005E1998 /* funopen.c in Sources */, + C97A71011517AF53005E1998 /* fvwrite.c in Sources */, + C97A71021517AF53005E1998 /* fwalk.c in Sources */, + C97A71031517AF53005E1998 /* fwide.c in Sources */, + C97A71041517AF53005E1998 /* fwprintf.c in Sources */, + C97A71051517AF53005E1998 /* fwrite.c in Sources */, + C97A71061517AF53005E1998 /* fwscanf.c in Sources */, + C97A71071517AF53005E1998 /* getc.c in Sources */, + C97A71081517AF53005E1998 /* getchar.c in Sources */, + C97A71091517AF53005E1998 /* getdelim.c in Sources */, + C97A710A1517AF53005E1998 /* getline.c in Sources */, + C97A710B1517AF53005E1998 /* gets.c in Sources */, + C97A710C1517AF53005E1998 /* getw.c in Sources */, + C97A710D1517AF53005E1998 /* getwc.c in Sources */, + C97A710E1517AF53005E1998 /* getwchar.c in Sources */, + C97A710F1517AF53005E1998 /* makebuf.c in Sources */, + C97A71101517AF53005E1998 /* mktemp.c in Sources */, + C97A71111517AF53005E1998 /* perror.c in Sources */, + C97A71121517AF53005E1998 /* printf-pos.c in Sources */, + C97A71131517AF53005E1998 /* printf.c in Sources */, + C97A71141517AF53005E1998 /* putc.c in Sources */, + C97A71151517AF53005E1998 /* putchar.c in Sources */, + C97A71161517AF53005E1998 /* puts.c in Sources */, + C97A71171517AF53005E1998 /* putw.c in Sources */, + C97A71181517AF53005E1998 /* putwc.c in Sources */, + C97A71191517AF53005E1998 /* putwchar.c in Sources */, + C97A711A1517AF53005E1998 /* refill.c in Sources */, + C97A711B1517AF53005E1998 /* remove.c in Sources */, + C97A711C1517AF53005E1998 /* rewind.c in Sources */, + C97A711D1517AF53005E1998 /* rget.c in Sources */, + C97A711E1517AF53005E1998 /* scanf.c in Sources */, + C97A711F1517AF53005E1998 /* setbuf.c in Sources */, + C97A71201517AF53005E1998 /* setbuffer.c in Sources */, + C97A71211517AF53005E1998 /* setvbuf.c in Sources */, + C97A71221517AF53005E1998 /* snprintf.c in Sources */, + C97A71231517AF53005E1998 /* sprintf.c in Sources */, + C97A71241517AF53005E1998 /* sscanf.c in Sources */, + C97A71251517AF53005E1998 /* stdio.c in Sources */, + C97A71261517AF53005E1998 /* swprintf.c in Sources */, + C97A71271517AF53005E1998 /* swscanf.c in Sources */, + C97A71281517AF53005E1998 /* tempnam.c in Sources */, + C97A71291517AF53005E1998 /* tmpfile.c in Sources */, + C97A712A1517AF53005E1998 /* tmpnam.c in Sources */, + C97A712B1517AF53005E1998 /* ungetc.c in Sources */, + C97A712C1517AF53005E1998 /* ungetwc.c in Sources */, + C97A712D1517AF53005E1998 /* vasprintf.c in Sources */, + C97A712E1517AF53005E1998 /* vdprintf.c in Sources */, + C97A712F1517AF53005E1998 /* vfprintf.c in Sources */, + C97A71301517AF53005E1998 /* vfscanf.c in Sources */, + C97A71311517AF53005E1998 /* vfwprintf.c in Sources */, + C97A71321517AF53005E1998 /* vfwscanf.c in Sources */, + C97A71331517AF53005E1998 /* vprintf.c in Sources */, + C97A71341517AF53005E1998 /* vscanf.c in Sources */, + C97A71351517AF53005E1998 /* vsnprintf.c in Sources */, + C97A71361517AF53005E1998 /* vsprintf.c in Sources */, + C97A71371517AF53005E1998 /* vsscanf.c in Sources */, + C97A71381517AF53005E1998 /* vswprintf.c in Sources */, + C97A71391517AF53005E1998 /* vswscanf.c in Sources */, + C97A713A1517AF53005E1998 /* vwprintf.c in Sources */, + C97A713B1517AF53005E1998 /* vwscanf.c in Sources */, + C97A713C1517AF53005E1998 /* wbuf.c in Sources */, + C97A713D1517AF53005E1998 /* wprintf.c in Sources */, + C97A713E1517AF53005E1998 /* wscanf.c in Sources */, + 147CDFDA1B7C232900831EC6 /* clock_gettime.c in Sources */, + C97A713F1517AF53005E1998 /* wsetup.c in Sources */, + C97A71401517AF53005E1998 /* a64l.c in Sources */, + C97A71411517AF53005E1998 /* _Exit_.c in Sources */, + C97A71421517AF53005E1998 /* abort.c in Sources */, + C97A71431517AF53005E1998 /* abs.c in Sources */, + C97A71441517AF53005E1998 /* atexit.c in Sources */, + C97A71451517AF53005E1998 /* atof.c in Sources */, + C97A71461517AF53005E1998 /* atoi.c in Sources */, + C97A71471517AF53005E1998 /* atol.c in Sources */, + C97A71481517AF53005E1998 /* atoll.c in Sources */, + C97A71491517AF53005E1998 /* bsearch.c in Sources */, + C97A714A1517AF53005E1998 /* div.c in Sources */, + C97A714B1517AF53005E1998 /* exit.c in Sources */, + C97A714C1517AF53005E1998 /* getenv.c in Sources */, + C97A714D1517AF53005E1998 /* getopt.c in Sources */, + C97A714E1517AF53005E1998 /* getopt_long.c in Sources */, + C97A714F1517AF53005E1998 /* getsubopt.c in Sources */, + C97A71501517AF53005E1998 /* hcreate.c in Sources */, + C97A71511517AF53005E1998 /* heapsort.c in Sources */, + C97A71521517AF53005E1998 /* heapsort_b.c in Sources */, + C97A71531517AF53005E1998 /* heapsort_r.c in Sources */, + C97A71541517AF53005E1998 /* imaxabs.c in Sources */, + C97A71551517AF53005E1998 /* imaxdiv.c in Sources */, + C97A71561517AF53005E1998 /* insque.c in Sources */, + C97A71571517AF53005E1998 /* labs.c in Sources */, + C97A71581517AF53005E1998 /* ldiv.c in Sources */, + C97A71591517AF53005E1998 /* llabs.c in Sources */, + C97A715A1517AF53005E1998 /* lldiv.c in Sources */, + C97A715B1517AF53005E1998 /* lsearch.c in Sources */, + C97A715C1517AF53005E1998 /* merge.c in Sources */, + C97A715D1517AF53005E1998 /* putenv.c in Sources */, + C97A715E1517AF53005E1998 /* qsort.c in Sources */, + C97A715F1517AF53005E1998 /* qsort_r.c in Sources */, + C97A71601517AF53005E1998 /* radixsort.c in Sources */, + C97A71611517AF53005E1998 /* rand.c in Sources */, + C97A71621517AF53005E1998 /* random.c in Sources */, + C97A71631517AF53005E1998 /* reallocf.c in Sources */, + C97A71641517AF53005E1998 /* realpath.c in Sources */, + C97A71651517AF53005E1998 /* remque.c in Sources */, + C97A71661517AF53005E1998 /* setenv.c in Sources */, + C97A71671517AF53005E1998 /* strhash.c in Sources */, + C97A71681517AF53005E1998 /* strtoimax.c in Sources */, + C97A71691517AF53005E1998 /* strtol.c in Sources */, + C97A716A1517AF53005E1998 /* strtoll.c in Sources */, + C97A716B1517AF53005E1998 /* strtoq.c in Sources */, + C97A716C1517AF53005E1998 /* strtoul.c in Sources */, + C97A716D1517AF53005E1998 /* strtoull.c in Sources */, + C97A716E1517AF53005E1998 /* strtoumax.c in Sources */, + C97A716F1517AF53005E1998 /* strtouq.c in Sources */, + C97A71701517AF53005E1998 /* system.c in Sources */, + C97A71711517AF53005E1998 /* tdelete.c in Sources */, + C97A71721517AF53005E1998 /* tfind.c in Sources */, + C97A71731517AF53005E1998 /* tsearch.c in Sources */, + C97A71741517AF53005E1998 /* twalk.c in Sources */, + C97A71751517AF53005E1998 /* grantpt.c in Sources */, + C97A71761517AF53005E1998 /* l64a.c in Sources */, + C97A71771517AF53005E1998 /* strfmon.c in Sources */, + C97A71781517AF53005E1998 /* ecvt.c in Sources */, + C97A71791517AF53005E1998 /* gcvt.c in Sources */, + C97A717A1517AF53005E1998 /* qsort_b.c in Sources */, + C97A717B1517AF53005E1998 /* asctime.c in Sources */, + C97A717C1517AF53005E1998 /* difftime.c in Sources */, + C97A717D1517AF53005E1998 /* ftime.c in Sources */, + C97A717E1517AF53005E1998 /* localtime.c in Sources */, + C97A717F1517AF53005E1998 /* strftime.c in Sources */, + C97A71801517AF53005E1998 /* strptime.c in Sources */, + C97A71811517AF53005E1998 /* time32.c in Sources */, + C97A71821517AF53005E1998 /* timelocal.c in Sources */, + C97A71831517AF53005E1998 /* getdate.c in Sources */, + C97A71841517AF53005E1998 /* timezone_unix03.c in Sources */, + C97A718D1517AF53005E1998 /* memmem.c in Sources */, + C97A71901517AF53005E1998 /* rindex.c in Sources */, + C97A71911517AF53005E1998 /* strcasecmp.c in Sources */, + C97A71921517AF53005E1998 /* strcasestr.c in Sources */, + C97A71951517AF53005E1998 /* strcoll.c in Sources */, + C97A71961517AF53005E1998 /* strcspn.c in Sources */, + C97A71971517AF53005E1998 /* strdup.c in Sources */, + C97A71981517AF53005E1998 /* strerror.c in Sources */, + C97A719A1517AF53005E1998 /* strmode.c in Sources */, + C97A719C1517AF53005E1998 /* strndup.c in Sources */, + C97A719E1517AF53005E1998 /* strnstr.c in Sources */, + C97A719F1517AF53005E1998 /* strpbrk.c in Sources */, + C97A71A01517AF53005E1998 /* strrchr.c in Sources */, + C97A71A11517AF53005E1998 /* strsep.c in Sources */, + C97A71A21517AF53005E1998 /* strsignal.c in Sources */, + C97A71A31517AF53005E1998 /* strspn.c in Sources */, + C97A71A51517AF53005E1998 /* strtok.c in Sources */, + C97A71A61517AF53005E1998 /* strxfrm.c in Sources */, + C97A71A71517AF53005E1998 /* swab.c in Sources */, + C97A71A81517AF53005E1998 /* wcpcpy.c in Sources */, + C97A71A91517AF53005E1998 /* wcpncpy.c in Sources */, + C97A71AA1517AF53005E1998 /* wcscasecmp.c in Sources */, + C97A71AB1517AF53005E1998 /* wcscat.c in Sources */, + C97A71AC1517AF53005E1998 /* wcschr.c in Sources */, + C97A71AD1517AF53005E1998 /* wcscmp.c in Sources */, + C97A71AE1517AF53005E1998 /* wcscoll.c in Sources */, + C97A71AF1517AF53005E1998 /* wcscpy.c in Sources */, + C97A71B01517AF53005E1998 /* wcscspn.c in Sources */, + C97A71B11517AF53005E1998 /* wcsdup.c in Sources */, + C97A71B21517AF53005E1998 /* wcslcat.c in Sources */, + C97A71B31517AF53005E1998 /* wcslcpy.c in Sources */, + C97A71B41517AF53005E1998 /* wcslen.c in Sources */, + C97A71B51517AF53005E1998 /* wcsncasecmp.c in Sources */, + C97A71B61517AF53005E1998 /* wcsncat.c in Sources */, + C97A71B71517AF53005E1998 /* wcsncmp.c in Sources */, + C97A71B81517AF53005E1998 /* wcsncpy.c in Sources */, + C97A71B91517AF53005E1998 /* wcsnlen.c in Sources */, + C97A71BA1517AF53005E1998 /* wcspbrk.c in Sources */, + C97A71BB1517AF53005E1998 /* wcsrchr.c in Sources */, + C97A71BC1517AF53005E1998 /* wcsspn.c in Sources */, + C97A71BD1517AF53005E1998 /* wcsstr.c in Sources */, + C97A71BE1517AF53005E1998 /* wcstok.c in Sources */, + C97A71BF1517AF53005E1998 /* wcswidth.c in Sources */, + C97A71C01517AF53005E1998 /* wcsxfrm.c in Sources */, + C97A71C11517AF53005E1998 /* wmemchr.c in Sources */, + C97A71C21517AF53005E1998 /* wmemcmp.c in Sources */, + C97A71C31517AF53005E1998 /* wmemcpy.c in Sources */, + C97A71C41517AF53005E1998 /* wmemmove.c in Sources */, + C97A71C51517AF53005E1998 /* wmemset.c in Sources */, + C97A71C61517AF53005E1998 /* _libc_init.c in Sources */, + C97A71C71517AF53005E1998 /* _libc_fork_child.c in Sources */, + C97A71C81517AF53005E1998 /* chmodx_np.c in Sources */, + C97A71CA1517AF53005E1998 /* crt_externs.c in Sources */, + C97A71CC1517AF53005E1998 /* fork.c in Sources */, + C97A71CD1517AF53005E1998 /* getgroups.c in Sources */, + C97A71CF1517AF53005E1998 /* gettimeofday.c in Sources */, + C97A71D01517AF53005E1998 /* msgctl.c in Sources */, + C97A71D11517AF53005E1998 /* stack_protector.c in Sources */, + C97A71D21517AF53005E1998 /* openx_np.c in Sources */, + C97A71D31517AF53005E1998 /* OSMemoryNotification.c in Sources */, + C97A71D41517AF53005E1998 /* OSThermalNotification.c in Sources */, + C97A71D51517AF53005E1998 /* posix_spawn.c in Sources */, + C97A71D61517AF53005E1998 /* semctl.c in Sources */, + C97A71D71517AF53005E1998 /* settimeofday.c in Sources */, + C97A71D81517AF53005E1998 /* shmctl.c in Sources */, + C97A71D91517AF53005E1998 /* sigaction.c in Sources */, + C97A71DA1517AF53005E1998 /* (null) in Sources */, + C97A71DD1517AF53005E1998 /* statx_np.c in Sources */, + C97A71DE1517AF53005E1998 /* umaskx_np.c in Sources */, + C97A71E21517AF53005E1998 /* fparseln.c in Sources */, + C97A71E31517AF53005E1998 /* login.c in Sources */, + C97A71E41517AF53005E1998 /* login_tty.c in Sources */, + C97A71E51517AF53005E1998 /* logout.c in Sources */, + C97A71E61517AF53005E1998 /* logwtmp.c in Sources */, + C97A71E71517AF53005E1998 /* mkpath_np.c in Sources */, + C97A71E81517AF53005E1998 /* opendev.c in Sources */, + C97A71E91517AF53005E1998 /* pty.c in Sources */, + C97A71EA1517AF53005E1998 /* clear.c in Sources */, + C97A71EB1517AF53005E1998 /* compare.c in Sources */, + C97A71EC1517AF53005E1998 /* copy.c in Sources */, + C97A71ED1517AF53005E1998 /* gen_uuid.c in Sources */, + C97A71EE1517AF53005E1998 /* isnull.c in Sources */, + C97A71EF1517AF53005E1998 /* pack.c in Sources */, + C97A71F01517AF53005E1998 /* parse.c in Sources */, + C97A71F11517AF53005E1998 /* unpack.c in Sources */, + C97A71F21517AF53005E1998 /* unparse.c in Sources */, + C97A71F71517AF53005E1998 /* (null) in Sources */, + C97A71F81517AF53005E1998 /* (null) in Sources */, + C97A71F91517AF53005E1998 /* (null) in Sources */, + C97A71FA1517AF53005E1998 /* (null) in Sources */, + C97A71FD1517AF53005E1998 /* scandir_b.c in Sources */, + C97A72101517AF53005E1998 /* stpcpy.c in Sources */, + C97A72111517AF53005E1998 /* stpncpy.c in Sources */, + C97A72121517AF53005E1998 /* strcat.c in Sources */, + C97A72131517AF53005E1998 /* strncat.c in Sources */, + C97A72161517AF53005E1998 /* sync_volume_np.c in Sources */, + C97A72171517AF53005E1998 /* dirfd.c in Sources */, + C925D1FD1518F4A2003D315B /* eos_stubs.c in Sources */, + 4B2C64A415519BC400342BFA /* assumes.c in Sources */, + FC2ED611157D4BE80098EC69 /* inet_ntop.c in Sources */, + FC2ED61A157D4BE80098EC69 /* inet_pton.c in Sources */, + 3F169A3E1643B7BA0029E851 /* memccpy_chk.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9B53E28138DA0610028D27C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E408425B20B585BF00CC87A7 /* forceLibcToBuild.c in Sources */, + C9EB2F53138F68A80075BB52 /* mcount.s in Sources */, + C9B53E5E138DA5910028D27C /* mcount.s in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9C2A949138DFFD900287F00 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C9C2A959138E025700287F00 /* sigaltstk.c in Sources */, + C9C2A95A138E025700287F00 /* sigcompat.c in Sources */, + 147CDFDB1B7C232A00831EC6 /* clock_gettime.c in Sources */, + C9C2A97D138E058200287F00 /* brk.c in Sources */, + C9C2A97E138E058200287F00 /* bsd_signal.c in Sources */, + C9C2A97F138E058200287F00 /* lchflags.c in Sources */, + C9C2A980138E058200287F00 /* lchmod.c in Sources */, + C9C2A981138E058200287F00 /* lutimes.c in Sources */, + C9C2A982138E058200287F00 /* statvfs.c in Sources */, + C9C2A9A2138E06D900287F00 /* backtrace.c in Sources */, + C9C2A9A4138E06D900287F00 /* confstr.c in Sources */, + C9C2A9A5138E06D900287F00 /* crypt.c in Sources */, + C9C2A9A6138E06D900287F00 /* devname.c in Sources */, + C9C2A9A7138E06D900287F00 /* disklabel.c in Sources */, + C9C2A9A8138E06D900287F00 /* errlst.c in Sources */, + C9C2A9A9138E06D900287F00 /* filesec.c in Sources */, + C9C2A9AA138E072500287F00 /* fts.c in Sources */, + C9C2A9AB138E072500287F00 /* get_compat.c in Sources */, + C9C2A9AC138E072500287F00 /* getloadavg.c in Sources */, + C9C2A9AD138E072500287F00 /* getttyent.c in Sources */, + C9C2A9AE138E072500287F00 /* getusershell.c in Sources */, + C9C2A9AF138E072500287F00 /* getvfsbyname.c in Sources */, + C9ECE2771950E384008E8672 /* atexit_receipt.c in Sources */, + C9C2A9B5138E072500287F00 /* nanosleep.c in Sources */, + C9C2A9B6138E072500287F00 /* nftw.c in Sources */, + C9C2A9B8138E072500287F00 /* setlogin.c in Sources */, + C9C2A9B9138E072600287F00 /* sigsetops.c in Sources */, + C9C2A9BC138E072600287F00 /* strtofflags.c in Sources */, + C9C2A9BE138E072600287F00 /* thread_stack_pcs.c in Sources */, + C9C2A9BF138E072600287F00 /* uname.c in Sources */, + C9C2A9C0138E072600287F00 /* utmpx-darwin.c in Sources */, + 2DF67CE0184F9CBE00B83A3D /* debug_private.c in Sources */, + C9A12853138E0BE00003880A /* gmon.c in Sources */, + C9A12854138E0C1C0003880A /* isctype.c in Sources */, + 3FD14576171D42B300B7BAF5 /* bcopy.c in Sources */, + C9A12855138E0C1C0003880A /* iswctype.c in Sources */, + C9A12856138E0C1C0003880A /* xlocale.c in Sources */, + C9A128A0138E0CD10003880A /* acl.c in Sources */, + C9A128A1138E0CD10003880A /* acl_entry.c in Sources */, + C9A128A2138E0CD10003880A /* acl_file.c in Sources */, + C9A128A3138E0CD10003880A /* acl_flag.c in Sources */, + C9A128A4138E0CD10003880A /* acl_perm.c in Sources */, + C9A128A5138E0CD10003880A /* acl_translate.c in Sources */, + C9A12929138E0EF00003880A /* getdate.c in Sources */, + C9A1292A138E0EF00003880A /* timezone_unix03.c in Sources */, + B1795373158B0E35008990E8 /* xprintf_all_in_one.c in Sources */, + B126140515881A000077E3CC /* xprintf_comp.c in Sources */, + B126140615881A000077E3CC /* xprintf_domain.c in Sources */, + B1795374158B0E35008990E8 /* xprintf_exec.c in Sources */, + C9A12977138E10C40003880A /* fparseln.c in Sources */, + C9A12978138E10C40003880A /* login_tty.c in Sources */, + C9A12979138E10C40003880A /* logwtmp.c in Sources */, + 3F76864713E91CBC00C94D25 /* mkpath_np.c in Sources */, + 3F34A15D1C4AA80B000D4A82 /* raise.c in Sources */, + C9A1297A138E10C40003880A /* opendev.c in Sources */, + C9A1297B138E10C40003880A /* pty.c in Sources */, + C9A1297C138E10FB0003880A /* clear.c in Sources */, + C9A1297D138E10FB0003880A /* compare.c in Sources */, + C9A1297E138E10FB0003880A /* copy.c in Sources */, + C9A1297F138E10FB0003880A /* gen_uuid.c in Sources */, + C9A12980138E10FB0003880A /* isnull.c in Sources */, + C9A12981138E10FB0003880A /* pack.c in Sources */, + C9A12982138E10FB0003880A /* parse.c in Sources */, + C9A12983138E10FB0003880A /* unpack.c in Sources */, + C9A12984138E10FB0003880A /* unparse.c in Sources */, + C9C2A983138E058200287F00 /* tcgetsid.c in Sources */, + C9FA32FB138E4BD00089A94B /* _libc_init.c in Sources */, + C9FA32FC138E4BD00089A94B /* _libc_fork_child.c in Sources */, + C9FA32FD138E4BD00089A94B /* chmodx_np.c in Sources */, + C9FA32FF138E4BD00089A94B /* crt_externs.c in Sources */, + C9FA3301138E4BD00089A94B /* fork.c in Sources */, + C9FA3303138E4BD00089A94B /* gettimeofday.c in Sources */, + C9FA3304138E4BD00089A94B /* openx_np.c in Sources */, + C9FA3307138E4BD00089A94B /* posix_spawn.c in Sources */, + C9FA3308138E4BD00089A94B /* settimeofday.c in Sources */, + C9FA3309138E4BD00089A94B /* sigaction.c in Sources */, + C9FA330D138E4BD00089A94B /* statx_np.c in Sources */, + C9FA330E138E4BD00089A94B /* umaskx_np.c in Sources */, + C9421014138F23CA004BA536 /* frune.c in Sources */, + C9421015138F23CA004BA536 /* mbrune.c in Sources */, + C9421016138F23CA004BA536 /* runedepreciated.c in Sources */, + C9421017138F23CA004BA536 /* setinvalidrune.c in Sources */, + C9EB3542138F7D0A0075BB52 /* login.c in Sources */, + C9EB3543138F7D0A0075BB52 /* logout.c in Sources */, + C9EB3558138F7FF40075BB52 /* nlist.c in Sources */, + C9EB355C138F81A40075BB52 /* kvm.c in Sources */, + C98373971395989E00E5C052 /* OSMemoryNotification.c in Sources */, + C98373981395989E00E5C052 /* OSThermalNotification.c in Sources */, + 63D4060613DDEDF10094DD56 /* stpcpy.c in Sources */, + 63D4060B13DDEEA20094DD56 /* stpncpy.c in Sources */, + 63D4060E13DDF26A0094DD56 /* strcat.c in Sources */, + 63D4061113DDF4340094DD56 /* strncat.c in Sources */, + B19C645D1450F90200032373 /* sync_volume_np.c in Sources */, + 3FB7E1B5146EF2E000843438 /* dirfd.c in Sources */, + 4B2C64BA1551B03700342BFA /* assumes.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9D9432B138DB73300FB7ACC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C9D94333138DB75B00FB7ACC /* forceLibcToBuild.c in Sources */, + 92ABC7E91D375FC2000DF880 /* compatibility_hacks.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9D9435C138EC3E300FB7ACC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C9765EB9138EC61900741512 /* creat.c in Sources */, + C9765EBA138EC61900741512 /* gethostid.c in Sources */, + C9765EBB138EC61900741512 /* getwd.c in Sources */, + C9765EBC138EC61900741512 /* killpg.c in Sources */, + C9765EBD138EC61900741512 /* sethostid.c in Sources */, + C9765EBE138EC61900741512 /* setpgrp.c in Sources */, + C9765EBF138EC61900741512 /* setrgid.c in Sources */, + C9765EC0138EC61900741512 /* setruid.c in Sources */, + C9765EC1138EC61900741512 /* setregid.c in Sources */, + C9765EC2138EC61900741512 /* setreuid.c in Sources */, + C9765EC3138EC61900741512 /* sigaltstk.c in Sources */, + C9765EC4138EC61900741512 /* sigcompat.c in Sources */, + C9765EC6138EC61900741512 /* kvm.c in Sources */, + C9765ECA138EC61900741512 /* forceLibcToBuild.c in Sources */, + C9765ECB138EC61900741512 /* bt_close.c in Sources */, + C9765ECC138EC61900741512 /* bt_conv.c in Sources */, + C9765ECD138EC61900741512 /* bt_debug.c in Sources */, + 7756338C22F3B549002F1707 /* rpmatch.c in Sources */, + C9765ECE138EC61900741512 /* bt_delete.c in Sources */, + C9765ECF138EC61900741512 /* bt_get.c in Sources */, + C9765ED0138EC61900741512 /* bt_open.c in Sources */, + C9765ED1138EC61900741512 /* bt_overflow.c in Sources */, + C9765ED2138EC61900741512 /* bt_page.c in Sources */, + C9765ED3138EC61900741512 /* bt_put.c in Sources */, + C9765ED4138EC61900741512 /* bt_search.c in Sources */, + C9765ED5138EC61900741512 /* bt_seq.c in Sources */, + C9765ED6138EC61900741512 /* bt_split.c in Sources */, + C9765ED7138EC61900741512 /* bt_utils.c in Sources */, + C9765ED8138EC61900741512 /* db.c in Sources */, + C9765ED9138EC61900741512 /* hash.c in Sources */, + C9765EDA138EC61900741512 /* hash_bigkey.c in Sources */, + C9765EDB138EC61900741512 /* hash_buf.c in Sources */, + C9765EDC138EC61900741512 /* hash_func.c in Sources */, + C9765EDD138EC61900741512 /* hash_log2.c in Sources */, + C9765EDE138EC61900741512 /* hash_page.c in Sources */, + C9765EDF138EC61900741512 /* ndbm.c in Sources */, + C9765EE0138EC61900741512 /* mpool.c in Sources */, + C9765EE1138EC61900741512 /* rec_close.c in Sources */, + C9765EE2138EC61900741512 /* rec_delete.c in Sources */, + C9765EE3138EC61900741512 /* rec_get.c in Sources */, + C9765EE4138EC61900741512 /* rec_open.c in Sources */, + C9765EE5138EC61900741512 /* rec_put.c in Sources */, + C9765EE6138EC61900741512 /* rec_search.c in Sources */, + C9765EE7138EC61900741512 /* rec_seq.c in Sources */, + C9765EE8138EC61900741512 /* rec_utils.c in Sources */, + C9765EE9138EC61900741512 /* brk.c in Sources */, + C9765EEA138EC61900741512 /* bsd_signal.c in Sources */, + C9765EEB138EC61900741512 /* lchflags.c in Sources */, + C9765EEC138EC61900741512 /* lchmod.c in Sources */, + C9765EED138EC61900741512 /* lutimes.c in Sources */, + C9765EEE138EC61900741512 /* statvfs.c in Sources */, + C9765EEF138EC61900741512 /* tcgetsid.c in Sources */, + C9765EF0138EC61900741512 /* _ldbl_util.c in Sources */, + C9765EF1138EC61900741512 /* _hdtoa.c in Sources */, + C9765EF2138EC61900741512 /* _ldtoa.c in Sources */, + C9765EF3138EC61900741512 /* gdtoa-dmisc.c in Sources */, + C9765EF4138EC61900741512 /* gdtoa-dtoa.c in Sources */, + C9765EF5138EC61900741512 /* gdtoa-gdtoa.c in Sources */, + C9765EF6138EC61900741512 /* gdtoa-gethex.c in Sources */, + C9765EF7138EC61900741512 /* gdtoa-gmisc.c in Sources */, + C9765EF8138EC61900741512 /* gdtoa-hd_init.c in Sources */, + C9765EF9138EC61900741512 /* gdtoa-hexnan.c in Sources */, + C9765EFA138EC61900741512 /* gdtoa-misc.c in Sources */, + C9765EFB138EC61900741512 /* gdtoa-smisc.c in Sources */, + C9765EFC138EC61900741512 /* gdtoa-strtod.c in Sources */, + C9765EFD138EC61900741512 /* gdtoa-strtodg.c in Sources */, + C9765EFE138EC61900741512 /* gdtoa-strtof.c in Sources */, + C9765EFF138EC61900741512 /* gdtoa-strtoIg.c in Sources */, + C9765F00138EC61900741512 /* gdtoa-strtopdd.c in Sources */, + C9765F01138EC61900741512 /* gdtoa-strtopx.c in Sources */, + C9765F02138EC61900741512 /* gdtoa-strtord.c in Sources */, + C9765F03138EC61900741512 /* gdtoa-sum.c in Sources */, + C9765F04138EC61900741512 /* gdtoa-ulp.c in Sources */, + C9765F05138EC61900741512 /* glue.c in Sources */, + C9765F06138EC61900741512 /* machdep_ldisd.c in Sources */, + C9765F07138EC61900741512 /* machdep_ldisdd.c in Sources */, + C9765F08138EC61900741512 /* machdep_ldisQ.c in Sources */, + C9765F09138EC61900741512 /* machdep_ldisx.c in Sources */, + C9765F13138EC61900741512 /* authentication.c in Sources */, + C9765F14138EC61900741512 /* backtrace.c in Sources */, + C9765F16138EC61900741512 /* confstr.c in Sources */, + C9765F17138EC61900741512 /* crypt.c in Sources */, + C9765F18138EC61900741512 /* devname.c in Sources */, + C9765F19138EC61900741512 /* disklabel.c in Sources */, + C9765F1A138EC61900741512 /* errlst.c in Sources */, + C9765F1B138EC61900741512 /* filesec.c in Sources */, + 147CDFDC1B7C232F00831EC6 /* clock_gettime.c in Sources */, + C9765F1C138EC61900741512 /* _rand48.c in Sources */, + C9765F1D138EC61900741512 /* alarm.c in Sources */, + C9765F1E138EC61900741512 /* arc4random.c in Sources */, + C9765F1F138EC61900741512 /* assert.c in Sources */, + C9765F20138EC61900741512 /* basename.c in Sources */, + C9765F21138EC61900741512 /* clock.c in Sources */, + C9765F22138EC61900741512 /* closedir.c in Sources */, + C9765F23138EC61900741512 /* ctermid.c in Sources */, + C9765F24138EC61900741512 /* daemon.c in Sources */, + C9765F25138EC61900741512 /* dirname.c in Sources */, + C9765F26138EC61900741512 /* drand48.c in Sources */, + C9765F27138EC61900741512 /* erand48.c in Sources */, + C9765F28138EC61900741512 /* err.c in Sources */, + C9765F29138EC61900741512 /* exec.c in Sources */, + C9765F2A138EC61900741512 /* fmtcheck.c in Sources */, + C9765F2B138EC61900741512 /* fmtmsg.c in Sources */, + C9765F2C138EC61900741512 /* fnmatch.c in Sources */, + C9765F2D138EC61900741512 /* ftok.c in Sources */, + C9765F2E138EC61900741512 /* getbsize.c in Sources */, + C9765F2F138EC61900741512 /* getcap.c in Sources */, + C9765F30138EC61900741512 /* getcwd.c in Sources */, + C9765F31138EC61900741512 /* gethostname.c in Sources */, + C9765F32138EC61900741512 /* getlogin.c in Sources */, + C9765F33138EC61900741512 /* getmntinfo.c in Sources */, + C9765F34138EC61900741512 /* getpagesize.c in Sources */, + C9765F35138EC61900741512 /* getpeereid.c in Sources */, + C9765F36138EC61900741512 /* getprogname.c in Sources */, + C9765F37138EC61900741512 /* glob.c in Sources */, + C9765F38138EC61900741512 /* isatty.c in Sources */, + C9765F39138EC61900741512 /* jrand48.c in Sources */, + C9765F3A138EC61900741512 /* lcong48.c in Sources */, + C9765F3B138EC61900741512 /* lockf.c in Sources */, + C9765F3C138EC61900741512 /* lrand48.c in Sources */, + C9765F3D138EC61900741512 /* mrand48.c in Sources */, + C9765F3E138EC61900741512 /* nice.c in Sources */, + C9765F3F138EC61900741512 /* nrand48.c in Sources */, + C9765F40138EC61900741512 /* opendir.c in Sources */, + C9765F41138EC61900741512 /* pause.c in Sources */, + C9765F42138EC61900741512 /* popen.c in Sources */, + C9765F44138EC61900741512 /* psignal.c in Sources */, + C9765F45138EC61900741512 /* raise.c in Sources */, + C9765F46138EC61900741512 /* readdir.c in Sources */, + C9765F47138EC61900741512 /* readpassphrase.c in Sources */, + C9765F48138EC61900741512 /* rewinddir.c in Sources */, + C9765F49138EC61900741512 /* scandir.c in Sources */, + C9765F4A138EC61900741512 /* seed48.c in Sources */, + C9765F4B138EC61900741512 /* seekdir.c in Sources */, + C9765F4C138EC61900741512 /* sethostname.c in Sources */, + C9765F4D138EC61900741512 /* setmode.c in Sources */, + C9765F4E138EC61900741512 /* setprogname.c in Sources */, + C9765F4F138EC61900741512 /* siginterrupt.c in Sources */, + C9765F50138EC61900741512 /* siglist.c in Sources */, + C9765F51138EC61900741512 /* signal.c in Sources */, + C9765F52138EC61900741512 /* sleep.c in Sources */, + C9765F53138EC61900741512 /* srand48.c in Sources */, + C9765F54138EC61900741512 /* stringlist.c in Sources */, + C9765F55138EC61900741512 /* sysconf.c in Sources */, + C9765F56138EC61900741512 /* sysctl.c in Sources */, + C9765F57138EC61900741512 /* sysctlbyname.c in Sources */, + C9765F58138EC61900741512 /* sysctlnametomib.c in Sources */, + C9765F59138EC61900741512 /* telldir.c in Sources */, + C9765F5A138EC61900741512 /* termios.c in Sources */, + C9765F5B138EC61900741512 /* time.c in Sources */, + C9765F5C138EC61900741512 /* times.c in Sources */, + C9765F5D138EC61900741512 /* timezone.c in Sources */, + C9765F5E138EC61900741512 /* ttyname.c in Sources */, + C9765F5F138EC61900741512 /* ttyslot.c in Sources */, + C9765F60138EC61900741512 /* ualarm.c in Sources */, + C9765F61138EC61900741512 /* ulimit.c in Sources */, + C9765F62138EC61900741512 /* unvis.c in Sources */, + C9765F63138EC61900741512 /* usleep.c in Sources */, + C9765F64138EC61900741512 /* utime.c in Sources */, + C9765F65138EC61900741512 /* vis.c in Sources */, + C9765F66138EC61900741512 /* wait.c in Sources */, + C9765F67138EC61900741512 /* wait3.c in Sources */, + C9765F68138EC61900741512 /* waitpid.c in Sources */, + C9765F69138EC61900741512 /* fts.c in Sources */, + C9765F6A138EC61900741512 /* get_compat.c in Sources */, + C9765F6B138EC61900741512 /* getloadavg.c in Sources */, + C9765F6C138EC61900741512 /* getttyent.c in Sources */, + C9765F6D138EC61900741512 /* getusershell.c in Sources */, + C9765F6E138EC61900741512 /* getvfsbyname.c in Sources */, + C9765F73138EC61900741512 /* nanosleep.c in Sources */, + C9765F74138EC61900741512 /* utmpx.c in Sources */, + C9765F75138EC61900741512 /* nftw.c in Sources */, + C9765F76138EC61900741512 /* nlist.c in Sources */, + C9765F78138EC61900741512 /* oldsyslog.c in Sources */, + C9765F7B138EC61900741512 /* setlogin.c in Sources */, + C9765F7C138EC61900741512 /* sigsetops.c in Sources */, + C9765F7F138EC61900741512 /* strtofflags.c in Sources */, + C9765F81138EC61900741512 /* thread_stack_pcs.c in Sources */, + C9765F82138EC61900741512 /* uname.c in Sources */, + C9765F83138EC61900741512 /* utmpx-darwin.c in Sources */, + C9765F84138EC61900741512 /* wordexp.c in Sources */, + C9765F86138EC61900741512 /* gmon.c in Sources */, + C9765FA6138EC61900741512 /* ascii.c in Sources */, + C9765FA7138EC61900741512 /* big5.c in Sources */, + C9765FA8138EC61900741512 /* btowc.c in Sources */, + C9765FA9138EC61900741512 /* collate.c in Sources */, + C9765FAA138EC61900741512 /* collcmp.c in Sources */, + C9765FAB138EC61900741512 /* euc.c in Sources */, + C9765FAC138EC61900741512 /* fix_grouping.c in Sources */, + C9765FAD138EC61900741512 /* gb18030.c in Sources */, + C9765FAE138EC61900741512 /* gb2312.c in Sources */, + C9765FAF138EC61900741512 /* gbk.c in Sources */, + C9765FB0138EC61900741512 /* ldpart.c in Sources */, + C9765FB1138EC61900741512 /* lmessages.c in Sources */, + C9765FB2138EC61900741512 /* lmonetary.c in Sources */, + C9765FB3138EC61900741512 /* lnumeric.c in Sources */, + C9765FB4138EC61900741512 /* localeconv.c in Sources */, + C9765FB5138EC61900741512 /* mblen.c in Sources */, + C9765FB6138EC61900741512 /* mbrlen.c in Sources */, + C9765FB7138EC61900741512 /* mbrtowc.c in Sources */, + C9765FB8138EC61900741512 /* mbsinit.c in Sources */, + C9765FB9138EC61900741512 /* mbsnrtowcs.c in Sources */, + C9765FBA138EC61900741512 /* mbsrtowcs.c in Sources */, + C9765FBB138EC61900741512 /* mbstowcs.c in Sources */, + C9765FBC138EC61900741512 /* mbtowc.c in Sources */, + C9765FBD138EC61900741512 /* mskanji.c in Sources */, + C9765FBE138EC61900741512 /* nextwctype.c in Sources */, + C9765FBF138EC61900741512 /* nl_langinfo.c in Sources */, + C9765FC0138EC61900741512 /* nomacros.c in Sources */, + C9765FC1138EC61900741512 /* none.c in Sources */, + C9765FC2138EC61900741512 /* rune.c in Sources */, + C9765FC3138EC61900741512 /* runetype.c in Sources */, + C9765FC4138EC61900741512 /* setlocale.c in Sources */, + C9765FC5138EC61900741512 /* setrunelocale.c in Sources */, + C9765FC6138EC61900741512 /* table.c in Sources */, + C9765FC7138EC61900741512 /* tolower.c in Sources */, + C9765FC8138EC61900741512 /* toupper.c in Sources */, + C9765FC9138EC61900741512 /* utf2.c in Sources */, + C9765FCA138EC61900741512 /* utf8.c in Sources */, + C9765FCB138EC61900741512 /* wcrtomb.c in Sources */, + C9765FCC138EC61900741512 /* wcsftime.c in Sources */, + C9765FCD138EC61900741512 /* wcsnrtombs.c in Sources */, + C9765FCE138EC61900741512 /* wcsrtombs.c in Sources */, + C9765FCF138EC61900741512 /* wcstod.c in Sources */, + C9765FD0138EC61900741512 /* wcstof.c in Sources */, + C9765FD1138EC61900741512 /* wcstoimax.c in Sources */, + C9765FD2138EC61900741512 /* wcstol.c in Sources */, + C9765FD3138EC61900741512 /* wcstold.c in Sources */, + C9765FD4138EC61900741512 /* wcstoll.c in Sources */, + C9765FD5138EC61900741512 /* wcstombs.c in Sources */, + C9765FD6138EC61900741512 /* wcstoul.c in Sources */, + C9765FD7138EC61900741512 /* wcstoull.c in Sources */, + C9765FD8138EC61900741512 /* wcstoumax.c in Sources */, + C9765FD9138EC61900741512 /* wctob.c in Sources */, + C9765FDA138EC61900741512 /* wctomb.c in Sources */, + C9765FDB138EC61900741512 /* wctrans.c in Sources */, + C9765FDC138EC61900741512 /* wctype.c in Sources */, + C9765FDD138EC61900741512 /* wcwidth.c in Sources */, + C9765FDE138EC61900741512 /* frune.c in Sources */, + C9765FDF138EC61900741512 /* isctype.c in Sources */, + C9765FE0138EC61900741512 /* iswctype.c in Sources */, + C9765FE1138EC61900741512 /* lconv.c in Sources */, + C9765FE2138EC61900741512 /* mbrune.c in Sources */, + C9765FE3138EC61900741512 /* runedepreciated.c in Sources */, + C9765FE4138EC61900741512 /* setinvalidrune.c in Sources */, + C9765FE5138EC61900741512 /* xlocale.c in Sources */, + C9765FE6138EC61900741512 /* addr2ascii.c in Sources */, + C9765FE7138EC61900741512 /* ascii2addr.c in Sources */, + C9765FE8138EC61900741512 /* inet_addr.c in Sources */, + C9765FE9138EC61900741512 /* inet_lnaof.c in Sources */, + C9765FEA138EC61900741512 /* inet_makeaddr.c in Sources */, + C9765FEB138EC61900741512 /* inet_net_ntop.c in Sources */, + C9765FEC138EC61900741512 /* inet_net_pton.c in Sources */, + C9765FED138EC61900741512 /* inet_neta.c in Sources */, + C9765FEE138EC61900741512 /* inet_netof.c in Sources */, + C9765FEF138EC61900741512 /* inet_network.c in Sources */, + C9765FF0138EC61900741512 /* inet_ntoa.c in Sources */, + C9765FF1138EC61900741512 /* linkaddr.c in Sources */, + C9765FF2138EC61900741512 /* nsap_addr.c in Sources */, + C9765FF3138EC61900741512 /* recv.c in Sources */, + C9765FF4138EC61900741512 /* send.c in Sources */, + C9765FF5138EC61900741512 /* sockatmark.c in Sources */, + C9765FF6138EC61900741512 /* sourcefilter.c in Sources */, + C9765FF7138EC61900741512 /* msgcat.c in Sources */, + C9765FF8138EC61900741512 /* acl.c in Sources */, + C9765FF9138EC61900741512 /* acl_entry.c in Sources */, + C9765FFA138EC61900741512 /* acl_file.c in Sources */, + C9765FFB138EC61900741512 /* acl_flag.c in Sources */, + C9765FFC138EC61900741512 /* acl_perm.c in Sources */, + C9765FFD138EC61900741512 /* acl_translate.c in Sources */, + C9766011138EC61900741512 /* regerror.c in Sources */, + C9766022138EC61A00741512 /* _flock_stub.c in Sources */, + C9766023138EC61A00741512 /* asprintf.c in Sources */, + C9766024138EC61A00741512 /* clrerr.c in Sources */, + C9766025138EC61A00741512 /* dprintf.c in Sources */, + C9766026138EC61A00741512 /* fclose.c in Sources */, + C9766027138EC61A00741512 /* fdopen.c in Sources */, + C9766028138EC61A00741512 /* feof.c in Sources */, + C9766029138EC61A00741512 /* ferror.c in Sources */, + C976602A138EC61A00741512 /* fflush.c in Sources */, + C976602B138EC61A00741512 /* fgetc.c in Sources */, + C976602C138EC61A00741512 /* fgetln.c in Sources */, + C976602D138EC61A00741512 /* fgetpos.c in Sources */, + C976602E138EC61A00741512 /* fgets.c in Sources */, + C976602F138EC61A00741512 /* fgetwc.c in Sources */, + C9766030138EC61A00741512 /* fgetwln.c in Sources */, + C9766031138EC61A00741512 /* fgetws.c in Sources */, + C9766032138EC61A00741512 /* fileno.c in Sources */, + C9766033138EC61A00741512 /* findfp.c in Sources */, + C9766034138EC61A00741512 /* flags.c in Sources */, + C9766035138EC61A00741512 /* fopen.c in Sources */, + C9766036138EC61A00741512 /* fprintf.c in Sources */, + C9766037138EC61A00741512 /* fpurge.c in Sources */, + C9766038138EC61A00741512 /* fputc.c in Sources */, + C9766039138EC61A00741512 /* fputs.c in Sources */, + C976603A138EC61A00741512 /* fputwc.c in Sources */, + C976603B138EC61A00741512 /* fputws.c in Sources */, + C976603C138EC61A00741512 /* fread.c in Sources */, + C976603D138EC61A00741512 /* freopen.c in Sources */, + C976603E138EC61A00741512 /* fscanf.c in Sources */, + C976603F138EC61A00741512 /* fseek.c in Sources */, + C9766040138EC61A00741512 /* fsetpos.c in Sources */, + C9766041138EC61A00741512 /* ftell.c in Sources */, + C9766042138EC61A00741512 /* funopen.c in Sources */, + C9766043138EC61A00741512 /* fvwrite.c in Sources */, + C9766044138EC61A00741512 /* fwalk.c in Sources */, + C9766045138EC61A00741512 /* fwide.c in Sources */, + C9766046138EC61A00741512 /* fwprintf.c in Sources */, + C9766047138EC61A00741512 /* fwrite.c in Sources */, + C9766048138EC61A00741512 /* fwscanf.c in Sources */, + C9766049138EC61A00741512 /* getc.c in Sources */, + C976604A138EC61A00741512 /* getchar.c in Sources */, + C976604B138EC61A00741512 /* getdelim.c in Sources */, + C976604C138EC61A00741512 /* getline.c in Sources */, + 928BD1031D76073300EC01FC /* timingsafe_bcmp.c in Sources */, + C976604D138EC61A00741512 /* gets.c in Sources */, + C976604E138EC61A00741512 /* getw.c in Sources */, + C976604F138EC61A00741512 /* getwc.c in Sources */, + C9766050138EC61A00741512 /* getwchar.c in Sources */, + C9766051138EC61A00741512 /* makebuf.c in Sources */, + C9766052138EC61A00741512 /* mktemp.c in Sources */, + C9766053138EC61A00741512 /* perror.c in Sources */, + C9766054138EC61A00741512 /* printf-pos.c in Sources */, + C9766055138EC61A00741512 /* printf.c in Sources */, + C9766056138EC61A00741512 /* putc.c in Sources */, + C9766057138EC61A00741512 /* putchar.c in Sources */, + C9766058138EC61A00741512 /* puts.c in Sources */, + C9766059138EC61A00741512 /* putw.c in Sources */, + C976605A138EC61A00741512 /* putwc.c in Sources */, + C976605B138EC61A00741512 /* putwchar.c in Sources */, + C976605C138EC61A00741512 /* refill.c in Sources */, + C976605D138EC61A00741512 /* remove.c in Sources */, + C976605E138EC61A00741512 /* rewind.c in Sources */, + C976605F138EC61A00741512 /* rget.c in Sources */, + C9766060138EC61A00741512 /* scanf.c in Sources */, + C9766061138EC61A00741512 /* setbuf.c in Sources */, + C9766062138EC61A00741512 /* setbuffer.c in Sources */, + C9766063138EC61A00741512 /* setvbuf.c in Sources */, + C9766064138EC61A00741512 /* snprintf.c in Sources */, + C9766065138EC61A00741512 /* sprintf.c in Sources */, + C9766066138EC61A00741512 /* sscanf.c in Sources */, + C9766067138EC61A00741512 /* stdio.c in Sources */, + C9766068138EC61A00741512 /* swprintf.c in Sources */, + C9766069138EC61A00741512 /* swscanf.c in Sources */, + C976606A138EC61A00741512 /* tempnam.c in Sources */, + C976606B138EC61A00741512 /* tmpfile.c in Sources */, + C976606C138EC61A00741512 /* tmpnam.c in Sources */, + C976606D138EC61A00741512 /* ungetc.c in Sources */, + C976606E138EC61A00741512 /* ungetwc.c in Sources */, + C976606F138EC61A00741512 /* vasprintf.c in Sources */, + C9766070138EC61A00741512 /* vdprintf.c in Sources */, + C9766071138EC61A00741512 /* vfprintf.c in Sources */, + C9766072138EC61A00741512 /* vfscanf.c in Sources */, + C9766073138EC61A00741512 /* vfwprintf.c in Sources */, + C9766074138EC61A00741512 /* vfwscanf.c in Sources */, + C9766075138EC61A00741512 /* vprintf.c in Sources */, + C9766076138EC61A00741512 /* vscanf.c in Sources */, + C9766077138EC61A00741512 /* vsnprintf.c in Sources */, + C9766078138EC61A00741512 /* vsprintf.c in Sources */, + C9766079138EC61A00741512 /* vsscanf.c in Sources */, + C976607A138EC61A00741512 /* vswprintf.c in Sources */, + C976607B138EC61A00741512 /* vswscanf.c in Sources */, + C976607C138EC61A00741512 /* vwprintf.c in Sources */, + C976607D138EC61A00741512 /* vwscanf.c in Sources */, + C976607E138EC61A00741512 /* wbuf.c in Sources */, + C976607F138EC61A00741512 /* wprintf.c in Sources */, + C9766080138EC61A00741512 /* wscanf.c in Sources */, + C9766081138EC61A00741512 /* wsetup.c in Sources */, + C9766082138EC61A00741512 /* a64l.c in Sources */, + C9766083138EC61A00741512 /* _Exit_.c in Sources */, + C9766084138EC61A00741512 /* abort.c in Sources */, + C9766085138EC61A00741512 /* abs.c in Sources */, + C9766086138EC61A00741512 /* atexit.c in Sources */, + C9766087138EC61A00741512 /* atof.c in Sources */, + C9766088138EC61A00741512 /* atoi.c in Sources */, + C9766089138EC61A00741512 /* atol.c in Sources */, + C976608A138EC61A00741512 /* atoll.c in Sources */, + C976608B138EC61A00741512 /* bsearch.c in Sources */, + C976608C138EC61A00741512 /* div.c in Sources */, + C976608D138EC61A00741512 /* exit.c in Sources */, + C976608E138EC61A00741512 /* getenv.c in Sources */, + C976608F138EC61A00741512 /* getopt.c in Sources */, + C9766090138EC61A00741512 /* getopt_long.c in Sources */, + C9766091138EC61A00741512 /* getsubopt.c in Sources */, + C9766092138EC61A00741512 /* hcreate.c in Sources */, + C9766093138EC61A00741512 /* heapsort.c in Sources */, + C9766094138EC61A00741512 /* heapsort_b.c in Sources */, + C9766095138EC61A00741512 /* heapsort_r.c in Sources */, + C9766096138EC61A00741512 /* imaxabs.c in Sources */, + C9766097138EC61A00741512 /* imaxdiv.c in Sources */, + C9766098138EC61A00741512 /* insque.c in Sources */, + C9766099138EC61A00741512 /* labs.c in Sources */, + C976609A138EC61A00741512 /* ldiv.c in Sources */, + C976609B138EC61A00741512 /* llabs.c in Sources */, + C976609C138EC61A00741512 /* lldiv.c in Sources */, + C976609D138EC61A00741512 /* lsearch.c in Sources */, + C976609E138EC61A00741512 /* merge.c in Sources */, + C976609F138EC61A00741512 /* putenv.c in Sources */, + C97660A0138EC61A00741512 /* qsort.c in Sources */, + C97660A1138EC61A00741512 /* qsort_r.c in Sources */, + C97660A2138EC61A00741512 /* radixsort.c in Sources */, + C97660A3138EC61A00741512 /* rand.c in Sources */, + C97660A4138EC61A00741512 /* random.c in Sources */, + C97660A5138EC61A00741512 /* reallocf.c in Sources */, + C97660A6138EC61A00741512 /* realpath.c in Sources */, + C97660A7138EC61A00741512 /* remque.c in Sources */, + C97660A8138EC61A00741512 /* setenv.c in Sources */, + C97660A9138EC61A00741512 /* strhash.c in Sources */, + C97660AA138EC61A00741512 /* strtoimax.c in Sources */, + 922D0C1321BFA1A40072834D /* timespec_get.c in Sources */, + C97660AB138EC61A00741512 /* strtol.c in Sources */, + C97660AC138EC61A00741512 /* strtoll.c in Sources */, + C97660AD138EC61A00741512 /* strtoq.c in Sources */, + C97660AE138EC61A00741512 /* strtoul.c in Sources */, + C97660AF138EC61A00741512 /* strtoull.c in Sources */, + C97660B0138EC61A00741512 /* strtoumax.c in Sources */, + C97660B1138EC61A00741512 /* strtouq.c in Sources */, + C97660B2138EC61A00741512 /* system.c in Sources */, + C97660B3138EC61A00741512 /* tdelete.c in Sources */, + C97660B4138EC61A00741512 /* tfind.c in Sources */, + C97660B5138EC61A00741512 /* tsearch.c in Sources */, + C97660B6138EC61A00741512 /* twalk.c in Sources */, + C97660B7138EC61A00741512 /* grantpt.c in Sources */, + C97660B8138EC61A00741512 /* l64a.c in Sources */, + C97660B9138EC61A00741512 /* strfmon.c in Sources */, + C97660BA138EC61A00741512 /* ecvt.c in Sources */, + C97660BB138EC61A00741512 /* gcvt.c in Sources */, + C97660BC138EC61A00741512 /* qsort_b.c in Sources */, + C97660BD138EC61A00741512 /* asctime.c in Sources */, + C97660BE138EC61A00741512 /* difftime.c in Sources */, + C97660BF138EC61A00741512 /* ftime.c in Sources */, + C97660C0138EC61A00741512 /* localtime.c in Sources */, + C97660C1138EC61A00741512 /* strftime.c in Sources */, + C97660C2138EC61A00741512 /* strptime.c in Sources */, + C97660C3138EC61A00741512 /* time32.c in Sources */, + C97660C4138EC61A00741512 /* timelocal.c in Sources */, + C97660C5138EC61A00741512 /* getdate.c in Sources */, + C97660C6138EC61A00741512 /* timezone_unix03.c in Sources */, + C97660CF138EC61A00741512 /* memmem.c in Sources */, + C97660D2138EC61A00741512 /* rindex.c in Sources */, + C97660D5138EC61A00741512 /* strcasecmp.c in Sources */, + C97660D6138EC61A00741512 /* strcasestr.c in Sources */, + C97660DA138EC61A00741512 /* strcoll.c in Sources */, + C97660DC138EC61A00741512 /* strcspn.c in Sources */, + C97660DD138EC61A00741512 /* strdup.c in Sources */, + C97660DE138EC61A00741512 /* strerror.c in Sources */, + C97660E2138EC61A00741512 /* strmode.c in Sources */, + C97660E6138EC61A00741512 /* strndup.c in Sources */, + C97660E8138EC61A00741512 /* strnstr.c in Sources */, + C97660E9138EC61A00741512 /* strpbrk.c in Sources */, + C97660EA138EC61A00741512 /* strrchr.c in Sources */, + C97660EB138EC61A00741512 /* strsep.c in Sources */, + C97660EC138EC61A00741512 /* strsignal.c in Sources */, + C97660ED138EC61A00741512 /* strspn.c in Sources */, + C97660EF138EC61A00741512 /* strtok.c in Sources */, + C97660F0138EC61A00741512 /* strxfrm.c in Sources */, + C97660F1138EC61A00741512 /* swab.c in Sources */, + C97660F2138EC61A00741512 /* wcpcpy.c in Sources */, + C97660F3138EC61A00741512 /* wcpncpy.c in Sources */, + C97660F4138EC61A00741512 /* wcscasecmp.c in Sources */, + C97660F5138EC61A00741512 /* wcscat.c in Sources */, + C97660F6138EC61A00741512 /* wcschr.c in Sources */, + C97660F7138EC61A00741512 /* wcscmp.c in Sources */, + C97660F8138EC61A00741512 /* wcscoll.c in Sources */, + C97660F9138EC61A00741512 /* wcscpy.c in Sources */, + C97660FA138EC61A00741512 /* wcscspn.c in Sources */, + C97660FB138EC61A00741512 /* wcsdup.c in Sources */, + C97660FC138EC61A00741512 /* wcslcat.c in Sources */, + C97660FD138EC61A00741512 /* wcslcpy.c in Sources */, + C97660FE138EC61A00741512 /* wcslen.c in Sources */, + C97660FF138EC61A00741512 /* wcsncasecmp.c in Sources */, + C9766100138EC61A00741512 /* wcsncat.c in Sources */, + C9766101138EC61A00741512 /* wcsncmp.c in Sources */, + C9766102138EC61A00741512 /* wcsncpy.c in Sources */, + C9766103138EC61A00741512 /* wcsnlen.c in Sources */, + C9766104138EC61A00741512 /* wcspbrk.c in Sources */, + C9766105138EC61A00741512 /* wcsrchr.c in Sources */, + C9766106138EC61A00741512 /* wcsspn.c in Sources */, + C9766107138EC61A00741512 /* wcsstr.c in Sources */, + C9766108138EC61A00741512 /* wcstok.c in Sources */, + C9766109138EC61A00741512 /* wcswidth.c in Sources */, + C976610A138EC61A00741512 /* wcsxfrm.c in Sources */, + C976610B138EC61A00741512 /* wmemchr.c in Sources */, + C976610C138EC61A00741512 /* wmemcmp.c in Sources */, + C976610D138EC61A00741512 /* wmemcpy.c in Sources */, + 2DF67CE1184F9CBE00B83A3D /* debug_private.c in Sources */, + C976610E138EC61A00741512 /* wmemmove.c in Sources */, + C976610F138EC61A00741512 /* wmemset.c in Sources */, + C9766110138EC61A00741512 /* _libc_init.c in Sources */, + C9766111138EC61A00741512 /* _libc_fork_child.c in Sources */, + C9766112138EC61A00741512 /* chmodx_np.c in Sources */, + C9766114138EC61A00741512 /* crt_externs.c in Sources */, + C9766116138EC61A00741512 /* fork.c in Sources */, + C9766117138EC61A00741512 /* getgroups.c in Sources */, + C9766119138EC61A00741512 /* gettimeofday.c in Sources */, + C976611A138EC61A00741512 /* msgctl.c in Sources */, + C976611B138EC61A00741512 /* stack_protector.c in Sources */, + C976611C138EC61A00741512 /* openx_np.c in Sources */, + C976611D138EC61A00741512 /* OSMemoryNotification.c in Sources */, + C976611E138EC61A00741512 /* OSThermalNotification.c in Sources */, + C976611F138EC61A00741512 /* posix_spawn.c in Sources */, + C9766120138EC61A00741512 /* semctl.c in Sources */, + C9766121138EC61A00741512 /* settimeofday.c in Sources */, + C9766122138EC61A00741512 /* shmctl.c in Sources */, + C9766123138EC61A00741512 /* sigaction.c in Sources */, + C9766127138EC61A00741512 /* statx_np.c in Sources */, + C9766128138EC61A00741512 /* umaskx_np.c in Sources */, + C976612C138EC61A00741512 /* fparseln.c in Sources */, + C976612D138EC61A00741512 /* login.c in Sources */, + C976612E138EC61A00741512 /* login_tty.c in Sources */, + C976612F138EC61A00741512 /* logout.c in Sources */, + C9766130138EC61A00741512 /* logwtmp.c in Sources */, + 3F76864F13E91D6700C94D25 /* mkpath_np.c in Sources */, + C9766131138EC61A00741512 /* opendev.c in Sources */, + C9766132138EC61A00741512 /* pty.c in Sources */, + C9766133138EC61A00741512 /* clear.c in Sources */, + C9766134138EC61A00741512 /* compare.c in Sources */, + C9766135138EC61A00741512 /* copy.c in Sources */, + C9766136138EC61A00741512 /* gen_uuid.c in Sources */, + C9766137138EC61A00741512 /* isnull.c in Sources */, + C9766138138EC61A00741512 /* pack.c in Sources */, + C9766139138EC61A00741512 /* parse.c in Sources */, + C976613A138EC61A00741512 /* unpack.c in Sources */, + C976613B138EC61A00741512 /* unparse.c in Sources */, + B19C645E1450F90200032373 /* sync_volume_np.c in Sources */, + 3FB7E1B6146EF2E000843438 /* dirfd.c in Sources */, + 4B2C64A515519BC600342BFA /* assumes.c in Sources */, + FC2ED613157D4BE80098EC69 /* inet_ntop.c in Sources */, + FC2ED61C157D4BE80098EC69 /* inet_pton.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9EB2FCC138F6D880075BB52 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C9EB2FD4138F6D880075BB52 /* creat.c in Sources */, + C9EB2FD5138F6D880075BB52 /* gethostid.c in Sources */, + C9EB2FD6138F6D880075BB52 /* getwd.c in Sources */, + C9EB2FD7138F6D880075BB52 /* killpg.c in Sources */, + C9EB2FD8138F6D880075BB52 /* sethostid.c in Sources */, + C9EB2FD9138F6D880075BB52 /* setpgrp.c in Sources */, + C9EB2FDA138F6D880075BB52 /* setrgid.c in Sources */, + C9EB2FDB138F6D880075BB52 /* setruid.c in Sources */, + C9EB2FDC138F6D880075BB52 /* setregid.c in Sources */, + C9EB2FDD138F6D880075BB52 /* setreuid.c in Sources */, + C9EB2FDE138F6D880075BB52 /* sigaltstk.c in Sources */, + C9EB2FDF138F6D880075BB52 /* sigcompat.c in Sources */, + C9EB2FE1138F6D880075BB52 /* kvm.c in Sources */, + C9EB2FE5138F6D880075BB52 /* forceLibcToBuild.c in Sources */, + C9EB2FE6138F6D880075BB52 /* bt_close.c in Sources */, + C9EB2FE7138F6D880075BB52 /* bt_conv.c in Sources */, + C9EB2FE8138F6D880075BB52 /* bt_debug.c in Sources */, + C9EB2FE9138F6D880075BB52 /* bt_delete.c in Sources */, + C9EB2FEA138F6D880075BB52 /* bt_get.c in Sources */, + C9EB2FEB138F6D880075BB52 /* bt_open.c in Sources */, + C9EB2FEC138F6D880075BB52 /* bt_overflow.c in Sources */, + C9EB2FED138F6D880075BB52 /* bt_page.c in Sources */, + C9EB2FEE138F6D880075BB52 /* bt_put.c in Sources */, + C9EB2FEF138F6D880075BB52 /* bt_search.c in Sources */, + C9EB2FF0138F6D880075BB52 /* bt_seq.c in Sources */, + C9EB2FF1138F6D880075BB52 /* bt_split.c in Sources */, + C9EB2FF2138F6D880075BB52 /* bt_utils.c in Sources */, + C9EB2FF3138F6D880075BB52 /* db.c in Sources */, + C9EB2FF4138F6D880075BB52 /* hash.c in Sources */, + C9EB2FF5138F6D880075BB52 /* hash_bigkey.c in Sources */, + C9EB2FF6138F6D880075BB52 /* hash_buf.c in Sources */, + C9EB2FF7138F6D880075BB52 /* hash_func.c in Sources */, + C9EB2FF8138F6D880075BB52 /* hash_log2.c in Sources */, + C9EB2FF9138F6D880075BB52 /* hash_page.c in Sources */, + C9EB2FFA138F6D880075BB52 /* ndbm.c in Sources */, + C9EB2FFB138F6D880075BB52 /* mpool.c in Sources */, + C9EB2FFC138F6D880075BB52 /* rec_close.c in Sources */, + C9EB2FFD138F6D880075BB52 /* rec_delete.c in Sources */, + C9EB2FFE138F6D880075BB52 /* rec_get.c in Sources */, + C9EB2FFF138F6D880075BB52 /* rec_open.c in Sources */, + C9EB3000138F6D880075BB52 /* rec_put.c in Sources */, + C9EB3001138F6D880075BB52 /* rec_search.c in Sources */, + C9EB3002138F6D880075BB52 /* rec_seq.c in Sources */, + C9EB3003138F6D880075BB52 /* rec_utils.c in Sources */, + C9EB3004138F6D880075BB52 /* brk.c in Sources */, + C9EB3005138F6D880075BB52 /* bsd_signal.c in Sources */, + C9EB3006138F6D880075BB52 /* lchflags.c in Sources */, + C9EB3007138F6D880075BB52 /* lchmod.c in Sources */, + C9EB3008138F6D880075BB52 /* lutimes.c in Sources */, + C9EB3009138F6D880075BB52 /* statvfs.c in Sources */, + C9EB300A138F6D880075BB52 /* tcgetsid.c in Sources */, + C9EB300B138F6D880075BB52 /* _ldbl_util.c in Sources */, + C9EB300C138F6D880075BB52 /* _hdtoa.c in Sources */, + C9EB300D138F6D880075BB52 /* _ldtoa.c in Sources */, + C9EB300E138F6D880075BB52 /* gdtoa-dmisc.c in Sources */, + C9EB300F138F6D880075BB52 /* gdtoa-dtoa.c in Sources */, + C9EB3010138F6D880075BB52 /* gdtoa-gdtoa.c in Sources */, + C9EB3011138F6D880075BB52 /* gdtoa-gethex.c in Sources */, + C9EB3012138F6D880075BB52 /* gdtoa-gmisc.c in Sources */, + C9EB3013138F6D880075BB52 /* gdtoa-hd_init.c in Sources */, + C9EB3014138F6D880075BB52 /* gdtoa-hexnan.c in Sources */, + C9EB3015138F6D880075BB52 /* gdtoa-misc.c in Sources */, + C9EB3016138F6D880075BB52 /* gdtoa-smisc.c in Sources */, + C9EB3017138F6D880075BB52 /* gdtoa-strtod.c in Sources */, + C9EB3018138F6D880075BB52 /* gdtoa-strtodg.c in Sources */, + C9EB3019138F6D880075BB52 /* gdtoa-strtof.c in Sources */, + C9EB301A138F6D880075BB52 /* gdtoa-strtoIg.c in Sources */, + C9EB301B138F6D880075BB52 /* gdtoa-strtopdd.c in Sources */, + C9EB301C138F6D880075BB52 /* gdtoa-strtopx.c in Sources */, + C9EB301D138F6D880075BB52 /* gdtoa-strtord.c in Sources */, + C9EB301E138F6D880075BB52 /* gdtoa-sum.c in Sources */, + C9EB301F138F6D880075BB52 /* gdtoa-ulp.c in Sources */, + C9EB3020138F6D880075BB52 /* glue.c in Sources */, + C9EB3021138F6D880075BB52 /* machdep_ldisd.c in Sources */, + C9EB3022138F6D880075BB52 /* machdep_ldisdd.c in Sources */, + C9EB3023138F6D880075BB52 /* machdep_ldisQ.c in Sources */, + C9EB3024138F6D880075BB52 /* machdep_ldisx.c in Sources */, + C9EB302E138F6D880075BB52 /* authentication.c in Sources */, + C9EB302F138F6D880075BB52 /* backtrace.c in Sources */, + C9EB3031138F6D880075BB52 /* confstr.c in Sources */, + C9EB3032138F6D880075BB52 /* crypt.c in Sources */, + C9EB3033138F6D880075BB52 /* devname.c in Sources */, + C9EB3034138F6D880075BB52 /* disklabel.c in Sources */, + C9EB3035138F6D880075BB52 /* errlst.c in Sources */, + C9EB3036138F6D880075BB52 /* filesec.c in Sources */, + C9EB3037138F6D880075BB52 /* _rand48.c in Sources */, + C9EB3038138F6D880075BB52 /* alarm.c in Sources */, + C9EB3039138F6D880075BB52 /* arc4random.c in Sources */, + C9EB303A138F6D880075BB52 /* assert.c in Sources */, + C9EB303B138F6D880075BB52 /* basename.c in Sources */, + C9EB303C138F6D880075BB52 /* clock.c in Sources */, + C9EB303D138F6D880075BB52 /* closedir.c in Sources */, + C9EB303E138F6D880075BB52 /* ctermid.c in Sources */, + C9EB303F138F6D880075BB52 /* daemon.c in Sources */, + C9EB3040138F6D880075BB52 /* dirname.c in Sources */, + C9EB3041138F6D880075BB52 /* drand48.c in Sources */, + C9EB3042138F6D880075BB52 /* erand48.c in Sources */, + C9EB3043138F6D880075BB52 /* err.c in Sources */, + C9EB3044138F6D880075BB52 /* exec.c in Sources */, + C9EB3045138F6D880075BB52 /* fmtcheck.c in Sources */, + C9EB3046138F6D880075BB52 /* fmtmsg.c in Sources */, + C9EB3047138F6D880075BB52 /* fnmatch.c in Sources */, + C9EB3048138F6D880075BB52 /* ftok.c in Sources */, + C9EB3049138F6D880075BB52 /* getbsize.c in Sources */, + C9EB304A138F6D880075BB52 /* getcap.c in Sources */, + C9EB304B138F6D880075BB52 /* getcwd.c in Sources */, + C9EB304C138F6D880075BB52 /* gethostname.c in Sources */, + C9EB304D138F6D880075BB52 /* getlogin.c in Sources */, + C9EB304E138F6D880075BB52 /* getmntinfo.c in Sources */, + C9EB304F138F6D880075BB52 /* getpagesize.c in Sources */, + C9EB3050138F6D880075BB52 /* getpeereid.c in Sources */, + C9EB3051138F6D880075BB52 /* getprogname.c in Sources */, + C9EB3052138F6D880075BB52 /* glob.c in Sources */, + C9EB3053138F6D880075BB52 /* isatty.c in Sources */, + C9EB3054138F6D880075BB52 /* jrand48.c in Sources */, + C9EB3055138F6D880075BB52 /* lcong48.c in Sources */, + C9EB3056138F6D880075BB52 /* lockf.c in Sources */, + C9EB3057138F6D880075BB52 /* lrand48.c in Sources */, + C9EB3058138F6D880075BB52 /* mrand48.c in Sources */, + C9EB3059138F6D880075BB52 /* nice.c in Sources */, + C9EB305A138F6D880075BB52 /* nrand48.c in Sources */, + C9EB305B138F6D880075BB52 /* opendir.c in Sources */, + C9EB305C138F6D880075BB52 /* pause.c in Sources */, + C9EB305D138F6D880075BB52 /* popen.c in Sources */, + C9EB305F138F6D880075BB52 /* psignal.c in Sources */, + C9EB3060138F6D880075BB52 /* raise.c in Sources */, + C9EB3061138F6D880075BB52 /* readdir.c in Sources */, + C9EB3062138F6D880075BB52 /* readpassphrase.c in Sources */, + C9EB3063138F6D880075BB52 /* rewinddir.c in Sources */, + C9EB3064138F6D880075BB52 /* scandir.c in Sources */, + C9EB3065138F6D880075BB52 /* seed48.c in Sources */, + C9EB3066138F6D880075BB52 /* seekdir.c in Sources */, + C9EB3067138F6D880075BB52 /* sethostname.c in Sources */, + C9EB3068138F6D880075BB52 /* setmode.c in Sources */, + C9EB3069138F6D880075BB52 /* setprogname.c in Sources */, + C9EB306A138F6D880075BB52 /* siginterrupt.c in Sources */, + C9EB306B138F6D880075BB52 /* siglist.c in Sources */, + C9EB306C138F6D880075BB52 /* signal.c in Sources */, + C9EB306D138F6D880075BB52 /* sleep.c in Sources */, + C9EB306E138F6D880075BB52 /* srand48.c in Sources */, + C9EB306F138F6D880075BB52 /* stringlist.c in Sources */, + C9EB3070138F6D880075BB52 /* sysconf.c in Sources */, + C9EB3071138F6D880075BB52 /* sysctl.c in Sources */, + C9EB3072138F6D880075BB52 /* sysctlbyname.c in Sources */, + C9EB3073138F6D880075BB52 /* sysctlnametomib.c in Sources */, + C9EB3074138F6D880075BB52 /* telldir.c in Sources */, + C9EB3075138F6D880075BB52 /* termios.c in Sources */, + C9EB3076138F6D880075BB52 /* time.c in Sources */, + C9EB3077138F6D880075BB52 /* times.c in Sources */, + C9EB3078138F6D880075BB52 /* timezone.c in Sources */, + C9EB3079138F6D880075BB52 /* ttyname.c in Sources */, + C9EB307A138F6D880075BB52 /* ttyslot.c in Sources */, + C9EB307B138F6D880075BB52 /* ualarm.c in Sources */, + C9EB307C138F6D880075BB52 /* ulimit.c in Sources */, + C9EB307D138F6D880075BB52 /* unvis.c in Sources */, + C9EB307E138F6D880075BB52 /* usleep.c in Sources */, + C9EB307F138F6D880075BB52 /* utime.c in Sources */, + C9EB3080138F6D880075BB52 /* vis.c in Sources */, + C9EB3081138F6D880075BB52 /* wait.c in Sources */, + C9EB3082138F6D880075BB52 /* wait3.c in Sources */, + C9EB3083138F6D880075BB52 /* waitpid.c in Sources */, + C9EB3084138F6D880075BB52 /* fts.c in Sources */, + C9EB3085138F6D880075BB52 /* get_compat.c in Sources */, + C9EB3086138F6D880075BB52 /* getloadavg.c in Sources */, + C9EB3087138F6D880075BB52 /* getttyent.c in Sources */, + C9EB3088138F6D880075BB52 /* getusershell.c in Sources */, + C9EB3089138F6D880075BB52 /* getvfsbyname.c in Sources */, + C9EB308E138F6D880075BB52 /* nanosleep.c in Sources */, + C9EB308F138F6D880075BB52 /* utmpx.c in Sources */, + C9EB3090138F6D880075BB52 /* nftw.c in Sources */, + C9EB3091138F6D880075BB52 /* nlist.c in Sources */, + C9EB3093138F6D880075BB52 /* oldsyslog.c in Sources */, + 928BD1071D76073600EC01FC /* timingsafe_bcmp.c in Sources */, + C9EB3096138F6D880075BB52 /* setlogin.c in Sources */, + C9EB3097138F6D880075BB52 /* sigsetops.c in Sources */, + C9EB309A138F6D880075BB52 /* strtofflags.c in Sources */, + C9EB309C138F6D880075BB52 /* thread_stack_pcs.c in Sources */, + C9EB309D138F6D880075BB52 /* uname.c in Sources */, + C9EB309E138F6D880075BB52 /* utmpx-darwin.c in Sources */, + C9EB309F138F6D880075BB52 /* wordexp.c in Sources */, + C9EB30A1138F6D880075BB52 /* gmon.c in Sources */, + C9EB30C1138F6D880075BB52 /* ascii.c in Sources */, + C9EB30C2138F6D880075BB52 /* big5.c in Sources */, + C9EB30C3138F6D880075BB52 /* btowc.c in Sources */, + C9EB30C4138F6D880075BB52 /* collate.c in Sources */, + C9EB30C5138F6D880075BB52 /* collcmp.c in Sources */, + C9EB30C6138F6D880075BB52 /* euc.c in Sources */, + C9EB30C7138F6D880075BB52 /* fix_grouping.c in Sources */, + C9EB30C8138F6D880075BB52 /* gb18030.c in Sources */, + C9EB30C9138F6D880075BB52 /* gb2312.c in Sources */, + C9EB30CA138F6D880075BB52 /* gbk.c in Sources */, + C9EB30CB138F6D880075BB52 /* ldpart.c in Sources */, + C9EB30CC138F6D880075BB52 /* lmessages.c in Sources */, + C9EB30CD138F6D880075BB52 /* lmonetary.c in Sources */, + C9EB30CE138F6D880075BB52 /* lnumeric.c in Sources */, + C9EB30CF138F6D880075BB52 /* localeconv.c in Sources */, + C9EB30D0138F6D880075BB52 /* mblen.c in Sources */, + C9EB30D1138F6D880075BB52 /* mbrlen.c in Sources */, + C9EB30D2138F6D880075BB52 /* mbrtowc.c in Sources */, + C9EB30D3138F6D880075BB52 /* mbsinit.c in Sources */, + C9EB30D4138F6D880075BB52 /* mbsnrtowcs.c in Sources */, + C9EB30D5138F6D880075BB52 /* mbsrtowcs.c in Sources */, + C9EB30D6138F6D880075BB52 /* mbstowcs.c in Sources */, + C9EB30D7138F6D880075BB52 /* mbtowc.c in Sources */, + C9EB30D8138F6D880075BB52 /* mskanji.c in Sources */, + C9EB30D9138F6D880075BB52 /* nextwctype.c in Sources */, + C9EB30DA138F6D880075BB52 /* nl_langinfo.c in Sources */, + C9EB30DB138F6D880075BB52 /* nomacros.c in Sources */, + C9EB30DC138F6D880075BB52 /* none.c in Sources */, + C9EB30DD138F6D880075BB52 /* rune.c in Sources */, + C9EB30DE138F6D880075BB52 /* runetype.c in Sources */, + C9EB30DF138F6D880075BB52 /* setlocale.c in Sources */, + C9EB30E0138F6D880075BB52 /* setrunelocale.c in Sources */, + C9EB30E1138F6D880075BB52 /* table.c in Sources */, + C9EB30E2138F6D880075BB52 /* tolower.c in Sources */, + C9EB30E3138F6D880075BB52 /* toupper.c in Sources */, + C9EB30E4138F6D880075BB52 /* utf2.c in Sources */, + C9EB30E5138F6D880075BB52 /* utf8.c in Sources */, + C9EB30E6138F6D880075BB52 /* wcrtomb.c in Sources */, + C9EB30E7138F6D880075BB52 /* wcsftime.c in Sources */, + C9EB30E8138F6D880075BB52 /* wcsnrtombs.c in Sources */, + C9EB30E9138F6D880075BB52 /* wcsrtombs.c in Sources */, + C9EB30EA138F6D880075BB52 /* wcstod.c in Sources */, + C9EB30EB138F6D880075BB52 /* wcstof.c in Sources */, + C9EB30EC138F6D880075BB52 /* wcstoimax.c in Sources */, + C9EB30ED138F6D880075BB52 /* wcstol.c in Sources */, + C9EB30EE138F6D880075BB52 /* wcstold.c in Sources */, + C9EB30EF138F6D880075BB52 /* wcstoll.c in Sources */, + C9EB30F0138F6D880075BB52 /* wcstombs.c in Sources */, + C9EB30F1138F6D880075BB52 /* wcstoul.c in Sources */, + C9EB30F2138F6D880075BB52 /* wcstoull.c in Sources */, + C9EB30F3138F6D880075BB52 /* wcstoumax.c in Sources */, + C9EB30F4138F6D880075BB52 /* wctob.c in Sources */, + C9EB30F5138F6D880075BB52 /* wctomb.c in Sources */, + C9EB30F6138F6D880075BB52 /* wctrans.c in Sources */, + C9EB30F7138F6D880075BB52 /* wctype.c in Sources */, + C9EB30F8138F6D880075BB52 /* wcwidth.c in Sources */, + C9EB30F9138F6D880075BB52 /* frune.c in Sources */, + C9EB30FA138F6D880075BB52 /* isctype.c in Sources */, + C9EB30FB138F6D880075BB52 /* iswctype.c in Sources */, + C9EB30FC138F6D880075BB52 /* lconv.c in Sources */, + C9EB30FD138F6D880075BB52 /* mbrune.c in Sources */, + C9EB30FE138F6D880075BB52 /* runedepreciated.c in Sources */, + C9EB30FF138F6D880075BB52 /* setinvalidrune.c in Sources */, + C9EB3100138F6D880075BB52 /* xlocale.c in Sources */, + C9EB3101138F6D880075BB52 /* addr2ascii.c in Sources */, + C9EB3102138F6D880075BB52 /* ascii2addr.c in Sources */, + C9EB3103138F6D880075BB52 /* inet_addr.c in Sources */, + C9EB3104138F6D880075BB52 /* inet_lnaof.c in Sources */, + C9EB3105138F6D880075BB52 /* inet_makeaddr.c in Sources */, + C9EB3106138F6D880075BB52 /* inet_net_ntop.c in Sources */, + C9EB3107138F6D880075BB52 /* inet_net_pton.c in Sources */, + C9EB3108138F6D880075BB52 /* inet_neta.c in Sources */, + C9EB3109138F6D880075BB52 /* inet_netof.c in Sources */, + C9EB310A138F6D880075BB52 /* inet_network.c in Sources */, + C9EB310B138F6D880075BB52 /* inet_ntoa.c in Sources */, + C9EB310C138F6D880075BB52 /* linkaddr.c in Sources */, + C9EB310D138F6D880075BB52 /* nsap_addr.c in Sources */, + C9EB310E138F6D880075BB52 /* recv.c in Sources */, + C9EB310F138F6D880075BB52 /* send.c in Sources */, + C9EB3110138F6D880075BB52 /* sockatmark.c in Sources */, + C9EB3111138F6D880075BB52 /* sourcefilter.c in Sources */, + C9EB3112138F6D880075BB52 /* msgcat.c in Sources */, + C9EB3113138F6D880075BB52 /* acl.c in Sources */, + C9EB3114138F6D880075BB52 /* acl_entry.c in Sources */, + C9EB3115138F6D880075BB52 /* acl_file.c in Sources */, + C9EB3116138F6D880075BB52 /* acl_flag.c in Sources */, + C9EB3117138F6D880075BB52 /* acl_perm.c in Sources */, + C9EB3118138F6D880075BB52 /* acl_translate.c in Sources */, + C9EB312C138F6D880075BB52 /* regerror.c in Sources */, + C9EB313D138F6D880075BB52 /* _flock_stub.c in Sources */, + C9EB313E138F6D880075BB52 /* asprintf.c in Sources */, + C9EB313F138F6D880075BB52 /* clrerr.c in Sources */, + C9EB3140138F6D880075BB52 /* dprintf.c in Sources */, + C9EB3141138F6D880075BB52 /* fclose.c in Sources */, + C9EB3142138F6D880075BB52 /* fdopen.c in Sources */, + C9EB3143138F6D880075BB52 /* feof.c in Sources */, + C9EB3144138F6D880075BB52 /* ferror.c in Sources */, + C9EB3145138F6D880075BB52 /* fflush.c in Sources */, + C9EB3146138F6D880075BB52 /* fgetc.c in Sources */, + C9EB3147138F6D880075BB52 /* fgetln.c in Sources */, + C9EB3148138F6D880075BB52 /* fgetpos.c in Sources */, + C9EB3149138F6D880075BB52 /* fgets.c in Sources */, + C9EB314A138F6D880075BB52 /* fgetwc.c in Sources */, + C9EB314B138F6D880075BB52 /* fgetwln.c in Sources */, + C9EB314C138F6D880075BB52 /* fgetws.c in Sources */, + C9EB314D138F6D880075BB52 /* fileno.c in Sources */, + 147CDFE01B7C233200831EC6 /* clock_gettime.c in Sources */, + C9EB314E138F6D880075BB52 /* findfp.c in Sources */, + C9EB314F138F6D880075BB52 /* flags.c in Sources */, + C9EB3150138F6D880075BB52 /* fopen.c in Sources */, + C9EB3151138F6D880075BB52 /* fprintf.c in Sources */, + C9EB3152138F6D880075BB52 /* fpurge.c in Sources */, + C9EB3153138F6D880075BB52 /* fputc.c in Sources */, + C9EB3154138F6D880075BB52 /* fputs.c in Sources */, + C9EB3155138F6D880075BB52 /* fputwc.c in Sources */, + C9EB3156138F6D880075BB52 /* fputws.c in Sources */, + C9EB3157138F6D880075BB52 /* fread.c in Sources */, + C9EB3158138F6D880075BB52 /* freopen.c in Sources */, + C9EB3159138F6D880075BB52 /* fscanf.c in Sources */, + C9EB315A138F6D880075BB52 /* fseek.c in Sources */, + C9EB315B138F6D880075BB52 /* fsetpos.c in Sources */, + C9EB315C138F6D880075BB52 /* ftell.c in Sources */, + C9EB315D138F6D880075BB52 /* funopen.c in Sources */, + C9EB315E138F6D880075BB52 /* fvwrite.c in Sources */, + C9EB315F138F6D880075BB52 /* fwalk.c in Sources */, + C9EB3160138F6D880075BB52 /* fwide.c in Sources */, + C9EB3161138F6D880075BB52 /* fwprintf.c in Sources */, + C9EB3162138F6D880075BB52 /* fwrite.c in Sources */, + C9EB3163138F6D880075BB52 /* fwscanf.c in Sources */, + C9EB3164138F6D880075BB52 /* getc.c in Sources */, + C9EB3165138F6D880075BB52 /* getchar.c in Sources */, + C9EB3166138F6D880075BB52 /* getdelim.c in Sources */, + C9EB3167138F6D880075BB52 /* getline.c in Sources */, + C9EB3168138F6D880075BB52 /* gets.c in Sources */, + C9EB3169138F6D880075BB52 /* getw.c in Sources */, + C9EB316A138F6D880075BB52 /* getwc.c in Sources */, + C9EB316B138F6D880075BB52 /* getwchar.c in Sources */, + C9EB316C138F6D880075BB52 /* makebuf.c in Sources */, + C9EB316D138F6D880075BB52 /* mktemp.c in Sources */, + C9EB316E138F6D880075BB52 /* perror.c in Sources */, + C9EB316F138F6D880075BB52 /* printf-pos.c in Sources */, + C9EB3170138F6D880075BB52 /* printf.c in Sources */, + C9EB3171138F6D880075BB52 /* putc.c in Sources */, + C9EB3172138F6D880075BB52 /* putchar.c in Sources */, + C9EB3173138F6D880075BB52 /* puts.c in Sources */, + C9EB3174138F6D880075BB52 /* putw.c in Sources */, + C9EB3175138F6D880075BB52 /* putwc.c in Sources */, + C9EB3176138F6D880075BB52 /* putwchar.c in Sources */, + C9EB3177138F6D880075BB52 /* refill.c in Sources */, + C9EB3178138F6D880075BB52 /* remove.c in Sources */, + C9EB3179138F6D880075BB52 /* rewind.c in Sources */, + C9EB317A138F6D880075BB52 /* rget.c in Sources */, + C9EB317B138F6D880075BB52 /* scanf.c in Sources */, + C9EB317C138F6D880075BB52 /* setbuf.c in Sources */, + C9EB317D138F6D880075BB52 /* setbuffer.c in Sources */, + C9EB317E138F6D880075BB52 /* setvbuf.c in Sources */, + C9EB317F138F6D880075BB52 /* snprintf.c in Sources */, + C9EB3180138F6D880075BB52 /* sprintf.c in Sources */, + C9EB3181138F6D880075BB52 /* sscanf.c in Sources */, + C9EB3182138F6D880075BB52 /* stdio.c in Sources */, + C9EB3183138F6D880075BB52 /* swprintf.c in Sources */, + C9EB3184138F6D880075BB52 /* swscanf.c in Sources */, + C9EB3185138F6D880075BB52 /* tempnam.c in Sources */, + C9EB3186138F6D880075BB52 /* tmpfile.c in Sources */, + C9EB3187138F6D880075BB52 /* tmpnam.c in Sources */, + C9EB3188138F6D880075BB52 /* ungetc.c in Sources */, + C9EB3189138F6D880075BB52 /* ungetwc.c in Sources */, + C9EB318A138F6D880075BB52 /* vasprintf.c in Sources */, + C9EB318B138F6D880075BB52 /* vdprintf.c in Sources */, + C9EB318C138F6D880075BB52 /* vfprintf.c in Sources */, + C9EB318D138F6D880075BB52 /* vfscanf.c in Sources */, + C9EB318E138F6D880075BB52 /* vfwprintf.c in Sources */, + C9EB318F138F6D880075BB52 /* vfwscanf.c in Sources */, + C9EB3190138F6D880075BB52 /* vprintf.c in Sources */, + C9EB3191138F6D880075BB52 /* vscanf.c in Sources */, + C9EB3192138F6D880075BB52 /* vsnprintf.c in Sources */, + C9EB3193138F6D880075BB52 /* vsprintf.c in Sources */, + C9EB3194138F6D880075BB52 /* vsscanf.c in Sources */, + C9EB3195138F6D880075BB52 /* vswprintf.c in Sources */, + C9EB3196138F6D880075BB52 /* vswscanf.c in Sources */, + C9EB3197138F6D880075BB52 /* vwprintf.c in Sources */, + C9EB3198138F6D880075BB52 /* vwscanf.c in Sources */, + C9EB3199138F6D880075BB52 /* wbuf.c in Sources */, + C9EB319A138F6D880075BB52 /* wprintf.c in Sources */, + C9EB319B138F6D880075BB52 /* wscanf.c in Sources */, + C9EB319C138F6D880075BB52 /* wsetup.c in Sources */, + C9EB319D138F6D880075BB52 /* a64l.c in Sources */, + C9EB319E138F6D880075BB52 /* _Exit_.c in Sources */, + C9EB319F138F6D880075BB52 /* abort.c in Sources */, + C9EB31A0138F6D880075BB52 /* abs.c in Sources */, + C9EB31A1138F6D880075BB52 /* atexit.c in Sources */, + C9EB31A2138F6D880075BB52 /* atof.c in Sources */, + C9EB31A3138F6D880075BB52 /* atoi.c in Sources */, + C9EB31A4138F6D880075BB52 /* atol.c in Sources */, + 922D0C0F21BFA1A20072834D /* timespec_get.c in Sources */, + C9EB31A5138F6D880075BB52 /* atoll.c in Sources */, + C9EB31A6138F6D880075BB52 /* bsearch.c in Sources */, + C9EB31A7138F6D880075BB52 /* div.c in Sources */, + C9EB31A8138F6D880075BB52 /* exit.c in Sources */, + C9EB31A9138F6D880075BB52 /* getenv.c in Sources */, + C9EB31AA138F6D880075BB52 /* getopt.c in Sources */, + C9EB31AB138F6D880075BB52 /* getopt_long.c in Sources */, + C9EB31AC138F6D880075BB52 /* getsubopt.c in Sources */, + C9EB31AD138F6D880075BB52 /* hcreate.c in Sources */, + C9EB31AE138F6D880075BB52 /* heapsort.c in Sources */, + C9EB31AF138F6D880075BB52 /* heapsort_b.c in Sources */, + C9EB31B0138F6D880075BB52 /* heapsort_r.c in Sources */, + C9EB31B1138F6D880075BB52 /* imaxabs.c in Sources */, + C9EB31B2138F6D880075BB52 /* imaxdiv.c in Sources */, + C9EB31B3138F6D880075BB52 /* insque.c in Sources */, + C9EB31B4138F6D880075BB52 /* labs.c in Sources */, + C9EB31B5138F6D880075BB52 /* ldiv.c in Sources */, + C9EB31B6138F6D880075BB52 /* llabs.c in Sources */, + C9EB31B7138F6D880075BB52 /* lldiv.c in Sources */, + C9EB31B8138F6D880075BB52 /* lsearch.c in Sources */, + C9EB31B9138F6D880075BB52 /* merge.c in Sources */, + C9EB31BA138F6D880075BB52 /* putenv.c in Sources */, + C9EB31BB138F6D880075BB52 /* qsort.c in Sources */, + C9EB31BC138F6D880075BB52 /* qsort_r.c in Sources */, + C9EB31BD138F6D880075BB52 /* radixsort.c in Sources */, + C9EB31BE138F6D880075BB52 /* rand.c in Sources */, + C9EB31BF138F6D880075BB52 /* random.c in Sources */, + C9EB31C0138F6D880075BB52 /* reallocf.c in Sources */, + C9EB31C1138F6D880075BB52 /* realpath.c in Sources */, + C9EB31C2138F6D880075BB52 /* remque.c in Sources */, + C9EB31C3138F6D880075BB52 /* setenv.c in Sources */, + C9EB31C4138F6D880075BB52 /* strhash.c in Sources */, + C9EB31C5138F6D880075BB52 /* strtoimax.c in Sources */, + C9EB31C6138F6D880075BB52 /* strtol.c in Sources */, + C9EB31C7138F6D880075BB52 /* strtoll.c in Sources */, + C9EB31C8138F6D880075BB52 /* strtoq.c in Sources */, + C9EB31C9138F6D880075BB52 /* strtoul.c in Sources */, + C9EB31CA138F6D880075BB52 /* strtoull.c in Sources */, + C9EB31CB138F6D880075BB52 /* strtoumax.c in Sources */, + C9EB31CC138F6D880075BB52 /* strtouq.c in Sources */, + C9EB31CD138F6D880075BB52 /* system.c in Sources */, + C9EB31CE138F6D880075BB52 /* tdelete.c in Sources */, + C9EB31CF138F6D880075BB52 /* tfind.c in Sources */, + C9EB31D0138F6D880075BB52 /* tsearch.c in Sources */, + C9EB31D1138F6D880075BB52 /* twalk.c in Sources */, + C9EB31D2138F6D880075BB52 /* grantpt.c in Sources */, + C9EB31D3138F6D880075BB52 /* l64a.c in Sources */, + C9EB31D4138F6D880075BB52 /* strfmon.c in Sources */, + C9EB31D5138F6D880075BB52 /* ecvt.c in Sources */, + C9EB31D6138F6D880075BB52 /* gcvt.c in Sources */, + C9EB31D7138F6D880075BB52 /* qsort_b.c in Sources */, + C9EB31D8138F6D880075BB52 /* asctime.c in Sources */, + C9EB31D9138F6D880075BB52 /* difftime.c in Sources */, + C9EB31DA138F6D880075BB52 /* ftime.c in Sources */, + C9EB31DB138F6D880075BB52 /* localtime.c in Sources */, + C9EB31DC138F6D880075BB52 /* strftime.c in Sources */, + C9EB31DD138F6D880075BB52 /* strptime.c in Sources */, + C9EB31DE138F6D880075BB52 /* time32.c in Sources */, + C9EB31DF138F6D880075BB52 /* timelocal.c in Sources */, + 7756339022F3B54E002F1707 /* rpmatch.c in Sources */, + C9EB31E0138F6D880075BB52 /* getdate.c in Sources */, + C9EB31E1138F6D880075BB52 /* timezone_unix03.c in Sources */, + C9EB31EA138F6D880075BB52 /* memmem.c in Sources */, + C9EB31ED138F6D880075BB52 /* rindex.c in Sources */, + C9EB31F0138F6D880075BB52 /* strcasecmp.c in Sources */, + C9EB31F1138F6D880075BB52 /* strcasestr.c in Sources */, + C9EB31F5138F6D880075BB52 /* strcoll.c in Sources */, + C9EB31F7138F6D880075BB52 /* strcspn.c in Sources */, + C9EB31F8138F6D880075BB52 /* strdup.c in Sources */, + C9EB31F9138F6D880075BB52 /* strerror.c in Sources */, + C9EB31FD138F6D880075BB52 /* strmode.c in Sources */, + C9EB3201138F6D880075BB52 /* strndup.c in Sources */, + C9EB3203138F6D880075BB52 /* strnstr.c in Sources */, + C9EB3204138F6D880075BB52 /* strpbrk.c in Sources */, + C9EB3205138F6D880075BB52 /* strrchr.c in Sources */, + C9EB3206138F6D880075BB52 /* strsep.c in Sources */, + C9EB3207138F6D880075BB52 /* strsignal.c in Sources */, + C9EB3208138F6D880075BB52 /* strspn.c in Sources */, + C9EB320A138F6D880075BB52 /* strtok.c in Sources */, + C9EB320B138F6D880075BB52 /* strxfrm.c in Sources */, + C9EB320C138F6D880075BB52 /* swab.c in Sources */, + C9EB320D138F6D880075BB52 /* wcpcpy.c in Sources */, + C9EB320E138F6D880075BB52 /* wcpncpy.c in Sources */, + C9EB320F138F6D880075BB52 /* wcscasecmp.c in Sources */, + C9EB3210138F6D880075BB52 /* wcscat.c in Sources */, + C9EB3211138F6D880075BB52 /* wcschr.c in Sources */, + C9EB3212138F6D880075BB52 /* wcscmp.c in Sources */, + C9EB3213138F6D880075BB52 /* wcscoll.c in Sources */, + C9EB3214138F6D880075BB52 /* wcscpy.c in Sources */, + C9EB3215138F6D880075BB52 /* wcscspn.c in Sources */, + C9EB3216138F6D880075BB52 /* wcsdup.c in Sources */, + C9EB3217138F6D880075BB52 /* wcslcat.c in Sources */, + C9EB3218138F6D880075BB52 /* wcslcpy.c in Sources */, + C9EB3219138F6D880075BB52 /* wcslen.c in Sources */, + C9EB321A138F6D880075BB52 /* wcsncasecmp.c in Sources */, + C9EB321B138F6D880075BB52 /* wcsncat.c in Sources */, + C9EB321C138F6D880075BB52 /* wcsncmp.c in Sources */, + C9EB321D138F6D880075BB52 /* wcsncpy.c in Sources */, + C9EB321E138F6D880075BB52 /* wcsnlen.c in Sources */, + C9EB321F138F6D880075BB52 /* wcspbrk.c in Sources */, + 2DF67CE5184F9CBE00B83A3D /* debug_private.c in Sources */, + C9EB3220138F6D880075BB52 /* wcsrchr.c in Sources */, + C9EB3221138F6D880075BB52 /* wcsspn.c in Sources */, + C9EB3222138F6D880075BB52 /* wcsstr.c in Sources */, + C9EB3223138F6D880075BB52 /* wcstok.c in Sources */, + C9EB3224138F6D880075BB52 /* wcswidth.c in Sources */, + C9EB3225138F6D880075BB52 /* wcsxfrm.c in Sources */, + C9EB3226138F6D880075BB52 /* wmemchr.c in Sources */, + C9EB3227138F6D880075BB52 /* wmemcmp.c in Sources */, + C9EB3228138F6D880075BB52 /* wmemcpy.c in Sources */, + C9EB3229138F6D880075BB52 /* wmemmove.c in Sources */, + C9EB322A138F6D880075BB52 /* wmemset.c in Sources */, + C9EB322B138F6D880075BB52 /* _libc_init.c in Sources */, + C9EB322C138F6D880075BB52 /* _libc_fork_child.c in Sources */, + C9EB322D138F6D880075BB52 /* chmodx_np.c in Sources */, + C9EB322F138F6D880075BB52 /* crt_externs.c in Sources */, + C9EB3231138F6D880075BB52 /* fork.c in Sources */, + C9EB3232138F6D880075BB52 /* getgroups.c in Sources */, + C9EB3234138F6D880075BB52 /* gettimeofday.c in Sources */, + C9EB3235138F6D880075BB52 /* msgctl.c in Sources */, + C9EB3236138F6D880075BB52 /* stack_protector.c in Sources */, + C9EB3237138F6D880075BB52 /* openx_np.c in Sources */, + C9EB3238138F6D880075BB52 /* OSMemoryNotification.c in Sources */, + C9EB3239138F6D880075BB52 /* OSThermalNotification.c in Sources */, + C9EB323A138F6D880075BB52 /* posix_spawn.c in Sources */, + C9EB323B138F6D880075BB52 /* semctl.c in Sources */, + C9EB323C138F6D880075BB52 /* settimeofday.c in Sources */, + C9EB323D138F6D880075BB52 /* shmctl.c in Sources */, + C9EB323E138F6D880075BB52 /* sigaction.c in Sources */, + C9EB3242138F6D880075BB52 /* statx_np.c in Sources */, + C9EB3243138F6D880075BB52 /* umaskx_np.c in Sources */, + C9EB3247138F6D880075BB52 /* fparseln.c in Sources */, + C9EB3248138F6D880075BB52 /* login.c in Sources */, + C9EB3249138F6D880075BB52 /* login_tty.c in Sources */, + C9EB324A138F6D880075BB52 /* logout.c in Sources */, + C9EB324B138F6D880075BB52 /* logwtmp.c in Sources */, + 3F76864B13E91D3F00C94D25 /* mkpath_np.c in Sources */, + C9EB324C138F6D880075BB52 /* opendev.c in Sources */, + C9EB324D138F6D880075BB52 /* pty.c in Sources */, + C9EB324E138F6D880075BB52 /* clear.c in Sources */, + C9EB324F138F6D880075BB52 /* compare.c in Sources */, + C9EB3250138F6D880075BB52 /* copy.c in Sources */, + C9EB3251138F6D880075BB52 /* gen_uuid.c in Sources */, + C9EB3252138F6D880075BB52 /* isnull.c in Sources */, + C9EB3253138F6D880075BB52 /* pack.c in Sources */, + C9EB3254138F6D880075BB52 /* parse.c in Sources */, + C9EB3255138F6D880075BB52 /* unpack.c in Sources */, + C9EB3256138F6D880075BB52 /* unparse.c in Sources */, + B10BC41C14338AEB005E4366 /* regcomp.c in Sources */, + B19C64621450F90200032373 /* sync_volume_np.c in Sources */, + 3FB7E1BA146EF2E000843438 /* dirfd.c in Sources */, + 4B2C64A915519BC800342BFA /* assumes.c in Sources */, + FC2ED617157D4BE80098EC69 /* inet_ntop.c in Sources */, + FC2ED620157D4BE80098EC69 /* inet_pton.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9EB3273138F75580075BB52 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C9EB327B138F75580075BB52 /* creat.c in Sources */, + C9EB327C138F75580075BB52 /* gethostid.c in Sources */, + C9EB327D138F75580075BB52 /* getwd.c in Sources */, + C9EB327E138F75580075BB52 /* killpg.c in Sources */, + C9EB327F138F75580075BB52 /* sethostid.c in Sources */, + C9EB3280138F75580075BB52 /* setpgrp.c in Sources */, + C9EB3281138F75580075BB52 /* setrgid.c in Sources */, + C9EB3282138F75580075BB52 /* setruid.c in Sources */, + C9EB3283138F75580075BB52 /* setregid.c in Sources */, + C9EB3284138F75580075BB52 /* setreuid.c in Sources */, + C9EB3285138F75580075BB52 /* sigaltstk.c in Sources */, + C9EB3286138F75580075BB52 /* sigcompat.c in Sources */, + C9EB3288138F75580075BB52 /* kvm.c in Sources */, + C9EB328C138F75580075BB52 /* forceLibcToBuild.c in Sources */, + C9EB328D138F75580075BB52 /* bt_close.c in Sources */, + C9EB328E138F75580075BB52 /* bt_conv.c in Sources */, + C9EB328F138F75580075BB52 /* bt_debug.c in Sources */, + C9EB3290138F75580075BB52 /* bt_delete.c in Sources */, + C9EB3291138F75580075BB52 /* bt_get.c in Sources */, + C9EB3292138F75580075BB52 /* bt_open.c in Sources */, + C9EB3293138F75580075BB52 /* bt_overflow.c in Sources */, + C9EB3294138F75580075BB52 /* bt_page.c in Sources */, + C9EB3295138F75580075BB52 /* bt_put.c in Sources */, + C9EB3296138F75580075BB52 /* bt_search.c in Sources */, + C9EB3297138F75580075BB52 /* bt_seq.c in Sources */, + C9EB3298138F75580075BB52 /* bt_split.c in Sources */, + C9EB3299138F75580075BB52 /* bt_utils.c in Sources */, + C9EB329A138F75580075BB52 /* db.c in Sources */, + C9EB329B138F75580075BB52 /* hash.c in Sources */, + C9EB329C138F75580075BB52 /* hash_bigkey.c in Sources */, + C9EB329D138F75580075BB52 /* hash_buf.c in Sources */, + C9EB329E138F75580075BB52 /* hash_func.c in Sources */, + C9EB329F138F75580075BB52 /* hash_log2.c in Sources */, + C9EB32A0138F75580075BB52 /* hash_page.c in Sources */, + C9EB32A1138F75580075BB52 /* ndbm.c in Sources */, + C9EB32A2138F75580075BB52 /* mpool.c in Sources */, + C9EB32A3138F75580075BB52 /* rec_close.c in Sources */, + C9EB32A4138F75580075BB52 /* rec_delete.c in Sources */, + C9EB32A5138F75580075BB52 /* rec_get.c in Sources */, + C9EB32A6138F75580075BB52 /* rec_open.c in Sources */, + C9EB32A7138F75580075BB52 /* rec_put.c in Sources */, + C9EB32A8138F75580075BB52 /* rec_search.c in Sources */, + C9EB32A9138F75580075BB52 /* rec_seq.c in Sources */, + C9EB32AA138F75580075BB52 /* rec_utils.c in Sources */, + C9EB32AB138F75580075BB52 /* brk.c in Sources */, + C9EB32AC138F75580075BB52 /* bsd_signal.c in Sources */, + C9EB32AD138F75580075BB52 /* lchflags.c in Sources */, + C9EB32AE138F75580075BB52 /* lchmod.c in Sources */, + C9EB32AF138F75580075BB52 /* lutimes.c in Sources */, + C9EB32B0138F75580075BB52 /* statvfs.c in Sources */, + C9EB32B1138F75580075BB52 /* tcgetsid.c in Sources */, + C9EB32B2138F75580075BB52 /* _ldbl_util.c in Sources */, + C9EB32B3138F75580075BB52 /* _hdtoa.c in Sources */, + C9EB32B4138F75580075BB52 /* _ldtoa.c in Sources */, + C9EB32B5138F75580075BB52 /* gdtoa-dmisc.c in Sources */, + C9EB32B6138F75580075BB52 /* gdtoa-dtoa.c in Sources */, + C9EB32B7138F75580075BB52 /* gdtoa-gdtoa.c in Sources */, + C9EB32B8138F75580075BB52 /* gdtoa-gethex.c in Sources */, + C9EB32B9138F75580075BB52 /* gdtoa-gmisc.c in Sources */, + C9EB32BA138F75580075BB52 /* gdtoa-hd_init.c in Sources */, + C9EB32BB138F75580075BB52 /* gdtoa-hexnan.c in Sources */, + C9EB32BC138F75580075BB52 /* gdtoa-misc.c in Sources */, + C9EB32BD138F75580075BB52 /* gdtoa-smisc.c in Sources */, + C9EB32BE138F75580075BB52 /* gdtoa-strtod.c in Sources */, + C9EB32BF138F75580075BB52 /* gdtoa-strtodg.c in Sources */, + C9EB32C0138F75580075BB52 /* gdtoa-strtof.c in Sources */, + C9EB32C1138F75580075BB52 /* gdtoa-strtoIg.c in Sources */, + C9EB32C2138F75580075BB52 /* gdtoa-strtopdd.c in Sources */, + C9EB32C3138F75580075BB52 /* gdtoa-strtopx.c in Sources */, + C9EB32C4138F75580075BB52 /* gdtoa-strtord.c in Sources */, + C9EB32C5138F75580075BB52 /* gdtoa-sum.c in Sources */, + C9EB32C6138F75580075BB52 /* gdtoa-ulp.c in Sources */, + C9EB32C7138F75580075BB52 /* glue.c in Sources */, + C9EB32C8138F75580075BB52 /* machdep_ldisd.c in Sources */, + C9EB32C9138F75580075BB52 /* machdep_ldisdd.c in Sources */, + C9EB32CA138F75580075BB52 /* machdep_ldisQ.c in Sources */, + C9EB32CB138F75580075BB52 /* machdep_ldisx.c in Sources */, + C9EB32D5138F75580075BB52 /* authentication.c in Sources */, + C9EB32D6138F75580075BB52 /* backtrace.c in Sources */, + C9EB32D8138F75580075BB52 /* confstr.c in Sources */, + C9EB32D9138F75580075BB52 /* crypt.c in Sources */, + C9EB32DA138F75580075BB52 /* devname.c in Sources */, + C9EB32DB138F75580075BB52 /* disklabel.c in Sources */, + C9EB32DC138F75580075BB52 /* errlst.c in Sources */, + C9EB32DD138F75580075BB52 /* filesec.c in Sources */, + C9EB32DE138F75580075BB52 /* _rand48.c in Sources */, + C9EB32DF138F75580075BB52 /* alarm.c in Sources */, + C9EB32E0138F75580075BB52 /* arc4random.c in Sources */, + C9EB32E1138F75580075BB52 /* assert.c in Sources */, + C9EB32E2138F75580075BB52 /* basename.c in Sources */, + C9EB32E3138F75580075BB52 /* clock.c in Sources */, + C9EB32E4138F75580075BB52 /* closedir.c in Sources */, + C9EB32E5138F75580075BB52 /* ctermid.c in Sources */, + C9EB32E6138F75580075BB52 /* daemon.c in Sources */, + C9EB32E7138F75580075BB52 /* dirname.c in Sources */, + C9EB32E8138F75580075BB52 /* drand48.c in Sources */, + C9EB32E9138F75580075BB52 /* erand48.c in Sources */, + C9EB32EA138F75580075BB52 /* err.c in Sources */, + C9EB32EB138F75580075BB52 /* exec.c in Sources */, + C9EB32EC138F75580075BB52 /* fmtcheck.c in Sources */, + C9EB32ED138F75580075BB52 /* fmtmsg.c in Sources */, + C9EB32EE138F75580075BB52 /* fnmatch.c in Sources */, + C9EB32EF138F75580075BB52 /* ftok.c in Sources */, + C9EB32F0138F75580075BB52 /* getbsize.c in Sources */, + C9EB32F1138F75580075BB52 /* getcap.c in Sources */, + C9EB32F2138F75580075BB52 /* getcwd.c in Sources */, + C9EB32F3138F75580075BB52 /* gethostname.c in Sources */, + C9EB32F4138F75580075BB52 /* getlogin.c in Sources */, + C9EB32F5138F75580075BB52 /* getmntinfo.c in Sources */, + C9EB32F6138F75580075BB52 /* getpagesize.c in Sources */, + C9EB32F7138F75580075BB52 /* getpeereid.c in Sources */, + C9EB32F8138F75580075BB52 /* getprogname.c in Sources */, + C9EB32F9138F75580075BB52 /* glob.c in Sources */, + C9EB32FA138F75580075BB52 /* isatty.c in Sources */, + C9EB32FB138F75580075BB52 /* jrand48.c in Sources */, + C9EB32FC138F75580075BB52 /* lcong48.c in Sources */, + C9EB32FD138F75580075BB52 /* lockf.c in Sources */, + C9EB32FE138F75580075BB52 /* lrand48.c in Sources */, + C9EB32FF138F75580075BB52 /* mrand48.c in Sources */, + C9EB3300138F75580075BB52 /* nice.c in Sources */, + C9EB3301138F75580075BB52 /* nrand48.c in Sources */, + C9EB3302138F75580075BB52 /* opendir.c in Sources */, + C9EB3303138F75580075BB52 /* pause.c in Sources */, + C9EB3304138F75580075BB52 /* popen.c in Sources */, + C9EB3306138F75580075BB52 /* psignal.c in Sources */, + C9EB3307138F75580075BB52 /* raise.c in Sources */, + C9EB3308138F75580075BB52 /* readdir.c in Sources */, + C9EB3309138F75580075BB52 /* readpassphrase.c in Sources */, + C9EB330A138F75580075BB52 /* rewinddir.c in Sources */, + C9EB330B138F75580075BB52 /* scandir.c in Sources */, + C9EB330C138F75580075BB52 /* seed48.c in Sources */, + C9EB330D138F75580075BB52 /* seekdir.c in Sources */, + C9EB330E138F75580075BB52 /* sethostname.c in Sources */, + C9EB330F138F75580075BB52 /* setmode.c in Sources */, + C9EB3310138F75580075BB52 /* setprogname.c in Sources */, + C9EB3311138F75580075BB52 /* siginterrupt.c in Sources */, + C9EB3312138F75580075BB52 /* siglist.c in Sources */, + C9EB3313138F75580075BB52 /* signal.c in Sources */, + C9EB3314138F75580075BB52 /* sleep.c in Sources */, + C9EB3315138F75580075BB52 /* srand48.c in Sources */, + C9EB3316138F75580075BB52 /* stringlist.c in Sources */, + C9EB3317138F75580075BB52 /* sysconf.c in Sources */, + C9EB3318138F75580075BB52 /* sysctl.c in Sources */, + C9EB3319138F75580075BB52 /* sysctlbyname.c in Sources */, + C9EB331A138F75580075BB52 /* sysctlnametomib.c in Sources */, + C9EB331B138F75580075BB52 /* telldir.c in Sources */, + C9EB331C138F75580075BB52 /* termios.c in Sources */, + C9EB331D138F75580075BB52 /* time.c in Sources */, + C9EB331E138F75580075BB52 /* times.c in Sources */, + C9EB331F138F75580075BB52 /* timezone.c in Sources */, + C9EB3320138F75580075BB52 /* ttyname.c in Sources */, + C9EB3321138F75580075BB52 /* ttyslot.c in Sources */, + C9EB3322138F75580075BB52 /* ualarm.c in Sources */, + C9EB3323138F75580075BB52 /* ulimit.c in Sources */, + C9EB3324138F75580075BB52 /* unvis.c in Sources */, + C9EB3325138F75580075BB52 /* usleep.c in Sources */, + C9EB3326138F75580075BB52 /* utime.c in Sources */, + C9EB3327138F75580075BB52 /* vis.c in Sources */, + C9EB3328138F75580075BB52 /* wait.c in Sources */, + C9EB3329138F75580075BB52 /* wait3.c in Sources */, + C9EB332A138F75580075BB52 /* waitpid.c in Sources */, + C9EB332B138F75580075BB52 /* fts.c in Sources */, + C9EB332C138F75580075BB52 /* get_compat.c in Sources */, + C9EB332D138F75580075BB52 /* getloadavg.c in Sources */, + C9EB332E138F75580075BB52 /* getttyent.c in Sources */, + C9EB332F138F75580075BB52 /* getusershell.c in Sources */, + C9EB3330138F75580075BB52 /* getvfsbyname.c in Sources */, + C9EB3335138F75580075BB52 /* nanosleep.c in Sources */, + C9EB3336138F75580075BB52 /* utmpx.c in Sources */, + C9EB3337138F75580075BB52 /* nftw.c in Sources */, + C9EB3338138F75580075BB52 /* nlist.c in Sources */, + C9EB333A138F75580075BB52 /* oldsyslog.c in Sources */, + 928BD1081D76073600EC01FC /* timingsafe_bcmp.c in Sources */, + C9EB333D138F75580075BB52 /* setlogin.c in Sources */, + C9EB333E138F75580075BB52 /* sigsetops.c in Sources */, + C9EB3341138F75580075BB52 /* strtofflags.c in Sources */, + C9EB3343138F75580075BB52 /* thread_stack_pcs.c in Sources */, + C9EB3344138F75580075BB52 /* uname.c in Sources */, + C9EB3345138F75580075BB52 /* utmpx-darwin.c in Sources */, + C9EB3346138F75580075BB52 /* wordexp.c in Sources */, + C9EB3348138F75580075BB52 /* gmon.c in Sources */, + C9EB3368138F75580075BB52 /* ascii.c in Sources */, + C9EB3369138F75580075BB52 /* big5.c in Sources */, + C9EB336A138F75580075BB52 /* btowc.c in Sources */, + C9EB336B138F75580075BB52 /* collate.c in Sources */, + C9EB336C138F75580075BB52 /* collcmp.c in Sources */, + C9EB336D138F75580075BB52 /* euc.c in Sources */, + C9EB336E138F75580075BB52 /* fix_grouping.c in Sources */, + C9EB336F138F75580075BB52 /* gb18030.c in Sources */, + C9EB3370138F75580075BB52 /* gb2312.c in Sources */, + C9EB3371138F75580075BB52 /* gbk.c in Sources */, + C9EB3372138F75580075BB52 /* ldpart.c in Sources */, + C9EB3373138F75580075BB52 /* lmessages.c in Sources */, + C9EB3374138F75580075BB52 /* lmonetary.c in Sources */, + C9EB3375138F75580075BB52 /* lnumeric.c in Sources */, + C9EB3376138F75580075BB52 /* localeconv.c in Sources */, + C9EB3377138F75580075BB52 /* mblen.c in Sources */, + C9EB3378138F75580075BB52 /* mbrlen.c in Sources */, + C9EB3379138F75580075BB52 /* mbrtowc.c in Sources */, + C9EB337A138F75580075BB52 /* mbsinit.c in Sources */, + C9EB337B138F75580075BB52 /* mbsnrtowcs.c in Sources */, + C9EB337C138F75580075BB52 /* mbsrtowcs.c in Sources */, + C9EB337D138F75580075BB52 /* mbstowcs.c in Sources */, + C9EB337E138F75580075BB52 /* mbtowc.c in Sources */, + C9EB337F138F75580075BB52 /* mskanji.c in Sources */, + C9EB3380138F75580075BB52 /* nextwctype.c in Sources */, + C9EB3381138F75580075BB52 /* nl_langinfo.c in Sources */, + C9EB3382138F75580075BB52 /* nomacros.c in Sources */, + C9EB3383138F75580075BB52 /* none.c in Sources */, + C9EB3384138F75580075BB52 /* rune.c in Sources */, + C9EB3385138F75580075BB52 /* runetype.c in Sources */, + C9EB3386138F75580075BB52 /* setlocale.c in Sources */, + C9EB3387138F75580075BB52 /* setrunelocale.c in Sources */, + C9EB3388138F75580075BB52 /* table.c in Sources */, + C9EB3389138F75580075BB52 /* tolower.c in Sources */, + C9EB338A138F75580075BB52 /* toupper.c in Sources */, + C9EB338B138F75580075BB52 /* utf2.c in Sources */, + C9EB338C138F75580075BB52 /* utf8.c in Sources */, + C9EB338D138F75580075BB52 /* wcrtomb.c in Sources */, + C9EB338E138F75580075BB52 /* wcsftime.c in Sources */, + C9EB338F138F75580075BB52 /* wcsnrtombs.c in Sources */, + C9EB3390138F75580075BB52 /* wcsrtombs.c in Sources */, + C9EB3391138F75580075BB52 /* wcstod.c in Sources */, + C9EB3392138F75580075BB52 /* wcstof.c in Sources */, + C9EB3393138F75580075BB52 /* wcstoimax.c in Sources */, + C9EB3394138F75580075BB52 /* wcstol.c in Sources */, + C9EB3395138F75580075BB52 /* wcstold.c in Sources */, + C9EB3396138F75580075BB52 /* wcstoll.c in Sources */, + C9EB3397138F75580075BB52 /* wcstombs.c in Sources */, + C9EB3398138F75580075BB52 /* wcstoul.c in Sources */, + C9EB3399138F75580075BB52 /* wcstoull.c in Sources */, + C9EB339A138F75580075BB52 /* wcstoumax.c in Sources */, + C9EB339B138F75580075BB52 /* wctob.c in Sources */, + C9EB339C138F75580075BB52 /* wctomb.c in Sources */, + C9EB339D138F75580075BB52 /* wctrans.c in Sources */, + C9EB339E138F75580075BB52 /* wctype.c in Sources */, + C9EB339F138F75580075BB52 /* wcwidth.c in Sources */, + C9EB33A0138F75580075BB52 /* frune.c in Sources */, + C9EB33A1138F75580075BB52 /* isctype.c in Sources */, + C9EB33A2138F75580075BB52 /* iswctype.c in Sources */, + C9EB33A3138F75580075BB52 /* lconv.c in Sources */, + C9EB33A4138F75580075BB52 /* mbrune.c in Sources */, + C9EB33A5138F75580075BB52 /* runedepreciated.c in Sources */, + C9EB33A6138F75580075BB52 /* setinvalidrune.c in Sources */, + C9EB33A7138F75580075BB52 /* xlocale.c in Sources */, + C9EB33A8138F75580075BB52 /* addr2ascii.c in Sources */, + C9EB33A9138F75580075BB52 /* ascii2addr.c in Sources */, + C9EB33AA138F75580075BB52 /* inet_addr.c in Sources */, + C9EB33AB138F75580075BB52 /* inet_lnaof.c in Sources */, + C9EB33AC138F75580075BB52 /* inet_makeaddr.c in Sources */, + C9EB33AD138F75580075BB52 /* inet_net_ntop.c in Sources */, + C9EB33AE138F75580075BB52 /* inet_net_pton.c in Sources */, + C9EB33AF138F75580075BB52 /* inet_neta.c in Sources */, + C9EB33B0138F75580075BB52 /* inet_netof.c in Sources */, + C9EB33B1138F75580075BB52 /* inet_network.c in Sources */, + C9EB33B2138F75580075BB52 /* inet_ntoa.c in Sources */, + C9EB33B3138F75580075BB52 /* linkaddr.c in Sources */, + C9EB33B4138F75580075BB52 /* nsap_addr.c in Sources */, + C9EB33B5138F75580075BB52 /* recv.c in Sources */, + C9EB33B6138F75580075BB52 /* send.c in Sources */, + C9EB33B7138F75580075BB52 /* sockatmark.c in Sources */, + C9EB33B8138F75580075BB52 /* sourcefilter.c in Sources */, + C9EB33B9138F75580075BB52 /* msgcat.c in Sources */, + C9EB33BA138F75580075BB52 /* acl.c in Sources */, + C9EB33BB138F75580075BB52 /* acl_entry.c in Sources */, + C9EB33BC138F75580075BB52 /* acl_file.c in Sources */, + C9EB33BD138F75580075BB52 /* acl_flag.c in Sources */, + C9EB33BE138F75580075BB52 /* acl_perm.c in Sources */, + C9EB33BF138F75580075BB52 /* acl_translate.c in Sources */, + C9EB33D3138F75580075BB52 /* regerror.c in Sources */, + C9EB33E4138F75580075BB52 /* _flock_stub.c in Sources */, + C9EB33E5138F75580075BB52 /* asprintf.c in Sources */, + C9EB33E6138F75580075BB52 /* clrerr.c in Sources */, + C9EB33E7138F75580075BB52 /* dprintf.c in Sources */, + C9EB33E8138F75580075BB52 /* fclose.c in Sources */, + C9EB33E9138F75580075BB52 /* fdopen.c in Sources */, + C9EB33EA138F75580075BB52 /* feof.c in Sources */, + C9EB33EB138F75580075BB52 /* ferror.c in Sources */, + C9EB33EC138F75580075BB52 /* fflush.c in Sources */, + C9EB33ED138F75580075BB52 /* fgetc.c in Sources */, + C9EB33EE138F75580075BB52 /* fgetln.c in Sources */, + C9EB33EF138F75580075BB52 /* fgetpos.c in Sources */, + C9EB33F0138F75580075BB52 /* fgets.c in Sources */, + C9EB33F1138F75580075BB52 /* fgetwc.c in Sources */, + C9EB33F2138F75580075BB52 /* fgetwln.c in Sources */, + C9EB33F3138F75580075BB52 /* fgetws.c in Sources */, + C9EB33F4138F75580075BB52 /* fileno.c in Sources */, + 147CDFE11B7C233300831EC6 /* clock_gettime.c in Sources */, + C9EB33F5138F75580075BB52 /* findfp.c in Sources */, + C9EB33F6138F75580075BB52 /* flags.c in Sources */, + C9EB33F7138F75580075BB52 /* fopen.c in Sources */, + C9EB33F8138F75580075BB52 /* fprintf.c in Sources */, + C9EB33F9138F75580075BB52 /* fpurge.c in Sources */, + C9EB33FA138F75580075BB52 /* fputc.c in Sources */, + C9EB33FB138F75580075BB52 /* fputs.c in Sources */, + C9EB33FC138F75580075BB52 /* fputwc.c in Sources */, + C9EB33FD138F75580075BB52 /* fputws.c in Sources */, + C9EB33FE138F75580075BB52 /* fread.c in Sources */, + C9EB33FF138F75580075BB52 /* freopen.c in Sources */, + C9EB3400138F75580075BB52 /* fscanf.c in Sources */, + C9EB3401138F75580075BB52 /* fseek.c in Sources */, + C9EB3402138F75580075BB52 /* fsetpos.c in Sources */, + C9EB3403138F75580075BB52 /* ftell.c in Sources */, + C9EB3404138F75580075BB52 /* funopen.c in Sources */, + C9EB3405138F75580075BB52 /* fvwrite.c in Sources */, + C9EB3406138F75580075BB52 /* fwalk.c in Sources */, + C9EB3407138F75580075BB52 /* fwide.c in Sources */, + C9EB3408138F75580075BB52 /* fwprintf.c in Sources */, + C9EB3409138F75580075BB52 /* fwrite.c in Sources */, + C9EB340A138F75580075BB52 /* fwscanf.c in Sources */, + C9EB340B138F75580075BB52 /* getc.c in Sources */, + C9EB340C138F75580075BB52 /* getchar.c in Sources */, + C9EB340D138F75580075BB52 /* getdelim.c in Sources */, + C9EB340E138F75580075BB52 /* getline.c in Sources */, + C9EB340F138F75580075BB52 /* gets.c in Sources */, + C9EB3410138F75580075BB52 /* getw.c in Sources */, + C9EB3411138F75580075BB52 /* getwc.c in Sources */, + C9EB3412138F75580075BB52 /* getwchar.c in Sources */, + C9EB3413138F75580075BB52 /* makebuf.c in Sources */, + C9EB3414138F75580075BB52 /* mktemp.c in Sources */, + C9EB3415138F75580075BB52 /* perror.c in Sources */, + C9EB3416138F75580075BB52 /* printf-pos.c in Sources */, + C9EB3417138F75580075BB52 /* printf.c in Sources */, + C9EB3418138F75580075BB52 /* putc.c in Sources */, + C9EB3419138F75580075BB52 /* putchar.c in Sources */, + C9EB341A138F75580075BB52 /* puts.c in Sources */, + C9EB341B138F75580075BB52 /* putw.c in Sources */, + C9EB341C138F75580075BB52 /* putwc.c in Sources */, + C9EB341D138F75580075BB52 /* putwchar.c in Sources */, + C9EB341E138F75580075BB52 /* refill.c in Sources */, + C9EB341F138F75580075BB52 /* remove.c in Sources */, + C9EB3420138F75580075BB52 /* rewind.c in Sources */, + C9EB3421138F75580075BB52 /* rget.c in Sources */, + C9EB3422138F75580075BB52 /* scanf.c in Sources */, + C9EB3423138F75580075BB52 /* setbuf.c in Sources */, + C9EB3424138F75580075BB52 /* setbuffer.c in Sources */, + C9EB3425138F75580075BB52 /* setvbuf.c in Sources */, + C9EB3426138F75580075BB52 /* snprintf.c in Sources */, + C9EB3427138F75580075BB52 /* sprintf.c in Sources */, + C9EB3428138F75580075BB52 /* sscanf.c in Sources */, + C9EB3429138F75580075BB52 /* stdio.c in Sources */, + C9EB342A138F75580075BB52 /* swprintf.c in Sources */, + C9EB342B138F75580075BB52 /* swscanf.c in Sources */, + C9EB342C138F75580075BB52 /* tempnam.c in Sources */, + C9EB342D138F75580075BB52 /* tmpfile.c in Sources */, + C9EB342E138F75580075BB52 /* tmpnam.c in Sources */, + C9EB342F138F75580075BB52 /* ungetc.c in Sources */, + C9EB3430138F75580075BB52 /* ungetwc.c in Sources */, + C9EB3431138F75580075BB52 /* vasprintf.c in Sources */, + C9EB3432138F75580075BB52 /* vdprintf.c in Sources */, + C9EB3433138F75580075BB52 /* vfprintf.c in Sources */, + C9EB3434138F75580075BB52 /* vfscanf.c in Sources */, + C9EB3435138F75580075BB52 /* vfwprintf.c in Sources */, + C9EB3436138F75580075BB52 /* vfwscanf.c in Sources */, + C9EB3437138F75580075BB52 /* vprintf.c in Sources */, + C9EB3438138F75580075BB52 /* vscanf.c in Sources */, + C9EB3439138F75580075BB52 /* vsnprintf.c in Sources */, + C9EB343A138F75580075BB52 /* vsprintf.c in Sources */, + C9EB343B138F75580075BB52 /* vsscanf.c in Sources */, + C9EB343C138F75580075BB52 /* vswprintf.c in Sources */, + C9EB343D138F75580075BB52 /* vswscanf.c in Sources */, + C9EB343E138F75580075BB52 /* vwprintf.c in Sources */, + C9EB343F138F75580075BB52 /* vwscanf.c in Sources */, + C9EB3440138F75580075BB52 /* wbuf.c in Sources */, + C9EB3441138F75580075BB52 /* wprintf.c in Sources */, + C9EB3442138F75580075BB52 /* wscanf.c in Sources */, + C9EB3443138F75580075BB52 /* wsetup.c in Sources */, + C9EB3444138F75580075BB52 /* a64l.c in Sources */, + C9EB3445138F75580075BB52 /* _Exit_.c in Sources */, + C9EB3446138F75580075BB52 /* abort.c in Sources */, + C9EB3447138F75580075BB52 /* abs.c in Sources */, + C9EB3448138F75580075BB52 /* atexit.c in Sources */, + C9EB3449138F75580075BB52 /* atof.c in Sources */, + C9EB344A138F75580075BB52 /* atoi.c in Sources */, + C9EB344B138F75580075BB52 /* atol.c in Sources */, + 922D0C0E21BFA1A10072834D /* timespec_get.c in Sources */, + C9EB344C138F75580075BB52 /* atoll.c in Sources */, + C9EB344D138F75580075BB52 /* bsearch.c in Sources */, + C9EB344E138F75580075BB52 /* div.c in Sources */, + C9EB344F138F75580075BB52 /* exit.c in Sources */, + C9EB3450138F75580075BB52 /* getenv.c in Sources */, + C9EB3451138F75580075BB52 /* getopt.c in Sources */, + C9EB3452138F75580075BB52 /* getopt_long.c in Sources */, + C9EB3453138F75580075BB52 /* getsubopt.c in Sources */, + C9EB3454138F75580075BB52 /* hcreate.c in Sources */, + C9EB3455138F75580075BB52 /* heapsort.c in Sources */, + C9EB3456138F75580075BB52 /* heapsort_b.c in Sources */, + C9EB3457138F75580075BB52 /* heapsort_r.c in Sources */, + C9EB3458138F75580075BB52 /* imaxabs.c in Sources */, + C9EB3459138F75580075BB52 /* imaxdiv.c in Sources */, + C9EB345A138F75580075BB52 /* insque.c in Sources */, + C9EB345B138F75580075BB52 /* labs.c in Sources */, + C9EB345C138F75580075BB52 /* ldiv.c in Sources */, + C9EB345D138F75580075BB52 /* llabs.c in Sources */, + C9EB345E138F75580075BB52 /* lldiv.c in Sources */, + C9EB345F138F75580075BB52 /* lsearch.c in Sources */, + C9EB3460138F75580075BB52 /* merge.c in Sources */, + C9EB3461138F75580075BB52 /* putenv.c in Sources */, + C9EB3462138F75580075BB52 /* qsort.c in Sources */, + C9EB3463138F75580075BB52 /* qsort_r.c in Sources */, + C9EB3464138F75580075BB52 /* radixsort.c in Sources */, + C9EB3465138F75580075BB52 /* rand.c in Sources */, + C9EB3466138F75580075BB52 /* random.c in Sources */, + C9EB3467138F75580075BB52 /* reallocf.c in Sources */, + C9EB3468138F75580075BB52 /* realpath.c in Sources */, + C9EB3469138F75580075BB52 /* remque.c in Sources */, + C9EB346A138F75580075BB52 /* setenv.c in Sources */, + C9EB346B138F75580075BB52 /* strhash.c in Sources */, + C9EB346C138F75580075BB52 /* strtoimax.c in Sources */, + C9EB346D138F75580075BB52 /* strtol.c in Sources */, + C9EB346E138F75580075BB52 /* strtoll.c in Sources */, + C9EB346F138F75580075BB52 /* strtoq.c in Sources */, + C9EB3470138F75580075BB52 /* strtoul.c in Sources */, + C9EB3471138F75580075BB52 /* strtoull.c in Sources */, + C9EB3472138F75580075BB52 /* strtoumax.c in Sources */, + C9EB3473138F75580075BB52 /* strtouq.c in Sources */, + C9EB3474138F75580075BB52 /* system.c in Sources */, + C9EB3475138F75580075BB52 /* tdelete.c in Sources */, + C9EB3476138F75580075BB52 /* tfind.c in Sources */, + C9EB3477138F75580075BB52 /* tsearch.c in Sources */, + C9EB3478138F75580075BB52 /* twalk.c in Sources */, + C9EB3479138F75580075BB52 /* grantpt.c in Sources */, + C9EB347A138F75580075BB52 /* l64a.c in Sources */, + C9EB347B138F75580075BB52 /* strfmon.c in Sources */, + C9EB347C138F75580075BB52 /* ecvt.c in Sources */, + C9EB347D138F75580075BB52 /* gcvt.c in Sources */, + C9EB347E138F75580075BB52 /* qsort_b.c in Sources */, + C9EB347F138F75580075BB52 /* asctime.c in Sources */, + C9EB3480138F75580075BB52 /* difftime.c in Sources */, + C9EB3481138F75580075BB52 /* ftime.c in Sources */, + C9EB3482138F75580075BB52 /* localtime.c in Sources */, + C9EB3483138F75580075BB52 /* strftime.c in Sources */, + C9EB3484138F75580075BB52 /* strptime.c in Sources */, + C9EB3485138F75580075BB52 /* time32.c in Sources */, + C9EB3486138F75580075BB52 /* timelocal.c in Sources */, + 7756339122F3B550002F1707 /* rpmatch.c in Sources */, + C9EB3487138F75580075BB52 /* getdate.c in Sources */, + C9EB3488138F75580075BB52 /* timezone_unix03.c in Sources */, + C9EB3491138F75580075BB52 /* memmem.c in Sources */, + C9EB3494138F75580075BB52 /* rindex.c in Sources */, + C9EB3497138F75580075BB52 /* strcasecmp.c in Sources */, + C9EB3498138F75580075BB52 /* strcasestr.c in Sources */, + C9EB349C138F75580075BB52 /* strcoll.c in Sources */, + C9EB349E138F75580075BB52 /* strcspn.c in Sources */, + C9EB349F138F75580075BB52 /* strdup.c in Sources */, + C9EB34A0138F75580075BB52 /* strerror.c in Sources */, + C9EB34A4138F75580075BB52 /* strmode.c in Sources */, + C9EB34A8138F75580075BB52 /* strndup.c in Sources */, + C9EB34AA138F75580075BB52 /* strnstr.c in Sources */, + C9EB34AB138F75580075BB52 /* strpbrk.c in Sources */, + C9EB34AC138F75580075BB52 /* strrchr.c in Sources */, + C9EB34AD138F75580075BB52 /* strsep.c in Sources */, + C9EB34AE138F75580075BB52 /* strsignal.c in Sources */, + C9EB34AF138F75580075BB52 /* strspn.c in Sources */, + C9EB34B1138F75580075BB52 /* strtok.c in Sources */, + C9EB34B2138F75580075BB52 /* strxfrm.c in Sources */, + C9EB34B3138F75580075BB52 /* swab.c in Sources */, + C9EB34B4138F75580075BB52 /* wcpcpy.c in Sources */, + C9EB34B5138F75580075BB52 /* wcpncpy.c in Sources */, + C9EB34B6138F75580075BB52 /* wcscasecmp.c in Sources */, + C9EB34B7138F75580075BB52 /* wcscat.c in Sources */, + C9EB34B8138F75580075BB52 /* wcschr.c in Sources */, + C9EB34B9138F75580075BB52 /* wcscmp.c in Sources */, + C9EB34BA138F75580075BB52 /* wcscoll.c in Sources */, + C9EB34BB138F75580075BB52 /* wcscpy.c in Sources */, + C9EB34BC138F75580075BB52 /* wcscspn.c in Sources */, + C9EB34BD138F75580075BB52 /* wcsdup.c in Sources */, + C9EB34BE138F75580075BB52 /* wcslcat.c in Sources */, + C9EB34BF138F75580075BB52 /* wcslcpy.c in Sources */, + C9EB34C0138F75580075BB52 /* wcslen.c in Sources */, + C9EB34C1138F75580075BB52 /* wcsncasecmp.c in Sources */, + C9EB34C2138F75580075BB52 /* wcsncat.c in Sources */, + C9EB34C3138F75580075BB52 /* wcsncmp.c in Sources */, + C9EB34C4138F75580075BB52 /* wcsncpy.c in Sources */, + C9EB34C5138F75580075BB52 /* wcsnlen.c in Sources */, + C9EB34C6138F75580075BB52 /* wcspbrk.c in Sources */, + 2DF67CE6184F9CBE00B83A3D /* debug_private.c in Sources */, + C9EB34C7138F75580075BB52 /* wcsrchr.c in Sources */, + C9EB34C8138F75580075BB52 /* wcsspn.c in Sources */, + C9EB34C9138F75580075BB52 /* wcsstr.c in Sources */, + C9EB34CA138F75580075BB52 /* wcstok.c in Sources */, + C9EB34CB138F75580075BB52 /* wcswidth.c in Sources */, + C9EB34CC138F75580075BB52 /* wcsxfrm.c in Sources */, + C9EB34CD138F75580075BB52 /* wmemchr.c in Sources */, + C9EB34CE138F75580075BB52 /* wmemcmp.c in Sources */, + C9EB34CF138F75580075BB52 /* wmemcpy.c in Sources */, + C9EB34D0138F75580075BB52 /* wmemmove.c in Sources */, + C9EB34D1138F75580075BB52 /* wmemset.c in Sources */, + C9EB34D2138F75580075BB52 /* _libc_init.c in Sources */, + C9EB34D3138F75580075BB52 /* _libc_fork_child.c in Sources */, + C9EB34D4138F75580075BB52 /* chmodx_np.c in Sources */, + C9EB34D6138F75580075BB52 /* crt_externs.c in Sources */, + C9EB34D8138F75580075BB52 /* fork.c in Sources */, + C9EB34D9138F75580075BB52 /* getgroups.c in Sources */, + C9EB34DB138F75580075BB52 /* gettimeofday.c in Sources */, + C9EB34DC138F75580075BB52 /* msgctl.c in Sources */, + C9EB34DD138F75580075BB52 /* stack_protector.c in Sources */, + C9EB34DE138F75580075BB52 /* openx_np.c in Sources */, + C9EB34DF138F75580075BB52 /* OSMemoryNotification.c in Sources */, + C9EB34E0138F75580075BB52 /* OSThermalNotification.c in Sources */, + C9EB34E1138F75580075BB52 /* posix_spawn.c in Sources */, + C9EB34E2138F75580075BB52 /* semctl.c in Sources */, + C9EB34E3138F75580075BB52 /* settimeofday.c in Sources */, + C9EB34E4138F75580075BB52 /* shmctl.c in Sources */, + C9EB34E5138F75580075BB52 /* sigaction.c in Sources */, + C9EB34E9138F75580075BB52 /* statx_np.c in Sources */, + C9EB34EA138F75580075BB52 /* umaskx_np.c in Sources */, + C9EB34EE138F75580075BB52 /* fparseln.c in Sources */, + C9EB34EF138F75580075BB52 /* login.c in Sources */, + C9EB34F0138F75580075BB52 /* login_tty.c in Sources */, + C9EB34F1138F75580075BB52 /* logout.c in Sources */, + C9EB34F2138F75580075BB52 /* logwtmp.c in Sources */, + 3F76864C13E91D4B00C94D25 /* mkpath_np.c in Sources */, + C9EB34F3138F75580075BB52 /* opendev.c in Sources */, + C9EB34F4138F75580075BB52 /* pty.c in Sources */, + C9EB34F5138F75580075BB52 /* clear.c in Sources */, + C9EB34F6138F75580075BB52 /* compare.c in Sources */, + C9EB34F7138F75580075BB52 /* copy.c in Sources */, + C9EB34F8138F75580075BB52 /* gen_uuid.c in Sources */, + C9EB34F9138F75580075BB52 /* isnull.c in Sources */, + C9EB34FA138F75580075BB52 /* pack.c in Sources */, + C9EB34FB138F75580075BB52 /* parse.c in Sources */, + C9EB34FC138F75580075BB52 /* unpack.c in Sources */, + C9EB34FD138F75580075BB52 /* unparse.c in Sources */, + C9EB3510138F76A10075BB52 /* scandir_b.c in Sources */, + B19C64631450F90200032373 /* sync_volume_np.c in Sources */, + 3FB7E1BB146EF2E000843438 /* dirfd.c in Sources */, + 4B2C64AA15519BCB00342BFA /* assumes.c in Sources */, + FC2ED618157D4BE80098EC69 /* inet_ntop.c in Sources */, + FC2ED621157D4BE80098EC69 /* inet_pton.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 3F51211716C318EB00AFB431 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3F51206A16C3174300AFB431 /* FortifySource */; + targetProxy = 3F51211616C318EB00AFB431 /* PBXContainerItemProxy */; + }; + 926F73A21E046E69001E049D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 926F73911E03E2A3001E049D /* libsystem_darwin.dylib */; + targetProxy = 926F73A11E046E69001E049D /* PBXContainerItemProxy */; + }; + 928F25D51BEAD2AE007B13C7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 928F25D01BEACED7007B13C7 /* darwintests */; + targetProxy = 928F25D41BEAD2AE007B13C7 /* PBXContainerItemProxy */; + }; + B122F2D91432BA8700AF95D0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B122F0E71432B8E600AF95D0 /* TRE */; + targetProxy = B122F2D81432BA8700AF95D0 /* PBXContainerItemProxy */; + }; + C0E343841C582ECB00E749C2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9C2A94C138DFFD900287F00 /* Base */; + targetProxy = C0E343851C582ECB00E749C2 /* PBXContainerItemProxy */; + }; + C0E343861C582ECB00E749C2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9257ECF138E1B5000B3107C /* FreeBSD */; + targetProxy = C0E343871C582ECB00E749C2 /* PBXContainerItemProxy */; + }; + C0E343881C582ECB00E749C2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B122F0E71432B8E600AF95D0 /* TRE */; + targetProxy = C0E343891C582ECB00E749C2 /* PBXContainerItemProxy */; + }; + C0E3438A1C582ECB00E749C2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9D9435F138EC3E300FB7ACC /* Variant_Cancelable */; + targetProxy = C0E3438B1C582ECB00E749C2 /* PBXContainerItemProxy */; + }; + C0E3438C1C582ECB00E749C2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C95B7ED9138F3C55004311DA /* Variant_DarwinExtsn */; + targetProxy = C0E3438D1C582ECB00E749C2 /* PBXContainerItemProxy */; + }; + C925D2011518FA5D003D315B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C95B7ED9138F3C55004311DA /* Variant_DarwinExtsn */; + targetProxy = C925D2001518FA5D003D315B /* PBXContainerItemProxy */; + }; + C95B817D138F3F72004311DA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C95B7ED9138F3C55004311DA /* Variant_DarwinExtsn */; + targetProxy = C95B817C138F3F72004311DA /* PBXContainerItemProxy */; + }; + C95B8428138F5388004311DA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C95B8184138F52B0004311DA /* Variant_DarwinExtsn_Cancelable */; + targetProxy = C95B8427138F5388004311DA /* PBXContainerItemProxy */; + }; + C95B86CC138F546E004311DA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C95B842A138F53DB004311DA /* Variant_Pre1050 */; + targetProxy = C95B86CB138F546E004311DA /* PBXContainerItemProxy */; + }; + C9AE91BB1517D33100A2626C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9C2A94C138DFFD900287F00 /* Base */; + targetProxy = C9AE91BA1517D33100A2626C /* PBXContainerItemProxy */; + }; + C9AE91BD1517D33100A2626C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9257ECF138E1B5000B3107C /* FreeBSD */; + targetProxy = C9AE91BC1517D33100A2626C /* PBXContainerItemProxy */; + }; + C9AE91BF1517D33100A2626C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B122F0E71432B8E600AF95D0 /* TRE */; + targetProxy = C9AE91BE1517D33100A2626C /* PBXContainerItemProxy */; + }; + C9AE91C11517D33100A2626C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9D9435F138EC3E300FB7ACC /* Variant_Cancelable */; + targetProxy = C9AE91C01517D33100A2626C /* PBXContainerItemProxy */; + }; + C9BD3C39138F16EE00B389FD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9D9435F138EC3E300FB7ACC /* Variant_Cancelable */; + targetProxy = C9BD3C38138F16EE00B389FD /* PBXContainerItemProxy */; + }; + C9D94335138DB75F00FB7ACC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9B53E2B138DA0610028D27C /* Platform */; + targetProxy = C9D94334138DB75F00FB7ACC /* PBXContainerItemProxy */; + }; + C9EB326D138F74D20075BB52 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9EB2FC9138F6D880075BB52 /* Variant_Legacy */; + targetProxy = C9EB326C138F74D20075BB52 /* PBXContainerItemProxy */; + }; + C9EB3515138F771F0075BB52 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9EB326F138F75580075BB52 /* Variant_Inode32 */; + targetProxy = C9EB3514138F771F0075BB52 /* PBXContainerItemProxy */; + }; + C9FA32C8138E41800089A94B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9C2A94C138DFFD900287F00 /* Base */; + targetProxy = C9FA32C7138E41800089A94B /* PBXContainerItemProxy */; + }; + C9FA32CA138E41800089A94B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9257ECF138E1B5000B3107C /* FreeBSD */; + targetProxy = C9FA32C9138E41800089A94B /* PBXContainerItemProxy */; + }; + C9FA32CC138E41800089A94B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9258093138E2D3100B3107C /* NetBSD */; + targetProxy = C9FA32CB138E41800089A94B /* PBXContainerItemProxy */; + }; + E47E981722150F0A006E312E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9D9432E138DB73300FB7ACC /* libsystem_c.dylib */; + targetProxy = E47E981622150F0A006E312E /* PBXContainerItemProxy */; + }; + E47E981922150F2C006E312E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C942102D13900C8A004BA536 /* libc_dyld */; + targetProxy = E47E981822150F2C006E312E /* PBXContainerItemProxy */; + }; + E47E981B22150F2F006E312E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C0E343831C582ECB00E749C2 /* libc_static */; + targetProxy = E47E981A22150F2F006E312E /* PBXContainerItemProxy */; + }; + E47E981D22150F32006E312E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C97A6F1E1517AF53005E1998 /* libc_eOS.a */; + targetProxy = E47E981C22150F32006E312E /* PBXContainerItemProxy */; + }; + E47E981F22150F3C006E312E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C9D9432E138DB73300FB7ACC /* libsystem_c.dylib */; + targetProxy = E47E981E22150F3C006E312E /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 3F5120EF16C3174300AFB431 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(BASE_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 3F5120F016C3174300AFB431 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(BASE_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 925E7FE719E8945A00AC7889 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 925E7FE819E8945A00AC7889 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 926F73931E03E2A4001E049D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "_LIBC_NO_FEATURE_VERIFICATION=1", + "DARWIN_BUILDING_LIBSYSTEM_DARWIN=1", + OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE, + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$($(TARGET_NAME)_SEARCH_PATHS)", + "$(DERIVED_FILES_DIR)/dtrace", + "$(SRCROOT_SEARCH_PATHS)", + "$(SYSTEM_FRAMEWORK_HEADERS)", + "$(PROJECT_DIR)/libdarwin", + "$(PROJECT_DIR)/libdarwin/h", + "$(SDKROOT)/usr/local/include", + "$(inherited)", + ); + LIBRARY_SEARCH_PATHS = /usr/lib/system; + LIBSYSTEM_DARWIN_LDFLAGS = "-all_load -nostdlib -L/usr/lib/system -umbrella System $(LIBCOMPILER_RT_LDFLAGS) $(LIBDYLD_LDFLAGS) $(LIBSYSCALL_LDFLAGS) $(LIBM_LDFLAGS) $(LIBMALLOC_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBPTHREAD_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBC_LDFLAGS) $(LIBDISPATCH_LDFLAGS) $(LIBXPC_LDFLAGS) -lmacho -ldyld -Wl,-upward-lsystem_trace"; + OTHER_LDFLAGS = "$(LIBSYSTEM_DARWIN_LDFLAGS)"; + OTHER_TAPI_FLAGS = "$(inherited) -extra-public-header $(SRCROOT)/libdarwin/h/dirstat.h -extra-public-header $(SRCROOT)/libdarwin/internal.h -DDARWIN_TAPI=1 -extra-public-header $(SRCROOT)/os/variant_private.h"; + PRIVATE_HEADERS_FOLDER_PATH = "$(DARWIN_PRIVATE_HEADERS_FOLDER_PATH)"; + PRODUCT_NAME = darwin; + SKIP_INSTALL = NO; + SUPPORTS_TEXT_BASED_API = YES; + TAPI_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/libdarwin"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 926F73941E03E2A4001E049D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "_LIBC_NO_FEATURE_VERIFICATION=1", + "DARWIN_BUILDING_LIBSYSTEM_DARWIN=1", + OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE, + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$($(TARGET_NAME)_SEARCH_PATHS)", + "$(DERIVED_FILES_DIR)/dtrace", + "$(SRCROOT_SEARCH_PATHS)", + "$(SYSTEM_FRAMEWORK_HEADERS)", + "$(PROJECT_DIR)/libdarwin", + "$(PROJECT_DIR)/libdarwin/h", + "$(SDKROOT)/usr/local/include", + "$(inherited)", + ); + LIBRARY_SEARCH_PATHS = /usr/lib/system; + LIBSYSTEM_DARWIN_LDFLAGS = "-all_load -nostdlib -L/usr/lib/system -umbrella System $(LIBCOMPILER_RT_LDFLAGS) $(LIBDYLD_LDFLAGS) $(LIBSYSCALL_LDFLAGS) $(LIBM_LDFLAGS) $(LIBMALLOC_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBPTHREAD_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBC_LDFLAGS) $(LIBDISPATCH_LDFLAGS) $(LIBXPC_LDFLAGS) -lmacho -ldyld -Wl,-upward-lsystem_trace"; + OTHER_LDFLAGS = "$(LIBSYSTEM_DARWIN_LDFLAGS)"; + OTHER_TAPI_FLAGS = "$(inherited) -extra-public-header $(SRCROOT)/libdarwin/h/dirstat.h -extra-public-header $(SRCROOT)/libdarwin/tapi.h -DDARWIN_TAPI=1 -extra-public-header $(SRCROOT)/os/variant_private.h -extra-public-header $(SRCROOT)/os/api.h"; + PRIVATE_HEADERS_FOLDER_PATH = "$(DARWIN_PRIVATE_HEADERS_FOLDER_PATH)"; + PRODUCT_NAME = darwin; + SKIP_INSTALL = NO; + SUPPORTS_TEXT_BASED_API = YES; + TAPI_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/libdarwin"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + 926F739F1E046E56001E049D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 926F73A01E046E56001E049D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 928F25D21BEACED7007B13C7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + }; + name = Debug; + }; + 928F25D31BEACED7007B13C7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + }; + name = Release; + }; + B122F2AB1432B8E600AF95D0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = ( + "$(FreeBSD_EXCLUDED_SOURCE_GDTOA)", + "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)", + ); + EXECUTABLE_PREFIX = lib; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + INCLUDED_SOURCE_FILE_NAMES = "$(FreeBSD_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = TRE; + }; + name = Debug; + }; + B122F2AC1432B8E600AF95D0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = ( + "$(FreeBSD_EXCLUDED_SOURCE_GDTOA)", + "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)", + ); + EXECUTABLE_PREFIX = lib; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + INCLUDED_SOURCE_FILE_NAMES = "$(FreeBSD_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = TRE; + }; + name = Release; + }; + C0E345E01C582ECB00E749C2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C0E345E31C58300F00E749C2 /* libc_static.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + PRODUCT_NAME = "$(PRODUCT_NAME)"; + }; + name = Debug; + }; + C0E345E11C582ECB00E749C2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C0E345E31C58300F00E749C2 /* libc_static.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + PRODUCT_NAME = "$(PRODUCT_NAME)"; + }; + name = Release; + }; + C9257ED1138E1B5000B3107C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = ( + "$(FreeBSD_EXCLUDED_SOURCE_GDTOA)", + "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)", + ); + EXECUTABLE_PREFIX = lib; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + INCLUDED_SOURCE_FILE_NAMES = "$(FreeBSD_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + C9257ED2138E1B5000B3107C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = ( + "$(FreeBSD_EXCLUDED_SOURCE_GDTOA)", + "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)", + ); + EXECUTABLE_PREFIX = lib; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + INCLUDED_SOURCE_FILE_NAMES = "$(FreeBSD_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + C9258103138E2D3100B3107C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + PRODUCT_NAME = NetBSD; + }; + name = Debug; + }; + C9258104138E2D3100B3107C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + PRODUCT_NAME = NetBSD; + }; + name = Release; + }; + C94212CA13900C8A004BA536 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + BUILD_VARIANTS = normal; + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + INSTALL_PATH = /usr/local/lib/dyld; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + /usr/lib/system, + ); + PRODUCT_NAME = c_dyld; + SKIP_INSTALL = NO; + STRIP_INSTALLED_PRODUCT = NO; + VARIANT = DYLD; + }; + name = Debug; + }; + C94212CB13900C8A004BA536 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + BUILD_VARIANTS = normal; + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + INSTALL_PATH = /usr/local/lib/dyld; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + /usr/lib/system, + ); + PRODUCT_NAME = c_dyld; + SKIP_INSTALL = NO; + STRIP_INSTALLED_PRODUCT = NO; + VARIANT = DYLD; + }; + name = Release; + }; + C95B8174138F3C55004311DA /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vDarwinExtsn; + VARIANT = DARWINEXTSN; + }; + name = Debug; + }; + C95B8175138F3C55004311DA /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vDarwinExtsn; + VARIANT = DARWINEXTSN; + }; + name = Release; + }; + C95B841F138F52B0004311DA /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vDarwinExtsnCancelable; + VARIANT = DARWINEXTSN_CANCELABLE; + }; + name = Debug; + }; + C95B8420138F52B0004311DA /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vDarwinExtsnCancelable; + VARIANT = DARWINEXTSN_CANCELABLE; + }; + name = Release; + }; + C95B86C5138F53DB004311DA /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vPre1050; + VARIANT = PRE1050; + }; + name = Debug; + }; + C95B86C6138F53DB004311DA /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vPre1050; + VARIANT = PRE1050; + }; + name = Release; + }; + C97A721A1517AF53005E1998 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9AE91AE1517CDAC00A2626C /* eos.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + }; + name = Debug; + }; + C97A721B1517AF53005E1998 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9AE91AE1517CDAC00A2626C /* eos.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + }; + name = Release; + }; + C9B5359C138D9A690028D27C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9C2A948138DF7DD00287F00 /* libc.xcconfig */; + buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + ONLY_ACTIVE_ARCH = YES; + }; + name = Debug; + }; + C9B5359D138D9A690028D27C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9C2A948138DF7DD00287F00 /* libc.xcconfig */; + buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + }; + name = Release; + }; + C9B53E2E138DA0610028D27C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + EXCLUDED_SOURCE_FILE_NAMES = "*"; + EXECUTABLE_PREFIX = lib; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + INCLUDED_SOURCE_FILE_NAMES = "$(Platform_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + C9B53E2F138DA0610028D27C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + EXCLUDED_SOURCE_FILE_NAMES = "*"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(Platform_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + C9C2A94F138DFFDA00287F00 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(BASE_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + C9C2A950138DFFDA00287F00 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(BASE_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(BASE_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + C9D94331138DB73300FB7ACC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DYLIB_CURRENT_VERSION = "$(CURRENT_PROJECT_VERSION)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SDK_INSTALL_ROOT)/usr/lib/system", + ); + "ORDER_FILE[sdk=iphoneos*]" = "$(SDKROOT)/AppleInternal/OrderFiles/libsystem_c.order"; + OTHER_LDFLAGS = "$(LIBSYSTEM_C_LDFLAGS)"; + PRODUCT_NAME = c; + SKIP_INSTALL = NO; + STRIP_INSTALLED_PRODUCT = YES; + SUPPORTS_TEXT_BASED_API = NO; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + C9D94332138DB73300FB7ACC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DYLIB_CURRENT_VERSION = "$(CURRENT_PROJECT_VERSION)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SDK_INSTALL_ROOT)/usr/lib/system", + ); + "ORDER_FILE[sdk=iphoneos*]" = "$(SDKROOT)/AppleInternal/OrderFiles/libsystem_c.order"; + OTHER_LDFLAGS = "$(LIBSYSTEM_C_LDFLAGS)"; + PRODUCT_NAME = c; + SKIP_INSTALL = NO; + STRIP_INSTALLED_PRODUCT = YES; + SUPPORTS_TEXT_BASED_API = NO; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + C9D94362138EC3E300FB7ACC /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vCancelable; + VARIANT = CANCELABLE; + }; + name = Debug; + }; + C9D94363138EC3E300FB7ACC /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vCancelable; + VARIANT = CANCELABLE; + }; + name = Release; + }; + C9EB3264138F6D880075BB52 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vLegacy; + VARIANT = LEGACY; + }; + name = Debug; + }; + C9EB3265138F6D880075BB52 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vLegacy; + VARIANT = LEGACY; + }; + name = Release; + }; + C9EB350B138F75580075BB52 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vInode32; + VARIANT = INODE32; + }; + name = Debug; + }; + C9EB350C138F75580075BB52 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9766153138ECF0000741512 /* variants.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_EXCLUDED_SOURCE_FILE_NAMES)"; + EXECUTABLE_PREFIX = lib; + INCLUDED_SOURCE_FILE_NAMES = "$(VARIANT_INCLUDED_SOURCE_FILE_NAMES)"; + PRODUCT_NAME = vInode32; + VARIANT = INODE32; + }; + name = Release; + }; + E47E980F22150EAD006E312E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + E47E981022150EAD006E312E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + E47E981422150EBB006E312E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + E47E981522150EBB006E312E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3F5120EE16C3174300AFB431 /* Build configuration list for PBXNativeTarget "FortifySource" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F5120EF16C3174300AFB431 /* Debug */, + 3F5120F016C3174300AFB431 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 925E7FF919E8945A00AC7889 /* Build configuration list for PBXAggregateTarget "Libc_tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 925E7FE719E8945A00AC7889 /* Debug */, + 925E7FE819E8945A00AC7889 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 926F73951E03E2A4001E049D /* Build configuration list for PBXNativeTarget "libsystem_darwin.dylib" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 926F73931E03E2A4001E049D /* Debug */, + 926F73941E03E2A4001E049D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 926F739E1E046E56001E049D /* Build configuration list for PBXAggregateTarget "Libc_darwin" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 926F739F1E046E56001E049D /* Debug */, + 926F73A01E046E56001E049D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 928F25D11BEACED7007B13C7 /* Build configuration list for PBXLegacyTarget "darwintests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 928F25D21BEACED7007B13C7 /* Debug */, + 928F25D31BEACED7007B13C7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B122F2AA1432B8E600AF95D0 /* Build configuration list for PBXNativeTarget "TRE" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B122F2AB1432B8E600AF95D0 /* Debug */, + B122F2AC1432B8E600AF95D0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C0E345DF1C582ECB00E749C2 /* Build configuration list for PBXNativeTarget "libc_static" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C0E345E01C582ECB00E749C2 /* Debug */, + C0E345E11C582ECB00E749C2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C9257ED3138E1B5000B3107C /* Build configuration list for PBXNativeTarget "FreeBSD" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C9257ED1138E1B5000B3107C /* Debug */, + C9257ED2138E1B5000B3107C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C9258102138E2D3100B3107C /* Build configuration list for PBXNativeTarget "NetBSD" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C9258103138E2D3100B3107C /* Debug */, + C9258104138E2D3100B3107C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C94212C913900C8A004BA536 /* Build configuration list for PBXNativeTarget "libc_dyld" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C94212CA13900C8A004BA536 /* Debug */, + C94212CB13900C8A004BA536 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C95B8173138F3C55004311DA /* Build configuration list for PBXNativeTarget "Variant_DarwinExtsn" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C95B8174138F3C55004311DA /* Debug */, + C95B8175138F3C55004311DA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C95B841E138F52B0004311DA /* Build configuration list for PBXNativeTarget "Variant_DarwinExtsn_Cancelable" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C95B841F138F52B0004311DA /* Debug */, + C95B8420138F52B0004311DA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C95B86C4138F53DB004311DA /* Build configuration list for PBXNativeTarget "Variant_Pre1050" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C95B86C5138F53DB004311DA /* Debug */, + C95B86C6138F53DB004311DA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C97A72191517AF53005E1998 /* Build configuration list for PBXNativeTarget "libc_eOS.a" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C97A721A1517AF53005E1998 /* Debug */, + C97A721B1517AF53005E1998 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C9B5359A138D9A690028D27C /* Build configuration list for PBXProject "Libc" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C9B5359C138D9A690028D27C /* Debug */, + C9B5359D138D9A690028D27C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C9B53E2D138DA0610028D27C /* Build configuration list for PBXNativeTarget "Platform" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C9B53E2E138DA0610028D27C /* Debug */, + C9B53E2F138DA0610028D27C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C9C2A94E138DFFDA00287F00 /* Build configuration list for PBXNativeTarget "Base" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C9C2A94F138DFFDA00287F00 /* Debug */, + C9C2A950138DFFDA00287F00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C9D94330138DB73300FB7ACC /* Build configuration list for PBXNativeTarget "libsystem_c.dylib" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C9D94331138DB73300FB7ACC /* Debug */, + C9D94332138DB73300FB7ACC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C9D94361138EC3E300FB7ACC /* Build configuration list for PBXNativeTarget "Variant_Cancelable" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C9D94362138EC3E300FB7ACC /* Debug */, + C9D94363138EC3E300FB7ACC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C9EB3263138F6D880075BB52 /* Build configuration list for PBXNativeTarget "Variant_Legacy" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C9EB3264138F6D880075BB52 /* Debug */, + C9EB3265138F6D880075BB52 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C9EB350A138F75580075BB52 /* Build configuration list for PBXNativeTarget "Variant_Inode32" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C9EB350B138F75580075BB52 /* Debug */, + C9EB350C138F75580075BB52 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E47E981122150EAD006E312E /* Build configuration list for PBXAggregateTarget "Libc" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E47E980F22150EAD006E312E /* Debug */, + E47E981022150EAD006E312E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E47E981322150EBB006E312E /* Build configuration list for PBXAggregateTarget "Libc_driverkit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E47E981422150EBB006E312E /* Debug */, + E47E981522150EBB006E312E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C9B53597138D9A690028D27C /* Project object */; +} diff --git a/Platforms/appletvos/Makefile.inc b/Platforms/appletvos/Makefile.inc new file mode 100644 index 0000000..04157fe --- /dev/null +++ b/Platforms/appletvos/Makefile.inc @@ -0,0 +1,48 @@ +# +# Selectable features for AppleTV +# + +# Legacy *64 APIs +#FEATURE_LEGACY_64_APIS = 1 + +# Legacy crt1.o environ support +#FEATURE_LEGACY_CRT1_ENVIRON = 1 + +# Legacy rune APIs +#FEATURE_LEGACY_RUNE_APIS = 1 + +# Legacy utmp APIs +#FEATURE_LEGACY_UTMP_APIS = 1 + +# OSThermalNotification APIs +FEATURE_THERM_NOTIFICATION_APIS = 1 + +# No pre-1050 variants (should match sys/cdefs.h) +FEATURE_ONLY_1050_VARIANTS = 1 + +# No legacy variants (should match sys/cdefs.h) +FEATURE_ONLY_UNIX_CONFORMANCE = 1 + +# Only 64-bit ino_t (should match sys/cdefs.h) +FEATURE_ONLY_64_BIT_INO_T = 1 + +# Patch 3333969 +#FEATURE_PATCH_3333969 = 1 + +# Patch 3417676 +#FEATURE_PATCH_3417676 = 1 + +# plockstat dtrace support +#FEATURE_PLOCKSTAT = 1 + +# Timezone change notification +FEATURE_TIMEZONE_CHANGE_NOTIFICATION = 1 + +# Smaller stdio buffers +FEATURE_SMALL_STDIOBUF = 1 + +# Disable registration of specific signals () +FEATURE_SIGNAL_RESTRICTION = 1 + +# Enable 32-bit compilation in unistd.h () +# FEATURE_POSIX_ILP32_ALLOW = 0 diff --git a/Platforms/bridgeos/Makefile.inc b/Platforms/bridgeos/Makefile.inc new file mode 100644 index 0000000..03e0e3c --- /dev/null +++ b/Platforms/bridgeos/Makefile.inc @@ -0,0 +1,48 @@ +# +# Selectable features for bridgeOS +# + +# Legacy *64 APIs +#FEATURE_LEGACY_64_APIS = 1 + +# Legacy crt1.o environ support +#FEATURE_LEGACY_CRT1_ENVIRON = 1 + +# Legacy rune APIs +#FEATURE_LEGACY_RUNE_APIS = 1 + +# Legacy utmp APIs +#FEATURE_LEGACY_UTMP_APIS = 1 + +# OSThermalNotification APIs +FEATURE_THERM_NOTIFICATION_APIS = 1 + +# No pre-1050 variants (should match sys/cdefs.h) +FEATURE_ONLY_1050_VARIANTS = 1 + +# No legacy variants (should match sys/cdefs.h) +FEATURE_ONLY_UNIX_CONFORMANCE = 1 + +# Only 64-bit ino_t (should match sys/cdefs.h) +FEATURE_ONLY_64_BIT_INO_T = 1 + +# Patch 3333969 +#FEATURE_PATCH_3333969 = 1 + +# Patch 3417676 +#FEATURE_PATCH_3417676 = 1 + +# plockstat dtrace support +#FEATURE_PLOCKSTAT = 1 + +# Timezone change notification +FEATURE_TIMEZONE_CHANGE_NOTIFICATION = 1 + +# Smaller stdio buffers +FEATURE_SMALL_STDIOBUF = 1 + +# Disable registration of specific signals () +FEATURE_SIGNAL_RESTRICTION = 1 + +# Enable 32-bit compilation in unistd.h () +# FEATURE_POSIX_ILP32_ALLOW = 0 diff --git a/Platforms/driverkit/Makefile.inc b/Platforms/driverkit/Makefile.inc new file mode 100644 index 0000000..8f827c3 --- /dev/null +++ b/Platforms/driverkit/Makefile.inc @@ -0,0 +1,48 @@ +# +# Selectable features for DriverKit +# + +# Legacy *64 APIs +#FEATURE_LEGACY_64_APIS = 1 + +# Legacy crt1.o environ support +#FEATURE_LEGACY_CRT1_ENVIRON = 1 + +# Legacy rune APIs +#FEATURE_LEGACY_RUNE_APIS = 1 + +# Legacy utmp APIs +#FEATURE_LEGACY_UTMP_APIS = 1 + +# OSThermalNotification APIs +#FEATURE_THERM_NOTIFICATION_APIS = 1 + +# No pre-1050 variants (should match sys/cdefs.h) +FEATURE_ONLY_1050_VARIANTS = 1 + +# No legacy variants (should match sys/cdefs.h) +FEATURE_ONLY_UNIX_CONFORMANCE = 1 + +# Only 64-bit ino_t (should match sys/cdefs.h) +FEATURE_ONLY_64_BIT_INO_T = 1 + +# Patch 3333969 +#FEATURE_PATCH_3333969 = 1 + +# Patch 3417676 +#FEATURE_PATCH_3417676 = 1 + +# plockstat dtrace support +#FEATURE_PLOCKSTAT = 1 + +# Timezone change notification +#FEATURE_TIMEZONE_CHANGE_NOTIFICATION = 1 + +# Extensible printf performance enhancement (uses more memory) +#FEATURE_XPRINTF_PERF = 1 + +# Disable registration of specific signals () +# FEATURE_SIGNAL_RESTRICTION = 0 + +# Enable 32-bit compilation in unistd.h () +# FEATURE_POSIX_ILP32_ALLOW = 0 diff --git a/Platforms/iphoneos/Makefile.inc b/Platforms/iphoneos/Makefile.inc new file mode 100644 index 0000000..16cfa88 --- /dev/null +++ b/Platforms/iphoneos/Makefile.inc @@ -0,0 +1,48 @@ +# +# Selectable features for iPhone +# + +# Legacy *64 APIs +#FEATURE_LEGACY_64_APIS = 1 + +# Legacy crt1.o environ support +#FEATURE_LEGACY_CRT1_ENVIRON = 1 + +# Legacy rune APIs +#FEATURE_LEGACY_RUNE_APIS = 1 + +# Legacy utmp APIs +#FEATURE_LEGACY_UTMP_APIS = 1 + +# OSThermalNotification APIs +FEATURE_THERM_NOTIFICATION_APIS = 1 + +# No pre-1050 variants (should match sys/cdefs.h) +FEATURE_ONLY_1050_VARIANTS = 1 + +# No legacy variants (should match sys/cdefs.h) +FEATURE_ONLY_UNIX_CONFORMANCE = 1 + +# Only 64-bit ino_t (should match sys/cdefs.h) +FEATURE_ONLY_64_BIT_INO_T = 1 + +# Patch 3333969 +#FEATURE_PATCH_3333969 = 1 + +# Patch 3417676 +#FEATURE_PATCH_3417676 = 1 + +# plockstat dtrace support +#FEATURE_PLOCKSTAT = 1 + +# Timezone change notification +FEATURE_TIMEZONE_CHANGE_NOTIFICATION = 1 + +# Smaller stdio buffers +FEATURE_SMALL_STDIOBUF = 1 + +# Disable registration of specific signals () +# FEATURE_SIGNAL_RESTRICTION = 0 + +# Enable 32-bit compilation in unistd.h () +# FEATURE_POSIX_ILP32_ALLOW = 0 diff --git a/Platforms/macosx/Makefile.inc b/Platforms/macosx/Makefile.inc new file mode 100644 index 0000000..b73ae87 --- /dev/null +++ b/Platforms/macosx/Makefile.inc @@ -0,0 +1,50 @@ +# +# Selectable features for MacOSX +# + +# Legacy *64 APIs +FEATURE_LEGACY_64_APIS = 1 + +# Legacy crt1.o environ support +FEATURE_LEGACY_CRT1_ENVIRON = 1 + +# Legacy rune APIs +FEATURE_LEGACY_RUNE_APIS = 1 + +# Legacy utmp APIs +FEATURE_LEGACY_UTMP_APIS = 1 + +# OSThermalNotification APIs +FEATURE_THERM_NOTIFICATION_APIS = 1 + +# No pre-1050 variants (should match sys/cdefs.h) +#FEATURE_ONLY_1050_VARIANTS = 1 + +# No legacy variants (should match sys/cdefs.h) +.if CURRENT_ARCH 64$ +FEATURE_ONLY_UNIX_CONFORMANCE = 1 +.endif + +# Only 64-bit ino_t (should match sys/cdefs.h) +#FEATURE_ONLY_64_BIT_INO_T = 1 + +# Patch 3333969 +FEATURE_PATCH_3333969 = 1 + +# Patch 3417676 +FEATURE_PATCH_3417676 = 1 + +# plockstat dtrace support +FEATURE_PLOCKSTAT = 1 + +# Timezone change notification +FEATURE_TIMEZONE_CHANGE_NOTIFICATION = 1 + +# Extensible printf performance enhancement (uses more memory) +FEATURE_XPRINTF_PERF = 1 + +# Disable registration of specific signals () +# FEATURE_SIGNAL_RESTRICTION = 0 + +# Enable 32-bit compilation in unistd.h () +# FEATURE_POSIX_ILP32_ALLOW = 0 diff --git a/Platforms/watchos/Makefile.inc b/Platforms/watchos/Makefile.inc new file mode 100644 index 0000000..13a81ca --- /dev/null +++ b/Platforms/watchos/Makefile.inc @@ -0,0 +1,48 @@ +# +# Selectable features for Apple Watch +# + +# Legacy *64 APIs +#FEATURE_LEGACY_64_APIS = 1 + +# Legacy crt1.o environ support +#FEATURE_LEGACY_CRT1_ENVIRON = 1 + +# Legacy rune APIs +#FEATURE_LEGACY_RUNE_APIS = 1 + +# Legacy utmp APIs +#FEATURE_LEGACY_UTMP_APIS = 1 + +# OSThermalNotification APIs +FEATURE_THERM_NOTIFICATION_APIS = 1 + +# No pre-1050 variants (should match sys/cdefs.h) +FEATURE_ONLY_1050_VARIANTS = 1 + +# No legacy variants (should match sys/cdefs.h) +FEATURE_ONLY_UNIX_CONFORMANCE = 1 + +# Only 64-bit ino_t (should match sys/cdefs.h) +FEATURE_ONLY_64_BIT_INO_T = 1 + +# Patch 3333969 +#FEATURE_PATCH_3333969 = 1 + +# Patch 3417676 +#FEATURE_PATCH_3417676 = 1 + +# plockstat dtrace support +#FEATURE_PLOCKSTAT = 1 + +# Timezone change notification +FEATURE_TIMEZONE_CHANGE_NOTIFICATION = 1 + +# Smaller stdio buffers +FEATURE_SMALL_STDIOBUF = 1 + +# Disable registration of specific signals () +FEATURE_SIGNAL_RESTRICTION = 1 + +# Enable 32-bit compilation in unistd.h () +FEATURE_POSIX_ILP32_ALLOW = 1 diff --git a/compat-43/CMakeLists.txt b/compat-43/CMakeLists.txt new file mode 100644 index 0000000..ba59fdd --- /dev/null +++ b/compat-43/CMakeLists.txt @@ -0,0 +1,50 @@ +project(libc-compat) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") + +set(compat_sources setregid.c setreuid.c sigaltstk.c sigcompat.c) + +set(compat_sources ${compat_sources} + FreeBSD/creat.c + FreeBSD/gethostid.c + FreeBSD/getwd.c + FreeBSD/killpg.c + FreeBSD/sethostid.c + FreeBSD/setpgrp.c + FreeBSD/setrgid.c + FreeBSD/setruid.c) + +SET_SOURCE_FILES_PROPERTIES(FreeBSD/creat.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_CREAT") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/killpg.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_KILLPG") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/setpgrp.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_SETPGRP") +SET_SOURCE_FILES_PROPERTIES(sigcompat.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_SIGPAUSE") + +add_darling_object_library(libc-compat ${compat_sources}) +#SET_TARGET_PROPERTIES(libc-compat PROPERTIES COMPILE_DEFINITIONS "__DARWIN_NON_CANCELABLE") + +# *** +# Cancelable variants +# *** + +#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U__DARWIN_NON_CANCELABLE") + +set(compat-cancelable_sources sigcompat.c FreeBSD/creat.c) + +add_library(libc-compat_cancelable OBJECT ${compat-cancelable_sources}) +SET_TARGET_PROPERTIES(libc-compat_cancelable PROPERTIES + COMPILE_DEFINITIONS "BUILDING_VARIANT;VARIANT_CANCELABLE" + COMPILE_FLAGS "-U__DARWIN_NON_CANCELABLE -D__DARWIN_UNIX03=1") + +# *** +# Legacy variants +# *** + +if (TARGET_i386) + set(compat-legacy_sources FreeBSD/creat.c FreeBSD/killpg.c) + add_library(libc-compat_legacy OBJECT ${compat-legacy_sources}) + SET_TARGET_PROPERTIES(libc-compat_legacy PROPERTIES + COMPILE_DEFINITIONS "BUILDING_VARIANT;VARIANT_LEGACY;_NONSTD_SOURCE" + COMPILE_FLAGS "-U__DARWIN_NON_CANCELABLE -U__DARWIN_UNIX03 -U_DARWIN_C_SOURCE -U_POSIX_C_SOURCE") +endif (TARGET_i386) diff --git a/compat-43/FreeBSD/creat.2 b/compat-43/FreeBSD/creat.2 new file mode 100644 index 0000000..50acae4 --- /dev/null +++ b/compat-43/FreeBSD/creat.2 @@ -0,0 +1,62 @@ +.\" Copyright (c) 1989, 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)creat.2 8.1 (Berkeley) 6/2/93 +.\" $FreeBSD: src/lib/libc/compat-43/creat.2,v 1.11 2007/01/09 00:27:49 imp Exp $ +.\" +.Dd June 2, 1993 +.Dt CREAT 2 +.Os +.Sh NAME +.Nm creat +.Nd create a new file +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In fcntl.h +.Ft int +.Fn creat "const char *path" "mode_t mode" +.Sh DESCRIPTION +.Bf -symbolic +This interface is made obsolete by: +.Ef +.Xr open 2 . +.Pp +The +.Fn creat +function +is the same as: +.Bd -literal -offset indent +open(path, O_CREAT | O_TRUNC | O_WRONLY, mode); +.Ed +.Sh SEE ALSO +.Xr open 2 +.Sh HISTORY +The +.Fn creat +function appeared in +.At v6 . diff --git a/compat-43/FreeBSD/creat.c b/compat-43/FreeBSD/creat.c new file mode 100644 index 0000000..f913d4a --- /dev/null +++ b/compat-43/FreeBSD/creat.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)creat.c 8.1 (Berkeley) 6/2/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/compat-43/creat.c,v 1.8 2007/01/09 00:27:49 imp Exp $"); + + +#include "namespace.h" +#include +#include "un-namespace.h" + +#ifdef VARIANT_CANCELABLE +int __open(const char *path, int flags, mode_t mode); +#else /* !VARIANT_CANCELABLE */ +int __open_nocancel(const char *path, int flags, mode_t mode); +#endif /* VARIANT_CANCELABLE */ + + +int +__creat(const char *path, mode_t mode) +{ +#ifdef VARIANT_CANCELABLE + return(__open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)); +#else /* !VARIANT_CANCELABLE */ + return(__open_nocancel(path, O_WRONLY|O_CREAT|O_TRUNC, mode)); +#endif /* VARIANT_CANCELABLE */ +} +__weak_reference(__creat, creat); +__weak_reference(__creat, _creat); diff --git a/compat-43/FreeBSD/gethostid.3 b/compat-43/FreeBSD/gethostid.3 new file mode 100644 index 0000000..e938320 --- /dev/null +++ b/compat-43/FreeBSD/gethostid.3 @@ -0,0 +1,78 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)gethostid.3 8.1 (Berkeley) 6/2/93 +.\" $FreeBSD: src/lib/libc/compat-43/gethostid.3,v 1.14 2007/01/09 00:27:49 imp Exp $ +.\" +.Dd June 2, 1993 +.Dt GETHOSTID 3 +.Os +.Sh NAME +.Nm gethostid , +.Nm sethostid +.Nd get/set unique identifier of current host +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft long +.Fn gethostid void +.Ft void +.Fn sethostid "long hostid" +.Sh DESCRIPTION +The +.Fn sethostid +function +establishes a 32-bit identifier for the current processor. +The id, intended to be unique among all UNIX systems in existence, +is normally a DARPA Internet address for the local machine. +This call is allowed only to the +super-user and is normally performed at boot time. +.Pp +The +.Fn gethostid +function +returns the 32-bit identifier for the current processor. +.Pp +This function has been deprecated. +The hostid should be set or retrieved by use of +.Xr sysctl 3 . +.Sh SEE ALSO +.Xr gethostname 3 , +.Xr sysctl 3 , +.Xr sysctl 8 +.Sh HISTORY +The +.Fn gethostid +and +.Fn sethostid +syscalls appeared in +.Bx 4.2 +and were dropped in +.Bx 4.4 . +.Sh BUGS +32 bits for the identifier is too small. diff --git a/compat-43/FreeBSD/gethostid.c b/compat-43/FreeBSD/gethostid.c new file mode 100644 index 0000000..5f77a9b --- /dev/null +++ b/compat-43/FreeBSD/gethostid.c @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gethostid.c 8.1 (Berkeley) 6/2/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/compat-43/gethostid.c,v 1.5 2007/01/09 00:27:49 imp Exp $"); + +#include +#include + +#include + +long +gethostid(void) +{ + int mib[2]; + size_t size; + int value; + + mib[0] = CTL_KERN; + mib[1] = KERN_HOSTID; + size = sizeof value; + if (sysctl(mib, 2, &value, &size, NULL, 0) == -1) + return (-1); + return (value); +} diff --git a/compat-43/FreeBSD/getwd.c b/compat-43/FreeBSD/getwd.c new file mode 100644 index 0000000..3ed8490 --- /dev/null +++ b/compat-43/FreeBSD/getwd.c @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getwd.c 8.1 (Berkeley) 6/2/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/compat-43/getwd.c,v 1.6 2007/01/09 00:27:49 imp Exp $"); + +#include +#include +#include +#include +#include + +char * +getwd(char *buf) +{ + char *p; + + if ( (p = getcwd(buf, MAXPATHLEN)) ) + return(p); + (void)strerror_r(errno, buf, MAXPATHLEN); + return((char *)NULL); +} diff --git a/compat-43/FreeBSD/killpg.2 b/compat-43/FreeBSD/killpg.2 new file mode 100644 index 0000000..2518ab9 --- /dev/null +++ b/compat-43/FreeBSD/killpg.2 @@ -0,0 +1,105 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)killpg.2 8.1 (Berkeley) 6/2/93 +.\" $FreeBSD: src/lib/libc/compat-43/killpg.2,v 1.14 2007/01/09 00:27:49 imp Exp $ +.\" +.Dd October 10, 2006 +.Dt KILLPG 2 +.Os +.Sh NAME +.Nm killpg +.Nd send signal to a process group +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.Ft int +.Fn killpg "pid_t pgrp" "int sig" +.Sh DESCRIPTION +The +.Fn killpg +function +sends the signal +.Fa sig +to the process group +.Fa pgrp . +See +.Xr sigaction 2 +for a list of signals. +If +.Fa pgrp +is 0, +.Fn killpg +sends the signal to the sending process's process group. +.Pp +The sending process and members of the process group must +have the same effective user ID, or +the sender must be the super-user. +As a single special case the continue signal SIGCONT may be sent +to any process with the same session ID as the caller. +.Sh RETURN VALUES +.Rv -std killpg +.Sh ERRORS +The +.Fn killpg +function +will fail and no signal will be sent if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa sig +argument +is not a valid signal number. +.It Bq Er EPERM +The sending process is not the super-user and one or more +of the target processes has an effective user ID different from that +of the sending process. +.It Bq Er ESRCH +No process can be found in the process group specified by +.Fa pgrp . +.It Bq Er ESRCH +The process group was given as 0 +but the sending process does not have a process group. +.El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/types.h +is necessary. +.Sh SEE ALSO +.Xr getpgrp 2 , +.Xr kill 2 , +.Xr sigaction 2 , +.Xr compat 5 +.Sh HISTORY +The +.Fn killpg +function appeared in +.Bx 4.0 . diff --git a/compat-43/FreeBSD/killpg.c b/compat-43/FreeBSD/killpg.c new file mode 100644 index 0000000..d66425b --- /dev/null +++ b/compat-43/FreeBSD/killpg.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/compat-43/killpg.c,v 1.5 2007/01/09 00:27:49 imp Exp $"); + +#include +#include +#include + +int __kill(pid_t pid, int sig, int posix); + +#if __DARWIN_UNIX03 +#define _PID1ERR EPERM +#define _POSIXKILL 1 +#else /* !__DARWIN_UNIX03 */ +#define _PID1ERR ESRCH +#define _POSIXKILL 0 +#endif /* !__DARWIN_UNIX03 */ + +/* + * Backwards-compatible killpg(). + */ +int +killpg(pid_t pgid, int sig) +{ + if (pgid == 1) { + errno = _PID1ERR; + return (-1); + } + return (__kill(-pgid, sig, _POSIXKILL)); +} diff --git a/compat-43/FreeBSD/sethostid.c b/compat-43/FreeBSD/sethostid.c new file mode 100644 index 0000000..8f36a98 --- /dev/null +++ b/compat-43/FreeBSD/sethostid.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sethostid.c 8.1 (Berkeley) 6/2/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/compat-43/sethostid.c,v 1.5 2007/01/09 00:27:49 imp Exp $"); + +#include +#include + +#include + +void +sethostid(long hostid) +{ + int mib[2]; + + mib[0] = CTL_KERN; + mib[1] = KERN_HOSTID; + sysctl(mib, 2, NULL, NULL, &hostid, sizeof hostid); +} diff --git a/compat-43/FreeBSD/setpgrp.c b/compat-43/FreeBSD/setpgrp.c new file mode 100644 index 0000000..ebed79a --- /dev/null +++ b/compat-43/FreeBSD/setpgrp.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setpgrp.c 8.1 (Berkeley) 6/2/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/compat-43/setpgrp.c,v 1.5 2007/01/09 00:27:49 imp Exp $"); + +#include +#include + +/* UNIX03 only */ +pid_t +setpgrp(void) +{ + pid_t pgid = getpgrp(); + pid_t pid = getpid(); + if (pgid != pid) + setpgid(pid, pid); + return pid; +} diff --git a/compat-43/FreeBSD/setrgid.c b/compat-43/FreeBSD/setrgid.c new file mode 100644 index 0000000..94e57ec --- /dev/null +++ b/compat-43/FreeBSD/setrgid.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setrgid.c 8.1 (Berkeley) 6/2/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/compat-43/setrgid.c,v 1.4 2007/01/09 00:27:49 imp Exp $"); + +#include + +int +setrgid(gid_t rgid) +{ + + return (setregid(rgid, -1)); +} diff --git a/compat-43/FreeBSD/setruid.3 b/compat-43/FreeBSD/setruid.3 new file mode 100644 index 0000000..f738d3c --- /dev/null +++ b/compat-43/FreeBSD/setruid.3 @@ -0,0 +1,80 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)setruid.3 8.1 (Berkeley) 6/2/93 +.\" $FreeBSD: src/lib/libc/compat-43/setruid.3,v 1.12 2007/01/09 00:27:49 imp Exp $ +.\" +.Dd June 2, 1993 +.Dt SETRUID 3 +.Os +.Sh NAME +.Nm setruid , +.Nm setrgid +.Nd set user and group ID +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn setruid "uid_t ruid" +.Ft int +.Fn setrgid "gid_t rgid" +.Sh DESCRIPTION +The +.Fn setruid +function +.Pq Fn setrgid +sets the real user ID (group ID) of the +current process. +.Sh RETURN VALUES +.Rv -std +.Sh COMPATIBILITY +The use of these calls is not portable. +Their use is discouraged; they will be removed in the future. +.Sh ERRORS +The functions fail if: +.Bl -tag -width Er +.It Bq Er EPERM +The user is not the super user and the ID +specified is not the real or effective ID. +.El +.Sh SEE ALSO +.Xr getgid 2 , +.Xr getuid 2 , +.Xr setegid 2 , +.Xr seteuid 2 , +.Xr setgid 2 , +.Xr setuid 2 +.Sh HISTORY +The +.Fn setruid +and +.Fn setrgid +syscalls appeared in +.Bx 4.2 +and were dropped in +.Bx 4.4 . diff --git a/compat-43/FreeBSD/setruid.c b/compat-43/FreeBSD/setruid.c new file mode 100644 index 0000000..1a2a5c8 --- /dev/null +++ b/compat-43/FreeBSD/setruid.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setruid.c 8.1 (Berkeley) 6/2/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/compat-43/setruid.c,v 1.4 2007/01/09 00:27:49 imp Exp $"); + +#include + +int +setruid(uid_t ruid) +{ + + return (setreuid(ruid, -1)); +} diff --git a/compat-43/setregid.c b/compat-43/setregid.c new file mode 100644 index 0000000..e782d0b --- /dev/null +++ b/compat-43/setregid.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include + +int +setregid(rgid, egid) + gid_t rgid, egid; +{ + static gid_t savedgid = -1; + + if (savedgid == -1) + savedgid = getegid(); + /* + * we assume that the intent here is to be able to + * get back rgid priviledge. So we make sure that + * we will be able to do so, but do not actually + * set the rgid. + */ + if (rgid != -1 && rgid != getgid() && rgid != savedgid) { + errno = EPERM; + return (-1); + } + if (egid != -1 && setegid(egid) < 0) + return (-1); + return (0); +} diff --git a/compat-43/setreuid.c b/compat-43/setreuid.c new file mode 100644 index 0000000..337829f --- /dev/null +++ b/compat-43/setreuid.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include + +int +setreuid(ruid, euid) + uid_t ruid, euid; +{ + static uid_t saveduid = -1; + + if (saveduid == -1) + saveduid = geteuid(); + /* + * we assume that the intent here is to be able to + * get back ruid priviledge. So we make sure that + * we will be able to do so, but do not actually + * set the ruid. + */ + if (ruid != -1 && ruid != getuid() && ruid != saveduid) { + errno = EPERM; + return (-1); + } + if (euid != -1 && seteuid(euid) < 0) + return (-1); + return (0); +} diff --git a/compat-43/sigaltstk.c b/compat-43/sigaltstk.c new file mode 100644 index 0000000..968d1ac --- /dev/null +++ b/compat-43/sigaltstk.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2005, 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include + +int __sigaltstack(const stack_t * __restrict, stack_t * __restrict); + +/* UNIX03 only */ +int sigaltstack(const stack_t * __restrict nstack, stack_t * __restrict ostack) +{ + if (nstack && nstack->ss_size < MINSIGSTKSZ) { + errno = ENOMEM; + return -1; + } + return __sigaltstack(nstack, ostack); +} diff --git a/compat-43/sigblock.2 b/compat-43/sigblock.2 new file mode 100644 index 0000000..43920c7 --- /dev/null +++ b/compat-43/sigblock.2 @@ -0,0 +1,87 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)sigblock.2 8.1 (Berkeley) 6/2/93 +.\" $FreeBSD: src/lib/libc/compat-43/sigblock.2,v 1.5.2.2 2001/12/21 10:07:08 ru Exp $ +.\" +.Dd June 2, 1993 +.Dt SIGBLOCK 2 +.Os +.Sh NAME +.Nm sigblock +.Nd block signals +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.Ft int +.Fn sigblock "int mask" +.Ft int +.Fn sigmask signum +.Sh DESCRIPTION +.Bf -symbolic +This interface is made obsolete by +.Xr sigprocmask 2 . +.Ef +.Pp +.Fn Sigblock +adds the signals specified in +.Fa mask +to the set of signals currently +being blocked from delivery. +Signals are blocked if the +corresponding bit in +.Fa mask +is a 1; the macro +.Fn sigmask +is provided to construct the mask for a given +.Fa signum . +.Pp +It is not possible to block +.Dv SIGKILL +or +.Dv SIGSTOP ; +this restriction is silently +imposed by the system. +.Sh RETURN VALUES +The previous set of masked signals is returned. +.Sh SEE ALSO +.Xr kill 2 , +.Xr sigaction 2 , +.Xr sigprocmask 2 , +.Xr sigsetmask 2 , +.Xr sigsetops 3 +.Sh HISTORY +The +.Fn sigblock +function call appeared in +.Bx 4.2 +and has been deprecated. diff --git a/compat-43/sigcompat.c b/compat-43/sigcompat.c new file mode 100644 index 0000000..1e8ca39 --- /dev/null +++ b/compat-43/sigcompat.c @@ -0,0 +1,235 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if __DARWIN_UNIX03 +#ifdef VARIANT_CANCELABLE +#include +#endif /* VARIANT_CANCELABLE */ +extern int __unix_conforming; +#endif /* __DARWIN_UNIX03 */ + +#include +#include +#include + +#ifndef BUILDING_VARIANT +#if defined(__DYNAMIC__) +extern int _sigaction_nobind (int sig, const struct sigaction *nsv, struct sigaction *osv); +extern int _sigvec_nobind (int, struct sigvec *, struct sigvec *); +#endif + +static int +sigvec__(int signo, + struct sigvec *sv, + struct sigvec *osv, + int bind) +{ + int ret; + + if (sv) + sv->sv_flags ^= SV_INTERRUPT; /* !SA_INTERRUPT */ +#if defined(__DYNAMIC__) + if (bind) { +#endif + ret = sigaction(signo, (struct sigaction *)sv, (struct sigaction *)osv); +#if defined(__DYNAMIC__) + } else { + ret = _sigaction_nobind(signo, (struct sigaction *)sv, (struct sigaction *)osv); + } +#endif + if (ret == 0 && osv) + osv->sv_flags ^= SV_INTERRUPT; /* !SA_INTERRUPT */ + return (ret); +} + +int +sigvec(int signo, + struct sigvec *sv, + struct sigvec *osv) +{ + return sigvec__(signo, sv, osv, 1); +} + +#if defined(__DYNAMIC__) +int +_sigvec_nobind(int signo, + struct sigvec *sv, + struct sigvec *osv) +{ + return sigvec__(signo, sv, osv, 0); +} +#endif + +int +sigsetmask(int mask) +{ + int omask, n; + + n = sigprocmask(SIG_SETMASK, (sigset_t *) &mask, (sigset_t *) &omask); + if (n) + return (n); + return (omask); +} + +int +sigblock(int mask) +{ + int omask, n; + + n = sigprocmask(SIG_BLOCK, (sigset_t *) &mask, (sigset_t *) &omask); + if (n) + return (n); + return (omask); +} +#endif /* !BUILDING_VARIANT */ + +#if __DARWIN_UNIX03 +int +sigpause(int sig) +{ + sigset_t mask; + + if (__unix_conforming == 0) + __unix_conforming = 1; +#ifdef VARIANT_CANCELABLE + pthread_testcancel(); +#endif /* VARIANT_CANCELABLE */ + + if ((sig <= 0) || (sig >= NSIG)) { + errno = EINVAL; + return(-1); + } + if (sigprocmask(SIG_BLOCK, (sigset_t *) 0, (sigset_t *) &mask) < 0) { + return(-1); + } + sigdelset(&mask, sig); + return (sigsuspend(&mask)); +} +#else +int +sigpause(int mask) +{ + return (sigsuspend((sigset_t *)&mask)); +} +#endif /* __DARWIN_UNIX03 */ + +#ifndef BUILDING_VARIANT +int +sighold(int sig) +{ + sigset_t mask; + + if ((sig <= 0) || (sig >= NSIG)) { + errno = EINVAL; + return(-1); + } + sigemptyset(&mask); + sigaddset(&mask, sig); + return(sigprocmask(SIG_BLOCK, &mask,(sigset_t *)0)); +} + +int +sigrelse(int sig) +{ + sigset_t mask; + + if ((sig <= 0) || (sig >= NSIG)) { + errno = EINVAL; + return(-1); + } + sigemptyset(&mask); + sigaddset(&mask, sig); + return(sigprocmask(SIG_UNBLOCK, &mask,(sigset_t *)0)); +} + + +int +sigignore(int sig) +{ + return (signal(sig, SIG_IGN) == SIG_ERR ? -1 : 0); +} + +void (*sigset(int sig, void (*disp)(int)))(int) { + sigset_t omask; + int blocked; + struct sigaction oact; + + if ((sig <= 0) || (sig >= NSIG)) { + errno = EINVAL; + return (SIG_ERR); + } + if (-1 == sigprocmask(0, NULL, &omask)) + return (SIG_ERR); + blocked = sigismember(&omask, sig); + if (disp == SIG_HOLD) { + if (blocked) + return (SIG_HOLD); + if ((-1 == sigaction(sig, NULL, &oact)) || + (-1 == sighold(sig))) + return (SIG_ERR); + return (sig_t)oact.sa_handler; + } else { + if (blocked) { + if (-1 == sigrelse(sig)) + return (SIG_ERR); + } + sig_t rv = signal(sig, disp); + if (rv != SIG_ERR) + return blocked ? SIG_HOLD : rv; + else + return (rv); + } +} +#endif /* !BUILDING_VARIANT */ diff --git a/compat-43/sigpause.2 b/compat-43/sigpause.2 new file mode 100644 index 0000000..802e039 --- /dev/null +++ b/compat-43/sigpause.2 @@ -0,0 +1,89 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)sigpause.2 8.1 (Berkeley) 6/2/93 +.\" $FreeBSD: src/lib/libc/compat-43/sigpause.2,v 1.5.2.5 2001/12/14 18:33:49 ru Exp $ +.\" +.Dd June 2, 1993 +.Dt SIGPAUSE 2 +.Os +.Sh NAME +.Nm sigpause +.Nd atomically release blocked signals and wait for interrupt +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.Ft int +.Fn sigpause "int sig" +.Sh DESCRIPTION +.Sy This interface is made obsolete by +.Xr sigsuspend 2 . +.Pp +.Fn Sigpause +assigns +.Fa sig +to the set of masked signals +and then waits for a signal to arrive; +on return the set of masked signals is restored. +.Fa Sig +is usually 0, indicating that no +signals are to be blocked. +.Fn Sigpause +always terminates by being interrupted, returning -1 with +.Va errno +set to +.Er EINTR . +.Sh COMPATIBILITY +.Fn sigpause +now takes a signal value and not a mask. +This often appears as a hang in sigpause$UNIX2003 +or with +.Fn sigpause +returning with +.Va errno +set to EINVAL. +Use +.Fn sigsuspend +with signal masks. +.Sh SEE ALSO +.Xr kill 2 , +.Xr sigaction 2 , +.Xr sigblock 2 , +.Xr sigprocmask 2 , +.Xr sigsuspend 2 , +.Xr sigvec 2 +.Sh HISTORY +The +.Fn sigpause +function call appeared in +.Bx 4.2 +and has been deprecated. diff --git a/compat-43/sigsetmask.2 b/compat-43/sigsetmask.2 new file mode 100644 index 0000000..96ae7d3 --- /dev/null +++ b/compat-43/sigsetmask.2 @@ -0,0 +1,85 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)sigsetmask.2 8.1 (Berkeley) 6/2/93 +.\" $FreeBSD: src/lib/libc/compat-43/sigsetmask.2,v 1.7.2.4 2001/12/14 18:33:49 ru Exp $ +.\" +.Dd June 2, 1993 +.Dt SIGSETMASK 2 +.Os +.Sh NAME +.Nm sigsetmask +.Nd set current signal mask +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.Ft int +.Fn sigsetmask "int mask" +.Fn sigmask signum +.Sh DESCRIPTION +.Bf -symbolic +This interface is made obsolete by: +.Ef +.Xr sigprocmask 2 . +.Pp +.Fn Sigsetmask +sets the current signal mask. Signals +are blocked from delivery if the +corresponding bit in +.Fa mask +is a 1; the macro +.Fn sigmask +is provided to construct the mask for a given +.Fa signum . +.Pp +The system +quietly disallows +.Dv SIGKILL +or +.Dv SIGSTOP +to be blocked. +.Sh RETURN VALUES +The previous set of masked signals is returned. +.Sh SEE ALSO +.Xr kill 2 , +.Xr sigaction 2 , +.Xr sigblock 2 , +.Xr sigprocmask 2 , +.Xr sigsuspend 2 , +.Xr sigvec 2 , +.Xr sigsetops 3 +.Sh HISTORY +The +.Fn sigsetmask +function call appeared in +.Bx 4.2 +and has been deprecated. diff --git a/compat-43/sigvec.2 b/compat-43/sigvec.2 new file mode 100644 index 0000000..dbbcf2c --- /dev/null +++ b/compat-43/sigvec.2 @@ -0,0 +1,327 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)sigvec.2 8.2 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/compat-43/sigvec.2,v 1.9.2.7 2001/12/14 18:33:49 ru Exp $ +.\" +.Dd April 19, 1994 +.Dt SIGVEC 2 +.Os +.Sh NAME +.Nm sigvec +.Nd software signal facilities +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.Bd -literal +struct sigvec { + void (*sv_handler)(); + int sv_mask; + int sv_flags; +}; +.Ed +.Ft int +.Fn sigvec "int sig" "struct sigvec *vec" "struct sigvec *ovec" +.Sh DESCRIPTION +.Bf -symbolic +This interface is made obsolete by +.Xr sigaction 2 . +.Ef +.Pp +The system defines a set of signals that may be delivered to a process. +Signal delivery resembles the occurrence of a hardware interrupt: +the signal is blocked from further occurrence, the current process +context is saved, and a new one is built. A process may specify a +.Em handler +to which a signal is delivered, or specify that a signal is to be +.Em blocked +or +.Em ignored . +A process may also specify that a default action is to be taken +by the system when a signal occurs. +Normally, signal handlers execute on the current stack +of the process. This may be changed, on a per-handler basis, +so that signals are taken on a special +.Em "signal stack" . +.Pp +All signals have the same +.Em priority . +Signal routines execute with the signal that caused their +invocation +.Em blocked , +but other signals may yet occur. +A global +.Em "signal mask" +defines the set of signals currently blocked from delivery +to a process. The signal mask for a process is initialized +from that of its parent (normally 0). It +may be changed with a +.Xr sigblock 2 +or +.Xr sigsetmask 2 +call, or when a signal is delivered to the process. +.Pp +When a signal +condition arises for a process, the signal is added to a set of +signals pending for the process. If the signal is not currently +.Em blocked +by the process then it is delivered to the process. When a signal +is delivered, the current state of the process is saved, +a new signal mask is calculated (as described below), +and the signal handler is invoked. The call to the handler +is arranged so that if the signal handling routine returns +normally the process will resume execution in the context +from before the signal's delivery. +If the process wishes to resume in a different context, then it +must arrange to restore the previous context itself. +.Pp +When a signal is delivered to a process a new signal mask is +installed for the duration of the process' signal handler +(or until a +.Xr sigblock 2 +or +.Xr sigsetmask 2 +call is made). +This mask is formed by taking the current signal mask, +adding the signal to be delivered, and +.Em or Ns 'ing +in the signal mask associated with the handler to be invoked. +.Pp +.Fn Sigvec +assigns a handler for a specific signal. If +.Fa vec +is non-zero, it +specifies a handler routine and mask +to be used when delivering the specified signal. +Further, if the +.Dv SV_ONSTACK +bit is set in +.Fa sv_flags , +the system will deliver the signal to the process on a +.Em "signal stack" , +specified with +.Xr sigaltstack 2 . +If +.Fa ovec +is non-zero, the previous handling information for the signal +is returned to the user. +.Pp +The following is a list of all signals +with names as in the include file +.Aq Pa signal.h : +.Bl -column SIGVTALARMXX "create core imagexxx" +.It Sy "NAME Default Action Description" +.It Dv SIGHUP No " terminate process" " terminal line hangup" +.It Dv SIGINT No " terminate process" " interrupt program" +.It Dv SIGQUIT No " create core image" " quit program" +.It Dv SIGILL No " create core image" " illegal instruction" +.It Dv SIGTRAP No " create core image" " trace trap" +.It Dv SIGABRT No " create core image" Ta Xr abort 3 +call (formerly +.Dv SIGIOT ) +.It Dv SIGEMT No " create core image" " emulate instruction executed" +.It Dv SIGFPE No " create core image" " floating-point exception" +.It Dv SIGKILL No " terminate process" " kill program" +.It Dv SIGBUS No " create core image" " bus error" +.It Dv SIGSEGV No " create core image" " segmentation violation" +.It Dv SIGSYS No " create core image" " non-existent system call invoked" +.It Dv SIGPIPE No " terminate process" " write on a pipe with no reader" +.It Dv SIGALRM No " terminate process" " real-time timer expired" +.It Dv SIGTERM No " terminate process" " software termination signal" +.It Dv SIGURG No " discard signal" " urgent condition present on socket" +.It Dv SIGSTOP No " stop process" " stop (cannot be caught or ignored)" +.It Dv SIGTSTP No " stop process" " stop signal generated from keyboard" +.It Dv SIGCONT No " discard signal" " continue after stop" +.It Dv SIGCHLD No " discard signal" " child status has changed" +.It Dv SIGTTIN No " stop process" " background read attempted from control terminal" +.It Dv SIGTTOU No " stop process" " background write attempted to control terminal" +.It Dv SIGIO No " discard signal" Tn " I/O" +is possible on a descriptor (see +.Xr fcntl 2 ) +.It Dv SIGXCPU No " terminate process" " cpu time limit exceeded (see" +.Xr setrlimit 2 ) +.It Dv SIGXFSZ No " terminate process" " file size limit exceeded (see" +.Xr setrlimit 2 ) +.It Dv SIGVTALRM No " terminate process" " virtual time alarm (see" +.Xr setitimer 2 ) +.It Dv SIGPROF No " terminate process" " profiling timer alarm (see" +.Xr setitimer 2 ) +.It Dv SIGWINCH No " discard signal" " Window size change" +.It Dv SIGINFO No " discard signal" " status request from keyboard" +.It Dv SIGUSR1 No " terminate process" " User defined signal 1" +.It Dv SIGUSR2 No " terminate process" " User defined signal 2" +.El +.Pp +Once a signal handler is installed, it remains installed +until another +.Fn sigvec +call is made, or an +.Xr execve 2 +is performed. +A signal-specific default action may be reset by +setting +.Fa sv_handler +to +.Dv SIG_DFL . +The defaults are process termination, possibly with core dump; +no action; stopping the process; or continuing the process. +See the above signal list for each signal's default action. +If +.Fa sv_handler +is +.Dv SIG_IGN +current and pending instances +of the signal are ignored and discarded. +.Pp +If a signal is caught during the system calls listed below, +the call is normally restarted. +The call can be forced to terminate prematurely with an +.Er EINTR +error return by setting the +.Dv SV_INTERRUPT +bit in +.Fa sv_flags . +The affected system calls include +.Xr read 2 , +.Xr write 2 , +.Xr sendto 2 , +.Xr recvfrom 2 , +.Xr sendmsg 2 +and +.Xr recvmsg 2 +on a communications channel or a slow device (such as a terminal, +but not a regular file) +and during a +.Xr wait 2 +or +.Xr ioctl 2 . +However, calls that have already committed are not restarted, +but instead return a partial success (for example, a short read count). +.Pp +After a +.Xr fork 2 +or +.Xr vfork 2 +all signals, the signal mask, the signal stack, +and the restart/interrupt flags are inherited by the child. +.Pp +.Xr Execve 2 +reinstates the default +action for all signals which were caught and +resets all signals to be caught on the user stack. +Ignored signals remain ignored; +the signal mask remains the same; +signals that interrupt system calls continue to do so. +.Sh NOTES +The mask specified in +.Fa vec +is not allowed to block +.Dv SIGKILL +or +.Dv SIGSTOP . +This is done silently by the system. +.Pp +The +.Dv SV_INTERRUPT +flag is not available in +.Bx 4.2 , +hence it should not be used if backward compatibility is needed. +.Sh RETURN VALUES +.Rv -std sigvec +.Sh ERRORS +.Fn Sigvec +will fail and no new signal handler will be installed if one +of the following occurs: +.Bl -tag -width Er +.It Bq Er EFAULT +Either +.Fa vec +or +.Fa ovec +points to memory that is not a valid part of the process +address space. +.It Bq Er EINVAL +.Fa Sig +is not a valid signal number. +.It Bq Er EINVAL +An attempt is made to ignore or supply a handler for +.Dv SIGKILL +or +.Dv SIGSTOP . +.El +.Sh SEE ALSO +.Xr kill 1 , +.Xr kill 2 , +.Xr ptrace 2 , +.Xr sigaction 2 , +.Xr sigaltstack 2 , +.Xr sigblock 2 , +.Xr sigpause 2 , +.Xr sigprocmask 2 , +.Xr sigsetmask 2 , +.Xr sigsuspend 2 , +.Xr setjmp 3 , +.Xr siginterrupt 3 , +.Xr signal 3 , +.Xr sigsetops 3 , +.Xr tty 4 +.Sh EXAMPLES +On the +.Tn VAX\-11 +The handler routine can be declared: +.Bd -literal -offset indent +void handler(sig, code, scp) +int sig, code; +struct sigcontext *scp; +.Ed +.Pp +Here +.Fa sig +is the signal number, into which the hardware faults and traps are +mapped as defined below. +.Fa Code +is a parameter that is either a constant +as given below or, for compatibility mode faults, the code provided by +the hardware (Compatibility mode faults are distinguished from the +other +.Dv SIGILL +traps by having +.Dv PSL_CM +set in the psl). +.Fa Scp +is a pointer to the +.Fa sigcontext +structure (defined in +.Aq Pa signal.h ) , +used to restore the context from before the signal. +.Sh BUGS +This manual page is still confusing. diff --git a/darling-scripts/generate-derived.sh b/darling-scripts/generate-derived.sh new file mode 100755 index 0000000..5d0ee74 --- /dev/null +++ b/darling-scripts/generate-derived.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -x + +pushd $(dirname "$0") > /dev/null +SCRIPTDIR=$(pwd -P) +popd > /dev/null + +export SRCROOT="$SCRIPTDIR/.." +export ARCHS="x86_64 i386 arm64 arm ppc" +export DERIVED_FILES_DIR="$SRCROOT/derived" +export VARIANT_PLATFORM_NAME="macosx" + +$SRCROOT/xcodescripts/generate_features.pl diff --git a/darling-scripts/replace-libc-comments.sh b/darling-scripts/replace-libc-comments.sh new file mode 100755 index 0000000..4ba6033 --- /dev/null +++ b/darling-scripts/replace-libc-comments.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -x + +pushd $(dirname "$0") > /dev/null +SCRIPTDIR=$(pwd -P) +popd > /dev/null + +SRCROOT="$SCRIPTDIR/.." + +pushd "${SRCROOT}/include" +for i in `find . -name \*.h -print0 | xargs -0 grep -l '^//Begin-Libc'`; do + mkdir -p "../private-include/$(dirname $i)" + cp "$i" "../private-include/$i" + ed - "$i" < "${SRCROOT}/xcodescripts/strip-header.ed" + #sed -i '' -e 's/\/\/Begin-Libc/\#ifdef BUILDING_LIBC/g; s/\/\/End-Libc/\#endif \/\/ BUILDING_LIBC/g' "$i" +done +popd diff --git a/darwin/CMakeLists.txt b/darwin/CMakeLists.txt new file mode 100644 index 0000000..d89e456 --- /dev/null +++ b/darwin/CMakeLists.txt @@ -0,0 +1,13 @@ +project(libc-darwin) + +cmake_minimum_required(VERSION 3.10) + +set(darwin_sources + atexit_receipt.c + compatibility_hacks.c + forceLibcToBuild.c + kvm.c + darling_hacks.c +) + +add_darling_object_library(libc-darwin ${darwin_sources}) diff --git a/darwin/atexit_receipt.c b/darwin/atexit_receipt.c new file mode 100644 index 0000000..62bde8b --- /dev/null +++ b/darwin/atexit_receipt.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + diff --git a/darwin/compatibility_hacks.c b/darwin/compatibility_hacks.c new file mode 100644 index 0000000..805aa2e --- /dev/null +++ b/darwin/compatibility_hacks.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#include + +#if !TARGET_OS_IPHONE && !TARGET_OS_DRIVERKIT + +#define WEAK_SYMBOL_LD_CMD(sym, version) \ + __asm__(".section __TEXT,__const\n\t" \ + ".globl $ld$weak$os" #version "$_" #sym "\n\t" \ + "$ld$weak$os" #version "$_" #sym ":\n\t" \ + " .byte 0\n\t" \ + ".previous") + +#define ADDED_IN_10_12(sym) WEAK_SYMBOL_LD_CMD(sym, 10.11) +#define ADDED_IN_10_13(sym) WEAK_SYMBOL_LD_CMD(sym, 10.12) + +ADDED_IN_10_12(getentropy); + +ADDED_IN_10_12(clock_getres); +ADDED_IN_10_12(clock_gettime); +ADDED_IN_10_12(clock_settime); + +ADDED_IN_10_12(basename_r); +ADDED_IN_10_12(dirname_r); + +ADDED_IN_10_12(mkostemp); +ADDED_IN_10_12(mkostemps); + +ADDED_IN_10_12(timingsafe_bcmp); + +ADDED_IN_10_13(utimensat); + +#endif /* TARGET_OS_IPHONE */ diff --git a/darwin/darling_hacks.c b/darwin/darling_hacks.c new file mode 100644 index 0000000..eb63489 --- /dev/null +++ b/darwin/darling_hacks.c @@ -0,0 +1,8 @@ +#include +#include + +typedef float __attribute__((ext_vector_type(4))) simd_float4; +typedef struct { simd_float4 columns[4]; } simd_float4x4; + +// TODO +simd_float4x4 matrix_identity_float4x4; diff --git a/darwin/forceLibcToBuild.c b/darwin/forceLibcToBuild.c new file mode 100644 index 0000000..9b0b97c --- /dev/null +++ b/darwin/forceLibcToBuild.c @@ -0,0 +1,6 @@ +// XCode will not build a library unless it contains at least one module. +// Absent this requirement, libm.dylib would be composed entirely by linking +// the component static libraries together, but to satisfy it, we must have +// a C file. + +typedef int theCStandardDoesNotAllowAnEmptyModule; diff --git a/darwin/kvm.c b/darwin/kvm.c new file mode 100644 index 0000000..60ba30b --- /dev/null +++ b/darwin/kvm.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include + +int +kvm_close(void* kd) +{ + return (0); +} + +char** +kvm_getargv(void* kd, const void* p, int nchr) +{ + return (0); +} + +char** +kvm_getenvv(void* kd, const void* p, int nchr) +{ + return (0); +} + +char* +kvm_geterr(void* kd) +{ + return (0); +} + +int +kvm_getloadavg(void* kd, double loadagv[], int nelem) +{ + return (-1); +} + +char* +kvm_getfiles(void* kd, int op, int arg, int* cnt) +{ + if (cnt) *cnt = 0; + return (0); +} + +void* +kvm_getprocs(void* kd, int op, int arg, int* cnt) +{ + if (cnt) *cnt = 0; + return (0); +} + +int +kvm_nlist(void* kd, void* nl) +{ + return (-1); +} + +void* +kvm_open(const char* execfile, const char* corefile, const char* swapfile, int flags, const char* errstr) +{ + fprintf(stderr, "%s%s/dev/mem: No such file or directory", errstr ? errstr : "", errstr ? ": " : ""); + return (0); +} + +void* +kvm_openfiles(const char* execfile, const char* corefile, const char* swapfile, int flags, char* errout) +{ + if (errout) strcpy(errout, "/dev/mem: No such file or directory"); + return (0); +} + +int +kvm_read(void* kd, unsigned long addr, void* buf, unsigned int nbytes) +{ + return (-1); +} + +int +kvm_uread(void* kd, void* p, unsigned long uva, void* buf, size_t len) +{ + return (0); +} + +int +kvm_write(void* kd, unsigned long addr, const void* buf, unsigned int nbytes) +{ + return (0); +} diff --git a/darwin/libc_private.h b/darwin/libc_private.h new file mode 100644 index 0000000..6214528 --- /dev/null +++ b/darwin/libc_private.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBC_PRIVATE_H__ +#define __LIBC_PRIVATE_H__ + +#include +#include +#include + +__BEGIN_DECLS + +struct _libc_functions { + unsigned long version; + void (*atfork_prepare)(void); // version 1 + void (*atfork_parent)(void); // version 1 + void (*atfork_child)(void); // version 1 + char *(*dirhelper)(int, char *, size_t); // version 1 +}; + +struct ProgramVars; // forward reference + +__deprecated_msg("use _libc_initializer()") +extern void +__libc_init(const struct ProgramVars *vars, + void (*atfork_prepare)(void), + void (*atfork_parent)(void), + void (*atfork_child)(void), + const char *apple[]); + +__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) +extern void +_libc_initializer(const struct _libc_functions *funcs, + const char *envp[], + const char *apple[], + const struct ProgramVars *vars); + +extern void +_libc_fork_child(void); + +extern int +_atexit_receipt(void); + +__IOS_AVAILABLE(9.0) __OSX_AVAILABLE(10.11) +extern void +abort_report_np(const char *, ...) __dead2 __cold __printflike(1, 2); + +__END_DECLS + +#endif // __LIBC_PRIVATE_H__ diff --git a/db/CMakeLists.txt b/db/CMakeLists.txt new file mode 100644 index 0000000..9107de4 --- /dev/null +++ b/db/CMakeLists.txt @@ -0,0 +1,48 @@ +project(libc-db) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") + +add_definitions(-D__DBINTERFACE_PRIVATE) + +set(db_sources btree/FreeBSD/bt_close.c + btree/FreeBSD/bt_conv.c + btree/FreeBSD/bt_debug.c + btree/FreeBSD/bt_delete.c + btree/FreeBSD/bt_get.c + btree/FreeBSD/bt_open.c + btree/FreeBSD/bt_overflow.c + btree/FreeBSD/bt_page.c + btree/FreeBSD/bt_put.c + btree/FreeBSD/bt_search.c + btree/FreeBSD/bt_seq.c + btree/FreeBSD/bt_split.c + btree/FreeBSD/bt_utils.c) + +set(db_sources ${db_sources} + db/FreeBSD/db.c + mpool/FreeBSD/mpool.c) + +set(db_sources ${db_sources} + hash/FreeBSD/hash_bigkey.c + hash/FreeBSD/hash_buf.c + hash/FreeBSD/hash.c + hash/FreeBSD/hash_func.c + hash/FreeBSD/hash_log2.c + hash/FreeBSD/hash_page.c + hash/FreeBSD/ndbm.c) + +set(db_sources ${db_sources} + recno/FreeBSD/rec_close.c + recno/FreeBSD/rec_delete.c + recno/FreeBSD/rec_get.c + recno/FreeBSD/rec_open.c + recno/FreeBSD/rec_put.c + recno/FreeBSD/rec_search.c + recno/FreeBSD/rec_seq.c + recno/FreeBSD/rec_utils.c) + +add_darling_object_library(libc-db ${db_sources}) + diff --git a/db/btree/FreeBSD/bt_close.c b/db/btree/FreeBSD/bt_close.c new file mode 100644 index 0000000..89359b5 --- /dev/null +++ b/db/btree/FreeBSD/bt_close.c @@ -0,0 +1,178 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_close.c 8.7 (Berkeley) 8/17/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_close.c,v 1.10 2009/03/02 23:47:18 delphij Exp $"); + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include +#include "btree.h" + +static int bt_meta(BTREE *); + +/* + * BT_CLOSE -- Close a btree. + * + * Parameters: + * dbp: pointer to access method + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__bt_close(DB *dbp) +{ + BTREE *t; + int fd; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* Sync the tree. */ + if (__bt_sync(dbp, 0) == RET_ERROR) + return (RET_ERROR); + + /* Close the memory pool. */ + if (mpool_close(t->bt_mp) == RET_ERROR) + return (RET_ERROR); + + /* Free random memory. */ + if (t->bt_cursor.key.data != NULL) { + free(t->bt_cursor.key.data); + t->bt_cursor.key.size = 0; + t->bt_cursor.key.data = NULL; + } + if (t->bt_rkey.data) { + free(t->bt_rkey.data); + t->bt_rkey.size = 0; + t->bt_rkey.data = NULL; + } + if (t->bt_rdata.data) { + free(t->bt_rdata.data); + t->bt_rdata.size = 0; + t->bt_rdata.data = NULL; + } + + fd = t->bt_fd; + free(t); + free(dbp); + return (_close(fd) ? RET_ERROR : RET_SUCCESS); +} + +/* + * BT_SYNC -- sync the btree to disk. + * + * Parameters: + * dbp: pointer to access method + * + * Returns: + * RET_SUCCESS, RET_ERROR. + */ +int +__bt_sync(const DB *dbp, u_int flags) +{ + BTREE *t; + int status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* Sync doesn't currently take any flags. */ + if (flags != 0) { + errno = EINVAL; + return (RET_ERROR); + } + + if (F_ISSET(t, B_INMEM | B_RDONLY) || !F_ISSET(t, B_MODIFIED)) + return (RET_SUCCESS); + + if (F_ISSET(t, B_METADIRTY) && bt_meta(t) == RET_ERROR) + return (RET_ERROR); + + if ((status = mpool_sync(t->bt_mp)) == RET_SUCCESS) + F_CLR(t, B_MODIFIED); + + return (status); +} + +/* + * BT_META -- write the tree meta data to disk. + * + * Parameters: + * t: tree + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +static int +bt_meta(BTREE *t) +{ + BTMETA m; + void *p; + + if ((p = mpool_get(t->bt_mp, P_META, 0)) == NULL) + return (RET_ERROR); + + /* Fill in metadata. */ + m.magic = BTREEMAGIC; + m.version = BTREEVERSION; + m.psize = t->bt_psize; + m.free = t->bt_free; + m.nrecs = t->bt_nrecs; + m.flags = F_ISSET(t, SAVEMETA); + + memmove(p, &m, sizeof(BTMETA)); + mpool_put(t->bt_mp, p, MPOOL_DIRTY); + return (RET_SUCCESS); +} diff --git a/db/btree/FreeBSD/bt_conv.c b/db/btree/FreeBSD/bt_conv.c new file mode 100644 index 0000000..3774ed4 --- /dev/null +++ b/db/btree/FreeBSD/bt_conv.c @@ -0,0 +1,212 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_conv.c 8.5 (Berkeley) 8/17/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_conv.c,v 1.4 2009/03/02 23:47:18 delphij Exp $"); + +#include + +#include + +#include +#include "btree.h" + +static void mswap(PAGE *); + +/* + * __BT_BPGIN, __BT_BPGOUT -- + * Convert host-specific number layout to/from the host-independent + * format stored on disk. + * + * Parameters: + * t: tree + * pg: page number + * h: page to convert + */ +void +__bt_pgin(void *t, pgno_t pg, void *pp) +{ + PAGE *h; + indx_t i, top; + u_char flags; + char *p; + + if (!F_ISSET(((BTREE *)t), B_NEEDSWAP)) + return; + if (pg == P_META) { + mswap(pp); + return; + } + + h = pp; + M_32_SWAP(h->pgno); + M_32_SWAP(h->prevpg); + M_32_SWAP(h->nextpg); + M_32_SWAP(h->flags); + M_16_SWAP(h->lower); + M_16_SWAP(h->upper); + + top = NEXTINDEX(h); + if ((h->flags & P_TYPE) == P_BINTERNAL) + for (i = 0; i < top; i++) { + M_16_SWAP(h->linp[i]); + p = (char *)GETBINTERNAL(h, i); + P_32_SWAP(p); + p += sizeof(u_int32_t); + P_32_SWAP(p); + p += sizeof(pgno_t); + if (*(u_char *)p & P_BIGKEY) { + p += sizeof(u_char); + P_32_SWAP(p); + p += sizeof(pgno_t); + P_32_SWAP(p); + } + } + else if ((h->flags & P_TYPE) == P_BLEAF) + for (i = 0; i < top; i++) { + M_16_SWAP(h->linp[i]); + p = (char *)GETBLEAF(h, i); + P_32_SWAP(p); + p += sizeof(u_int32_t); + P_32_SWAP(p); + p += sizeof(u_int32_t); + flags = *(u_char *)p; + if (flags & (P_BIGKEY | P_BIGDATA)) { + p += sizeof(u_char); + if (flags & P_BIGKEY) { + P_32_SWAP(p); + p += sizeof(pgno_t); + P_32_SWAP(p); + } + if (flags & P_BIGDATA) { + p += sizeof(u_int32_t); + P_32_SWAP(p); + p += sizeof(pgno_t); + P_32_SWAP(p); + } + } + } +} + +void +__bt_pgout(void *t, pgno_t pg, void *pp) +{ + PAGE *h; + indx_t i, top; + u_char flags; + char *p; + + if (!F_ISSET(((BTREE *)t), B_NEEDSWAP)) + return; + if (pg == P_META) { + mswap(pp); + return; + } + + h = pp; + top = NEXTINDEX(h); + if ((h->flags & P_TYPE) == P_BINTERNAL) + for (i = 0; i < top; i++) { + p = (char *)GETBINTERNAL(h, i); + P_32_SWAP(p); + p += sizeof(u_int32_t); + P_32_SWAP(p); + p += sizeof(pgno_t); + if (*(u_char *)p & P_BIGKEY) { + p += sizeof(u_char); + P_32_SWAP(p); + p += sizeof(pgno_t); + P_32_SWAP(p); + } + M_16_SWAP(h->linp[i]); + } + else if ((h->flags & P_TYPE) == P_BLEAF) + for (i = 0; i < top; i++) { + p = (char *)GETBLEAF(h, i); + P_32_SWAP(p); + p += sizeof(u_int32_t); + P_32_SWAP(p); + p += sizeof(u_int32_t); + flags = *(u_char *)p; + if (flags & (P_BIGKEY | P_BIGDATA)) { + p += sizeof(u_char); + if (flags & P_BIGKEY) { + P_32_SWAP(p); + p += sizeof(pgno_t); + P_32_SWAP(p); + } + if (flags & P_BIGDATA) { + p += sizeof(u_int32_t); + P_32_SWAP(p); + p += sizeof(pgno_t); + P_32_SWAP(p); + } + } + M_16_SWAP(h->linp[i]); + } + + M_32_SWAP(h->pgno); + M_32_SWAP(h->prevpg); + M_32_SWAP(h->nextpg); + M_32_SWAP(h->flags); + M_16_SWAP(h->lower); + M_16_SWAP(h->upper); +} + +/* + * MSWAP -- Actually swap the bytes on the meta page. + * + * Parameters: + * p: page to convert + */ +static void +mswap(PAGE *pg) +{ + char *p; + + p = (char *)pg; + P_32_SWAP(p); /* magic */ + p += sizeof(u_int32_t); + P_32_SWAP(p); /* version */ + p += sizeof(u_int32_t); + P_32_SWAP(p); /* psize */ + p += sizeof(u_int32_t); + P_32_SWAP(p); /* free */ + p += sizeof(u_int32_t); + P_32_SWAP(p); /* nrecs */ + p += sizeof(u_int32_t); + P_32_SWAP(p); /* flags */ + p += sizeof(u_int32_t); +} diff --git a/db/btree/FreeBSD/bt_debug.c b/db/btree/FreeBSD/bt_debug.c new file mode 100644 index 0000000..fa0481b --- /dev/null +++ b/db/btree/FreeBSD/bt_debug.c @@ -0,0 +1,322 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_debug.c 8.5 (Berkeley) 8/17/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_debug.c,v 1.6 2009/03/23 23:22:09 delphij Exp $"); + +#include + +#include +#include +#include + +#include +#include "btree.h" + +#ifdef DEBUG +/* + * BT_DUMP -- Dump the tree + * + * Parameters: + * dbp: pointer to the DB + */ +void +__bt_dump(DB *dbp) +{ + BTREE *t; + PAGE *h; + pgno_t i; + char *sep; + + t = dbp->internal; + (void)fprintf(stderr, "%s: pgsz %u", + F_ISSET(t, B_INMEM) ? "memory" : "disk", t->bt_psize); + if (F_ISSET(t, R_RECNO)) + (void)fprintf(stderr, " keys %u", t->bt_nrecs); +#undef X +#define X(flag, name) \ + if (F_ISSET(t, flag)) { \ + (void)fprintf(stderr, "%s%s", sep, name); \ + sep = ", "; \ + } + if (t->flags != 0) { + sep = " flags ("; + X(R_FIXLEN, "FIXLEN"); + X(B_INMEM, "INMEM"); + X(B_NODUPS, "NODUPS"); + X(B_RDONLY, "RDONLY"); + X(R_RECNO, "RECNO"); + X(B_METADIRTY,"METADIRTY"); + (void)fprintf(stderr, ")\n"); + } +#undef X + + for (i = P_ROOT; (h = mpool_get(t->bt_mp, i, 0)) != NULL; ++i) { + __bt_dpage(h); + (void)mpool_put(t->bt_mp, h, 0); + } +} + +/* + * BT_DMPAGE -- Dump the meta page + * + * Parameters: + * h: pointer to the PAGE + */ +void +__bt_dmpage(PAGE *h) +{ + BTMETA *m; + char *sep; + + m = (BTMETA *)h; + (void)fprintf(stderr, "magic %x\n", m->magic); + (void)fprintf(stderr, "version %u\n", m->version); + (void)fprintf(stderr, "psize %u\n", m->psize); + (void)fprintf(stderr, "free %u\n", m->free); + (void)fprintf(stderr, "nrecs %u\n", m->nrecs); + (void)fprintf(stderr, "flags %u", m->flags); +#undef X +#define X(flag, name) \ + if (m->flags & flag) { \ + (void)fprintf(stderr, "%s%s", sep, name); \ + sep = ", "; \ + } + if (m->flags) { + sep = " ("; + X(B_NODUPS, "NODUPS"); + X(R_RECNO, "RECNO"); + (void)fprintf(stderr, ")"); + } +} + +/* + * BT_DNPAGE -- Dump the page + * + * Parameters: + * n: page number to dump. + */ +void +__bt_dnpage(DB *dbp, pgno_t pgno) +{ + BTREE *t; + PAGE *h; + + t = dbp->internal; + if ((h = mpool_get(t->bt_mp, pgno, 0)) != NULL) { + __bt_dpage(h); + (void)mpool_put(t->bt_mp, h, 0); + } +} + +/* + * BT_DPAGE -- Dump the page + * + * Parameters: + * h: pointer to the PAGE + */ +void +__bt_dpage(PAGE *h) +{ + BINTERNAL *bi; + BLEAF *bl; + RINTERNAL *ri; + RLEAF *rl; + indx_t cur, top; + char *sep; + + (void)fprintf(stderr, " page %u: (", h->pgno); +#undef X +#define X(flag, name) \ + if (h->flags & flag) { \ + (void)fprintf(stderr, "%s%s", sep, name); \ + sep = ", "; \ + } + sep = ""; + X(P_BINTERNAL, "BINTERNAL") /* types */ + X(P_BLEAF, "BLEAF") + X(P_RINTERNAL, "RINTERNAL") /* types */ + X(P_RLEAF, "RLEAF") + X(P_OVERFLOW, "OVERFLOW") + X(P_PRESERVE, "PRESERVE"); + (void)fprintf(stderr, ")\n"); +#undef X + + (void)fprintf(stderr, "\tprev %2u next %2u", h->prevpg, h->nextpg); + if (h->flags & P_OVERFLOW) + return; + + top = NEXTINDEX(h); + (void)fprintf(stderr, " lower %3d upper %3d nextind %d\n", + h->lower, h->upper, top); + for (cur = 0; cur < top; cur++) { + (void)fprintf(stderr, "\t[%03d] %4d ", cur, h->linp[cur]); + switch (h->flags & P_TYPE) { + case P_BINTERNAL: + bi = GETBINTERNAL(h, cur); + (void)fprintf(stderr, + "size %03d pgno %03d", bi->ksize, bi->pgno); + if (bi->flags & P_BIGKEY) + (void)fprintf(stderr, " (indirect)"); + else if (bi->ksize) + (void)fprintf(stderr, + " {%.*s}", (int)bi->ksize, bi->bytes); + break; + case P_RINTERNAL: + ri = GETRINTERNAL(h, cur); + (void)fprintf(stderr, "entries %03d pgno %03d", + ri->nrecs, ri->pgno); + break; + case P_BLEAF: + bl = GETBLEAF(h, cur); + if (bl->flags & P_BIGKEY) + (void)fprintf(stderr, + "big key page %u size %u/", + *(pgno_t *)bl->bytes, + *(u_int32_t *)(bl->bytes + sizeof(pgno_t))); + else if (bl->ksize) + (void)fprintf(stderr, "%.*s/", + bl->ksize, bl->bytes); + if (bl->flags & P_BIGDATA) + (void)fprintf(stderr, + "big data page %u size %u", + *(pgno_t *)(bl->bytes + bl->ksize), + *(u_int32_t *)(bl->bytes + bl->ksize + + sizeof(pgno_t))); + else if (bl->dsize) + (void)fprintf(stderr, "%.*s", + (int)bl->dsize, bl->bytes + bl->ksize); + break; + case P_RLEAF: + rl = GETRLEAF(h, cur); + if (rl->flags & P_BIGDATA) + (void)fprintf(stderr, + "big data page %u size %u", + *(pgno_t *)rl->bytes, + *(u_int32_t *)(rl->bytes + sizeof(pgno_t))); + else if (rl->dsize) + (void)fprintf(stderr, + "%.*s", (int)rl->dsize, rl->bytes); + break; + } + (void)fprintf(stderr, "\n"); + } +} +#endif + +#ifdef STATISTICS +/* + * BT_STAT -- Gather/print the tree statistics + * + * Parameters: + * dbp: pointer to the DB + */ +void +__bt_stat(DB *dbp) +{ + extern u_long bt_cache_hit, bt_cache_miss, bt_pfxsaved, bt_rootsplit; + extern u_long bt_sortsplit, bt_split; + BTREE *t; + PAGE *h; + pgno_t i, pcont, pinternal, pleaf; + u_long ifree, lfree, nkeys; + int levels; + + t = dbp->internal; + pcont = pinternal = pleaf = 0; + nkeys = ifree = lfree = 0; + for (i = P_ROOT; (h = mpool_get(t->bt_mp, i, 0)) != NULL; ++i) { + switch (h->flags & P_TYPE) { + case P_BINTERNAL: + case P_RINTERNAL: + ++pinternal; + ifree += h->upper - h->lower; + break; + case P_BLEAF: + case P_RLEAF: + ++pleaf; + lfree += h->upper - h->lower; + nkeys += NEXTINDEX(h); + break; + case P_OVERFLOW: + ++pcont; + break; + } + (void)mpool_put(t->bt_mp, h, 0); + } + + /* Count the levels of the tree. */ + for (i = P_ROOT, levels = 0 ;; ++levels) { + h = mpool_get(t->bt_mp, i, 0); + if (h->flags & (P_BLEAF|P_RLEAF)) { + if (levels == 0) + levels = 1; + (void)mpool_put(t->bt_mp, h, 0); + break; + } + i = F_ISSET(t, R_RECNO) ? + GETRINTERNAL(h, 0)->pgno : + GETBINTERNAL(h, 0)->pgno; + (void)mpool_put(t->bt_mp, h, 0); + } + + (void)fprintf(stderr, "%d level%s with %lu keys", + levels, levels == 1 ? "" : "s", nkeys); + if (F_ISSET(t, R_RECNO)) + (void)fprintf(stderr, " (%u header count)", t->bt_nrecs); + (void)fprintf(stderr, + "\n%u pages (leaf %u, internal %u, overflow %u)\n", + pinternal + pleaf + pcont, pleaf, pinternal, pcont); + (void)fprintf(stderr, "%lu cache hits, %lu cache misses\n", + bt_cache_hit, bt_cache_miss); + (void)fprintf(stderr, "%lu splits (%lu root splits, %lu sort splits)\n", + bt_split, bt_rootsplit, bt_sortsplit); + pleaf *= t->bt_psize - BTDATAOFF; + if (pleaf) + (void)fprintf(stderr, + "%.0f%% leaf fill (%lu bytes used, %lu bytes free)\n", + ((double)(pleaf - lfree) / pleaf) * 100, + pleaf - lfree, lfree); + pinternal *= t->bt_psize - BTDATAOFF; + if (pinternal) + (void)fprintf(stderr, + "%.0f%% internal fill (%lu bytes used, %lu bytes free\n", + ((double)(pinternal - ifree) / pinternal) * 100, + pinternal - ifree, ifree); + if (bt_pfxsaved) + (void)fprintf(stderr, "prefix checking removed %lu bytes.\n", + bt_pfxsaved); +} +#endif diff --git a/db/btree/FreeBSD/bt_delete.c b/db/btree/FreeBSD/bt_delete.c new file mode 100644 index 0000000..1289b72 --- /dev/null +++ b/db/btree/FreeBSD/bt_delete.c @@ -0,0 +1,635 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_delete.c 8.13 (Berkeley) 7/28/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_delete.c,v 1.6 2009/03/04 00:58:04 delphij Exp $"); + +#include + +#include +#include +#include + +#include +#include "btree.h" + +static int __bt_bdelete(BTREE *, const DBT *); +static int __bt_curdel(BTREE *, const DBT *, PAGE *, u_int); +static int __bt_pdelete(BTREE *, PAGE *); +static int __bt_relink(BTREE *, PAGE *); +static int __bt_stkacq(BTREE *, PAGE **, CURSOR *); + +/* + * __bt_delete + * Delete the item(s) referenced by a key. + * + * Return RET_SPECIAL if the key is not found. + */ +int +__bt_delete(const DB *dbp, const DBT *key, u_int flags) +{ + BTREE *t; + CURSOR *c; + PAGE *h; + int status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* Check for change to a read-only tree. */ + if (F_ISSET(t, B_RDONLY)) { + errno = EPERM; + return (RET_ERROR); + } + + switch (flags) { + case 0: + status = __bt_bdelete(t, key); + break; + case R_CURSOR: + /* + * If flags is R_CURSOR, delete the cursor. Must already + * have started a scan and not have already deleted it. + */ + c = &t->bt_cursor; + if (F_ISSET(c, CURS_INIT)) { + if (F_ISSET(c, CURS_ACQUIRE | CURS_AFTER | CURS_BEFORE)) + return (RET_SPECIAL); + if ((h = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL) + return (RET_ERROR); + + /* + * If the page is about to be emptied, we'll need to + * delete it, which means we have to acquire a stack. + */ + if (NEXTINDEX(h) == 1) + if (__bt_stkacq(t, &h, &t->bt_cursor)) + return (RET_ERROR); + + status = __bt_dleaf(t, NULL, h, c->pg.index); + + if (NEXTINDEX(h) == 0 && status == RET_SUCCESS) { + if (__bt_pdelete(t, h)) + return (RET_ERROR); + } else + mpool_put(t->bt_mp, + h, status == RET_SUCCESS ? MPOOL_DIRTY : 0); + break; + } + /* FALLTHROUGH */ + default: + errno = EINVAL; + return (RET_ERROR); + } + if (status == RET_SUCCESS) + F_SET(t, B_MODIFIED); + return (status); +} + +/* + * __bt_stkacq -- + * Acquire a stack so we can delete a cursor entry. + * + * Parameters: + * t: tree + * hp: pointer to current, pinned PAGE pointer + * c: pointer to the cursor + * + * Returns: + * 0 on success, 1 on failure + */ +static int +__bt_stkacq(BTREE *t, PAGE **hp, CURSOR *c) +{ + BINTERNAL *bi; + EPG *e; + EPGNO *parent; + PAGE *h; + indx_t idx; + pgno_t pgno; + recno_t nextpg, prevpg; + int exact, level; + + /* + * Find the first occurrence of the key in the tree. Toss the + * currently locked page so we don't hit an already-locked page. + */ + h = *hp; + mpool_put(t->bt_mp, h, 0); + if ((e = __bt_search(t, &c->key, &exact)) == NULL) + return (1); + h = e->page; + + /* See if we got it in one shot. */ + if (h->pgno == c->pg.pgno) + goto ret; + + /* + * Move right, looking for the page. At each move we have to move + * up the stack until we don't have to move to the next page. If + * we have to change pages at an internal level, we have to fix the + * stack back up. + */ + while (h->pgno != c->pg.pgno) { + if ((nextpg = h->nextpg) == P_INVALID) + break; + mpool_put(t->bt_mp, h, 0); + + /* Move up the stack. */ + for (level = 0; (parent = BT_POP(t)) != NULL; ++level) { + /* Get the parent page. */ + if ((h = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL) + return (1); + + /* Move to the next index. */ + if (parent->index != NEXTINDEX(h) - 1) { + idx = parent->index + 1; + BT_PUSH(t, h->pgno, idx); + break; + } + mpool_put(t->bt_mp, h, 0); + } + + /* Restore the stack. */ + while (level--) { + /* Push the next level down onto the stack. */ + bi = GETBINTERNAL(h, idx); + pgno = bi->pgno; + BT_PUSH(t, pgno, 0); + + /* Lose the currently pinned page. */ + mpool_put(t->bt_mp, h, 0); + + /* Get the next level down. */ + if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL) + return (1); + idx = 0; + } + mpool_put(t->bt_mp, h, 0); + if ((h = mpool_get(t->bt_mp, nextpg, 0)) == NULL) + return (1); + } + + if (h->pgno == c->pg.pgno) + goto ret; + + /* Reacquire the original stack. */ + mpool_put(t->bt_mp, h, 0); + if ((e = __bt_search(t, &c->key, &exact)) == NULL) + return (1); + h = e->page; + + /* + * Move left, looking for the page. At each move we have to move + * up the stack until we don't have to change pages to move to the + * next page. If we have to change pages at an internal level, we + * have to fix the stack back up. + */ + while (h->pgno != c->pg.pgno) { + if ((prevpg = h->prevpg) == P_INVALID) + break; + mpool_put(t->bt_mp, h, 0); + + /* Move up the stack. */ + for (level = 0; (parent = BT_POP(t)) != NULL; ++level) { + /* Get the parent page. */ + if ((h = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL) + return (1); + + /* Move to the next index. */ + if (parent->index != 0) { + idx = parent->index - 1; + BT_PUSH(t, h->pgno, idx); + break; + } + mpool_put(t->bt_mp, h, 0); + } + + /* Restore the stack. */ + while (level--) { + /* Push the next level down onto the stack. */ + bi = GETBINTERNAL(h, idx); + pgno = bi->pgno; + + /* Lose the currently pinned page. */ + mpool_put(t->bt_mp, h, 0); + + /* Get the next level down. */ + if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL) + return (1); + + idx = NEXTINDEX(h) - 1; + BT_PUSH(t, pgno, idx); + } + mpool_put(t->bt_mp, h, 0); + if ((h = mpool_get(t->bt_mp, prevpg, 0)) == NULL) + return (1); + } + + +ret: mpool_put(t->bt_mp, h, 0); + return ((*hp = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL); +} + +/* + * __bt_bdelete -- + * Delete all key/data pairs matching the specified key. + * + * Parameters: + * t: tree + * key: key to delete + * + * Returns: + * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. + */ +static int +__bt_bdelete(BTREE *t, const DBT *key) +{ + EPG *e; + PAGE *h; + int deleted, exact, redo; + + deleted = 0; + + /* Find any matching record; __bt_search pins the page. */ +loop: if ((e = __bt_search(t, key, &exact)) == NULL) + return (deleted ? RET_SUCCESS : RET_ERROR); + if (!exact) { + mpool_put(t->bt_mp, e->page, 0); + return (deleted ? RET_SUCCESS : RET_SPECIAL); + } + + /* + * Delete forward, then delete backward, from the found key. If + * there are duplicates and we reach either side of the page, do + * the key search again, so that we get them all. + */ + redo = 0; + h = e->page; + do { + if (__bt_dleaf(t, key, h, e->index)) { + mpool_put(t->bt_mp, h, 0); + return (RET_ERROR); + } + if (F_ISSET(t, B_NODUPS)) { + if (NEXTINDEX(h) == 0) { + if (__bt_pdelete(t, h)) + return (RET_ERROR); + } else + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + return (RET_SUCCESS); + } + deleted = 1; + } while (e->index < NEXTINDEX(h) && __bt_cmp(t, key, e) == 0); + + /* Check for right-hand edge of the page. */ + if (e->index == NEXTINDEX(h)) + redo = 1; + + /* Delete from the key to the beginning of the page. */ + while (e->index-- > 0) { + if (__bt_cmp(t, key, e) != 0) + break; + if (__bt_dleaf(t, key, h, e->index) == RET_ERROR) { + mpool_put(t->bt_mp, h, 0); + return (RET_ERROR); + } + if (e->index == 0) + redo = 1; + } + + /* Check for an empty page. */ + if (NEXTINDEX(h) == 0) { + if (__bt_pdelete(t, h)) + return (RET_ERROR); + goto loop; + } + + /* Put the page. */ + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + + if (redo) + goto loop; + return (RET_SUCCESS); +} + +/* + * __bt_pdelete -- + * Delete a single page from the tree. + * + * Parameters: + * t: tree + * h: leaf page + * + * Returns: + * RET_SUCCESS, RET_ERROR. + * + * Side-effects: + * mpool_put's the page + */ +static int +__bt_pdelete(BTREE *t, PAGE *h) +{ + BINTERNAL *bi; + PAGE *pg; + EPGNO *parent; + indx_t cnt, idx, *ip, offset; + u_int32_t nksize; + char *from; + + /* + * Walk the parent page stack -- a LIFO stack of the pages that were + * traversed when we searched for the page where the delete occurred. + * Each stack entry is a page number and a page index offset. The + * offset is for the page traversed on the search. We've just deleted + * a page, so we have to delete the key from the parent page. + * + * If the delete from the parent page makes it empty, this process may + * continue all the way up the tree. We stop if we reach the root page + * (which is never deleted, it's just not worth the effort) or if the + * delete does not empty the page. + */ + while ((parent = BT_POP(t)) != NULL) { + /* Get the parent page. */ + if ((pg = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL) + return (RET_ERROR); + + idx = parent->index; + bi = GETBINTERNAL(pg, idx); + + /* Free any overflow pages. */ + if (bi->flags & P_BIGKEY && + __ovfl_delete(t, bi->bytes) == RET_ERROR) { + mpool_put(t->bt_mp, pg, 0); + return (RET_ERROR); + } + + /* + * Free the parent if it has only the one key and it's not the + * root page. If it's the rootpage, turn it back into an empty + * leaf page. + */ + if (NEXTINDEX(pg) == 1) { + if (pg->pgno == P_ROOT) { + pg->lower = BTDATAOFF; + pg->upper = t->bt_psize; + pg->flags = P_BLEAF; + } else { + if (__bt_relink(t, pg) || __bt_free(t, pg)) + return (RET_ERROR); + continue; + } + } else { + /* Pack remaining key items at the end of the page. */ + nksize = NBINTERNAL(bi->ksize); + from = (char *)pg + pg->upper; + memmove(from + nksize, from, (char *)bi - from); + pg->upper += nksize; + + /* Adjust indices' offsets, shift the indices down. */ + offset = pg->linp[idx]; + for (cnt = idx, ip = &pg->linp[0]; cnt--; ++ip) + if (ip[0] < offset) + ip[0] += nksize; + for (cnt = NEXTINDEX(pg) - idx; --cnt; ++ip) + ip[0] = ip[1] < offset ? ip[1] + nksize : ip[1]; + pg->lower -= sizeof(indx_t); + } + + mpool_put(t->bt_mp, pg, MPOOL_DIRTY); + break; + } + + /* Free the leaf page, as long as it wasn't the root. */ + if (h->pgno == P_ROOT) { + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + return (RET_SUCCESS); + } + return (__bt_relink(t, h) || __bt_free(t, h)); +} + +/* + * __bt_dleaf -- + * Delete a single record from a leaf page. + * + * Parameters: + * t: tree + * key: referenced key + * h: page + * idx: index on page to delete + * + * Returns: + * RET_SUCCESS, RET_ERROR. + */ +int +__bt_dleaf(BTREE *t, const DBT *key, PAGE *h, u_int idx) +{ + BLEAF *bl; + indx_t cnt, *ip, offset; + u_int32_t nbytes; + void *to; + char *from; + + /* If this record is referenced by the cursor, delete the cursor. */ + if (F_ISSET(&t->bt_cursor, CURS_INIT) && + !F_ISSET(&t->bt_cursor, CURS_ACQUIRE) && + t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index == idx && + __bt_curdel(t, key, h, idx)) + return (RET_ERROR); + + /* If the entry uses overflow pages, make them available for reuse. */ + to = bl = GETBLEAF(h, idx); + if (bl->flags & P_BIGKEY && __ovfl_delete(t, bl->bytes) == RET_ERROR) + return (RET_ERROR); + if (bl->flags & P_BIGDATA && + __ovfl_delete(t, bl->bytes + bl->ksize) == RET_ERROR) + return (RET_ERROR); + + /* Pack the remaining key/data items at the end of the page. */ + nbytes = NBLEAF(bl); + from = (char *)h + h->upper; + memmove(from + nbytes, from, (char *)to - from); + h->upper += nbytes; + + /* Adjust the indices' offsets, shift the indices down. */ + offset = h->linp[idx]; + for (cnt = idx, ip = &h->linp[0]; cnt--; ++ip) + if (ip[0] < offset) + ip[0] += nbytes; + for (cnt = NEXTINDEX(h) - idx; --cnt; ++ip) + ip[0] = ip[1] < offset ? ip[1] + nbytes : ip[1]; + h->lower -= sizeof(indx_t); + + /* If the cursor is on this page, adjust it as necessary. */ + if (F_ISSET(&t->bt_cursor, CURS_INIT) && + !F_ISSET(&t->bt_cursor, CURS_ACQUIRE) && + t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index > idx) + --t->bt_cursor.pg.index; + + return (RET_SUCCESS); +} + +/* + * __bt_curdel -- + * Delete the cursor. + * + * Parameters: + * t: tree + * key: referenced key (or NULL) + * h: page + * idx: index on page to delete + * + * Returns: + * RET_SUCCESS, RET_ERROR. + */ +static int +__bt_curdel(BTREE *t, const DBT *key, PAGE *h, u_int idx) +{ + CURSOR *c; + EPG e; + PAGE *pg; + int curcopy, status; + + /* + * If there are duplicates, move forward or backward to one. + * Otherwise, copy the key into the cursor area. + */ + c = &t->bt_cursor; + F_CLR(c, CURS_AFTER | CURS_BEFORE | CURS_ACQUIRE); + + curcopy = 0; + if (!F_ISSET(t, B_NODUPS)) { + /* + * We're going to have to do comparisons. If we weren't + * provided a copy of the key, i.e. the user is deleting + * the current cursor position, get one. + */ + if (key == NULL) { + e.page = h; + e.index = idx; + if ((status = __bt_ret(t, &e, + &c->key, &c->key, NULL, NULL, 1)) != RET_SUCCESS) + return (status); + curcopy = 1; + key = &c->key; + } + /* Check previous key, if not at the beginning of the page. */ + if (idx > 0) { + e.page = h; + e.index = idx - 1; + if (__bt_cmp(t, key, &e) == 0) { + F_SET(c, CURS_BEFORE); + goto dup2; + } + } + /* Check next key, if not at the end of the page. */ + if (idx < NEXTINDEX(h) - 1) { + e.page = h; + e.index = idx + 1; + if (__bt_cmp(t, key, &e) == 0) { + F_SET(c, CURS_AFTER); + goto dup2; + } + } + /* Check previous key if at the beginning of the page. */ + if (idx == 0 && h->prevpg != P_INVALID) { + if ((pg = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL) + return (RET_ERROR); + e.page = pg; + e.index = NEXTINDEX(pg) - 1; + if (__bt_cmp(t, key, &e) == 0) { + F_SET(c, CURS_BEFORE); + goto dup1; + } + mpool_put(t->bt_mp, pg, 0); + } + /* Check next key if at the end of the page. */ + if (idx == NEXTINDEX(h) - 1 && h->nextpg != P_INVALID) { + if ((pg = mpool_get(t->bt_mp, h->nextpg, 0)) == NULL) + return (RET_ERROR); + e.page = pg; + e.index = 0; + if (__bt_cmp(t, key, &e) == 0) { + F_SET(c, CURS_AFTER); +dup1: mpool_put(t->bt_mp, pg, 0); +dup2: c->pg.pgno = e.page->pgno; + c->pg.index = e.index; + return (RET_SUCCESS); + } + mpool_put(t->bt_mp, pg, 0); + } + } + e.page = h; + e.index = idx; + if (curcopy || (status = + __bt_ret(t, &e, &c->key, &c->key, NULL, NULL, 1)) == RET_SUCCESS) { + F_SET(c, CURS_ACQUIRE); + return (RET_SUCCESS); + } + return (status); +} + +/* + * __bt_relink -- + * Link around a deleted page. + * + * Parameters: + * t: tree + * h: page to be deleted + */ +static int +__bt_relink(BTREE *t, PAGE *h) +{ + PAGE *pg; + + if (h->nextpg != P_INVALID) { + if ((pg = mpool_get(t->bt_mp, h->nextpg, 0)) == NULL) + return (RET_ERROR); + pg->prevpg = h->prevpg; + mpool_put(t->bt_mp, pg, MPOOL_DIRTY); + } + if (h->prevpg != P_INVALID) { + if ((pg = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL) + return (RET_ERROR); + pg->nextpg = h->nextpg; + mpool_put(t->bt_mp, pg, MPOOL_DIRTY); + } + return (0); +} diff --git a/db/btree/FreeBSD/bt_extern.h b/db/btree/FreeBSD/bt_extern.h new file mode 100644 index 0000000..2edf1c1 --- /dev/null +++ b/db/btree/FreeBSD/bt_extern.h @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)extern.h 8.10 (Berkeley) 7/20/94 + * $FreeBSD: src/lib/libc/db/btree/extern.h,v 1.4 2007/01/09 00:27:50 imp Exp $ + */ + +int __bt_close(DB *); +int __bt_cmp(BTREE *, const DBT *, EPG *); +int __bt_crsrdel(BTREE *, EPGNO *); +int __bt_defcmp(const DBT *, const DBT *); +size_t __bt_defpfx(const DBT *, const DBT *); +int __bt_delete(const DB *, const DBT *, u_int); +int __bt_dleaf(BTREE *, const DBT *, PAGE *, u_int); +int __bt_fd(const DB *); +int __bt_free(BTREE *, PAGE *); +int __bt_get(const DB *, const DBT *, DBT *, u_int); +PAGE *__bt_new(BTREE *, pgno_t *); +void __bt_pgin(void *, pgno_t, void *); +void __bt_pgout(void *, pgno_t, void *); +int __bt_push(BTREE *, pgno_t, int); +int __bt_put(const DB *dbp, DBT *, const DBT *, u_int); +int __bt_ret(BTREE *, EPG *, DBT *, DBT *, DBT *, DBT *, int); +EPG *__bt_search(BTREE *, const DBT *, int *); +int __bt_seq(const DB *, DBT *, DBT *, u_int); +void __bt_setcur(BTREE *, pgno_t, u_int); +int __bt_split(BTREE *, PAGE *, + const DBT *, const DBT *, int, size_t, u_int32_t); +int __bt_sync(const DB *, u_int); + +int __ovfl_delete(BTREE *, void *); +int __ovfl_get(BTREE *, void *, size_t *, void **, size_t *); +int __ovfl_put(BTREE *, const DBT *, pgno_t *); + +#ifdef DEBUG +void __bt_dnpage(DB *, pgno_t); +void __bt_dpage(PAGE *); +void __bt_dump(DB *); +#endif +#ifdef STATISTICS +void __bt_stat(DB *); +#endif diff --git a/db/btree/FreeBSD/bt_get.c b/db/btree/FreeBSD/bt_get.c new file mode 100644 index 0000000..7de592e --- /dev/null +++ b/db/btree/FreeBSD/bt_get.c @@ -0,0 +1,99 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_get.c 8.6 (Berkeley) 7/20/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_get.c,v 1.4 2009/03/02 23:47:18 delphij Exp $"); + +#include + +#include +#include +#include + +#include +#include "btree.h" + +/* + * __BT_GET -- Get a record from the btree. + * + * Parameters: + * dbp: pointer to access method + * key: key to find + * data: data to return + * flag: currently unused + * + * Returns: + * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. + */ +int +__bt_get(const DB *dbp, const DBT *key, DBT *data, u_int flags) +{ + BTREE *t; + EPG *e; + int exact, status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* Get currently doesn't take any flags. */ + if (flags) { + errno = EINVAL; + return (RET_ERROR); + } + + if ((e = __bt_search(t, key, &exact)) == NULL) + return (RET_ERROR); + if (!exact) { + mpool_put(t->bt_mp, e->page, 0); + return (RET_SPECIAL); + } + + status = __bt_ret(t, e, NULL, NULL, data, &t->bt_rdata, 0); + + /* + * If the user is doing concurrent access, we copied the + * key/data, toss the page. + */ + if (F_ISSET(t, B_DB_LOCK)) + mpool_put(t->bt_mp, e->page, 0); + else + t->bt_pinned = e->page; + return (status); +} diff --git a/db/btree/FreeBSD/bt_open.c b/db/btree/FreeBSD/bt_open.c new file mode 100644 index 0000000..955032a --- /dev/null +++ b/db/btree/FreeBSD/bt_open.c @@ -0,0 +1,444 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_open.c 8.10 (Berkeley) 8/17/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_open.c,v 1.17 2009/03/28 05:57:27 delphij Exp $"); + +/* + * Implementation of btree access method for 4.4BSD. + * + * The design here was originally based on that of the btree access method + * used in the Postgres database system at UC Berkeley. This implementation + * is wholly independent of the Postgres code. + */ + +#include "namespace.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include +#include "btree.h" + +#ifdef DEBUG +#undef MINPSIZE +#define MINPSIZE 128 +#endif + +static int byteorder(void); +static int nroot(BTREE *); +static int tmp(void); + +/* + * __BT_OPEN -- Open a btree. + * + * Creates and fills a DB struct, and calls the routine that actually + * opens the btree. + * + * Parameters: + * fname: filename (NULL for in-memory trees) + * flags: open flag bits + * mode: open permission bits + * b: BTREEINFO pointer + * + * Returns: + * NULL on failure, pointer to DB on success. + * + */ +DB * +__bt_open(const char *fname, int flags, int mode, const BTREEINFO *openinfo, int dflags) +{ + struct stat sb; + BTMETA m; + BTREE *t; + BTREEINFO b; + DB *dbp; + pgno_t ncache; + ssize_t nr; + int machine_lorder, saved_errno; + + t = NULL; + + /* + * Intention is to make sure all of the user's selections are okay + * here and then use them without checking. Can't be complete, since + * we don't know the right page size, lorder or flags until the backing + * file is opened. Also, the file's page size can cause the cachesize + * to change. + */ + machine_lorder = byteorder(); + if (openinfo) { + b = *openinfo; + + /* Flags: R_DUP. */ + if (b.flags & ~(R_DUP)) + goto einval; + + /* + * Page size must be indx_t aligned and >= MINPSIZE. Default + * page size is set farther on, based on the underlying file + * transfer size. + */ + if (b.psize && + (b.psize < MINPSIZE || b.psize > MAX_PAGE_OFFSET + 1 || + b.psize & (sizeof(indx_t) - 1) )) + goto einval; + + /* Minimum number of keys per page; absolute minimum is 2. */ + if (b.minkeypage) { + if (b.minkeypage < 2) + goto einval; + } else + b.minkeypage = DEFMINKEYPAGE; + + /* If no comparison, use default comparison and prefix. */ + if (b.compare == NULL) { + b.compare = __bt_defcmp; + if (b.prefix == NULL) + b.prefix = __bt_defpfx; + } + + if (b.lorder == 0) + b.lorder = machine_lorder; + } else { + b.compare = __bt_defcmp; + b.cachesize = 0; + b.flags = 0; + b.lorder = machine_lorder; + b.minkeypage = DEFMINKEYPAGE; + b.prefix = __bt_defpfx; + b.psize = 0; + } + + /* Check for the ubiquitous PDP-11. */ + if (b.lorder != BIG_ENDIAN && b.lorder != LITTLE_ENDIAN) + goto einval; + + /* Allocate and initialize DB and BTREE structures. */ + if ((t = (BTREE *)calloc(1, sizeof(BTREE))) == NULL) + goto err; + t->bt_fd = -1; /* Don't close unopened fd on error. */ + t->bt_lorder = b.lorder; + t->bt_order = NOT; + t->bt_cmp = b.compare; + t->bt_pfx = b.prefix; + t->bt_rfd = -1; + + if ((t->bt_dbp = dbp = (DB *)calloc(1, sizeof(DB))) == NULL) + goto err; + if (t->bt_lorder != machine_lorder) + F_SET(t, B_NEEDSWAP); + + dbp->type = DB_BTREE; + dbp->internal = t; + dbp->close = __bt_close; + dbp->del = __bt_delete; + dbp->fd = __bt_fd; + dbp->get = __bt_get; + dbp->put = __bt_put; + dbp->seq = __bt_seq; + dbp->sync = __bt_sync; + + /* + * If no file name was supplied, this is an in-memory btree and we + * open a backing temporary file. Otherwise, it's a disk-based tree. + */ + if (fname) { + switch (flags & O_ACCMODE) { + case O_RDONLY: + F_SET(t, B_RDONLY); + break; + case O_RDWR: + break; + case O_WRONLY: + default: + goto einval; + } + + if ((t->bt_fd = _open(fname, flags, mode)) < 0) + goto err; + + } else { + if ((flags & O_ACCMODE) != O_RDWR) + goto einval; + if ((t->bt_fd = tmp()) == -1) + goto err; + F_SET(t, B_INMEM); + } + + if (_fcntl(t->bt_fd, F_SETFD, 1) == -1) + goto err; + + if (_fstat(t->bt_fd, &sb)) + goto err; + if (sb.st_size) { + if ((nr = _read(t->bt_fd, &m, sizeof(BTMETA))) < 0) + goto err; + if (nr != sizeof(BTMETA)) + goto eftype; + + /* + * Read in the meta-data. This can change the notion of what + * the lorder, page size and flags are, and, when the page size + * changes, the cachesize value can change too. If the user + * specified the wrong byte order for an existing database, we + * don't bother to return an error, we just clear the NEEDSWAP + * bit. + */ + if (m.magic == BTREEMAGIC) + F_CLR(t, B_NEEDSWAP); + else { + F_SET(t, B_NEEDSWAP); + M_32_SWAP(m.magic); + M_32_SWAP(m.version); + M_32_SWAP(m.psize); + M_32_SWAP(m.free); + M_32_SWAP(m.nrecs); + M_32_SWAP(m.flags); + } + if (m.magic != BTREEMAGIC || m.version != BTREEVERSION) + goto eftype; + if (m.psize < MINPSIZE || m.psize > MAX_PAGE_OFFSET + 1 || + m.psize & (sizeof(indx_t) - 1) ) + goto eftype; + if (m.flags & ~SAVEMETA) + goto eftype; + b.psize = m.psize; + F_SET(t, m.flags); + t->bt_free = m.free; + t->bt_nrecs = m.nrecs; + } else { + /* + * Set the page size to the best value for I/O to this file. + * Don't overflow the page offset type. + */ + if (b.psize == 0) { + b.psize = sb.st_blksize; + if (b.psize < MINPSIZE) + b.psize = MINPSIZE; + if (b.psize > MAX_PAGE_OFFSET + 1) + b.psize = MAX_PAGE_OFFSET + 1; + } + + /* Set flag if duplicates permitted. */ + if (!(b.flags & R_DUP)) + F_SET(t, B_NODUPS); + + t->bt_free = P_INVALID; + t->bt_nrecs = 0; + F_SET(t, B_METADIRTY); + } + + t->bt_psize = b.psize; + + /* Set the cache size; must be a multiple of the page size. */ + if (b.cachesize && b.cachesize & (b.psize - 1) ) + b.cachesize += (~b.cachesize & (b.psize - 1) ) + 1; + if (b.cachesize < b.psize * MINCACHE) + b.cachesize = b.psize * MINCACHE; + + /* Calculate number of pages to cache. */ + ncache = (b.cachesize + t->bt_psize - 1) / t->bt_psize; + + /* + * The btree data structure requires that at least two keys can fit on + * a page, but other than that there's no fixed requirement. The user + * specified a minimum number per page, and we translated that into the + * number of bytes a key/data pair can use before being placed on an + * overflow page. This calculation includes the page header, the size + * of the index referencing the leaf item and the size of the leaf item + * structure. Also, don't let the user specify a minkeypage such that + * a key/data pair won't fit even if both key and data are on overflow + * pages. + */ + t->bt_ovflsize = (t->bt_psize - BTDATAOFF) / b.minkeypage - + (sizeof(indx_t) + NBLEAFDBT(0, 0)); + if (t->bt_ovflsize < NBLEAFDBT(NOVFLSIZE, NOVFLSIZE) + sizeof(indx_t)) + t->bt_ovflsize = + NBLEAFDBT(NOVFLSIZE, NOVFLSIZE) + sizeof(indx_t); + + /* Initialize the buffer pool. */ + if ((t->bt_mp = + mpool_open(NULL, t->bt_fd, t->bt_psize, ncache)) == NULL) + goto err; + if (!F_ISSET(t, B_INMEM)) + mpool_filter(t->bt_mp, __bt_pgin, __bt_pgout, t); + + /* Create a root page if new tree. */ + if (nroot(t) == RET_ERROR) + goto err; + + /* Global flags. */ + if (dflags & DB_LOCK) + F_SET(t, B_DB_LOCK); + if (dflags & DB_SHMEM) + F_SET(t, B_DB_SHMEM); + if (dflags & DB_TXN) + F_SET(t, B_DB_TXN); + + return (dbp); + +einval: errno = EINVAL; + goto err; + +eftype: errno = EFTYPE; + goto err; + +err: saved_errno = errno; + if (t) { + if (t->bt_dbp) + free(t->bt_dbp); + if (t->bt_fd != -1) + (void)_close(t->bt_fd); + free(t); + } + errno = saved_errno; + return (NULL); +} + +/* + * NROOT -- Create the root of a new tree. + * + * Parameters: + * t: tree + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +static int +nroot(BTREE *t) +{ + PAGE *meta, *root; + pgno_t npg; + + if ((meta = mpool_get(t->bt_mp, 0, 0)) != NULL) { + mpool_put(t->bt_mp, meta, 0); + return (RET_SUCCESS); + } + if (errno != EINVAL) /* It's OK to not exist. */ + return (RET_ERROR); + errno = 0; + + if ((meta = mpool_new(t->bt_mp, &npg)) == NULL) + return (RET_ERROR); + + if ((root = mpool_new(t->bt_mp, &npg)) == NULL) + return (RET_ERROR); + + if (npg != P_ROOT) + return (RET_ERROR); + root->pgno = npg; + root->prevpg = root->nextpg = P_INVALID; + root->lower = BTDATAOFF; + root->upper = t->bt_psize; + root->flags = P_BLEAF; + memset(meta, 0, t->bt_psize); + mpool_put(t->bt_mp, meta, MPOOL_DIRTY); + mpool_put(t->bt_mp, root, MPOOL_DIRTY); + return (RET_SUCCESS); +} + +static int +tmp(void) +{ + sigset_t set, oset; + int fd, len; + char *envtmp = NULL; + char path[MAXPATHLEN]; + + if (issetugid() == 0) + envtmp = getenv("TMPDIR"); + len = snprintf(path, + sizeof(path), "%s/bt.XXXXXXXXXX", envtmp ? envtmp : "/tmp"); + if (len < 0 || len >= (int)sizeof(path)) { + errno = ENAMETOOLONG; + return(-1); + } + + (void)sigfillset(&set); + (void)_sigprocmask(SIG_BLOCK, &set, &oset); + if ((fd = mkstemp(path)) != -1) + (void)unlink(path); + (void)_sigprocmask(SIG_SETMASK, &oset, NULL); + return(fd); +} + +static int +byteorder(void) +{ + u_int32_t x; + u_char *p; + + x = 0x01020304; + p = (u_char *)&x; + switch (*p) { + case 1: + return (BIG_ENDIAN); + case 4: + return (LITTLE_ENDIAN); + default: + return (0); + } +} + +int +__bt_fd(const DB *dbp) +{ + BTREE *t; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* In-memory database can't have a file descriptor. */ + if (F_ISSET(t, B_INMEM)) { + errno = ENOENT; + return (-1); + } + return (t->bt_fd); +} diff --git a/db/btree/FreeBSD/bt_overflow.c b/db/btree/FreeBSD/bt_overflow.c new file mode 100644 index 0000000..25e3000 --- /dev/null +++ b/db/btree/FreeBSD/bt_overflow.c @@ -0,0 +1,216 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_overflow.c 8.5 (Berkeley) 7/16/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_overflow.c,v 1.6 2009/03/05 00:57:01 delphij Exp $"); + +#include + +#include +#include +#include + +#include +#include "btree.h" + +/* + * Big key/data code. + * + * Big key and data entries are stored on linked lists of pages. The initial + * reference is byte string stored with the key or data and is the page number + * and size. The actual record is stored in a chain of pages linked by the + * nextpg field of the PAGE header. + * + * The first page of the chain has a special property. If the record is used + * by an internal page, it cannot be deleted and the P_PRESERVE bit will be set + * in the header. + * + * XXX + * A single DBT is written to each chain, so a lot of space on the last page + * is wasted. This is a fairly major bug for some data sets. + */ + +/* + * __OVFL_GET -- Get an overflow key/data item. + * + * Parameters: + * t: tree + * p: pointer to { pgno_t, u_int32_t } + * buf: storage address + * bufsz: storage size + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__ovfl_get(BTREE *t, void *p, size_t *ssz, void **buf, size_t *bufsz) +{ + PAGE *h; + pgno_t pg; + size_t nb, plen; + u_int32_t sz; + + memmove(&pg, p, sizeof(pgno_t)); + memmove(&sz, (char *)p + sizeof(pgno_t), sizeof(u_int32_t)); + *ssz = sz; + +#ifdef DEBUG + if (pg == P_INVALID || sz == 0) + LIBC_ABORT("%s", pg == P_INVALID ? "pg == P_INVALID" : "sz == 0"); +#endif + /* Make the buffer bigger as necessary. */ + if (*bufsz < sz) { + *buf = reallocf(*buf, sz); + if (*buf == NULL) + return (RET_ERROR); + *bufsz = sz; + } + + /* + * Step through the linked list of pages, copying the data on each one + * into the buffer. Never copy more than the data's length. + */ + plen = t->bt_psize - BTDATAOFF; + for (p = *buf;; p = (char *)p + nb, pg = h->nextpg) { + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (RET_ERROR); + + nb = MIN(sz, plen); + memmove(p, (char *)h + BTDATAOFF, nb); + mpool_put(t->bt_mp, h, 0); + + if ((sz -= nb) == 0) + break; + } + return (RET_SUCCESS); +} + +/* + * __OVFL_PUT -- Store an overflow key/data item. + * + * Parameters: + * t: tree + * data: DBT to store + * pgno: storage page number + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__ovfl_put(BTREE *t, const DBT *dbt, pgno_t *pg) +{ + PAGE *h, *last; + void *p; + pgno_t npg; + size_t nb, plen; + u_int32_t sz; + + /* + * Allocate pages and copy the key/data record into them. Store the + * number of the first page in the chain. + */ + plen = t->bt_psize - BTDATAOFF; + for (last = NULL, p = dbt->data, sz = dbt->size;; + p = (char *)p + plen, last = h) { + if ((h = __bt_new(t, &npg)) == NULL) + return (RET_ERROR); + + h->pgno = npg; + h->nextpg = h->prevpg = P_INVALID; + h->flags = P_OVERFLOW; + h->lower = h->upper = 0; + + nb = MIN(sz, plen); + memmove((char *)h + BTDATAOFF, p, nb); + + if (last) { + last->nextpg = h->pgno; + mpool_put(t->bt_mp, last, MPOOL_DIRTY); + } else + *pg = h->pgno; + + if ((sz -= nb) == 0) { + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + break; + } + } + return (RET_SUCCESS); +} + +/* + * __OVFL_DELETE -- Delete an overflow chain. + * + * Parameters: + * t: tree + * p: pointer to { pgno_t, u_int32_t } + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__ovfl_delete(BTREE *t, void *p) +{ + PAGE *h; + pgno_t pg; + size_t plen; + u_int32_t sz; + + memmove(&pg, p, sizeof(pgno_t)); + memmove(&sz, (char *)p + sizeof(pgno_t), sizeof(u_int32_t)); + +#ifdef DEBUG + if (pg == P_INVALID || sz == 0) + LIBC_ABORT("%s", pg == P_INVALID ? "pg == P_INVALID" : "sz == 0"); +#endif + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (RET_ERROR); + + /* Don't delete chains used by internal pages. */ + if (h->flags & P_PRESERVE) { + mpool_put(t->bt_mp, h, 0); + return (RET_SUCCESS); + } + + /* Step through the chain, calling the free routine for each page. */ + for (plen = t->bt_psize - BTDATAOFF;; sz -= plen) { + pg = h->nextpg; + __bt_free(t, h); + if (sz <= plen) + break; + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (RET_ERROR); + } + return (RET_SUCCESS); +} diff --git a/db/btree/FreeBSD/bt_page.c b/db/btree/FreeBSD/bt_page.c new file mode 100644 index 0000000..f4fbd2c --- /dev/null +++ b/db/btree/FreeBSD/bt_page.c @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_page.c 8.3 (Berkeley) 7/14/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_page.c,v 1.5 2009/03/02 23:47:18 delphij Exp $"); + +#include + +#include + +#include +#include "btree.h" + +/* + * __bt_free -- + * Put a page on the freelist. + * + * Parameters: + * t: tree + * h: page to free + * + * Returns: + * RET_ERROR, RET_SUCCESS + * + * Side-effect: + * mpool_put's the page. + */ +int +__bt_free(BTREE *t, PAGE *h) +{ + /* Insert the page at the head of the free list. */ + h->prevpg = P_INVALID; + h->nextpg = t->bt_free; + t->bt_free = h->pgno; + F_SET(t, B_METADIRTY); + + /* Make sure the page gets written back. */ + return (mpool_put(t->bt_mp, h, MPOOL_DIRTY)); +} + +/* + * __bt_new -- + * Get a new page, preferably from the freelist. + * + * Parameters: + * t: tree + * npg: storage for page number. + * + * Returns: + * Pointer to a page, NULL on error. + */ +PAGE * +__bt_new(BTREE *t, pgno_t *npg) +{ + PAGE *h; + + if (t->bt_free != P_INVALID && + (h = mpool_get(t->bt_mp, t->bt_free, 0)) != NULL) { + *npg = t->bt_free; + t->bt_free = h->nextpg; + F_SET(t, B_METADIRTY); + return (h); + } + return (mpool_new(t->bt_mp, npg)); +} diff --git a/db/btree/FreeBSD/bt_put.c b/db/btree/FreeBSD/bt_put.c new file mode 100644 index 0000000..78db11a --- /dev/null +++ b/db/btree/FreeBSD/bt_put.c @@ -0,0 +1,314 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_put.c 8.8 (Berkeley) 7/26/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_put.c,v 1.9 2009/03/28 05:45:29 delphij Exp $"); + +#include + +#include +#include +#include +#include + +#include +#include "btree.h" + +static EPG *bt_fast(BTREE *, const DBT *, const DBT *, int *); + +/* + * __BT_PUT -- Add a btree item to the tree. + * + * Parameters: + * dbp: pointer to access method + * key: key + * data: data + * flag: R_NOOVERWRITE + * + * Returns: + * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key is already in the + * tree and R_NOOVERWRITE specified. + */ +int +__bt_put(const DB *dbp, DBT *key, const DBT *data, u_int flags) +{ + BTREE *t; + DBT tkey, tdata; + EPG *e; + PAGE *h; + indx_t idx, nxtindex; + pgno_t pg; + u_int32_t nbytes, tmp; + int dflags, exact, status; + char *dest, db[NOVFLSIZE], kb[NOVFLSIZE]; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* Check for change to a read-only tree. */ + if (F_ISSET(t, B_RDONLY)) { + errno = EPERM; + return (RET_ERROR); + } + + switch (flags) { + case 0: + case R_NOOVERWRITE: + break; + case R_CURSOR: + /* + * If flags is R_CURSOR, put the cursor. Must already + * have started a scan and not have already deleted it. + */ + if (F_ISSET(&t->bt_cursor, CURS_INIT) && + !F_ISSET(&t->bt_cursor, + CURS_ACQUIRE | CURS_AFTER | CURS_BEFORE)) + break; + /* FALLTHROUGH */ + default: + errno = EINVAL; + return (RET_ERROR); + } + + /* + * If the key/data pair won't fit on a page, store it on overflow + * pages. Only put the key on the overflow page if the pair are + * still too big after moving the data to an overflow page. + * + * XXX + * If the insert fails later on, the overflow pages aren't recovered. + */ + dflags = 0; + if (key->size + data->size > t->bt_ovflsize) { + if (key->size > t->bt_ovflsize) { +storekey: if (__ovfl_put(t, key, &pg) == RET_ERROR) + return (RET_ERROR); + tkey.data = kb; + tkey.size = NOVFLSIZE; + memmove(kb, &pg, sizeof(pgno_t)); + tmp = key->size; + memmove(kb + sizeof(pgno_t), + &tmp, sizeof(u_int32_t)); + dflags |= P_BIGKEY; + key = &tkey; + } + if (key->size + data->size > t->bt_ovflsize) { + if (__ovfl_put(t, data, &pg) == RET_ERROR) + return (RET_ERROR); + tdata.data = db; + tdata.size = NOVFLSIZE; + memmove(db, &pg, sizeof(pgno_t)); + tmp = data->size; + memmove(db + sizeof(pgno_t), + &tmp, sizeof(u_int32_t)); + dflags |= P_BIGDATA; + data = &tdata; + } + if (key->size + data->size > t->bt_ovflsize) + goto storekey; + } + + /* Replace the cursor. */ + if (flags == R_CURSOR) { + if ((h = mpool_get(t->bt_mp, t->bt_cursor.pg.pgno, 0)) == NULL) + return (RET_ERROR); + idx = t->bt_cursor.pg.index; + goto delete; + } + + /* + * Find the key to delete, or, the location at which to insert. + * Bt_fast and __bt_search both pin the returned page. + */ + if (t->bt_order == NOT || (e = bt_fast(t, key, data, &exact)) == NULL) + if ((e = __bt_search(t, key, &exact)) == NULL) + return (RET_ERROR); + h = e->page; + idx = e->index; + + /* + * Add the key/data pair to the tree. If an identical key is already + * in the tree, and R_NOOVERWRITE is set, an error is returned. If + * R_NOOVERWRITE is not set, the key is either added (if duplicates are + * permitted) or an error is returned. + */ + switch (flags) { + case R_NOOVERWRITE: + if (!exact) + break; + mpool_put(t->bt_mp, h, 0); + return (RET_SPECIAL); + default: + if (!exact || !F_ISSET(t, B_NODUPS)) + break; + /* + * !!! + * Note, the delete may empty the page, so we need to put a + * new entry into the page immediately. + */ +delete: if (__bt_dleaf(t, key, h, idx) == RET_ERROR) { + mpool_put(t->bt_mp, h, 0); + return (RET_ERROR); + } + break; + } + + /* + * If not enough room, or the user has put a ceiling on the number of + * keys permitted in the page, split the page. The split code will + * insert the key and data and unpin the current page. If inserting + * into the offset array, shift the pointers up. + */ + nbytes = NBLEAFDBT(key->size, data->size); + if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) { + if ((status = __bt_split(t, h, key, + data, dflags, nbytes, idx)) != RET_SUCCESS) + return (status); + goto success; + } + + if (idx < (nxtindex = NEXTINDEX(h))) + memmove(h->linp + idx + 1, h->linp + idx, + (nxtindex - idx) * sizeof(indx_t)); + h->lower += sizeof(indx_t); + + h->linp[idx] = h->upper -= nbytes; + dest = (char *)h + h->upper; + WR_BLEAF(dest, key, data, dflags); + + /* If the cursor is on this page, adjust it as necessary. */ + if (F_ISSET(&t->bt_cursor, CURS_INIT) && + !F_ISSET(&t->bt_cursor, CURS_ACQUIRE) && + t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index >= idx) + ++t->bt_cursor.pg.index; + + if (t->bt_order == NOT) { + if (h->nextpg == P_INVALID) { + if (idx == NEXTINDEX(h) - 1) { + t->bt_order = FORWARD; + t->bt_last.index = idx; + t->bt_last.pgno = h->pgno; + } + } else if (h->prevpg == P_INVALID) { + if (idx == 0) { + t->bt_order = BACK; + t->bt_last.index = 0; + t->bt_last.pgno = h->pgno; + } + } + } + + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + +success: + if (flags == R_SETCURSOR) + __bt_setcur(t, e->page->pgno, e->index); + + F_SET(t, B_MODIFIED); + return (RET_SUCCESS); +} + +#ifdef STATISTICS +u_long bt_cache_hit, bt_cache_miss; +#endif + +/* + * BT_FAST -- Do a quick check for sorted data. + * + * Parameters: + * t: tree + * key: key to insert + * + * Returns: + * EPG for new record or NULL if not found. + */ +static EPG * +bt_fast(BTREE *t, const DBT *key, const DBT *data, int *exactp) +{ + PAGE *h; + u_int32_t nbytes; + int cmp; + + if ((h = mpool_get(t->bt_mp, t->bt_last.pgno, 0)) == NULL) { + t->bt_order = NOT; + return (NULL); + } + t->bt_cur.page = h; + t->bt_cur.index = t->bt_last.index; + + /* + * If won't fit in this page or have too many keys in this page, + * have to search to get split stack. + */ + nbytes = NBLEAFDBT(key->size, data->size); + if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) + goto miss; + + if (t->bt_order == FORWARD) { + if (t->bt_cur.page->nextpg != P_INVALID) + goto miss; + if (t->bt_cur.index != NEXTINDEX(h) - 1) + goto miss; + if ((cmp = __bt_cmp(t, key, &t->bt_cur)) < 0) + goto miss; + t->bt_last.index = cmp ? ++t->bt_cur.index : t->bt_cur.index; + } else { + if (t->bt_cur.page->prevpg != P_INVALID) + goto miss; + if (t->bt_cur.index != 0) + goto miss; + if ((cmp = __bt_cmp(t, key, &t->bt_cur)) > 0) + goto miss; + t->bt_last.index = 0; + } + *exactp = cmp == 0; +#ifdef STATISTICS + ++bt_cache_hit; +#endif + return (&t->bt_cur); + +miss: +#ifdef STATISTICS + ++bt_cache_miss; +#endif + t->bt_order = NOT; + mpool_put(t->bt_mp, h, 0); + return (NULL); +} diff --git a/db/btree/FreeBSD/bt_search.c b/db/btree/FreeBSD/bt_search.c new file mode 100644 index 0000000..c49d27c --- /dev/null +++ b/db/btree/FreeBSD/bt_search.c @@ -0,0 +1,200 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_search.c 8.8 (Berkeley) 7/31/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_search.c,v 1.5 2009/03/03 02:16:12 delphij Exp $"); + +#include + +#include + +#include +#include "btree.h" + +static int __bt_snext(BTREE *, PAGE *, const DBT *, int *); +static int __bt_sprev(BTREE *, PAGE *, const DBT *, int *); + +/* + * __bt_search -- + * Search a btree for a key. + * + * Parameters: + * t: tree to search + * key: key to find + * exactp: pointer to exact match flag + * + * Returns: + * The EPG for matching record, if any, or the EPG for the location + * of the key, if it were inserted into the tree, is entered into + * the bt_cur field of the tree. A pointer to the field is returned. + */ +EPG * +__bt_search(BTREE *t, const DBT *key, int *exactp) +{ + PAGE *h; + indx_t base, idx, lim; + pgno_t pg; + int cmp; + + BT_CLR(t); + for (pg = P_ROOT;;) { + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (NULL); + + /* Do a binary search on the current page. */ + t->bt_cur.page = h; + for (base = 0, lim = NEXTINDEX(h); lim; lim >>= 1) { + t->bt_cur.index = idx = base + (lim >> 1); + if ((cmp = __bt_cmp(t, key, &t->bt_cur)) == 0) { + if (h->flags & P_BLEAF) { + *exactp = 1; + return (&t->bt_cur); + } + goto next; + } + if (cmp > 0) { + base = idx + 1; + --lim; + } + } + + /* + * If it's a leaf page, we're almost done. If no duplicates + * are allowed, or we have an exact match, we're done. Else, + * it's possible that there were matching keys on this page, + * which later deleted, and we're on a page with no matches + * while there are matches on other pages. If at the start or + * end of a page, check the adjacent page. + */ + if (h->flags & P_BLEAF) { + if (!F_ISSET(t, B_NODUPS)) { + if (base == 0 && + h->prevpg != P_INVALID && + __bt_sprev(t, h, key, exactp)) + return (&t->bt_cur); + if (base == NEXTINDEX(h) && + h->nextpg != P_INVALID && + __bt_snext(t, h, key, exactp)) + return (&t->bt_cur); + } + *exactp = 0; + t->bt_cur.index = base; + return (&t->bt_cur); + } + + /* + * No match found. Base is the smallest index greater than + * key and may be zero or a last + 1 index. If it's non-zero, + * decrement by one, and record the internal page which should + * be a parent page for the key. If a split later occurs, the + * inserted page will be to the right of the saved page. + */ + idx = base ? base - 1 : base; + +next: BT_PUSH(t, h->pgno, idx); + pg = GETBINTERNAL(h, idx)->pgno; + mpool_put(t->bt_mp, h, 0); + } +} + +/* + * __bt_snext -- + * Check for an exact match after the key. + * + * Parameters: + * t: tree + * h: current page + * key: key + * exactp: pointer to exact match flag + * + * Returns: + * If an exact match found. + */ +static int +__bt_snext(BTREE *t, PAGE *h, const DBT *key, int *exactp) +{ + EPG e; + + /* + * Get the next page. The key is either an exact + * match, or not as good as the one we already have. + */ + if ((e.page = mpool_get(t->bt_mp, h->nextpg, 0)) == NULL) + return (0); + e.index = 0; + if (__bt_cmp(t, key, &e) == 0) { + mpool_put(t->bt_mp, h, 0); + t->bt_cur = e; + *exactp = 1; + return (1); + } + mpool_put(t->bt_mp, e.page, 0); + return (0); +} + +/* + * __bt_sprev -- + * Check for an exact match before the key. + * + * Parameters: + * t: tree + * h: current page + * key: key + * exactp: pointer to exact match flag + * + * Returns: + * If an exact match found. + */ +static int +__bt_sprev(BTREE *t, PAGE *h, const DBT *key, int *exactp) +{ + EPG e; + + /* + * Get the previous page. The key is either an exact + * match, or not as good as the one we already have. + */ + if ((e.page = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL) + return (0); + e.index = NEXTINDEX(e.page) - 1; + if (__bt_cmp(t, key, &e) == 0) { + mpool_put(t->bt_mp, h, 0); + t->bt_cur = e; + *exactp = 1; + return (1); + } + mpool_put(t->bt_mp, e.page, 0); + return (0); +} diff --git a/db/btree/FreeBSD/bt_seq.c b/db/btree/FreeBSD/bt_seq.c new file mode 100644 index 0000000..1521ca2 --- /dev/null +++ b/db/btree/FreeBSD/bt_seq.c @@ -0,0 +1,442 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_seq.c 8.7 (Berkeley) 7/20/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_seq.c,v 1.7 2009/03/04 00:58:04 delphij Exp $"); + +#include + +#include +#include +#include +#include + +#include +#include "btree.h" + +static int __bt_first(BTREE *, const DBT *, EPG *, int *); +static int __bt_seqadv(BTREE *, EPG *, int); +static int __bt_seqset(BTREE *, EPG *, DBT *, int); + +/* + * Sequential scan support. + * + * The tree can be scanned sequentially, starting from either end of the + * tree or from any specific key. A scan request before any scanning is + * done is initialized as starting from the least node. + */ + +/* + * __bt_seq -- + * Btree sequential scan interface. + * + * Parameters: + * dbp: pointer to access method + * key: key for positioning and return value + * data: data return value + * flags: R_CURSOR, R_FIRST, R_LAST, R_NEXT, R_PREV. + * + * Returns: + * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. + */ +int +__bt_seq(const DB *dbp, DBT *key, DBT *data, u_int flags) +{ + BTREE *t; + EPG e; + int status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* + * If scan unitialized as yet, or starting at a specific record, set + * the scan to a specific key. Both __bt_seqset and __bt_seqadv pin + * the page the cursor references if they're successful. + */ + switch (flags) { + case R_NEXT: + case R_PREV: + if (F_ISSET(&t->bt_cursor, CURS_INIT)) { + status = __bt_seqadv(t, &e, flags); + break; + } + /* FALLTHROUGH */ + case R_FIRST: + case R_LAST: + case R_CURSOR: + status = __bt_seqset(t, &e, key, flags); + break; + default: + errno = EINVAL; + return (RET_ERROR); + } + + if (status == RET_SUCCESS) { + __bt_setcur(t, e.page->pgno, e.index); + + status = + __bt_ret(t, &e, key, &t->bt_rkey, data, &t->bt_rdata, 0); + + /* + * If the user is doing concurrent access, we copied the + * key/data, toss the page. + */ + if (F_ISSET(t, B_DB_LOCK)) + mpool_put(t->bt_mp, e.page, 0); + else + t->bt_pinned = e.page; + } + return (status); +} + +/* + * __bt_seqset -- + * Set the sequential scan to a specific key. + * + * Parameters: + * t: tree + * ep: storage for returned key + * key: key for initial scan position + * flags: R_CURSOR, R_FIRST, R_LAST, R_NEXT, R_PREV + * + * Side effects: + * Pins the page the cursor references. + * + * Returns: + * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. + */ +static int +__bt_seqset(BTREE *t, EPG *ep, DBT *key, int flags) +{ + PAGE *h; + pgno_t pg; + int exact; + + /* + * Find the first, last or specific key in the tree and point the + * cursor at it. The cursor may not be moved until a new key has + * been found. + */ + switch (flags) { + case R_CURSOR: /* Keyed scan. */ + /* + * Find the first instance of the key or the smallest key + * which is greater than or equal to the specified key. + */ + if (key->data == NULL || key->size == 0) { + errno = EINVAL; + return (RET_ERROR); + } + return (__bt_first(t, key, ep, &exact)); + case R_FIRST: /* First record. */ + case R_NEXT: + /* Walk down the left-hand side of the tree. */ + for (pg = P_ROOT;;) { + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (RET_ERROR); + + /* Check for an empty tree. */ + if (NEXTINDEX(h) == 0) { + mpool_put(t->bt_mp, h, 0); + return (RET_SPECIAL); + } + + if (h->flags & (P_BLEAF | P_RLEAF)) + break; + pg = GETBINTERNAL(h, 0)->pgno; + mpool_put(t->bt_mp, h, 0); + } + ep->page = h; + ep->index = 0; + break; + case R_LAST: /* Last record. */ + case R_PREV: + /* Walk down the right-hand side of the tree. */ + for (pg = P_ROOT;;) { + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (RET_ERROR); + + /* Check for an empty tree. */ + if (NEXTINDEX(h) == 0) { + mpool_put(t->bt_mp, h, 0); + return (RET_SPECIAL); + } + + if (h->flags & (P_BLEAF | P_RLEAF)) + break; + pg = GETBINTERNAL(h, NEXTINDEX(h) - 1)->pgno; + mpool_put(t->bt_mp, h, 0); + } + + ep->page = h; + ep->index = NEXTINDEX(h) - 1; + break; + } + return (RET_SUCCESS); +} + +/* + * __bt_seqadvance -- + * Advance the sequential scan. + * + * Parameters: + * t: tree + * flags: R_NEXT, R_PREV + * + * Side effects: + * Pins the page the new key/data record is on. + * + * Returns: + * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. + */ +static int +__bt_seqadv(BTREE *t, EPG *ep, int flags) +{ + CURSOR *c; + PAGE *h; + indx_t idx; + pgno_t pg; + int exact; + + /* + * There are a couple of states that we can be in. The cursor has + * been initialized by the time we get here, but that's all we know. + */ + c = &t->bt_cursor; + + /* + * The cursor was deleted where there weren't any duplicate records, + * so the key was saved. Find out where that key would go in the + * current tree. It doesn't matter if the returned key is an exact + * match or not -- if it's an exact match, the record was added after + * the delete so we can just return it. If not, as long as there's + * a record there, return it. + */ + if (F_ISSET(c, CURS_ACQUIRE)) + return (__bt_first(t, &c->key, ep, &exact)); + + /* Get the page referenced by the cursor. */ + if ((h = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL) + return (RET_ERROR); + + /* + * Find the next/previous record in the tree and point the cursor at + * it. The cursor may not be moved until a new key has been found. + */ + switch (flags) { + case R_NEXT: /* Next record. */ + /* + * The cursor was deleted in duplicate records, and moved + * forward to a record that has yet to be returned. Clear + * that flag, and return the record. + */ + if (F_ISSET(c, CURS_AFTER)) + goto usecurrent; + idx = c->pg.index; + if (++idx == NEXTINDEX(h)) { + pg = h->nextpg; + mpool_put(t->bt_mp, h, 0); + if (pg == P_INVALID) + return (RET_SPECIAL); + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (RET_ERROR); + idx = 0; + } + break; + case R_PREV: /* Previous record. */ + /* + * The cursor was deleted in duplicate records, and moved + * backward to a record that has yet to be returned. Clear + * that flag, and return the record. + */ + if (F_ISSET(c, CURS_BEFORE)) { +usecurrent: F_CLR(c, CURS_AFTER | CURS_BEFORE); + ep->page = h; + ep->index = c->pg.index; + return (RET_SUCCESS); + } + idx = c->pg.index; + if (idx == 0) { + pg = h->prevpg; + mpool_put(t->bt_mp, h, 0); + if (pg == P_INVALID) + return (RET_SPECIAL); + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (RET_ERROR); + idx = NEXTINDEX(h) - 1; + } else + --idx; + break; + } + + ep->page = h; + ep->index = idx; + return (RET_SUCCESS); +} + +/* + * __bt_first -- + * Find the first entry. + * + * Parameters: + * t: the tree + * key: the key + * erval: return EPG + * exactp: pointer to exact match flag + * + * Returns: + * The first entry in the tree greater than or equal to key, + * or RET_SPECIAL if no such key exists. + */ +static int +__bt_first(BTREE *t, const DBT *key, EPG *erval, int *exactp) +{ + PAGE *h; + EPG *ep, save; + pgno_t pg; + + /* + * Find any matching record; __bt_search pins the page. + * + * If it's an exact match and duplicates are possible, walk backwards + * in the tree until we find the first one. Otherwise, make sure it's + * a valid key (__bt_search may return an index just past the end of a + * page) and return it. + */ + if ((ep = __bt_search(t, key, exactp)) == NULL) + return (RET_SPECIAL); + if (*exactp) { + if (F_ISSET(t, B_NODUPS)) { + *erval = *ep; + return (RET_SUCCESS); + } + + /* + * Walk backwards, as long as the entry matches and there are + * keys left in the tree. Save a copy of each match in case + * we go too far. + */ + save = *ep; + h = ep->page; + do { + if (save.page->pgno != ep->page->pgno) { + mpool_put(t->bt_mp, save.page, 0); + save = *ep; + } else + save.index = ep->index; + + /* + * Don't unpin the page the last (or original) match + * was on, but make sure it's unpinned if an error + * occurs. + */ + if (ep->index == 0) { + PAGE *hprev; + if (h->prevpg == P_INVALID) + break; + if (h->pgno != save.page->pgno) + mpool_put(t->bt_mp, h, 0); + if ((hprev = mpool_get(t->bt_mp, + h->prevpg, 0)) == NULL) { + if (h->pgno == save.page->pgno) + mpool_put(t->bt_mp, + save.page, 0); + return (RET_ERROR); + } + ep->page = h = hprev; + ep->index = NEXTINDEX(h); + } + --ep->index; + } while (__bt_cmp(t, key, ep) == 0); + + /* + * Reach here with the last page that was looked at pinned, + * which may or may not be the same as the last (or original) + * match page. If it's not useful, release it. + */ + if (h->pgno != save.page->pgno) + mpool_put(t->bt_mp, h, 0); + + *erval = save; + return (RET_SUCCESS); + } + + /* If at the end of a page, find the next entry. */ + if (ep->index == NEXTINDEX(ep->page)) { + h = ep->page; + pg = h->nextpg; + mpool_put(t->bt_mp, h, 0); + if (pg == P_INVALID) + return (RET_SPECIAL); + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (RET_ERROR); + ep->index = 0; + ep->page = h; + } + *erval = *ep; + return (RET_SUCCESS); +} + +/* + * __bt_setcur -- + * Set the cursor to an entry in the tree. + * + * Parameters: + * t: the tree + * pgno: page number + * idx: page index + */ +void +__bt_setcur(BTREE *t, pgno_t pgno, u_int idx) +{ + /* Lose any already deleted key. */ + if (t->bt_cursor.key.data != NULL) { + free(t->bt_cursor.key.data); + t->bt_cursor.key.size = 0; + t->bt_cursor.key.data = NULL; + } + F_CLR(&t->bt_cursor, CURS_ACQUIRE | CURS_AFTER | CURS_BEFORE); + + /* Update the cursor. */ + t->bt_cursor.pg.pgno = pgno; + t->bt_cursor.pg.index = idx; + F_SET(&t->bt_cursor, CURS_INIT); +} diff --git a/db/btree/FreeBSD/bt_split.c b/db/btree/FreeBSD/bt_split.c new file mode 100644 index 0000000..3e93e20 --- /dev/null +++ b/db/btree/FreeBSD/bt_split.c @@ -0,0 +1,796 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_split.c 8.9 (Berkeley) 7/26/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_split.c,v 1.12 2009/03/28 05:45:29 delphij Exp $"); + +#include + +#include +#include +#include +#include + +#include +#include "btree.h" + +static int bt_broot(BTREE *, PAGE *, PAGE *, PAGE *); +static PAGE *bt_page(BTREE *, PAGE *, PAGE **, PAGE **, indx_t *, size_t); +static int bt_preserve(BTREE *, pgno_t); +static PAGE *bt_psplit(BTREE *, PAGE *, PAGE *, PAGE *, indx_t *, size_t); +static PAGE *bt_root(BTREE *, PAGE *, PAGE **, PAGE **, indx_t *, size_t); +static int bt_rroot(BTREE *, PAGE *, PAGE *, PAGE *); +static recno_t rec_total(PAGE *); + +#ifdef STATISTICS +u_long bt_rootsplit, bt_split, bt_sortsplit, bt_pfxsaved; +#endif + +/* + * __BT_SPLIT -- Split the tree. + * + * Parameters: + * t: tree + * sp: page to split + * key: key to insert + * data: data to insert + * flags: BIGKEY/BIGDATA flags + * ilen: insert length + * skip: index to leave open + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__bt_split(BTREE *t, PAGE *sp, const DBT *key, const DBT *data, int flags, + size_t ilen, u_int32_t argskip) +{ + BINTERNAL *bi; + BLEAF *bl, *tbl; + DBT a, b; + EPGNO *parent; + PAGE *h, *l, *r, *lchild, *rchild; + indx_t nxtindex; + u_int16_t skip; + u_int32_t n, nbytes, nksize; + int parentsplit; + char *dest; + + /* + * Split the page into two pages, l and r. The split routines return + * a pointer to the page into which the key should be inserted and with + * skip set to the offset which should be used. Additionally, l and r + * are pinned. + */ + skip = argskip; + h = sp->pgno == P_ROOT ? + bt_root(t, sp, &l, &r, &skip, ilen) : + bt_page(t, sp, &l, &r, &skip, ilen); + if (h == NULL) + return (RET_ERROR); + + /* + * Insert the new key/data pair into the leaf page. (Key inserts + * always cause a leaf page to split first.) + */ + h->linp[skip] = h->upper -= ilen; + dest = (char *)h + h->upper; + if (F_ISSET(t, R_RECNO)) + WR_RLEAF(dest, data, flags) + else + WR_BLEAF(dest, key, data, flags) + + /* If the root page was split, make it look right. */ + if (sp->pgno == P_ROOT && + (F_ISSET(t, R_RECNO) ? + bt_rroot(t, sp, l, r) : bt_broot(t, sp, l, r)) == RET_ERROR) + goto err2; + + /* + * Now we walk the parent page stack -- a LIFO stack of the pages that + * were traversed when we searched for the page that split. Each stack + * entry is a page number and a page index offset. The offset is for + * the page traversed on the search. We've just split a page, so we + * have to insert a new key into the parent page. + * + * If the insert into the parent page causes it to split, may have to + * continue splitting all the way up the tree. We stop if the root + * splits or the page inserted into didn't have to split to hold the + * new key. Some algorithms replace the key for the old page as well + * as the new page. We don't, as there's no reason to believe that the + * first key on the old page is any better than the key we have, and, + * in the case of a key being placed at index 0 causing the split, the + * key is unavailable. + * + * There are a maximum of 5 pages pinned at any time. We keep the left + * and right pages pinned while working on the parent. The 5 are the + * two children, left parent and right parent (when the parent splits) + * and the root page or the overflow key page when calling bt_preserve. + * This code must make sure that all pins are released other than the + * root page or overflow page which is unlocked elsewhere. + */ + while ((parent = BT_POP(t)) != NULL) { + lchild = l; + rchild = r; + + /* Get the parent page. */ + if ((h = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL) + goto err2; + + /* + * The new key goes ONE AFTER the index, because the split + * was to the right. + */ + skip = parent->index + 1; + + /* + * Calculate the space needed on the parent page. + * + * Prefix trees: space hack when inserting into BINTERNAL + * pages. Retain only what's needed to distinguish between + * the new entry and the LAST entry on the page to its left. + * If the keys compare equal, retain the entire key. Note, + * we don't touch overflow keys, and the entire key must be + * retained for the next-to-left most key on the leftmost + * page of each level, or the search will fail. Applicable + * ONLY to internal pages that have leaf pages as children. + * Further reduction of the key between pairs of internal + * pages loses too much information. + */ + switch (rchild->flags & P_TYPE) { + case P_BINTERNAL: + bi = GETBINTERNAL(rchild, 0); + nbytes = NBINTERNAL(bi->ksize); + break; + case P_BLEAF: + bl = GETBLEAF(rchild, 0); + nbytes = NBINTERNAL(bl->ksize); + if (t->bt_pfx && !(bl->flags & P_BIGKEY) && + (h->prevpg != P_INVALID || skip > 1)) { + tbl = GETBLEAF(lchild, NEXTINDEX(lchild) - 1); + a.size = tbl->ksize; + a.data = tbl->bytes; + b.size = bl->ksize; + b.data = bl->bytes; + nksize = t->bt_pfx(&a, &b); + n = NBINTERNAL(nksize); + if (n < nbytes) { +#ifdef STATISTICS + bt_pfxsaved += nbytes - n; +#endif + nbytes = n; + } else + nksize = 0; + } else + nksize = 0; + break; + case P_RINTERNAL: + case P_RLEAF: + nbytes = NRINTERNAL; + break; + default: + LIBC_ABORT("illegal rchild->flags & P_TYPE (0x%x)", rchild->flags & P_TYPE); + } + + /* Split the parent page if necessary or shift the indices. */ + if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) { + sp = h; + h = h->pgno == P_ROOT ? + bt_root(t, h, &l, &r, &skip, nbytes) : + bt_page(t, h, &l, &r, &skip, nbytes); + if (h == NULL) + goto err1; + parentsplit = 1; + } else { + if (skip < (nxtindex = NEXTINDEX(h))) + memmove(h->linp + skip + 1, h->linp + skip, + (nxtindex - skip) * sizeof(indx_t)); + h->lower += sizeof(indx_t); + parentsplit = 0; + } + + /* Insert the key into the parent page. */ + switch (rchild->flags & P_TYPE) { + case P_BINTERNAL: + h->linp[skip] = h->upper -= nbytes; + dest = (char *)h + h->linp[skip]; + memmove(dest, bi, nbytes); + ((BINTERNAL *)dest)->pgno = rchild->pgno; + break; + case P_BLEAF: + h->linp[skip] = h->upper -= nbytes; + dest = (char *)h + h->linp[skip]; + WR_BINTERNAL(dest, nksize ? nksize : bl->ksize, + rchild->pgno, bl->flags & P_BIGKEY); + memmove(dest, bl->bytes, nksize ? nksize : bl->ksize); + if (bl->flags & P_BIGKEY && + bt_preserve(t, *(pgno_t *)bl->bytes) == RET_ERROR) + goto err1; + break; + case P_RINTERNAL: + /* + * Update the left page count. If split + * added at index 0, fix the correct page. + */ + if (skip > 0) + dest = (char *)h + h->linp[skip - 1]; + else + dest = (char *)l + l->linp[NEXTINDEX(l) - 1]; + ((RINTERNAL *)dest)->nrecs = rec_total(lchild); + ((RINTERNAL *)dest)->pgno = lchild->pgno; + + /* Update the right page count. */ + h->linp[skip] = h->upper -= nbytes; + dest = (char *)h + h->linp[skip]; + ((RINTERNAL *)dest)->nrecs = rec_total(rchild); + ((RINTERNAL *)dest)->pgno = rchild->pgno; + break; + case P_RLEAF: + /* + * Update the left page count. If split + * added at index 0, fix the correct page. + */ + if (skip > 0) + dest = (char *)h + h->linp[skip - 1]; + else + dest = (char *)l + l->linp[NEXTINDEX(l) - 1]; + ((RINTERNAL *)dest)->nrecs = NEXTINDEX(lchild); + ((RINTERNAL *)dest)->pgno = lchild->pgno; + + /* Update the right page count. */ + h->linp[skip] = h->upper -= nbytes; + dest = (char *)h + h->linp[skip]; + ((RINTERNAL *)dest)->nrecs = NEXTINDEX(rchild); + ((RINTERNAL *)dest)->pgno = rchild->pgno; + break; + default: + LIBC_ABORT("illegal rchild->flags & P_TYPE (0x%x)", rchild->flags & P_TYPE); + } + + /* Unpin the held pages. */ + if (!parentsplit) { + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + break; + } + + /* If the root page was split, make it look right. */ + if (sp->pgno == P_ROOT && + (F_ISSET(t, R_RECNO) ? + bt_rroot(t, sp, l, r) : bt_broot(t, sp, l, r)) == RET_ERROR) + goto err1; + + mpool_put(t->bt_mp, lchild, MPOOL_DIRTY); + mpool_put(t->bt_mp, rchild, MPOOL_DIRTY); + } + + /* Unpin the held pages. */ + mpool_put(t->bt_mp, l, MPOOL_DIRTY); + mpool_put(t->bt_mp, r, MPOOL_DIRTY); + + /* Clear any pages left on the stack. */ + return (RET_SUCCESS); + + /* + * If something fails in the above loop we were already walking back + * up the tree and the tree is now inconsistent. Nothing much we can + * do about it but release any memory we're holding. + */ +err1: mpool_put(t->bt_mp, lchild, MPOOL_DIRTY); + mpool_put(t->bt_mp, rchild, MPOOL_DIRTY); + +err2: mpool_put(t->bt_mp, l, 0); + mpool_put(t->bt_mp, r, 0); + __dbpanic(t->bt_dbp); + return (RET_ERROR); +} + +/* + * BT_PAGE -- Split a non-root page of a btree. + * + * Parameters: + * t: tree + * h: root page + * lp: pointer to left page pointer + * rp: pointer to right page pointer + * skip: pointer to index to leave open + * ilen: insert length + * + * Returns: + * Pointer to page in which to insert or NULL on error. + */ +static PAGE * +bt_page(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, indx_t *skip, size_t ilen) +{ + PAGE *l, *r, *tp; + pgno_t npg; + +#ifdef STATISTICS + ++bt_split; +#endif + /* Put the new right page for the split into place. */ + if ((r = __bt_new(t, &npg)) == NULL) + return (NULL); + r->pgno = npg; + r->lower = BTDATAOFF; + r->upper = t->bt_psize; + r->nextpg = h->nextpg; + r->prevpg = h->pgno; + r->flags = h->flags & P_TYPE; + + /* + * If we're splitting the last page on a level because we're appending + * a key to it (skip is NEXTINDEX()), it's likely that the data is + * sorted. Adding an empty page on the side of the level is less work + * and can push the fill factor much higher than normal. If we're + * wrong it's no big deal, we'll just do the split the right way next + * time. It may look like it's equally easy to do a similar hack for + * reverse sorted data, that is, split the tree left, but it's not. + * Don't even try. + */ + if (h->nextpg == P_INVALID && *skip == NEXTINDEX(h)) { +#ifdef STATISTICS + ++bt_sortsplit; +#endif + h->nextpg = r->pgno; + r->lower = BTDATAOFF + sizeof(indx_t); + *skip = 0; + *lp = h; + *rp = r; + return (r); + } + + /* Put the new left page for the split into place. */ + if ((l = (PAGE *)calloc(1, t->bt_psize)) == NULL) { + mpool_put(t->bt_mp, r, 0); + return (NULL); + } + l->pgno = h->pgno; + l->nextpg = r->pgno; + l->prevpg = h->prevpg; + l->lower = BTDATAOFF; + l->upper = t->bt_psize; + l->flags = h->flags & P_TYPE; + + /* Fix up the previous pointer of the page after the split page. */ + if (h->nextpg != P_INVALID) { + if ((tp = mpool_get(t->bt_mp, h->nextpg, 0)) == NULL) { + free(l); + /* XXX mpool_free(t->bt_mp, r->pgno); */ + return (NULL); + } + tp->prevpg = r->pgno; + mpool_put(t->bt_mp, tp, MPOOL_DIRTY); + } + + /* + * Split right. The key/data pairs aren't sorted in the btree page so + * it's simpler to copy the data from the split page onto two new pages + * instead of copying half the data to the right page and compacting + * the left page in place. Since the left page can't change, we have + * to swap the original and the allocated left page after the split. + */ + tp = bt_psplit(t, h, l, r, skip, ilen); + + /* Move the new left page onto the old left page. */ + memmove(h, l, t->bt_psize); + if (tp == l) + tp = h; + free(l); + + *lp = h; + *rp = r; + return (tp); +} + +/* + * BT_ROOT -- Split the root page of a btree. + * + * Parameters: + * t: tree + * h: root page + * lp: pointer to left page pointer + * rp: pointer to right page pointer + * skip: pointer to index to leave open + * ilen: insert length + * + * Returns: + * Pointer to page in which to insert or NULL on error. + */ +static PAGE * +bt_root(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, indx_t *skip, size_t ilen) +{ + PAGE *l, *r, *tp; + pgno_t lnpg, rnpg; + +#ifdef STATISTICS + ++bt_split; + ++bt_rootsplit; +#endif + /* Put the new left and right pages for the split into place. */ + if ((l = __bt_new(t, &lnpg)) == NULL || + (r = __bt_new(t, &rnpg)) == NULL) + return (NULL); + l->pgno = lnpg; + r->pgno = rnpg; + l->nextpg = r->pgno; + r->prevpg = l->pgno; + l->prevpg = r->nextpg = P_INVALID; + l->lower = r->lower = BTDATAOFF; + l->upper = r->upper = t->bt_psize; + l->flags = r->flags = h->flags & P_TYPE; + + /* Split the root page. */ + tp = bt_psplit(t, h, l, r, skip, ilen); + + *lp = l; + *rp = r; + return (tp); +} + +/* + * BT_RROOT -- Fix up the recno root page after it has been split. + * + * Parameters: + * t: tree + * h: root page + * l: left page + * r: right page + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +static int +bt_rroot(BTREE *t, PAGE *h, PAGE *l, PAGE *r) +{ + char *dest; + + /* Insert the left and right keys, set the header information. */ + h->linp[0] = h->upper = t->bt_psize - NRINTERNAL; + dest = (char *)h + h->upper; + WR_RINTERNAL(dest, + l->flags & P_RLEAF ? NEXTINDEX(l) : rec_total(l), l->pgno); + + h->linp[1] = h->upper -= NRINTERNAL; + dest = (char *)h + h->upper; + WR_RINTERNAL(dest, + r->flags & P_RLEAF ? NEXTINDEX(r) : rec_total(r), r->pgno); + + h->lower = BTDATAOFF + 2 * sizeof(indx_t); + + /* Unpin the root page, set to recno internal page. */ + h->flags &= ~P_TYPE; + h->flags |= P_RINTERNAL; + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + + return (RET_SUCCESS); +} + +/* + * BT_BROOT -- Fix up the btree root page after it has been split. + * + * Parameters: + * t: tree + * h: root page + * l: left page + * r: right page + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +static int +bt_broot(BTREE *t, PAGE *h, PAGE *l, PAGE *r) +{ + BINTERNAL *bi; + BLEAF *bl; + u_int32_t nbytes; + char *dest; + + /* + * If the root page was a leaf page, change it into an internal page. + * We copy the key we split on (but not the key's data, in the case of + * a leaf page) to the new root page. + * + * The btree comparison code guarantees that the left-most key on any + * level of the tree is never used, so it doesn't need to be filled in. + */ + nbytes = NBINTERNAL(0); + h->linp[0] = h->upper = t->bt_psize - nbytes; + dest = (char *)h + h->upper; + WR_BINTERNAL(dest, 0, l->pgno, 0); + + switch (h->flags & P_TYPE) { + case P_BLEAF: + bl = GETBLEAF(r, 0); + nbytes = NBINTERNAL(bl->ksize); + h->linp[1] = h->upper -= nbytes; + dest = (char *)h + h->upper; + WR_BINTERNAL(dest, bl->ksize, r->pgno, 0); + memmove(dest, bl->bytes, bl->ksize); + + /* + * If the key is on an overflow page, mark the overflow chain + * so it isn't deleted when the leaf copy of the key is deleted. + */ + if (bl->flags & P_BIGKEY && + bt_preserve(t, *(pgno_t *)bl->bytes) == RET_ERROR) + return (RET_ERROR); + break; + case P_BINTERNAL: + bi = GETBINTERNAL(r, 0); + nbytes = NBINTERNAL(bi->ksize); + h->linp[1] = h->upper -= nbytes; + dest = (char *)h + h->upper; + memmove(dest, bi, nbytes); + ((BINTERNAL *)dest)->pgno = r->pgno; + break; + default: + LIBC_ABORT("illegal h->flags & P_TYPE (0x%x)", h->flags & P_TYPE); + } + + /* There are two keys on the page. */ + h->lower = BTDATAOFF + 2 * sizeof(indx_t); + + /* Unpin the root page, set to btree internal page. */ + h->flags &= ~P_TYPE; + h->flags |= P_BINTERNAL; + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + + return (RET_SUCCESS); +} + +/* + * BT_PSPLIT -- Do the real work of splitting the page. + * + * Parameters: + * t: tree + * h: page to be split + * l: page to put lower half of data + * r: page to put upper half of data + * pskip: pointer to index to leave open + * ilen: insert length + * + * Returns: + * Pointer to page in which to insert. + */ +static PAGE * +bt_psplit(BTREE *t, PAGE *h, PAGE *l, PAGE *r, indx_t *pskip, size_t ilen) +{ + BINTERNAL *bi; + BLEAF *bl; + CURSOR *c; + RLEAF *rl; + PAGE *rval; + void *src; + indx_t full, half, nxt, off, skip, top, used; + u_int32_t nbytes; + int bigkeycnt, isbigkey; + + /* + * Split the data to the left and right pages. Leave the skip index + * open. Additionally, make some effort not to split on an overflow + * key. This makes internal page processing faster and can save + * space as overflow keys used by internal pages are never deleted. + */ + bigkeycnt = 0; + skip = *pskip; + full = t->bt_psize - BTDATAOFF; + half = full / 2; + used = 0; + for (nxt = off = 0, top = NEXTINDEX(h); nxt < top; ++off) { + if (skip == off) { + nbytes = ilen; + isbigkey = 0; /* XXX: not really known. */ + } else + switch (h->flags & P_TYPE) { + case P_BINTERNAL: + src = bi = GETBINTERNAL(h, nxt); + nbytes = NBINTERNAL(bi->ksize); + isbigkey = bi->flags & P_BIGKEY; + break; + case P_BLEAF: + src = bl = GETBLEAF(h, nxt); + nbytes = NBLEAF(bl); + isbigkey = bl->flags & P_BIGKEY; + break; + case P_RINTERNAL: + src = GETRINTERNAL(h, nxt); + nbytes = NRINTERNAL; + isbigkey = 0; + break; + case P_RLEAF: + src = rl = GETRLEAF(h, nxt); + nbytes = NRLEAF(rl); + isbigkey = 0; + break; + default: + LIBC_ABORT("illegal h->flags & P_TYPE (0x%x)", h->flags & P_TYPE); + } + + /* + * If the key/data pairs are substantial fractions of the max + * possible size for the page, it's possible to get situations + * where we decide to try and copy too much onto the left page. + * Make sure that doesn't happen. + */ + if ((skip <= off && used + nbytes + sizeof(indx_t) >= full) + || nxt == top - 1) { + --off; + break; + } + + /* Copy the key/data pair, if not the skipped index. */ + if (skip != off) { + ++nxt; + + l->linp[off] = l->upper -= nbytes; + memmove((char *)l + l->upper, src, nbytes); + } + + used += nbytes + sizeof(indx_t); + if (used >= half) { + if (!isbigkey || bigkeycnt == 3) + break; + else + ++bigkeycnt; + } + } + + /* + * Off is the last offset that's valid for the left page. + * Nxt is the first offset to be placed on the right page. + */ + l->lower += (off + 1) * sizeof(indx_t); + + /* + * If splitting the page that the cursor was on, the cursor has to be + * adjusted to point to the same record as before the split. If the + * cursor is at or past the skipped slot, the cursor is incremented by + * one. If the cursor is on the right page, it is decremented by the + * number of records split to the left page. + */ + c = &t->bt_cursor; + if (F_ISSET(c, CURS_INIT) && c->pg.pgno == h->pgno) { + if (c->pg.index >= skip) + ++c->pg.index; + if (c->pg.index < nxt) /* Left page. */ + c->pg.pgno = l->pgno; + else { /* Right page. */ + c->pg.pgno = r->pgno; + c->pg.index -= nxt; + } + } + + /* + * If the skipped index was on the left page, just return that page. + * Otherwise, adjust the skip index to reflect the new position on + * the right page. + */ + if (skip <= off) { + skip = MAX_PAGE_OFFSET; + rval = l; + } else { + rval = r; + *pskip -= nxt; + } + + for (off = 0; nxt < top; ++off) { + if (skip == nxt) { + ++off; + skip = MAX_PAGE_OFFSET; + } + switch (h->flags & P_TYPE) { + case P_BINTERNAL: + src = bi = GETBINTERNAL(h, nxt); + nbytes = NBINTERNAL(bi->ksize); + break; + case P_BLEAF: + src = bl = GETBLEAF(h, nxt); + nbytes = NBLEAF(bl); + break; + case P_RINTERNAL: + src = GETRINTERNAL(h, nxt); + nbytes = NRINTERNAL; + break; + case P_RLEAF: + src = rl = GETRLEAF(h, nxt); + nbytes = NRLEAF(rl); + break; + default: + LIBC_ABORT("illegal h->flags & P_TYPE (0x%x)", h->flags & P_TYPE); + } + ++nxt; + r->linp[off] = r->upper -= nbytes; + memmove((char *)r + r->upper, src, nbytes); + } + r->lower += off * sizeof(indx_t); + + /* If the key is being appended to the page, adjust the index. */ + if (skip == top) + r->lower += sizeof(indx_t); + + return (rval); +} + +/* + * BT_PRESERVE -- Mark a chain of pages as used by an internal node. + * + * Chains of indirect blocks pointed to by leaf nodes get reclaimed when the + * record that references them gets deleted. Chains pointed to by internal + * pages never get deleted. This routine marks a chain as pointed to by an + * internal page. + * + * Parameters: + * t: tree + * pg: page number of first page in the chain. + * + * Returns: + * RET_SUCCESS, RET_ERROR. + */ +static int +bt_preserve(BTREE *t, pgno_t pg) +{ + PAGE *h; + + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + return (RET_ERROR); + h->flags |= P_PRESERVE; + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + return (RET_SUCCESS); +} + +/* + * REC_TOTAL -- Return the number of recno entries below a page. + * + * Parameters: + * h: page + * + * Returns: + * The number of recno entries below a page. + * + * XXX + * These values could be set by the bt_psplit routine. The problem is that the + * entry has to be popped off of the stack etc. or the values have to be passed + * all the way back to bt_split/bt_rroot and it's not very clean. + */ +static recno_t +rec_total(PAGE *h) +{ + recno_t recs; + indx_t nxt, top; + + for (recs = 0, nxt = 0, top = NEXTINDEX(h); nxt < top; ++nxt) + recs += GETRINTERNAL(h, nxt)->nrecs; + return (recs); +} diff --git a/db/btree/FreeBSD/bt_utils.c b/db/btree/FreeBSD/bt_utils.c new file mode 100644 index 0000000..27d745b --- /dev/null +++ b/db/btree/FreeBSD/bt_utils.c @@ -0,0 +1,246 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bt_utils.c 8.8 (Berkeley) 7/20/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/btree/bt_utils.c,v 1.7 2009/03/05 00:57:01 delphij Exp $"); + +#include + +#include +#include +#include + +#include +#include "btree.h" + +/* + * __bt_ret -- + * Build return key/data pair. + * + * Parameters: + * t: tree + * e: key/data pair to be returned + * key: user's key structure (NULL if not to be filled in) + * rkey: memory area to hold key + * data: user's data structure (NULL if not to be filled in) + * rdata: memory area to hold data + * copy: always copy the key/data item + * + * Returns: + * RET_SUCCESS, RET_ERROR. + */ +int +__bt_ret(BTREE *t, EPG *e, DBT *key, DBT *rkey, DBT *data, DBT *rdata, int copy) +{ + BLEAF *bl; + void *p; + + bl = GETBLEAF(e->page, e->index); + + /* + * We must copy big keys/data to make them contigous. Otherwise, + * leave the page pinned and don't copy unless the user specified + * concurrent access. + */ + if (key == NULL) + goto dataonly; + + if (bl->flags & P_BIGKEY) { + if (__ovfl_get(t, bl->bytes, + &key->size, &rkey->data, &rkey->size)) + return (RET_ERROR); + key->data = rkey->data; + } else if (copy || F_ISSET(t, B_DB_LOCK)) { + if (bl->ksize > rkey->size) { + p = realloc(rkey->data, bl->ksize); + if (p == NULL) + return (RET_ERROR); + rkey->data = p; + rkey->size = bl->ksize; + } + memmove(rkey->data, bl->bytes, bl->ksize); + key->size = bl->ksize; + key->data = rkey->data; + } else { + key->size = bl->ksize; + key->data = bl->bytes; + } + +dataonly: + if (data == NULL) + return (RET_SUCCESS); + + if (bl->flags & P_BIGDATA) { + if (__ovfl_get(t, bl->bytes + bl->ksize, + &data->size, &rdata->data, &rdata->size)) + return (RET_ERROR); + data->data = rdata->data; + } else if (copy || F_ISSET(t, B_DB_LOCK)) { + /* Use +1 in case the first record retrieved is 0 length. */ + if (bl->dsize + 1 > rdata->size) { + p = realloc(rdata->data, bl->dsize + 1); + if (p == NULL) + return (RET_ERROR); + rdata->data = p; + rdata->size = bl->dsize + 1; + } + memmove(rdata->data, bl->bytes + bl->ksize, bl->dsize); + data->size = bl->dsize; + data->data = rdata->data; + } else { + data->size = bl->dsize; + data->data = bl->bytes + bl->ksize; + } + + return (RET_SUCCESS); +} + +/* + * __BT_CMP -- Compare a key to a given record. + * + * Parameters: + * t: tree + * k1: DBT pointer of first arg to comparison + * e: pointer to EPG for comparison + * + * Returns: + * < 0 if k1 is < record + * = 0 if k1 is = record + * > 0 if k1 is > record + */ +int +__bt_cmp(BTREE *t, const DBT *k1, EPG *e) +{ + BINTERNAL *bi; + BLEAF *bl; + DBT k2; + PAGE *h; + void *bigkey; + + /* + * The left-most key on internal pages, at any level of the tree, is + * guaranteed by the following code to be less than any user key. + * This saves us from having to update the leftmost key on an internal + * page when the user inserts a new key in the tree smaller than + * anything we've yet seen. + */ + h = e->page; + if (e->index == 0 && h->prevpg == P_INVALID && !(h->flags & P_BLEAF)) + return (1); + + bigkey = NULL; + if (h->flags & P_BLEAF) { + bl = GETBLEAF(h, e->index); + if (bl->flags & P_BIGKEY) + bigkey = bl->bytes; + else { + k2.data = bl->bytes; + k2.size = bl->ksize; + } + } else { + bi = GETBINTERNAL(h, e->index); + if (bi->flags & P_BIGKEY) + bigkey = bi->bytes; + else { + k2.data = bi->bytes; + k2.size = bi->ksize; + } + } + + if (bigkey) { + if (__ovfl_get(t, bigkey, + &k2.size, &t->bt_rdata.data, &t->bt_rdata.size)) + return (RET_ERROR); + k2.data = t->bt_rdata.data; + } + return ((*t->bt_cmp)(k1, &k2)); +} + +/* + * __BT_DEFCMP -- Default comparison routine. + * + * Parameters: + * a: DBT #1 + * b: DBT #2 + * + * Returns: + * < 0 if a is < b + * = 0 if a is = b + * > 0 if a is > b + */ +int +__bt_defcmp(const DBT *a, const DBT *b) +{ + size_t len; + u_char *p1, *p2; + + /* + * XXX + * If a size_t doesn't fit in an int, this routine can lose. + * What we need is an integral type which is guaranteed to be + * larger than a size_t, and there is no such thing. + */ + len = MIN(a->size, b->size); + for (p1 = a->data, p2 = b->data; len--; ++p1, ++p2) + if (*p1 != *p2) + return ((int)*p1 - (int)*p2); + return ((int)a->size - (int)b->size); +} + +/* + * __BT_DEFPFX -- Default prefix routine. + * + * Parameters: + * a: DBT #1 + * b: DBT #2 + * + * Returns: + * Number of bytes needed to distinguish b from a. + */ +size_t +__bt_defpfx(const DBT *a, const DBT *b) +{ + u_char *p1, *p2; + size_t cnt, len; + + cnt = 1; + len = MIN(a->size, b->size); + for (p1 = a->data, p2 = b->data; len--; ++p1, ++p2, ++cnt) + if (*p1 != *p2) + return (cnt); + + /* a->size must be <= b->size, or they wouldn't be in this order. */ + return (a->size < b->size ? a->size + 1 : a->size); +} diff --git a/db/btree/FreeBSD/btree.h b/db/btree/FreeBSD/btree.h new file mode 100644 index 0000000..c7c1f0f --- /dev/null +++ b/db/btree/FreeBSD/btree.h @@ -0,0 +1,380 @@ +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)btree.h 8.11 (Berkeley) 8/17/94 + * $FreeBSD: src/lib/libc/db/btree/btree.h,v 1.5 2009/03/04 00:58:04 delphij Exp $ + */ + +/* Macros to set/clear/test flags. */ +#define F_SET(p, f) (p)->flags |= (f) +#define F_CLR(p, f) (p)->flags &= ~(f) +#define F_ISSET(p, f) ((p)->flags & (f)) + +#include + +#define DEFMINKEYPAGE (2) /* Minimum keys per page */ +#define MINCACHE (5) /* Minimum cached pages */ +#define MINPSIZE (512) /* Minimum page size */ + +/* + * Page 0 of a btree file contains a copy of the meta-data. This page is also + * used as an out-of-band page, i.e. page pointers that point to nowhere point + * to page 0. Page 1 is the root of the btree. + */ +#define P_INVALID 0 /* Invalid tree page number. */ +#define P_META 0 /* Tree metadata page number. */ +#define P_ROOT 1 /* Tree root page number. */ + +/* + * There are five page layouts in the btree: btree internal pages (BINTERNAL), + * btree leaf pages (BLEAF), recno internal pages (RINTERNAL), recno leaf pages + * (RLEAF) and overflow pages. All five page types have a page header (PAGE). + * This implementation requires that values within structures NOT be padded. + * (ANSI C permits random padding.) If your compiler pads randomly you'll have + * to do some work to get this package to run. + */ +typedef struct _page { + pgno_t pgno; /* this page's page number */ + pgno_t prevpg; /* left sibling */ + pgno_t nextpg; /* right sibling */ + +#define P_BINTERNAL 0x01 /* btree internal page */ +#define P_BLEAF 0x02 /* leaf page */ +#define P_OVERFLOW 0x04 /* overflow page */ +#define P_RINTERNAL 0x08 /* recno internal page */ +#define P_RLEAF 0x10 /* leaf page */ +#define P_TYPE 0x1f /* type mask */ +#define P_PRESERVE 0x20 /* never delete this chain of pages */ + u_int32_t flags; + + indx_t lower; /* lower bound of free space on page */ + indx_t upper; /* upper bound of free space on page */ + indx_t linp[1]; /* indx_t-aligned VAR. LENGTH DATA */ +} PAGE; + +/* First and next index. */ +#define BTDATAOFF \ + (sizeof(pgno_t) + sizeof(pgno_t) + sizeof(pgno_t) + \ + sizeof(u_int32_t) + sizeof(indx_t) + sizeof(indx_t)) +#define NEXTINDEX(p) (((p)->lower - BTDATAOFF) / sizeof(indx_t)) + +/* + * For pages other than overflow pages, there is an array of offsets into the + * rest of the page immediately following the page header. Each offset is to + * an item which is unique to the type of page. The h_lower offset is just + * past the last filled-in index. The h_upper offset is the first item on the + * page. Offsets are from the beginning of the page. + * + * If an item is too big to store on a single page, a flag is set and the item + * is a { page, size } pair such that the page is the first page of an overflow + * chain with size bytes of item. Overflow pages are simply bytes without any + * external structure. + * + * The page number and size fields in the items are pgno_t-aligned so they can + * be manipulated without copying. (This presumes that 32 bit items can be + * manipulated on this system.) + */ +#define LALIGN(n) (((n) + sizeof(pgno_t) - 1) & ~(sizeof(pgno_t) - 1)) +#define NOVFLSIZE (sizeof(pgno_t) + sizeof(u_int32_t)) + +/* + * For the btree internal pages, the item is a key. BINTERNALs are {key, pgno} + * pairs, such that the key compares less than or equal to all of the records + * on that page. For a tree without duplicate keys, an internal page with two + * consecutive keys, a and b, will have all records greater than or equal to a + * and less than b stored on the page associated with a. Duplicate keys are + * somewhat special and can cause duplicate internal and leaf page records and + * some minor modifications of the above rule. + */ +typedef struct _binternal { + u_int32_t ksize; /* key size */ + pgno_t pgno; /* page number stored on */ +#define P_BIGDATA 0x01 /* overflow data */ +#define P_BIGKEY 0x02 /* overflow key */ + u_char flags; + char bytes[1]; /* data */ +} BINTERNAL; + +/* Get the page's BINTERNAL structure at index indx. */ +#define GETBINTERNAL(pg, indx) \ + ((BINTERNAL *)((char *)(pg) + (pg)->linp[indx])) + +/* Get the number of bytes in the entry. */ +#define NBINTERNAL(len) \ + LALIGN(sizeof(u_int32_t) + sizeof(pgno_t) + sizeof(u_char) + (len)) + +/* Copy a BINTERNAL entry to the page. */ +#define WR_BINTERNAL(p, size, pgno, flags) { \ + *(u_int32_t *)p = size; \ + p += sizeof(u_int32_t); \ + *(pgno_t *)p = pgno; \ + p += sizeof(pgno_t); \ + *(u_char *)p = flags; \ + p += sizeof(u_char); \ +} + +/* + * For the recno internal pages, the item is a page number with the number of + * keys found on that page and below. + */ +typedef struct _rinternal { + recno_t nrecs; /* number of records */ + pgno_t pgno; /* page number stored below */ +} RINTERNAL; + +/* Get the page's RINTERNAL structure at index indx. */ +#define GETRINTERNAL(pg, indx) \ + ((RINTERNAL *)((char *)(pg) + (pg)->linp[indx])) + +/* Get the number of bytes in the entry. */ +#define NRINTERNAL \ + LALIGN(sizeof(recno_t) + sizeof(pgno_t)) + +/* Copy a RINTERAL entry to the page. */ +#define WR_RINTERNAL(p, nrecs, pgno) { \ + *(recno_t *)p = nrecs; \ + p += sizeof(recno_t); \ + *(pgno_t *)p = pgno; \ +} + +/* For the btree leaf pages, the item is a key and data pair. */ +typedef struct _bleaf { + u_int32_t ksize; /* size of key */ + u_int32_t dsize; /* size of data */ + u_char flags; /* P_BIGDATA, P_BIGKEY */ + char bytes[1]; /* data */ +} BLEAF; + +/* Get the page's BLEAF structure at index indx. */ +#define GETBLEAF(pg, indx) \ + ((BLEAF *)((char *)(pg) + (pg)->linp[indx])) + +/* Get the number of bytes in the entry. */ +#define NBLEAF(p) NBLEAFDBT((p)->ksize, (p)->dsize) + +/* Get the number of bytes in the user's key/data pair. */ +#define NBLEAFDBT(ksize, dsize) \ + LALIGN(sizeof(u_int32_t) + sizeof(u_int32_t) + sizeof(u_char) + \ + (ksize) + (dsize)) + +/* Copy a BLEAF entry to the page. */ +#define WR_BLEAF(p, key, data, flags) { \ + *(u_int32_t *)p = key->size; \ + p += sizeof(u_int32_t); \ + *(u_int32_t *)p = data->size; \ + p += sizeof(u_int32_t); \ + *(u_char *)p = flags; \ + p += sizeof(u_char); \ + memmove(p, key->data, key->size); \ + p += key->size; \ + memmove(p, data->data, data->size); \ +} + +/* For the recno leaf pages, the item is a data entry. */ +typedef struct _rleaf { + u_int32_t dsize; /* size of data */ + u_char flags; /* P_BIGDATA */ + char bytes[1]; +} RLEAF; + +/* Get the page's RLEAF structure at index indx. */ +#define GETRLEAF(pg, indx) \ + ((RLEAF *)((char *)(pg) + (pg)->linp[indx])) + +/* Get the number of bytes in the entry. */ +#define NRLEAF(p) NRLEAFDBT((p)->dsize) + +/* Get the number of bytes from the user's data. */ +#define NRLEAFDBT(dsize) \ + LALIGN(sizeof(u_int32_t) + sizeof(u_char) + (dsize)) + +/* Copy a RLEAF entry to the page. */ +#define WR_RLEAF(p, data, flags) { \ + *(u_int32_t *)p = data->size; \ + p += sizeof(u_int32_t); \ + *(u_char *)p = flags; \ + p += sizeof(u_char); \ + memmove(p, data->data, data->size); \ +} + +/* + * A record in the tree is either a pointer to a page and an index in the page + * or a page number and an index. These structures are used as a cursor, stack + * entry and search returns as well as to pass records to other routines. + * + * One comment about searches. Internal page searches must find the largest + * record less than key in the tree so that descents work. Leaf page searches + * must find the smallest record greater than key so that the returned index + * is the record's correct position for insertion. + */ +typedef struct _epgno { + pgno_t pgno; /* the page number */ + indx_t index; /* the index on the page */ +} EPGNO; + +typedef struct _epg { + PAGE *page; /* the (pinned) page */ + indx_t index; /* the index on the page */ +} EPG; + +/* + * About cursors. The cursor (and the page that contained the key/data pair + * that it referenced) can be deleted, which makes things a bit tricky. If + * there are no duplicates of the cursor key in the tree (i.e. B_NODUPS is set + * or there simply aren't any duplicates of the key) we copy the key that it + * referenced when it's deleted, and reacquire a new cursor key if the cursor + * is used again. If there are duplicates keys, we move to the next/previous + * key, and set a flag so that we know what happened. NOTE: if duplicate (to + * the cursor) keys are added to the tree during this process, it is undefined + * if they will be returned or not in a cursor scan. + * + * The flags determine the possible states of the cursor: + * + * CURS_INIT The cursor references *something*. + * CURS_ACQUIRE The cursor was deleted, and a key has been saved so that + * we can reacquire the right position in the tree. + * CURS_AFTER, CURS_BEFORE + * The cursor was deleted, and now references a key/data pair + * that has not yet been returned, either before or after the + * deleted key/data pair. + * XXX + * This structure is broken out so that we can eventually offer multiple + * cursors as part of the DB interface. + */ +typedef struct _cursor { + EPGNO pg; /* B: Saved tree reference. */ + DBT key; /* B: Saved key, or key.data == NULL. */ + recno_t rcursor; /* R: recno cursor (1-based) */ + +#define CURS_ACQUIRE 0x01 /* B: Cursor needs to be reacquired. */ +#define CURS_AFTER 0x02 /* B: Unreturned cursor after key. */ +#define CURS_BEFORE 0x04 /* B: Unreturned cursor before key. */ +#define CURS_INIT 0x08 /* RB: Cursor initialized. */ + u_int8_t flags; +} CURSOR; + +/* + * The metadata of the tree. The nrecs field is used only by the RECNO code. + * This is because the btree doesn't really need it and it requires that every + * put or delete call modify the metadata. + */ +typedef struct _btmeta { + u_int32_t magic; /* magic number */ + u_int32_t version; /* version */ + u_int32_t psize; /* page size */ + u_int32_t free; /* page number of first free page */ + u_int32_t nrecs; /* R: number of records */ + +#define SAVEMETA (B_NODUPS | R_RECNO) + u_int32_t flags; /* bt_flags & SAVEMETA */ +} BTMETA; + +/* The in-memory btree/recno data structure. */ +typedef struct _btree { + MPOOL *bt_mp; /* memory pool cookie */ + + DB *bt_dbp; /* pointer to enclosing DB */ + + EPG bt_cur; /* current (pinned) page */ + PAGE *bt_pinned; /* page pinned across calls */ + + CURSOR bt_cursor; /* cursor */ + +#define BT_PUSH(t, p, i) { \ + t->bt_sp->pgno = p; \ + t->bt_sp->index = i; \ + ++t->bt_sp; \ +} +#define BT_POP(t) (t->bt_sp == t->bt_stack ? NULL : --t->bt_sp) +#define BT_CLR(t) (t->bt_sp = t->bt_stack) + EPGNO bt_stack[50]; /* stack of parent pages */ + EPGNO *bt_sp; /* current stack pointer */ + + DBT bt_rkey; /* returned key */ + DBT bt_rdata; /* returned data */ + + int bt_fd; /* tree file descriptor */ + + pgno_t bt_free; /* next free page */ + u_int32_t bt_psize; /* page size */ + indx_t bt_ovflsize; /* cut-off for key/data overflow */ + int bt_lorder; /* byte order */ + /* sorted order */ + enum { NOT, BACK, FORWARD } bt_order; + EPGNO bt_last; /* last insert */ + + /* B: key comparison function */ + int (*bt_cmp)(const DBT *, const DBT *); + /* B: prefix comparison function */ + size_t (*bt_pfx)(const DBT *, const DBT *); + /* R: recno input function */ + int (*bt_irec)(struct _btree *, recno_t); + + FILE *bt_rfp; /* R: record FILE pointer */ + int bt_rfd; /* R: record file descriptor */ + + caddr_t bt_cmap; /* R: current point in mapped space */ + caddr_t bt_smap; /* R: start of mapped space */ + caddr_t bt_emap; /* R: end of mapped space */ + size_t bt_msize; /* R: size of mapped region. */ + + recno_t bt_nrecs; /* R: number of records */ + size_t bt_reclen; /* R: fixed record length */ + u_char bt_bval; /* R: delimiting byte/pad character */ + +/* + * NB: + * B_NODUPS and R_RECNO are stored on disk, and may not be changed. + */ +#define B_INMEM 0x00001 /* in-memory tree */ +#define B_METADIRTY 0x00002 /* need to write metadata */ +#define B_MODIFIED 0x00004 /* tree modified */ +#define B_NEEDSWAP 0x00008 /* if byte order requires swapping */ +#define B_RDONLY 0x00010 /* read-only tree */ + +#define B_NODUPS 0x00020 /* no duplicate keys permitted */ +#define R_RECNO 0x00080 /* record oriented tree */ + +#define R_CLOSEFP 0x00040 /* opened a file pointer */ +#define R_EOF 0x00100 /* end of input file reached. */ +#define R_FIXLEN 0x00200 /* fixed length records */ +#define R_MEMMAPPED 0x00400 /* memory mapped file. */ +#define R_INMEM 0x00800 /* in-memory file */ +#define R_MODIFIED 0x01000 /* modified file */ +#define R_RDONLY 0x02000 /* read-only file */ + +#define B_DB_LOCK 0x04000 /* DB_LOCK specified. */ +#define B_DB_SHMEM 0x08000 /* DB_SHMEM specified. */ +#define B_DB_TXN 0x10000 /* DB_TXN specified. */ + u_int32_t flags; +} BTREE; + +#include "bt_extern.h" diff --git a/db/db/FreeBSD/db.c b/db/db/FreeBSD/db.c new file mode 100644 index 0000000..bc89bb0 --- /dev/null +++ b/db/db/FreeBSD/db.c @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/db/db.c,v 1.2 2002/03/22 21:52:01 obrien Exp $"); + +#include + +#include +#include +#include +#include + +#include + +DB * +dbopen(fname, flags, mode, type, openinfo) + const char *fname; + int flags, mode; + DBTYPE type; + const void *openinfo; +{ + +#define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN) +#define USE_OPEN_FLAGS \ + (O_CREAT | O_EXCL | O_EXLOCK | O_NONBLOCK | O_RDONLY | \ + O_RDWR | O_SHLOCK | O_TRUNC) + + if ((flags & ~(USE_OPEN_FLAGS | DB_FLAGS)) == 0) + switch (type) { + case DB_BTREE: + return (__bt_open(fname, flags & USE_OPEN_FLAGS, + mode, openinfo, flags & DB_FLAGS)); + case DB_HASH: + return (__hash_open(fname, flags & USE_OPEN_FLAGS, + mode, openinfo, flags & DB_FLAGS)); + case DB_RECNO: + return (__rec_open(fname, flags & USE_OPEN_FLAGS, + mode, openinfo, flags & DB_FLAGS)); + } + errno = EINVAL; + return (NULL); +} + +static int +__dberr() +{ + return (RET_ERROR); +} + +/* + * __DBPANIC -- Stop. + * + * Parameters: + * dbp: pointer to the DB structure. + */ +void +__dbpanic(dbp) + DB *dbp; +{ + /* The only thing that can succeed is a close. */ + dbp->del = (int (*)())__dberr; + dbp->fd = (int (*)())__dberr; + dbp->get = (int (*)())__dberr; + dbp->put = (int (*)())__dberr; + dbp->seq = (int (*)())__dberr; + dbp->sync = (int (*)())__dberr; +} +#pragma clang diagnostic pop diff --git a/db/hash/FreeBSD/hash.c b/db/hash/FreeBSD/hash.c new file mode 100644 index 0000000..8c9a0c4 --- /dev/null +++ b/db/hash/FreeBSD/hash.c @@ -0,0 +1,963 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/hash/hash.c,v 1.21 2009/03/28 07:20:39 delphij Exp $"); + +#include "namespace.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#ifdef DEBUG +#include +#endif +#include "un-namespace.h" + +#include +#include "hash.h" +#include "page.h" +#include "hash_extern.h" + +static int alloc_segs(HTAB *, int); +static int flush_meta(HTAB *); +static int hash_access(HTAB *, ACTION, DBT *, DBT *); +static int hash_close(DB *); +static int hash_delete(const DB *, const DBT *, u_int32_t); +static int hash_fd(const DB *); +static int hash_get(const DB *, const DBT *, DBT *, u_int32_t); +static int hash_put(const DB *, DBT *, const DBT *, u_int32_t); +static void *hash_realloc(SEGMENT **, int, int); +static int hash_seq(const DB *, DBT *, DBT *, u_int32_t); +static int hash_sync(const DB *, u_int32_t); +static int hdestroy(HTAB *); +static HTAB *init_hash(HTAB *, const char *, const HASHINFO *); +static int init_htab(HTAB *, int); +#if BYTE_ORDER == LITTLE_ENDIAN +static void swap_header(HTAB *); +static void swap_header_copy(HASHHDR *, HASHHDR *); +#endif + +/* Fast arithmetic, relying on powers of 2, */ +#define MOD(x, y) ((x) & ((y) - 1)) + +#define RETURN_ERROR(ERR, LOC) { save_errno = ERR; goto LOC; } + +/* Return values */ +#define SUCCESS (0) +#define ERROR (-1) +#define ABNORMAL (1) + +#ifdef HASH_STATISTICS +int hash_accesses, hash_collisions, hash_expansions, hash_overflows; +#endif + +/************************** INTERFACE ROUTINES ***************************/ +/* OPEN/CLOSE */ + +/* ARGSUSED */ +DB * +__hash_open(const char *file, int flags, int mode, + const HASHINFO *info, /* Special directives for create */ + int dflags) +{ + HTAB *hashp; + struct stat statbuf; + DB *dbp; + int bpages, hdrsize, new_table, nsegs, save_errno; + + if ((flags & O_ACCMODE) == O_WRONLY) { + flags += O_RDWR - O_WRONLY; /* POSIX */ + } + + if (!(hashp = (HTAB *)calloc(1, sizeof(HTAB)))) + return (NULL); + hashp->fp = -1; + + /* + * Even if user wants write only, we need to be able to read + * the actual file, so we need to open it read/write. But, the + * field in the hashp structure needs to be accurate so that + * we can check accesses. + */ + hashp->flags = flags; + + if (file) { + if ((hashp->fp = _open(file, flags, mode)) == -1) + RETURN_ERROR(errno, error0); + (void)_fcntl(hashp->fp, F_SETFD, 1); + new_table = _fstat(hashp->fp, &statbuf) == 0 && + statbuf.st_size == 0 && + ((flags & O_ACCMODE) != O_RDONLY || (flags & O_CREAT) != 0); + } else + new_table = 1; + + if (new_table) { + if (!(hashp = init_hash(hashp, file, info))) + RETURN_ERROR(errno, error1); + } else { + /* Table already exists */ + if (info && info->hash) + hashp->hash = info->hash; + else + hashp->hash = __default_hash; + + hdrsize = _read(hashp->fp, &hashp->hdr, sizeof(HASHHDR)); +#if BYTE_ORDER == LITTLE_ENDIAN + swap_header(hashp); +#endif + if (hdrsize == -1) + RETURN_ERROR(errno, error1); + if (hdrsize != sizeof(HASHHDR)) + RETURN_ERROR(EFTYPE, error1); + /* Verify file type, versions and hash function */ + if (hashp->MAGIC != HASHMAGIC) + RETURN_ERROR(EFTYPE, error1); +#define OLDHASHVERSION 1 + if (hashp->VERSION != HASHVERSION && + hashp->VERSION != OLDHASHVERSION) + RETURN_ERROR(EFTYPE, error1); + if ((int32_t)hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY) + RETURN_ERROR(EFTYPE, error1); + /* + * Figure out how many segments we need. Max_Bucket is the + * maximum bucket number, so the number of buckets is + * max_bucket + 1. + */ + nsegs = (hashp->MAX_BUCKET + 1 + hashp->SGSIZE - 1) / + hashp->SGSIZE; + if (alloc_segs(hashp, nsegs)) + /* + * If alloc_segs fails, table will have been destroyed + * and errno will have been set. + */ + return (NULL); + /* Read in bitmaps */ + bpages = (hashp->SPARES[hashp->OVFL_POINT] + + (hashp->BSIZE << BYTE_SHIFT) - 1) >> + (hashp->BSHIFT + BYTE_SHIFT); + + hashp->nmaps = bpages; + (void)memset(&hashp->mapp[0], 0, bpages * sizeof(u_int32_t *)); + } + + /* Initialize Buffer Manager */ + if (info && info->cachesize) + __buf_init(hashp, info->cachesize); + else + __buf_init(hashp, DEF_BUFSIZE); + + hashp->new_file = new_table; + hashp->save_file = file && (hashp->flags & O_RDWR); + hashp->cbucket = -1; + if (!(dbp = (DB *)malloc(sizeof(DB)))) { + save_errno = errno; + hdestroy(hashp); + errno = save_errno; + return (NULL); + } + dbp->internal = hashp; + dbp->close = hash_close; + dbp->del = hash_delete; + dbp->fd = hash_fd; + dbp->get = hash_get; + dbp->put = hash_put; + dbp->seq = hash_seq; + dbp->sync = hash_sync; + dbp->type = DB_HASH; + +#ifdef DEBUG + (void)fprintf(stderr, +"%s\n%s%p\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n%s%x\n%s%x\n%s%d\n%s%d\n", + "init_htab:", + "TABLE POINTER ", hashp, + "BUCKET SIZE ", hashp->BSIZE, + "BUCKET SHIFT ", hashp->BSHIFT, + "DIRECTORY SIZE ", hashp->DSIZE, + "SEGMENT SIZE ", hashp->SGSIZE, + "SEGMENT SHIFT ", hashp->SSHIFT, + "FILL FACTOR ", hashp->FFACTOR, + "MAX BUCKET ", hashp->MAX_BUCKET, + "OVFL POINT ", hashp->OVFL_POINT, + "LAST FREED ", hashp->LAST_FREED, + "HIGH MASK ", hashp->HIGH_MASK, + "LOW MASK ", hashp->LOW_MASK, + "NSEGS ", hashp->nsegs, + "NKEYS ", hashp->NKEYS); +#endif +#ifdef HASH_STATISTICS + hash_overflows = hash_accesses = hash_collisions = hash_expansions = 0; +#endif + return (dbp); + +error1: + if (hashp != NULL) + (void)_close(hashp->fp); + +error0: + free(hashp); + errno = save_errno; + return (NULL); +} + +static int +hash_close(DB *dbp) +{ + HTAB *hashp; + int retval; + + if (!dbp) + return (ERROR); + + hashp = (HTAB *)dbp->internal; + retval = hdestroy(hashp); + free(dbp); + return (retval); +} + +static int +hash_fd(const DB *dbp) +{ + HTAB *hashp; + + if (!dbp) + return (ERROR); + + hashp = (HTAB *)dbp->internal; + if (hashp->fp == -1) { + errno = ENOENT; + return (-1); + } + return (hashp->fp); +} + +/************************** LOCAL CREATION ROUTINES **********************/ +static HTAB * +init_hash(HTAB *hashp, const char *file, const HASHINFO *info) +{ + struct stat statbuf; + int nelem; + + nelem = 1; + hashp->NKEYS = 0; + hashp->LORDER = BYTE_ORDER; + hashp->BSIZE = DEF_BUCKET_SIZE; + hashp->BSHIFT = DEF_BUCKET_SHIFT; + hashp->SGSIZE = DEF_SEGSIZE; + hashp->SSHIFT = DEF_SEGSIZE_SHIFT; + hashp->DSIZE = DEF_DIRSIZE; + hashp->FFACTOR = DEF_FFACTOR; + hashp->hash = __default_hash; + memset(hashp->SPARES, 0, sizeof(hashp->SPARES)); + memset(hashp->BITMAPS, 0, sizeof (hashp->BITMAPS)); + + /* Fix bucket size to be optimal for file system */ + if (file != NULL) { + if (stat(file, &statbuf)) + return (NULL); + hashp->BSIZE = statbuf.st_blksize; + hashp->BSHIFT = __log2(hashp->BSIZE); + } + + if (info) { + if (info->bsize) { + /* Round pagesize up to power of 2 */ + hashp->BSHIFT = __log2(info->bsize); + hashp->BSIZE = 1 << hashp->BSHIFT; + if (hashp->BSIZE > MAX_BSIZE) { + errno = EINVAL; + return (NULL); + } + } + if (info->ffactor) + hashp->FFACTOR = info->ffactor; + if (info->hash) + hashp->hash = info->hash; + if (info->nelem) + nelem = info->nelem; + if (info->lorder) { + if (info->lorder != BIG_ENDIAN && + info->lorder != LITTLE_ENDIAN) { + errno = EINVAL; + return (NULL); + } + hashp->LORDER = info->lorder; + } + } + /* init_htab should destroy the table and set errno if it fails */ + if (init_htab(hashp, nelem)) + return (NULL); + else + return (hashp); +} +/* + * This calls alloc_segs which may run out of memory. Alloc_segs will destroy + * the table and set errno, so we just pass the error information along. + * + * Returns 0 on No Error + */ +static int +init_htab(HTAB *hashp, int nelem) +{ + int nbuckets, nsegs, l2; + + /* + * Divide number of elements by the fill factor and determine a + * desired number of buckets. Allocate space for the next greater + * power of two number of buckets. + */ + nelem = (nelem - 1) / hashp->FFACTOR + 1; + + l2 = __log2(MAX(nelem, 2)); + nbuckets = 1 << l2; + + hashp->SPARES[l2] = l2 + 1; + hashp->SPARES[l2 + 1] = l2 + 1; + hashp->OVFL_POINT = l2; + hashp->LAST_FREED = 2; + + /* First bitmap page is at: splitpoint l2 page offset 1 */ + if (__ibitmap(hashp, OADDR_OF(l2, 1), l2 + 1, 0)) + return (-1); + + hashp->MAX_BUCKET = hashp->LOW_MASK = nbuckets - 1; + hashp->HIGH_MASK = (nbuckets << 1) - 1; + hashp->HDRPAGES = ((MAX(sizeof(HASHHDR), MINHDRSIZE) - 1) >> + hashp->BSHIFT) + 1; + + nsegs = (nbuckets - 1) / hashp->SGSIZE + 1; + nsegs = 1 << __log2(nsegs); + + if (nsegs > hashp->DSIZE) + hashp->DSIZE = nsegs; + return (alloc_segs(hashp, nsegs)); +} + +/********************** DESTROY/CLOSE ROUTINES ************************/ + +/* + * Flushes any changes to the file if necessary and destroys the hashp + * structure, freeing all allocated space. + */ +static int +hdestroy(HTAB *hashp) +{ + int i, save_errno; + + save_errno = 0; + +#ifdef HASH_STATISTICS + (void)fprintf(stderr, "hdestroy: accesses %ld collisions %ld\n", + hash_accesses, hash_collisions); + (void)fprintf(stderr, "hdestroy: expansions %ld\n", + hash_expansions); + (void)fprintf(stderr, "hdestroy: overflows %ld\n", + hash_overflows); + (void)fprintf(stderr, "keys %ld maxp %d segmentcount %d\n", + hashp->NKEYS, hashp->MAX_BUCKET, hashp->nsegs); + + for (i = 0; i < NCACHED; i++) + (void)fprintf(stderr, + "spares[%d] = %d\n", i, hashp->SPARES[i]); +#endif + /* + * Call on buffer manager to free buffers, and if required, + * write them to disk. + */ + if (__buf_free(hashp, 1, hashp->save_file)) + save_errno = errno; + if (hashp->dir) { + free(*hashp->dir); /* Free initial segments */ + /* Free extra segments */ + while (hashp->exsegs--) + free(hashp->dir[--hashp->nsegs]); + free(hashp->dir); + } + if (flush_meta(hashp) && !save_errno) + save_errno = errno; + /* Free Bigmaps */ + for (i = 0; i < hashp->nmaps; i++) + if (hashp->mapp[i]) + free(hashp->mapp[i]); + if (hashp->tmp_key) + free(hashp->tmp_key); + if (hashp->tmp_buf) + free(hashp->tmp_buf); + + if (hashp->fp != -1) + (void)_close(hashp->fp); + + free(hashp); + + if (save_errno) { + errno = save_errno; + return (ERROR); + } + return (SUCCESS); +} +/* + * Write modified pages to disk + * + * Returns: + * 0 == OK + * -1 ERROR + */ +static int +hash_sync(const DB *dbp, u_int32_t flags) +{ + HTAB *hashp; + + if (flags != 0) { + errno = EINVAL; + return (ERROR); + } + + if (!dbp) + return (ERROR); + + hashp = (HTAB *)dbp->internal; + if (!hashp->save_file) + return (0); + if (__buf_free(hashp, 0, 1) || flush_meta(hashp)) + return (ERROR); + hashp->new_file = 0; + return (0); +} + +/* + * Returns: + * 0 == OK + * -1 indicates that errno should be set + */ +static int +flush_meta(HTAB *hashp) +{ + HASHHDR *whdrp; +#if BYTE_ORDER == LITTLE_ENDIAN + HASHHDR whdr; +#endif + int fp, i, wsize; + + if (!hashp->save_file) + return (0); + hashp->MAGIC = HASHMAGIC; + hashp->VERSION = HASHVERSION; + hashp->H_CHARKEY = hashp->hash(CHARKEY, sizeof(CHARKEY)); + + fp = hashp->fp; + whdrp = &hashp->hdr; +#if BYTE_ORDER == LITTLE_ENDIAN + whdrp = &whdr; + swap_header_copy(&hashp->hdr, whdrp); +#endif + if ((wsize = pwrite(fp, whdrp, sizeof(HASHHDR), (off_t)0)) == -1) + return (-1); + else + if (wsize != sizeof(HASHHDR)) { + errno = EFTYPE; + hashp->error = errno; + return (-1); + } + for (i = 0; i < NCACHED; i++) + if (hashp->mapp[i]) + if (__put_page(hashp, (char *)hashp->mapp[i], + hashp->BITMAPS[i], 0, 1)) + return (-1); + return (0); +} + +/*******************************SEARCH ROUTINES *****************************/ +/* + * All the access routines return + * + * Returns: + * 0 on SUCCESS + * 1 to indicate an external ERROR (i.e. key not found, etc) + * -1 to indicate an internal ERROR (i.e. out of memory, etc) + */ +static int +hash_get(const DB *dbp, const DBT *key, DBT *data, u_int32_t flag) +{ + HTAB *hashp; + + hashp = (HTAB *)dbp->internal; + if (flag) { + hashp->error = errno = EINVAL; + return (ERROR); + } + return (hash_access(hashp, HASH_GET, (DBT *)key, data)); +} + +static int +hash_put(const DB *dbp, DBT *key, const DBT *data, u_int32_t flag) +{ + HTAB *hashp; + + hashp = (HTAB *)dbp->internal; + if (flag && flag != R_NOOVERWRITE) { + hashp->error = errno = EINVAL; + return (ERROR); + } + if ((hashp->flags & O_ACCMODE) == O_RDONLY) { + hashp->error = errno = EPERM; + return (ERROR); + } + return (hash_access(hashp, flag == R_NOOVERWRITE ? + HASH_PUTNEW : HASH_PUT, (DBT *)key, (DBT *)data)); +} + +static int +hash_delete(const DB *dbp, const DBT *key, + u_int32_t flag) /* Ignored */ +{ + HTAB *hashp; + + hashp = (HTAB *)dbp->internal; + if (flag && flag != R_CURSOR) { + hashp->error = errno = EINVAL; + return (ERROR); + } + if ((hashp->flags & O_ACCMODE) == O_RDONLY) { + hashp->error = errno = EPERM; + return (ERROR); + } + return (hash_access(hashp, HASH_DELETE, (DBT *)key, NULL)); +} + +/* + * Assume that hashp has been set in wrapper routine. + */ +static int +hash_access(HTAB *hashp, ACTION action, DBT *key, DBT *val) +{ + BUFHEAD *rbufp; + BUFHEAD *bufp, *save_bufp; + u_int16_t *bp; + int n, ndx, off, size; + char *kp; + u_int16_t pageno; + +#ifdef HASH_STATISTICS + hash_accesses++; +#endif + + off = hashp->BSIZE; + size = key->size; + kp = (char *)key->data; + rbufp = __get_buf(hashp, __call_hash(hashp, kp, size), NULL, 0); + if (!rbufp) + return (ERROR); + save_bufp = rbufp; + + /* Pin the bucket chain */ + rbufp->flags |= BUF_PIN; + for (bp = (u_int16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;) + if (bp[1] >= REAL_KEY) { + /* Real key/data pair */ + if (size == off - *bp && + memcmp(kp, rbufp->page + *bp, size) == 0) + goto found; + off = bp[1]; +#ifdef HASH_STATISTICS + hash_collisions++; +#endif + bp += 2; + ndx += 2; + } else if (bp[1] == OVFLPAGE) { + rbufp = __get_buf(hashp, *bp, rbufp, 0); + if (!rbufp) { + save_bufp->flags &= ~BUF_PIN; + return (ERROR); + } + /* FOR LOOP INIT */ + bp = (u_int16_t *)rbufp->page; + n = *bp++; + ndx = 1; + off = hashp->BSIZE; + } else if (bp[1] < REAL_KEY) { + if ((ndx = + __find_bigpair(hashp, rbufp, ndx, kp, size)) > 0) + goto found; + if (ndx == -2) { + bufp = rbufp; + if (!(pageno = + __find_last_page(hashp, &bufp))) { + ndx = 0; + rbufp = bufp; + break; /* FOR */ + } + rbufp = __get_buf(hashp, pageno, bufp, 0); + if (!rbufp) { + save_bufp->flags &= ~BUF_PIN; + return (ERROR); + } + /* FOR LOOP INIT */ + bp = (u_int16_t *)rbufp->page; + n = *bp++; + ndx = 1; + off = hashp->BSIZE; + } else { + save_bufp->flags &= ~BUF_PIN; + return (ERROR); + } + } + + /* Not found */ + switch (action) { + case HASH_PUT: + case HASH_PUTNEW: + if (__addel(hashp, rbufp, key, val)) { + save_bufp->flags &= ~BUF_PIN; + return (ERROR); + } else { + save_bufp->flags &= ~BUF_PIN; + return (SUCCESS); + } + case HASH_GET: + case HASH_DELETE: + default: + save_bufp->flags &= ~BUF_PIN; + return (ABNORMAL); + } + +found: + switch (action) { + case HASH_PUTNEW: + save_bufp->flags &= ~BUF_PIN; + return (ABNORMAL); + case HASH_GET: + bp = (u_int16_t *)rbufp->page; + if (bp[ndx + 1] < REAL_KEY) { + if (__big_return(hashp, rbufp, ndx, val, 0)) + return (ERROR); + } else { + val->data = (u_char *)rbufp->page + (int)bp[ndx + 1]; + val->size = bp[ndx] - bp[ndx + 1]; + } + break; + case HASH_PUT: + if ((__delpair(hashp, rbufp, ndx)) || + (__addel(hashp, rbufp, key, val))) { + save_bufp->flags &= ~BUF_PIN; + return (ERROR); + } + break; + case HASH_DELETE: + if (__delpair(hashp, rbufp, ndx)) + return (ERROR); + break; + default: + LIBC_ABORT("illegal action (%d)", action); + } + save_bufp->flags &= ~BUF_PIN; + return (SUCCESS); +} + +static int +hash_seq(const DB *dbp, DBT *key, DBT *data, u_int32_t flag) +{ + u_int32_t bucket; + BUFHEAD *bufp; + HTAB *hashp; + u_int16_t *bp, ndx; + + hashp = (HTAB *)dbp->internal; + if (flag && flag != R_FIRST && flag != R_NEXT) { + hashp->error = errno = EINVAL; + return (ERROR); + } +#ifdef HASH_STATISTICS + hash_accesses++; +#endif + if ((hashp->cbucket < 0) || (flag == R_FIRST)) { + hashp->cbucket = 0; + hashp->cndx = 1; + hashp->cpage = NULL; + } + next_bucket: + for (bp = NULL; !bp || !bp[0]; ) { + if (!(bufp = hashp->cpage)) { + for (bucket = hashp->cbucket; + bucket <= hashp->MAX_BUCKET; + bucket++, hashp->cndx = 1) { + bufp = __get_buf(hashp, bucket, NULL, 0); + if (!bufp) + return (ERROR); + hashp->cpage = bufp; + bp = (u_int16_t *)bufp->page; + if (bp[0]) + break; + } + hashp->cbucket = bucket; + if ((u_int32_t)hashp->cbucket > hashp->MAX_BUCKET) { + hashp->cbucket = -1; + return (ABNORMAL); + } + } else { + bp = (u_int16_t *)hashp->cpage->page; + if (flag == R_NEXT) { + hashp->cndx += 2; + if (hashp->cndx > bp[0]) { + hashp->cpage = NULL; + hashp->cbucket++; + hashp->cndx = 1; + goto next_bucket; + } + } + } + +#ifdef DEBUG + assert(bp); + assert(bufp); +#endif + while (bp[hashp->cndx + 1] == OVFLPAGE) { + bufp = hashp->cpage = + __get_buf(hashp, bp[hashp->cndx], bufp, 0); + if (!bufp) + return (ERROR); + bp = (u_int16_t *)(bufp->page); + hashp->cndx = 1; + } + if (!bp[0]) { + hashp->cpage = NULL; + ++hashp->cbucket; + } + } + ndx = hashp->cndx; + if (bp[ndx + 1] < REAL_KEY) { + if (__big_keydata(hashp, bufp, key, data, 1)) + return (ERROR); + } else { + if (hashp->cpage == 0) + return (ERROR); + key->data = (u_char *)hashp->cpage->page + bp[ndx]; + key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx]; + data->data = (u_char *)hashp->cpage->page + bp[ndx + 1]; + data->size = bp[ndx] - bp[ndx + 1]; + } + return (SUCCESS); +} + +/********************************* UTILITIES ************************/ + +/* + * Returns: + * 0 ==> OK + * -1 ==> Error + */ +int +__expand_table(HTAB *hashp) +{ + u_int32_t old_bucket, new_bucket; + int dirsize, new_segnum, spare_ndx; + +#ifdef HASH_STATISTICS + hash_expansions++; +#endif + new_bucket = ++hashp->MAX_BUCKET; + old_bucket = (hashp->MAX_BUCKET & hashp->LOW_MASK); + + new_segnum = new_bucket >> hashp->SSHIFT; + + /* Check if we need a new segment */ + if (new_segnum >= hashp->nsegs) { + /* Check if we need to expand directory */ + if (new_segnum >= hashp->DSIZE) { + /* Reallocate directory */ + dirsize = hashp->DSIZE * sizeof(SEGMENT *); + if (!hash_realloc(&hashp->dir, dirsize, dirsize << 1)) + return (-1); + hashp->DSIZE = dirsize << 1; + } + if ((hashp->dir[new_segnum] = + (SEGMENT)calloc(hashp->SGSIZE, sizeof(SEGMENT))) == NULL) + return (-1); + hashp->exsegs++; + hashp->nsegs++; + } + /* + * If the split point is increasing (MAX_BUCKET's log base 2 + * * increases), we need to copy the current contents of the spare + * split bucket to the next bucket. + */ + spare_ndx = __log2(hashp->MAX_BUCKET + 1); + if (spare_ndx > hashp->OVFL_POINT) { + hashp->SPARES[spare_ndx] = hashp->SPARES[hashp->OVFL_POINT]; + hashp->OVFL_POINT = spare_ndx; + } + + if (new_bucket > hashp->HIGH_MASK) { + /* Starting a new doubling */ + hashp->LOW_MASK = hashp->HIGH_MASK; + hashp->HIGH_MASK = new_bucket | hashp->LOW_MASK; + } + /* Relocate records to the new bucket */ + return (__split_page(hashp, old_bucket, new_bucket)); +} + +/* + * If realloc guarantees that the pointer is not destroyed if the realloc + * fails, then this routine can go away. + */ +static void * +hash_realloc(SEGMENT **p_ptr, int oldsize, int newsize) +{ + void *p; + + if ( (p = malloc(newsize)) ) { + memmove(p, *p_ptr, oldsize); + memset((char *)p + oldsize, 0, newsize - oldsize); + free(*p_ptr); + *p_ptr = p; + } + return (p); +} + +u_int32_t +__call_hash(HTAB *hashp, char *k, int len) +{ + unsigned int n, bucket; + + n = hashp->hash(k, len); + bucket = n & hashp->HIGH_MASK; + if (bucket > hashp->MAX_BUCKET) + bucket = bucket & hashp->LOW_MASK; + return (bucket); +} + +/* + * Allocate segment table. On error, destroy the table and set errno. + * + * Returns 0 on success + */ +static int +alloc_segs(HTAB *hashp, int nsegs) +{ + int i; + SEGMENT store; + + int save_errno; + + if ((hashp->dir = + (SEGMENT *)calloc(hashp->DSIZE, sizeof(SEGMENT *))) == NULL) { + save_errno = errno; + (void)hdestroy(hashp); + errno = save_errno; + return (-1); + } + hashp->nsegs = nsegs; + if (nsegs == 0) + return (0); + /* Allocate segments */ + if ((store = (SEGMENT)calloc(nsegs << hashp->SSHIFT, + sizeof(SEGMENT))) == NULL) { + save_errno = errno; + (void)hdestroy(hashp); + errno = save_errno; + return (-1); + } + for (i = 0; i < nsegs; i++) + hashp->dir[i] = &store[i << hashp->SSHIFT]; + return (0); +} + +#if BYTE_ORDER == LITTLE_ENDIAN +/* + * Hashp->hdr needs to be byteswapped. + */ +static void +swap_header_copy(HASHHDR *srcp, HASHHDR *destp) +{ + int i; + + P_32_COPY(srcp->magic, destp->magic); + P_32_COPY(srcp->version, destp->version); + P_32_COPY(srcp->lorder, destp->lorder); + P_32_COPY(srcp->bsize, destp->bsize); + P_32_COPY(srcp->bshift, destp->bshift); + P_32_COPY(srcp->dsize, destp->dsize); + P_32_COPY(srcp->ssize, destp->ssize); + P_32_COPY(srcp->sshift, destp->sshift); + P_32_COPY(srcp->ovfl_point, destp->ovfl_point); + P_32_COPY(srcp->last_freed, destp->last_freed); + P_32_COPY(srcp->max_bucket, destp->max_bucket); + P_32_COPY(srcp->high_mask, destp->high_mask); + P_32_COPY(srcp->low_mask, destp->low_mask); + P_32_COPY(srcp->ffactor, destp->ffactor); + P_32_COPY(srcp->nkeys, destp->nkeys); + P_32_COPY(srcp->hdrpages, destp->hdrpages); + P_32_COPY(srcp->h_charkey, destp->h_charkey); + for (i = 0; i < NCACHED; i++) { + P_32_COPY(srcp->spares[i], destp->spares[i]); + P_16_COPY(srcp->bitmaps[i], destp->bitmaps[i]); + } +} + +static void +swap_header(HTAB *hashp) +{ + HASHHDR *hdrp; + int i; + + hdrp = &hashp->hdr; + + M_32_SWAP(hdrp->magic); + M_32_SWAP(hdrp->version); + M_32_SWAP(hdrp->lorder); + M_32_SWAP(hdrp->bsize); + M_32_SWAP(hdrp->bshift); + M_32_SWAP(hdrp->dsize); + M_32_SWAP(hdrp->ssize); + M_32_SWAP(hdrp->sshift); + M_32_SWAP(hdrp->ovfl_point); + M_32_SWAP(hdrp->last_freed); + M_32_SWAP(hdrp->max_bucket); + M_32_SWAP(hdrp->high_mask); + M_32_SWAP(hdrp->low_mask); + M_32_SWAP(hdrp->ffactor); + M_32_SWAP(hdrp->nkeys); + M_32_SWAP(hdrp->hdrpages); + M_32_SWAP(hdrp->h_charkey); + for (i = 0; i < NCACHED; i++) { + M_32_SWAP(hdrp->spares[i]); + M_16_SWAP(hdrp->bitmaps[i]); + } +} +#endif diff --git a/db/hash/FreeBSD/hash.h b/db/hash/FreeBSD/hash.h new file mode 100644 index 0000000..e4f77c2 --- /dev/null +++ b/db/hash/FreeBSD/hash.h @@ -0,0 +1,292 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)hash.h 8.3 (Berkeley) 5/31/94 + * $FreeBSD: src/lib/libc/db/hash/hash.h,v 1.9 2009/03/28 05:45:29 delphij Exp $ + */ + +/* Operations */ +typedef enum { + HASH_GET, HASH_PUT, HASH_PUTNEW, HASH_DELETE, HASH_FIRST, HASH_NEXT +} ACTION; + +/* Buffer Management structures */ +typedef struct _bufhead BUFHEAD; + +struct _bufhead { + BUFHEAD *prev; /* LRU links */ + BUFHEAD *next; /* LRU links */ + BUFHEAD *ovfl; /* Overflow page buffer header */ + u_int32_t addr; /* Address of this page */ + char *page; /* Actual page data */ + char flags; +#define BUF_MOD 0x0001 +#define BUF_DISK 0x0002 +#define BUF_BUCKET 0x0004 +#define BUF_PIN 0x0008 +}; + +#define IS_BUCKET(X) ((X) & BUF_BUCKET) + +typedef BUFHEAD **SEGMENT; + +/* Hash Table Information */ +typedef struct hashhdr { /* Disk resident portion */ + int32_t magic; /* Magic NO for hash tables */ + int32_t version; /* Version ID */ + u_int32_t lorder; /* Byte Order */ + int32_t bsize; /* Bucket/Page Size */ + int32_t bshift; /* Bucket shift */ + int32_t dsize; /* Directory Size */ + int32_t ssize; /* Segment Size */ + int32_t sshift; /* Segment shift */ + int32_t ovfl_point; /* Where overflow pages are being + * allocated */ + int32_t last_freed; /* Last overflow page freed */ + u_int32_t max_bucket; /* ID of Maximum bucket in use */ + u_int32_t high_mask; /* Mask to modulo into entire table */ + u_int32_t low_mask; /* Mask to modulo into lower half of + * table */ + u_int32_t ffactor; /* Fill factor */ + int32_t nkeys; /* Number of keys in hash table */ + int32_t hdrpages; /* Size of table header */ + int32_t h_charkey; /* value of hash(CHARKEY) */ +#define NCACHED 32 /* number of bit maps and spare + * points */ + int32_t spares[NCACHED];/* spare pages for overflow */ + u_int16_t bitmaps[NCACHED]; /* address of overflow page + * bitmaps */ +} HASHHDR; + +typedef struct htab { /* Memory resident data structure */ + HASHHDR hdr; /* Header */ + int nsegs; /* Number of allocated segments */ + int exsegs; /* Number of extra allocated + * segments */ + u_int32_t /* Hash function */ + (*hash)(const void *, size_t); + int flags; /* Flag values */ + int fp; /* File pointer */ + char *tmp_buf; /* Temporary Buffer for BIG data */ + char *tmp_key; /* Temporary Buffer for BIG keys */ + BUFHEAD *cpage; /* Current page */ + int cbucket; /* Current bucket */ + int cndx; /* Index of next item on cpage */ + int error; /* Error Number -- for DBM + * compatibility */ + int new_file; /* Indicates if fd is backing store + * or no */ + int save_file; /* Indicates whether we need to flush + * file at + * exit */ + u_int32_t *mapp[NCACHED]; /* Pointers to page maps */ + int nmaps; /* Initial number of bitmaps */ + int nbufs; /* Number of buffers left to + * allocate */ + BUFHEAD bufhead; /* Header of buffer lru list */ + SEGMENT *dir; /* Hash Bucket directory */ + /* other flags */ + int nextkey_eof :1; /* dbm_nextkey() reached EOF */ +} HTAB; + +/* + * Constants + */ +#define MAX_BSIZE 65536 /* 2^16 */ +#define MIN_BUFFERS 6 +#define MINHDRSIZE 512 +#define DEF_BUFSIZE 65536 /* 64 K */ +#define DEF_BUCKET_SIZE 4096 +#define DEF_BUCKET_SHIFT 12 /* log2(BUCKET) */ +#define DEF_SEGSIZE 256 +#define DEF_SEGSIZE_SHIFT 8 /* log2(SEGSIZE) */ +#define DEF_DIRSIZE 256 +#define DEF_FFACTOR 65536 +#define MIN_FFACTOR 4 +#define SPLTMAX 8 +#define CHARKEY "%$sniglet^&" +#define NUMKEY 1038583 +#define BYTE_SHIFT 3 +#define INT_TO_BYTE 2 +#define INT_BYTE_SHIFT 5 +#define ALL_SET ((u_int32_t)0xFFFFFFFF) +#define ALL_CLEAR 0 + +#define PTROF(X) ((BUFHEAD *)((ptrdiff_t)(X)&~0x3)) +#define ISMOD(X) ((u_int32_t)(ptrdiff_t)(X)&0x1) +#define DOMOD(X) ((X) = (char *)((ptrdiff_t)(X)|0x1)) +#define ISDISK(X) ((u_int32_t)(ptrdiff_t)(X)&0x2) +#define DODISK(X) ((X) = (char *)((ptrdiff_t)(X)|0x2)) + +#define BITS_PER_MAP 32 + +/* Given the address of the beginning of a big map, clear/set the nth bit */ +#define CLRBIT(A, N) ((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP))) +#define SETBIT(A, N) ((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP))) +#define ISSET(A, N) ((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP))) + +/* Overflow management */ +/* + * Overflow page numbers are allocated per split point. At each doubling of + * the table, we can allocate extra pages. So, an overflow page number has + * the top 5 bits indicate which split point and the lower 11 bits indicate + * which page at that split point is indicated (pages within split points are + * numberered starting with 1). + */ + +#define SPLITSHIFT 11 +#define SPLITMASK 0x7FF +#define SPLITNUM(N) (((u_int32_t)(N)) >> SPLITSHIFT) +#define OPAGENUM(N) ((N) & SPLITMASK) +#define OADDR_OF(S,O) ((u_int32_t)((u_int32_t)(S) << SPLITSHIFT) + (O)) + +#define BUCKET_TO_PAGE(B) \ + (B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__log2((B)+1)-1] : 0) +#define OADDR_TO_PAGE(B) \ + BUCKET_TO_PAGE ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B)); + +/* + * page.h contains a detailed description of the page format. + * + * Normally, keys and data are accessed from offset tables in the top of + * each page which point to the beginning of the key and data. There are + * four flag values which may be stored in these offset tables which indicate + * the following: + * + * + * OVFLPAGE Rather than a key data pair, this pair contains + * the address of an overflow page. The format of + * the pair is: + * OVERFLOW_PAGE_NUMBER OVFLPAGE + * + * PARTIAL_KEY This must be the first key/data pair on a page + * and implies that page contains only a partial key. + * That is, the key is too big to fit on a single page + * so it starts on this page and continues on the next. + * The format of the page is: + * KEY_OFF PARTIAL_KEY OVFL_PAGENO OVFLPAGE + * + * KEY_OFF -- offset of the beginning of the key + * PARTIAL_KEY -- 1 + * OVFL_PAGENO - page number of the next overflow page + * OVFLPAGE -- 0 + * + * FULL_KEY This must be the first key/data pair on the page. It + * is used in two cases. + * + * Case 1: + * There is a complete key on the page but no data + * (because it wouldn't fit). The next page contains + * the data. + * + * Page format it: + * KEY_OFF FULL_KEY OVFL_PAGENO OVFL_PAGE + * + * KEY_OFF -- offset of the beginning of the key + * FULL_KEY -- 2 + * OVFL_PAGENO - page number of the next overflow page + * OVFLPAGE -- 0 + * + * Case 2: + * This page contains no key, but part of a large + * data field, which is continued on the next page. + * + * Page format it: + * DATA_OFF FULL_KEY OVFL_PAGENO OVFL_PAGE + * + * KEY_OFF -- offset of the beginning of the data on + * this page + * FULL_KEY -- 2 + * OVFL_PAGENO - page number of the next overflow page + * OVFLPAGE -- 0 + * + * FULL_KEY_DATA + * This must be the first key/data pair on the page. + * There are two cases: + * + * Case 1: + * This page contains a key and the beginning of the + * data field, but the data field is continued on the + * next page. + * + * Page format is: + * KEY_OFF FULL_KEY_DATA OVFL_PAGENO DATA_OFF + * + * KEY_OFF -- offset of the beginning of the key + * FULL_KEY_DATA -- 3 + * OVFL_PAGENO - page number of the next overflow page + * DATA_OFF -- offset of the beginning of the data + * + * Case 2: + * This page contains the last page of a big data pair. + * There is no key, only the tail end of the data + * on this page. + * + * Page format is: + * DATA_OFF FULL_KEY_DATA + * + * DATA_OFF -- offset of the beginning of the data on + * this page + * FULL_KEY_DATA -- 3 + * OVFL_PAGENO - page number of the next overflow page + * OVFLPAGE -- 0 + * + * OVFL_PAGENO and OVFLPAGE are optional (they are + * not present if there is no next page). + */ + +#define OVFLPAGE 0 +#define PARTIAL_KEY 1 +#define FULL_KEY 2 +#define FULL_KEY_DATA 3 +#define REAL_KEY 4 + +/* Short hands for accessing structure */ +#define BSIZE hdr.bsize +#define BSHIFT hdr.bshift +#define DSIZE hdr.dsize +#define SGSIZE hdr.ssize +#define SSHIFT hdr.sshift +#define LORDER hdr.lorder +#define OVFL_POINT hdr.ovfl_point +#define LAST_FREED hdr.last_freed +#define MAX_BUCKET hdr.max_bucket +#define FFACTOR hdr.ffactor +#define HIGH_MASK hdr.high_mask +#define LOW_MASK hdr.low_mask +#define NKEYS hdr.nkeys +#define HDRPAGES hdr.hdrpages +#define SPARES hdr.spares +#define BITMAPS hdr.bitmaps +#define VERSION hdr.version +#define MAGIC hdr.magic +#define NEXT_FREE hdr.next_free +#define H_CHARKEY hdr.h_charkey diff --git a/db/hash/FreeBSD/hash_bigkey.c b/db/hash/FreeBSD/hash_bigkey.c new file mode 100644 index 0000000..d325105 --- /dev/null +++ b/db/hash/FreeBSD/hash_bigkey.c @@ -0,0 +1,646 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)hash_bigkey.c 8.3 (Berkeley) 5/31/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/hash/hash_bigkey.c,v 1.10 2009/03/28 06:47:05 delphij Exp $"); + +/* + * PACKAGE: hash + * DESCRIPTION: + * Big key/data handling for the hashing package. + * + * ROUTINES: + * External + * __big_keydata + * __big_split + * __big_insert + * __big_return + * __big_delete + * __find_last_page + * Internal + * collect_key + * collect_data + */ + +#include + +#include +#include +#include +#include + +#ifdef DEBUG +#include +#endif + +#include +#include "hash.h" +#include "page.h" +#include "hash_extern.h" + +static int collect_key(HTAB *, BUFHEAD *, int, DBT *, int); +static int collect_data(HTAB *, BUFHEAD *, int, int); + +/* + * Big_insert + * + * You need to do an insert and the key/data pair is too big + * + * Returns: + * 0 ==> OK + *-1 ==> ERROR + */ +int +__big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) +{ + u_int16_t *p; + int key_size, n; + unsigned int val_size; + u_int16_t space, move_bytes, off; + char *cp, *key_data, *val_data; + + cp = bufp->page; /* Character pointer of p. */ + p = (u_int16_t *)cp; + + key_data = (char *)key->data; + key_size = key->size; + val_data = (char *)val->data; + val_size = val->size; + + /* First move the Key */ + for (space = FREESPACE(p) - BIGOVERHEAD; key_size; + space = FREESPACE(p) - BIGOVERHEAD) { + move_bytes = MIN(space, key_size); + off = OFFSET(p) - move_bytes; + memmove(cp + off, key_data, move_bytes); + key_size -= move_bytes; + key_data += move_bytes; + n = p[0]; + p[++n] = off; + p[0] = ++n; + FREESPACE(p) = off - PAGE_META(n); + OFFSET(p) = off; + p[n] = PARTIAL_KEY; + bufp = __add_ovflpage(hashp, bufp); + if (!bufp) + return (-1); + n = p[0]; + if (!key_size) { + space = FREESPACE(p); + if (space) { + move_bytes = MIN(space, val_size); + /* + * If the data would fit exactly in the + * remaining space, we must overflow it to the + * next page; otherwise the invariant that the + * data must end on a page with FREESPACE + * non-zero would fail. + */ + if (space == val_size && val_size == val->size) + goto toolarge; + off = OFFSET(p) - move_bytes; + memmove(cp + off, val_data, move_bytes); + val_data += move_bytes; + val_size -= move_bytes; + p[n] = off; + p[n - 2] = FULL_KEY_DATA; + FREESPACE(p) = FREESPACE(p) - move_bytes; + OFFSET(p) = off; + } else { + toolarge: + p[n - 2] = FULL_KEY; + } + } + p = (u_int16_t *)bufp->page; + cp = bufp->page; + bufp->flags |= BUF_MOD; + } + + /* Now move the data */ + for (space = FREESPACE(p) - BIGOVERHEAD; val_size; + space = FREESPACE(p) - BIGOVERHEAD) { + move_bytes = MIN(space, val_size); + /* + * Here's the hack to make sure that if the data ends on the + * same page as the key ends, FREESPACE is at least one. + */ + if (space == val_size && val_size == val->size) + move_bytes--; + off = OFFSET(p) - move_bytes; + memmove(cp + off, val_data, move_bytes); + val_size -= move_bytes; + val_data += move_bytes; + n = p[0]; + p[++n] = off; + p[0] = ++n; + FREESPACE(p) = off - PAGE_META(n); + OFFSET(p) = off; + if (val_size) { + p[n] = FULL_KEY; + bufp = __add_ovflpage(hashp, bufp); + if (!bufp) + return (-1); + cp = bufp->page; + p = (u_int16_t *)cp; + } else + p[n] = FULL_KEY_DATA; + bufp->flags |= BUF_MOD; + } + return (0); +} + +/* + * Called when bufp's page contains a partial key (index should be 1) + * + * All pages in the big key/data pair except bufp are freed. We cannot + * free bufp because the page pointing to it is lost and we can't get rid + * of its pointer. + * + * Returns: + * 0 => OK + *-1 => ERROR + */ +int +__big_delete(HTAB *hashp, BUFHEAD *bufp) +{ + BUFHEAD *last_bfp, *rbufp; + u_int16_t *bp, pageno; + int key_done, n; + + rbufp = bufp; + last_bfp = NULL; + bp = (u_int16_t *)bufp->page; + pageno = 0; + key_done = 0; + + while (!key_done || (bp[2] != FULL_KEY_DATA)) { + if (bp[2] == FULL_KEY || bp[2] == FULL_KEY_DATA) + key_done = 1; + + /* + * If there is freespace left on a FULL_KEY_DATA page, then + * the data is short and fits entirely on this page, and this + * is the last page. + */ + if (bp[2] == FULL_KEY_DATA && FREESPACE(bp)) + break; + pageno = bp[bp[0] - 1]; + rbufp->flags |= BUF_MOD; + rbufp = __get_buf(hashp, pageno, rbufp, 0); + if (last_bfp) + __free_ovflpage(hashp, last_bfp); + last_bfp = rbufp; + if (!rbufp) + return (-1); /* Error. */ + bp = (u_int16_t *)rbufp->page; + } + + /* + * If we get here then rbufp points to the last page of the big + * key/data pair. Bufp points to the first one -- it should now be + * empty pointing to the next page after this pair. Can't free it + * because we don't have the page pointing to it. + */ + + /* This is information from the last page of the pair. */ + n = bp[0]; + pageno = bp[n - 1]; + + /* Now, bp is the first page of the pair. */ + bp = (u_int16_t *)bufp->page; + if (n > 2) { + /* There is an overflow page. */ + bp[1] = pageno; + bp[2] = OVFLPAGE; + bufp->ovfl = rbufp->ovfl; + } else + /* This is the last page. */ + bufp->ovfl = NULL; + n -= 2; + bp[0] = n; + FREESPACE(bp) = hashp->BSIZE - PAGE_META(n); + OFFSET(bp) = hashp->BSIZE; + + bufp->flags |= BUF_MOD; + if (rbufp) + __free_ovflpage(hashp, rbufp); + if (last_bfp && last_bfp != rbufp) + __free_ovflpage(hashp, last_bfp); + + hashp->NKEYS--; + return (0); +} +/* + * Returns: + * 0 = key not found + * -1 = get next overflow page + * -2 means key not found and this is big key/data + * -3 error + */ +int +__find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size) +{ + u_int16_t *bp; + char *p; + int ksize; + u_int16_t bytes; + char *kkey; + + bp = (u_int16_t *)bufp->page; + p = bufp->page; + ksize = size; + kkey = key; + + for (bytes = hashp->BSIZE - bp[ndx]; + bytes <= size && bp[ndx + 1] == PARTIAL_KEY; + bytes = hashp->BSIZE - bp[ndx]) { + if (memcmp(p + bp[ndx], kkey, bytes)) + return (-2); + kkey += bytes; + ksize -= bytes; + bufp = __get_buf(hashp, bp[ndx + 2], bufp, 0); + if (!bufp) + return (-3); + p = bufp->page; + bp = (u_int16_t *)p; + ndx = 1; + } + + if (bytes != ksize || memcmp(p + bp[ndx], kkey, bytes)) { +#ifdef HASH_STATISTICS + ++hash_collisions; +#endif + return (-2); + } else + return (ndx); +} + +/* + * Given the buffer pointer of the first overflow page of a big pair, + * find the end of the big pair + * + * This will set bpp to the buffer header of the last page of the big pair. + * It will return the pageno of the overflow page following the last page + * of the pair; 0 if there isn't any (i.e. big pair is the last key in the + * bucket) + */ +u_int16_t +__find_last_page(HTAB *hashp, BUFHEAD **bpp) +{ + BUFHEAD *bufp; + u_int16_t *bp, pageno; + int n; + + bufp = *bpp; + bp = (u_int16_t *)bufp->page; + for (;;) { + n = bp[0]; + + /* + * This is the last page if: the tag is FULL_KEY_DATA and + * either only 2 entries OVFLPAGE marker is explicit there + * is freespace on the page. + */ + if (bp[2] == FULL_KEY_DATA && + ((n == 2) || (bp[n] == OVFLPAGE) || (FREESPACE(bp)))) + break; + + pageno = bp[n - 1]; + bufp = __get_buf(hashp, pageno, bufp, 0); + if (!bufp) + return (0); /* Need to indicate an error! */ + bp = (u_int16_t *)bufp->page; + } + + *bpp = bufp; + if (bp[0] > 2) + return (bp[3]); + else + return (0); +} + +/* + * Return the data for the key/data pair that begins on this page at this + * index (index should always be 1). + */ +int +__big_return(HTAB *hashp, BUFHEAD *bufp, int ndx, DBT *val, int set_current) +{ + BUFHEAD *save_p; + u_int16_t *bp, len, off, save_addr; + char *tp; + + bp = (u_int16_t *)bufp->page; + while (bp[ndx + 1] == PARTIAL_KEY) { + bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + if (!bufp) + return (-1); + bp = (u_int16_t *)bufp->page; + ndx = 1; + } + + if (bp[ndx + 1] == FULL_KEY) { + bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + if (!bufp) + return (-1); + bp = (u_int16_t *)bufp->page; + save_p = bufp; + save_addr = save_p->addr; + off = bp[1]; + len = 0; + } else + if (!FREESPACE(bp)) { + /* + * This is a hack. We can't distinguish between + * FULL_KEY_DATA that contains complete data or + * incomplete data, so we require that if the data + * is complete, there is at least 1 byte of free + * space left. + */ + off = bp[bp[0]]; + len = bp[1] - off; + save_p = bufp; + save_addr = bufp->addr; + bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + if (!bufp) + return (-1); + bp = (u_int16_t *)bufp->page; + } else { + /* The data is all on one page. */ + tp = (char *)bp; + off = bp[bp[0]]; + val->data = (u_char *)tp + off; + val->size = bp[1] - off; + if (set_current) { + if (bp[0] == 2) { /* No more buckets in + * chain */ + hashp->cpage = NULL; + hashp->cbucket++; + hashp->cndx = 1; + } else { + hashp->cpage = __get_buf(hashp, + bp[bp[0] - 1], bufp, 0); + if (!hashp->cpage) + return (-1); + hashp->cndx = 1; + if (!((u_int16_t *) + hashp->cpage->page)[0]) { + hashp->cbucket++; + hashp->cpage = NULL; + } + } + } + return (0); + } + + val->size = (size_t)collect_data(hashp, bufp, (int)len, set_current); + if (val->size == (size_t)-1) + return (-1); + if (save_p->addr != save_addr) { + /* We are pretty short on buffers. */ + errno = EINVAL; /* OUT OF BUFFERS */ + return (-1); + } + memmove(hashp->tmp_buf, (save_p->page) + off, len); + val->data = (u_char *)hashp->tmp_buf; + return (0); +} +/* + * Count how big the total datasize is by recursing through the pages. Then + * allocate a buffer and copy the data as you recurse up. + */ +static int +collect_data(HTAB *hashp, BUFHEAD *bufp, int len, int set) +{ + u_int16_t *bp; + char *p; + BUFHEAD *xbp; + u_int16_t save_addr; + int mylen, totlen; + + p = bufp->page; + bp = (u_int16_t *)p; + mylen = hashp->BSIZE - bp[1]; + save_addr = bufp->addr; + + if (bp[2] == FULL_KEY_DATA) { /* End of Data */ + totlen = len + mylen; + if (hashp->tmp_buf) + free(hashp->tmp_buf); + if ((hashp->tmp_buf = (char *)malloc(totlen)) == NULL) + return (-1); + if (set) { + hashp->cndx = 1; + if (bp[0] == 2) { /* No more buckets in chain */ + hashp->cpage = NULL; + hashp->cbucket++; + } else { + hashp->cpage = + __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + if (!hashp->cpage) + return (-1); + else if (!((u_int16_t *)hashp->cpage->page)[0]) { + hashp->cbucket++; + hashp->cpage = NULL; + } + } + } + } else { + xbp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + if (!xbp || ((totlen = + collect_data(hashp, xbp, len + mylen, set)) < 1)) + return (-1); + } + if (bufp->addr != save_addr) { + errno = EINVAL; /* Out of buffers. */ + return (-1); + } + memmove(&hashp->tmp_buf[len], (bufp->page) + bp[1], mylen); + return (totlen); +} + +/* + * Fill in the key and data for this big pair. + */ +int +__big_keydata(HTAB *hashp, BUFHEAD *bufp, DBT *key, DBT *val, int set) +{ + key->size = (size_t)collect_key(hashp, bufp, 0, val, set); + if (key->size == (size_t)-1) + return (-1); + key->data = (u_char *)hashp->tmp_key; + return (0); +} + +/* + * Count how big the total key size is by recursing through the pages. Then + * collect the data, allocate a buffer and copy the key as you recurse up. + */ +static int +collect_key(HTAB *hashp, BUFHEAD *bufp, int len, DBT *val, int set) +{ + BUFHEAD *xbp; + char *p; + int mylen, totlen; + u_int16_t *bp, save_addr; + + p = bufp->page; + bp = (u_int16_t *)p; + mylen = hashp->BSIZE - bp[1]; + + save_addr = bufp->addr; + totlen = len + mylen; + if (bp[2] == FULL_KEY || bp[2] == FULL_KEY_DATA) { /* End of Key. */ + if (hashp->tmp_key != NULL) + free(hashp->tmp_key); + if ((hashp->tmp_key = (char *)malloc(totlen)) == NULL) + return (-1); + if (__big_return(hashp, bufp, 1, val, set)) + return (-1); + } else { + xbp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + if (!xbp || ((totlen = + collect_key(hashp, xbp, totlen, val, set)) < 1)) + return (-1); + } + if (bufp->addr != save_addr) { + errno = EINVAL; /* MIS -- OUT OF BUFFERS */ + return (-1); + } + memmove(&hashp->tmp_key[len], (bufp->page) + bp[1], mylen); + return (totlen); +} + +/* + * Returns: + * 0 => OK + * -1 => error + */ +int +__big_split(HTAB *hashp, + BUFHEAD *op, /* Pointer to where to put keys that go in old bucket */ + BUFHEAD *np, /* Pointer to new bucket page */ + BUFHEAD *big_keyp, /* Pointer to first page containing the big key/data */ + int addr, /* Address of big_keyp */ + u_int32_t obucket, /* Old Bucket */ + SPLIT_RETURN *ret) +{ + BUFHEAD *bp, *tmpp; + DBT key, val; + u_int32_t change; + u_int16_t free_space, n, off, *tp; + + bp = big_keyp; + + /* Now figure out where the big key/data goes */ + if (__big_keydata(hashp, big_keyp, &key, &val, 0)) + return (-1); + change = (__call_hash(hashp, key.data, key.size) != obucket); + + if ( (ret->next_addr = __find_last_page(hashp, &big_keyp)) ) { + if (!(ret->nextp = + __get_buf(hashp, ret->next_addr, big_keyp, 0))) + return (-1); + } else + ret->nextp = NULL; + + /* Now make one of np/op point to the big key/data pair */ +#ifdef DEBUG + assert(np->ovfl == NULL); +#endif + if (change) + tmpp = np; + else + tmpp = op; + + tmpp->flags |= BUF_MOD; +#ifdef DEBUG1 + (void)fprintf(stderr, + "BIG_SPLIT: %d->ovfl was %d is now %d\n", tmpp->addr, + (tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0)); +#endif + tmpp->ovfl = bp; /* one of op/np point to big_keyp */ + tp = (u_int16_t *)tmpp->page; +#ifdef DEBUG + assert(FREESPACE(tp) >= OVFLSIZE); +#endif + n = tp[0]; + off = OFFSET(tp); + free_space = FREESPACE(tp); + tp[++n] = (u_int16_t)addr; + tp[++n] = OVFLPAGE; + tp[0] = n; + OFFSET(tp) = off; + FREESPACE(tp) = free_space - OVFLSIZE; + + /* + * Finally, set the new and old return values. BIG_KEYP contains a + * pointer to the last page of the big key_data pair. Make sure that + * big_keyp has no following page (2 elements) or create an empty + * following page. + */ + + ret->newp = np; + ret->oldp = op; + + tp = (u_int16_t *)big_keyp->page; + big_keyp->flags |= BUF_MOD; + if (tp[0] > 2) { + /* + * There may be either one or two offsets on this page. If + * there is one, then the overflow page is linked on normally + * and tp[4] is OVFLPAGE. If there are two, tp[4] contains + * the second offset and needs to get stuffed in after the + * next overflow page is added. + */ + n = tp[4]; + free_space = FREESPACE(tp); + off = OFFSET(tp); + tp[0] -= 2; + FREESPACE(tp) = free_space + OVFLSIZE; + OFFSET(tp) = off; + tmpp = __add_ovflpage(hashp, big_keyp); + if (!tmpp) + return (-1); + tp[4] = n; + } else + tmpp = big_keyp; + + if (change) + ret->newp = tmpp; + else + ret->oldp = tmpp; + return (0); +} diff --git a/db/hash/FreeBSD/hash_buf.c b/db/hash/FreeBSD/hash_buf.c new file mode 100644 index 0000000..e19beda --- /dev/null +++ b/db/hash/FreeBSD/hash_buf.c @@ -0,0 +1,358 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/hash/hash_buf.c,v 1.12 2009/03/28 06:40:48 delphij Exp $"); + +/* + * PACKAGE: hash + * + * DESCRIPTION: + * Contains buffer management + * + * ROUTINES: + * External + * __buf_init + * __get_buf + * __buf_free + * __reclaim_buf + * Internal + * newbuf + */ + +#include + +#include +#include +#include +#include + +#ifdef DEBUG +#include +#endif + +#include +#include "hash.h" +#include "page.h" +#include "hash_extern.h" + +static BUFHEAD *newbuf(HTAB *, u_int32_t, BUFHEAD *); + +/* Unlink B from its place in the lru */ +#define BUF_REMOVE(B) { \ + (B)->prev->next = (B)->next; \ + (B)->next->prev = (B)->prev; \ +} + +/* Insert B after P */ +#define BUF_INSERT(B, P) { \ + (B)->next = (P)->next; \ + (B)->prev = (P); \ + (P)->next = (B); \ + (B)->next->prev = (B); \ +} + +#define MRU hashp->bufhead.next +#define LRU hashp->bufhead.prev + +#define MRU_INSERT(B) BUF_INSERT((B), &hashp->bufhead) +#define LRU_INSERT(B) BUF_INSERT((B), LRU) + +/* + * We are looking for a buffer with address "addr". If prev_bp is NULL, then + * address is a bucket index. If prev_bp is not NULL, then it points to the + * page previous to an overflow page that we are trying to find. + * + * CAVEAT: The buffer header accessed via prev_bp's ovfl field may no longer + * be valid. Therefore, you must always verify that its address matches the + * address you are seeking. + */ +BUFHEAD * +__get_buf(HTAB *hashp, u_int32_t addr, + BUFHEAD *prev_bp, /* If prev_bp set, indicates a new overflow page. */ + int newpage) +{ + BUFHEAD *bp; + u_int32_t is_disk_mask; + int is_disk, segment_ndx; + SEGMENT segp; + + is_disk = 0; + is_disk_mask = 0; + if (prev_bp) { + bp = prev_bp->ovfl; + if (!bp || (bp->addr != addr)) + bp = NULL; + if (!newpage) + is_disk = BUF_DISK; + } else { + /* Grab buffer out of directory */ + segment_ndx = addr & (hashp->SGSIZE - 1); + + /* valid segment ensured by __call_hash() */ + segp = hashp->dir[addr >> hashp->SSHIFT]; +#ifdef DEBUG + assert(segp != NULL); +#endif + bp = PTROF(segp[segment_ndx]); + is_disk_mask = ISDISK(segp[segment_ndx]); + is_disk = is_disk_mask || !hashp->new_file; + } + + if (!bp) { + bp = newbuf(hashp, addr, prev_bp); + if (!bp || + __get_page(hashp, bp->page, addr, !prev_bp, is_disk, 0)) + return (NULL); + if (!prev_bp) + segp[segment_ndx] = + (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask); + } else { + BUF_REMOVE(bp); + MRU_INSERT(bp); + } + return (bp); +} + +/* + * We need a buffer for this page. Either allocate one, or evict a resident + * one (if we have as many buffers as we're allowed) and put this one in. + * + * If newbuf finds an error (returning NULL), it also sets errno. + */ +static BUFHEAD * +newbuf(HTAB *hashp, u_int32_t addr, BUFHEAD *prev_bp) +{ + BUFHEAD *bp; /* The buffer we're going to use */ + BUFHEAD *xbp; /* Temp pointer */ + BUFHEAD *next_xbp; + SEGMENT segp; + int segment_ndx; + u_int16_t oaddr, *shortp; + + oaddr = 0; + bp = LRU; + + /* It is bad to overwrite the page under the cursor. */ + if (bp == hashp->cpage) { + BUF_REMOVE(bp); + MRU_INSERT(bp); + bp = LRU; + } + + /* If prev_bp is part of bp overflow, create a new buffer. */ + if (hashp->nbufs == 0 && prev_bp && bp->ovfl) { + BUFHEAD *ovfl; + + for (ovfl = bp->ovfl; ovfl ; ovfl = ovfl->ovfl) { + if (ovfl == prev_bp) { + hashp->nbufs++; + break; + } + } + } + + /* + * If LRU buffer is pinned, the buffer pool is too small. We need to + * allocate more buffers. + */ + if (hashp->nbufs || (bp->flags & BUF_PIN) || bp == hashp->cpage) { + /* Allocate a new one */ + if ((bp = (BUFHEAD *)calloc(1, sizeof(BUFHEAD))) == NULL) + return (NULL); + if ((bp->page = (char *)calloc(1, hashp->BSIZE)) == NULL) { + free(bp); + return (NULL); + } + if (hashp->nbufs) + hashp->nbufs--; + } else { + /* Kick someone out */ + BUF_REMOVE(bp); + /* + * If this is an overflow page with addr 0, it's already been + * flushed back in an overflow chain and initialized. + */ + if ((bp->addr != 0) || (bp->flags & BUF_BUCKET)) { + /* + * Set oaddr before __put_page so that you get it + * before bytes are swapped. + */ + shortp = (u_int16_t *)bp->page; + if (shortp[0]) + oaddr = shortp[shortp[0] - 1]; + if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page, + bp->addr, (int)IS_BUCKET(bp->flags), 0)) + return (NULL); + /* + * Update the pointer to this page (i.e. invalidate it). + * + * If this is a new file (i.e. we created it at open + * time), make sure that we mark pages which have been + * written to disk so we retrieve them from disk later, + * rather than allocating new pages. + */ + if (IS_BUCKET(bp->flags)) { + segment_ndx = bp->addr & (hashp->SGSIZE - 1); + segp = hashp->dir[bp->addr >> hashp->SSHIFT]; +#ifdef DEBUG + assert(segp != NULL); +#endif + + if (hashp->new_file && + ((bp->flags & BUF_MOD) || + ISDISK(segp[segment_ndx]))) + segp[segment_ndx] = (BUFHEAD *)BUF_DISK; + else + segp[segment_ndx] = NULL; + } + /* + * Since overflow pages can only be access by means of + * their bucket, free overflow pages associated with + * this bucket. + */ + for (xbp = bp; xbp->ovfl;) { + next_xbp = xbp->ovfl; + xbp->ovfl = 0; + xbp = next_xbp; + + /* Check that ovfl pointer is up date. */ + if (IS_BUCKET(xbp->flags) || + (oaddr != xbp->addr)) + break; + + shortp = (u_int16_t *)xbp->page; + if (shortp[0]) + /* set before __put_page */ + oaddr = shortp[shortp[0] - 1]; + if ((xbp->flags & BUF_MOD) && __put_page(hashp, + xbp->page, xbp->addr, 0, 0)) + return (NULL); + xbp->addr = 0; + xbp->flags = 0; + BUF_REMOVE(xbp); + LRU_INSERT(xbp); + } + } + } + + /* Now assign this buffer */ + bp->addr = addr; +#ifdef DEBUG1 + (void)fprintf(stderr, "NEWBUF1: %d->ovfl was %d is now %d\n", + bp->addr, (bp->ovfl ? bp->ovfl->addr : 0), 0); +#endif + bp->ovfl = NULL; + if (prev_bp) { + /* + * If prev_bp is set, this is an overflow page, hook it in to + * the buffer overflow links. + */ +#ifdef DEBUG1 + (void)fprintf(stderr, "NEWBUF2: %d->ovfl was %d is now %d\n", + prev_bp->addr, (prev_bp->ovfl ? prev_bp->ovfl->addr : 0), + (bp ? bp->addr : 0)); +#endif + prev_bp->ovfl = bp; + bp->flags = 0; + } else + bp->flags = BUF_BUCKET; + MRU_INSERT(bp); + return (bp); +} + +__private_extern__ void +__buf_init(HTAB *hashp, int nbytes) +{ + BUFHEAD *bfp; + int npages; + + bfp = &(hashp->bufhead); + npages = (nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT; + npages = MAX(npages, MIN_BUFFERS); + + hashp->nbufs = npages; + bfp->next = bfp; + bfp->prev = bfp; + /* + * This space is calloc'd so these are already null. + * + * bfp->ovfl = NULL; + * bfp->flags = 0; + * bfp->page = NULL; + * bfp->addr = 0; + */ +} + +int +__buf_free(HTAB *hashp, int do_free, int to_disk) +{ + BUFHEAD *bp; + + /* Need to make sure that buffer manager has been initialized */ + if (!LRU) + return (0); + for (bp = LRU; bp != &hashp->bufhead;) { + /* Check that the buffer is valid */ + if (bp->addr || IS_BUCKET(bp->flags)) { + if (to_disk && (bp->flags & BUF_MOD) && + __put_page(hashp, bp->page, + bp->addr, IS_BUCKET(bp->flags), 0)) + return (-1); + } + /* Check if we are freeing stuff */ + if (do_free) { + if (bp->page) { + (void)memset(bp->page, 0, hashp->BSIZE); + free(bp->page); + } + BUF_REMOVE(bp); + free(bp); + bp = LRU; + } else + bp = bp->prev; + } + return (0); +} + +void +__reclaim_buf(HTAB *hashp, BUFHEAD *bp) +{ + bp->ovfl = 0; + bp->addr = 0; + bp->flags = 0; + BUF_REMOVE(bp); + LRU_INSERT(bp); +} diff --git a/db/hash/FreeBSD/hash_extern.h b/db/hash/FreeBSD/hash_extern.h new file mode 100644 index 0000000..9c0afaf --- /dev/null +++ b/db/hash/FreeBSD/hash_extern.h @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)extern.h 8.4 (Berkeley) 6/16/94 + * $FreeBSD: src/lib/libc/db/hash/extern.h,v 1.4 2007/01/09 00:27:50 imp Exp $ + */ + +BUFHEAD *__add_ovflpage(HTAB *, BUFHEAD *); +int __addel(HTAB *, BUFHEAD *, const DBT *, const DBT *); +int __big_delete(HTAB *, BUFHEAD *); +int __big_insert(HTAB *, BUFHEAD *, const DBT *, const DBT *); +int __big_keydata(HTAB *, BUFHEAD *, DBT *, DBT *, int); +int __big_return(HTAB *, BUFHEAD *, int, DBT *, int); +int __big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *, + int, u_int32_t, SPLIT_RETURN *); +int __buf_free(HTAB *, int, int); +void __buf_init(HTAB *, int); +u_int32_t __call_hash(HTAB *, char *, int); +int __delpair(HTAB *, BUFHEAD *, int); +int __expand_table(HTAB *); +int __find_bigpair(HTAB *, BUFHEAD *, int, char *, int); +u_int16_t __find_last_page(HTAB *, BUFHEAD **); +void __free_ovflpage(HTAB *, BUFHEAD *); +BUFHEAD *__get_buf(HTAB *, u_int32_t, BUFHEAD *, int); +int __get_page(HTAB *, char *, u_int32_t, int, int, int); +int __ibitmap(HTAB *, int, int, int); +u_int32_t __log2(u_int32_t); +int __put_page(HTAB *, char *, u_int32_t, int, int); +void __reclaim_buf(HTAB *, BUFHEAD *); +int __split_page(HTAB *, u_int32_t, u_int32_t); + +/* Default hash routine. */ +extern u_int32_t (*__default_hash)(const void *, size_t); + +#ifdef HASH_STATISTICS +extern int hash_accesses, hash_collisions, hash_expansions, hash_overflows; +#endif diff --git a/db/hash/FreeBSD/hash_func.c b/db/hash/FreeBSD/hash_func.c new file mode 100644 index 0000000..a402e49 --- /dev/null +++ b/db/hash/FreeBSD/hash_func.c @@ -0,0 +1,210 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)hash_func.c 8.2 (Berkeley) 2/21/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/hash/hash_func.c,v 1.6 2007/01/09 00:27:50 imp Exp $"); + +#include + +#include +#include "hash.h" +#include "page.h" +#include "hash_extern.h" + +static u_int32_t hash1(const void *, size_t) __unused; +static u_int32_t hash2(const void *, size_t) __unused; +static u_int32_t hash3(const void *, size_t) __unused; +static u_int32_t hash4(const void *, size_t); + +/* Global default hash function */ +u_int32_t (*__default_hash)(const void *, size_t) = hash4; + +/* + * HASH FUNCTIONS + * + * Assume that we've already split the bucket to which this key hashes, + * calculate that bucket, and check that in fact we did already split it. + * + * This came from ejb's hsearch. + */ + +#define PRIME1 37 +#define PRIME2 1048583 + +static u_int32_t +hash1(keyarg, len) + const void *keyarg; + size_t len; +{ + const u_char *key; + u_int32_t h; + + /* Convert string to integer */ + for (key = keyarg, h = 0; len--;) + h = h * PRIME1 ^ (*key++ - ' '); + h %= PRIME2; + return (h); +} + +/* + * Phong's linear congruential hash + */ +#define dcharhash(h, c) ((h) = 0x63c63cd9*(h) + 0x9c39c33d + (c)) + +static u_int32_t +hash2(keyarg, len) + const void *keyarg; + size_t len; +{ + const u_char *e, *key; + u_int32_t h; + u_char c; + + key = keyarg; + e = key + len; + for (h = 0; key != e;) { + c = *key++; + if (!c && key > e) + break; + dcharhash(h, c); + } + return (h); +} + +/* + * This is INCREDIBLY ugly, but fast. We break the string up into 8 byte + * units. On the first time through the loop we get the "leftover bytes" + * (strlen % 8). On every other iteration, we perform 8 HASHC's so we handle + * all 8 bytes. Essentially, this saves us 7 cmp & branch instructions. If + * this routine is heavily used enough, it's worth the ugly coding. + * + * OZ's original sdbm hash + */ +static u_int32_t +hash3(keyarg, len) + const void *keyarg; + size_t len; +{ + const u_char *key; + size_t loop; + u_int32_t h; + +#define HASHC h = *key++ + 65599 * h + + h = 0; + key = keyarg; + if (len > 0) { + loop = (len + 8 - 1) >> 3; + + switch (len & (8 - 1)) { + case 0: + do { + HASHC; + /* FALLTHROUGH */ + case 7: + HASHC; + /* FALLTHROUGH */ + case 6: + HASHC; + /* FALLTHROUGH */ + case 5: + HASHC; + /* FALLTHROUGH */ + case 4: + HASHC; + /* FALLTHROUGH */ + case 3: + HASHC; + /* FALLTHROUGH */ + case 2: + HASHC; + /* FALLTHROUGH */ + case 1: + HASHC; + } while (--loop); + } + } + return (h); +} + +/* Hash function from Chris Torek. */ +static u_int32_t +hash4(keyarg, len) + const void *keyarg; + size_t len; +{ + const u_char *key; + size_t loop; + u_int32_t h; + +#define HASH4a h = (h << 5) - h + *key++; +#define HASH4b h = (h << 5) + h + *key++; +#define HASH4 HASH4b + + h = 0; + key = keyarg; + if (len > 0) { + loop = (len + 8 - 1) >> 3; + + switch (len & (8 - 1)) { + case 0: + do { + HASH4; + /* FALLTHROUGH */ + case 7: + HASH4; + /* FALLTHROUGH */ + case 6: + HASH4; + /* FALLTHROUGH */ + case 5: + HASH4; + /* FALLTHROUGH */ + case 4: + HASH4; + /* FALLTHROUGH */ + case 3: + HASH4; + /* FALLTHROUGH */ + case 2: + HASH4; + /* FALLTHROUGH */ + case 1: + HASH4; + } while (--loop); + } + } + return (h); +} diff --git a/db/hash/FreeBSD/hash_log2.c b/db/hash/FreeBSD/hash_log2.c new file mode 100644 index 0000000..56714a1 --- /dev/null +++ b/db/hash/FreeBSD/hash_log2.c @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)hash_log2.c 8.2 (Berkeley) 5/31/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/hash/hash_log2.c,v 1.5 2009/03/28 05:45:29 delphij Exp $"); + +#include +#include "hash.h" +#include "page.h" +#include "hash_extern.h" + +u_int32_t +__log2(u_int32_t num) +{ + u_int32_t i, limit; + + limit = 1; + for (i = 0; limit < num; limit = limit << 1, i++); + return (i); +} diff --git a/db/hash/FreeBSD/hash_page.c b/db/hash/FreeBSD/hash_page.c new file mode 100644 index 0000000..809a3b9 --- /dev/null +++ b/db/hash/FreeBSD/hash_page.c @@ -0,0 +1,948 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/hash/hash_page.c,v 1.16 2009/03/28 06:30:43 delphij Exp $"); + +/* + * PACKAGE: hashing + * + * DESCRIPTION: + * Page manipulation for hashing package. + * + * ROUTINES: + * + * External + * __get_page + * __add_ovflpage + * Internal + * overflow_page + * open_temp + */ + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#ifdef DEBUG +#include +#endif +#include "un-namespace.h" + +#include +#include "hash.h" +#include "page.h" +#include "hash_extern.h" + +static u_int32_t *fetch_bitmap(HTAB *, int); +static u_int32_t first_free(u_int32_t); +static int open_temp(HTAB *); +static u_int16_t overflow_page(HTAB *); +static void putpair(char *, const DBT *, const DBT *); +static void squeeze_key(u_int16_t *, const DBT *, const DBT *); +static int ugly_split(HTAB *, u_int32_t, BUFHEAD *, BUFHEAD *, int, int); + +#define PAGE_INIT(P) { \ + ((u_int16_t *)(P))[0] = 0; \ + ((u_int16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(u_int16_t); \ + ((u_int16_t *)(P))[2] = hashp->BSIZE; \ +} + +/* + * This is called AFTER we have verified that there is room on the page for + * the pair (PAIRFITS has returned true) so we go right ahead and start moving + * stuff on. + */ +static void +putpair(char *p, const DBT *key, const DBT *val) +{ + u_int16_t *bp, n, off; + + bp = (u_int16_t *)p; + + /* Enter the key first. */ + n = bp[0]; + + off = OFFSET(bp) - key->size; + memmove(p + off, key->data, key->size); + bp[++n] = off; + + /* Now the data. */ + off -= val->size; + memmove(p + off, val->data, val->size); + bp[++n] = off; + + /* Adjust page info. */ + bp[0] = n; + bp[n + 1] = off - ((n + 3) * sizeof(u_int16_t)); + bp[n + 2] = off; +} + +/* + * Returns: + * 0 OK + * -1 error + */ +int +__delpair(HTAB *hashp, BUFHEAD *bufp, int ndx) +{ + u_int16_t *bp, newoff, pairlen; + int n; + + bp = (u_int16_t *)bufp->page; + n = bp[0]; + + if (bp[ndx + 1] < REAL_KEY) + return (__big_delete(hashp, bufp)); + if (ndx != 1) + newoff = bp[ndx - 1]; + else + newoff = hashp->BSIZE; + pairlen = newoff - bp[ndx + 1]; + + if (ndx != (n - 1)) { + /* Hard Case -- need to shuffle keys */ + int i; + char *src = bufp->page + (int)OFFSET(bp); + char *dst = src + (int)pairlen; + memmove(dst, src, bp[ndx + 1] - OFFSET(bp)); + + /* Now adjust the pointers */ + for (i = ndx + 2; i <= n; i += 2) { + if (bp[i + 1] == OVFLPAGE) { + bp[i - 2] = bp[i]; + bp[i - 1] = bp[i + 1]; + } else { + bp[i - 2] = bp[i] + pairlen; + bp[i - 1] = bp[i + 1] + pairlen; + } + } + if (ndx == hashp->cndx) { + /* + * We just removed pair we were "pointing" to. + * By moving back the cndx we ensure subsequent + * hash_seq() calls won't skip over any entries. + */ + hashp->cndx -= 2; + } + } + /* Finally adjust the page data */ + bp[n] = OFFSET(bp) + pairlen; + bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(u_int16_t); + bp[0] = n - 2; + hashp->NKEYS--; + + bufp->flags |= BUF_MOD; + return (0); +} +/* + * Returns: + * 0 ==> OK + * -1 ==> Error + */ +int +__split_page(HTAB *hashp, u_int32_t obucket, u_int32_t nbucket) +{ + BUFHEAD *new_bufp, *old_bufp; + u_int16_t *ino; + char *np; + DBT key, val; + int n, ndx, retval; + u_int16_t copyto, diff, off, moved; + char *op; + + copyto = (u_int16_t)hashp->BSIZE; + off = (u_int16_t)hashp->BSIZE; + old_bufp = __get_buf(hashp, obucket, NULL, 0); + if (old_bufp == NULL) + return (-1); + new_bufp = __get_buf(hashp, nbucket, NULL, 0); + if (new_bufp == NULL) + return (-1); + + old_bufp->flags |= (BUF_MOD | BUF_PIN); + new_bufp->flags |= (BUF_MOD | BUF_PIN); + + ino = (u_int16_t *)(op = old_bufp->page); + np = new_bufp->page; + + moved = 0; + + for (n = 1, ndx = 1; n < ino[0]; n += 2) { + if (ino[n + 1] < REAL_KEY) { + retval = ugly_split(hashp, obucket, old_bufp, new_bufp, + (int)copyto, (int)moved); + old_bufp->flags &= ~BUF_PIN; + new_bufp->flags &= ~BUF_PIN; + return (retval); + + } + key.data = (u_char *)op + ino[n]; + key.size = off - ino[n]; + + if (__call_hash(hashp, key.data, key.size) == obucket) { + /* Don't switch page */ + diff = copyto - off; + if (diff) { + copyto = ino[n + 1] + diff; + memmove(op + copyto, op + ino[n + 1], + off - ino[n + 1]); + ino[ndx] = copyto + ino[n] - ino[n + 1]; + ino[ndx + 1] = copyto; + } else + copyto = ino[n + 1]; + ndx += 2; + } else { + /* Switch page */ + val.data = (u_char *)op + ino[n + 1]; + val.size = ino[n] - ino[n + 1]; + putpair(np, &key, &val); + moved += 2; + } + + off = ino[n + 1]; + } + + /* Now clean up the page */ + ino[0] -= moved; + FREESPACE(ino) = copyto - sizeof(u_int16_t) * (ino[0] + 3); + OFFSET(ino) = copyto; + +#ifdef DEBUG3 + (void)fprintf(stderr, "split %d/%d\n", + ((u_int16_t *)np)[0] / 2, + ((u_int16_t *)op)[0] / 2); +#endif + /* unpin both pages */ + old_bufp->flags &= ~BUF_PIN; + new_bufp->flags &= ~BUF_PIN; + return (0); +} + +/* + * Called when we encounter an overflow or big key/data page during split + * handling. This is special cased since we have to begin checking whether + * the key/data pairs fit on their respective pages and because we may need + * overflow pages for both the old and new pages. + * + * The first page might be a page with regular key/data pairs in which case + * we have a regular overflow condition and just need to go on to the next + * page or it might be a big key/data pair in which case we need to fix the + * big key/data pair. + * + * Returns: + * 0 ==> success + * -1 ==> failure + */ +static int +ugly_split(HTAB *hashp, + u_int32_t obucket, /* Same as __split_page. */ + BUFHEAD *old_bufp, + BUFHEAD *new_bufp, + int copyto, /* First byte on page which contains key/data values. */ + int moved) /* Number of pairs moved to new page. */ +{ + BUFHEAD *bufp; /* Buffer header for ino */ + u_int16_t *ino; /* Page keys come off of */ + u_int16_t *np; /* New page */ + u_int16_t *op; /* Page keys go on to if they aren't moving */ + + BUFHEAD *last_bfp; /* Last buf header OVFL needing to be freed */ + DBT key, val; + SPLIT_RETURN ret; + u_int16_t n, off, ov_addr, scopyto; + char *cino; /* Character value of ino */ + + bufp = old_bufp; + ino = (u_int16_t *)old_bufp->page; + np = (u_int16_t *)new_bufp->page; + op = (u_int16_t *)old_bufp->page; + last_bfp = NULL; + scopyto = (u_int16_t)copyto; /* ANSI */ + + n = ino[0] - 1; + while (n < ino[0]) { + if (ino[2] < REAL_KEY && ino[2] != OVFLPAGE) { + if (__big_split(hashp, old_bufp, + new_bufp, bufp, bufp->addr, obucket, &ret)) + return (-1); + old_bufp = ret.oldp; + if (!old_bufp) + return (-1); + op = (u_int16_t *)old_bufp->page; + new_bufp = ret.newp; + if (!new_bufp) + return (-1); + np = (u_int16_t *)new_bufp->page; + bufp = ret.nextp; + if (!bufp) + return (0); + cino = (char *)bufp->page; + ino = (u_int16_t *)cino; + last_bfp = ret.nextp; + } else if (ino[n + 1] == OVFLPAGE) { + ov_addr = ino[n]; + /* + * Fix up the old page -- the extra 2 are the fields + * which contained the overflow information. + */ + ino[0] -= (moved + 2); + FREESPACE(ino) = + scopyto - sizeof(u_int16_t) * (ino[0] + 3); + OFFSET(ino) = scopyto; + + bufp = __get_buf(hashp, ov_addr, bufp, 0); + if (!bufp) + return (-1); + + ino = (u_int16_t *)bufp->page; + n = 1; + scopyto = hashp->BSIZE; + moved = 0; + + if (last_bfp) + __free_ovflpage(hashp, last_bfp); + last_bfp = bufp; + } + /* Move regular sized pairs of there are any */ + off = hashp->BSIZE; + for (n = 1; (n < ino[0]) && (ino[n + 1] >= REAL_KEY); n += 2) { + cino = (char *)ino; + key.data = (u_char *)cino + ino[n]; + key.size = off - ino[n]; + val.data = (u_char *)cino + ino[n + 1]; + val.size = ino[n] - ino[n + 1]; + off = ino[n + 1]; + + if (__call_hash(hashp, key.data, key.size) == obucket) { + /* Keep on old page */ + if (PAIRFITS(op, (&key), (&val))) + putpair((char *)op, &key, &val); + else { + old_bufp = + __add_ovflpage(hashp, old_bufp); + if (!old_bufp) + return (-1); + op = (u_int16_t *)old_bufp->page; + putpair((char *)op, &key, &val); + } + old_bufp->flags |= BUF_MOD; + } else { + /* Move to new page */ + if (PAIRFITS(np, (&key), (&val))) + putpair((char *)np, &key, &val); + else { + new_bufp = + __add_ovflpage(hashp, new_bufp); + if (!new_bufp) + return (-1); + np = (u_int16_t *)new_bufp->page; + putpair((char *)np, &key, &val); + } + new_bufp->flags |= BUF_MOD; + } + } + } + if (last_bfp) + __free_ovflpage(hashp, last_bfp); + return (0); +} + +/* + * Add the given pair to the page + * + * Returns: + * 0 ==> OK + * 1 ==> failure + */ +int +__addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) +{ + u_int16_t *bp, *sop; + int do_expand; + + bp = (u_int16_t *)bufp->page; + do_expand = 0; + while (bp[0] && (bp[2] < REAL_KEY || bp[bp[0]] < REAL_KEY)) + /* Exception case */ + if (bp[2] == FULL_KEY_DATA && bp[0] == 2) + /* This is the last page of a big key/data pair + and we need to add another page */ + break; + else if (bp[2] < REAL_KEY && bp[bp[0]] != OVFLPAGE) { + bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + if (!bufp) + return (-1); + bp = (u_int16_t *)bufp->page; + } else if (bp[bp[0]] != OVFLPAGE) { + /* Short key/data pairs, no more pages */ + break; + } else { + /* Try to squeeze key on this page */ + if (bp[2] >= REAL_KEY && + FREESPACE(bp) >= PAIRSIZE(key, val)) { + squeeze_key(bp, key, val); + goto stats; + } else { + bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + if (!bufp) + return (-1); + bp = (u_int16_t *)bufp->page; + } + } + + if (PAIRFITS(bp, key, val)) + putpair(bufp->page, key, val); + else { + do_expand = 1; + bufp = __add_ovflpage(hashp, bufp); + if (!bufp) + return (-1); + sop = (u_int16_t *)bufp->page; + + if (PAIRFITS(sop, key, val)) + putpair((char *)sop, key, val); + else + if (__big_insert(hashp, bufp, key, val)) + return (-1); + } +stats: + bufp->flags |= BUF_MOD; + /* + * If the average number of keys per bucket exceeds the fill factor, + * expand the table. + */ + hashp->NKEYS++; + if (do_expand || + (hashp->NKEYS / (hashp->MAX_BUCKET + 1) > hashp->FFACTOR)) + return (__expand_table(hashp)); + return (0); +} + +/* + * + * Returns: + * pointer on success + * NULL on error + */ +BUFHEAD * +__add_ovflpage(HTAB *hashp, BUFHEAD *bufp) +{ + u_int16_t *sp, ndx, ovfl_num; +#ifdef DEBUG1 + int tmp1, tmp2; +#endif + sp = (u_int16_t *)bufp->page; + + /* Check if we are dynamically determining the fill factor */ + if (hashp->FFACTOR == DEF_FFACTOR) { + hashp->FFACTOR = sp[0] >> 1; + if (hashp->FFACTOR < MIN_FFACTOR) + hashp->FFACTOR = MIN_FFACTOR; + } + bufp->flags |= BUF_MOD; + ovfl_num = overflow_page(hashp); +#ifdef DEBUG1 + tmp1 = bufp->addr; + tmp2 = bufp->ovfl ? bufp->ovfl->addr : 0; +#endif + if (!ovfl_num || !(bufp->ovfl = __get_buf(hashp, ovfl_num, bufp, 1))) + return (NULL); + bufp->ovfl->flags |= BUF_MOD; +#ifdef DEBUG1 + (void)fprintf(stderr, "ADDOVFLPAGE: %d->ovfl was %d is now %d\n", + tmp1, tmp2, bufp->ovfl->addr); +#endif + ndx = sp[0]; + /* + * Since a pair is allocated on a page only if there's room to add + * an overflow page, we know that the OVFL information will fit on + * the page. + */ + sp[ndx + 4] = OFFSET(sp); + sp[ndx + 3] = FREESPACE(sp) - OVFLSIZE; + sp[ndx + 1] = ovfl_num; + sp[ndx + 2] = OVFLPAGE; + sp[0] = ndx + 2; +#ifdef HASH_STATISTICS + hash_overflows++; +#endif + return (bufp->ovfl); +} + +/* + * Returns: + * 0 indicates SUCCESS + * -1 indicates FAILURE + */ +int +__get_page(HTAB *hashp, char *p, u_int32_t bucket, int is_bucket, int is_disk, + int is_bitmap) +{ + int fd, page, size, rsize; + u_int16_t *bp; + + fd = hashp->fp; + size = hashp->BSIZE; + + if ((fd == -1) || !is_disk) { + PAGE_INIT(p); + return (0); + } + if (is_bucket) + page = BUCKET_TO_PAGE(bucket); + else + page = OADDR_TO_PAGE(bucket); + if ((rsize = pread(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1) + return (-1); + bp = (u_int16_t *)p; + if (!rsize) + bp[0] = 0; /* We hit the EOF, so initialize a new page */ + else + if (rsize != size) { + errno = EFTYPE; + return (-1); + } + if (!is_bitmap && !bp[0]) { + PAGE_INIT(p); + } else + if (hashp->LORDER != BYTE_ORDER) { + int i, max; + + if (is_bitmap) { + max = hashp->BSIZE >> 2; /* divide by 4 */ + for (i = 0; i < max; i++) + M_32_SWAP(((int *)p)[i]); + } else { + M_16_SWAP(bp[0]); + max = bp[0] + 2; + for (i = 1; i <= max; i++) + M_16_SWAP(bp[i]); + } + } + return (0); +} + +/* + * Write page p to disk + * + * Returns: + * 0 ==> OK + * -1 ==>failure + */ +int +__put_page(HTAB *hashp, char *p, u_int32_t bucket, int is_bucket, int is_bitmap) +{ + int fd, page, size, wsize, max; + + size = hashp->BSIZE; + if ((hashp->fp == -1) && open_temp(hashp)) + return (-1); + fd = hashp->fp; + + if (hashp->LORDER != BYTE_ORDER) { + int i; + + if (is_bitmap) { + max = hashp->BSIZE >> 2; /* divide by 4 */ + for (i = 0; i < max; i++) + M_32_SWAP(((int *)p)[i]); + } else { + max = ((u_int16_t *)p)[0] + 2; + for (i = 0; i <= max; i++) + M_16_SWAP(((u_int16_t *)p)[i]); + } + } + if (is_bucket) + page = BUCKET_TO_PAGE(bucket); + else + page = OADDR_TO_PAGE(bucket); + if ((wsize = pwrite(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1) + /* Errno is set */ + return (-1); + if (wsize != size) { + errno = EFTYPE; + return (-1); + } + /* 4485533 - reswap the in-memory copy */ + if (hashp->LORDER != BYTE_ORDER) { + int i; + + if (is_bitmap) { + for (i = 0; i < max; i++) + M_32_SWAP(((int *)p)[i]); + } else { + for (i = 0; i <= max; i++) + M_16_SWAP(((u_int16_t *)p)[i]); + } + } + return (0); +} + +#define BYTE_MASK ((1 << INT_BYTE_SHIFT) -1) +/* + * Initialize a new bitmap page. Bitmap pages are left in memory + * once they are read in. + */ +int +__ibitmap(HTAB *hashp, int pnum, int nbits, int ndx) +{ + u_int32_t *ip; + int clearbytes, clearints; + + if ((ip = (u_int32_t *)malloc(hashp->BSIZE)) == NULL) + return (1); + hashp->nmaps++; + clearints = ((nbits - 1) >> INT_BYTE_SHIFT) + 1; + clearbytes = clearints << INT_TO_BYTE; + (void)memset((char *)ip, 0, clearbytes); + (void)memset(((char *)ip) + clearbytes, 0xFF, + hashp->BSIZE - clearbytes); + ip[clearints - 1] = ALL_SET << (nbits & BYTE_MASK); + SETBIT(ip, 0); + hashp->BITMAPS[ndx] = (u_int16_t)pnum; + hashp->mapp[ndx] = ip; + return (0); +} + +static u_int32_t +first_free(u_int32_t map) +{ + u_int32_t i, mask; + + mask = 0x1; + for (i = 0; i < BITS_PER_MAP; i++) { + if (!(mask & map)) + return (i); + mask = mask << 1; + } + return (i); +} + +static u_int16_t +overflow_page(HTAB *hashp) +{ + u_int32_t *freep; + int max_free, offset, splitnum; + u_int16_t addr; + int bit, first_page, free_bit, free_page, i, in_use_bits, j; +#ifdef DEBUG2 + int tmp1, tmp2; +#endif + splitnum = hashp->OVFL_POINT; + max_free = hashp->SPARES[splitnum]; + + free_page = (max_free - 1) >> (hashp->BSHIFT + BYTE_SHIFT); + free_bit = (max_free - 1) & ((hashp->BSIZE << BYTE_SHIFT) - 1); + + /* Look through all the free maps to find the first free block */ + first_page = hashp->LAST_FREED >>(hashp->BSHIFT + BYTE_SHIFT); + for ( i = first_page; i <= free_page; i++ ) { + if (!(freep = (u_int32_t *)hashp->mapp[i]) && + !(freep = fetch_bitmap(hashp, i))) + return (0); + if (i == free_page) + in_use_bits = free_bit; + else + in_use_bits = (hashp->BSIZE << BYTE_SHIFT) - 1; + + if (i == first_page) { + bit = hashp->LAST_FREED & + ((hashp->BSIZE << BYTE_SHIFT) - 1); + j = bit / BITS_PER_MAP; + bit = bit & ~(BITS_PER_MAP - 1); + } else { + bit = 0; + j = 0; + } + for (; bit <= in_use_bits; j++, bit += BITS_PER_MAP) + if (freep[j] != ALL_SET) + goto found; + } + + /* No Free Page Found */ + hashp->LAST_FREED = hashp->SPARES[splitnum]; + hashp->SPARES[splitnum]++; + offset = hashp->SPARES[splitnum] - + (splitnum ? hashp->SPARES[splitnum - 1] : 0); + +#define OVMSG "HASH: Out of overflow pages. Increase page size\n" + if (offset > SPLITMASK) { + if (++splitnum >= NCACHED) { + (void)_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1); + errno = EFBIG; + return (0); + } + hashp->OVFL_POINT = splitnum; + hashp->SPARES[splitnum] = hashp->SPARES[splitnum-1]; + hashp->SPARES[splitnum-1]--; + offset = 1; + } + + /* Check if we need to allocate a new bitmap page */ + if (free_bit == (hashp->BSIZE << BYTE_SHIFT) - 1) { + free_page++; + if (free_page >= NCACHED) { + (void)_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1); + errno = EFBIG; + return (0); + } + /* + * This is tricky. The 1 indicates that you want the new page + * allocated with 1 clear bit. Actually, you are going to + * allocate 2 pages from this map. The first is going to be + * the map page, the second is the overflow page we were + * looking for. The init_bitmap routine automatically, sets + * the first bit of itself to indicate that the bitmap itself + * is in use. We would explicitly set the second bit, but + * don't have to if we tell init_bitmap not to leave it clear + * in the first place. + */ + if (__ibitmap(hashp, + (int)OADDR_OF(splitnum, offset), 1, free_page)) + return (0); + hashp->SPARES[splitnum]++; +#ifdef DEBUG2 + free_bit = 2; +#endif + offset++; + if (offset > SPLITMASK) { + if (++splitnum >= NCACHED) { + (void)_write(STDERR_FILENO, OVMSG, + sizeof(OVMSG) - 1); + errno = EFBIG; + return (0); + } + hashp->OVFL_POINT = splitnum; + hashp->SPARES[splitnum] = hashp->SPARES[splitnum-1]; + hashp->SPARES[splitnum-1]--; + offset = 0; + } + } else { + /* + * Free_bit addresses the last used bit. Bump it to address + * the first available bit. + */ + free_bit++; + SETBIT(freep, free_bit); + } + + /* Calculate address of the new overflow page */ + addr = OADDR_OF(splitnum, offset); +#ifdef DEBUG2 + (void)fprintf(stderr, "OVERFLOW_PAGE: ADDR: %d BIT: %d PAGE %d\n", + addr, free_bit, free_page); +#endif + return (addr); + +found: + bit = bit + first_free(freep[j]); + SETBIT(freep, bit); +#ifdef DEBUG2 + tmp1 = bit; + tmp2 = i; +#endif + /* + * Bits are addressed starting with 0, but overflow pages are addressed + * beginning at 1. Bit is a bit addressnumber, so we need to increment + * it to convert it to a page number. + */ + bit = 1 + bit + (i * (hashp->BSIZE << BYTE_SHIFT)); + if (bit >= hashp->LAST_FREED) + hashp->LAST_FREED = bit - 1; + + /* Calculate the split number for this page */ + for (i = 0; (i < splitnum) && (bit > hashp->SPARES[i]); i++); + offset = (i ? bit - hashp->SPARES[i - 1] : bit); + if (offset >= SPLITMASK) { + (void)_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1); + errno = EFBIG; + return (0); /* Out of overflow pages */ + } + addr = OADDR_OF(i, offset); +#ifdef DEBUG2 + (void)fprintf(stderr, "OVERFLOW_PAGE: ADDR: %d BIT: %d PAGE %d\n", + addr, tmp1, tmp2); +#endif + + /* Allocate and return the overflow page */ + return (addr); +} + +/* + * Mark this overflow page as free. + */ +void +__free_ovflpage(HTAB *hashp, BUFHEAD *obufp) +{ + u_int16_t addr; + u_int32_t *freep; + int bit_address, free_page, free_bit; + u_int16_t ndx; + + addr = obufp->addr; +#ifdef DEBUG1 + (void)fprintf(stderr, "Freeing %d\n", addr); +#endif + ndx = (((u_int16_t)addr) >> SPLITSHIFT); + bit_address = + (ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1; + if (bit_address < hashp->LAST_FREED) + hashp->LAST_FREED = bit_address; + free_page = (bit_address >> (hashp->BSHIFT + BYTE_SHIFT)); + free_bit = bit_address & ((hashp->BSIZE << BYTE_SHIFT) - 1); + + if (!(freep = hashp->mapp[free_page])) + freep = fetch_bitmap(hashp, free_page); +#ifdef DEBUG + /* + * This had better never happen. It means we tried to read a bitmap + * that has already had overflow pages allocated off it, and we + * failed to read it from the file. + */ + if (!freep) + assert(0); +#endif + CLRBIT(freep, free_bit); +#ifdef DEBUG2 + (void)fprintf(stderr, "FREE_OVFLPAGE: ADDR: %d BIT: %d PAGE %d\n", + obufp->addr, free_bit, free_page); +#endif + __reclaim_buf(hashp, obufp); +} + +/* + * Returns: + * 0 success + * -1 failure + */ +static int +open_temp(HTAB *hashp) +{ + sigset_t set, oset; + int len; + char *envtmp = NULL; + char path[MAXPATHLEN]; + + if (issetugid() == 0) + envtmp = getenv("TMPDIR"); + len = snprintf(path, + sizeof(path), "%s/_hash.XXXXXX", envtmp ? envtmp : "/tmp"); + if (len < 0 || len >= sizeof(path)) { + errno = ENAMETOOLONG; + return (-1); + } + + /* Block signals; make sure file goes away at process exit. */ + (void)sigfillset(&set); + (void)_sigprocmask(SIG_BLOCK, &set, &oset); + if ((hashp->fp = mkstemp(path)) != -1) { + (void)unlink(path); + (void)_fcntl(hashp->fp, F_SETFD, 1); + } + (void)_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); + return (hashp->fp != -1 ? 0 : -1); +} + +/* + * We have to know that the key will fit, but the last entry on the page is + * an overflow pair, so we need to shift things. + */ +static void +squeeze_key(u_int16_t *sp, const DBT *key, const DBT *val) +{ + char *p; + u_int16_t free_space, n, off, pageno; + + p = (char *)sp; + n = sp[0]; + free_space = FREESPACE(sp); + off = OFFSET(sp); + + pageno = sp[n - 1]; + off -= key->size; + sp[n - 1] = off; + memmove(p + off, key->data, key->size); + off -= val->size; + sp[n] = off; + memmove(p + off, val->data, val->size); + sp[0] = n + 2; + sp[n + 1] = pageno; + sp[n + 2] = OVFLPAGE; + FREESPACE(sp) = free_space - PAIRSIZE(key, val); + OFFSET(sp) = off; +} + +static u_int32_t * +fetch_bitmap(HTAB *hashp, int ndx) +{ + if (ndx >= hashp->nmaps) + return (NULL); + if ((hashp->mapp[ndx] = (u_int32_t *)malloc(hashp->BSIZE)) == NULL) + return (NULL); + if (__get_page(hashp, + (char *)hashp->mapp[ndx], hashp->BITMAPS[ndx], 0, 1, 1)) { + free(hashp->mapp[ndx]); + return (NULL); + } + return (hashp->mapp[ndx]); +} + +#ifdef DEBUG4 +int +print_chain(int addr) +{ + BUFHEAD *bufp; + short *bp, oaddr; + + (void)fprintf(stderr, "%d ", addr); + bufp = __get_buf(hashp, addr, NULL, 0); + bp = (short *)bufp->page; + while (bp[0] && ((bp[bp[0]] == OVFLPAGE) || + ((bp[0] > 2) && bp[2] < REAL_KEY))) { + oaddr = bp[bp[0] - 1]; + (void)fprintf(stderr, "%d ", (int)oaddr); + bufp = __get_buf(hashp, (int)oaddr, bufp, 0); + bp = (short *)bufp->page; + } + (void)fprintf(stderr, "\n"); +} +#endif diff --git a/db/hash/FreeBSD/ndbm.c b/db/hash/FreeBSD/ndbm.c new file mode 100644 index 0000000..e89d5d2 --- /dev/null +++ b/db/hash/FreeBSD/ndbm.c @@ -0,0 +1,239 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ndbm.c 8.4 (Berkeley) 7/21/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/hash/ndbm.c,v 1.7 2007/01/09 00:27:51 imp Exp $"); + +/* + * This package provides a dbm compatible interface to the new hashing + * package described in db(3). + */ + +#include + +#include +#include +#include + +#include +#define _DBM +typedef DB DBM; +#include +#include "hash.h" + +/* + * Returns: + * *DBM on success + * NULL on failure + */ +extern DBM * +dbm_open(const char *file, int flags, mode_t mode) +{ + HASHINFO info; + char path[MAXPATHLEN]; + + info.bsize = 4096; + info.ffactor = 40; + info.nelem = 1; + info.cachesize = 0; + info.hash = NULL; + info.lorder = 0; + + if( strlen(file) >= sizeof(path) - strlen(DBM_SUFFIX)) { + errno = ENAMETOOLONG; + return(NULL); + } + (void)strcpy(path, file); + (void)strcat(path, DBM_SUFFIX); + return ((DBM *)__hash_open(path, flags, mode, &info, 0)); +} + +extern void +dbm_close(db) + DBM *db; +{ + (void)(db->close)(db); +} + +/* + * Returns: + * DATUM on success + * NULL on failure + */ +extern datum +dbm_fetch(db, key) + DBM *db; + datum key; +{ + datum retdata; + int status; + DBT dbtkey, dbtretdata; + + dbtkey.data = key.dptr; + dbtkey.size = key.dsize; + status = (db->get)(db, &dbtkey, &dbtretdata, 0); + if (status) { + dbtretdata.data = NULL; + dbtretdata.size = 0; + } + retdata.dptr = dbtretdata.data; + retdata.dsize = dbtretdata.size; + return (retdata); +} + +/* + * Returns: + * DATUM on success + * NULL on failure + */ +extern datum +dbm_firstkey(db) + DBM *db; +{ + int status; + datum retkey; + DBT dbtretkey, dbtretdata; + HTAB *htab = (HTAB *)(db->internal); + + status = (db->seq)(db, &dbtretkey, &dbtretdata, R_FIRST); + if (status) { + dbtretkey.data = NULL; + htab->nextkey_eof = 1; + } else + htab->nextkey_eof = 0; + retkey.dptr = dbtretkey.data; + retkey.dsize = dbtretkey.size; + return (retkey); +} + +/* + * Returns: + * DATUM on success + * NULL on failure + */ +extern datum +dbm_nextkey(db) + DBM *db; +{ + int status = 1; + datum retkey; + DBT dbtretkey, dbtretdata; + HTAB *htab = (HTAB *)(db->internal); + + if (htab->nextkey_eof) + dbtretkey.data = NULL; + else { + status = (db->seq)(db, &dbtretkey, &dbtretdata, R_NEXT); + if (status) { + dbtretkey.data = NULL; + htab->nextkey_eof = 1; + } + } + retkey.dptr = dbtretkey.data; + retkey.dsize = dbtretkey.size; + return (retkey); +} + +/* + * Returns: + * 0 on success + * <0 failure + */ +extern int +dbm_delete(db, key) + DBM *db; + datum key; +{ + int status; + DBT dbtkey; + + dbtkey.data = key.dptr; + dbtkey.size = key.dsize; + status = (db->del)(db, &dbtkey, 0); + if (status) + return (-1); + else + return (0); +} + +/* + * Returns: + * 0 on success + * <0 failure + * 1 if DBM_INSERT and entry exists + */ +extern int +dbm_store(db, key, data, flags) + DBM *db; + datum key, data; + int flags; +{ + DBT dbtkey, dbtdata; + + dbtkey.data = key.dptr; + dbtkey.size = key.dsize; + dbtdata.data = data.dptr; + dbtdata.size = data.dsize; + return ((db->put)(db, &dbtkey, &dbtdata, + (flags == DBM_INSERT) ? R_NOOVERWRITE : 0)); +} + +extern int +dbm_error(db) + DBM *db; +{ + HTAB *hp; + + hp = (HTAB *)db->internal; + return (hp->error); +} + +extern int +dbm_clearerr(db) + DBM *db; +{ + HTAB *hp; + + hp = (HTAB *)db->internal; + hp->error = 0; + return (0); +} + +extern int +dbm_dirfno(db) + DBM *db; +{ + return(((HTAB *)db->internal)->fp); +} diff --git a/db/hash/FreeBSD/page.h b/db/hash/FreeBSD/page.h new file mode 100644 index 0000000..76082dd --- /dev/null +++ b/db/hash/FreeBSD/page.h @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)page.h 8.2 (Berkeley) 5/31/94 + * $FreeBSD: src/lib/libc/db/hash/page.h,v 1.4 2009/03/04 00:58:04 delphij Exp $ + */ + +/* + * Definitions for hashing page file format. + */ + +/* + * routines dealing with a data page + * + * page format: + * +------------------------------+ + * p | n | keyoff | datoff | keyoff | + * +------------+--------+--------+ + * | datoff | free | ptr | --> | + * +--------+---------------------+ + * | F R E E A R E A | + * +--------------+---------------+ + * | <---- - - - | data | + * +--------+-----+----+----------+ + * | key | data | key | + * +--------+----------+----------+ + * + * Pointer to the free space is always: p[p[0] + 2] + * Amount of free space on the page is: p[p[0] + 1] + */ + +/* + * How many bytes required for this pair? + * 2 shorts in the table at the top of the page + room for the + * key and room for the data + * + * We prohibit entering a pair on a page unless there is also room to append + * an overflow page. The reason for this it that you can get in a situation + * where a single key/data pair fits on a page, but you can't append an + * overflow page and later you'd have to split the key/data and handle like + * a big pair. + * You might as well do this up front. + */ + +#define PAIRSIZE(K,D) (2*sizeof(u_int16_t) + (K)->size + (D)->size) +#define BIGOVERHEAD (4*sizeof(u_int16_t)) +#define KEYSIZE(K) (4*sizeof(u_int16_t) + (K)->size); +#define OVFLSIZE (2*sizeof(u_int16_t)) +#define FREESPACE(P) ((P)[(P)[0]+1]) +#define OFFSET(P) ((P)[(P)[0]+2]) +#define PAIRFITS(P,K,D) \ + (((P)[2] >= REAL_KEY) && \ + (PAIRSIZE((K),(D)) + OVFLSIZE) <= FREESPACE((P))) +#define PAGE_META(N) (((N)+3) * sizeof(u_int16_t)) + +typedef struct { + BUFHEAD *newp; + BUFHEAD *oldp; + BUFHEAD *nextp; + u_int16_t next_addr; +} SPLIT_RETURN; diff --git a/db/man/FreeBSD/btree.3 b/db/man/FreeBSD/btree.3 new file mode 100644 index 0000000..d886f97 --- /dev/null +++ b/db/man/FreeBSD/btree.3 @@ -0,0 +1,271 @@ +.\" Copyright (c) 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)btree.3 8.4 (Berkeley) 8/18/94 +.\" $FreeBSD: src/lib/libc/db/man/btree.3,v 1.9 2007/01/09 00:27:51 imp Exp $ +.\" +.Dd August 18, 1994 +.Dt BTREE 3 +.Os +.Sh NAME +.Nm btree +.Nd "btree database access method" +.Sh SYNOPSIS +.In sys/types.h +.In db.h +.Sh DESCRIPTION +The routine +.Fn dbopen +is the library interface to database files. +One of the supported file formats is +.Nm +files. +The general description of the database access methods is in +.Xr dbopen 3 , +this manual page describes only the +.Nm +specific information. +.Pp +The +.Nm +data structure is a sorted, balanced tree structure storing +associated key/data pairs. +.Pp +The +.Nm +access method specific data structure provided to +.Fn dbopen +is defined in the +.In db.h +include file as follows: +.Bd -literal +typedef struct { + u_long flags; + u_int cachesize; + int maxkeypage; + int minkeypage; + u_int psize; + int (*compare)(const DBT *key1, const DBT *key2); + size_t (*prefix)(const DBT *key1, const DBT *key2); + int lorder; +} BTREEINFO; +.Ed +.Pp +The elements of this structure are as follows: +.Bl -tag -width indent +.It Va flags +The flag value is specified by +.Em or Ns 'ing +any of the following values: +.Bl -tag -width indent +.It Dv R_DUP +Permit duplicate keys in the tree, i.e., permit insertion if the key to be +inserted already exists in the tree. +The default behavior, as described in +.Xr dbopen 3 , +is to overwrite a matching key when inserting a new key or to fail if +the +.Dv R_NOOVERWRITE +flag is specified. +The +.Dv R_DUP +flag is overridden by the +.Dv R_NOOVERWRITE +flag, and if the +.Dv R_NOOVERWRITE +flag is specified, attempts to insert duplicate keys into +the tree will fail. +.Pp +If the database contains duplicate keys, the order of retrieval of +key/data pairs is undefined if the +.Va get +routine is used, however, +.Va seq +routine calls with the +.Dv R_CURSOR +flag set will always return the logical +.Dq first +of any group of duplicate keys. +.El +.It Va cachesize +A suggested maximum size (in bytes) of the memory cache. +This value is +.Em only +advisory, and the access method will allocate more memory rather than fail. +Since every search examines the root page of the tree, caching the most +recently used pages substantially improves access time. +In addition, physical writes are delayed as long as possible, so a moderate +cache can reduce the number of I/O operations significantly. +Obviously, using a cache increases (but only increases) the likelihood of +corruption or lost data if the system crashes while a tree is being modified. +If +.Va cachesize +is 0 (no size is specified) a default cache is used. +.It Va maxkeypage +The maximum number of keys which will be stored on any single page. +Not currently implemented. +.\" The maximum number of keys which will be stored on any single page. +.\" Because of the way the +.\" .Nm +.\" data structure works, +.\" .Va maxkeypage +.\" must always be greater than or equal to 2. +.\" If +.\" .Va maxkeypage +.\" is 0 (no maximum number of keys is specified) the page fill factor is +.\" made as large as possible (which is almost invariably what is wanted). +.It Va minkeypage +The minimum number of keys which will be stored on any single page. +This value is used to determine which keys will be stored on overflow +pages, i.e., if a key or data item is longer than the pagesize divided +by the minkeypage value, it will be stored on overflow pages instead +of in the page itself. +If +.Va minkeypage +is 0 (no minimum number of keys is specified) a value of 2 is used. +.It Va psize +Page size is the size (in bytes) of the pages used for nodes in the tree. +The minimum page size is 512 bytes and the maximum page size is 64K. +If +.Va psize +is 0 (no page size is specified) a page size is chosen based on the +underlying file system I/O block size. +.It Va compare +Compare is the key comparison function. +It must return an integer less than, equal to, or greater than zero if the +first key argument is considered to be respectively less than, equal to, +or greater than the second key argument. +The same comparison function must be used on a given tree every time it +is opened. +If +.Va compare +is +.Dv NULL +(no comparison function is specified), the keys are compared +lexically, with shorter keys considered less than longer keys. +.It Va prefix +The +.Va prefix +element +is the prefix comparison function. +If specified, this routine must return the number of bytes of the second key +argument which are necessary to determine that it is greater than the first +key argument. +If the keys are equal, the key length should be returned. +Note, the usefulness of this routine is very data dependent, but, in some +data sets can produce significantly reduced tree sizes and search times. +If +.Va prefix +is +.Dv NULL +(no prefix function is specified), +.Em and +no comparison function is specified, a default lexical comparison routine +is used. +If +.Va prefix +is +.Dv NULL +and a comparison routine is specified, no prefix comparison is +done. +.It Va lorder +The byte order for integers in the stored database metadata. +The number should represent the order as an integer; for example, +big endian order would be the number 4,321. +If +.Va lorder +is 0 (no order is specified) the current host order is used. +.El +.Pp +If the file already exists (and the +.Dv O_TRUNC +flag is not specified), the +values specified for the +.Va flags , lorder +and +.Va psize +arguments +are ignored +in favor of the values used when the tree was created. +.Pp +Forward sequential scans of a tree are from the least key to the greatest. +.Pp +Space freed up by deleting key/data pairs from the tree is never reclaimed, +although it is normally made available for reuse. +This means that the +.Nm +storage structure is grow-only. +The only solutions are to avoid excessive deletions, or to create a fresh +tree periodically from a scan of an existing one. +.Pp +Searches, insertions, and deletions in a +.Nm +will all complete in +O lg base N where base is the average fill factor. +Often, inserting ordered data into +.Nm Ns s +results in a low fill factor. +This implementation has been modified to make ordered insertion the best +case, resulting in a much better than normal page fill factor. +.Sh ERRORS +The +.Nm +access method routines may fail and set +.Va errno +for any of the errors specified for the library routine +.Xr dbopen 3 . +.Sh SEE ALSO +.Xr dbopen 3 , +.Xr hash 3 , +.Xr mpool 3 , +.Xr recno 3 +.Rs +.%T "The Ubiquitous B-tree" +.%A Douglas Comer +.%J "ACM Comput. Surv. 11" +.%N 2 +.%D June 1979 +.%P 121-138 +.Re +.Rs +.%A Bayer +.%A Unterauer +.%T "Prefix B-trees" +.%J "ACM Transactions on Database Systems" +.%N 1 +.%V Vol. 2 +.%D March 1977 +.%P 11-26 +.Re +.Rs +.%B "The Art of Computer Programming Vol. 3: Sorting and Searching" +.%A D. E. Knuth +.%D 1968 +.%P 471-480 +.Re +.Sh BUGS +Only big and little endian byte order is supported. diff --git a/db/man/FreeBSD/dbm.3 b/db/man/FreeBSD/dbm.3 new file mode 100644 index 0000000..6258f1c --- /dev/null +++ b/db/man/FreeBSD/dbm.3 @@ -0,0 +1,274 @@ +.\" Copyright (c) 1999 Tim Singletary +.\" No copyright is claimed. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/db/man/dbm.3,v 1.10 2009/01/30 15:28:35 gabor Exp $ +.\" +.Dd April 16, 2006 +.Dt DBM 3 +.Os +.Sh NAME +.Nm dbm_clearerr , +.Nm dbm_close , +.Nm dbm_delete , +.Nm dbm_dirfno , +.Nm dbm_error , +.Nm dbm_fetch , +.Nm dbm_firstkey , +.Nm dbm_nextkey , +.Nm dbm_open , +.Nm dbm_store +.Nd database access functions +.Sh SYNOPSIS +.In ndbm.h +.Ft int +.Fo dbm_clearerr +.Fa "DBM *db" +.Fc +.Ft void +.Fo dbm_close +.Fa "DBM *db" +.Fc +.Ft int +.Fo dbm_delete +.Fa "DBM *db" +.Fa "datum key" +.Fc +.Ft int +.Fo dbm_dirfno +.Fa "DBM *db" +.Fc +.Ft int +.Fo dbm_error +.Fa "DBM *db" +.Fc +.Ft datum +.Fo dbm_fetch +.Fa "DBM *db" +.Fa "datum key" +.Fc +.Ft datum +.Fo dbm_firstkey +.Fa "DBM *db" +.Fc +.Ft datum +.Fo dbm_nextkey +.Fa "DBM *db" +.Fc +.Ft DBM * +.Fo dbm_open +.Fa "const char *file" +.Fa "int open_flags" +.Fa "mode_t file_mode" +.Fc +.Ft int +.Fo dbm_store +.Fa "DBM *db" +.Fa "datum key" +.Fa "datum content" +.Fa "int store_mode" +.Fc +.Sh DESCRIPTION +Database access functions. +These functions are implemented using +.Xr dbopen 3 +with a +.Xr hash 3 +database. +.Pp +.Vt datum +is declared in +.In ndbm.h : +.Bd -literal +typedef struct { + char *dptr; + int dsize; +} datum; +.Ed +.Pp +The +.Fn dbm_open file open_flags file_mode +function +opens or creates a database file. +The +.Fa file +argument +is the basename of the file containing +the database; the actual database has a +.Pa .db +suffix. +I.e., if +.Fa file +is +.Qq Li /home/me/mystuff +then the actual database is in the file +.Pa /home/me/mystuff.db . +The +.Fa open_flags +and +.Fa file_mode +arguments +are passed to +.Xr open 2 . +.Pq Dv O_RDWR | O_CREAT +is a typical value for +.Fa open_flags ; +.Li 0660 +is a typical value for +.Fa file_mode . +.Dv O_WRONLY +is not allowed in +.Fa open_flags . +The pointer returned by +.Fn dbm_open +identifies the database and is the +.Fa db +argument to the other functions. +The +.Fn dbm_open +function +returns +.Dv NULL +and sets +.Va errno +if there were any errors. +.Pp +The +.Fn dbm_close db +function +closes the database. +.Pp +The +.Fn dbm_store db key content store_mode +function +inserts or replaces an entry in the database. +The +.Fa store_mode +argument +is either +.Dv DBM_INSERT +or +.Dv DBM_REPLACE . +If +.Fa store_mode +is +.Dv DBM_INSERT +and the database already contains an entry for +.Fa key , +that entry is not replaced. +Otherwise the entry is replaced or inserted. +The +.Fn dbm_store +function +normally returns zero but returns 1 if the entry could not be +inserted (because +.Fa store_mode +is +.Dv DBM_INSERT , +and an entry with +.Fa key +already exists) or returns -1 and sets +.Va errno +if there were any errors. +.Pp +The +.Fn dbm_fetch db key +function +returns +.Dv NULL +or the +.Fa content +corresponding to +.Fa key . +.Pp +The +.Fn dbm_delete db key +function +deletes the entry for +.Fa key . +The +.Fn dbm_delete +function +normally returns zero but returns 1 if there was no entry with +.Fa key +in the database or returns -1 and sets +.Va errno +if there were any errors. +.Pp +The +.Fn dbm_firstkey db +function +returns the first key in the database. +The +.Fn dbm_nextkey db +function +returns subsequent keys. +The +.Fn db_firstkey +function +must be called before +.Fn dbm_nextkey . +The order in which keys are returned is unspecified and may appear +random. +The +.Fn dbm_nextkey +function +returns +.Dv NULL +after all keys have been returned. +.Pp +The +.Fn dbm_error db +function +returns the +.Va errno +value of the most recent error. +The +.Fn dbm_clearerr db +function +resets this value to 0 and returns 0. +.Pp +The +.Fn dbm_dirfno db +function +returns the file descriptor to the database. +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In ndbm.h +is necessary for all functions. +.Pp +.Ft DBM * +.br +.Fo dbm_open +.Fa "const char *file" +.Fa "int open_flags" +.Fa "int file_mode" +.Fc ; +.Pp +.Fa file_mode +has type +.Vt int . +.Sh SEE ALSO +.Xr open 2 , +.Xr dbopen 3 , +.Xr hash 3 , +.Xr compat 5 +.Sh STANDARDS +These functions (except +.Fn dbm_dirfno ) +are included in the +.St -susv2 . diff --git a/db/man/FreeBSD/dbopen.3 b/db/man/FreeBSD/dbopen.3 new file mode 100644 index 0000000..f976042 --- /dev/null +++ b/db/man/FreeBSD/dbopen.3 @@ -0,0 +1,546 @@ +.\" Copyright (c) 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)dbopen.3 8.5 (Berkeley) 1/2/94 +.\" $FreeBSD: src/lib/libc/db/man/dbopen.3,v 1.13 2007/01/09 00:27:51 imp Exp $ +.\" +.Dd January 2, 1994 +.Dt DBOPEN 3 +.Os +.Sh NAME +.Nm dbopen +.Nd "database access methods" +.Sh SYNOPSIS +.In sys/types.h +.In db.h +.In fcntl.h +.In limits.h +.Ft DB * +.Fn dbopen "const char *file" "int flags" "int mode" "DBTYPE type" "const void *openinfo" +.Sh DESCRIPTION +The +.Fn dbopen +function +is the library interface to database files. +The supported file formats are btree, hashed and UNIX file oriented. +The btree format is a representation of a sorted, balanced tree structure. +The hashed format is an extensible, dynamic hashing scheme. +The flat-file format is a byte stream file with fixed or variable length +records. +The formats and file format specific information are described in detail +in their respective manual pages +.Xr btree 3 , +.Xr hash 3 +and +.Xr recno 3 . +.Pp +The +.Fn dbopen +function +opens +.Fa file +for reading and/or writing. +Files never intended to be preserved on disk may be created by setting +the +.Fa file +argument to +.Dv NULL . +.Pp +The +.Fa flags +and +.Fa mode +arguments +are as specified to the +.Xr open 2 +routine, however, only the +.Dv O_CREAT , O_EXCL , O_EXLOCK , O_NONBLOCK , +.Dv O_RDONLY , O_RDWR , O_SHLOCK +and +.Dv O_TRUNC +flags are meaningful. +(Note, opening a database file +.Dv O_WRONLY +is not possible.) +.\"Three additional options may be specified by +.\".Em or Ns 'ing +.\"them into the +.\".Fa flags +.\"argument. +.\".Bl -tag -width indent +.\".It Dv DB_LOCK +.\"Do the necessary locking in the database to support concurrent access. +.\"If concurrent access is not needed or the database is read-only this +.\"flag should not be set, as it tends to have an associated performance +.\"penalty. +.\".It Dv DB_SHMEM +.\"Place the underlying memory pool used by the database in shared +.\"memory. +.\"Necessary for concurrent access. +.\".It Dv DB_TXN +.\"Support transactions in the database. +.\"The +.\".Dv DB_LOCK +.\"and +.\".Dv DB_SHMEM +.\"flags must be set as well. +.\".El +.Pp +The +.Fa type +argument is of type +.Ft DBTYPE +(as defined in the +.In db.h +include file) and +may be set to +.Dv DB_BTREE , DB_HASH +or +.Dv DB_RECNO . +.Pp +The +.Fa openinfo +argument is a pointer to an access method specific structure described +in the access method's manual page. +If +.Fa openinfo +is +.Dv NULL , +each access method will use defaults appropriate for the system +and the access method. +.Pp +The +.Fn dbopen +function +returns a pointer to a +.Ft DB +structure on success and +.Dv NULL +on error. +The +.Ft DB +structure is defined in the +.In db.h +include file, and contains at +least the following fields: +.Bd -literal +typedef struct { + DBTYPE type; + int (*close)(DB *db); + int (*del)(const DB *db, const DBT *key, u_int flags); + int (*fd)(const DB *db); + int (*get)(const DB *db, const DBT *key, DBT *data, u_int flags); + int (*put)(const DB *db, DBT *key, const DBT *data, + u_int flags); + int (*sync)(const DB *db, u_int flags); + int (*seq)(const DB *db, DBT *key, DBT *data, u_int flags); +} DB; +.Ed +.Pp +These elements describe a database type and a set of functions performing +various actions. +These functions take a pointer to a structure as returned by +.Fn dbopen , +and sometimes one or more pointers to key/data structures and a flag value. +.Bl -tag -width indent +.It Va type +The type of the underlying access method (and file format). +.It Va close +A pointer to a routine to flush any cached information to disk, free any +allocated resources, and close the underlying file(s). +Since key/data pairs may be cached in memory, failing to sync the file +with a +.Va close +or +.Va sync +function may result in inconsistent or lost information. +.Va close +routines return -1 on error (setting +.Va errno ) +and 0 on success. +.It Va del +A pointer to a routine to remove key/data pairs from the database. +.Pp +The +.Fa flags +argument +may be set to the following value: +.Bl -tag -width indent +.It Dv R_CURSOR +Delete the record referenced by the cursor. +The cursor must have previously been initialized. +.El +.Pp +.Va delete +routines return -1 on error (setting +.Va errno ) , +0 on success, and 1 if the specified +.Fa key +was not in the file. +.It Va fd +A pointer to a routine which returns a file descriptor representative +of the underlying database. +A file descriptor referencing the same file will be returned to all +processes which call +.Fn dbopen +with the same +.Fa file +name. +This file descriptor may be safely used as an argument to the +.Xr fcntl 2 +and +.Xr flock 2 +locking functions. +The file descriptor is not necessarily associated with any of the +underlying files used by the access method. +No file descriptor is available for in memory databases. +.Va \&Fd +routines return -1 on error (setting +.Va errno ) , +and the file descriptor on success. +.It Va get +A pointer to a routine which is the interface for keyed retrieval from +the database. +The address and length of the data associated with the specified +.Fa key +are returned in the structure referenced by +.Fa data . +.Va get +routines return -1 on error (setting +.Va errno ) , +0 on success, and 1 if the +.Fa key +was not in the file. +.It Va put +A pointer to a routine to store key/data pairs in the database. +.Pp +The +.Fa flags +argument +may be set to one of the following values: +.Bl -tag -width indent +.It Dv R_CURSOR +Replace the key/data pair referenced by the cursor. +The cursor must have previously been initialized. +.It Dv R_IAFTER +Append the data immediately after the data referenced by +.Fa key , +creating a new key/data pair. +The record number of the appended key/data pair is returned in the +.Fa key +structure. +(Applicable only to the +.Dv DB_RECNO +access method.) +.It Dv R_IBEFORE +Insert the data immediately before the data referenced by +.Fa key , +creating a new key/data pair. +The record number of the inserted key/data pair is returned in the +.Fa key +structure. +(Applicable only to the +.Dv DB_RECNO +access method.) +.It Dv R_NOOVERWRITE +Enter the new key/data pair only if the key does not previously exist. +.It Dv R_SETCURSOR +Store the key/data pair, setting or initializing the position of the +cursor to reference it. +(Applicable only to the +.Dv DB_BTREE +and +.Dv DB_RECNO +access methods.) +.El +.Pp +.Dv R_SETCURSOR +is available only for the +.Dv DB_BTREE +and +.Dv DB_RECNO +access +methods because it implies that the keys have an inherent order +which does not change. +.Pp +.Dv R_IAFTER +and +.Dv R_IBEFORE +are available only for the +.Dv DB_RECNO +access method because they each imply that the access method is able to +create new keys. +This is only true if the keys are ordered and independent, record numbers +for example. +.Pp +The default behavior of the +.Va put +routines is to enter the new key/data pair, replacing any previously +existing key. +.Pp +.Va put +routines return -1 on error (setting +.Va errno ) , +0 on success, and 1 if the +.Dv R_NOOVERWRITE +flag +was set and the key already exists in the file. +.It Va seq +A pointer to a routine which is the interface for sequential +retrieval from the database. +The address and length of the key are returned in the structure +referenced by +.Fa key , +and the address and length of the data are returned in the +structure referenced +by +.Fa data . +.Pp +Sequential key/data pair retrieval may begin at any time, and the +position of the +.Dq cursor +is not affected by calls to the +.Va del , +.Va get , +.Va put , +or +.Va sync +routines. +Modifications to the database during a sequential scan will be reflected +in the scan, i.e., records inserted behind the cursor will not be returned +while records inserted in front of the cursor will be returned. +.Pp +The +.Fa flags +argument +.Em must +be set to one of the following values: +.Bl -tag -width indent +.It Dv R_CURSOR +The data associated with the specified key is returned. +This differs from the +.Va get +routines in that it sets or initializes the cursor to the location of +the key as well. +(Note, for the +.Dv DB_BTREE +access method, the returned key is not necessarily an +exact match for the specified key. +The returned key is the smallest key greater than or equal to the specified +key, permitting partial key matches and range searches.) +.It Dv R_FIRST +The first key/data pair of the database is returned, and the cursor +is set or initialized to reference it. +.It Dv R_LAST +The last key/data pair of the database is returned, and the cursor +is set or initialized to reference it. +(Applicable only to the +.Dv DB_BTREE +and +.Dv DB_RECNO +access methods.) +.It Dv R_NEXT +Retrieve the key/data pair immediately after the cursor. +If the cursor is not yet set, this is the same as the +.Dv R_FIRST +flag. +.It Dv R_PREV +Retrieve the key/data pair immediately before the cursor. +If the cursor is not yet set, this is the same as the +.Dv R_LAST +flag. +(Applicable only to the +.Dv DB_BTREE +and +.Dv DB_RECNO +access methods.) +.El +.Pp +.Dv R_LAST +and +.Dv R_PREV +are available only for the +.Dv DB_BTREE +and +.Dv DB_RECNO +access methods because they each imply that the keys have an inherent +order which does not change. +.Pp +.Va seq +routines return -1 on error (setting +.Va errno ) , +0 on success and 1 if there are no key/data pairs less than or greater +than the specified or current key. +If the +.Dv DB_RECNO +access method is being used, and if the database file +is a character special file and no complete key/data pairs are currently +available, the +.Va seq +routines return 2. +.It Va sync +A pointer to a routine to flush any cached information to disk. +If the database is in memory only, the +.Va sync +routine has no effect and will always succeed. +.Pp +The +.Fa flags +argument may be set to the following value: +.Bl -tag -width indent +.It Dv R_RECNOSYNC +If the +.Dv DB_RECNO +access method is being used, this flag causes +the +.Va sync +routine to apply to the btree file which underlies the +recno file, not the recno file itself. +(See the +.Va bfname +field of the +.Xr recno 3 +manual page for more information.) +.El +.Pp +.Va sync +routines return -1 on error (setting +.Va errno ) +and 0 on success. +.El +.Sh "KEY/DATA PAIRS" +Access to all file types is based on key/data pairs. +Both keys and data are represented by the following data structure: +.Bd -literal +typedef struct { + void *data; + size_t size; +} DBT; +.Ed +.Pp +The elements of the +.Ft DBT +structure are defined as follows: +.Bl -tag -width "data" +.It Va data +A pointer to a byte string. +.It Va size +The length of the byte string. +.El +.Pp +Key and data byte strings may reference strings of essentially unlimited +length although any two of them must fit into available memory at the same +time. +It should be noted that the access methods provide no guarantees about +byte string alignment. +.Sh ERRORS +The +.Fn dbopen +routine may fail and set +.Va errno +for any of the errors specified for the library routines +.Xr open 2 +and +.Xr malloc 3 +or the following: +.Bl -tag -width Er +.It Bq Er EFTYPE +A file is incorrectly formatted. +.It Bq Er EINVAL +An argument has been specified (hash function, pad byte etc.) that is +incompatible with the current file specification or which is not +meaningful for the function (for example, use of the cursor without +prior initialization) or there is a mismatch between the version +number of file and the software. +.El +.Pp +The +.Va close +routines may fail and set +.Va errno +for any of the errors specified for the library routines +.Xr close 2 , +.Xr read 2 , +.Xr write 2 , +.Xr free 3 , +or +.Xr fsync 2 . +.Pp +The +.Va del , +.Va get , +.Va put +and +.Va seq +routines may fail and set +.Va errno +for any of the errors specified for the library routines +.Xr read 2 , +.Xr write 2 , +.Xr free 3 +or +.Xr malloc 3 . +.Pp +The +.Va fd +routines will fail and set +.Va errno +to +.Er ENOENT +for in memory databases. +.Pp +The +.Va sync +routines may fail and set +.Va errno +for any of the errors specified for the library routine +.Xr fsync 2 . +.Sh SEE ALSO +.Xr btree 3 , +.Xr hash 3 , +.Xr mpool 3 , +.Xr recno 3 +.Rs +.%T "LIBTP: Portable, Modular Transactions for UNIX" +.%A Margo Seltzer +.%A Michael Olson +.%R "USENIX proceedings" +.%D Winter 1992 +.Re +.Sh BUGS +The typedef +.Ft DBT +is a mnemonic for +.Dq "data base thang" , +and was used +because noone could think of a reasonable name that was not already used. +.Pp +The file descriptor interface is a kluge and will be deleted in a +future version of the interface. +.Pp +None of the access methods provide any form of concurrent access, +locking, or transactions. diff --git a/db/man/FreeBSD/hash.3 b/db/man/FreeBSD/hash.3 new file mode 100644 index 0000000..ea8db05 --- /dev/null +++ b/db/man/FreeBSD/hash.3 @@ -0,0 +1,196 @@ +.\" Copyright (c) 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)hash.3 8.6 (Berkeley) 8/18/94 +.\" $FreeBSD: src/lib/libc/db/man/hash.3,v 1.9 2007/01/09 00:27:51 imp Exp $ +.\" +.Dd August 18, 1994 +.Dt HASH 3 +.Os +.Sh NAME +.Nm hash +.Nd "hash database access method" +.Sh SYNOPSIS +.In sys/types.h +.In db.h +.Sh DESCRIPTION +The routine +.Fn dbopen +is the library interface to database files. +One of the supported file formats is +.Nm +files. +The general description of the database access methods is in +.Xr dbopen 3 , +this manual page describes only the +.Nm +specific information. +.Pp +The +.Nm +data structure is an extensible, dynamic hashing scheme. +.Pp +The access method specific data structure provided to +.Fn dbopen +is defined in the +.In db.h +include file as follows: +.Bd -literal +typedef struct { + u_int bsize; + u_int ffactor; + u_int nelem; + u_int cachesize; + u_int32_t (*hash)(const void *, size_t); + int lorder; +} HASHINFO; +.Ed +.Pp +The elements of this structure are as follows: +.Bl -tag -width indent +.It Va bsize +The +.Va bsize +element +defines the +.Nm +table bucket size, and is, by default, 256 bytes. +It may be preferable to increase the page size for disk-resident tables +and tables with large data items. +.It Va ffactor +The +.Va ffactor +element +indicates a desired density within the +.Nm +table. +It is an approximation of the number of keys allowed to accumulate in any +one bucket, determining when the +.Nm +table grows or shrinks. +The default value is 8. +.It Va nelem +The +.Va nelem +element +is an estimate of the final size of the +.Nm +table. +If not set or set too low, +.Nm +tables will expand gracefully as keys +are entered, although a slight performance degradation may be noticed. +The default value is 1. +.It Va cachesize +A suggested maximum size, in bytes, of the memory cache. +This value is +.Em only +advisory, and the access method will allocate more memory rather +than fail. +.It Va hash +The +.Va hash +element +is a user defined +.Nm +function. +Since no +.Nm +function performs equally well on all possible data, the +user may find that the built-in +.Nm +function does poorly on a particular +data set. +User specified +.Nm +functions must take two arguments (a pointer to a byte +string and a length) and return a 32-bit quantity to be used as the +.Nm +value. +.It Va lorder +The byte order for integers in the stored database metadata. +The number should represent the order as an integer; for example, +big endian order would be the number 4,321. +If +.Va lorder +is 0 (no order is specified) the current host order is used. +If the file already exists, the specified value is ignored and the +value specified when the tree was created is used. +.El +.Pp +If the file already exists (and the +.Dv O_TRUNC +flag is not specified), the +values specified for the +.Va bsize , ffactor , lorder +and +.Va nelem +arguments +are +ignored and the values specified when the tree was created are used. +.Pp +If a +.Nm +function is specified, +.Fn hash_open +will attempt to determine if the +.Nm +function specified is the same as +the one with which the database was created, and will fail if it is not. +.Pp +Backward compatible interfaces to the older +.Em dbm +and +.Em ndbm +routines are provided, however these interfaces are not compatible with +previous file formats. +.Sh ERRORS +The +.Nm +access method routines may fail and set +.Va errno +for any of the errors specified for the library routine +.Xr dbopen 3 . +.Sh SEE ALSO +.Xr btree 3 , +.Xr dbopen 3 , +.Xr mpool 3 , +.Xr recno 3 +.Rs +.%T "Dynamic Hash Tables" +.%A Per-Ake Larson +.%R "Communications of the ACM" +.%D April 1988 +.Re +.Rs +.%T "A New Hash Package for UNIX" +.%A Margo Seltzer +.%R "USENIX Proceedings" +.%D Winter 1991 +.Re +.Sh BUGS +Only big and little endian byte order is supported. diff --git a/db/man/FreeBSD/mpool.3 b/db/man/FreeBSD/mpool.3 new file mode 100644 index 0000000..d5c51ae --- /dev/null +++ b/db/man/FreeBSD/mpool.3 @@ -0,0 +1,227 @@ +.\" Copyright (c) 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)mpool.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/db/man/mpool.3,v 1.15 2007/01/09 00:27:51 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt MPOOL 3 +.Os +.Sh NAME +.Nm mpool +.Nd "shared memory buffer pool" +.Sh SYNOPSIS +.In db.h +.In mpool.h +.Ft MPOOL * +.Fn mpool_open "void *key" "int fd" "pgno_t pagesize" "pgno_t maxcache" +.Ft void +.Fo mpool_filter +.Fa "MPOOL *mp" +.Fa "void (*pgin)(void *, pgno_t, void *)" +.Fa "void (*pgout)(void *, pgno_t, void *)" +.Fa "void *pgcookie" +.Fc +.Ft void * +.Fn mpool_new "MPOOL *mp" "pgno_t *pgnoaddr" +.Ft void * +.Fn mpool_get "MPOOL *mp" "pgno_t pgno" "u_int flags" +.Ft int +.Fn mpool_put "MPOOL *mp" "void *pgaddr" "u_int flags" +.Ft int +.Fn mpool_sync "MPOOL *mp" +.Ft int +.Fn mpool_close "MPOOL *mp" +.Sh DESCRIPTION +The +.Nm mpool +library interface is intended to provide page oriented buffer management +of files. +.Pp +The +.Fn mpool_open +function initializes a memory pool. +The +.Fa key +argument is currently ignored. +The +.Fa fd +argument is a file descriptor for the underlying file, which must be seekable. +.Pp +The +.Fa pagesize +argument is the size, in bytes, of the pages into which the file is broken up. +The +.Fa maxcache +argument is the maximum number of pages from the underlying file to cache +at any one time. +This value is not relative to the number of processes which share a file's +buffers, but will be the largest value specified by any of the processes +sharing the file. +.Pp +The +.Fn mpool_filter +function is intended to make transparent input and output processing of the +pages possible. +If the +.Fa pgin +function is specified, it is called each time a buffer is read into the memory +pool from the backing file. +If the +.Fa pgout +function is specified, it is called each time a buffer is written into the +backing file. +Both functions are called with the +.Fa pgcookie +pointer, the page number and a pointer to the page to being read or written. +.Pp +The +.Fn mpool_new +function takes an +.Ft MPOOL +pointer and an address as arguments. +If a new page can be allocated, a pointer to the page is returned and +the page number is stored into the +.Fa pgnoaddr +address. +Otherwise, +.Dv NULL +is returned and +.Va errno +is set. +.Pp +The +.Fn mpool_get +function takes a +.Ft MPOOL +pointer and a page number as arguments. +If the page exists, a pointer to the page is returned. +Otherwise, +.Dv NULL +is returned and +.Va errno +is set. +The +.Fa flags +argument is not currently used. +.Pp +The +.Fn mpool_put +function unpins the page referenced by +.Fa pgaddr . +The +.Fa pgaddr +argument +must be an address previously returned by +.Fn mpool_get +or +.Fn mpool_new . +The +.Fa flags +argument is specified by +.Em or Ns 'ing +any of the following values: +.Bl -tag -width indent +.It Dv MPOOL_DIRTY +The page has been modified and needs to be written to the backing file. +.El +.Pp +The +.Fn mpool_put +function +returns 0 on success and -1 if an error occurs. +.Pp +The +.Fn mpool_sync +function writes all modified pages associated with the +.Ft MPOOL +pointer to the +backing file. +The +.Fn mpool_sync +function +returns 0 on success and -1 if an error occurs. +.Pp +The +.Fn mpool_close +function free's up any allocated memory associated with the memory pool +cookie. +Modified pages are +.Em not +written to the backing file. +The +.Fn mpool_close +function +returns 0 on success and -1 if an error occurs. +.Sh ERRORS +The +.Fn mpool_open +function may fail and set +.Va errno +for any of the errors specified for the library routine +.Xr malloc 3 . +.Pp +The +.Fn mpool_get +function may fail and set +.Va errno +for the following: +.Bl -tag -width Er +.It Bq Er EINVAL +The requested record does not exist. +.El +.Pp +The +.Fn mpool_new +and +.Fn mpool_get +functions may fail and set +.Va errno +for any of the errors specified for the library routines +.Xr read 2 , +.Xr write 2 , +and +.Xr malloc 3 . +.Pp +The +.Fn mpool_sync +function may fail and set +.Va errno +for any of the errors specified for the library routine +.Xr write 2 . +.Pp +The +.Fn mpool_close +function may fail and set +.Va errno +for any of the errors specified for the library routine +.Xr free 3 . +.Sh SEE ALSO +.Xr btree 3 , +.Xr dbopen 3 , +.Xr hash 3 , +.Xr recno 3 diff --git a/db/man/FreeBSD/recno.3 b/db/man/FreeBSD/recno.3 new file mode 100644 index 0000000..ff32fed --- /dev/null +++ b/db/man/FreeBSD/recno.3 @@ -0,0 +1,228 @@ +.\" Copyright (c) 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)recno.3 8.5 (Berkeley) 8/18/94 +.\" $FreeBSD: src/lib/libc/db/man/recno.3,v 1.9 2007/01/09 00:27:51 imp Exp $ +.\" +.Dd August 18, 1994 +.Dt RECNO 3 +.Os +.Sh NAME +.Nm recno +.Nd "record number database access method" +.Sh SYNOPSIS +.In sys/types.h +.In db.h +.Sh DESCRIPTION +The routine +.Fn dbopen +is the library interface to database files. +One of the supported file formats is record number files. +The general description of the database access methods is in +.Xr dbopen 3 , +this manual page describes only the +.Nm +specific information. +.Pp +The record number data structure is either variable or fixed-length +records stored in a flat-file format, accessed by the logical record +number. +The existence of record number five implies the existence of records +one through four, and the deletion of record number one causes +record number five to be renumbered to record number four, as well +as the cursor, if positioned after record number one, to shift down +one record. +.Pp +The +.Nm +access method specific data structure provided to +.Fn dbopen +is defined in the +.In db.h +include file as follows: +.Bd -literal +typedef struct { + u_long flags; + u_int cachesize; + u_int psize; + int lorder; + size_t reclen; + u_char bval; + char *bfname; +} RECNOINFO; +.Ed +.Pp +The elements of this structure are defined as follows: +.Bl -tag -width indent +.It Va flags +The flag value is specified by +.Em or Ns 'ing +any of the following values: +.Bl -tag -width indent +.It Dv R_FIXEDLEN +The records are fixed-length, not byte delimited. +The structure element +.Va reclen +specifies the length of the record, and the structure element +.Va bval +is used as the pad character. +Any records, inserted into the database, that are less than +.Va reclen +bytes long are automatically padded. +.It Dv R_NOKEY +In the interface specified by +.Fn dbopen , +the sequential record retrieval fills in both the caller's key and +data structures. +If the +.Dv R_NOKEY +flag is specified, the +.Em cursor +routines are not required to fill in the key structure. +This permits applications to retrieve records at the end of files without +reading all of the intervening records. +.It Dv R_SNAPSHOT +This flag requires that a snapshot of the file be taken when +.Fn dbopen +is called, instead of permitting any unmodified records to be read from +the original file. +.El +.It Va cachesize +A suggested maximum size, in bytes, of the memory cache. +This value is +.Em only +advisory, and the access method will allocate more memory rather than fail. +If +.Va cachesize +is 0 (no size is specified) a default cache is used. +.It Va psize +The +.Nm +access method stores the in-memory copies of its records +in a btree. +This value is the size (in bytes) of the pages used for nodes in that tree. +If +.Va psize +is 0 (no page size is specified) a page size is chosen based on the +underlying file system I/O block size. +See +.Xr btree 3 +for more information. +.It Va lorder +The byte order for integers in the stored database metadata. +The number should represent the order as an integer; for example, +big endian order would be the number 4,321. +If +.Va lorder +is 0 (no order is specified) the current host order is used. +.It Va reclen +The length of a fixed-length record. +.It Va bval +The delimiting byte to be used to mark the end of a record for +variable-length records, and the pad character for fixed-length +records. +If no value is specified, newlines +.Pq Dq \en +are used to mark the end +of variable-length records and fixed-length records are padded with +spaces. +.It Va bfname +The +.Nm +access method stores the in-memory copies of its records +in a btree. +If +.Va bfname +is +.No non\- Ns Dv NULL , +it specifies the name of the btree file, +as if specified as the file name for a +.Fn dbopen +of a btree file. +.El +.Pp +The data part of the key/data pair used by the +.Nm +access method +is the same as other access methods. +The key is different. +The +.Va data +field of the key should be a pointer to a memory location of type +.Ft recno_t , +as defined in the +.In db.h +include file. +This type is normally the largest unsigned integral type available to +the implementation. +The +.Va size +field of the key should be the size of that type. +.Pp +Because there can be no meta-data associated with the underlying +.Nm +access method files, any changes made to the default values +(e.g.\& fixed record length or byte separator value) must be explicitly +specified each time the file is opened. +.Pp +In the interface specified by +.Fn dbopen , +using the +.Va put +interface to create a new record will cause the creation of multiple, +empty records if the record number is more than one greater than the +largest record currently in the database. +.Sh ERRORS +The +.Nm +access method routines may fail and set +.Va errno +for any of the errors specified for the library routine +.Xr dbopen 3 +or the following: +.Bl -tag -width Er +.It Bq Er EINVAL +An attempt was made to add a record to a fixed-length database that +was too large to fit. +.El +.Sh SEE ALSO +.Xr btree 3 , +.Xr dbopen 3 , +.Xr hash 3 , +.Xr mpool 3 +.Rs +.%T "Document Processing in a Relational Database System" +.%A Michael Stonebraker +.%A Heidi Stettner +.%A Joseph Kalash +.%A Antonin Guttman +.%A Nadene Lynn +.%R "Memorandum No. UCB/ERL M82/32" +.%D May 1982 +.Re +.Sh BUGS +Only big and little endian byte order is supported. diff --git a/db/mpool/FreeBSD/mpool.c b/db/mpool/FreeBSD/mpool.c new file mode 100644 index 0000000..56e6a30 --- /dev/null +++ b/db/mpool/FreeBSD/mpool.c @@ -0,0 +1,446 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/mpool/mpool.c,v 1.16 2009/03/28 04:00:46 delphij Exp $"); + +#include "namespace.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include + +#define __MPOOLINTERFACE_PRIVATE +#include + +static BKT *mpool_bkt(MPOOL *); +static BKT *mpool_look(MPOOL *, pgno_t); +static int mpool_write(MPOOL *, BKT *); + +/* + * mpool_open -- + * Initialize a memory pool. + */ +/* ARGSUSED */ +MPOOL * +mpool_open(void *key, int fd, pgno_t pagesize, pgno_t maxcache) +{ + struct stat sb; + MPOOL *mp; + int entry; + + /* + * Get information about the file. + * + * XXX + * We don't currently handle pipes, although we should. + */ + if (_fstat(fd, &sb)) + return (NULL); + if (!S_ISREG(sb.st_mode)) { + errno = ESPIPE; + return (NULL); + } + + /* Allocate and initialize the MPOOL cookie. */ + if ((mp = (MPOOL *)calloc(1, sizeof(MPOOL))) == NULL) + return (NULL); + TAILQ_INIT(&mp->lqh); + for (entry = 0; entry < HASHSIZE; ++entry) + TAILQ_INIT(&mp->hqh[entry]); + mp->maxcache = maxcache; + mp->npages = sb.st_size / pagesize; + mp->pagesize = pagesize; + mp->fd = fd; + return (mp); +} + +/* + * mpool_filter -- + * Initialize input/output filters. + */ +void +mpool_filter(MPOOL *mp, void (*pgin) (void *, pgno_t, void *), + void (*pgout) (void *, pgno_t, void *), void *pgcookie) +{ + mp->pgin = pgin; + mp->pgout = pgout; + mp->pgcookie = pgcookie; +} + +/* + * mpool_new -- + * Get a new page of memory. + */ +void * +mpool_new(mp, pgnoaddr) + MPOOL *mp; + pgno_t *pgnoaddr; +{ + struct _hqh *head; + BKT *bp; + + if (mp->npages == MAX_PAGE_NUMBER) { + (void)fprintf(stderr, "mpool_new: page allocation overflow.\n"); + LIBC_ABORT("page allocation overflow"); + } +#ifdef STATISTICS + ++mp->pagenew; +#endif + /* + * Get a BKT from the cache. Assign a new page number, attach + * it to the head of the hash chain, the tail of the lru chain, + * and return. + */ + if ((bp = mpool_bkt(mp)) == NULL) + return (NULL); + *pgnoaddr = bp->pgno = mp->npages++; + bp->flags = MPOOL_PINNED; + + head = &mp->hqh[HASHKEY(bp->pgno)]; + TAILQ_INSERT_HEAD(head, bp, hq); + TAILQ_INSERT_TAIL(&mp->lqh, bp, q); + return (bp->page); +} + +/* + * mpool_get + * Get a page. + */ +/* ARGSUSED */ +void * +mpool_get(MPOOL *mp, pgno_t pgno, + u_int flags) /* XXX not used? */ +{ + struct _hqh *head; + BKT *bp; + off_t off; + int nr; + + /* Check for attempt to retrieve a non-existent page. */ + if (pgno >= mp->npages) { + errno = EINVAL; + return (NULL); + } + +#ifdef STATISTICS + ++mp->pageget; +#endif + + /* Check for a page that is cached. */ + if ((bp = mpool_look(mp, pgno)) != NULL) { +#ifdef DEBUG + if (bp->flags & MPOOL_PINNED) { + (void)fprintf(stderr, + "mpool_get: page %d already pinned\n", bp->pgno); + LIBC_ABORT("page %d already pinned", bp->pgno); + } +#endif + /* + * Move the page to the head of the hash chain and the tail + * of the lru chain. + */ + head = &mp->hqh[HASHKEY(bp->pgno)]; + TAILQ_REMOVE(head, bp, hq); + TAILQ_INSERT_HEAD(head, bp, hq); + TAILQ_REMOVE(&mp->lqh, bp, q); + TAILQ_INSERT_TAIL(&mp->lqh, bp, q); + + /* Return a pinned page. */ + bp->flags |= MPOOL_PINNED; + return (bp->page); + } + + /* Get a page from the cache. */ + if ((bp = mpool_bkt(mp)) == NULL) + return (NULL); + + /* Read in the contents. */ +#ifdef STATISTICS + ++mp->pageread; +#endif + off = mp->pagesize * pgno; + nr = pread(mp->fd, bp->page, mp->pagesize, off); + if (nr != mp->pagesize) { + if (nr >= 0) + errno = EFTYPE; + return (NULL); + } + + /* Set the page number, pin the page. */ + bp->pgno = pgno; + bp->flags = MPOOL_PINNED; + + /* + * Add the page to the head of the hash chain and the tail + * of the lru chain. + */ + head = &mp->hqh[HASHKEY(bp->pgno)]; + TAILQ_INSERT_HEAD(head, bp, hq); + TAILQ_INSERT_TAIL(&mp->lqh, bp, q); + + /* Run through the user's filter. */ + if (mp->pgin != NULL) + (mp->pgin)(mp->pgcookie, bp->pgno, bp->page); + + return (bp->page); +} + +/* + * mpool_put + * Return a page. + */ +/* ARGSUSED */ +int +mpool_put(MPOOL *mp, void *page, u_int flags) +{ + BKT *bp; + +#ifdef STATISTICS + ++mp->pageput; +#endif + bp = (BKT *)((char *)page - sizeof(BKT)); +#ifdef DEBUG + if (!(bp->flags & MPOOL_PINNED)) { + (void)fprintf(stderr, + "mpool_put: page %d not pinned\n", bp->pgno); + LIBC_ABORT("page %d not pinned", bp->pgno); + } +#endif + bp->flags &= ~MPOOL_PINNED; + bp->flags |= flags & MPOOL_DIRTY; + return (RET_SUCCESS); +} + +/* + * mpool_close + * Close the buffer pool. + */ +int +mpool_close(MPOOL *mp) +{ + BKT *bp; + + /* Free up any space allocated to the lru pages. */ + while (!TAILQ_EMPTY(&mp->lqh)) { + bp = TAILQ_FIRST(&mp->lqh); + TAILQ_REMOVE(&mp->lqh, bp, q); + free(bp); + } + + /* Free the MPOOL cookie. */ + free(mp); + return (RET_SUCCESS); +} + +/* + * mpool_sync + * Sync the pool to disk. + */ +int +mpool_sync(MPOOL *mp) +{ + BKT *bp; + + /* Walk the lru chain, flushing any dirty pages to disk. */ + TAILQ_FOREACH(bp, &mp->lqh, q) { + if (bp->flags & MPOOL_DIRTY) { + if (mpool_write(mp, bp) == RET_ERROR) { + return (RET_ERROR); + } else { + /* 4874757: Re-run through the user's pgin filter. */ + if (mp->pgin != NULL) + (mp->pgin)(mp->pgcookie, bp->pgno, bp->page); + } + } + } + + /* Sync the file descriptor. */ + return (_fsync(mp->fd) ? RET_ERROR : RET_SUCCESS); +} + +/* + * mpool_bkt + * Get a page from the cache (or create one). + */ +static BKT * +mpool_bkt(MPOOL *mp) +{ + struct _hqh *head; + BKT *bp; + + /* If under the max cached, always create a new page. */ + if (mp->curcache < mp->maxcache) + goto new; + + /* + * If the cache is max'd out, walk the lru list for a buffer we + * can flush. If we find one, write it (if necessary) and take it + * off any lists. If we don't find anything we grow the cache anyway. + * The cache never shrinks. + */ + TAILQ_FOREACH(bp, &mp->lqh, q) + if (!(bp->flags & MPOOL_PINNED)) { + /* Flush if dirty. */ + if (bp->flags & MPOOL_DIRTY && + mpool_write(mp, bp) == RET_ERROR) + return (NULL); +#ifdef STATISTICS + ++mp->pageflush; +#endif + /* Remove from the hash and lru queues. */ + head = &mp->hqh[HASHKEY(bp->pgno)]; + TAILQ_REMOVE(head, bp, hq); + TAILQ_REMOVE(&mp->lqh, bp, q); +#ifdef DEBUG + { void *spage; + spage = bp->page; + memset(bp, 0xff, sizeof(BKT) + mp->pagesize); + bp->page = spage; + } +#endif + return (bp); + } + +new: if ((bp = (BKT *)calloc(1, sizeof(BKT) + mp->pagesize)) == NULL) + return (NULL); +#ifdef STATISTICS + ++mp->pagealloc; +#endif + bp->page = (char *)bp + sizeof(BKT); + ++mp->curcache; + return (bp); +} + +/* + * mpool_write + * Write a page to disk. + */ +static int +mpool_write(MPOOL *mp, BKT *bp) +{ + off_t off; + +#ifdef STATISTICS + ++mp->pagewrite; +#endif + + /* Run through the user's filter. */ + if (mp->pgout) + (mp->pgout)(mp->pgcookie, bp->pgno, bp->page); + + off = mp->pagesize * bp->pgno; + if (pwrite(mp->fd, bp->page, mp->pagesize, off) != mp->pagesize) + return (RET_ERROR); + + bp->flags &= ~MPOOL_DIRTY; + return (RET_SUCCESS); +} + +/* + * mpool_look + * Lookup a page in the cache. + */ +static BKT * +mpool_look(MPOOL *mp, pgno_t pgno) +{ + struct _hqh *head; + BKT *bp; + + head = &mp->hqh[HASHKEY(pgno)]; + TAILQ_FOREACH(bp, head, hq) + if (bp->pgno == pgno) { +#ifdef STATISTICS + ++mp->cachehit; +#endif + return (bp); + } +#ifdef STATISTICS + ++mp->cachemiss; +#endif + return (NULL); +} + +#ifdef STATISTICS +/* + * mpool_stat + * Print out cache statistics. + */ +void +mpool_stat(MPOOL *mp) +{ + BKT *bp; + int cnt; + char *sep; + + (void)fprintf(stderr, "%lu pages in the file\n", mp->npages); + (void)fprintf(stderr, + "page size %lu, cacheing %lu pages of %lu page max cache\n", + mp->pagesize, mp->curcache, mp->maxcache); + (void)fprintf(stderr, "%lu page puts, %lu page gets, %lu page new\n", + mp->pageput, mp->pageget, mp->pagenew); + (void)fprintf(stderr, "%lu page allocs, %lu page flushes\n", + mp->pagealloc, mp->pageflush); + if (mp->cachehit + mp->cachemiss) + (void)fprintf(stderr, + "%.0f%% cache hit rate (%lu hits, %lu misses)\n", + ((double)mp->cachehit / (mp->cachehit + mp->cachemiss)) + * 100, mp->cachehit, mp->cachemiss); + (void)fprintf(stderr, "%lu page reads, %lu page writes\n", + mp->pageread, mp->pagewrite); + + sep = ""; + cnt = 0; + TAILQ_FOREACH(bp, &mp->lqh, q) { + (void)fprintf(stderr, "%s%d", sep, bp->pgno); + if (bp->flags & MPOOL_DIRTY) + (void)fprintf(stderr, "d"); + if (bp->flags & MPOOL_PINNED) + (void)fprintf(stderr, "P"); + if (++cnt == 10) { + sep = "\n"; + cnt = 0; + } else + sep = ", "; + + } + (void)fprintf(stderr, "\n"); +} +#endif diff --git a/db/recno/FreeBSD/rec_close.c b/db/recno/FreeBSD/rec_close.c new file mode 100644 index 0000000..f335a9f --- /dev/null +++ b/db/recno/FreeBSD/rec_close.c @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rec_close.c 8.6 (Berkeley) 8/18/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/recno/rec_close.c,v 1.11 2009/03/28 05:45:29 delphij Exp $"); + +#include "namespace.h" +#include +#include +#include + +#include +#include +#include +#include +#include "un-namespace.h" + +#include +#include "recno.h" + +/* + * __REC_CLOSE -- Close a recno tree. + * + * Parameters: + * dbp: pointer to access method + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__rec_close(DB *dbp) +{ + BTREE *t; + int status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + if (__rec_sync(dbp, 0) == RET_ERROR) + return (RET_ERROR); + + /* Committed to closing. */ + status = RET_SUCCESS; + if (F_ISSET(t, R_MEMMAPPED) && munmap(t->bt_smap, t->bt_msize)) + status = RET_ERROR; + + if (!F_ISSET(t, R_INMEM)) { + if (F_ISSET(t, R_CLOSEFP)) { + if (fclose(t->bt_rfp)) + status = RET_ERROR; + } else { + if (_close(t->bt_rfd)) + status = RET_ERROR; + } + } + + if (__bt_close(dbp) == RET_ERROR) + status = RET_ERROR; + + return (status); +} + +/* + * __REC_SYNC -- sync the recno tree to disk. + * + * Parameters: + * dbp: pointer to access method + * + * Returns: + * RET_SUCCESS, RET_ERROR. + */ +int +__rec_sync(const DB *dbp, u_int flags) +{ + struct iovec iov[2]; + BTREE *t; + DBT data, key; + off_t off; + recno_t scursor, trec; + int status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + if (flags == R_RECNOSYNC) + return (__bt_sync(dbp, 0)); + + if (F_ISSET(t, R_RDONLY | R_INMEM) || !F_ISSET(t, R_MODIFIED)) + return (RET_SUCCESS); + + /* Read any remaining records into the tree. */ + if (!F_ISSET(t, R_EOF) && t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR) + return (RET_ERROR); + + /* Rewind the file descriptor. */ + if (lseek(t->bt_rfd, (off_t)0, SEEK_SET) != 0) + return (RET_ERROR); + + /* Save the cursor. */ + scursor = t->bt_cursor.rcursor; + + key.size = sizeof(recno_t); + key.data = &trec; + + if (F_ISSET(t, R_FIXLEN)) { + /* + * We assume that fixed length records are all fixed length. + * Any that aren't are either EINVAL'd or corrected by the + * record put code. + */ + status = (dbp->seq)(dbp, &key, &data, R_FIRST); + while (status == RET_SUCCESS) { + if (_write(t->bt_rfd, data.data, data.size) != + (ssize_t)data.size) + return (RET_ERROR); + status = (dbp->seq)(dbp, &key, &data, R_NEXT); + } + } else { + iov[1].iov_base = &t->bt_bval; + iov[1].iov_len = 1; + + status = (dbp->seq)(dbp, &key, &data, R_FIRST); + while (status == RET_SUCCESS) { + iov[0].iov_base = data.data; + iov[0].iov_len = data.size; + if (_writev(t->bt_rfd, iov, 2) != (ssize_t)(data.size + 1)) + return (RET_ERROR); + status = (dbp->seq)(dbp, &key, &data, R_NEXT); + } + } + + /* Restore the cursor. */ + t->bt_cursor.rcursor = scursor; + + if (status == RET_ERROR) + return (RET_ERROR); + if ((off = lseek(t->bt_rfd, (off_t)0, SEEK_CUR)) == -1) + return (RET_ERROR); + if (ftruncate(t->bt_rfd, off)) + return (RET_ERROR); + F_CLR(t, R_MODIFIED); + return (RET_SUCCESS); +} diff --git a/db/recno/FreeBSD/rec_delete.c b/db/recno/FreeBSD/rec_delete.c new file mode 100644 index 0000000..f7062d2 --- /dev/null +++ b/db/recno/FreeBSD/rec_delete.c @@ -0,0 +1,187 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rec_delete.c 8.7 (Berkeley) 7/14/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/recno/rec_delete.c,v 1.5 2009/03/03 02:16:12 delphij Exp $"); + +#include + +#include +#include +#include + +#include +#include "recno.h" + +static int rec_rdelete(BTREE *, recno_t); + +/* + * __REC_DELETE -- Delete the item(s) referenced by a key. + * + * Parameters: + * dbp: pointer to access method + * key: key to delete + * flags: R_CURSOR if deleting what the cursor references + * + * Returns: + * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. + */ +int +__rec_delete(const DB *dbp, const DBT *key, u_int flags) +{ + BTREE *t; + recno_t nrec; + int status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + switch(flags) { + case 0: + if ((nrec = *(recno_t *)key->data) == 0) + goto einval; + if (nrec > t->bt_nrecs) + return (RET_SPECIAL); + --nrec; + status = rec_rdelete(t, nrec); + break; + case R_CURSOR: + if (!F_ISSET(&t->bt_cursor, CURS_INIT)) + goto einval; + if (t->bt_nrecs == 0) + return (RET_SPECIAL); + status = rec_rdelete(t, t->bt_cursor.rcursor - 1); + if (status == RET_SUCCESS) + --t->bt_cursor.rcursor; + break; + default: +einval: errno = EINVAL; + return (RET_ERROR); + } + + if (status == RET_SUCCESS) + F_SET(t, B_MODIFIED | R_MODIFIED); + return (status); +} + +/* + * REC_RDELETE -- Delete the data matching the specified key. + * + * Parameters: + * tree: tree + * nrec: record to delete + * + * Returns: + * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. + */ +static int +rec_rdelete(BTREE *t, recno_t nrec) +{ + EPG *e; + PAGE *h; + int status; + + /* Find the record; __rec_search pins the page. */ + if ((e = __rec_search(t, nrec, SDELETE)) == NULL) + return (RET_ERROR); + + /* Delete the record. */ + h = e->page; + status = __rec_dleaf(t, h, e->index); + if (status != RET_SUCCESS) { + mpool_put(t->bt_mp, h, 0); + return (status); + } + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + return (RET_SUCCESS); +} + +/* + * __REC_DLEAF -- Delete a single record from a recno leaf page. + * + * Parameters: + * t: tree + * idx: index on current page to delete + * + * Returns: + * RET_SUCCESS, RET_ERROR. + */ +int +__rec_dleaf(BTREE *t, PAGE *h, u_int32_t idx) +{ + RLEAF *rl; + indx_t *ip, cnt, offset; + u_int32_t nbytes; + char *from; + void *to; + + /* + * Delete a record from a recno leaf page. Internal records are never + * deleted from internal pages, regardless of the records that caused + * them to be added being deleted. Pages made empty by deletion are + * not reclaimed. They are, however, made available for reuse. + * + * Pack the remaining entries at the end of the page, shift the indices + * down, overwriting the deleted record and its index. If the record + * uses overflow pages, make them available for reuse. + */ + to = rl = GETRLEAF(h, idx); + if (rl->flags & P_BIGDATA && __ovfl_delete(t, rl->bytes) == RET_ERROR) + return (RET_ERROR); + nbytes = NRLEAF(rl); + + /* + * Compress the key/data pairs. Compress and adjust the [BR]LEAF + * offsets. Reset the headers. + */ + from = (char *)h + h->upper; + memmove(from + nbytes, from, (char *)to - from); + h->upper += nbytes; + + offset = h->linp[idx]; + for (cnt = &h->linp[idx] - (ip = &h->linp[0]); cnt--; ++ip) + if (ip[0] < offset) + ip[0] += nbytes; + for (cnt = &h->linp[NEXTINDEX(h)] - ip; --cnt; ++ip) + ip[0] = ip[1] < offset ? ip[1] + nbytes : ip[1]; + h->lower -= sizeof(indx_t); + --t->bt_nrecs; + return (RET_SUCCESS); +} diff --git a/db/recno/FreeBSD/rec_extern.h b/db/recno/FreeBSD/rec_extern.h new file mode 100644 index 0000000..514170c --- /dev/null +++ b/db/recno/FreeBSD/rec_extern.h @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)extern.h 8.3 (Berkeley) 6/4/94 + * $FreeBSD: src/lib/libc/db/recno/extern.h,v 1.3 2007/01/09 00:27:51 imp Exp $ + */ + +#include "../../btree/FreeBSD/bt_extern.h" + +int __rec_close(DB *); +int __rec_delete(const DB *, const DBT *, u_int); +int __rec_dleaf(BTREE *, PAGE *, u_int32_t); +int __rec_fd(const DB *); +int __rec_fmap(BTREE *, recno_t); +int __rec_fout(BTREE *); +int __rec_fpipe(BTREE *, recno_t); +int __rec_get(const DB *, const DBT *, DBT *, u_int); +int __rec_iput(BTREE *, recno_t, const DBT *, u_int); +int __rec_put(const DB *dbp, DBT *, const DBT *, u_int); +int __rec_ret(BTREE *, EPG *, recno_t, DBT *, DBT *); +EPG *__rec_search(BTREE *, recno_t, enum SRCHOP); +int __rec_seq(const DB *, DBT *, DBT *, u_int); +int __rec_sync(const DB *, u_int); +int __rec_vmap(BTREE *, recno_t); +int __rec_vout(BTREE *); +int __rec_vpipe(BTREE *, recno_t); diff --git a/db/recno/FreeBSD/rec_get.c b/db/recno/FreeBSD/rec_get.c new file mode 100644 index 0000000..84b9ef0 --- /dev/null +++ b/db/recno/FreeBSD/rec_get.c @@ -0,0 +1,291 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rec_get.c 8.9 (Berkeley) 8/18/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/recno/rec_get.c,v 1.8 2009/03/05 00:57:01 delphij Exp $"); + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include "recno.h" + +/* + * __REC_GET -- Get a record from the btree. + * + * Parameters: + * dbp: pointer to access method + * key: key to find + * data: data to return + * flag: currently unused + * + * Returns: + * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. + */ +int +__rec_get(const DB *dbp, const DBT *key, DBT *data, u_int flags) +{ + BTREE *t; + EPG *e; + recno_t nrec; + int status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* Get currently doesn't take any flags, and keys of 0 are illegal. */ + if (flags || (nrec = *(recno_t *)key->data) == 0) { + errno = EINVAL; + return (RET_ERROR); + } + + /* + * If we haven't seen this record yet, try to find it in the + * original file. + */ + if (nrec > t->bt_nrecs) { + if (F_ISSET(t, R_EOF | R_INMEM)) + return (RET_SPECIAL); + if ((status = t->bt_irec(t, nrec)) != RET_SUCCESS) + return (status); + } + + --nrec; + if ((e = __rec_search(t, nrec, SEARCH)) == NULL) + return (RET_ERROR); + + status = __rec_ret(t, e, 0, NULL, data); + if (F_ISSET(t, B_DB_LOCK)) + mpool_put(t->bt_mp, e->page, 0); + else + t->bt_pinned = e->page; + return (status); +} + +/* + * __REC_FPIPE -- Get fixed length records from a pipe. + * + * Parameters: + * t: tree + * cnt: records to read + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__rec_fpipe(BTREE *t, recno_t top) +{ + DBT data; + recno_t nrec; + size_t len; + int ch; + u_char *p; + + if (t->bt_rdata.size < t->bt_reclen) { + t->bt_rdata.data = reallocf(t->bt_rdata.data, t->bt_reclen); + if (t->bt_rdata.data == NULL) + return (RET_ERROR); + t->bt_rdata.size = t->bt_reclen; + } + data.data = t->bt_rdata.data; + data.size = t->bt_reclen; + + for (nrec = t->bt_nrecs; nrec < top;) { + len = t->bt_reclen; + for (p = t->bt_rdata.data;; *p++ = ch) + if ((ch = getc(t->bt_rfp)) == EOF || !--len) { + if (ch != EOF) + *p = ch; + if (len != 0) + memset(p, t->bt_bval, len); + if (__rec_iput(t, + nrec, &data, 0) != RET_SUCCESS) + return (RET_ERROR); + ++nrec; + break; + } + if (ch == EOF) + break; + } + if (nrec < top) { + F_SET(t, R_EOF); + return (RET_SPECIAL); + } + return (RET_SUCCESS); +} + +/* + * __REC_VPIPE -- Get variable length records from a pipe. + * + * Parameters: + * t: tree + * cnt: records to read + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__rec_vpipe(BTREE *t, recno_t top) +{ + DBT data; + recno_t nrec; + size_t len; + size_t sz; + int bval, ch; + u_char *p; + + bval = t->bt_bval; + for (nrec = t->bt_nrecs; nrec < top; ++nrec) { + for (p = t->bt_rdata.data, + sz = t->bt_rdata.size;; *p++ = ch, --sz) { + if ((ch = getc(t->bt_rfp)) == EOF || ch == bval) { + data.data = t->bt_rdata.data; + data.size = p - (u_char *)t->bt_rdata.data; + if (ch == EOF && data.size == 0) + break; + if (__rec_iput(t, nrec, &data, 0) + != RET_SUCCESS) + return (RET_ERROR); + break; + } + if (sz == 0) { + len = p - (u_char *)t->bt_rdata.data; + t->bt_rdata.size += (sz = 256); + t->bt_rdata.data = reallocf(t->bt_rdata.data, t->bt_rdata.size); + if (t->bt_rdata.data == NULL) + return (RET_ERROR); + p = (u_char *)t->bt_rdata.data + len; + } + } + if (ch == EOF) + break; + } + if (nrec < top) { + F_SET(t, R_EOF); + return (RET_SPECIAL); + } + return (RET_SUCCESS); +} + +/* + * __REC_FMAP -- Get fixed length records from a file. + * + * Parameters: + * t: tree + * cnt: records to read + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__rec_fmap(BTREE *t, recno_t top) +{ + DBT data; + recno_t nrec; + u_char *sp, *ep, *p; + size_t len; + + if (t->bt_rdata.size < t->bt_reclen) { + t->bt_rdata.data = reallocf(t->bt_rdata.data, t->bt_reclen); + if (t->bt_rdata.data == NULL) + return (RET_ERROR); + t->bt_rdata.size = t->bt_reclen; + } + data.data = t->bt_rdata.data; + data.size = t->bt_reclen; + + sp = (u_char *)t->bt_cmap; + ep = (u_char *)t->bt_emap; + for (nrec = t->bt_nrecs; nrec < top; ++nrec) { + if (sp >= ep) { + F_SET(t, R_EOF); + return (RET_SPECIAL); + } + len = t->bt_reclen; + for (p = t->bt_rdata.data; + sp < ep && len > 0; *p++ = *sp++, --len); + if (len != 0) + memset(p, t->bt_bval, len); + if (__rec_iput(t, nrec, &data, 0) != RET_SUCCESS) + return (RET_ERROR); + } + t->bt_cmap = (caddr_t)sp; + return (RET_SUCCESS); +} + +/* + * __REC_VMAP -- Get variable length records from a file. + * + * Parameters: + * t: tree + * cnt: records to read + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__rec_vmap(BTREE *t, recno_t top) +{ + DBT data; + u_char *sp, *ep; + recno_t nrec; + int bval; + + sp = (u_char *)t->bt_cmap; + ep = (u_char *)t->bt_emap; + bval = t->bt_bval; + + for (nrec = t->bt_nrecs; nrec < top; ++nrec) { + if (sp >= ep) { + F_SET(t, R_EOF); + return (RET_SPECIAL); + } + for (data.data = sp; sp < ep && *sp != bval; ++sp); + data.size = sp - (u_char *)data.data; + if (__rec_iput(t, nrec, &data, 0) != RET_SUCCESS) + return (RET_ERROR); + ++sp; + } + t->bt_cmap = (caddr_t)sp; + return (RET_SUCCESS); +} diff --git a/db/recno/FreeBSD/rec_open.c b/db/recno/FreeBSD/rec_open.c new file mode 100644 index 0000000..c6e5571 --- /dev/null +++ b/db/recno/FreeBSD/rec_open.c @@ -0,0 +1,238 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Olson. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rec_open.c 8.10 (Berkeley) 9/1/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/recno/rec_open.c,v 1.9 2009/03/04 00:58:04 delphij Exp $"); + +#include "namespace.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include +#include "recno.h" + +DB * +__rec_open(const char *fname, int flags, int mode, const RECNOINFO *openinfo, + int dflags) +{ + BTREE *t; + BTREEINFO btopeninfo; + DB *dbp; + PAGE *h; + struct stat sb; + int rfd, sverrno; + + /* Open the user's file -- if this fails, we're done. */ + if (fname != NULL && (rfd = _open(fname, flags, mode)) < 0) + return (NULL); + + /* Create a btree in memory (backed by disk). */ + dbp = NULL; + if (openinfo) { + if (openinfo->flags & ~(R_FIXEDLEN | R_NOKEY | R_SNAPSHOT)) + goto einval; + btopeninfo.flags = 0; + btopeninfo.cachesize = openinfo->cachesize; + btopeninfo.maxkeypage = 0; + btopeninfo.minkeypage = 0; + btopeninfo.psize = openinfo->psize; + btopeninfo.compare = NULL; + btopeninfo.prefix = NULL; + btopeninfo.lorder = openinfo->lorder; + dbp = __bt_open(openinfo->bfname, + O_RDWR, S_IRUSR | S_IWUSR, &btopeninfo, dflags); + } else + dbp = __bt_open(NULL, O_RDWR, S_IRUSR | S_IWUSR, NULL, dflags); + if (dbp == NULL) + goto err; + + /* + * Some fields in the tree structure are recno specific. Fill them + * in and make the btree structure look like a recno structure. We + * don't change the bt_ovflsize value, it's close enough and slightly + * bigger. + */ + t = dbp->internal; + if (openinfo) { + if (openinfo->flags & R_FIXEDLEN) { + F_SET(t, R_FIXLEN); + t->bt_reclen = openinfo->reclen; + if (t->bt_reclen == 0) + goto einval; + } + t->bt_bval = openinfo->bval; + } else + t->bt_bval = '\n'; + + F_SET(t, R_RECNO); + if (fname == NULL) + F_SET(t, R_EOF | R_INMEM); + else + t->bt_rfd = rfd; + + if (fname != NULL) { + /* + * In 4.4BSD, stat(2) returns true for ISSOCK on pipes. + * Unfortunately, that's not portable, so we use lseek + * and check the errno values. + */ + errno = 0; + if (lseek(rfd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) { + switch (flags & O_ACCMODE) { + case O_RDONLY: + F_SET(t, R_RDONLY); + break; + default: + goto einval; + } +slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL) + goto err; + F_SET(t, R_CLOSEFP); + t->bt_irec = + F_ISSET(t, R_FIXLEN) ? __rec_fpipe : __rec_vpipe; + } else { + switch (flags & O_ACCMODE) { + case O_RDONLY: + F_SET(t, R_RDONLY); + break; + case O_RDWR: + break; + default: + goto einval; + } + + if (_fstat(rfd, &sb)) + goto err; + /* + * Kluge -- we'd like to test to see if the file is too + * big to mmap. Since, we don't know what size or type + * off_t's or size_t's are, what the largest unsigned + * integral type is, or what random insanity the local + * C compiler will perpetrate, doing the comparison in + * a portable way is flatly impossible. Hope that mmap + * fails if the file is too large. + */ + if (sb.st_size == 0) + F_SET(t, R_EOF); + else { +#ifdef MMAP_NOT_AVAILABLE + /* + * XXX + * Mmap doesn't work correctly on many current + * systems. In particular, it can fail subtly, + * with cache coherency problems. Don't use it + * for now. + */ + t->bt_msize = sb.st_size; + if ((t->bt_smap = mmap(NULL, t->bt_msize, + PROT_READ, MAP_PRIVATE, rfd, + (off_t)0)) == MAP_FAILED) + goto slow; + t->bt_cmap = t->bt_smap; + t->bt_emap = t->bt_smap + sb.st_size; + t->bt_irec = F_ISSET(t, R_FIXLEN) ? + __rec_fmap : __rec_vmap; + F_SET(t, R_MEMMAPPED); +#else + goto slow; +#endif + } + } + } + + /* Use the recno routines. */ + dbp->close = __rec_close; + dbp->del = __rec_delete; + dbp->fd = __rec_fd; + dbp->get = __rec_get; + dbp->put = __rec_put; + dbp->seq = __rec_seq; + dbp->sync = __rec_sync; + + /* If the root page was created, reset the flags. */ + if ((h = mpool_get(t->bt_mp, P_ROOT, 0)) == NULL) + goto err; + if ((h->flags & P_TYPE) == P_BLEAF) { + F_CLR(h, P_TYPE); + F_SET(h, P_RLEAF); + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + } else + mpool_put(t->bt_mp, h, 0); + + if (openinfo && openinfo->flags & R_SNAPSHOT && + !F_ISSET(t, R_EOF | R_INMEM) && + t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR) + goto err; + return (dbp); + +einval: errno = EINVAL; +err: sverrno = errno; + if (dbp != NULL) + (void)__bt_close(dbp); + if (fname != NULL) + (void)_close(rfd); + errno = sverrno; + return (NULL); +} + +int +__rec_fd(const DB *dbp) +{ + BTREE *t; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* In-memory database can't have a file descriptor. */ + if (F_ISSET(t, R_INMEM)) { + errno = ENOENT; + return (-1); + } + return (t->bt_rfd); +} diff --git a/db/recno/FreeBSD/rec_put.c b/db/recno/FreeBSD/rec_put.c new file mode 100644 index 0000000..1730066 --- /dev/null +++ b/db/recno/FreeBSD/rec_put.c @@ -0,0 +1,275 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rec_put.c 8.7 (Berkeley) 8/18/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/recno/rec_put.c,v 1.11 2009/03/28 05:45:29 delphij Exp $"); + +#include + +#include +#include +#include +#include + +#include +#include "recno.h" + +/* + * __REC_PUT -- Add a recno item to the tree. + * + * Parameters: + * dbp: pointer to access method + * key: key + * data: data + * flag: R_CURSOR, R_IAFTER, R_IBEFORE, R_NOOVERWRITE + * + * Returns: + * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key is + * already in the tree and R_NOOVERWRITE specified. + */ +int +__rec_put(const DB *dbp, DBT *key, const DBT *data, u_int flags) +{ + BTREE *t; + DBT fdata, tdata; + recno_t nrec; + int status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + /* + * If using fixed-length records, and the record is long, return + * EINVAL. If it's short, pad it out. Use the record data return + * memory, it's only short-term. + */ + if (F_ISSET(t, R_FIXLEN) && data->size != t->bt_reclen) { + if (data->size > t->bt_reclen) + goto einval; + + if (t->bt_rdata.size < t->bt_reclen) { + t->bt_rdata.data = + reallocf(t->bt_rdata.data, t->bt_reclen); + if (t->bt_rdata.data == NULL) + return (RET_ERROR); + t->bt_rdata.size = t->bt_reclen; + } + memmove(t->bt_rdata.data, data->data, data->size); + memset((char *)t->bt_rdata.data + data->size, + t->bt_bval, t->bt_reclen - data->size); + fdata.data = t->bt_rdata.data; + fdata.size = t->bt_reclen; + } else { + fdata.data = data->data; + fdata.size = data->size; + } + + switch (flags) { + case R_CURSOR: + if (!F_ISSET(&t->bt_cursor, CURS_INIT)) + goto einval; + nrec = t->bt_cursor.rcursor; + break; + case R_SETCURSOR: + if ((nrec = *(recno_t *)key->data) == 0) + goto einval; + break; + case R_IAFTER: + if ((nrec = *(recno_t *)key->data) == 0) { + nrec = 1; + flags = R_IBEFORE; + } + break; + case 0: + case R_IBEFORE: + if ((nrec = *(recno_t *)key->data) == 0) + goto einval; + break; + case R_NOOVERWRITE: + if ((nrec = *(recno_t *)key->data) == 0) + goto einval; + if (nrec <= t->bt_nrecs) + return (RET_SPECIAL); + break; + default: +einval: errno = EINVAL; + return (RET_ERROR); + } + + /* + * Make sure that records up to and including the put record are + * already in the database. If skipping records, create empty ones. + */ + if (nrec > t->bt_nrecs) { + if (!F_ISSET(t, R_EOF | R_INMEM) && + t->bt_irec(t, nrec) == RET_ERROR) + return (RET_ERROR); + if (nrec > t->bt_nrecs + 1) { + if (F_ISSET(t, R_FIXLEN)) { + if ((tdata.data = + (void *)malloc(t->bt_reclen)) == NULL) + return (RET_ERROR); + tdata.size = t->bt_reclen; + memset(tdata.data, t->bt_bval, tdata.size); + } else { + tdata.data = NULL; + tdata.size = 0; + } + while (nrec > t->bt_nrecs + 1) + if (__rec_iput(t, + t->bt_nrecs, &tdata, 0) != RET_SUCCESS) + return (RET_ERROR); + if (F_ISSET(t, R_FIXLEN)) + free(tdata.data); + } + } + + if ((status = __rec_iput(t, nrec - 1, &fdata, flags)) != RET_SUCCESS) + return (status); + + switch (flags) { + case R_IAFTER: + nrec++; + break; + case R_SETCURSOR: + t->bt_cursor.rcursor = nrec; + break; + } + + F_SET(t, R_MODIFIED); + return (__rec_ret(t, NULL, nrec, key, NULL)); +} + +/* + * __REC_IPUT -- Add a recno item to the tree. + * + * Parameters: + * t: tree + * nrec: record number + * data: data + * + * Returns: + * RET_ERROR, RET_SUCCESS + */ +int +__rec_iput(BTREE *t, recno_t nrec, const DBT *data, u_int flags) +{ + DBT tdata; + EPG *e; + PAGE *h; + indx_t idx, nxtindex; + pgno_t pg; + u_int32_t nbytes; + int dflags, status; + char *dest, db[NOVFLSIZE]; + + /* + * If the data won't fit on a page, store it on indirect pages. + * + * XXX + * If the insert fails later on, these pages aren't recovered. + */ + if (data->size > t->bt_ovflsize) { + if (__ovfl_put(t, data, &pg) == RET_ERROR) + return (RET_ERROR); + tdata.data = db; + tdata.size = NOVFLSIZE; + *(pgno_t *)db = pg; + *(u_int32_t *)(db + sizeof(pgno_t)) = data->size; + dflags = P_BIGDATA; + data = &tdata; + } else + dflags = 0; + + /* __rec_search pins the returned page. */ + if ((e = __rec_search(t, nrec, + nrec > t->bt_nrecs || flags == R_IAFTER || flags == R_IBEFORE ? + SINSERT : SEARCH)) == NULL) + return (RET_ERROR); + + h = e->page; + idx = e->index; + + /* + * Add the specified key/data pair to the tree. The R_IAFTER and + * R_IBEFORE flags insert the key after/before the specified key. + * + * Pages are split as required. + */ + switch (flags) { + case R_IAFTER: + ++idx; + break; + case R_IBEFORE: + break; + default: + if (nrec < t->bt_nrecs && + __rec_dleaf(t, h, idx) == RET_ERROR) { + mpool_put(t->bt_mp, h, 0); + return (RET_ERROR); + } + break; + } + + /* + * If not enough room, split the page. The split code will insert + * the key and data and unpin the current page. If inserting into + * the offset array, shift the pointers up. + */ + nbytes = NRLEAFDBT(data->size); + if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) { + status = __bt_split(t, h, NULL, data, dflags, nbytes, idx); + if (status == RET_SUCCESS) + ++t->bt_nrecs; + return (status); + } + + if (idx < (nxtindex = NEXTINDEX(h))) + memmove(h->linp + idx + 1, h->linp + idx, + (nxtindex - idx) * sizeof(indx_t)); + h->lower += sizeof(indx_t); + + h->linp[idx] = h->upper -= nbytes; + dest = (char *)h + h->upper; + WR_RLEAF(dest, data, dflags); + + ++t->bt_nrecs; + F_SET(t, B_MODIFIED); + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + + return (RET_SUCCESS); +} diff --git a/db/recno/FreeBSD/rec_search.c b/db/recno/FreeBSD/rec_search.c new file mode 100644 index 0000000..545209f --- /dev/null +++ b/db/recno/FreeBSD/rec_search.c @@ -0,0 +1,121 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rec_search.c 8.4 (Berkeley) 7/14/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/recno/rec_search.c,v 1.8 2009/03/04 00:58:04 delphij Exp $"); + +#include + +#include +#include + +#include +#include "recno.h" + +/* + * __REC_SEARCH -- Search a btree for a key. + * + * Parameters: + * t: tree to search + * recno: key to find + * op: search operation + * + * Returns: + * EPG for matching record, if any, or the EPG for the location of the + * key, if it were inserted into the tree. + * + * Returns: + * The EPG for matching record, if any, or the EPG for the location + * of the key, if it were inserted into the tree, is entered into + * the bt_cur field of the tree. A pointer to the field is returned. + */ +EPG * +__rec_search(BTREE *t, recno_t recno, enum SRCHOP op) +{ + indx_t idx; + PAGE *h; + EPGNO *parent; + RINTERNAL *r; + pgno_t pg; + indx_t top; + recno_t total; + int sverrno; + + BT_CLR(t); + for (pg = P_ROOT, total = 0;;) { + if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) + goto err; + if (h->flags & P_RLEAF) { + t->bt_cur.page = h; + t->bt_cur.index = recno - total; + return (&t->bt_cur); + } + for (idx = 0, top = NEXTINDEX(h);;) { + r = GETRINTERNAL(h, idx); + if (++idx == top || total + r->nrecs > recno) + break; + total += r->nrecs; + } + + BT_PUSH(t, pg, idx - 1); + + pg = r->pgno; + switch (op) { + case SDELETE: + --GETRINTERNAL(h, (idx - 1))->nrecs; + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + break; + case SINSERT: + ++GETRINTERNAL(h, (idx - 1))->nrecs; + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + break; + case SEARCH: + mpool_put(t->bt_mp, h, 0); + break; + } + + } + /* Try and recover the tree. */ +err: sverrno = errno; + if (op != SEARCH) + while ((parent = BT_POP(t)) != NULL) { + if ((h = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL) + break; + if (op == SINSERT) + --GETRINTERNAL(h, parent->index)->nrecs; + else + ++GETRINTERNAL(h, parent->index)->nrecs; + mpool_put(t->bt_mp, h, MPOOL_DIRTY); + } + errno = sverrno; + return (NULL); +} diff --git a/db/recno/FreeBSD/rec_seq.c b/db/recno/FreeBSD/rec_seq.c new file mode 100644 index 0000000..fc9c644 --- /dev/null +++ b/db/recno/FreeBSD/rec_seq.c @@ -0,0 +1,127 @@ +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#ifndef lint +/* XXX use __SCCSID */ +static char sccsid[] __unused = "@(#)rec_seq.c 8.3 (Berkeley) 7/14/94"; +#endif /* not lint */ +__FBSDID("$FreeBSD: src/lib/libc/db/recno/rec_seq.c,v 1.8 2009/03/04 00:58:04 delphij Exp $"); + +#include + +#include +#include +#include +#include + +#include +#include "recno.h" + +/* + * __REC_SEQ -- Recno sequential scan interface. + * + * Parameters: + * dbp: pointer to access method + * key: key for positioning and return value + * data: data return value + * flags: R_CURSOR, R_FIRST, R_LAST, R_NEXT, R_PREV. + * + * Returns: + * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. + */ +int +__rec_seq(const DB *dbp, DBT *key, DBT *data, u_int flags) +{ + BTREE *t; + EPG *e; + recno_t nrec; + int status; + + t = dbp->internal; + + /* Toss any page pinned across calls. */ + if (t->bt_pinned != NULL) { + mpool_put(t->bt_mp, t->bt_pinned, 0); + t->bt_pinned = NULL; + } + + switch(flags) { + case R_CURSOR: + if ((nrec = *(recno_t *)key->data) == 0) + goto einval; + break; + case R_NEXT: + if (F_ISSET(&t->bt_cursor, CURS_INIT)) { + nrec = t->bt_cursor.rcursor + 1; + break; + } + /* FALLTHROUGH */ + case R_FIRST: + nrec = 1; + break; + case R_PREV: + if (F_ISSET(&t->bt_cursor, CURS_INIT)) { + if ((nrec = t->bt_cursor.rcursor - 1) == 0) + return (RET_SPECIAL); + break; + } + /* FALLTHROUGH */ + case R_LAST: + if (!F_ISSET(t, R_EOF | R_INMEM) && + t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR) + return (RET_ERROR); + nrec = t->bt_nrecs; + break; + default: +einval: errno = EINVAL; + return (RET_ERROR); + } + + if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) { + if (!F_ISSET(t, R_EOF | R_INMEM) && + (status = t->bt_irec(t, nrec)) != RET_SUCCESS) + return (status); + if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) + return (RET_SPECIAL); + } + + if ((e = __rec_search(t, nrec - 1, SEARCH)) == NULL) + return (RET_ERROR); + + F_SET(&t->bt_cursor, CURS_INIT); + t->bt_cursor.rcursor = nrec; + + status = __rec_ret(t, e, nrec, key, data); + if (F_ISSET(t, B_DB_LOCK)) + mpool_put(t->bt_mp, e->page, 0); + else + t->bt_pinned = e->page; + return (status); +} diff --git a/db/recno/FreeBSD/rec_utils.c b/db/recno/FreeBSD/rec_utils.c new file mode 100644 index 0000000..3e69af2 --- /dev/null +++ b/db/recno/FreeBSD/rec_utils.c @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rec_utils.c 8.6 (Berkeley) 7/16/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/db/recno/rec_utils.c,v 1.6 2009/03/05 00:57:01 delphij Exp $"); + +#include + +#include +#include +#include + +#include +#include "recno.h" + +/* + * __rec_ret -- + * Build return data. + * + * Parameters: + * t: tree + * e: key/data pair to be returned + * nrec: record number + * key: user's key structure + * data: user's data structure + * + * Returns: + * RET_SUCCESS, RET_ERROR. + */ +int +__rec_ret(BTREE *t, EPG *e, recno_t nrec, DBT *key, DBT *data) +{ + RLEAF *rl; + void *p; + + if (key == NULL) + goto dataonly; + + /* We have to copy the key, it's not on the page. */ + if (sizeof(recno_t) > t->bt_rkey.size) { + p = realloc(t->bt_rkey.data, sizeof(recno_t)); + if (p == NULL) + return (RET_ERROR); + t->bt_rkey.data = p; + t->bt_rkey.size = sizeof(recno_t); + } + memmove(t->bt_rkey.data, &nrec, sizeof(recno_t)); + key->size = sizeof(recno_t); + key->data = t->bt_rkey.data; + +dataonly: + if (data == NULL) + return (RET_SUCCESS); + + /* + * We must copy big keys/data to make them contigous. Otherwise, + * leave the page pinned and don't copy unless the user specified + * concurrent access. + */ + rl = GETRLEAF(e->page, e->index); + if (rl->flags & P_BIGDATA) { + if (__ovfl_get(t, rl->bytes, + &data->size, &t->bt_rdata.data, &t->bt_rdata.size)) + return (RET_ERROR); + data->data = t->bt_rdata.data; + } else if (F_ISSET(t, B_DB_LOCK)) { + /* Use +1 in case the first record retrieved is 0 length. */ + if (rl->dsize + 1 > t->bt_rdata.size) { + p = realloc(t->bt_rdata.data, rl->dsize + 1); + if (p == NULL) + return (RET_ERROR); + t->bt_rdata.data = p; + t->bt_rdata.size = rl->dsize + 1; + } + memmove(t->bt_rdata.data, rl->bytes, rl->dsize); + data->size = rl->dsize; + data->data = t->bt_rdata.data; + } else { + data->size = rl->dsize; + data->data = rl->bytes; + } + return (RET_SUCCESS); +} diff --git a/db/recno/FreeBSD/recno.h b/db/recno/FreeBSD/recno.h new file mode 100644 index 0000000..438a56c --- /dev/null +++ b/db/recno/FreeBSD/recno.h @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)recno.h 8.1 (Berkeley) 6/4/93 + * $FreeBSD: src/lib/libc/db/recno/recno.h,v 1.3 2007/01/09 00:27:52 imp Exp $ + */ + +enum SRCHOP { SDELETE, SINSERT, SEARCH}; /* Rec_search operation. */ + +#include "../../btree/FreeBSD/btree.h" +#include "rec_extern.h" diff --git a/derived/arm/libc-features.h b/derived/arm/libc-features.h new file mode 100644 index 0000000..9b2dd12 --- /dev/null +++ b/derived/arm/libc-features.h @@ -0,0 +1,26 @@ +#ifndef _LIBC_FEATURES_H_ +#define _LIBC_FEATURES_H_ + +#if !defined(__arm__) +#error Mismatched libc-features.h architecture +#endif + +#define UNIFDEF_LEGACY_RUNE_APIS 1 +#define LEGACY_CRT1_ENVIRON 1 +#define UNIFDEF_LEGACY_UTMP_APIS 1 +#if __DARWIN_ONLY_VERS_1050 +# error Feature mismatch: __DARWIN_ONLY_VERS_1050 == 1 +#endif /* __DARWIN_ONLY_VERS_1050 */ +#if __DARWIN_ONLY_UNIX_CONFORMANCE +# error Feature mismatch: __DARWIN_ONLY_UNIX_CONFORMANCE == 1 +#endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */ +#if __DARWIN_ONLY_64_BIT_INO_T +# error Feature mismatch: __DARWIN_ONLY_64_BIT_INO_T == 1 +#endif /* __DARWIN_ONLY_64_BIT_INO_T */ +#define __APPLE_PR3417676_HACK__ 1 +#define PLOCKSTAT 1 +#define NOTIFY_TZ 1 +/* #undef FEATURE_SMALL_STDIOBUF */ +#define XPRINTF_PERF 1 +/* #undef FEATURE_SIGNAL_RESTRICTION */ +#endif // _LIBC_FEATURES_H_ diff --git a/derived/arm64/libc-features.h b/derived/arm64/libc-features.h new file mode 100644 index 0000000..fd435d3 --- /dev/null +++ b/derived/arm64/libc-features.h @@ -0,0 +1,26 @@ +#ifndef _LIBC_FEATURES_H_ +#define _LIBC_FEATURES_H_ + +#if !defined(__arm64__) +#error Mismatched libc-features.h architecture +#endif + +#define UNIFDEF_LEGACY_RUNE_APIS 1 +#define LEGACY_CRT1_ENVIRON 1 +#define UNIFDEF_LEGACY_UTMP_APIS 1 +#if __DARWIN_ONLY_VERS_1050 +# error Feature mismatch: __DARWIN_ONLY_VERS_1050 == 1 +#endif /* __DARWIN_ONLY_VERS_1050 */ +#if !__DARWIN_ONLY_UNIX_CONFORMANCE +# error Feature mismatch: __DARWIN_ONLY_UNIX_CONFORMANCE == 0 +#endif /* !__DARWIN_ONLY_UNIX_CONFORMANCE */ +#if __DARWIN_ONLY_64_BIT_INO_T +# error Feature mismatch: __DARWIN_ONLY_64_BIT_INO_T == 1 +#endif /* __DARWIN_ONLY_64_BIT_INO_T */ +#define __APPLE_PR3417676_HACK__ 1 +#define PLOCKSTAT 1 +#define NOTIFY_TZ 1 +/* #undef FEATURE_SMALL_STDIOBUF */ +#define XPRINTF_PERF 1 +/* #undef FEATURE_SIGNAL_RESTRICTION */ +#endif // _LIBC_FEATURES_H_ diff --git a/derived/i386/libc-features.h b/derived/i386/libc-features.h new file mode 100644 index 0000000..37d6c34 --- /dev/null +++ b/derived/i386/libc-features.h @@ -0,0 +1,26 @@ +#ifndef _LIBC_FEATURES_H_ +#define _LIBC_FEATURES_H_ + +#if !defined(__i386__) +#error Mismatched libc-features.h architecture +#endif + +#define UNIFDEF_LEGACY_RUNE_APIS 1 +#define LEGACY_CRT1_ENVIRON 1 +#define UNIFDEF_LEGACY_UTMP_APIS 1 +#if __DARWIN_ONLY_VERS_1050 +# error Feature mismatch: __DARWIN_ONLY_VERS_1050 == 1 +#endif /* __DARWIN_ONLY_VERS_1050 */ +#if __DARWIN_ONLY_UNIX_CONFORMANCE +# error Feature mismatch: __DARWIN_ONLY_UNIX_CONFORMANCE == 1 +#endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */ +#if __DARWIN_ONLY_64_BIT_INO_T +# error Feature mismatch: __DARWIN_ONLY_64_BIT_INO_T == 1 +#endif /* __DARWIN_ONLY_64_BIT_INO_T */ +#define __APPLE_PR3417676_HACK__ 1 +#define PLOCKSTAT 1 +#define NOTIFY_TZ 1 +/* #undef FEATURE_SMALL_STDIOBUF */ +#define XPRINTF_PERF 1 +/* #undef FEATURE_SIGNAL_RESTRICTION */ +#endif // _LIBC_FEATURES_H_ diff --git a/derived/libc-features.h b/derived/libc-features.h new file mode 100644 index 0000000..b3e482d --- /dev/null +++ b/derived/libc-features.h @@ -0,0 +1,13 @@ +#if defined(__i386__) + #include "i386/libc-features.h" +#elif defined(__x86_64__) + #include "x86_64/libc-features.h" +#elif defined(__ppc__) + #include "ppc/libc-features.h" +#elif defined(__arm64__) + #include "arm64/libc-features.h" +#elif defined(__arm__) + #include "arm/libc-features.h" +#else + #error "Unsupported architecture!" +#endif diff --git a/derived/ppc/libc-features.h b/derived/ppc/libc-features.h new file mode 100644 index 0000000..4087c8b --- /dev/null +++ b/derived/ppc/libc-features.h @@ -0,0 +1,26 @@ +#ifndef _LIBC_FEATURES_H_ +#define _LIBC_FEATURES_H_ + +#if !defined(__ppc__) +#error Mismatched libc-features.h architecture +#endif + +#define UNIFDEF_LEGACY_RUNE_APIS 1 +#define LEGACY_CRT1_ENVIRON 1 +#define UNIFDEF_LEGACY_UTMP_APIS 1 +#if __DARWIN_ONLY_VERS_1050 +# error Feature mismatch: __DARWIN_ONLY_VERS_1050 == 1 +#endif /* __DARWIN_ONLY_VERS_1050 */ +#if __DARWIN_ONLY_UNIX_CONFORMANCE +# error Feature mismatch: __DARWIN_ONLY_UNIX_CONFORMANCE == 1 +#endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */ +#if __DARWIN_ONLY_64_BIT_INO_T +# error Feature mismatch: __DARWIN_ONLY_64_BIT_INO_T == 1 +#endif /* __DARWIN_ONLY_64_BIT_INO_T */ +#define __APPLE_PR3417676_HACK__ 1 +#define PLOCKSTAT 1 +#define NOTIFY_TZ 1 +/* #undef FEATURE_SMALL_STDIOBUF */ +#define XPRINTF_PERF 1 +/* #undef FEATURE_SIGNAL_RESTRICTION */ +#endif // _LIBC_FEATURES_H_ diff --git a/derived/x86_64/libc-features.h b/derived/x86_64/libc-features.h new file mode 100644 index 0000000..467ddff --- /dev/null +++ b/derived/x86_64/libc-features.h @@ -0,0 +1,30 @@ +#ifndef _LIBC_FEATURES_H_ +#define _LIBC_FEATURES_H_ + +#if !defined(__x86_64__) +#error Mismatched libc-features.h architecture +#endif + +#if defined(__i386__) +#error "i386 on x86_64" +#endif + +#define UNIFDEF_LEGACY_RUNE_APIS 1 +#define LEGACY_CRT1_ENVIRON 1 +#define UNIFDEF_LEGACY_UTMP_APIS 1 +#if __DARWIN_ONLY_VERS_1050 +# error Feature mismatch: __DARWIN_ONLY_VERS_1050 == 1 +#endif /* __DARWIN_ONLY_VERS_1050 */ +#if !__DARWIN_ONLY_UNIX_CONFORMANCE +# error Feature mismatch: __DARWIN_ONLY_UNIX_CONFORMANCE == 0 +#endif /* !__DARWIN_ONLY_UNIX_CONFORMANCE */ +#if __DARWIN_ONLY_64_BIT_INO_T +# error Feature mismatch: __DARWIN_ONLY_64_BIT_INO_T == 1 +#endif /* __DARWIN_ONLY_64_BIT_INO_T */ +#define __APPLE_PR3417676_HACK__ 1 +#define PLOCKSTAT 1 +#define NOTIFY_TZ 1 +/* #undef FEATURE_SMALL_STDIOBUF */ +#define XPRINTF_PERF 1 +/* #undef FEATURE_SIGNAL_RESTRICTION */ +#endif // _LIBC_FEATURES_H_ diff --git a/empty.c b/empty.c new file mode 100644 index 0000000..e69de29 diff --git a/emulated/CMakeLists.txt b/emulated/CMakeLists.txt new file mode 100644 index 0000000..ecbce25 --- /dev/null +++ b/emulated/CMakeLists.txt @@ -0,0 +1,9 @@ +project(libc-emulated) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89") + +set(emulated_sources brk.c bsd_signal.c lchflags.c lchmod.c lutimes.c statvfs.c tcgetsid.c) + +add_darling_object_library(libc-emulated ${emulated_sources}) diff --git a/emulated/brk.2 b/emulated/brk.2 new file mode 100644 index 0000000..9ea4f61 --- /dev/null +++ b/emulated/brk.2 @@ -0,0 +1,150 @@ +.\" $NetBSD: brk.2,v 1.7 1995/02/27 12:31:57 cgd Exp $ +.\" +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)brk.2 8.2 (Berkeley) 12/11/93 +.\" +.Dd December 11, 1993 +.Dt BRK 2 +.Os BSD 4 +.Sh NAME +.Nm brk , +.Nm sbrk +.Nd change data segment size +.Sh SYNOPSIS +.Fd #include +.Ft void * +.Fn brk "const void *addr" +.Ft void * +.Fn sbrk "int incr" +.Sh DESCRIPTION +.Bf -symbolic +The brk and sbrk functions are historical curiosities +left over from earlier days before the advent of virtual memory management. +.Ef +The +.Fn brk +function +sets the break or lowest address +of a process's data segment (uninitialized data) to +.Fa addr +(immediately above bss). +Data addressing is restricted between +.Fa addr +and the lowest stack pointer to the stack segment. +Memory is allocated by +.Fa brk +in page size pieces; +if +.Fa addr +is not evenly divisible by the system page size, it is +increased to the next page boundary. +.Pp +.\" The +.\" .Nm sbrk +.\" function +.\" allocates chunks of +.\" .Fa incr +.\" bytes +.\" to the process's data space +.\" and returns an address pointer. +.\" The +.\" .Xr malloc 3 +.\" function utilizes +.\" .Nm sbrk . +.\" .Pp +The current value of the program break is reliably returned by +.Dq Li sbrk(0) +(see also +.Xr end 3 ) . +The +.Xr getrlimit 2 +system call may be used to determine +the maximum permissible size of the +.Em data +segment; +it will not be possible to set the break +beyond the +.Em rlim_max +value returned from a call to +.Xr getrlimit , +e.g. +.Dq qetext + rlp\(->rlim_max. +(see +.Xr end 3 +for the definition of +.Em etext ) . +.Sh RETURN VALUES +.Nm Brk +returns a pointer to the new end of memory if successful; +otherwise -1 with +.Va errno +set to indicate why the allocation failed. +The +.Nm sbrk +function returns a pointer to the base of the new storage if successful; +otherwise -1 with +.Va errno +set to indicate why the allocation failed. +.Sh ERRORS +.Xr Sbrk +will fail and no additional memory will be allocated if +one of the following are true: +.Bl -tag -width Er +.It Bq Er ENOMEM +The limit, as set by +.Xr setrlimit 2 , +was exceeded. +.It Bq Er ENOMEM +The maximum possible size of a data segment (compiled into the +system) was exceeded. +.It Bq Er ENOMEM +Insufficient space existed in the swap area +to support the expansion. +.El +.Sh SEE ALSO +.Xr execve 2 , +.Xr getrlimit 2 , +.Xr malloc 3 , +.Xr mmap 2 , +.Xr end 3 +.Sh BUGS +Setting the break may fail due to a temporary lack of +swap space. It is not possible to distinguish this +from a failure caused by exceeding the maximum size of +the data segment without consulting +.Xr getrlimit . +.Sh HISTORY +A +.Fn brk +function call appeared in +.At v7 . diff --git a/emulated/brk.c b/emulated/brk.c new file mode 100644 index 0000000..3cf6918 --- /dev/null +++ b/emulated/brk.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 1999-2010 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * File: brk.c + * + * Unix compatibility for sbrk system call. + * + * HISTORY + * 09-Mar-90 Gregg Kellogg (gk) at NeXT. + * include instead of + * + * 14-Feb-89 Avadis Tevanian (avie) at NeXT. + * Total rewrite using a fixed area of VM from break region. + */ + +#include /* for vm_allocate, vm_offset_t */ +#include +#include +#include + +static int sbrk_needs_init = TRUE; +static vm_size_t sbrk_region_size = 4*1024*1024; /* Well, what should it be? */ +static vm_address_t sbrk_curbrk; + +void *sbrk(int size) +{ + kern_return_t ret; + + if (sbrk_needs_init) { + sbrk_needs_init = FALSE; + /* + * Allocate a big region to simulate break region. + */ + ret = vm_allocate(mach_task_self(), &sbrk_curbrk, sbrk_region_size, + VM_MAKE_TAG(VM_MEMORY_SBRK)|TRUE); + if (ret != KERN_SUCCESS) { + errno = ENOMEM; + return((void *)-1); + } + } + + if (size <= 0) + return((void *)sbrk_curbrk); + else if (size > sbrk_region_size) { + errno = ENOMEM; + return((void *)-1); + } + sbrk_curbrk += size; + sbrk_region_size -= size; + return((void *)(sbrk_curbrk - size)); +} + +void *brk(const void *x) +{ + errno = ENOMEM; + return((void *)-1); +} diff --git a/emulated/bsd_signal.3 b/emulated/bsd_signal.3 new file mode 100644 index 0000000..591a062 --- /dev/null +++ b/emulated/bsd_signal.3 @@ -0,0 +1,119 @@ +.\" Copyright (c) 2002 Apple Computer, Inc. All rights reserved. +.\" +.\" @APPLE_LICENSE_HEADER_START@ +.\" +.\" The contents of this file constitute Original Code as defined in and +.\" are subject to the Apple Public Source License Version 1.1 (the +.\" "License"). You may not use this file except in compliance with the +.\" License. Please obtain a copy of the License at +.\" http://www.apple.com/publicsource and read it before using this file. +.\" +.\" This Original Code and all software distributed under the License are +.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +.\" License for the specific language governing rights and limitations +.\" under the License. +.\" +.\" @APPLE_LICENSE_HEADER_END@ +.\" +.Dd December 20, 2003 +.Dt BSD_SIGNAL 3 +.Os +.Sh NAME +.Nm bsd_signal +.Nd simplified signal facilities +.Sh SYNOPSIS +.In signal.h +.\" The following is Quite Ugly, but syntactically correct. Don't try to +.\" fix it. +.Ft void \*(lp* +.Fn bsd_signal "int sig" "void \*(lp*func\*(rp\*(lpint\*(rp\*(rp\*(rp\*(lpint" +.Pp +or in an equivalent but easier to read typedef'd version: +.Ft typedef "void \*(lp*sig_t\*(rp \*(lpint\*(rp" ; +.Ft sig_t +.Fn bsd_signal "int sig" "sig_t func" +.Sh DESCRIPTION +The +.Fn bsd_signal +function provides a partially compatible interface for programs written +to historical system interfaces (see USAGE below). +.Pp +The function call +.Fn bsd_signal sig func +has the effect as if implemented as: +.Bd -literal -offset indent +void (*bsd_signal(int sig, void (*func)(int)))(int) +{ + struct sigaction act, oact; + + act.sa_handler = func; + act.sa_flags = SA_RESTART; + sigemptyset(&act.sa_mask); + sigaddset(&act.sa_mask, sig); + if (sigaction(sig, &act, &oact) == -1) + return(SIG_ERR); + return(oact.sa_handler); +} +.Ed +.Pp +The handler function should be declared: +.Pp +.D1 Fn "void func" "int sig" +.Pp +where +.Fa sig +is the signal number. +The behavior is undefined if +.Fn func +is a function that takes more than one argument, or an argument of a +different type. +.Sh RETURN VALUES +Upon successful completion, +.Fn bsd_signal +returns the previous action for +.Fa sig . +Otherwise, +.Er SIG_ERR +is returned and +.Va errno +is set to indicate the error. +.Sh ERRORS +Refer to +.Xr sigaction 2 . +.Sh USAGE +This function is a direct replacement for the +.Bx +.Xr signal(3) +function for simple applications that are installing a single-argument signal +handler function. +If a +.Bx +signal handler function is being installed that expects more than one +argument, the application has to be modified to use +.Xr sigaction 2 . +The +.Fn bsd_signal +function differs from +.Xr signal 3 +in that the +.Dv SA_RESTART +flag is set and the +.Dv SA_RESETHAND +will be clear when +.Fn bsd_signal +is used. +The state of these flags is not specified for +.Xr signal 3 . +.Sh SEE ALSO +.Xr sigaction 2 , +.Xr sigaddset 3 , +.Xr sigemptyset 3 , +.Xr signal 3 +.Sh STANDARDS +The +.Fn bsd_signal +function conforms to +.St -p1003.1-2001 . diff --git a/emulated/bsd_signal.c b/emulated/bsd_signal.c new file mode 100644 index 0000000..6e2847b --- /dev/null +++ b/emulated/bsd_signal.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * bsd_signal() function, per POIX 1003.1-2003 + */ +#include + +void +(*bsd_signal(int sig, void (*func)(int)))(int) +{ + struct sigaction act, oact; + + + act.sa_handler = func; + act.sa_flags = SA_RESTART; + + sigemptyset(&act.sa_mask); + sigaddset(&act.sa_mask, sig); + if (sigaction(sig, &act, &oact) == -1) + return(SIG_ERR); + + return(oact.sa_handler); +} diff --git a/emulated/lchflags.3 b/emulated/lchflags.3 new file mode 100644 index 0000000..585a1a9 --- /dev/null +++ b/emulated/lchflags.3 @@ -0,0 +1,52 @@ +.Dd Oct 31, 2005 +.Dt LCHFLAGS 3 +.Os +.Sh NAME +.Nm lchflags +.Nd set file flags +.Sh SYNOPSIS +.In sys/stat.h +.In unistd.h +.Ft int +.Fn lchflags "const char *path" "u_int flags" +.Sh DESCRIPTION +The file whose name is given by +.Fa path +has its flags changed to +.Fa flags . +See +.Xr chflags 2 +for the values of the +.Fa flags . +.Pp +The +.Fn lchflags +call is like +.Fn chflags +except when the named file is a symbolic link, +in which case +.Fn lchflags +will change the flags of the link itself, +rather than the file it points to. +.Sh NOTE +Instead of being a system call, +.Fn lchflags +is emulated using +.Xr setattrlist 2 . +Not all file systems support +.Xr setattrlist 2 . +.Sh RETURN VALUES +Upon successful completion, a value of 0 is returned. +Otherwise, -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn lchflags +call may return the same errors as +.Xr chflags 2 +and +.Xr setattrlist 2 . +.Sh SEE ALSO +.Xr chflags 2 , +.Xr setattrlist 2 diff --git a/emulated/lchflags.c b/emulated/lchflags.c new file mode 100644 index 0000000..05c7be8 --- /dev/null +++ b/emulated/lchflags.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include + +int +lchflags(const char *path, unsigned int flags) +{ + struct stat s; + struct attrlist a; + + if(lstat(path, &s) < 0) + return -1; + if((s.st_mode & S_IFMT) != S_IFLNK) + return chflags(path, flags); + bzero(&a, sizeof(a)); + a.bitmapcount = ATTR_BIT_MAP_COUNT; + a.commonattr = ATTR_CMN_FLAGS; + return setattrlist(path, &a, &flags, sizeof(unsigned int), FSOPT_NOFOLLOW); +} diff --git a/emulated/lchmod.3 b/emulated/lchmod.3 new file mode 100644 index 0000000..4c2c86b --- /dev/null +++ b/emulated/lchmod.3 @@ -0,0 +1,54 @@ +.Dd Oct 31, 2005 +.Dt LCHMOD 3 +.Os +.Sh NAME +.Nm lchmod +.Nd change mode of file +.Sh SYNOPSIS +.In sys/stat.h +.In unistd.h +.Ft int +.Fn lchmod "const char *path" "mode_t flags" +.Sh DESCRIPTION +The function +.Fn lchmod +sets the file permission bits of the file specified by the pathname +.Fa path +to +.Fa mode . +See +.Xr chmod 2 +for the values of the +.Fa flags . +.Pp +The +.Fn lchmod +call is like +.Fn chmod +except when the named file is a symbolic link, +in which case +.Fn lchmod +will change the flags of the link itself, +rather than the file it points to. +.Sh NOTE +Instead of being a system call, +.Fn lchmod +is emulated using +.Xr setattrlist 2 . +Not all file systems support +.Xr setattrlist 2 . +.Sh RETURN VALUES +Upon successful completion, a value of 0 is returned. +Otherwise, -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn lchmod +call may return the same errors as +.Xr chmod 2 +and +.Xr setattrlist 2 . +.Sh SEE ALSO +.Xr chmod 2 , +.Xr setattrlist 2 diff --git a/emulated/lchmod.c b/emulated/lchmod.c new file mode 100644 index 0000000..836f65e --- /dev/null +++ b/emulated/lchmod.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2005, 2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +// NOTE: This system call emulation should move to libsystem_kernel.dylib + +#include +#include +#include +#include +#include + +int +lchmod(const char *path, mode_t mode) +{ + struct attrlist a; + int m; + + bzero(&a, sizeof(a)); + a.bitmapcount = ATTR_BIT_MAP_COUNT; + a.commonattr = ATTR_CMN_ACCESSMASK; + m = mode; + return setattrlist(path, &a, &m, sizeof(int), FSOPT_NOFOLLOW); +} diff --git a/emulated/lutimes.3 b/emulated/lutimes.3 new file mode 100644 index 0000000..06cd3fb --- /dev/null +++ b/emulated/lutimes.3 @@ -0,0 +1,62 @@ +.Dd Aug 13, 2006 +.Dt LUTIMES 3 +.Os +.Sh NAME +.Nm lutimes +.Nd set file access and modification times of symlink +.Sh SYNOPSIS +.In sys/time.h +.Ft int +.Fn lutimes "const char *path" "struct timeval times[2]" +.Sh DESCRIPTION +The access and modification times of the file named by +.Fa path +are changed as specified by the argument +.Fa times , +even if +.Fa path +specifies a symbolic link (for +.Xr utimes 2 +the times of the file referenced by the symbolic link are changed). +.Pp +If +.Fa times +is +.Dv NULL , +the access and modification times are set to the current time. +The caller must be the owner of the file, have permission to +write the file, or be the super-user. +.Pp +If +.Fa times +is +.Pf non- Dv NULL , +it is assumed to point to an array of two timeval structures. +The access time is set to the value of the first element, and the +modification time is set to the value of the second element. +The caller must be the owner of the file or be the super-user. +.Pp +In either case, the inode-change-time of the file is set to the current +time. +.Sh NOTE +Instead of being a system call, +.Fn lutimes +is emulated using +.Xr setattrlist 2 . +Not all file systems support +.Xr setattrlist 2 . +.Sh RETURN VALUES +Upon successful completion, a value of 0 is returned. +Otherwise, -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn lutimes +call may return the same errors as +.Xr utimes 2 +and +.Xr setattrlist 2 . +.Sh SEE ALSO +.Xr utimes 2 , +.Xr setattrlist 2 diff --git a/emulated/lutimes.c b/emulated/lutimes.c new file mode 100644 index 0000000..fd5e8b4 --- /dev/null +++ b/emulated/lutimes.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include + +int +lutimes(const char *path, const struct timeval *times) +{ + struct stat s; + struct attrlist a; + struct { + struct timespec mod; + struct timespec access; + } t; + + if(lstat(path, &s) < 0) + return -1; + if((s.st_mode & S_IFMT) != S_IFLNK) + return utimes(path, times); + bzero(&a, sizeof(a)); + a.bitmapcount = ATTR_BIT_MAP_COUNT; + a.commonattr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME; + if(times) { + TIMEVAL_TO_TIMESPEC(×[0], &t.access); + TIMEVAL_TO_TIMESPEC(×[1], &t.mod); + } else { + struct timeval now; + + if(gettimeofday(&now, NULL) < 0) + return -1; + TIMEVAL_TO_TIMESPEC(&now, &t.access); + TIMEVAL_TO_TIMESPEC(&now, &t.mod); + } + return setattrlist(path, &a, &t, sizeof(t), FSOPT_NOFOLLOW); +} diff --git a/emulated/statvfs.3 b/emulated/statvfs.3 new file mode 100644 index 0000000..bcd9c44 --- /dev/null +++ b/emulated/statvfs.3 @@ -0,0 +1,214 @@ +.\" +.\" Copyright 2002 Massachusetts Institute of Technology +.\" +.\" Permission to use, copy, modify, and distribute this software and +.\" its documentation for any purpose and without fee is hereby +.\" granted, provided that both the above copyright notice and this +.\" permission notice appear in all copies, that both the above +.\" copyright notice and this permission notice appear in all +.\" supporting documentation, and that the name of M.I.T. not be used +.\" in advertising or publicity pertaining to distribution of the +.\" software without specific, written prior permission. M.I.T. makes +.\" no representations about the suitability of this software for any +.\" purpose. It is provided "as is" without express or implied +.\" warranty. +.\" +.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS +.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT +.\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/statvfs.3,v 1.7 2003/06/08 10:01:51 charnier Exp $ +.\" +.Dd July 13, 2002 +.Dt STATVFS 3 +.Os +.Sh NAME +.Nm fstatvfs , +.Nm statvfs +.Nd retrieve file system information +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/statvfs.h +.Ft int +.Fo fstatvfs +.Fa "int fildes" +.Fa "struct statvfs *buf" +.Fc +.Ft int +.Fo statvfs +.Fa "const char *restrict path" +.Fa "struct statvfs *restrict buf" +.Fc +.Sh DESCRIPTION +The +.Fn statvfs +and +.Fn fstatvfs +functions attempt to fill the structure pointed to by +.Fa buf +with file system +statistics, but portable applications must not depend on this. +Applications must pass a pathname or file descriptor which refers to a +file on the file system in which they are interested. +.Pp +The +.Vt statvfs +structure contains the following members: +.Bl -tag -offset indent -width ".Va f_namemax" +.It Va f_namemax +The maximum length in bytes of a file name on this file system. +Applications should use +.Xr pathconf 2 +instead. +.It Va f_fsid +Not meaningful in this implementation. +.It Va f_frsize +The size in bytes of the minimum unit of allocation on this +file system. +(This corresponds to the +.Va f_bsize +member of +.Vt "struct statfs" . ) +.It Va f_bsize +The preferred length of I/O requests for files on this file system. +(Corresponds to the +.Va f_iosize +member of +.Vt "struct statfs" . ) +.It Va f_flag +Flags describing mount options for this file system; see below. +.El +.Pp +In addition, there are three members of type +.Vt fsfilcnt_t , +which represent counts of file serial numbers +.Em ( i.e. , +inodes); these are named +.Va f_files , f_favail , +and +.Va f_ffree , +and represent the number of file serial numbers which exist in total, +are available to unprivileged processes, and are available to +privileged processes, respectively. +Likewise, the members +.Va f_blocks , f_bavail , +and +.Va f_bfree +(all of type +.Vt fsblkcnt_t ) +represent the respective allocation-block counts. +.Pp +There are two flags defined for the +.Va f_flag +member: +.Bl -tag -offset indent -width ".Dv ST_NOSUID" +.It Dv ST_RDONLY +The file system is mounted read-only. +.It Dv ST_NOSUID +The semantics of the +.Dv S_ISUID +and +.Dv S_ISGID +file mode bits +are not supported by, or are disabled on, this file system. +.El +.Sh IMPLEMENTATION NOTES +The +.Fn statvfs +and +.Fn fstatvfs +functions are implemented as wrappers around the +.Fn statfs +and +.Fn fstatfs +functions, respectively. +Not all the information provided by those functions is made available +through this interface. +.Sh RETURN VALUES +.Rv -std statvfs fstatvfs +.Sh ERRORS +The +.Fn statvfs +function fails if one or more of the following are true: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for a component of the path prefix of +.Fa path . +.It Bq Er EFAULT +.Fa Buf +or +.Fa path +points to an invalid address. +.It Bq Er EIO +An +.Tn I/O +error occurred while reading from or writing to the file system. +.It Bq Er ELOOP +Too many symbolic links were encountered in translating +.Fa path . +.It Bq Er ENAMETOOLONG +The length of a component of +.Fa path +exceeds +.Dv {NAME_MAX} +characters, or the length of +.Fa path +exceeds +.Dv {PATH_MAX} +characters. +.It Bq Er ENOENT +The file referred to by +.Fa path +does not exist. +.It Bq Er ENOTDIR +A component of the path prefix of +.Fa Path +is not a directory. +.El +.Pp +The +.Fn fstatvfs +functions fails if one or more of the following are true: +.Bl -tag -width Er +.It Bq Er EBADF +.Fa fildes +is not a valid open file descriptor. +.It Bq Er EFAULT +.Fa Buf +points to an invalid address. +.It Bq Er EIO +An +.Tn I/O +error occurred while reading from or writing to the file system. +.El +.Sh SEE ALSO +.Xr statfs 2 +.Sh STANDARDS +The +.Fn statvfs +and +.Fn fstatvfs +functions conform to +.St -p1003.1-2001 . +As standardized, portable applications cannot depend on these functions +returning any valid information at all. +This implementation attempts to provide as much useful information as +is provided by the underlying file system, subject to the limitations +of the specified data types. +.Sh AUTHORS +The +.Fn statvfs +and +.Fn fstatvfs +manual page was originally written by +.An Garrett Wollman Aq wollman@FreeBSD.org . diff --git a/emulated/statvfs.c b/emulated/statvfs.c new file mode 100644 index 0000000..5680001 --- /dev/null +++ b/emulated/statvfs.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * sys/statvfs.c + */ +#include +#include + +#include /* glue header */ + + +/* Internal common conversion function */ +static void +cvt_statfs_to_statvfs(struct statfs *from, struct statvfs *to) +{ + to->f_bsize = from->f_iosize; + to->f_frsize = from->f_bsize; + to->f_blocks = (fsblkcnt_t)from->f_blocks; + to->f_bfree = (fsblkcnt_t)from->f_bfree; + to->f_bavail = (fsblkcnt_t)from->f_bavail; + to->f_files = (fsfilcnt_t)from->f_files; + to->f_ffree = (fsfilcnt_t)from->f_ffree; + to->f_favail = (fsfilcnt_t)from->f_ffree; + to->f_fsid = from->f_fsid.val[0]; /* XXX bad if non-root */ + to->f_namemax = NAME_MAX; /* XXX should be per FS */ + + /* Conver FS flags */ + to->f_flag = 0; + if( from->f_flags & MNT_RDONLY) + to->f_flag |= ST_RDONLY; + if( from->f_flags & MNT_NOSUID) + to->f_flag |= ST_NOSUID; + + return; +} + + +int +fstatvfs(int fildes, struct statvfs *buf) +{ + int rv; + struct statfs cvt; + + if ((rv = fstatfs(fildes, &cvt)) == 0) + cvt_statfs_to_statvfs(&cvt, buf); + + return(rv); +} + + +int +statvfs(const char * __restrict path, struct statvfs * __restrict buf) +{ + int rv; + struct statfs cvt; + + if ((rv = statfs(path, &cvt)) == 0) + cvt_statfs_to_statvfs(&cvt, buf); + + return(rv); +} + +/* EOF */ diff --git a/emulated/tcgetsid.3 b/emulated/tcgetsid.3 new file mode 100644 index 0000000..429992a --- /dev/null +++ b/emulated/tcgetsid.3 @@ -0,0 +1,77 @@ +.\" Copyright (c) 2002 Apple Computer, Inc. All rights reserved. +.\" +.\" @APPLE_LICENSE_HEADER_START@ +.\" +.\" The contents of this file constitute Original Code as defined in and +.\" are subject to the Apple Public Source License Version 1.1 (the +.\" "License"). You may not use this file except in compliance with the +.\" License. Please obtain a copy of the License at +.\" http://www.apple.com/publicsource and read it before using this file. +.\" +.\" This Original Code and all software distributed under the License are +.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +.\" License for the specific language governing rights and limitations +.\" under the License. +.\" +.\" @APPLE_LICENSE_HEADER_END@ +.\" +.Dd December 20, 2003 +.Dt tcgetsid 3 +.Os +.Sh NAME +.Nm tcgetsid +.Nd get the process group ID for the session leader for the controlling terminal +.Sh SYNOPSIS +.In termios.h +.Ft pid_t +.Fo tcgetsid +.Fa "int fildes" +.Fc +.Sh DESCRIPTION +The +.Fn tcgetsid +function obtains the process group ID of the session for which the terminal +specified by +.Fa fildes +is the controlling terminal. +.Sh RETURN VALUES +Upon successful completion, +.Fn tcgetsid +returns the process group ID associated with the terminal. +Otherwise, a value of +.Po Vt pid_t Pc Ns -1 +is returned and +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn tcgetsid +function will fail if: +.Bl -tag -width Er +.It Bq Er EACCES +The +.Vt fildes +argument is not associated with a controlling terminal. +.It Bq Er EBADF +The +.Vt fildes +argument is not a valid file descriptor. +.It Bq Er ENOTTY +The file associated with +.Vt fildes +is not a terminal. +.El +.Sh SEE ALSO +.Xr getsid 2 , +.Xr setpgid 2 , +.Xr setsid 2 , +.Xr tcgetpgrp 3 , +.Xr termios 4 +.Sh STANDARDS +The +.Fn tcgetsid +function conforms to +.St -p1003.1-2001 . diff --git a/emulated/tcgetsid.c b/emulated/tcgetsid.c new file mode 100644 index 0000000..aa019f5 --- /dev/null +++ b/emulated/tcgetsid.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * tcgetsid.c + */ +#include +#include +#include /* ordering avoid termios.h redeclarations */ + +pid_t +tcgetsid(int fildes) +{ + pid_t sid; + + if (ioctl(fildes, TIOCGSID, (char *)&sid) < 0) + return ((pid_t)-1); + + return (sid); +} + +/* EOF */ diff --git a/fbsdcompat/_fbsd_compat_.h b/fbsdcompat/_fbsd_compat_.h new file mode 100644 index 0000000..cdda374 --- /dev/null +++ b/fbsdcompat/_fbsd_compat_.h @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __FBSD_COMPAT__H_ +#define __FBSD_COMPAT__H_ + +#include + +#define OFF_MAX LLONG_MAX +#define OFF_MIN LLONG_MIN +#ifndef _BIG_ENDIAN +#define _BIG_ENDIAN BIG_ENDIAN +#endif /* _BIG_ENDIAN */ +#define _BYTE_ORDER BYTE_ORDER +#define _LITTLE_ENDIAN LITTLE_ENDIAN +#define __ct_rune_t ct_rune_t +#define __va_list __darwin_va_list + +#define __isthreaded 1 + +#ifdef _FLOCK_DEBUG +#define _FLOCKFILE(x) _flockfile_debug(x, __FILE__, __LINE__) +#else +#define _FLOCKFILE(x) _flockfile(x) +#endif + +#define FLOCKFILE(fp) _FLOCKFILE(fp) +#define FUNLOCKFILE(fp) _funlockfile(fp) + +/* + * Do the opposite of FreeBSD namespace.h; that is, map the "hidden" names + * back to the real names. + */ + +/* + * ISO C (C90) section. Most names in libc aren't in ISO C, so they + * should be here. Most aren't here... + */ +#define _err err +#define _warn warn + +#define _accept accept +#define _bind bind +#define _close close +#define _connect connect +#define _creat creat +#define _dup dup +#define _dup2 dup2 +#define _execve execve +#define _fcntl fcntl +/*#define _flock flock */ +#define _flockfile flockfile +#define _ftrylockfile ftrylockfile +#define _fstat fstat +#define _fstatfs fstatfs +#define _fsync fsync +#define _funlockfile funlockfile +#define _getdirentries getdirentries +/* #define _getlogin getlogin */ +#define _getpeername getpeername +#define _getprogname getprogname +#define _getsockname getsockname +#define _getsockopt getsockopt +#define _ioctl ioctl +/* #define _kevent kevent */ +#define _listen listen +#define _nanosleep nanosleep +#define _open open +#define _pause pause +#define _poll poll +#define _pthread_cond_broadcast pthread_cond_broadcast +#define _pthread_cond_destroy pthread_cond_destroy +#define _pthread_cond_init pthread_cond_init +#define _pthread_cond_signal pthread_cond_signal +#define _pthread_cond_timedwait pthread_cond_timedwait +#define _pthread_cond_wait pthread_cond_wait +#define _pthread_exit pthread_exit +#define _pthread_getspecific pthread_getspecific +#define _pthread_key_create pthread_key_create +#define _pthread_key_delete pthread_key_delete +#define _pthread_main_np pthread_main_np +#define _pthread_mutex_destroy pthread_mutex_destroy +#define _pthread_mutex_init pthread_mutex_init +#define _pthread_mutex_lock pthread_mutex_lock +#define _pthread_mutex_trylock pthread_mutex_trylock +#define _pthread_mutex_unlock pthread_mutex_unlock +#define _pthread_mutexattr_destroy pthread_mutexattr_destroy +#define _pthread_mutexattr_init pthread_mutexattr_init +#define _pthread_mutexattr_settype pthread_mutexattr_settype +#define _pthread_once pthread_once +#define _pthread_rwlock_destroy pthread_rwlock_destroy +#define _pthread_rwlock_init pthread_rwlock_init +#define _pthread_rwlock_rdlock pthread_rwlock_rdlock +#define _pthread_rwlock_wrlock pthread_rwlock_wrlock +#define _pthread_rwlock_tryrdlock pthread_rwlock_tryrdlock +#define _pthread_rwlock_trywrlock pthread_rwlock_trywrlock +#define _pthread_rwlock_unlock pthread_rwlock_unlock +#define _pthread_self pthread_self +#define _pthread_setspecific pthread_setspecific +#define _pthread_sigmask pthread_sigmask +#define _read read +#define _readv readv +#define _recvfrom recvfrom +#define _recvmsg recvmsg +#define _select select +#define _pselect pselect +#define _sendmsg sendmsg +#define _sendto sendto +#define _setsockopt setsockopt +#define _sigaction sigaction +#define _sigprocmask sigprocmask +#define _sigsuspend sigsuspend +#define _sleep sleep +#define _socket socket +#define _socketpair socketpair +#define _system system +#define _tcdrain tcdrain +#define _usleep usleep +#define _wait wait +#define _wait4 wait4 +#define _waitpid waitpid +#define _write write +#define _writev writev + +#define __creat creat +#define __fmtcheck fmtcheck +#define __inet_addr inet_addr +#define __inet_aton inet_aton +#define __inet_lnaof inet_lnaof +#define __inet_makeaddr inet_makeaddr +#define __inet_net_ntop inet_net_ntop +#define __inet_net_pton inet_net_pton +#define __inet_neta inet_neta +#define __inet_netof inet_netof +#define __inet_network inet_network +#define __inet_nsap_addr inet_nsap_addr +#define __inet_nsap_ntoa inet_nsap_ntoa +#define __inet_ntoa inet_ntoa +#define __inet_ntop inet_ntop +#define __inet_pton inet_pton +#define __makecontext makecontext +#define __makecontext makecontext +#define __pause pause +#define __raise raise +#define __signalcontext signalcontext +#define __sleep sleep +#define __strtok_r strtok_r +#define __swapcontext swapcontext +#define __system system +#define __tcdrain tcdrain +#define __usleep usleep +#define __vfscanf vfscanf +#define __wait wait +#define __waitpid waitpid + +/* + * The _GENERIC_DIRSIZ macro gives the minimum record length which will hold + * the directory entry. This returns the amount of space in struct direct + * without the d_name field, plus enough space for the name with a terminating + * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. + */ +#define _GENERIC_DIRSIZ(dp) \ + (((unsigned long)&((struct dirent *)0)->d_name + (dp)->d_namlen+1 + 3) & ~3) + +#endif /* __FBSD_COMPAT__H_ */ diff --git a/fbsdcompat/_fpmath.h b/fbsdcompat/_fpmath.h new file mode 100644 index 0000000..ed38fc5 --- /dev/null +++ b/fbsdcompat/_fpmath.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2003, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 2002, 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.3 2004/01/18 07:57:01 das Exp $ + */ + +#if defined(__i386__) || defined(__x86_64__) + +union IEEEl2bits { + long double e; + struct { + unsigned int manl :32; + unsigned int manh :32; + unsigned int exp :15; + unsigned int sign :1; + unsigned int junk :16; + } bits; +}; + +#define mask_nbit_l(u) ((u).bits.manh &= 0x7fffffff) + +#define LDBL_MANH_SIZE 32 +#define LDBL_MANL_SIZE 32 + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) +#elif defined(__arm__) || defined(__arm64__) + +union IEEEl2bits { + long double e; + struct { +#ifndef __ARMEB__ + unsigned int manl :32; + unsigned int manh :20; + unsigned int exp :11; + unsigned int sign :1; +#else + unsigned int sign :1; + unsigned int exp :11; + unsigned int manh :20; + unsigned int manl :32; +#endif + } bits; +}; + +#define LDBL_NBIT 0 +#define mask_nbit_l(u) ((void)0) + +#define LDBL_MANH_SIZE 20 +#define LDBL_MANL_SIZE 32 + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) + +#else +#error unsupported architecture +#endif diff --git a/fbsdcompat/fpmath.h b/fbsdcompat/fpmath.h new file mode 100644 index 0000000..f52a6bd --- /dev/null +++ b/fbsdcompat/fpmath.h @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2003 Mike Barcroft + * Copyright (c) 2002 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/include/fpmath.h,v 1.2 2004/01/18 08:05:21 das Exp $ + */ + +#include +#include "_fpmath.h" + +union IEEEf2bits { + float f; + struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + unsigned int man :23; + unsigned int exp :8; + unsigned int sign :1; +#else /* _BIG_ENDIAN */ + unsigned int sign :1; + unsigned int exp :8; + unsigned int man :23; +#endif + } bits; +}; + +#define DBL_MANH_SIZE 20 +#define DBL_MANL_SIZE 32 + +union IEEEd2bits { + double d; + struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + unsigned int manl :32; + unsigned int manh :20; + unsigned int exp :11; + unsigned int sign :1; +#else /* _BIG_ENDIAN */ + unsigned int sign :1; + unsigned int exp :11; + unsigned int manh :20; + unsigned int manl :32; +#endif + } bits; +}; diff --git a/fbsdcompat/machine/atomic.h b/fbsdcompat/machine/atomic.h new file mode 100644 index 0000000..f87a3c5 --- /dev/null +++ b/fbsdcompat/machine/atomic.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * This file left intentionally blank. + */ diff --git a/fbsdcompat/namespace.h b/fbsdcompat/namespace.h new file mode 100644 index 0000000..c7aa0b7 --- /dev/null +++ b/fbsdcompat/namespace.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * This file left intentionally blank + */ diff --git a/fbsdcompat/port_after.h b/fbsdcompat/port_after.h new file mode 100644 index 0000000..3fbf933 --- /dev/null +++ b/fbsdcompat/port_after.h @@ -0,0 +1 @@ +/* FreeBSD only needs this for isc, nameser and resolv */ diff --git a/fbsdcompat/port_before.h b/fbsdcompat/port_before.h new file mode 100644 index 0000000..3fbf933 --- /dev/null +++ b/fbsdcompat/port_before.h @@ -0,0 +1 @@ +/* FreeBSD only needs this for isc, nameser and resolv */ diff --git a/fbsdcompat/reentrant.h b/fbsdcompat/reentrant.h new file mode 100644 index 0000000..c642dc4 --- /dev/null +++ b/fbsdcompat/reentrant.h @@ -0,0 +1,134 @@ +/*- + * Copyright (c) 1997,98 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by J.T. Conklin. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/include/reentrant.h,v 1.3 2004/02/25 21:03:45 green Exp $ + */ + +/* + * Requirements: + * + * 1. The thread safe mechanism should be lightweight so the library can + * be used by non-threaded applications without unreasonable overhead. + * + * 2. There should be no dependency on a thread engine for non-threaded + * applications. + * + * 3. There should be no dependency on any particular thread engine. + * + * 4. The library should be able to be compiled without support for thread + * safety. + * + * + * Rationale: + * + * One approach for thread safety is to provide discrete versions of the + * library: one thread safe, the other not. The disadvantage of this is + * that libc is rather large, and two copies of a library which are 99%+ + * identical is not an efficent use of resources. + * + * Another approach is to provide a single thread safe library. However, + * it should not add significant run time or code size overhead to non- + * threaded applications. + * + * Since the NetBSD C library is used in other projects, it should be + * easy to replace the mutual exclusion primitives with ones provided by + * another system. Similarly, it should also be easy to remove all + * support for thread safety completely if the target environment does + * not support threads. + * + * + * Implementation Details: + * + * The mutex primitives used by the library (mutex_t, mutex_lock, etc.) + * are macros which expand to the cooresponding primitives provided by + * the thread engine or to nothing. The latter is used so that code is + * not unreasonably cluttered with #ifdefs when all thread safe support + * is removed. + * + * The mutex macros can be directly mapped to the mutex primitives from + * pthreads, however it should be reasonably easy to wrap another mutex + * implementation so it presents a similar interface. + * + * Stub implementations of the mutex functions are provided with *weak* + * linkage. These functions simply return success. When linked with a + * thread library (i.e. -lpthread), the functions will override the + * stubs. + */ + +#include +#include "libc_private.h" + +#define mutex_t pthread_mutex_t +#define cond_t pthread_cond_t +#define rwlock_t pthread_rwlock_t +#define once_t pthread_once_t + +#define thread_key_t pthread_key_t +#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER +#define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER +#define ONCE_INITIALIZER PTHREAD_ONCE_INIT + +#define mutex_init(m, a) _pthread_mutex_init(m, a) +#define mutex_lock(m) if (__isthreaded) \ + _pthread_mutex_lock(m) +#define mutex_unlock(m) if (__isthreaded) \ + _pthread_mutex_unlock(m) +#define mutex_trylock(m) (__isthreaded ? 0 : _pthread_mutex_trylock(m)) + +#define cond_init(c, a, p) _pthread_cond_init(c, a) +#define cond_signal(m) if (__isthreaded) \ + _pthread_cond_signal(m) +#define cond_broadcast(m) if (__isthreaded) \ + _pthread_cond_broadcast(m) +#define cond_wait(c, m) if (__isthreaded) \ + _pthread_cond_wait(c, m) + +#define rwlock_init(l, a) _pthread_rwlock_init(l, a) +#define rwlock_rdlock(l) if (__isthreaded) \ + _pthread_rwlock_rdlock(l) +#define rwlock_wrlock(l) if (__isthreaded) \ + _pthread_rwlock_wrlock(l) +#define rwlock_unlock(l) if (__isthreaded) \ + _pthread_rwlock_unlock(l) + +#define thr_keycreate(k, d) _pthread_key_create(k, d) +#define thr_setspecific(k, p) _pthread_setspecific(k, p) +#define thr_getspecific(k) _pthread_getspecific(k) +#define thr_sigsetmask(f, n, o) _pthread_sigmask(f, n, o) + +#define thr_once(o, i) _pthread_once(o, i) +#define thr_self() _pthread_self() +#define thr_exit(x) _pthread_exit(x) +#define thr_main() _pthread_main_np() diff --git a/fbsdcompat/spinlock.h b/fbsdcompat/spinlock.h new file mode 100644 index 0000000..b3417ce --- /dev/null +++ b/fbsdcompat/spinlock.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 John Birrell . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by John Birrell. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/include/spinlock.h,v 1.5 2002/03/21 22:47:52 obrien Exp $ + * + * Lock definitions used in both libc and libpthread. + * + */ + +#ifndef _SPINLOCK_H_ +#define _SPINLOCK_H_ +#ifdef __APPLE__ +#include + +typedef os_unfair_lock spinlock_t; + +#define _SPINLOCK_INITIALIZER OS_UNFAIR_LOCK_INIT + +#define _SPINLOCK(_lck) \ + do { \ + os_unfair_lock_lock(_lck); \ + } while (0) + +#define _SPINUNLOCK(_lck) \ + do { \ + os_unfair_lock_unlock(_lck); \ + } while (0) + +#else /* ! __APPLE__ */ +#include +#include + +/* + * Lock structure with room for debugging information. + */ +typedef struct { + volatile long access_lock; + volatile long lock_owner; + volatile char *fname; + volatile int lineno; +} spinlock_t; + +#define _SPINLOCK_INITIALIZER { 0, 0, 0, 0 } + +#define _SPINUNLOCK(_lck) (_lck)->access_lock = 0 +#ifdef _LOCK_DEBUG +#define _SPINLOCK(_lck) _spinlock_debug(_lck, __FILE__, __LINE__) +#else +#define _SPINLOCK(_lck) _spinlock(_lck) +#endif + +/* + * Thread function prototype definitions: + */ +__BEGIN_DECLS +long _atomic_lock(volatile long *); +void _spinlock(spinlock_t *); +void _spinlock_debug(spinlock_t *, char *, int); +__END_DECLS + +#endif /* __APPLE__ */ + +#endif /* _SPINLOCK_H_ */ diff --git a/fbsdcompat/sys/cdefs.h b/fbsdcompat/sys/cdefs.h new file mode 100644 index 0000000..aea0606 --- /dev/null +++ b/fbsdcompat/sys/cdefs.h @@ -0,0 +1,165 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Berkeley Software Design, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 + * $FreeBSD: /repoman/r/ncvs/src/sys/sys/cdefs.h,v 1.68 2002/10/21 20:50:30 mike Exp $ + */ + +#ifndef _SYS_CDEFS_H_ + +/* + * Compiler-dependent macros to help declare dead (non-returning) and + * pure (no side effects) functions, and unused variables. They are + * null except for versions of gcc that are known to support the features + * properly (old versions of gcc-2 supported the dead and pure features + * in a different (wrong) way). If we do not provide an implementation + * for a given compiler, let the compile fail if it is told to use + * a feature that we cannot live without. + */ +#ifdef lint +#define __packed +#define __aligned(x) +#define __section(x) +#else +#define __packed __attribute__((__packed__)) +#define __aligned(x) __attribute__((__aligned__(x))) +#define __section(x) __attribute__((__section__(x))) +#endif + +#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 +#define __LONG_LONG_SUPPORTED +#endif + +/* + * We define this here since , , and + * require it. + */ +#define __strong_reference(sym,aliassym) \ + extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))); +#define __weak_reference(sym,alias) +#define __warn_references(sym,msg) + +#ifndef __RCSID_SOURCE +#ifndef NO__RCSID_SOURCE +#define __RCSID_SOURCE(s) __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s) +#else +#define __RCSID_SOURCE(s) +#endif +#endif + +#ifndef __DECONST +#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) +#endif + +#ifndef __DEVOLATILE +#define __DEVOLATILE(type, var) ((type)(uintptr_t)(volatile void *)(var)) +#endif + +#ifndef __DEQUALIFY +#define __DEQUALIFY(type, var) ((type)(uintptr_t)(const volatile void *)(var)) +#endif + +/* + * Now include the Apple version of sys/cdefs.h + */ + +#include_next + +/* + * Use FreeBSD version of __CONCAT + */ +#if defined(__STDC__) || defined(__cplusplus) +#undef __CONCAT1 +#undef __CONCAT +#define __CONCAT1(x,y) x ## y +#define __CONCAT(x,y) __CONCAT1(x,y) +#endif + +/* + * Deal with all versions of POSIX. The ordering relative to the tests above is + * important. + */ +#ifdef _POSIX_C_SOURCE +#if _POSIX_C_SOURCE >= 200112 +#define __POSIX_VISIBLE 200112 +#define __ISO_C_VISIBLE 1999 +#elif _POSIX_C_SOURCE >= 199506 +#define __POSIX_VISIBLE 199506 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199309 +#define __POSIX_VISIBLE 199309 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199209 +#define __POSIX_VISIBLE 199209 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199009 +#define __POSIX_VISIBLE 199009 +#define __ISO_C_VISIBLE 1990 +#else +#define __POSIX_VISIBLE 198808 +#define __ISO_C_VISIBLE 0 +#endif /* _POSIX_C_SOURCE */ +#else +/*- + * Deal with _ANSI_SOURCE: + * If it is defined, and no other compilation environment is explicitly + * requested, then define our internal feature-test macros to zero. This + * makes no difference to the preprocessor (undefined symbols in preprocessing + * expressions are defined to have value zero), but makes it more convenient for + * a test program to print out the values. + * + * If a program mistakenly defines _ANSI_SOURCE and some other macro such as + * _POSIX_C_SOURCE, we will assume that it wants the broader compilation + * environment (and in fact we will never get here). + */ +#if defined(_ANSI_SOURCE) /* Hide almost everything. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 1990 +#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 1999 +#else /* Default environment: show everything. */ +#define __POSIX_VISIBLE 200112 +#define __XSI_VISIBLE 600 +#define __BSD_VISIBLE 1 +#define __ISO_C_VISIBLE 1999 +#endif +#endif + +#endif /* !_SYS_CDEFS_H_ */ diff --git a/fbsdcompat/sys/endian.h b/fbsdcompat/sys/endian.h new file mode 100644 index 0000000..287dbd9 --- /dev/null +++ b/fbsdcompat/sys/endian.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _SYS_ENDIAN_H_ +#define _SYS_ENDIAN_H_ +#include +#endif /* _SYS_ENDIAN_H_ */ diff --git a/fbsdcompat/un-namespace.h b/fbsdcompat/un-namespace.h new file mode 100644 index 0000000..c7aa0b7 --- /dev/null +++ b/fbsdcompat/un-namespace.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * This file left intentionally blank + */ diff --git a/gdtoa/CMakeLists.txt b/gdtoa/CMakeLists.txt new file mode 100644 index 0000000..97ac144 --- /dev/null +++ b/gdtoa/CMakeLists.txt @@ -0,0 +1,54 @@ +project(libc-gdtoa) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}") + +# set(gdtoa_sources _ldbl_util.c) # doesn't build + +set(gdtoa_sources ${gdtoa_sources} + FreeBSD/gdtoa-dmisc.c + FreeBSD/gdtoa-dtoa.c + FreeBSD/gdtoa-gdtoa.c + FreeBSD/gdtoa-gethex.c + FreeBSD/gdtoa-gmisc.c + FreeBSD/gdtoa-hd_init.c + FreeBSD/gdtoa-hexnan.c + FreeBSD/gdtoa-misc.c + FreeBSD/gdtoa-smisc.c + FreeBSD/gdtoa-strtod.c + FreeBSD/gdtoa-strtodg.c + FreeBSD/gdtoa-strtof.c + #FreeBSD/gdtoa-strtoIg.c + FreeBSD/gdtoa-strtopdd.c + FreeBSD/gdtoa-strtopx.c + FreeBSD/gdtoa-strtord.c + FreeBSD/gdtoa-sum.c + FreeBSD/gdtoa-ulp.c + FreeBSD/glue.c + FreeBSD/_hdtoa.c + FreeBSD/_ldtoa.c + #FreeBSD/machdep_ldisd.c # these are not for x86 + #FreeBSD/machdep_ldisdd.c + #FreeBSD/machdep_ldisQ.c + FreeBSD/machdep_ldisx.c) + +#SET_SOURCE_FILES_PROPERTIES(FreeBSD/gdtoa-strtod.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_STRTOD -DLIBC_ALIAS_STRTOD_L") +#SET_SOURCE_FILES_PROPERTIES(FreeBSD/gdtoa-strtof.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_STRTOF -DLIBC_ALIAS_STRTOF_L") + +add_darling_object_library(libc-gdtoa ${gdtoa_sources}) +add_library(libc-gdtoa_dyld OBJECT ${gdtoa_sources}) +set_target_properties(libc-gdtoa_dyld PROPERTIES COMPILE_FLAGS "-DVARIANT_DYLD") +make_fat(libc-gdtoa_dyld) + +# Legacy variant +if (TARGET_i386) + set(gdtoa-legacy_sources + FreeBSD/gdtoa-strtod.c + FreeBSD/gdtoa-strtodg.c + FreeBSD/gdtoa-strtof.c) + add_library(libc-gdtoa_legacy OBJECT ${gdtoa-legacy_sources}) + SET_TARGET_PROPERTIES(libc-gdtoa_legacy PROPERTIES COMPILE_FLAGS + "-DBUILDING_VARIANT -DVARIANT_LEGACY -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0") +endif (TARGET_i386) diff --git a/gdtoa/FreeBSD/_hdtoa.c b/gdtoa/FreeBSD/_hdtoa.c new file mode 100644 index 0000000..10d4ab5 --- /dev/null +++ b/gdtoa/FreeBSD/_hdtoa.c @@ -0,0 +1,326 @@ +/*- + * Copyright (c) 2004, 2005 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/_hdtoa.c,v 1.5 2007/05/08 02:59:37 das Exp $"); + +#include +#include +#include +#include "fpmath.h" +#include "gdtoaimp.h" + +/* Strings values used by dtoa() */ +#define INFSTR "Infinity" +#define NANSTR "NaN" + +#define DBL_ADJ (DBL_MAX_EXP - 2 + ((DBL_MANT_DIG - 1) % 4)) +#define LDBL_ADJ (LDBL_MAX_EXP - 2 + ((LDBL_MANT_DIG - 1) % 4)) + +/* + * Round up the given digit string. If the digit string is fff...f, + * this procedure sets it to 100...0 and returns 1 to indicate that + * the exponent needs to be bumped. Otherwise, 0 is returned. + */ +static int +roundup(char *s0, int ndigits) +{ + char *s; + + for (s = s0 + ndigits - 1; *s == 0xf; s--) { + if (s == s0) { + *s = 1; + return (1); + } + *s = 0; + } + ++*s; + return (0); +} + +/* + * Round the given digit string to ndigits digits according to the + * current rounding mode. Note that this could produce a string whose + * value is not representable in the corresponding floating-point + * type. The exponent pointed to by decpt is adjusted if necessary. + */ +static void +dorounding(char *s0, int ndigits, int sign, int *decpt) +{ + int adjust = 0; /* do we need to adjust the exponent? */ + + switch (FLT_ROUNDS) { + case 0: /* toward zero */ + default: /* implementation-defined */ + break; + case 1: /* to nearest, halfway rounds to even */ + if ((s0[ndigits] > 8) || + (s0[ndigits] == 8 && s0[ndigits + 1] & 1)) + adjust = roundup(s0, ndigits); + break; + case 2: /* toward +inf */ + if (sign == 0) + adjust = roundup(s0, ndigits); + break; + case 3: /* toward -inf */ + if (sign != 0) + adjust = roundup(s0, ndigits); + break; + } + + if (adjust) + *decpt += 4; +} + +/* + * This procedure converts a double-precision number in IEEE format + * into a string of hexadecimal digits and an exponent of 2. Its + * behavior is bug-for-bug compatible with dtoa() in mode 2, with the + * following exceptions: + * + * - An ndigits < 0 causes it to use as many digits as necessary to + * represent the number exactly. + * - The additional xdigs argument should point to either the string + * "0123456789ABCDEF" or the string "0123456789abcdef", depending on + * which case is desired. + * - This routine does not repeat dtoa's mistake of setting decpt + * to 9999 in the case of an infinity or NaN. INT_MAX is used + * for this purpose instead. + * + * Note that the C99 standard does not specify what the leading digit + * should be for non-zero numbers. For instance, 0x1.3p3 is the same + * as 0x2.6p2 is the same as 0x4.cp3. This implementation chooses the + * first digit so that subsequent digits are aligned on nibble + * boundaries (before rounding). + * + * Inputs: d, xdigs, ndigits + * Outputs: decpt, sign, rve + */ +char * +__hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, + char **rve) +{ + static const int sigfigs = (DBL_MANT_DIG + 3) / 4; + union IEEEd2bits u; + char *s, *s0; + int bufsize, f; + + u.d = d; + *sign = u.bits.sign; + + switch (f = fpclassify(d)) { + case FP_NORMAL: + *decpt = u.bits.exp - DBL_ADJ; + break; + case FP_ZERO: +return_zero: + *decpt = 1; + return (nrv_alloc("0", rve, 1)); + case FP_SUBNORMAL: + /* + * For processors that treat subnormals as zero, comparison + * with zero will be equal, so we jump to the FP_ZERO case. + */ + if(u.d == 0.0) goto return_zero; + u.d *= 0x1p514; + *decpt = u.bits.exp - (514 + DBL_ADJ); + break; + case FP_INFINITE: + *decpt = INT_MAX; + return (nrv_alloc(INFSTR, rve, sizeof(INFSTR) - 1)); + case FP_NAN: + *decpt = INT_MAX; + return (nrv_alloc(NANSTR, rve, sizeof(NANSTR) - 1)); + default: + LIBC_ABORT("fpclassify returned %d", f); + } + + /* FP_NORMAL or FP_SUBNORMAL */ + + if (ndigits == 0) /* dtoa() compatibility */ + ndigits = 1; + + /* + * For simplicity, we generate all the digits even if the + * caller has requested fewer. + */ + bufsize = (sigfigs > ndigits) ? sigfigs : ndigits; + s0 = rv_alloc(bufsize); + + /* + * We work from right to left, first adding any requested zero + * padding, then the least significant portion of the + * mantissa, followed by the most significant. The buffer is + * filled with the byte values 0x0 through 0xf, which are + * converted to xdigs[0x0] through xdigs[0xf] after the + * rounding phase. + */ + for (s = s0 + bufsize - 1; s > s0 + sigfigs - 1; s--) + *s = 0; + for (; s > s0 + sigfigs - (DBL_MANL_SIZE / 4) - 1 && s > s0; s--) { + *s = u.bits.manl & 0xf; + u.bits.manl >>= 4; + } + for (; s > s0; s--) { + *s = u.bits.manh & 0xf; + u.bits.manh >>= 4; + } + + /* + * At this point, we have snarfed all the bits in the + * mantissa, with the possible exception of the highest-order + * (partial) nibble, which is dealt with by the next + * statement. We also tack on the implicit normalization bit. + */ + *s = u.bits.manh | (1U << ((DBL_MANT_DIG - 1) % 4)); + + /* If ndigits < 0, we are expected to auto-size the precision. */ + if (ndigits < 0) { + for (ndigits = sigfigs; s0[ndigits - 1] == 0; ndigits--) + ; + } + + if (sigfigs > ndigits && s0[ndigits] != 0) + dorounding(s0, ndigits, u.bits.sign, decpt); + + s = s0 + ndigits; + if (rve != NULL) + *rve = s; + *s-- = '\0'; + for (; s >= s0; s--) + *s = xdigs[(unsigned int)*s]; + + return (s0); +} + +#if (LDBL_MANT_DIG > DBL_MANT_DIG) + +/* + * This is the long double version of __hdtoa(). + */ +char * +__hldtoa(long double e, const char *xdigs, int ndigits, int *decpt, int *sign, + char **rve) +{ + static const int sigfigs = (LDBL_MANT_DIG + 3) / 4; + union IEEEl2bits u; + char *s, *s0; + int bufsize, f; + + u.e = e; + *sign = u.bits.sign; + + switch (f = fpclassify(e)) { + case FP_NORMAL: + case FP_SUPERNORMAL: + *decpt = u.bits.exp - LDBL_ADJ; + break; + case FP_ZERO: + *decpt = 1; + return (nrv_alloc("0", rve, 1)); + case FP_SUBNORMAL: + u.e *= 0x1p514L; + *decpt = u.bits.exp - (514 + LDBL_ADJ); + break; + case FP_INFINITE: + *decpt = INT_MAX; + return (nrv_alloc(INFSTR, rve, sizeof(INFSTR) - 1)); + case FP_NAN: + *decpt = INT_MAX; + return (nrv_alloc(NANSTR, rve, sizeof(NANSTR) - 1)); + default: + LIBC_ABORT("fpclassify returned %d", f); + } + + /* FP_NORMAL or FP_SUBNORMAL */ + + if (ndigits == 0) /* dtoa() compatibility */ + ndigits = 1; + + /* + * For simplicity, we generate all the digits even if the + * caller has requested fewer. + */ + bufsize = (sigfigs > ndigits) ? sigfigs : ndigits; + s0 = rv_alloc(bufsize); + + /* + * We work from right to left, first adding any requested zero + * padding, then the least significant portion of the + * mantissa, followed by the most significant. The buffer is + * filled with the byte values 0x0 through 0xf, which are + * converted to xdigs[0x0] through xdigs[0xf] after the + * rounding phase. + */ + for (s = s0 + bufsize - 1; s > s0 + sigfigs - 1; s--) + *s = 0; + for (; s > s0 + sigfigs - (LDBL_MANL_SIZE / 4) - 1 && s > s0; s--) { + *s = u.bits.manl & 0xf; + u.bits.manl >>= 4; + } + for (; s > s0; s--) { + *s = u.bits.manh & 0xf; + u.bits.manh >>= 4; + } + + /* + * At this point, we have snarfed all the bits in the + * mantissa, with the possible exception of the highest-order + * (partial) nibble, which is dealt with by the next + * statement. We also tack on the implicit normalization bit. + */ + *s = u.bits.manh | (1U << ((LDBL_MANT_DIG - 1) % 4)); + + /* If ndigits < 0, we are expected to auto-size the precision. */ + if (ndigits < 0) { + for (ndigits = sigfigs; s0[ndigits - 1] == 0; ndigits--) + ; + } + + if (sigfigs > ndigits && s0[ndigits] != 0) + dorounding(s0, ndigits, u.bits.sign, decpt); + + s = s0 + ndigits; + if (rve != NULL) + *rve = s; + *s-- = '\0'; + for (; s >= s0; s--) + *s = xdigs[(unsigned int)*s]; + + return (s0); +} + +#else /* (LDBL_MANT_DIG == DBL_MANT_DIG) */ + +char * +__hldtoa(long double e, const char *xdigs, int ndigits, int *decpt, int *sign, + char **rve) +{ + + return (__hdtoa((double)e, xdigs, ndigits, decpt, sign, rve)); +} + +#endif /* (LDBL_MANT_DIG == DBL_MANT_DIG) */ diff --git a/gdtoa/FreeBSD/_ldtoa.c b/gdtoa/FreeBSD/_ldtoa.c new file mode 100644 index 0000000..6367839 --- /dev/null +++ b/gdtoa/FreeBSD/_ldtoa.c @@ -0,0 +1,118 @@ +/*- + * Copyright (c) 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/_ldtoa.c,v 1.5 2007/12/09 19:48:57 das Exp $"); + +#include +#include +#include +#include +#include +#include "fpmath.h" +#include "gdtoaimp.h" + +/* + * ldtoa() is a wrapper for gdtoa() that makes it smell like dtoa(), + * except that the floating point argument is passed by reference. + * When dtoa() is passed a NaN or infinity, it sets expt to 9999. + * However, a long double could have a valid exponent of 9999, so we + * use INT_MAX in ldtoa() instead. + */ +char * +__ldtoa(long double *ld, int mode, int ndigits, int *decpt, int *sign, + char **rve) +{ +#if defined(__arm__) || defined(__arm64__) + /* On arm, double == long double, so short circuit this */ + char * ret = __dtoa((double)*ld, mode, ndigits, decpt, sign, rve); + if (*decpt == 9999) + *decpt = INT_MAX; + return ret; +#else + FPI fpi = { + LDBL_MANT_DIG, /* nbits */ + LDBL_MIN_EXP - LDBL_MANT_DIG, /* emin */ + LDBL_MAX_EXP - LDBL_MANT_DIG, /* emax */ + FLT_ROUNDS, /* rounding */ +#ifdef Sudden_Underflow /* unused, but correct anyway */ + 1 +#else + 0 +#endif + }; + int be, kind; + char *ret; + union IEEEl2bits u; + uint32_t bits[(LDBL_MANT_DIG + 31) / 32]; + void *vbits = bits; + int type; + + u.e = *ld; + type = fpclassify(u.e); + + /* + * gdtoa doesn't know anything about the sign of the number, so + * if the number is negative, we need to swap rounding modes of + * 2 (upwards) and 3 (downwards). + */ + *sign = u.bits.sign; + fpi.rounding ^= (fpi.rounding >> 1) & u.bits.sign; + + be = u.bits.exp - (LDBL_MAX_EXP - 1) - (LDBL_MANT_DIG - 1); + LDBL_TO_ARRAY32(u, bits); + + switch (type) { + case FP_NORMAL: + case FP_SUPERNORMAL: + kind = STRTOG_Normal; +#ifdef LDBL_IMPLICIT_NBIT + bits[LDBL_MANT_DIG / 32] |= 1 << ((LDBL_MANT_DIG - 1) % 32); +#endif /* LDBL_IMPLICIT_NBIT */ + break; + case FP_ZERO: + kind = STRTOG_Zero; + break; + case FP_SUBNORMAL: + kind = STRTOG_Denormal; + be++; + break; + case FP_INFINITE: + kind = STRTOG_Infinite; + break; + case FP_NAN: + kind = STRTOG_NaN; + break; + default: + LIBC_ABORT("fpclassify returned %d", type); + } + + ret = gdtoa(&fpi, be, vbits, &kind, mode, ndigits, decpt, rve); + if (*decpt == -32768) + *decpt = INT_MAX; + return ret; +#endif +} diff --git a/gdtoa/FreeBSD/gdtoa-dmisc.c b/gdtoa/FreeBSD/gdtoa-dmisc.c new file mode 100644 index 0000000..ce170c7 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-dmisc.c @@ -0,0 +1,216 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + +#ifndef MULTIPLE_THREADS + char *dtoa_result; +#endif + + char * +#ifdef KR_headers +rv_alloc(i) int i; +#else +rv_alloc(int i) +#endif +{ + int j, k, *r; + + j = sizeof(ULong); + for(k = 0; + sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= i; + j <<= 1) + k++; + r = (int*)Balloc(k); + *r = k; + return +#ifndef MULTIPLE_THREADS + dtoa_result = +#endif + (char *)(r+1); + } + + char * +#ifdef KR_headers +nrv_alloc(s, rve, n) char *s, **rve; int n; +#else +nrv_alloc(char *s, char **rve, int n) +#endif +{ + char *rv, *t; + + t = rv = rv_alloc(n); + while((*t = *s++) !=0) + t++; + if (rve) + *rve = t; + return rv; + } + +/* freedtoa(s) must be used to free values s returned by dtoa + * when MULTIPLE_THREADS is #defined. It should be used in all cases, + * but for consistency with earlier versions of dtoa, it is optional + * when MULTIPLE_THREADS is not defined. + */ + + void +#ifdef KR_headers +freedtoa(s) char *s; +#else +freedtoa(char *s) +#endif +{ + Bigint *b = (Bigint *)((int *)s - 1); + b->maxwds = 1 << (b->k = *(int*)b); + Bfree(b); +#ifndef MULTIPLE_THREADS + if (s == dtoa_result) + dtoa_result = 0; +#endif + } + + int +quorem +#ifdef KR_headers + (b, S) Bigint *b, *S; +#else + (Bigint *b, Bigint *S) +#endif +{ + int n; + ULong *bx, *bxe, q, *sx, *sxe; +#ifdef ULLong + ULLong borrow, carry, y, ys; +#else + ULong borrow, carry, y, ys; +#ifdef Pack_32 + ULong si, z, zs; +#endif +#endif + + n = S->wds; +#ifdef DEBUG + /*debug*/ if (b->wds > n) + /*debug*/ Bug("oversize b in quorem"); +#endif + if (b->wds < n) + return 0; + sx = S->x; + sxe = sx + --n; + bx = b->x; + bxe = bx + n; + q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ +#ifdef DEBUG + /*debug*/ if (q > 9) + /*debug*/ Bug("oversized quotient in quorem"); +#endif + if (q) { + borrow = 0; + carry = 0; + do { +#ifdef ULLong + ys = *sx++ * (ULLong)q + carry; + carry = ys >> 32; + y = *bx - (ys & 0xffffffffUL) - borrow; + borrow = y >> 32 & 1UL; + *bx++ = y & 0xffffffffUL; +#else +#ifdef Pack_32 + si = *sx++; + ys = (si & 0xffff) * q + carry; + zs = (si >> 16) * q + (ys >> 16); + carry = zs >> 16; + y = (*bx & 0xffff) - (ys & 0xffff) - borrow; + borrow = (y & 0x10000) >> 16; + z = (*bx >> 16) - (zs & 0xffff) - borrow; + borrow = (z & 0x10000) >> 16; + Storeinc(bx, z, y); +#else + ys = *sx++ * q + carry; + carry = ys >> 16; + y = *bx - (ys & 0xffff) - borrow; + borrow = (y & 0x10000) >> 16; + *bx++ = y & 0xffff; +#endif +#endif + } + while(sx <= sxe); + if (!*bxe) { + bx = b->x; + while(--bxe > bx && !*bxe) + --n; + b->wds = n; + } + } + if (cmp(b, S) >= 0) { + q++; + borrow = 0; + carry = 0; + bx = b->x; + sx = S->x; + do { +#ifdef ULLong + ys = *sx++ + carry; + carry = ys >> 32; + y = *bx - (ys & 0xffffffffUL) - borrow; + borrow = y >> 32 & 1UL; + *bx++ = y & 0xffffffffUL; +#else +#ifdef Pack_32 + si = *sx++; + ys = (si & 0xffff) + carry; + zs = (si >> 16) + (ys >> 16); + carry = zs >> 16; + y = (*bx & 0xffff) - (ys & 0xffff) - borrow; + borrow = (y & 0x10000) >> 16; + z = (*bx >> 16) - (zs & 0xffff) - borrow; + borrow = (z & 0x10000) >> 16; + Storeinc(bx, z, y); +#else + ys = *sx++ + carry; + carry = ys >> 16; + y = *bx - (ys & 0xffff) - borrow; + borrow = (y & 0x10000) >> 16; + *bx++ = y & 0xffff; +#endif +#endif + } + while(sx <= sxe); + bx = b->x; + bxe = bx + n; + if (!*bxe) { + while(--bxe > bx && !*bxe) + --n; + b->wds = n; + } + } + return q; + } diff --git a/gdtoa/FreeBSD/gdtoa-dtoa.c b/gdtoa/FreeBSD/gdtoa-dtoa.c new file mode 100644 index 0000000..f89ac0c --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-dtoa.c @@ -0,0 +1,766 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 1999 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + +/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. + * + * Inspired by "How to Print Floating-Point Numbers Accurately" by + * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126]. + * + * Modifications: + * 1. Rather than iterating, we use a simple numeric overestimate + * to determine k = floor(log10(d)). We scale relevant + * quantities using O(log2(k)) rather than O(k) multiplications. + * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't + * try to generate digits strictly left to right. Instead, we + * compute with fewer bits and propagate the carry if necessary + * when rounding the final digit up. This is often faster. + * 3. Under the assumption that input will be rounded nearest, + * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. + * That is, we allow equality in stopping tests when the + * round-nearest rule will give the same floating-point value + * as would satisfaction of the stopping test with strict + * inequality. + * 4. We remove common factors of powers of 2 from relevant + * quantities. + * 5. When converting floating-point integers less than 1e16, + * we use floating-point arithmetic rather than resorting + * to multiple-precision integers. + * 6. When asked to produce fewer than 15 digits, we first try + * to get by with floating-point arithmetic; we resort to + * multiple-precision integer arithmetic only if we cannot + * guarantee that the floating-point calculation has given + * the correctly rounded result. For k requested digits and + * "uniformly" distributed input, the probability is + * something like 10^(k-15) that we must resort to the Long + * calculation. + */ + +#ifdef Honor_FLT_ROUNDS +#undef Check_FLT_ROUNDS +#define Check_FLT_ROUNDS +#else +#define Rounding Flt_Rounds +#endif + + char * +dtoa +#ifdef KR_headers + (d0, mode, ndigits, decpt, sign, rve) + double d0; int mode, ndigits, *decpt, *sign; char **rve; +#else + (double d0, int mode, int ndigits, int *decpt, int *sign, char **rve) +#endif +{ + /* Arguments ndigits, decpt, sign are similar to those + of ecvt and fcvt; trailing zeros are suppressed from + the returned string. If not null, *rve is set to point + to the end of the return value. If d is +-Infinity or NaN, + then *decpt is set to 9999. + + mode: + 0 ==> shortest string that yields d when read in + and rounded to nearest. + 1 ==> like 0, but with Steele & White stopping rule; + e.g. with IEEE P754 arithmetic , mode 0 gives + 1e23 whereas mode 1 gives 9.999999999999999e22. + 2 ==> max(1,ndigits) significant digits. This gives a + return value similar to that of ecvt, except + that trailing zeros are suppressed. + 3 ==> through ndigits past the decimal point. This + gives a return value similar to that from fcvt, + except that trailing zeros are suppressed, and + ndigits can be negative. + 4,5 ==> similar to 2 and 3, respectively, but (in + round-nearest mode) with the tests of mode 0 to + possibly return a shorter string that rounds to d. + With IEEE arithmetic and compilation with + -DHonor_FLT_ROUNDS, modes 4 and 5 behave the same + as modes 2 and 3 when FLT_ROUNDS != 1. + 6-9 ==> Debugging modes similar to mode - 4: don't try + fast floating-point estimate (if applicable). + + Values of mode other than 0-9 are treated as mode 0. + + Sufficient space is allocated to the return value + to hold the suppressed trailing zeros. + */ + + int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1, + j, j1, k, k0, k_check, leftright, m2, m5, s2, s5, + spec_case, try_quick; + Long L; +#ifndef Sudden_Underflow + int denorm; + ULong x; +#endif + Bigint *b, *b1, *delta, *mlo, *mhi, *S; + U d, d2, eps; + double ds; + char *s, *s0; +#ifdef SET_INEXACT + int inexact, oldinexact; +#endif +#ifdef Honor_FLT_ROUNDS /*{*/ + int Rounding; +#ifdef Trust_FLT_ROUNDS /*{{ only define this if FLT_ROUNDS really works! */ + Rounding = Flt_Rounds; +#else /*}{*/ + Rounding = 1; + switch(fegetround()) { + case FE_TOWARDZERO: Rounding = 0; break; + case FE_UPWARD: Rounding = 2; break; + case FE_DOWNWARD: Rounding = 3; + } +#endif /*}}*/ +#endif /*}*/ + +#ifndef MULTIPLE_THREADS + if (dtoa_result) { + freedtoa(dtoa_result); + dtoa_result = 0; + } +#endif + d.d = d0; + if (word0(&d) & Sign_bit) { + /* set sign for everything, including 0's and NaNs */ + *sign = 1; + word0(&d) &= ~Sign_bit; /* clear sign bit */ + } + else + *sign = 0; + +#if defined(IEEE_Arith) + defined(VAX) +#ifdef IEEE_Arith + if ((word0(&d) & Exp_mask) == Exp_mask) +#else + if (word0(&d) == 0x8000) +#endif + { + /* Infinity or NaN */ + *decpt = 9999; +#ifdef IEEE_Arith + if (!word1(&d) && !(word0(&d) & 0xfffff)) + return nrv_alloc("Infinity", rve, 8); +#endif + return nrv_alloc("NaN", rve, 3); + } +#endif +#ifdef IBM + dval(&d) += 0; /* normalize */ +#endif + if (!dval(&d)) { + *decpt = 1; + return nrv_alloc("0", rve, 1); + } + +#ifdef SET_INEXACT + try_quick = oldinexact = get_inexact(); + inexact = 1; +#endif +#ifdef Honor_FLT_ROUNDS + if (Rounding >= 2) { + if (*sign) + Rounding = Rounding == 2 ? 0 : 2; + else + if (Rounding != 2) + Rounding = 0; + } +#endif + + b = d2b(dval(&d), &be, &bbits); +#ifdef Sudden_Underflow + i = (int)(word0(&d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)); +#else + if (( i = (int)(word0(&d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)) )!=0) { +#endif + dval(&d2) = dval(&d); + word0(&d2) &= Frac_mask1; + word0(&d2) |= Exp_11; +#ifdef IBM + if (( j = 11 - hi0bits(word0(&d2) & Frac_mask) )!=0) + dval(&d2) /= 1 << j; +#endif + + /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 + * log10(x) = log(x) / log(10) + * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) + * log10(&d) = (i-Bias)*log(2)/log(10) + log10(&d2) + * + * This suggests computing an approximation k to log10(&d) by + * + * k = (i - Bias)*0.301029995663981 + * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); + * + * We want k to be too large rather than too small. + * The error in the first-order Taylor series approximation + * is in our favor, so we just round up the constant enough + * to compensate for any error in the multiplication of + * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, + * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, + * adding 1e-13 to the constant term more than suffices. + * Hence we adjust the constant term to 0.1760912590558. + * (We could get a more accurate k by invoking log10, + * but this is probably not worthwhile.) + */ + + i -= Bias; +#ifdef IBM + i <<= 2; + i += j; +#endif +#ifndef Sudden_Underflow + denorm = 0; + } + else { + /* d is denormalized */ + + i = bbits + be + (Bias + (P-1) - 1); + x = i > 32 ? word0(&d) << (64 - i) | word1(&d) >> (i - 32) + : word1(&d) << (32 - i); + dval(&d2) = x; + word0(&d2) -= 31*Exp_msk1; /* adjust exponent */ + i -= (Bias + (P-1) - 1) + 1; + denorm = 1; + } +#endif + ds = (dval(&d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; + k = (int)ds; + if (ds < 0. && ds != k) + k--; /* want k = floor(ds) */ + k_check = 1; + if (k >= 0 && k <= Ten_pmax) { + if (dval(&d) < tens[k]) + k--; + k_check = 0; + } + j = bbits - i - 1; + if (j >= 0) { + b2 = 0; + s2 = j; + } + else { + b2 = -j; + s2 = 0; + } + if (k >= 0) { + b5 = 0; + s5 = k; + s2 += k; + } + else { + b2 -= k; + b5 = -k; + s5 = 0; + } + if (mode < 0 || mode > 9) + mode = 0; + +#ifndef SET_INEXACT +#ifdef Check_FLT_ROUNDS + try_quick = Rounding == 1; +#else + try_quick = 1; +#endif +#endif /*SET_INEXACT*/ + + if (mode > 5) { + mode -= 4; + try_quick = 0; + } + leftright = 1; + ilim = ilim1 = -1; /* Values for cases 0 and 1; done here to */ + /* silence erroneous "gcc -Wall" warning. */ + switch(mode) { + case 0: + case 1: + i = 18; + ndigits = 0; + break; + case 2: + leftright = 0; + /* no break */ + case 4: + if (ndigits <= 0) + ndigits = 1; + ilim = ilim1 = i = ndigits; + break; + case 3: + leftright = 0; + /* no break */ + case 5: + i = ndigits + k + 1; + ilim = i; + ilim1 = i - 1; + if (i <= 0) + i = 1; + } + s = s0 = rv_alloc(i); + +#ifdef Honor_FLT_ROUNDS + if (mode > 1 && Rounding != 1) + leftright = 0; +#endif + + if (ilim >= 0 && ilim <= Quick_max && try_quick) { + + /* Try to get by with floating-point arithmetic. */ + + i = 0; + dval(&d2) = dval(&d); + k0 = k; + ilim0 = ilim; + ieps = 2; /* conservative */ + if (k > 0) { + ds = tens[k&0xf]; + j = k >> 4; + if (j & Bletch) { + /* prevent overflows */ + j &= Bletch - 1; + dval(&d) /= bigtens[n_bigtens-1]; + ieps++; + } + for(; j; j >>= 1, i++) + if (j & 1) { + ieps++; + ds *= bigtens[i]; + } + dval(&d) /= ds; + } + else if (( j1 = -k )!=0) { + dval(&d) *= tens[j1 & 0xf]; + for(j = j1 >> 4; j; j >>= 1, i++) + if (j & 1) { + ieps++; + dval(&d) *= bigtens[i]; + } + } + if (k_check && dval(&d) < 1. && ilim > 0) { + if (ilim1 <= 0) + goto fast_failed; + ilim = ilim1; + k--; + dval(&d) *= 10.; + ieps++; + } + dval(&eps) = ieps*dval(&d) + 7.; + word0(&eps) -= (P-1)*Exp_msk1; + if (ilim == 0) { + S = mhi = 0; + dval(&d) -= 5.; + if (dval(&d) > dval(&eps)) + goto one_digit; + if (dval(&d) < -dval(&eps)) + goto no_digits; + goto fast_failed; + } +#ifndef No_leftright + if (leftright) { + /* Use Steele & White method of only + * generating digits needed. + */ + dval(&eps) = 0.5/tens[ilim-1] - dval(&eps); + for(i = 0;;) { + L = dval(&d); + dval(&d) -= L; + *s++ = '0' + (int)L; + if (dval(&d) < dval(&eps)) + goto ret1; + if (1. - dval(&d) < dval(&eps)) + goto bump_up; + if (++i >= ilim) + break; + dval(&eps) *= 10.; + dval(&d) *= 10.; + } + } + else { +#endif + /* Generate ilim digits, then fix them up. */ + dval(&eps) *= tens[ilim-1]; + for(i = 1;; i++, dval(&d) *= 10.) { + L = (Long)(dval(&d)); + if (!(dval(&d) -= L)) + ilim = i; + *s++ = '0' + (int)L; + if (i == ilim) { + if (dval(&d) > 0.5 + dval(&eps)) + goto bump_up; + else if (dval(&d) < 0.5 - dval(&eps)) { + while(*--s == '0'); + s++; + goto ret1; + } + break; + } + } +#ifndef No_leftright + } +#endif + fast_failed: + s = s0; + dval(&d) = dval(&d2); + k = k0; + ilim = ilim0; + } + + /* Do we have a "small" integer? */ + + if (be >= 0 && k <= Int_max) { + /* Yes. */ + ds = tens[k]; + if (ndigits < 0 && ilim <= 0) { + S = mhi = 0; + if (ilim < 0 || dval(&d) <= 5*ds) + goto no_digits; + goto one_digit; + } + for(i = 1;; i++, dval(&d) *= 10.) { + L = (Long)(dval(&d) / ds); + dval(&d) -= L*ds; +#ifdef Check_FLT_ROUNDS + /* If FLT_ROUNDS == 2, L will usually be high by 1 */ + if (dval(&d) < 0) { + L--; + dval(&d) += ds; + } +#endif + *s++ = '0' + (int)L; + if (!dval(&d)) { +#ifdef SET_INEXACT + inexact = 0; +#endif + break; + } + if (i == ilim) { +#ifdef Honor_FLT_ROUNDS + if (mode > 1) + switch(Rounding) { + case 0: goto ret1; + case 2: goto bump_up; + } +#endif + dval(&d) += dval(&d); + if (dval(&d) > ds || (dval(&d) == ds && L & 1)) { + bump_up: + while(*--s == '9') + if (s == s0) { + k++; + *s = '0'; + break; + } + ++*s++; + } + break; + } + } + goto ret1; + } + + m2 = b2; + m5 = b5; + mhi = mlo = 0; + if (leftright) { + i = +#ifndef Sudden_Underflow + denorm ? be + (Bias + (P-1) - 1 + 1) : +#endif +#ifdef IBM + 1 + 4*P - 3 - bbits + ((bbits + be - 1) & 3); +#else + 1 + P - bbits; +#endif + b2 += i; + s2 += i; + mhi = i2b(1); + } + if (m2 > 0 && s2 > 0) { + i = m2 < s2 ? m2 : s2; + b2 -= i; + m2 -= i; + s2 -= i; + } + if (b5 > 0) { + if (leftright) { + if (m5 > 0) { + mhi = pow5mult(mhi, m5); + b1 = mult(mhi, b); + Bfree(b); + b = b1; + } + if (( j = b5 - m5 )!=0) + b = pow5mult(b, j); + } + else + b = pow5mult(b, b5); + } + S = i2b(1); + if (s5 > 0) + S = pow5mult(S, s5); + + /* Check for special case that d is a normalized power of 2. */ + + spec_case = 0; + if ((mode < 2 || leftright) +#ifdef Honor_FLT_ROUNDS + && Rounding == 1 +#endif + ) { + if (!word1(&d) && !(word0(&d) & Bndry_mask) +#ifndef Sudden_Underflow + && word0(&d) & (Exp_mask & ~Exp_msk1) +#endif + ) { + /* The special case */ + b2 += Log2P; + s2 += Log2P; + spec_case = 1; + } + } + + /* Arrange for convenient computation of quotients: + * shift left if necessary so divisor has 4 leading 0 bits. + * + * Perhaps we should just compute leading 28 bits of S once + * and for all and pass them and a shift to quorem, so it + * can do shifts and ors to compute the numerator for q. + */ +#ifdef Pack_32 + if (( i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f )!=0) + i = 32 - i; +#else + if (( i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf )!=0) + i = 16 - i; +#endif + if (i > 4) { + i -= 4; + b2 += i; + m2 += i; + s2 += i; + } + else if (i < 4) { + i += 28; + b2 += i; + m2 += i; + s2 += i; + } + if (b2 > 0) + b = lshift(b, b2); + if (s2 > 0) + S = lshift(S, s2); + if (k_check) { + if (cmp(b,S) < 0) { + k--; + b = multadd(b, 10, 0); /* we botched the k estimate */ + if (leftright) + mhi = multadd(mhi, 10, 0); + ilim = ilim1; + } + } + if (ilim <= 0 && (mode == 3 || mode == 5)) { + if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) { + /* no digits, fcvt style */ + no_digits: + k = -1 - ndigits; + goto ret; + } + one_digit: + *s++ = '1'; + k++; + goto ret; + } + if (leftright) { + if (m2 > 0) + mhi = lshift(mhi, m2); + + /* Compute mlo -- check for special case + * that d is a normalized power of 2. + */ + + mlo = mhi; + if (spec_case) { + mhi = Balloc(mhi->k); + Bcopy(mhi, mlo); + mhi = lshift(mhi, Log2P); + } + + for(i = 1;;i++) { + dig = quorem(b,S) + '0'; + /* Do we yet have the shortest decimal string + * that will round to d? + */ + j = cmp(b, mlo); + delta = diff(S, mhi); + j1 = delta->sign ? 1 : cmp(b, delta); + Bfree(delta); +#ifndef ROUND_BIASED + if (j1 == 0 && mode != 1 && !(word1(&d) & 1) +#ifdef Honor_FLT_ROUNDS + && Rounding >= 1 +#endif + ) { + if (dig == '9') + goto round_9_up; + if (j > 0) + dig++; +#ifdef SET_INEXACT + else if (!b->x[0] && b->wds <= 1) + inexact = 0; +#endif + *s++ = dig; + goto ret; + } +#endif + if (j < 0 || (j == 0 && mode != 1 +#ifndef ROUND_BIASED + && !(word1(&d) & 1) +#endif + )) { + if (!b->x[0] && b->wds <= 1) { +#ifdef SET_INEXACT + inexact = 0; +#endif + goto accept_dig; + } +#ifdef Honor_FLT_ROUNDS + if (mode > 1) + switch(Rounding) { + case 0: goto accept_dig; + case 2: goto keep_dig; + } +#endif /*Honor_FLT_ROUNDS*/ + if (j1 > 0) { + b = lshift(b, 1); + j1 = cmp(b, S); + if ((j1 > 0 || (j1 == 0 && dig & 1)) + && dig++ == '9') + goto round_9_up; + } + accept_dig: + *s++ = dig; + goto ret; + } + if (j1 > 0) { +#ifdef Honor_FLT_ROUNDS + if (!Rounding) + goto accept_dig; +#endif + if (dig == '9') { /* possible if i == 1 */ + round_9_up: + *s++ = '9'; + goto roundoff; + } + *s++ = dig + 1; + goto ret; + } +#ifdef Honor_FLT_ROUNDS + keep_dig: +#endif + *s++ = dig; + if (i == ilim) + break; + b = multadd(b, 10, 0); + if (mlo == mhi) + mlo = mhi = multadd(mhi, 10, 0); + else { + mlo = multadd(mlo, 10, 0); + mhi = multadd(mhi, 10, 0); + } + } + } + else + for(i = 1;; i++) { + *s++ = dig = quorem(b,S) + '0'; + if (!b->x[0] && b->wds <= 1) { +#ifdef SET_INEXACT + inexact = 0; +#endif + goto ret; + } + if (i >= ilim) + break; + b = multadd(b, 10, 0); + } + + /* Round off last digit */ + +#ifdef Honor_FLT_ROUNDS + switch(Rounding) { + case 0: goto trimzeros; + case 2: goto roundoff; + } +#endif + b = lshift(b, 1); + j = cmp(b, S); + if (j > 0 || (j == 0 && dig & 1)) { + roundoff: + while(*--s == '9') + if (s == s0) { + k++; + *s++ = '1'; + goto ret; + } + ++*s++; + } + else { +#ifdef Honor_FLT_ROUNDS + trimzeros: +#endif + while(*--s == '0'); + s++; + } + ret: + Bfree(S); + if (mhi) { + if (mlo && mlo != mhi) + Bfree(mlo); + Bfree(mhi); + } + ret1: +#ifdef SET_INEXACT + if (inexact) { + if (!oldinexact) { + word0(&d) = Exp_1 + (70 << Exp_shift); + word1(&d) = 0; + dval(&d) += 1.; + } + } + else if (!oldinexact) + clear_inexact(); +#endif + Bfree(b); + *s = 0; + *decpt = k + 1; + if (rve) + *rve = s; + return s0; + } diff --git a/gdtoa/FreeBSD/gdtoa-gdtoa.c b/gdtoa/FreeBSD/gdtoa-gdtoa.c new file mode 100644 index 0000000..4ebdf41 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-gdtoa.c @@ -0,0 +1,745 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 1999 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + + static Bigint * +#ifdef KR_headers +bitstob(bits, nbits, bbits) ULong *bits; int nbits; int *bbits; +#else +bitstob(ULong *bits, int nbits, int *bbits) +#endif +{ + int i, k; + Bigint *b; + ULong *be, *x, *x0; + + i = ULbits; + k = 0; + while(i < nbits) { + i <<= 1; + k++; + } +#ifndef Pack_32 + if (!k) + k = 1; +#endif + b = Balloc(k); + be = bits + ((nbits - 1) >> kshift); + x = x0 = b->x; + do { + *x++ = *bits & ALL_ON; +#ifdef Pack_16 + *x++ = (*bits >> 16) & ALL_ON; +#endif + } while(++bits <= be); + i = x - x0; + while(!x0[--i]) + if (!i) { + b->wds = 0; + *bbits = 0; + goto ret; + } + b->wds = i + 1; + *bbits = i*ULbits + 32 - hi0bits(b->x[i]); + ret: + return b; + } + +/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. + * + * Inspired by "How to Print Floating-Point Numbers Accurately" by + * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126]. + * + * Modifications: + * 1. Rather than iterating, we use a simple numeric overestimate + * to determine k = floor(log10(d)). We scale relevant + * quantities using O(log2(k)) rather than O(k) multiplications. + * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't + * try to generate digits strictly left to right. Instead, we + * compute with fewer bits and propagate the carry if necessary + * when rounding the final digit up. This is often faster. + * 3. Under the assumption that input will be rounded nearest, + * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. + * That is, we allow equality in stopping tests when the + * round-nearest rule will give the same floating-point value + * as would satisfaction of the stopping test with strict + * inequality. + * 4. We remove common factors of powers of 2 from relevant + * quantities. + * 5. When converting floating-point integers less than 1e16, + * we use floating-point arithmetic rather than resorting + * to multiple-precision integers. + * 6. When asked to produce fewer than 15 digits, we first try + * to get by with floating-point arithmetic; we resort to + * multiple-precision integer arithmetic only if we cannot + * guarantee that the floating-point calculation has given + * the correctly rounded result. For k requested digits and + * "uniformly" distributed input, the probability is + * something like 10^(k-15) that we must resort to the Long + * calculation. + */ + + char * +gdtoa +#ifdef KR_headers + (fpi, be, bits, kindp, mode, ndigits, decpt, rve) + FPI *fpi; int be; ULong *bits; + int *kindp, mode, ndigits, *decpt; char **rve; +#else + (FPI *fpi, int be, ULong *bits, int *kindp, int mode, int ndigits, int *decpt, char **rve) +#endif +{ + /* Arguments ndigits and decpt are similar to the second and third + arguments of ecvt and fcvt; trailing zeros are suppressed from + the returned string. If not null, *rve is set to point + to the end of the return value. If d is +-Infinity or NaN, + then *decpt is set to 9999. + + mode: + 0 ==> shortest string that yields d when read in + and rounded to nearest. + 1 ==> like 0, but with Steele & White stopping rule; + e.g. with IEEE P754 arithmetic , mode 0 gives + 1e23 whereas mode 1 gives 9.999999999999999e22. + 2 ==> max(1,ndigits) significant digits. This gives a + return value similar to that of ecvt, except + that trailing zeros are suppressed. + 3 ==> through ndigits past the decimal point. This + gives a return value similar to that from fcvt, + except that trailing zeros are suppressed, and + ndigits can be negative. + 4-9 should give the same return values as 2-3, i.e., + 4 <= mode <= 9 ==> same return as mode + 2 + (mode & 1). These modes are mainly for + debugging; often they run slower but sometimes + faster than modes 2-3. + 4,5,8,9 ==> left-to-right digit generation. + 6-9 ==> don't try fast floating-point estimate + (if applicable). + + Values of mode other than 0-9 are treated as mode 0. + + Sufficient space is allocated to the return value + to hold the suppressed trailing zeros. + */ + + int bbits, b2, b5, be0, dig, i, ieps, ilim, ilim0, ilim1, inex; + int j, j1, k, k0, k_check, kind, leftright, m2, m5, nbits; + int rdir, s2, s5, spec_case, try_quick; + Long L; + Bigint *b, *b1, *delta, *mlo, *mhi, *mhi1, *S; + double d2, ds; + char *s, *s0; + U d, eps; + +#ifndef MULTIPLE_THREADS + if (dtoa_result) { + freedtoa(dtoa_result); + dtoa_result = 0; + } +#endif + inex = 0; + kind = *kindp &= ~STRTOG_Inexact; + switch(kind & STRTOG_Retmask) { + case STRTOG_Zero: + goto ret_zero; + case STRTOG_Normal: + case STRTOG_Denormal: + break; + case STRTOG_Infinite: + *decpt = -32768; + return nrv_alloc("Infinity", rve, 8); + case STRTOG_NaN: + *decpt = -32768; + return nrv_alloc("NaN", rve, 3); + default: + return 0; + } + b = bitstob(bits, nbits = fpi->nbits, &bbits); + be0 = be; + if ( (i = trailz(b)) !=0) { + rshift(b, i); + be += i; + bbits -= i; + } + if (!b->wds) { + Bfree(b); + ret_zero: + *decpt = 1; + return nrv_alloc("0", rve, 1); + } + + dval(&d) = b2d(b, &i); + i = be + bbits - 1; + word0(&d) &= Frac_mask1; + word0(&d) |= Exp_11; +#ifdef IBM + if ( (j = 11 - hi0bits(word0(&d) & Frac_mask)) !=0) + dval(&d) /= 1 << j; +#endif + + /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 + * log10(x) = log(x) / log(10) + * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) + * log10(&d) = (i-Bias)*log(2)/log(10) + log10(d2) + * + * This suggests computing an approximation k to log10(&d) by + * + * k = (i - Bias)*0.301029995663981 + * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); + * + * We want k to be too large rather than too small. + * The error in the first-order Taylor series approximation + * is in our favor, so we just round up the constant enough + * to compensate for any error in the multiplication of + * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, + * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, + * adding 1e-13 to the constant term more than suffices. + * Hence we adjust the constant term to 0.1760912590558. + * (We could get a more accurate k by invoking log10, + * but this is probably not worthwhile.) + */ +#ifdef IBM + i <<= 2; + i += j; +#endif + ds = (dval(&d)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; + + /* correct assumption about exponent range */ + if ((j = i) < 0) + j = -j; + if ((j -= 1077) > 0) + ds += j * 7e-17; + + k = (int)ds; + if (ds < 0. && ds != k) + k--; /* want k = floor(ds) */ + k_check = 1; +#ifdef IBM + j = be + bbits - 1; + if ( (j1 = j & 3) !=0) + dval(&d) *= 1 << j1; + word0(&d) += j << Exp_shift - 2 & Exp_mask; +#else + word0(&d) += (be + bbits - 1) << Exp_shift; +#endif + if (k >= 0 && k <= Ten_pmax) { + if (dval(&d) < tens[k]) + k--; + k_check = 0; + } + j = bbits - i - 1; + if (j >= 0) { + b2 = 0; + s2 = j; + } + else { + b2 = -j; + s2 = 0; + } + if (k >= 0) { + b5 = 0; + s5 = k; + s2 += k; + } + else { + b2 -= k; + b5 = -k; + s5 = 0; + } + if (mode < 0 || mode > 9) + mode = 0; + try_quick = 1; + if (mode > 5) { + mode -= 4; + try_quick = 0; + } + leftright = 1; + ilim = ilim1 = -1; /* Values for cases 0 and 1; done here to */ + /* silence erroneous "gcc -Wall" warning. */ + switch(mode) { + case 0: + case 1: + i = (int)(nbits * .30103) + 3; + ndigits = 0; + break; + case 2: + leftright = 0; + /* no break */ + case 4: + if (ndigits <= 0) + ndigits = 1; + ilim = ilim1 = i = ndigits; + break; + case 3: + leftright = 0; + /* no break */ + case 5: + i = ndigits + k + 1; + ilim = i; + ilim1 = i - 1; + if (i <= 0) + i = 1; + } + s = s0 = rv_alloc(i); + + if ( (rdir = fpi->rounding - 1) !=0) { + if (rdir < 0) + rdir = 2; + if (kind & STRTOG_Neg) + rdir = 3 - rdir; + } + + /* Now rdir = 0 ==> round near, 1 ==> round up, 2 ==> round down. */ + + if (ilim >= 0 && ilim <= Quick_max && try_quick && !rdir +#ifndef IMPRECISE_INEXACT + && k == 0 +#endif + ) { + + /* Try to get by with floating-point arithmetic. */ + + i = 0; + d2 = dval(&d); +#ifdef IBM + if ( (j = 11 - hi0bits(word0(&d) & Frac_mask)) !=0) + dval(&d) /= 1 << j; +#endif + k0 = k; + ilim0 = ilim; + ieps = 2; /* conservative */ + if (k > 0) { + ds = tens[k&0xf]; + j = k >> 4; + if (j & Bletch) { + /* prevent overflows */ + j &= Bletch - 1; + dval(&d) /= bigtens[n_bigtens-1]; + ieps++; + } + for(; j; j >>= 1, i++) + if (j & 1) { + ieps++; + ds *= bigtens[i]; + } + } + else { + ds = 1.; + if ( (j1 = -k) !=0) { + dval(&d) *= tens[j1 & 0xf]; + for(j = j1 >> 4; j; j >>= 1, i++) + if (j & 1) { + ieps++; + dval(&d) *= bigtens[i]; + } + } + } + if (k_check && dval(&d) < 1. && ilim > 0) { + if (ilim1 <= 0) + goto fast_failed; + ilim = ilim1; + k--; + dval(&d) *= 10.; + ieps++; + } + dval(&eps) = ieps*dval(&d) + 7.; + word0(&eps) -= (P-1)*Exp_msk1; + if (ilim == 0) { + S = mhi = 0; + dval(&d) -= 5.; + if (dval(&d) > dval(&eps)) + goto one_digit; + if (dval(&d) < -dval(&eps)) + goto no_digits; + goto fast_failed; + } +#ifndef No_leftright + if (leftright) { + /* Use Steele & White method of only + * generating digits needed. + */ + dval(&eps) = ds*0.5/tens[ilim-1] - dval(&eps); + for(i = 0;;) { + L = (Long)(dval(&d)/ds); + dval(&d) -= L*ds; + *s++ = '0' + (int)L; + if (dval(&d) < dval(&eps)) { + if (dval(&d)) + inex = STRTOG_Inexlo; + goto ret1; + } + if (ds - dval(&d) < dval(&eps)) + goto bump_up; + if (++i >= ilim) + break; + dval(&eps) *= 10.; + dval(&d) *= 10.; + } + } + else { +#endif + /* Generate ilim digits, then fix them up. */ + dval(&eps) *= tens[ilim-1]; + for(i = 1;; i++, dval(&d) *= 10.) { + if ( (L = (Long)(dval(&d)/ds)) !=0) + dval(&d) -= L*ds; + *s++ = '0' + (int)L; + if (i == ilim) { + ds *= 0.5; + if (dval(&d) > ds + dval(&eps)) + goto bump_up; + else if (dval(&d) < ds - dval(&eps)) { + if (dval(&d)) + inex = STRTOG_Inexlo; + goto clear_trailing0; + } + break; + } + } +#ifndef No_leftright + } +#endif + fast_failed: + s = s0; + dval(&d) = d2; + k = k0; + ilim = ilim0; + } + + /* Do we have a "small" integer? */ + + if (be >= 0 && k <= Int_max) { + /* Yes. */ + ds = tens[k]; + if (ndigits < 0 && ilim <= 0) { + S = mhi = 0; + if (ilim < 0 || dval(&d) <= 5*ds) + goto no_digits; + goto one_digit; + } + for(i = 1;; i++, dval(&d) *= 10.) { + L = dval(&d) / ds; + dval(&d) -= L*ds; +#ifdef Check_FLT_ROUNDS + /* If FLT_ROUNDS == 2, L will usually be high by 1 */ + if (dval(&d) < 0) { + L--; + dval(&d) += ds; + } +#endif + *s++ = '0' + (int)L; + if (dval(&d) == 0.) + break; + if (i == ilim) { + if (rdir) { + if (rdir == 1) + goto bump_up; + inex = STRTOG_Inexlo; + goto ret1; + } + dval(&d) += dval(&d); + if (dval(&d) > ds || (dval(&d) == ds && L & 1)) { + bump_up: + inex = STRTOG_Inexhi; + while(*--s == '9') + if (s == s0) { + k++; + *s = '0'; + break; + } + ++*s++; + } + else { + inex = STRTOG_Inexlo; + clear_trailing0: + while(*--s == '0'){} + ++s; + } + break; + } + } + goto ret1; + } + + m2 = b2; + m5 = b5; + mhi = mlo = 0; + if (leftright) { + if (mode < 2) { + i = nbits - bbits; + if (be - i++ < fpi->emin) + /* denormal */ + i = be - fpi->emin + 1; + } + else { + j = ilim - 1; + if (m5 >= j) + m5 -= j; + else { + s5 += j -= m5; + b5 += j; + m5 = 0; + } + if ((i = ilim) < 0) { + m2 -= i; + i = 0; + } + } + b2 += i; + s2 += i; + mhi = i2b(1); + } + if (m2 > 0 && s2 > 0) { + i = m2 < s2 ? m2 : s2; + b2 -= i; + m2 -= i; + s2 -= i; + } + if (b5 > 0) { + if (leftright) { + if (m5 > 0) { + mhi = pow5mult(mhi, m5); + b1 = mult(mhi, b); + Bfree(b); + b = b1; + } + if ( (j = b5 - m5) !=0) + b = pow5mult(b, j); + } + else + b = pow5mult(b, b5); + } + S = i2b(1); + if (s5 > 0) + S = pow5mult(S, s5); + + /* Check for special case that d is a normalized power of 2. */ + + spec_case = 0; + if (mode < 2) { + if (bbits == 1 && be0 > fpi->emin + 1) { + /* The special case */ + b2++; + s2++; + spec_case = 1; + } + } + + /* Arrange for convenient computation of quotients: + * shift left if necessary so divisor has 4 leading 0 bits. + * + * Perhaps we should just compute leading 28 bits of S once + * and for all and pass them and a shift to quorem, so it + * can do shifts and ors to compute the numerator for q. + */ + i = ((s5 ? hi0bits(S->x[S->wds-1]) : ULbits - 1) - s2 - 4) & kmask; + m2 += i; + if ((b2 += i) > 0) + b = lshift(b, b2); + if ((s2 += i) > 0) + S = lshift(S, s2); + if (k_check) { + if (cmp(b,S) < 0) { + k--; + b = multadd(b, 10, 0); /* we botched the k estimate */ + if (leftright) + mhi = multadd(mhi, 10, 0); + ilim = ilim1; + } + } + if (ilim <= 0 && mode > 2) { + if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) { + /* no digits, fcvt style */ + no_digits: + k = -1 - ndigits; + inex = STRTOG_Inexlo; + goto ret; + } + one_digit: + inex = STRTOG_Inexhi; + *s++ = '1'; + k++; + goto ret; + } + if (leftright) { + if (m2 > 0) + mhi = lshift(mhi, m2); + + /* Compute mlo -- check for special case + * that d is a normalized power of 2. + */ + + mlo = mhi; + if (spec_case) { + mhi = Balloc(mhi->k); + Bcopy(mhi, mlo); + mhi = lshift(mhi, 1); + } + + for(i = 1;;i++) { + dig = quorem(b,S) + '0'; + /* Do we yet have the shortest decimal string + * that will round to d? + */ + j = cmp(b, mlo); + delta = diff(S, mhi); + j1 = delta->sign ? 1 : cmp(b, delta); + Bfree(delta); +#ifndef ROUND_BIASED + if (j1 == 0 && !mode && !(bits[0] & 1) && !rdir) { + if (dig == '9') + goto round_9_up; + if (j <= 0) { + if (b->wds > 1 || b->x[0]) + inex = STRTOG_Inexlo; + } + else { + dig++; + inex = STRTOG_Inexhi; + } + *s++ = dig; + goto ret; + } +#endif + if (j < 0 || (j == 0 && !mode +#ifndef ROUND_BIASED + && !(bits[0] & 1) +#endif + )) { + if (rdir && (b->wds > 1 || b->x[0])) { + if (rdir == 2) { + inex = STRTOG_Inexlo; + goto accept; + } + while (cmp(S,mhi) > 0) { + *s++ = dig; + mhi1 = multadd(mhi, 10, 0); + if (mlo == mhi) + mlo = mhi1; + mhi = mhi1; + b = multadd(b, 10, 0); + dig = quorem(b,S) + '0'; + } + if (dig++ == '9') + goto round_9_up; + inex = STRTOG_Inexhi; + goto accept; + } + if (j1 > 0) { + b = lshift(b, 1); + j1 = cmp(b, S); + if ((j1 > 0 || (j1 == 0 && dig & 1)) + && dig++ == '9') + goto round_9_up; + inex = STRTOG_Inexhi; + } + if (b->wds > 1 || b->x[0]) + inex = STRTOG_Inexlo; + accept: + *s++ = dig; + goto ret; + } + if (j1 > 0 && rdir != 2) { + if (dig == '9') { /* possible if i == 1 */ + round_9_up: + *s++ = '9'; + inex = STRTOG_Inexhi; + goto roundoff; + } + inex = STRTOG_Inexhi; + *s++ = dig + 1; + goto ret; + } + *s++ = dig; + if (i == ilim) + break; + b = multadd(b, 10, 0); + if (mlo == mhi) + mlo = mhi = multadd(mhi, 10, 0); + else { + mlo = multadd(mlo, 10, 0); + mhi = multadd(mhi, 10, 0); + } + } + } + else + for(i = 1;; i++) { + *s++ = dig = quorem(b,S) + '0'; + if (i >= ilim) + break; + b = multadd(b, 10, 0); + } + + /* Round off last digit */ + + if (rdir) { + if (rdir == 2 || (b->wds <= 1 && !b->x[0])) + goto chopzeros; + goto roundoff; + } + b = lshift(b, 1); + j = cmp(b, S); + if (j > 0 || (j == 0 && dig & 1)) { + roundoff: + inex = STRTOG_Inexhi; + while(*--s == '9') + if (s == s0) { + k++; + *s++ = '1'; + goto ret; + } + ++*s++; + } + else { + chopzeros: + if (b->wds > 1 || b->x[0]) + inex = STRTOG_Inexlo; + while(*--s == '0'){} + ++s; + } + ret: + Bfree(S); + if (mhi) { + if (mlo && mlo != mhi) + Bfree(mlo); + Bfree(mhi); + } + ret1: + Bfree(b); + *s = 0; + *decpt = k + 1; + if (rve) + *rve = s; + *kindp |= inex; + return s0; + } diff --git a/gdtoa/FreeBSD/gdtoa-gethex.c b/gdtoa/FreeBSD/gdtoa-gethex.c new file mode 100644 index 0000000..fd0775c --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-gethex.c @@ -0,0 +1,407 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "xlocale_private.h" + +#include "gdtoaimp.h" + +#include + +#ifdef USE_LOCALE +#include "locale.h" +#endif + + int +#ifdef KR_headers +gethex(sp, fpi, exp, bp, sign, loc) + CONST char **sp; CONST FPI *fpi; Long *exp; Bigint **bp; int sign; locale_t loc; +#else +gethex( CONST char **sp, CONST FPI *fpi, Long *exp, Bigint **bp, int sign, locale_t loc) +#endif +{ + Bigint *b; + CONST unsigned char *decpt, *s0, *s, *s1; + unsigned char *strunc; + int big, esign, havedig, irv, j, k, n, n0, nbits, up, zret; + ULong L, lostbits, *x; + Long e, e1; +#ifdef USE_LOCALE + int i; + NORMALIZE_LOCALE(loc); +#ifdef NO_LOCALE_CACHE + const unsigned char *decimalpoint = (unsigned char*)localeconv_l(loc)->decimal_point; +#else + const unsigned char *decimalpoint; + static unsigned char *decimalpoint_cache; + if (!(s0 = decimalpoint_cache)) { + s0 = (unsigned char*)localeconv_l(loc)->decimal_point; + if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) { + strcpy(decimalpoint_cache, s0); + s0 = decimalpoint_cache; + } + } + decimalpoint = s0; +#endif +#endif + + if (!hexdig['0']) + hexdig_init_D2A(); + *bp = 0; + havedig = 0; + s0 = *(CONST unsigned char **)sp + 2; + while(s0[havedig] == '0') + havedig++; + s0 += havedig; + s = s0; + decpt = 0; + zret = 0; + e = 0; + if (hexdig[*s]) + havedig++; + else { + zret = 1; +#ifdef USE_LOCALE + for(i = 0; decimalpoint[i]; ++i) { + if (s[i] != decimalpoint[i]) + goto pcheck; + } + decpt = s += i; +#else + if (*s != '.') + goto pcheck; + decpt = ++s; +#endif + if (!hexdig[*s]) + goto pcheck; + while(*s == '0') + s++; + if (hexdig[*s]) + zret = 0; + havedig = 1; + s0 = s; + } + while(hexdig[*s]) + s++; +#ifdef USE_LOCALE + if (*s == *decimalpoint && !decpt) { + for(i = 1; decimalpoint[i]; ++i) { + if (s[i] != decimalpoint[i]) + goto pcheck; + } + decpt = s += i; +#else + if (*s == '.' && !decpt) { + decpt = ++s; +#endif + while(hexdig[*s]) + s++; + }/*}*/ + if (decpt) + e = -(((Long)(s-decpt)) << 2); + pcheck: + s1 = s; + big = esign = 0; + switch(*s) { + case 'p': + case 'P': + switch(*++s) { + case '-': + esign = 1; + /* no break */ + case '+': + s++; + } + if ((n = hexdig[*s]) == 0 || n > 0x19) { + s = s1; + break; + } + e1 = n - 0x10; + while((n = hexdig[*++s]) !=0 && n <= 0x19) { + if (e1 & 0xf8000000) + big = 1; + e1 = 10*e1 + n - 0x10; + } + if (esign) + e1 = -e1; + e += e1; + } + *sp = (char*)s; + if (!havedig) + *sp = (char*)s0 - 1; + if (zret) + return STRTOG_Zero; + if (big) { + if (esign) { + switch(fpi->rounding) { + case FPI_Round_up: + if (sign) + break; + goto ret_tiny; + case FPI_Round_down: + if (!sign) + break; + goto ret_tiny; + } + goto retz; + ret_tiny: + b = Balloc(0); + b->wds = 1; + b->x[0] = 1; + goto dret; + } + switch(fpi->rounding) { + case FPI_Round_near: + goto ovfl1; + case FPI_Round_up: + if (!sign) + goto ovfl1; + goto ret_big; + case FPI_Round_down: + if (sign) + goto ovfl1; + goto ret_big; + } + ret_big: + nbits = fpi->nbits; + n0 = n = nbits >> kshift; + if (nbits & kmask) + ++n; + for(j = n, k = 0; j >>= 1; ++k); + *bp = b = Balloc(k); + b->wds = n; + for(j = 0; j < n0; ++j) + b->x[j] = ALL_ON; + if (n > n0) + b->x[j] = ULbits >> (ULbits - (nbits & kmask)); + *exp = fpi->emin; + return STRTOG_Normal | STRTOG_Inexlo; + } + /* + * Truncate the hex string if it is longer than the precision needed, + * to avoid denial-of-service issues with very large strings. Use + * additional digits to insure precision. Scan to-be-truncated digits + * and replace with either '1' or '0' to ensure proper rounding. + */ + { + int maxdigits = ((fpi->nbits + 3) >> 2) + 2; + size_t nd = s1 - s0; +#ifdef USE_LOCALE + int dplen = strlen((const char *)decimalpoint); +#else + int dplen = 1; +#endif + + if (decpt && s0 < decpt) + nd -= dplen; + if (nd > maxdigits && (strunc = alloca(maxdigits + dplen + 2)) != NULL) { + ssize_t nd0 = decpt ? decpt - s0 - dplen : nd; + unsigned char *tp = strunc + maxdigits; + int found = 0; + if ((nd0 -= maxdigits) >= 0 || s0 >= decpt) + memcpy(strunc, s0, maxdigits); + else { + memcpy(strunc, s0, maxdigits + dplen); + tp += dplen; + } + s0 += maxdigits; + e += (nd - (maxdigits + 1)) << 2; + if (nd0 > 0) { + while(nd0-- > 0) + if (*s0++ != '0') { + found++; + break; + } + s0 += dplen; + } + if (!found && decpt) { + while(s0 < s1) + if(*s0++ != '0') { + found++; + break; + } + } + *tp++ = found ? '1' : '0'; + *tp = 0; + s0 = strunc; + s1 = tp; + } + } + + n = s1 - s0 - 1; + for(k = 0; n > (1 << (kshift-2)) - 1; n >>= 1) + k++; + b = Balloc(k); + x = b->x; + n = 0; + L = 0; +#ifdef USE_LOCALE + for(i = 0; decimalpoint[i+1]; ++i); +#endif + while(s1 > s0) { +#ifdef USE_LOCALE + if (*--s1 == decimalpoint[i]) { + s1 -= i; + continue; + } +#else + if (*--s1 == '.') + continue; +#endif + if (n == ULbits) { + *x++ = L; + L = 0; + n = 0; + } + L |= (hexdig[*s1] & 0x0f) << n; + n += 4; + } + *x++ = L; + b->wds = n = x - b->x; + n = ULbits*n - hi0bits(L); + nbits = fpi->nbits; + lostbits = 0; + x = b->x; + if (n > nbits) { + n -= nbits; + if (any_on(b,n)) { + lostbits = 1; + k = n - 1; + if (x[k>>kshift] & 1 << (k & kmask)) { + lostbits = 2; + if (k > 0 && any_on(b,k)) + lostbits = 3; + } + } + rshift(b, n); + e += n; + } + else if (n < nbits) { + n = nbits - n; + b = lshift(b, n); + e -= n; + x = b->x; + } + if (e > fpi->emax) { + ovfl: + Bfree(b); + ovfl1: +#ifndef NO_ERRNO + errno = ERANGE; +#endif + return STRTOG_Infinite | STRTOG_Overflow | STRTOG_Inexhi; + } + irv = STRTOG_Normal; + if (e < fpi->emin) { + irv = STRTOG_Denormal; + n = fpi->emin - e; + if (n >= nbits) { + switch (fpi->rounding) { + case FPI_Round_near: + if (n == nbits && (n < 2 || any_on(b,n-1))) + goto one_bit; + break; + case FPI_Round_up: + if (!sign) + goto one_bit; + break; + case FPI_Round_down: + if (sign) { + one_bit: + x[0] = b->wds = 1; + dret: + *bp = b; + *exp = fpi->emin; +#ifndef NO_ERRNO + errno = ERANGE; +#endif + return STRTOG_Denormal | STRTOG_Inexhi + | STRTOG_Underflow; + } + } + Bfree(b); + retz: +#ifndef NO_ERRNO + errno = ERANGE; +#endif + return STRTOG_Zero | STRTOG_Inexlo | STRTOG_Underflow; + } + k = n - 1; + if (lostbits) + lostbits = 1; + else if (k > 0) + lostbits = any_on(b,k); + if (x[k>>kshift] & 1 << (k & kmask)) + lostbits |= 2; + nbits -= n; + rshift(b,n); + e = fpi->emin; + } + if (lostbits) { + up = 0; + switch(fpi->rounding) { + case FPI_Round_zero: + break; + case FPI_Round_near: + if (lostbits & 2 + && (lostbits | x[0]) & 1) + up = 1; + break; + case FPI_Round_up: + up = 1 - sign; + break; + case FPI_Round_down: + up = sign; + } + if (up) { + k = b->wds; + b = increment(b); + x = b->x; + if (irv == STRTOG_Denormal) { + if (nbits == fpi->nbits - 1 + && x[nbits >> kshift] & 1 << (nbits & kmask)) + irv = STRTOG_Normal; + } + else if (b->wds > k + || ((n = nbits & kmask) !=0 + && hi0bits(x[k-1]) < 32-n)) { + rshift(b,1); + if (++e > fpi->emax) + goto ovfl; + } + irv |= STRTOG_Inexhi; + } + else + irv |= STRTOG_Inexlo; + } + *bp = b; + *exp = e; + return irv; + } diff --git a/gdtoa/FreeBSD/gdtoa-gmisc.c b/gdtoa/FreeBSD/gdtoa-gmisc.c new file mode 100644 index 0000000..8270ef9 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-gmisc.c @@ -0,0 +1,86 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + + void +#ifdef KR_headers +rshift(b, k) Bigint *b; int k; +#else +rshift(Bigint *b, int k) +#endif +{ + ULong *x, *x1, *xe, y; + int n; + + x = x1 = b->x; + n = k >> kshift; + if (n < b->wds) { + xe = x + b->wds; + x += n; + if (k &= kmask) { + n = ULbits - k; + y = *x++ >> k; + while(x < xe) { + *x1++ = (y | (*x << n)) & ALL_ON; + y = *x++ >> k; + } + if ((*x1 = y) !=0) + x1++; + } + else + while(x < xe) + *x1++ = *x++; + } + if ((b->wds = x1 - b->x) == 0) + b->x[0] = 0; + } + + int +#ifdef KR_headers +trailz(b) Bigint *b; +#else +trailz(Bigint *b) +#endif +{ + ULong L, *x, *xe; + int n = 0; + + x = b->x; + xe = x + b->wds; + for(n = 0; x < xe && !*x; x++) + n += ULbits; + if (x < xe) { + L = *x; + n += lo0bits(&L); + } + return n; + } diff --git a/gdtoa/FreeBSD/gdtoa-hd_init.c b/gdtoa/FreeBSD/gdtoa-hd_init.c new file mode 100644 index 0000000..96ac734 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-hd_init.c @@ -0,0 +1,76 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 2000 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + +CONST unsigned char hexdig[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0, 0, 0, 0, 0, 0, + 0, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +#ifndef __APPLE__ + static void +#ifdef KR_headers +htinit(h, s, inc) unsigned char *h; unsigned char *s; int inc; +#else +htinit(unsigned char *h, unsigned char *s, int inc) +#endif +{ + int i, j; + for(i = 0; (j = s[i]) !=0; i++) + h[j] = i + inc; + } + + void +hexdig_init_D2A(Void) +{ +#define USC (unsigned char *) + htinit(hexdig, USC "0123456789", 0x10); + htinit(hexdig, USC "abcdef", 0x10 + 10); + htinit(hexdig, USC "ABCDEF", 0x10 + 10); + } +#else +void hexdig_init_D2A(void) {} +#endif diff --git a/gdtoa/FreeBSD/gdtoa-hexnan.c b/gdtoa/FreeBSD/gdtoa-hexnan.c new file mode 100644 index 0000000..4de2605 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-hexnan.c @@ -0,0 +1,209 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 2000 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" +#include + +#ifndef __APPLE__ + static void +#ifdef KR_headers +L_shift(x, x1, i) ULong *x; ULong *x1; int i; +#else +L_shift(ULong *x, ULong *x1, int i) +#endif +{ + int j; + + i = 8 - i; + i <<= 2; + j = ULbits - i; + do { + *x |= x[1] << j; + x[1] >>= i; + } while(++x < x1); + } +#endif /* !__APPLE__ */ + + int +#ifdef KR_headers +hexnan(sp, fpi, x0) + CONST char **sp; CONST FPI *fpi; ULong *x0; +#else +hexnan( CONST char **sp, CONST FPI *fpi, ULong *x0) +#endif +{ +#ifdef __APPLE__ + int nbits, len; + char *cp; +#else /* !__APPLE__ */ + ULong c, h, *x, *x1, *xe; +#endif /* __APPLE__ */ + CONST char *s; +#ifndef __APPLE__ + int havedig, hd0, i, nbits; +#endif /* !__APPLE__ */ + +#ifdef __APPLE__ + if (sp == NULL || *sp == NULL || **sp != '(') + return STRTOG_NaN; +#else /* !__APPLE__ */ + if (!hexdig['0']) + hexdig_init_D2A(); + nbits = fpi->nbits; + x = x0 + (nbits >> kshift); + if (nbits & kmask) + x++; + *--x = 0; + x1 = xe = x; + havedig = hd0 = i = 0; +#endif /* __APPLE__ */ + s = *sp; +#ifdef __APPLE__ + if ((cp = strchr(s + 1, ')')) == NULL) { + return STRTOG_NaN; + } + else { + len = cp - (s + 1); + cp = alloca(len + 1); + if (!cp) +#else /* !__APPLE__ */ + /* allow optional initial 0x or 0X */ + while((c = *(CONST unsigned char*)(s+1)) && c <= ' ') + ++s; + if (s[1] == '0' && (s[2] == 'x' || s[2] == 'X') + && *(CONST unsigned char*)(s+3) > ' ') + s += 2; + while((c = *(CONST unsigned char*)++s)) { + if (!(h = hexdig[c])) { + if (c <= ' ') { + if (hd0 < havedig) { + if (x < x1 && i < 8) + L_shift(x, x1, i); + if (x <= x0) { + i = 8; + continue; + } + hd0 = havedig; + *--x = 0; + x1 = x; + i = 0; + } + while(*(CONST unsigned char*)(s+1) <= ' ') + ++s; + if (s[1] == '0' && (s[2] == 'x' || s[2] == 'X') + && *(CONST unsigned char*)(s+3) > ' ') + s += 2; + continue; + } + if (/*(*/ c == ')' && havedig) { + *sp = s + 1; + break; + } +#ifndef GDTOA_NON_PEDANTIC_NANCHECK + do { + if (/*(*/ c == ')') { + *sp = s + 1; + break; + } + } while((c = *++s)); +#endif +#endif /* __APPLE__ */ + return STRTOG_NaN; +#ifdef __APPLE__ + strlcpy(cp, s + 1, len + 1); + *sp += len + 2; +#else /* !__APPLE__ */ + } + havedig++; + if (++i > 8) { + if (x <= x0) + continue; + i = 1; + *--x = 0; + } + *x = (*x << 4) | (h & 0xf); +#endif /* __APPLE__ */ + } +#ifdef __APPLE__ + nbits = fpi->nbits; + /* a hack */ + if (nbits == 52) { /* double */ + union IEEEd2bits u; + u.d = nan(cp); + x0[1] = u.bits.manh; + x0[0] = u.bits.manl; +#else /* !__APPLE__ */ + if (!havedig) + return STRTOG_NaN; + if (x < x1 && i < 8) + L_shift(x, x1, i); + if (x > x0) { + x1 = x0; + do *x1++ = *x++; + while(x <= xe); + do *x1++ = 0; + while(x1 <= xe); +#endif /* __APPLE__ */ + } +#ifdef __APPLE__ + else if (nbits < 52) { /* float */ + union IEEEf2bits u; + u.f = nanf(cp); + x0[0] = u.bits.man; +#else /* !__APPLE__ */ + else { + /* truncate high-order word if necessary */ + if ( (i = nbits & (ULbits-1)) !=0) + *xe &= ((ULong)0xffffffff) >> (ULbits - i); +#endif /* __APPLE__ */ + } +#ifdef __APPLE__ + else { /* long double */ + union IEEEl2bits u; + u.e = nanl(cp); +#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__arm64__) + x0[1] = (ULong)u.bits.manh; + x0[0] = (ULong)u.bits.manl; +#else +#error unsupported architecture +#endif +#else /* !__APPLE__ */ + for(x1 = xe;; --x1) { + if (*x1 != 0) + break; + if (x1 == x0) { + *x1 = 1; + break; + } +#endif /* __APPLE__ */ + } + return STRTOG_NaNbits; + } diff --git a/gdtoa/FreeBSD/gdtoa-misc.c b/gdtoa/FreeBSD/gdtoa-misc.c new file mode 100644 index 0000000..03eccdf --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-misc.c @@ -0,0 +1,933 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 1999 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#define GDTOA_TSD +#define Omit_Private_Memory + +#ifdef GDTOA_TSD +#include +#endif /* GDTOA_TSD */ +#include "gdtoaimp.h" + +#ifdef GDTOA_TSD +static pthread_key_t gdtoa_tsd_key = (pthread_key_t)-1; +static pthread_mutex_t gdtoa_tsd_lock = PTHREAD_MUTEX_INITIALIZER; +#else /* !GDTOA_TSD */ + static Bigint *freelist[Kmax+1]; +#endif /* GDTOA_TSD */ +#ifndef Omit_Private_Memory +#ifndef PRIVATE_MEM +#define PRIVATE_MEM 2304 +#endif +#define PRIVATE_mem ((PRIVATE_MEM+sizeof(double)-1)/sizeof(double)) +static double private_mem[PRIVATE_mem], *pmem_next = private_mem; +#endif + +#ifdef GDTOA_TSD +static void +gdtoa_freelist_free(void *x) +{ + int i; + Bigint *cur, *next; + Bigint **fl = (Bigint **)x; + + if (!fl) return; + for(i = 0; i < Kmax+1; fl++, i++) { + if (!*fl) continue; + for(cur = *fl; cur; cur = next) { + next = cur->next; + free(cur); + } + } + free(x); + } +#endif /* GDTOA_TSD */ + + Bigint * +Balloc +#ifdef KR_headers + (k) int k; +#else + (int k) +#endif +{ + int x; + Bigint *rv; +#ifndef Omit_Private_Memory + unsigned int len; +#endif +#ifdef GDTOA_TSD + Bigint **freelist; + +#if !defined(DARLING) || !defined(VARIANT_DYLD) + if (gdtoa_tsd_key == (pthread_key_t)-1) { + pthread_mutex_lock(&gdtoa_tsd_lock); + if (gdtoa_tsd_key == (pthread_key_t)-1) { + gdtoa_tsd_key = __LIBC_PTHREAD_KEY_GDTOA_BIGINT; + pthread_key_init_np(gdtoa_tsd_key, gdtoa_freelist_free); + } + pthread_mutex_unlock(&gdtoa_tsd_lock); + } +#endif + if ((freelist = (Bigint **)pthread_getspecific(gdtoa_tsd_key)) == NULL) { + freelist = (Bigint **)MALLOC((Kmax+1) * sizeof(Bigint *)); + bzero(freelist, (Kmax+1) * sizeof(Bigint *)); + pthread_setspecific(gdtoa_tsd_key, freelist); + } +#else /* !GDTOA_TSD */ + ACQUIRE_DTOA_LOCK(0); +#endif /* GDTOA_TSD */ + /* The k > Kmax case does not need ACQUIRE_DTOA_LOCK(0), */ + /* but this case seems very unlikely. */ + if (k <= Kmax && (rv = freelist[k]) !=0) { + freelist[k] = rv->next; + } + else { + x = 1 << k; +#ifdef Omit_Private_Memory + rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(ULong)); +#else + len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1) + /sizeof(double); + if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) { + rv = (Bigint*)pmem_next; + pmem_next += len; + } + else + rv = (Bigint*)MALLOC(len*sizeof(double)); +#endif + rv->k = k; + rv->maxwds = x; + } +#ifndef GDTOA_TSD + FREE_DTOA_LOCK(0); +#endif /* GDTOA_TSD */ + rv->sign = rv->wds = 0; + return rv; + } + + void +Bfree +#ifdef KR_headers + (v) Bigint *v; +#else + (Bigint *v) +#endif +{ + if (v) { + if (v->k > Kmax) +#ifdef FREE + FREE((void*)v); +#else + free((void*)v); +#endif + else { +#ifdef GDTOA_TSD + Bigint **freelist = (Bigint **)pthread_getspecific(gdtoa_tsd_key); +#else /* !GDTOA_TSD */ + ACQUIRE_DTOA_LOCK(0); +#endif /* !GDTOA_TSD */ + v->next = freelist[v->k]; + freelist[v->k] = v; +#ifndef GDTOA_TSD + FREE_DTOA_LOCK(0); +#endif /* !GDTOA_TSD */ + } + } + } + + int +lo0bits +#ifdef KR_headers + (y) ULong *y; +#else + (ULong *y) +#endif +{ + int k; + ULong x = *y; + + if (x & 7) { + if (x & 1) + return 0; + if (x & 2) { + *y = x >> 1; + return 1; + } + *y = x >> 2; + return 2; + } + k = 0; + if (!(x & 0xffff)) { + k = 16; + x >>= 16; + } + if (!(x & 0xff)) { + k += 8; + x >>= 8; + } + if (!(x & 0xf)) { + k += 4; + x >>= 4; + } + if (!(x & 0x3)) { + k += 2; + x >>= 2; + } + if (!(x & 1)) { + k++; + x >>= 1; + if (!x) + return 32; + } + *y = x; + return k; + } + + Bigint * +multadd +#ifdef KR_headers + (b, m, a) Bigint *b; int m, a; +#else + (Bigint *b, int m, int a) /* multiply by m and add a */ +#endif +{ + int i, wds; +#ifdef ULLong + ULong *x; + ULLong carry, y; +#else + ULong carry, *x, y; +#ifdef Pack_32 + ULong xi, z; +#endif +#endif + Bigint *b1; + + wds = b->wds; + x = b->x; + i = 0; + carry = a; + do { +#ifdef ULLong + y = *x * (ULLong)m + carry; + carry = y >> 32; + *x++ = y & 0xffffffffUL; +#else +#ifdef Pack_32 + xi = *x; + y = (xi & 0xffff) * m + carry; + z = (xi >> 16) * m + (y >> 16); + carry = z >> 16; + *x++ = (z << 16) + (y & 0xffff); +#else + y = *x * m + carry; + carry = y >> 16; + *x++ = y & 0xffff; +#endif +#endif + } + while(++i < wds); + if (carry) { + if (wds >= b->maxwds) { + b1 = Balloc(b->k+1); + Bcopy(b1, b); + Bfree(b); + b = b1; + } + b->x[wds++] = carry; + b->wds = wds; + } + return b; + } + + int +hi0bits_D2A +#ifdef KR_headers + (x) ULong x; +#else + (ULong x) +#endif +{ + int k = 0; + + if (!(x & 0xffff0000)) { + k = 16; + x <<= 16; + } + if (!(x & 0xff000000)) { + k += 8; + x <<= 8; + } + if (!(x & 0xf0000000)) { + k += 4; + x <<= 4; + } + if (!(x & 0xc0000000)) { + k += 2; + x <<= 2; + } + if (!(x & 0x80000000)) { + k++; + if (!(x & 0x40000000)) + return 32; + } + return k; + } + + Bigint * +i2b +#ifdef KR_headers + (i) int i; +#else + (int i) +#endif +{ + Bigint *b; + + b = Balloc(1); + b->x[0] = i; + b->wds = 1; + return b; + } + + Bigint * +mult +#ifdef KR_headers + (a, b) Bigint *a, *b; +#else + (Bigint *a, Bigint *b) +#endif +{ + Bigint *c; + int k, wa, wb, wc; + ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; + ULong y; +#ifdef ULLong + ULLong carry, z; +#else + ULong carry, z; +#ifdef Pack_32 + ULong z2; +#endif +#endif + + if (a->wds < b->wds) { + c = a; + a = b; + b = c; + } + k = a->k; + wa = a->wds; + wb = b->wds; + wc = wa + wb; + if (wc > a->maxwds) + k++; + c = Balloc(k); + for(x = c->x, xa = x + wc; x < xa; x++) + *x = 0; + xa = a->x; + xae = xa + wa; + xb = b->x; + xbe = xb + wb; + xc0 = c->x; +#ifdef ULLong + for(; xb < xbe; xc0++) { + if ( (y = *xb++) !=0) { + x = xa; + xc = xc0; + carry = 0; + do { + z = *x++ * (ULLong)y + *xc + carry; + carry = z >> 32; + *xc++ = z & 0xffffffffUL; + } + while(x < xae); + *xc = carry; + } + } +#else +#ifdef Pack_32 + for(; xb < xbe; xb++, xc0++) { + if ( (y = *xb & 0xffff) !=0) { + x = xa; + xc = xc0; + carry = 0; + do { + z = (*x & 0xffff) * y + (*xc & 0xffff) + carry; + carry = z >> 16; + z2 = (*x++ >> 16) * y + (*xc >> 16) + carry; + carry = z2 >> 16; + Storeinc(xc, z2, z); + } + while(x < xae); + *xc = carry; + } + if ( (y = *xb >> 16) !=0) { + x = xa; + xc = xc0; + carry = 0; + z2 = *xc; + do { + z = (*x & 0xffff) * y + (*xc >> 16) + carry; + carry = z >> 16; + Storeinc(xc, z, z2); + z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry; + carry = z2 >> 16; + } + while(x < xae); + *xc = z2; + } + } +#else + for(; xb < xbe; xc0++) { + if ( (y = *xb++) !=0) { + x = xa; + xc = xc0; + carry = 0; + do { + z = *x++ * y + *xc + carry; + carry = z >> 16; + *xc++ = z & 0xffff; + } + while(x < xae); + *xc = carry; + } + } +#endif +#endif + for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ; + c->wds = wc; + return c; + } + + static Bigint *p5s; + + Bigint * +pow5mult +#ifdef KR_headers + (b, k) Bigint *b; int k; +#else + (Bigint *b, int k) +#endif +{ + Bigint *b1, *p5, *p51; + int i; + static int p05[3] = { 5, 25, 125 }; + + if ( (i = k & 3) !=0) + b = multadd(b, p05[i-1], 0); + + if (!(k >>= 2)) + return b; + if ((p5 = p5s) == 0) { + /* first time */ +#ifdef MULTIPLE_THREADS + ACQUIRE_DTOA_LOCK(1); + if (!(p5 = p5s)) { + p5 = p5s = i2b(625); + p5->next = 0; + } + FREE_DTOA_LOCK(1); +#else + p5 = p5s = i2b(625); + p5->next = 0; +#endif + } + for(;;) { + if (k & 1) { + b1 = mult(b, p5); + Bfree(b); + b = b1; + } + if (!(k >>= 1)) + break; + if ((p51 = p5->next) == 0) { +#ifdef MULTIPLE_THREADS + ACQUIRE_DTOA_LOCK(1); + if (!(p51 = p5->next)) { + p51 = p5->next = mult(p5,p5); + p51->next = 0; + } + FREE_DTOA_LOCK(1); +#else + p51 = p5->next = mult(p5,p5); + p51->next = 0; +#endif + } + p5 = p51; + } + return b; + } + + Bigint * +lshift +#ifdef KR_headers + (b, k) Bigint *b; int k; +#else + (Bigint *b, int k) +#endif +{ + int i, k1, n, n1; + Bigint *b1; + ULong *x, *x1, *xe, z; + + n = k >> kshift; + k1 = b->k; + n1 = n + b->wds + 1; + for(i = b->maxwds; n1 > i; i <<= 1) + k1++; + b1 = Balloc(k1); + x1 = b1->x; + for(i = 0; i < n; i++) + *x1++ = 0; + x = b->x; + xe = x + b->wds; + if (k &= kmask) { +#ifdef Pack_32 + k1 = 32 - k; + z = 0; + do { + *x1++ = *x << k | z; + z = *x++ >> k1; + } + while(x < xe); + if ((*x1 = z) !=0) + ++n1; +#else + k1 = 16 - k; + z = 0; + do { + *x1++ = *x << k & 0xffff | z; + z = *x++ >> k1; + } + while(x < xe); + if (*x1 = z) + ++n1; +#endif + } + else do + *x1++ = *x++; + while(x < xe); + b1->wds = n1 - 1; + Bfree(b); + return b1; + } + + int +cmp +#ifdef KR_headers + (a, b) Bigint *a, *b; +#else + (Bigint *a, Bigint *b) +#endif +{ + ULong *xa, *xa0, *xb, *xb0; + int i, j; + + i = a->wds; + j = b->wds; +#ifdef DEBUG + if (i > 1 && !a->x[i-1]) + Bug("cmp called with a->x[a->wds-1] == 0"); + if (j > 1 && !b->x[j-1]) + Bug("cmp called with b->x[b->wds-1] == 0"); +#endif + if (i -= j) + return i; + xa0 = a->x; + xa = xa0 + j; + xb0 = b->x; + xb = xb0 + j; + for(;;) { + if (*--xa != *--xb) + return *xa < *xb ? -1 : 1; + if (xa <= xa0) + break; + } + return 0; + } + + Bigint * +diff +#ifdef KR_headers + (a, b) Bigint *a, *b; +#else + (Bigint *a, Bigint *b) +#endif +{ + Bigint *c; + int i, wa, wb; + ULong *xa, *xae, *xb, *xbe, *xc; +#ifdef ULLong + ULLong borrow, y; +#else + ULong borrow, y; +#ifdef Pack_32 + ULong z; +#endif +#endif + + i = cmp(a,b); + if (!i) { + c = Balloc(0); + c->wds = 1; + c->x[0] = 0; + return c; + } + if (i < 0) { + c = a; + a = b; + b = c; + i = 1; + } + else + i = 0; + c = Balloc(a->k); + c->sign = i; + wa = a->wds; + xa = a->x; + xae = xa + wa; + wb = b->wds; + xb = b->x; + xbe = xb + wb; + xc = c->x; + borrow = 0; +#ifdef ULLong + do { + y = (ULLong)*xa++ - *xb++ - borrow; + borrow = y >> 32 & 1UL; + *xc++ = y & 0xffffffffUL; + } + while(xb < xbe); + while(xa < xae) { + y = *xa++ - borrow; + borrow = y >> 32 & 1UL; + *xc++ = y & 0xffffffffUL; + } +#else +#ifdef Pack_32 + do { + y = (*xa & 0xffff) - (*xb & 0xffff) - borrow; + borrow = (y & 0x10000) >> 16; + z = (*xa++ >> 16) - (*xb++ >> 16) - borrow; + borrow = (z & 0x10000) >> 16; + Storeinc(xc, z, y); + } + while(xb < xbe); + while(xa < xae) { + y = (*xa & 0xffff) - borrow; + borrow = (y & 0x10000) >> 16; + z = (*xa++ >> 16) - borrow; + borrow = (z & 0x10000) >> 16; + Storeinc(xc, z, y); + } +#else + do { + y = *xa++ - *xb++ - borrow; + borrow = (y & 0x10000) >> 16; + *xc++ = y & 0xffff; + } + while(xb < xbe); + while(xa < xae) { + y = *xa++ - borrow; + borrow = (y & 0x10000) >> 16; + *xc++ = y & 0xffff; + } +#endif +#endif + while(!*--xc) + wa--; + c->wds = wa; + return c; + } + + double +b2d +#ifdef KR_headers + (a, e) Bigint *a; int *e; +#else + (Bigint *a, int *e) +#endif +{ + ULong *xa, *xa0, w, y, z; + int k; + U d; +#ifdef VAX + ULong d0, d1; +#else +#define d0 word0(&d) +#define d1 word1(&d) +#endif + + xa0 = a->x; + xa = xa0 + a->wds; + y = *--xa; +#ifdef DEBUG + if (!y) Bug("zero y in b2d"); +#endif + k = hi0bits(y); + *e = 32 - k; +#ifdef Pack_32 + if (k < Ebits) { + d0 = Exp_1 | y >> (Ebits - k); + w = xa > xa0 ? *--xa : 0; + d1 = y << ((32-Ebits) + k) | w >> (Ebits - k); + goto ret_d; + } + z = xa > xa0 ? *--xa : 0; + if (k -= Ebits) { + d0 = Exp_1 | y << k | z >> (32 - k); + y = xa > xa0 ? *--xa : 0; + d1 = z << k | y >> (32 - k); + } + else { + d0 = Exp_1 | y; + d1 = z; + } +#else + if (k < Ebits + 16) { + z = xa > xa0 ? *--xa : 0; + d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k; + w = xa > xa0 ? *--xa : 0; + y = xa > xa0 ? *--xa : 0; + d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k; + goto ret_d; + } + z = xa > xa0 ? *--xa : 0; + w = xa > xa0 ? *--xa : 0; + k -= Ebits + 16; + d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k; + y = xa > xa0 ? *--xa : 0; + d1 = w << k + 16 | y << k; +#endif + ret_d: +#ifdef VAX + word0(&d) = d0 >> 16 | d0 << 16; + word1(&d) = d1 >> 16 | d1 << 16; +#endif + return dval(&d); + } +#undef d0 +#undef d1 + + Bigint * +d2b +#ifdef KR_headers + (dd, e, bits) double dd; int *e, *bits; +#else + (double dd, int *e, int *bits) +#endif +{ + Bigint *b; + U d; +#ifndef Sudden_Underflow + int i; +#endif + int de, k; + ULong *x, y, z; +#ifdef VAX + ULong d0, d1; +#else +#define d0 word0(&d) +#define d1 word1(&d) +#endif + d.d = dd; +#ifdef VAX + d0 = word0(&d) >> 16 | word0(&d) << 16; + d1 = word1(&d) >> 16 | word1(&d) << 16; +#endif + +#ifdef Pack_32 + b = Balloc(1); +#else + b = Balloc(2); +#endif + x = b->x; + + z = d0 & Frac_mask; + d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ +#ifdef Sudden_Underflow + de = (int)(d0 >> Exp_shift); +#ifndef IBM + z |= Exp_msk11; +#endif +#else + if ( (de = (int)(d0 >> Exp_shift)) !=0) + z |= Exp_msk1; +#endif +#ifdef Pack_32 + if ( (y = d1) !=0) { + if ( (k = lo0bits(&y)) !=0) { + x[0] = y | z << (32 - k); + z >>= k; + } + else + x[0] = y; +#ifndef Sudden_Underflow + i = +#endif + b->wds = (x[1] = z) !=0 ? 2 : 1; + } + else { + k = lo0bits(&z); + x[0] = z; +#ifndef Sudden_Underflow + i = +#endif + b->wds = 1; + k += 32; + } +#else + if ( (y = d1) !=0) { + if ( (k = lo0bits(&y)) !=0) + if (k >= 16) { + x[0] = y | z << 32 - k & 0xffff; + x[1] = z >> k - 16 & 0xffff; + x[2] = z >> k; + i = 2; + } + else { + x[0] = y & 0xffff; + x[1] = y >> 16 | z << 16 - k & 0xffff; + x[2] = z >> k & 0xffff; + x[3] = z >> k+16; + i = 3; + } + else { + x[0] = y & 0xffff; + x[1] = y >> 16; + x[2] = z & 0xffff; + x[3] = z >> 16; + i = 3; + } + } + else { +#ifdef DEBUG + if (!z) + Bug("Zero passed to d2b"); +#endif + k = lo0bits(&z); + if (k >= 16) { + x[0] = z; + i = 0; + } + else { + x[0] = z & 0xffff; + x[1] = z >> 16; + i = 1; + } + k += 32; + } + while(!x[i]) + --i; + b->wds = i + 1; +#endif +#ifndef Sudden_Underflow + if (de) { +#endif +#ifdef IBM + *e = (de - Bias - (P-1) << 2) + k; + *bits = 4*P + 8 - k - hi0bits(word0(&d) & Frac_mask); +#else + *e = de - Bias - (P-1) + k; + *bits = P - k; +#endif +#ifndef Sudden_Underflow + } + else { + *e = de - Bias - (P-1) + 1 + k; +#ifdef Pack_32 + *bits = 32*i - hi0bits(x[i-1]); +#else + *bits = (i+2)*16 - hi0bits(x[i]); +#endif + } +#endif + return b; + } +#undef d0 +#undef d1 + + CONST double +#ifdef IEEE_Arith +bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 }; +CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 + }; +#else +#ifdef IBM +bigtens[] = { 1e16, 1e32, 1e64 }; +CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 }; +#else +bigtens[] = { 1e16, 1e32 }; +CONST double tinytens[] = { 1e-16, 1e-32 }; +#endif +#endif + + CONST double +tens[] = { + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, + 1e20, 1e21, 1e22 +#ifdef VAX + , 1e23, 1e24 +#endif + }; + + char * +#ifdef KR_headers +strcp_D2A(a, b) char *a; char *b; +#else +strcp_D2A(char *a, CONST char *b) +#endif +{ + while((*a = *b++)) + a++; + return a; + } + +#ifdef NO_STRING_H + + Char * +#ifdef KR_headers +memcpy_D2A(a, b, len) Char *a; Char *b; size_t len; +#else +memcpy_D2A(void *a1, void *b1, size_t len) +#endif +{ + char *a = (char*)a1, *ae = a + len; + char *b = (char*)b1, *a0 = a; + while(a < ae) + *a++ = *b++; + return a0; + } + +#endif /* NO_STRING_H */ diff --git a/gdtoa/FreeBSD/gdtoa-smisc.c b/gdtoa/FreeBSD/gdtoa-smisc.c new file mode 100644 index 0000000..f4dbafb --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-smisc.c @@ -0,0 +1,191 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 1999 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + + Bigint * +s2b +#ifdef KR_headers + (s, nd0, nd, y9, dplen) CONST char *s; int dplen, nd0, nd; ULong y9; +#else + (CONST char *s, int nd0, int nd, ULong y9, int dplen) +#endif +{ + Bigint *b; + int i, k; + Long x, y; + + x = (nd + 8) / 9; + for(k = 0, y = 1; x > y; y <<= 1, k++) ; +#ifdef Pack_32 + b = Balloc(k); + b->x[0] = y9; + b->wds = 1; +#else + b = Balloc(k+1); + b->x[0] = y9 & 0xffff; + b->wds = (b->x[1] = y9 >> 16) ? 2 : 1; +#endif + + i = 9; + if (9 < nd0) { + s += 9; + do b = multadd(b, 10, *s++ - '0'); + while(++i < nd0); + s += dplen; + } + else + s += dplen + 9; + for(; i < nd; i++) + b = multadd(b, 10, *s++ - '0'); + return b; + } + + double +ratio +#ifdef KR_headers + (a, b) Bigint *a, *b; +#else + (Bigint *a, Bigint *b) +#endif +{ + U da, db; + int k, ka, kb; + + dval(&da) = b2d(a, &ka); + dval(&db) = b2d(b, &kb); + k = ka - kb + ULbits*(a->wds - b->wds); +#ifdef IBM + if (k > 0) { + word0(&da) += (k >> 2)*Exp_msk1; + if (k &= 3) + dval(&da) *= 1 << k; + } + else { + k = -k; + word0(&db) += (k >> 2)*Exp_msk1; + if (k &= 3) + dval(&db) *= 1 << k; + } +#else + if (k > 0) + word0(&da) += k*Exp_msk1; + else { + k = -k; + word0(&db) += k*Exp_msk1; + } +#endif + return dval(&da) / dval(&db); + } + +#ifdef INFNAN_CHECK + + int +match +#ifdef KR_headers + (sp, t) char **sp, *t; +#else + (CONST char **sp, char *t) +#endif +{ + int c, d; + CONST char *s = *sp; + + while( (d = *t++) !=0) { + if ((c = *++s) >= 'A' && c <= 'Z') + c += 'a' - 'A'; + if (c != d) + return 0; + } + *sp = s + 1; + return 1; + } +#endif /* INFNAN_CHECK */ + + void +#ifdef KR_headers +copybits(c, n, b) ULong *c; int n; Bigint *b; +#else +copybits(ULong *c, int n, Bigint *b) +#endif +{ + ULong *ce, *x, *xe; +#ifdef Pack_16 + int nw, nw1; +#endif + + ce = c + ((n-1) >> kshift) + 1; + x = b->x; +#ifdef Pack_32 + xe = x + b->wds; + while(x < xe) + *c++ = *x++; +#else + nw = b->wds; + nw1 = nw & 1; + for(xe = x + (nw - nw1); x < xe; x += 2) + Storeinc(c, x[1], x[0]); + if (nw1) + *c++ = *x; +#endif + while(c < ce) + *c++ = 0; + } + + ULong +#ifdef KR_headers +any_on(b, k) Bigint *b; int k; +#else +any_on(Bigint *b, int k) +#endif +{ + int n, nwds; + ULong *x, *x0, x1, x2; + + x = b->x; + nwds = b->wds; + n = k >> kshift; + if (n > nwds) + n = nwds; + else if (n < nwds && (k &= kmask)) { + x1 = x2 = x[n]; + x1 >>= k; + x1 <<= k; + if (x1 != x2) + return 1; + } + x0 = x; + x += n; + while(x > x0) + if (*--x) + return 1; + return 0; + } diff --git a/gdtoa/FreeBSD/gdtoa-strtoIg.c b/gdtoa/FreeBSD/gdtoa-strtoIg.c new file mode 100644 index 0000000..6a17760 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-strtoIg.c @@ -0,0 +1,137 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + + int +#ifdef KR_headers +strtoIg(s00, se, fpi, exp, B, rvp) CONST char *s00; char **se; FPI *fpi; Long *exp; Bigint **B; int *rvp; +#else +strtoIg(CONST char *s00, char **se, FPI *fpi, Long *exp, Bigint **B, int *rvp) +#endif +{ + Bigint *b, *b1; + int i, nb, nw, nw1, rv, rv1, swap; + unsigned int nb1, nb11; + Long e1; + + b = *B; + rv = strtodg(s00, se, fpi, exp, b->x); + if (!(rv & STRTOG_Inexact)) { + B[1] = 0; + return *rvp = rv; + } + e1 = exp[0]; + rv1 = rv ^ STRTOG_Inexact; + b1 = Balloc(b->k); + Bcopy(b1, b); + nb = fpi->nbits; + nb1 = nb & 31; + nb11 = (nb1 - 1) & 31; + nw = b->wds; + nw1 = nw - 1; + if (rv & STRTOG_Inexlo) { + swap = 0; + b1 = increment(b1); + if ((rv & STRTOG_Retmask) == STRTOG_Zero) { + if (fpi->sudden_underflow) { + b1->x[0] = 0; + b1->x[nw1] = 1L << nb11; + rv1 += STRTOG_Normal - STRTOG_Zero; + rv1 &= ~STRTOG_Underflow; + goto swapcheck; + } + rv1 &= STRTOG_Inexlo | STRTOG_Underflow | STRTOG_Zero; + rv1 |= STRTOG_Inexhi | STRTOG_Denormal; + goto swapcheck; + } + if (b1->wds > nw + || (nb1 && b1->x[nw1] & 1L << nb1)) { + if (++e1 > fpi->emax) + rv1 = STRTOG_Infinite | STRTOG_Inexhi; + rshift(b1, 1); + } + else if ((rv & STRTOG_Retmask) == STRTOG_Denormal) { + if (b1->x[nw1] & 1L << nb11) { + rv1 += STRTOG_Normal - STRTOG_Denormal; + rv1 &= ~STRTOG_Underflow; + } + } + } + else { + swap = STRTOG_Neg; + if ((rv & STRTOG_Retmask) == STRTOG_Infinite) { + b1 = set_ones(b1, nb); + e1 = fpi->emax; + rv1 = STRTOG_Normal | STRTOG_Inexlo; + goto swapcheck; + } + decrement(b1); + if ((rv & STRTOG_Retmask) == STRTOG_Denormal) { + for(i = nw1; !b1->x[i]; --i) + if (!i) { + rv1 = STRTOG_Zero | STRTOG_Inexlo; + break; + } + goto swapcheck; + } + if (!(b1->x[nw1] & 1L << nb11)) { + if (e1 == fpi->emin) { + if (fpi->sudden_underflow) + rv1 += STRTOG_Zero - STRTOG_Normal; + else + rv1 += STRTOG_Denormal - STRTOG_Normal; + rv1 |= STRTOG_Underflow; + } + else { + b1 = lshift(b1, 1); + b1->x[0] |= 1; + --e1; + } + } + } + swapcheck: + if (swap ^ (rv & STRTOG_Neg)) { + rvp[0] = rv1; + rvp[1] = rv; + B[0] = b1; + B[1] = b; + exp[1] = exp[0]; + exp[0] = e1; + } + else { + rvp[0] = rv; + rvp[1] = rv1; + B[1] = b1; + exp[1] = e1; + } + return rv; + } diff --git a/gdtoa/FreeBSD/gdtoa-strtod.c b/gdtoa/FreeBSD/gdtoa-strtod.c new file mode 100644 index 0000000..265a564 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-strtod.c @@ -0,0 +1,1044 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "xlocale_private.h" + +#include "gdtoaimp.h" +#ifndef NO_FENV_H +#include +#endif + +#ifdef USE_LOCALE +#include "locale.h" +#endif + +#ifdef IEEE_Arith +#ifndef NO_IEEE_Scale +#define Avoid_Underflow +#undef tinytens +/* The factor of 2^106 in tinytens[4] helps us avoid setting the underflow */ +/* flag unnecessarily. It leads to a song and dance at the end of strtod. */ +static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, + 9007199254740992.*9007199254740992.e-256 + }; +#endif +#endif + +#ifdef Honor_FLT_ROUNDS +#undef Check_FLT_ROUNDS +#define Check_FLT_ROUNDS +#else +#define Rounding Flt_Rounds +#endif + + double +strtod_l +#ifdef KR_headers + (s00, se, loc) CONST char *s00; char **se; locale_t loc; +#else + (CONST char *s00, char **se, locale_t loc) +#endif +{ +#ifdef Avoid_Underflow + int scale; +#endif + int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, decpt, dsign, + e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; + CONST char *s, *s0, *s1; + char *strunc = NULL; + double aadj; + Long L; + U adj, aadj1, rv, rv0; + ULong y, z; + Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; +#ifdef SET_INEXACT + int inexact, oldinexact; +#endif +#ifdef USE_LOCALE /*{{*/ + NORMALIZE_LOCALE(loc); +#ifdef NO_LOCALE_CACHE + char *decimalpoint = localeconv_l(loc)->decimal_point; + int dplen = strlen(decimalpoint); +#else + char *decimalpoint; + static char *decimalpoint_cache; + static int dplen; + if (!(s0 = decimalpoint_cache)) { + s0 = localeconv_l(loc)->decimal_point; + if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) { + strcpy(decimalpoint_cache, s0); + s0 = decimalpoint_cache; + } + dplen = strlen(s0); + } + decimalpoint = (char*)s0; +#endif /*NO_LOCALE_CACHE*/ +#else /*USE_LOCALE}{*/ +#define dplen 1 +#endif /*USE_LOCALE}}*/ + +#ifdef Honor_FLT_ROUNDS /*{*/ + int Rounding; +#ifdef Trust_FLT_ROUNDS /*{{ only define this if FLT_ROUNDS really works! */ + Rounding = Flt_Rounds; +#else /*}{*/ + Rounding = 1; + switch(fegetround()) { + case FE_TOWARDZERO: Rounding = 0; break; + case FE_UPWARD: Rounding = 2; break; + case FE_DOWNWARD: Rounding = 3; + } +#endif /*}}*/ +#endif /*}*/ + + sign = nz0 = nz = decpt = 0; + dval(&rv) = 0.; + for(s = s00;;s++) switch(*s) { + case '-': + sign = 1; + /* no break */ + case '+': + if (*++s) + goto break2; + /* no break */ + case 0: + goto ret0; + case '\t': + case '\n': + case '\v': + case '\f': + case '\r': + case ' ': + continue; + default: + goto break2; + } + break2: + if (*s == '0') { +#ifndef NO_HEX_FP /*{*/ + { + static CONST FPI fpi = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI }; + Long exp; + ULong bits[2]; + switch(s[1]) { + case 'x': + case 'X': + { +#ifdef Honor_FLT_ROUNDS + FPI fpi1 = fpi; + fpi1.rounding = Rounding; +#else +#define fpi1 fpi +#endif + switch((i = gethex(&s, &fpi1, &exp, &bb, sign, loc)) & STRTOG_Retmask) { + case STRTOG_NoNumber: + s = s00; + sign = 0; + case STRTOG_Zero: + break; + default: + if (bb) { + copybits(bits, fpi.nbits, bb); + Bfree(bb); + } + ULtod(((U*)&rv)->L, bits, exp, i); + }} + goto ret; + } + } +#endif /*}*/ + nz0 = 1; + while(*++s == '0') ; + if (!*s) + goto ret; + } + s0 = s; + y = z = 0; + for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) + if (nd < 9) + y = 10*y + c - '0'; + else if (nd < 16) + z = 10*z + c - '0'; + nd0 = nd; +#ifdef USE_LOCALE + if (c == *decimalpoint) { + for(i = 1; decimalpoint[i]; ++i) + if (s[i] != decimalpoint[i]) + goto dig_done; + s += i; + c = *s; +#else + if (c == '.') { + c = *++s; +#endif + decpt = 1; + if (!nd) { + for(; c == '0'; c = *++s) + nz++; + if (c > '0' && c <= '9') { + s0 = s; + nf += nz; + nz = 0; + goto have_dig; + } + goto dig_done; + } + for(; c >= '0' && c <= '9'; c = *++s) { + have_dig: + nz++; + if (c -= '0') { + nf += nz; + for(i = 1; i < nz; i++) + if (nd++ < 9) + y *= 10; + else if (nd <= DBL_DIG + 1) + z *= 10; + if (nd++ < 9) + y = 10*y + c; + else if (nd <= DBL_DIG + 1) + z = 10*z + c; + nz = 0; + } + } + }/*}*/ + dig_done: + e = 0; + if (c == 'e' || c == 'E') { + if (!nd && !nz && !nz0) { + goto ret0; + } + s00 = s; + esign = 0; + switch(c = *++s) { + case '-': + esign = 1; + case '+': + c = *++s; + } + if (c >= '0' && c <= '9') { + while(c == '0') + c = *++s; + if (c > '0' && c <= '9') { + L = c - '0'; + s1 = s; + while((c = *++s) >= '0' && c <= '9') + L = 10*L + c - '0'; + if (s - s1 > 8 || L > 19999) + /* Avoid confusion from exponents + * so large that e might overflow. + */ + e = 19999; /* safe for 16 bit ints */ + else + e = (int)L; + if (esign) + e = -e; + } + else + e = 0; + } + else + s = s00; + } + if (!nd) { + if (!nz && !nz0) { +#ifdef INFNAN_CHECK + /* Check for Nan and Infinity */ + ULong bits[2]; + static CONST FPI fpinan = /* only 52 explicit bits */ + { 52, 1-1023-53+1, 2046-1023-53+1, 1, SI }; + if (!decpt) + switch(c) { + case 'i': + case 'I': + if (match(&s,"nf")) { + --s; + if (!match(&s,"inity")) + ++s; + word0(&rv) = 0x7ff00000; + word1(&rv) = 0; + goto ret; + } + break; + case 'n': + case 'N': + if (match(&s, "an")) { +#ifndef No_Hex_NaN + if (*s == '(' /*)*/ + && hexnan(&s, &fpinan, bits) + == STRTOG_NaNbits) { + word0(&rv) = 0x7ff00000 | bits[1]; + word1(&rv) = bits[0]; + } + else { +#endif + word0(&rv) = NAN_WORD0; + word1(&rv) = NAN_WORD1; +#ifndef No_Hex_NaN + } +#endif + goto ret; + } + } +#endif /* INFNAN_CHECK */ + ret0: + s = s00; + sign = 0; + } + goto ret; + } +#define FPIEMIN (1-1023-53+1) // fpi.emin +#define FPINBITS 52 // fpi.nbits + TRUNCATE_DIGITS(s0, strunc, nd, nd0, nf, FPINBITS, FPIEMIN, dplen); + e1 = e -= nf; + + /* Now we have nd0 digits, starting at s0, followed by a + * decimal point, followed by nd-nd0 digits. The number we're + * after is the integer represented by those digits times + * 10**e */ + + if (!nd0) + nd0 = nd; + k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; + dval(&rv) = y; + if (k > 9) { +#ifdef SET_INEXACT + if (k > DBL_DIG) + oldinexact = get_inexact(); +#endif + dval(&rv) = tens[k - 9] * dval(&rv) + z; + } + bd0 = 0; + if (nd <= DBL_DIG +#ifndef RND_PRODQUOT +#ifndef Honor_FLT_ROUNDS + && Flt_Rounds == 1 +#endif +#endif + ) { + if (!e) + goto ret; + if (e > 0) { + if (e <= Ten_pmax) { +#ifdef VAX + goto vax_ovfl_check; +#else +#ifdef Honor_FLT_ROUNDS + /* round correctly FLT_ROUNDS = 2 or 3 */ + if (sign) { + dval(&rv) = -dval(&rv); + sign = 0; + } +#endif + /* rv = */ rounded_product(dval(&rv), tens[e]); + goto ret; +#endif + } + i = DBL_DIG - nd; + if (e <= Ten_pmax + i) { + /* A fancier test would sometimes let us do + * this for larger i values. + */ +#ifdef Honor_FLT_ROUNDS + /* round correctly FLT_ROUNDS = 2 or 3 */ + if (sign) { + dval(&rv) = -dval(&rv); + sign = 0; + } +#endif + e -= i; + dval(&rv) *= tens[i]; +#ifdef VAX + /* VAX exponent range is so narrow we must + * worry about overflow here... + */ + vax_ovfl_check: + word0(&rv) -= P*Exp_msk1; + /* rv = */ rounded_product(dval(&rv), tens[e]); + if ((word0(&rv) & Exp_mask) + > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) + goto ovfl; + word0(&rv) += P*Exp_msk1; +#else + /* rv = */ rounded_product(dval(&rv), tens[e]); +#endif + goto ret; + } + } +#ifndef Inaccurate_Divide + else if (e >= -Ten_pmax) { +#ifdef Honor_FLT_ROUNDS + /* round correctly FLT_ROUNDS = 2 or 3 */ + if (sign) { + dval(&rv) = -dval(&rv); + sign = 0; + } +#endif + /* rv = */ rounded_quotient(dval(&rv), tens[-e]); + goto ret; + } +#endif + } + e1 += nd - k; + +#ifdef IEEE_Arith +#ifdef SET_INEXACT + inexact = 1; + if (k <= DBL_DIG) + oldinexact = get_inexact(); +#endif +#ifdef Avoid_Underflow + scale = 0; +#endif +#ifdef Honor_FLT_ROUNDS + if (Rounding >= 2) { + if (sign) + Rounding = Rounding == 2 ? 0 : 2; + else + if (Rounding != 2) + Rounding = 0; + } +#endif +#endif /*IEEE_Arith*/ + + /* Get starting approximation = rv * 10**e1 */ + + if (e1 > 0) { + if ( (i = e1 & 15) !=0) + dval(&rv) *= tens[i]; + if (e1 &= ~15) { + if (e1 > DBL_MAX_10_EXP) { + ovfl: +#ifndef NO_ERRNO + errno = ERANGE; +#endif + /* Can't trust HUGE_VAL */ +#ifdef IEEE_Arith +#ifdef Honor_FLT_ROUNDS + switch(Rounding) { + case 0: /* toward 0 */ + case 3: /* toward -infinity */ + word0(&rv) = Big0; + word1(&rv) = Big1; + break; + default: + word0(&rv) = Exp_mask; + word1(&rv) = 0; + } +#else /*Honor_FLT_ROUNDS*/ + word0(&rv) = Exp_mask; + word1(&rv) = 0; +#endif /*Honor_FLT_ROUNDS*/ +#ifdef SET_INEXACT + /* set overflow bit */ + dval(&rv0) = 1e300; + dval(&rv0) *= dval(&rv0); +#endif +#else /*IEEE_Arith*/ + word0(&rv) = Big0; + word1(&rv) = Big1; +#endif /*IEEE_Arith*/ + if (bd0) + goto retfree; + goto ret; + } + e1 >>= 4; + for(j = 0; e1 > 1; j++, e1 >>= 1) + if (e1 & 1) + dval(&rv) *= bigtens[j]; + /* The last multiplication could overflow. */ + word0(&rv) -= P*Exp_msk1; + dval(&rv) *= bigtens[j]; + if ((z = word0(&rv) & Exp_mask) + > Exp_msk1*(DBL_MAX_EXP+Bias-P)) + goto ovfl; + if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) { + /* set to largest number */ + /* (Can't trust DBL_MAX) */ + word0(&rv) = Big0; + word1(&rv) = Big1; + } + else + word0(&rv) += P*Exp_msk1; + } + } + else if (e1 < 0) { + e1 = -e1; + if ( (i = e1 & 15) !=0) + dval(&rv) /= tens[i]; + if (e1 >>= 4) { + if (e1 >= 1 << n_bigtens) + goto undfl; +#ifdef Avoid_Underflow + if (e1 & Scale_Bit) + scale = 2*P; + for(j = 0; e1 > 0; j++, e1 >>= 1) + if (e1 & 1) + dval(&rv) *= tinytens[j]; + if (scale && (j = 2*P + 1 - ((word0(&rv) & Exp_mask) + >> Exp_shift)) > 0) { + /* scaled rv is denormal; zap j low bits */ + if (j >= 32) { + word1(&rv) = 0; + if (j >= 53) + word0(&rv) = (P+2)*Exp_msk1; + else + word0(&rv) &= 0xffffffff << (j-32); + } + else + word1(&rv) &= 0xffffffff << j; + } +#else + for(j = 0; e1 > 1; j++, e1 >>= 1) + if (e1 & 1) + dval(&rv) *= tinytens[j]; + /* The last multiplication could underflow. */ + dval(&rv0) = dval(&rv); + dval(&rv) *= tinytens[j]; + if (!dval(&rv)) { + dval(&rv) = 2.*dval(&rv0); + dval(&rv) *= tinytens[j]; +#endif + if (!dval(&rv)) { + undfl: + dval(&rv) = 0.; +#ifndef NO_ERRNO + errno = ERANGE; +#endif + if (bd0) + goto retfree; + goto ret; + } +#ifndef Avoid_Underflow + word0(&rv) = Tiny0; + word1(&rv) = Tiny1; + /* The refinement below will clean + * this approximation up. + */ + } +#endif + } + } + + /* Now the hard part -- adjusting rv to the correct value.*/ + + /* Put digits into bd: true value = bd * 10^e */ + + bd0 = s2b(s0, nd0, nd, y, dplen); + + for(;;) { + bd = Balloc(bd0->k); + Bcopy(bd, bd0); + bb = d2b(dval(&rv), &bbe, &bbbits); /* rv = bb * 2^bbe */ + bs = i2b(1); + + if (e >= 0) { + bb2 = bb5 = 0; + bd2 = bd5 = e; + } + else { + bb2 = bb5 = -e; + bd2 = bd5 = 0; + } + if (bbe >= 0) + bb2 += bbe; + else + bd2 -= bbe; + bs2 = bb2; +#ifdef Honor_FLT_ROUNDS + if (Rounding != 1) + bs2++; +#endif +#ifdef Avoid_Underflow + j = bbe - scale; + i = j + bbbits - 1; /* logb(&rv) */ + if (i < Emin) /* denormal */ + j += P - Emin; + else + j = P + 1 - bbbits; +#else /*Avoid_Underflow*/ +#ifdef Sudden_Underflow +#ifdef IBM + j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3); +#else + j = P + 1 - bbbits; +#endif +#else /*Sudden_Underflow*/ + j = bbe; + i = j + bbbits - 1; /* logb(&rv) */ + if (i < Emin) /* denormal */ + j += P - Emin; + else + j = P + 1 - bbbits; +#endif /*Sudden_Underflow*/ +#endif /*Avoid_Underflow*/ + bb2 += j; + bd2 += j; +#ifdef Avoid_Underflow + bd2 += scale; +#endif + i = bb2 < bd2 ? bb2 : bd2; + if (i > bs2) + i = bs2; + if (i > 0) { + bb2 -= i; + bd2 -= i; + bs2 -= i; + } + if (bb5 > 0) { + bs = pow5mult(bs, bb5); + bb1 = mult(bs, bb); + Bfree(bb); + bb = bb1; + } + if (bb2 > 0) + bb = lshift(bb, bb2); + if (bd5 > 0) + bd = pow5mult(bd, bd5); + if (bd2 > 0) + bd = lshift(bd, bd2); + if (bs2 > 0) + bs = lshift(bs, bs2); + delta = diff(bb, bd); + dsign = delta->sign; + delta->sign = 0; + i = cmp(delta, bs); +#ifdef Honor_FLT_ROUNDS + if (Rounding != 1) { + if (i < 0) { + /* Error is less than an ulp */ + if (!delta->x[0] && delta->wds <= 1) { + /* exact */ +#ifdef SET_INEXACT + inexact = 0; +#endif + break; + } + if (Rounding) { + if (dsign) { + dval(&adj) = 1.; + goto apply_adj; + } + } + else if (!dsign) { + dval(&adj) = -1.; + if (!word1(&rv) + && !(word0(&rv) & Frac_mask)) { + y = word0(&rv) & Exp_mask; +#ifdef Avoid_Underflow + if (!scale || y > 2*P*Exp_msk1) +#else + if (y) +#endif + { + delta = lshift(delta,Log2P); + if (cmp(delta, bs) <= 0) + dval(&adj) = -0.5; + } + } + apply_adj: +#ifdef Avoid_Underflow + if (scale && (y = word0(&rv) & Exp_mask) + <= 2*P*Exp_msk1) + word0(&adj) += (2*P+1)*Exp_msk1 - y; +#else +#ifdef Sudden_Underflow + if ((word0(&rv) & Exp_mask) <= + P*Exp_msk1) { + word0(&rv) += P*Exp_msk1; + dval(&rv) += adj*ulp(&rv); + word0(&rv) -= P*Exp_msk1; + } + else +#endif /*Sudden_Underflow*/ +#endif /*Avoid_Underflow*/ + dval(&rv) += dval(&adj)*ulp(&rv); + } + break; + } + dval(&adj) = ratio(delta, bs); + if (dval(&adj) < 1.) + dval(&adj) = 1.; + if (dval(&adj) <= 0x7ffffffe) { + /* dval(&adj) = Rounding ? ceil(&adj) : floor(&adj); */ + y = dval(&adj); + if (y != dval(&adj)) { + if (!((Rounding>>1) ^ dsign)) + y++; + dval(&adj) = y; + } + } +#ifdef Avoid_Underflow + if (scale && (y = word0(&rv) & Exp_mask) <= 2*P*Exp_msk1) + word0(&adj) += (2*P+1)*Exp_msk1 - y; +#else +#ifdef Sudden_Underflow + if ((word0(&rv) & Exp_mask) <= P*Exp_msk1) { + word0(&rv) += P*Exp_msk1; + dval(&adj) *= ulp(&rv); + if (dsign) + dval(&rv) += adj; + else + dval(&rv) -= adj; + word0(&rv) -= P*Exp_msk1; + goto cont; + } +#endif /*Sudden_Underflow*/ +#endif /*Avoid_Underflow*/ + dval(&adj) *= ulp(&rv); + if (dsign) { + if (word0(&rv) == Big0 && word1(&rv) == Big1) + goto ovfl; + dval(&rv) += dval(&adj); + } + else + dval(&rv) -= dval(&adj); + goto cont; + } +#endif /*Honor_FLT_ROUNDS*/ + + if (i < 0) { + /* Error is less than half an ulp -- check for + * special case of mantissa a power of two. + */ + if (dsign || word1(&rv) || word0(&rv) & Bndry_mask +#ifdef IEEE_Arith +#ifdef Avoid_Underflow + || (word0(&rv) & Exp_mask) <= (2*P+1)*Exp_msk1 +#else + || (word0(&rv) & Exp_mask) <= Exp_msk1 +#endif +#endif + ) { +#ifdef SET_INEXACT + if (!delta->x[0] && delta->wds <= 1) + inexact = 0; +#endif + break; + } + if (!delta->x[0] && delta->wds <= 1) { + /* exact result */ +#ifdef SET_INEXACT + inexact = 0; +#endif + break; + } + delta = lshift(delta,Log2P); + if (cmp(delta, bs) > 0) + goto drop_down; + break; + } + if (i == 0) { + /* exactly half-way between */ + if (dsign) { + if ((word0(&rv) & Bndry_mask1) == Bndry_mask1 + && word1(&rv) == ( +#ifdef Avoid_Underflow + (scale && (y = word0(&rv) & Exp_mask) <= 2*P*Exp_msk1) + ? (0xffffffff & (0xffffffff << (2*P+1-(y>>Exp_shift)))) : +#endif + 0xffffffff)) { + /*boundary case -- increment exponent*/ + word0(&rv) = (word0(&rv) & Exp_mask) + + Exp_msk1 +#ifdef IBM + | Exp_msk1 >> 4 +#endif + ; + word1(&rv) = 0; +#ifdef Avoid_Underflow + dsign = 0; +#endif + break; + } + } + else if (!(word0(&rv) & Bndry_mask) && !word1(&rv)) { + drop_down: + /* boundary case -- decrement exponent */ +#ifdef Sudden_Underflow /*{{*/ + L = word0(&rv) & Exp_mask; +#ifdef IBM + if (L < Exp_msk1) +#else +#ifdef Avoid_Underflow + if (L <= (scale ? (2*P+1)*Exp_msk1 : Exp_msk1)) +#else + if (L <= Exp_msk1) +#endif /*Avoid_Underflow*/ +#endif /*IBM*/ + goto undfl; + L -= Exp_msk1; +#else /*Sudden_Underflow}{*/ +#ifdef Avoid_Underflow + if (scale) { + L = word0(&rv) & Exp_mask; + if (L <= (2*P+1)*Exp_msk1) { + if (L > (P+2)*Exp_msk1) + /* round even ==> */ + /* accept rv */ + break; + /* rv = smallest denormal */ + goto undfl; + } + } +#endif /*Avoid_Underflow*/ + L = (word0(&rv) & Exp_mask) - Exp_msk1; +#endif /*Sudden_Underflow}}*/ + word0(&rv) = L | Bndry_mask1; + word1(&rv) = 0xffffffff; +#ifdef IBM + goto cont; +#else + break; +#endif + } +#ifndef ROUND_BIASED + if (!(word1(&rv) & LSB)) + break; +#endif + if (dsign) + dval(&rv) += ulp(&rv); +#ifndef ROUND_BIASED + else { + dval(&rv) -= ulp(&rv); +#ifndef Sudden_Underflow + if (!dval(&rv)) + goto undfl; +#endif + } +#ifdef Avoid_Underflow + dsign = 1 - dsign; +#endif +#endif + break; + } + if ((aadj = ratio(delta, bs)) <= 2.) { + if (dsign) + aadj = dval(&aadj1) = 1.; + else if (word1(&rv) || word0(&rv) & Bndry_mask) { +#ifndef Sudden_Underflow + if (word1(&rv) == Tiny1 && !word0(&rv)) + goto undfl; +#endif + aadj = 1.; + dval(&aadj1) = -1.; + } + else { + /* special case -- power of FLT_RADIX to be */ + /* rounded down... */ + + if (aadj < 2./FLT_RADIX) + aadj = 1./FLT_RADIX; + else + aadj *= 0.5; + dval(&aadj1) = -aadj; + } + } + else { + aadj *= 0.5; + dval(&aadj1) = dsign ? aadj : -aadj; +#ifdef Check_FLT_ROUNDS + switch(Rounding) { + case 2: /* towards +infinity */ + dval(&aadj1) -= 0.5; + break; + case 0: /* towards 0 */ + case 3: /* towards -infinity */ + dval(&aadj1) += 0.5; + } +#else + if (Flt_Rounds == 0) + dval(&aadj1) += 0.5; +#endif /*Check_FLT_ROUNDS*/ + } + y = word0(&rv) & Exp_mask; + + /* Check for overflow */ + + if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) { + dval(&rv0) = dval(&rv); + word0(&rv) -= P*Exp_msk1; + dval(&adj) = dval(&aadj1) * ulp(&rv); + dval(&rv) += dval(&adj); + if ((word0(&rv) & Exp_mask) >= + Exp_msk1*(DBL_MAX_EXP+Bias-P)) { + if (word0(&rv0) == Big0 && word1(&rv0) == Big1) + goto ovfl; + word0(&rv) = Big0; + word1(&rv) = Big1; + goto cont; + } + else + word0(&rv) += P*Exp_msk1; + } + else { +#ifdef Avoid_Underflow + if (scale && y <= 2*P*Exp_msk1) { + if (aadj <= 0x7fffffff) { + if ((z = aadj) <= 0) + z = 1; + aadj = z; + dval(&aadj1) = dsign ? aadj : -aadj; + } + word0(&aadj1) += (2*P+1)*Exp_msk1 - y; + } + dval(&adj) = dval(&aadj1) * ulp(&rv); + dval(&rv) += dval(&adj); +#else +#ifdef Sudden_Underflow + if ((word0(&rv) & Exp_mask) <= P*Exp_msk1) { + dval(&rv0) = dval(&rv); + word0(&rv) += P*Exp_msk1; + dval(&adj) = dval(&aadj1) * ulp(&rv); + dval(&rv) += adj; +#ifdef IBM + if ((word0(&rv) & Exp_mask) < P*Exp_msk1) +#else + if ((word0(&rv) & Exp_mask) <= P*Exp_msk1) +#endif + { + if (word0(&rv0) == Tiny0 + && word1(&rv0) == Tiny1) + goto undfl; + word0(&rv) = Tiny0; + word1(&rv) = Tiny1; + goto cont; + } + else + word0(&rv) -= P*Exp_msk1; + } + else { + dval(&adj) = dval(&aadj1) * ulp(&rv); + dval(&rv) += adj; + } +#else /*Sudden_Underflow*/ + /* Compute dval(&adj) so that the IEEE rounding rules will + * correctly round rv + dval(&adj) in some half-way cases. + * If rv * ulp(&rv) is denormalized (i.e., + * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid + * trouble from bits lost to denormalization; + * example: 1.2e-307 . + */ + if (y <= (P-1)*Exp_msk1 && aadj > 1.) { + dval(&aadj1) = (double)(int)(aadj + 0.5); + if (!dsign) + dval(&aadj1) = -dval(&aadj1); + } + dval(&adj) = dval(&aadj1) * ulp(&rv); + dval(&rv) += adj; +#endif /*Sudden_Underflow*/ +#endif /*Avoid_Underflow*/ + } + z = word0(&rv) & Exp_mask; +#ifndef SET_INEXACT +#ifdef Avoid_Underflow + if (!scale) +#endif + if (y == z) { + /* Can we stop now? */ + L = (Long)aadj; + aadj -= L; + /* The tolerances below are conservative. */ + if (dsign || word1(&rv) || word0(&rv) & Bndry_mask) { + if (aadj < .4999999 || aadj > .5000001) + break; + } + else if (aadj < .4999999/FLT_RADIX) + break; + } +#endif + cont: + Bfree(bb); + Bfree(bd); + Bfree(bs); + Bfree(delta); + } +#ifdef SET_INEXACT + if (inexact) { + if (!oldinexact) { + word0(&rv0) = Exp_1 + (70 << Exp_shift); + word1(&rv0) = 0; + dval(&rv0) += 1.; + } + } + else if (!oldinexact) + clear_inexact(); +#endif +#ifdef Avoid_Underflow + if (scale) { + word0(&rv0) = Exp_1 - 2*P*Exp_msk1; + word1(&rv0) = 0; + dval(&rv) *= dval(&rv0); +#ifndef NO_ERRNO + /* try to avoid the bug of testing an 8087 register value */ +#if defined(IEEE_Arith) && __DARWIN_UNIX03 + if (!(word0(&rv) & Exp_mask)) +#else + if (word0(&rv) == 0 && word1(&rv) == 0) +#endif + errno = ERANGE; +#endif + } +#endif /* Avoid_Underflow */ +#ifdef SET_INEXACT + if (inexact && !(word0(&rv) & Exp_mask)) { + /* set underflow bit */ + dval(&rv0) = 1e-300; + dval(&rv0) *= dval(&rv0); + } +#endif + retfree: + Bfree(bb); + Bfree(bd); + Bfree(bs); + Bfree(bd0); + Bfree(delta); + ret: + if (se) + *se = (char *)s; + if (strunc) +#ifdef FREE + FREE(strunc); +#else + free(strunc); +#endif + return sign ? -dval(&rv) : dval(&rv); + } + + double +strtod +#ifdef KR_headers + (s00, se) CONST char *s00; char **se; +#else + (CONST char *s00, char **se) +#endif +{ + return strtod_l(s00, se, __current_locale()); +} diff --git a/gdtoa/FreeBSD/gdtoa-strtodg.c b/gdtoa/FreeBSD/gdtoa-strtodg.c new file mode 100644 index 0000000..c436ea9 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-strtodg.c @@ -0,0 +1,1096 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "xlocale_private.h" + +#include "gdtoaimp.h" + +#ifdef USE_LOCALE +#include "locale.h" +#endif + +#define fivesbits __fivesbits_D2A +#define all_on __all_on_D2A +#define set_ones __set_ones_D2A +#define rvOK __rvOK_D2A +#define mantbits __mantbits_D2A + +#ifdef BUILDING_VARIANT +extern CONST int fivesbits[]; +int all_on(Bigint *b, int n); +Bigint *set_ones(Bigint *b, int n); +int rvOK(U *d, CONST FPI *fpi, Long *exp, ULong *bits, int exact, int rd, int *irv); +int mantbits(U *d); +#else /* !BUILDING_VARIANT */ + + __private_extern__ CONST int +fivesbits[] = { 0, 3, 5, 7, 10, 12, 14, 17, 19, 21, + 24, 26, 28, 31, 33, 35, 38, 40, 42, 45, + 47, 49, 52 +#ifdef VAX + , 54, 56 +#endif + }; + + Bigint * +#ifdef KR_headers +increment(b) Bigint *b; +#else +increment(Bigint *b) +#endif +{ + ULong *x, *xe; + Bigint *b1; +#ifdef Pack_16 + ULong carry = 1, y; +#endif + + x = b->x; + xe = x + b->wds; +#ifdef Pack_32 + do { + if (*x < (ULong)0xffffffffL) { + ++*x; + return b; + } + *x++ = 0; + } while(x < xe); +#else + do { + y = *x + carry; + carry = y >> 16; + *x++ = y & 0xffff; + if (!carry) + return b; + } while(x < xe); + if (carry) +#endif + { + if (b->wds >= b->maxwds) { + b1 = Balloc(b->k+1); + Bcopy(b1,b); + Bfree(b); + b = b1; + } + b->x[b->wds++] = 1; + } + return b; + } + + void +#ifdef KR_headers +decrement(b) Bigint *b; +#else +decrement(Bigint *b) +#endif +{ + ULong *x, *xe; +#ifdef Pack_16 + ULong borrow = 1, y; +#endif + + x = b->x; + xe = x + b->wds; +#ifdef Pack_32 + do { + if (*x) { + --*x; + break; + } + *x++ = 0xffffffffL; + } + while(x < xe); +#else + do { + y = *x - borrow; + borrow = (y & 0x10000) >> 16; + *x++ = y & 0xffff; + } while(borrow && x < xe); +#endif + } + + __private_extern__ int +#ifdef KR_headers +all_on(b, n) Bigint *b; int n; +#else +all_on(Bigint *b, int n) +#endif +{ + ULong *x, *xe; + + x = b->x; + xe = x + (n >> kshift); + while(x < xe) + if ((*x++ & ALL_ON) != ALL_ON) + return 0; + if (n &= kmask) + return ((*x | (ALL_ON << n)) & ALL_ON) == ALL_ON; + return 1; + } + + Bigint * +#ifdef KR_headers +set_ones(b, n) Bigint *b; int n; +#else +set_ones(Bigint *b, int n) +#endif +{ + int k; + ULong *x, *xe; + + k = (n + ((1 << kshift) - 1)) >> kshift; + if (b->k < k) { + Bfree(b); + b = Balloc(k); + } + k = n >> kshift; + if (n &= kmask) + k++; + b->wds = k; + x = b->x; + xe = x + k; + while(x < xe) + *x++ = ALL_ON; + if (n) + x[-1] >>= ULbits - n; + return b; + } + + __private_extern__ int +rvOK +#ifdef KR_headers + (d, fpi, exp, bits, exact, rd, irv) + U *d; CONST FPI *fpi; Long *exp; ULong *bits; int exact, rd, *irv; +#else + (U *d, CONST FPI *fpi, Long *exp, ULong *bits, int exact, int rd, int *irv) +#endif +{ + Bigint *b; + ULong carry, inex, lostbits; + int bdif, e, j, k, k1, nb, rv; + + carry = rv = 0; + b = d2b(dval(d), &e, &bdif); + bdif -= nb = fpi->nbits; + e += bdif; + if (bdif <= 0) { + if (exact) + goto trunc; + goto ret; + } + if (P == nb) { + if ( +#ifndef IMPRECISE_INEXACT + exact && +#endif + fpi->rounding == +#ifdef RND_PRODQUOT + FPI_Round_near +#else + Flt_Rounds +#endif + ) goto trunc; + goto ret; + } + switch(rd) { + case 1: /* round down (toward -Infinity) */ + goto trunc; + case 2: /* round up (toward +Infinity) */ + break; + default: /* round near */ + k = bdif - 1; + if (k < 0) + goto trunc; + if (!k) { + if (!exact) + goto ret; + if (b->x[0] & 2) + break; + goto trunc; + } + if (b->x[k>>kshift] & ((ULong)1 << (k & kmask))) + break; + goto trunc; + } + /* "break" cases: round up 1 bit, then truncate; bdif > 0 */ + carry = 1; + trunc: + inex = lostbits = 0; + if (bdif > 0) { + if ( (lostbits = any_on(b, bdif)) !=0) + inex = STRTOG_Inexlo; + rshift(b, bdif); + if (carry) { + inex = STRTOG_Inexhi; + b = increment(b); + if ( (j = nb & kmask) !=0) + j = ULbits - j; + if (hi0bits(b->x[b->wds - 1]) != j) { + if (!lostbits) + lostbits = b->x[0] & 1; + rshift(b, 1); + e++; + } + } + } + else if (bdif < 0) + b = lshift(b, -bdif); + if (e < fpi->emin) { + k = fpi->emin - e; + e = fpi->emin; + if (k > nb || fpi->sudden_underflow) { + b->wds = inex = 0; + *irv = STRTOG_Underflow | STRTOG_Inexlo; + } + else { + k1 = k - 1; + if (k1 > 0 && !lostbits) + lostbits = any_on(b, k1); + if (!lostbits && !exact) + goto ret; + lostbits |= + carry = b->x[k1>>kshift] & (1 << (k1 & kmask)); + rshift(b, k); + *irv = STRTOG_Denormal; + if (carry) { + b = increment(b); + inex = STRTOG_Inexhi | STRTOG_Underflow; + } + else if (lostbits) + inex = STRTOG_Inexlo | STRTOG_Underflow; + } + } + else if (e > fpi->emax) { + e = fpi->emax + 1; + *irv = STRTOG_Infinite | STRTOG_Overflow | STRTOG_Inexhi; +#ifndef NO_ERRNO + errno = ERANGE; +#endif + b->wds = inex = 0; + } + *exp = e; + copybits(bits, nb, b); + *irv |= inex; + rv = 1; + ret: + Bfree(b); + return rv; + } + + __private_extern__ int +#ifdef KR_headers +mantbits(d) U *d; +#else +mantbits(U *d) +#endif +{ + ULong L; +#ifdef VAX + L = word1(d) << 16 | word1(d) >> 16; + if (L) +#else + if ( (L = word1(d)) !=0) +#endif + return P - lo0bits(&L); +#ifdef VAX + L = word0(d) << 16 | word0(d) >> 16 | Exp_msk11; +#else + L = word0(d) | Exp_msk1; +#endif + return P - 32 - lo0bits(&L); + } + +#endif /* BUILDING_VARIANT */ + + int +strtodg +#ifdef KR_headers + (s00, se, fpi, exp, bits, loc) + CONST char *s00; char **se; CONST FPI *fpi; Long *exp; ULong *bits; locale_t loc; +#else + (CONST char *s00, char **se, CONST FPI *fpi, Long *exp, ULong *bits, locale_t loc) +#endif +{ + int abe, abits, asub; + int bb0, bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, decpt, denorm; + int dsign, e, e1, e2, emin, esign, finished, i, inex, irv; + int j, k, nbits, nd, nd0, nf, nz, nz0, rd, rvbits, rve, rve1, sign; + int sudden_underflow; + CONST char *s, *s0, *s1; + char *strunc = NULL; + double adj0, tol; + Long L; + U adj, rv; + ULong *b, *be, y, z; + Bigint *ab, *bb, *bb1, *bd, *bd0, *bs, *delta, *rvb, *rvb0; +#ifdef USE_LOCALE /*{{*/ + NORMALIZE_LOCALE(loc); +#ifdef NO_LOCALE_CACHE + char *decimalpoint = localeconv_l(loc)->decimal_point; + int dplen = strlen(decimalpoint); +#else + char *decimalpoint; + static char *decimalpoint_cache; + static int dplen; + if (!(s0 = decimalpoint_cache)) { + s0 = localeconv_l(loc)->decimal_point; + if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) { + strcpy(decimalpoint_cache, s0); + s0 = decimalpoint_cache; + } + dplen = strlen(s0); + } + decimalpoint = (char*)s0; +#endif /*NO_LOCALE_CACHE*/ +#else /*USE_LOCALE}{*/ +#define dplen 1 +#endif /*USE_LOCALE}}*/ + + irv = STRTOG_Zero; + denorm = sign = nz0 = nz = 0; + dval(&rv) = 0.; + rvb = 0; + nbits = fpi->nbits; + for(s = s00;;s++) switch(*s) { + case '-': + sign = 1; + /* no break */ + case '+': + if (*++s) + goto break2; + /* no break */ + case 0: + sign = 0; + irv = STRTOG_NoNumber; + s = s00; + goto ret; + case '\t': + case '\n': + case '\v': + case '\f': + case '\r': + case ' ': + continue; + default: + goto break2; + } + break2: + if (*s == '0') { +#ifndef NO_HEX_FP + switch(s[1]) { + case 'x': + case 'X': + irv = gethex(&s, fpi, exp, &rvb, sign, loc); + if (irv == STRTOG_NoNumber) { + s = s00; + sign = 0; + } + goto ret; + } +#endif + nz0 = 1; + while(*++s == '0') ; + if (!*s) + goto ret; + } + sudden_underflow = fpi->sudden_underflow; + s0 = s; + y = z = 0; + for(decpt = nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) + if (nd < 9) + y = 10*y + c - '0'; + else if (nd < 16) + z = 10*z + c - '0'; + nd0 = nd; +#ifdef USE_LOCALE + if (c == *decimalpoint) { + for(i = 1; decimalpoint[i]; ++i) + if (s[i] != decimalpoint[i]) + goto dig_done; + s += i; + c = *s; +#else + if (c == '.') { + c = *++s; +#endif + decpt = 1; + if (!nd) { + for(; c == '0'; c = *++s) + nz++; + if (c > '0' && c <= '9') { + s0 = s; + nf += nz; + nz = 0; + goto have_dig; + } + goto dig_done; + } + for(; c >= '0' && c <= '9'; c = *++s) { + have_dig: + nz++; + if (c -= '0') { + nf += nz; + for(i = 1; i < nz; i++) + if (nd++ < 9) + y *= 10; + else if (nd <= DBL_DIG + 1) + z *= 10; + if (nd++ < 9) + y = 10*y + c; + else if (nd <= DBL_DIG + 1) + z = 10*z + c; + nz = 0; + } + } + }/*}*/ + dig_done: + e = 0; + if (c == 'e' || c == 'E') { + if (!nd && !nz && !nz0) { + irv = STRTOG_NoNumber; + s = s00; + goto ret; + } + s00 = s; + esign = 0; + switch(c = *++s) { + case '-': + esign = 1; + case '+': + c = *++s; + } + if (c >= '0' && c <= '9') { + while(c == '0') + c = *++s; + if (c > '0' && c <= '9') { + L = c - '0'; + s1 = s; + while((c = *++s) >= '0' && c <= '9') + L = 10*L + c - '0'; + if (s - s1 > 8 || L > 19999) + /* Avoid confusion from exponents + * so large that e might overflow. + */ + e = 19999; /* safe for 16 bit ints */ + else + e = (int)L; + if (esign) + e = -e; + } + else + e = 0; + } + else + s = s00; + } + if (!nd) { + if (!nz && !nz0) { +#ifdef INFNAN_CHECK + /* Check for Nan and Infinity */ + if (!decpt) + switch(c) { + case 'i': + case 'I': + if (match(&s,"nf")) { + --s; + if (!match(&s,"inity")) + ++s; + irv = STRTOG_Infinite; + goto infnanexp; + } + break; + case 'n': + case 'N': + if (match(&s, "an")) { + irv = STRTOG_NaN; + *exp = fpi->emax + 1; +#ifndef No_Hex_NaN + if (*s == '(') /*)*/ + irv = hexnan(&s, fpi, bits); +#endif + goto infnanexp; + } + } +#endif /* INFNAN_CHECK */ + irv = STRTOG_NoNumber; + s = s00; + } + goto ret; + } + TRUNCATE_DIGITS(s0, strunc, nd, nd0, nf, fpi->nbits, fpi->emin, dplen); + + irv = STRTOG_Normal; + e1 = e -= nf; + rd = 0; + switch(fpi->rounding & 3) { + case FPI_Round_up: + rd = 2 - sign; + break; + case FPI_Round_zero: + rd = 1; + break; + case FPI_Round_down: + rd = 1 + sign; + } + + /* Now we have nd0 digits, starting at s0, followed by a + * decimal point, followed by nd-nd0 digits. The number we're + * after is the integer represented by those digits times + * 10**e */ + + if (!nd0) + nd0 = nd; + k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; + dval(&rv) = y; + if (k > 9) + dval(&rv) = tens[k - 9] * dval(&rv) + z; + bd0 = 0; + if (nbits <= P && nd <= DBL_DIG) { + if (!e) { + if (rvOK(&rv, fpi, exp, bits, 1, rd, &irv)) + goto ret; + } + else if (e > 0) { + if (e <= Ten_pmax) { +#ifdef VAX + goto vax_ovfl_check; +#else + i = fivesbits[e] + mantbits(&rv) <= P; + /* rv = */ rounded_product(dval(&rv), tens[e]); + if (rvOK(&rv, fpi, exp, bits, i, rd, &irv)) + goto ret; + e1 -= e; + goto rv_notOK; +#endif + } + i = DBL_DIG - nd; + if (e <= Ten_pmax + i) { + /* A fancier test would sometimes let us do + * this for larger i values. + */ + e2 = e - i; + e1 -= i; + dval(&rv) *= tens[i]; +#ifdef VAX + /* VAX exponent range is so narrow we must + * worry about overflow here... + */ + vax_ovfl_check: + dval(&adj) = dval(&rv); + word0(&adj) -= P*Exp_msk1; + /* adj = */ rounded_product(dval(&adj), tens[e2]); + if ((word0(&adj) & Exp_mask) + > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) + goto rv_notOK; + word0(&adj) += P*Exp_msk1; + dval(&rv) = dval(&adj); +#else + /* rv = */ rounded_product(dval(&rv), tens[e2]); +#endif + if (rvOK(&rv, fpi, exp, bits, 0, rd, &irv)) + goto ret; + e1 -= e2; + } + } +#ifndef Inaccurate_Divide + else if (e >= -Ten_pmax) { + /* rv = */ rounded_quotient(dval(&rv), tens[-e]); + if (rvOK(&rv, fpi, exp, bits, 0, rd, &irv)) + goto ret; + e1 -= e; + } +#endif + } + rv_notOK: + e1 += nd - k; + + /* Get starting approximation = rv * 10**e1 */ + + e2 = 0; + if (e1 > 0) { + if ( (i = e1 & 15) !=0) + dval(&rv) *= tens[i]; + if (e1 &= ~15) { + e1 >>= 4; + while(e1 >= (1 << (n_bigtens-1))) { + e2 += ((word0(&rv) & Exp_mask) + >> Exp_shift1) - Bias; + word0(&rv) &= ~Exp_mask; + word0(&rv) |= Bias << Exp_shift1; + dval(&rv) *= bigtens[n_bigtens-1]; + e1 -= 1 << (n_bigtens-1); + } + e2 += ((word0(&rv) & Exp_mask) >> Exp_shift1) - Bias; + word0(&rv) &= ~Exp_mask; + word0(&rv) |= Bias << Exp_shift1; + for(j = 0; e1 > 0; j++, e1 >>= 1) + if (e1 & 1) + dval(&rv) *= bigtens[j]; + } + } + else if (e1 < 0) { + e1 = -e1; + if ( (i = e1 & 15) !=0) + dval(&rv) /= tens[i]; + if (e1 &= ~15) { + e1 >>= 4; + while(e1 >= (1 << (n_bigtens-1))) { + e2 += ((word0(&rv) & Exp_mask) + >> Exp_shift1) - Bias; + word0(&rv) &= ~Exp_mask; + word0(&rv) |= Bias << Exp_shift1; + dval(&rv) *= tinytens[n_bigtens-1]; + e1 -= 1 << (n_bigtens-1); + } + e2 += ((word0(&rv) & Exp_mask) >> Exp_shift1) - Bias; + word0(&rv) &= ~Exp_mask; + word0(&rv) |= Bias << Exp_shift1; + for(j = 0; e1 > 0; j++, e1 >>= 1) + if (e1 & 1) + dval(&rv) *= tinytens[j]; + } + } +#ifdef IBM + /* e2 is a correction to the (base 2) exponent of the return + * value, reflecting adjustments above to avoid overflow in the + * native arithmetic. For native IBM (base 16) arithmetic, we + * must multiply e2 by 4 to change from base 16 to 2. + */ + e2 <<= 2; +#endif + rvb = d2b(dval(&rv), &rve, &rvbits); /* rv = rvb * 2^rve */ + rve += e2; + if ((j = rvbits - nbits) > 0) { + rshift(rvb, j); + rvbits = nbits; + rve += j; + } + bb0 = 0; /* trailing zero bits in rvb */ + e2 = rve + rvbits - nbits; + if (e2 > fpi->emax + 1) + goto huge; + rve1 = rve + rvbits - nbits; + if (e2 < (emin = fpi->emin)) { + denorm = 1; + j = rve - emin; + if (j > 0) { + rvb = lshift(rvb, j); + rvbits += j; + } + else if (j < 0) { + rvbits += j; + if (rvbits <= 0) { + if (rvbits < -1) { + ufl: + rvb->wds = 0; + rvb->x[0] = 0; + *exp = emin; + irv = STRTOG_Underflow | STRTOG_Inexlo; +/* When __DARWIN_UNIX03 is set, we don't need this (errno is set later) */ +#if !defined(NO_ERRNO) && !__DARWIN_UNIX03 + errno = ERANGE; +#endif + goto ret; + } + rvb->x[0] = rvb->wds = rvbits = 1; + } + else + rshift(rvb, -j); + } + rve = rve1 = emin; + if (sudden_underflow && e2 + 1 < emin) + goto ufl; + } + + /* Now the hard part -- adjusting rv to the correct value.*/ + + /* Put digits into bd: true value = bd * 10^e */ + + bd0 = s2b(s0, nd0, nd, y, dplen); + + for(;;) { + bd = Balloc(bd0->k); + Bcopy(bd, bd0); + bb = Balloc(rvb->k); + Bcopy(bb, rvb); + bbbits = rvbits - bb0; + bbe = rve + bb0; + bs = i2b(1); + + if (e >= 0) { + bb2 = bb5 = 0; + bd2 = bd5 = e; + } + else { + bb2 = bb5 = -e; + bd2 = bd5 = 0; + } + if (bbe >= 0) + bb2 += bbe; + else + bd2 -= bbe; + bs2 = bb2; + j = nbits + 1 - bbbits; + i = bbe + bbbits - nbits; + if (i < emin) /* denormal */ + j += i - emin; + bb2 += j; + bd2 += j; + i = bb2 < bd2 ? bb2 : bd2; + if (i > bs2) + i = bs2; + if (i > 0) { + bb2 -= i; + bd2 -= i; + bs2 -= i; + } + if (bb5 > 0) { + bs = pow5mult(bs, bb5); + bb1 = mult(bs, bb); + Bfree(bb); + bb = bb1; + } + bb2 -= bb0; + if (bb2 > 0) + bb = lshift(bb, bb2); + else if (bb2 < 0) + rshift(bb, -bb2); + if (bd5 > 0) + bd = pow5mult(bd, bd5); + if (bd2 > 0) + bd = lshift(bd, bd2); + if (bs2 > 0) + bs = lshift(bs, bs2); + asub = 1; + inex = STRTOG_Inexhi; + delta = diff(bb, bd); + if (delta->wds <= 1 && !delta->x[0]) + break; + dsign = delta->sign; + delta->sign = finished = 0; + L = 0; + i = cmp(delta, bs); + if (rd && i <= 0) { + irv = STRTOG_Normal; + if ( (finished = dsign ^ (rd&1)) !=0) { + if (dsign != 0) { + irv |= STRTOG_Inexhi; + goto adj1; + } + irv |= STRTOG_Inexlo; + if (rve1 == emin) + goto adj1; + for(i = 0, j = nbits; j >= ULbits; + i++, j -= ULbits) { + if (rvb->x[i] & ALL_ON) + goto adj1; + } + if (j > 1 && lo0bits(rvb->x + i) < j - 1) + goto adj1; + rve = rve1 - 1; + rvb = set_ones(rvb, rvbits = nbits); + break; + } + irv |= dsign ? STRTOG_Inexlo : STRTOG_Inexhi; + break; + } + if (i < 0) { + /* Error is less than half an ulp -- check for + * special case of mantissa a power of two. + */ + irv = dsign + ? STRTOG_Normal | STRTOG_Inexlo + : STRTOG_Normal | STRTOG_Inexhi; + if (dsign || bbbits > 1 || denorm || rve1 == emin) + break; + delta = lshift(delta,1); + if (cmp(delta, bs) > 0) { + irv = STRTOG_Normal | STRTOG_Inexlo; + goto drop_down; + } + break; + } + if (i == 0) { + /* exactly half-way between */ + if (dsign) { + if (denorm && all_on(rvb, rvbits)) { + /*boundary case -- increment exponent*/ + rvb->wds = 1; + rvb->x[0] = 1; + rve = emin + nbits - (rvbits = 1); + irv = STRTOG_Normal | STRTOG_Inexhi; + denorm = 0; + break; + } + irv = STRTOG_Normal | STRTOG_Inexlo; + } + else if (bbbits == 1) { + irv = STRTOG_Normal; + drop_down: + /* boundary case -- decrement exponent */ + if (rve1 == emin) { + irv = STRTOG_Normal | STRTOG_Inexhi; + if (rvb->wds == 1 && rvb->x[0] == 1) + sudden_underflow = 1; + break; + } + rve -= nbits; + rvb = set_ones(rvb, rvbits = nbits); + break; + } + else + irv = STRTOG_Normal | STRTOG_Inexhi; + if ((bbbits < nbits && !denorm) || !(rvb->x[0] & 1)) + break; + if (dsign) { + rvb = increment(rvb); + j = kmask & (ULbits - (rvbits & kmask)); + if (hi0bits(rvb->x[rvb->wds - 1]) != j) + rvbits++; + irv = STRTOG_Normal | STRTOG_Inexhi; + } + else { + if (bbbits == 1) + goto undfl; + decrement(rvb); + irv = STRTOG_Normal | STRTOG_Inexlo; + } + break; + } + if ((dval(&adj) = ratio(delta, bs)) <= 2.) { + adj1: + inex = STRTOG_Inexlo; + if (dsign) { + asub = 0; + inex = STRTOG_Inexhi; + } + else if (denorm && bbbits <= 1) { + undfl: + rvb->wds = 0; + rve = emin; + irv = STRTOG_Underflow | STRTOG_Inexlo; + break; + } + adj0 = dval(&adj) = 1.; + } + else { + adj0 = dval(&adj) *= 0.5; + if (dsign) { + asub = 0; + inex = STRTOG_Inexlo; + } + if (dval(&adj) < 2147483647.) { + L = adj0; + adj0 -= L; + switch(rd) { + case 0: + if (adj0 >= .5) + goto inc_L; + break; + case 1: + if (asub && adj0 > 0.) + goto inc_L; + break; + case 2: + if (!asub && adj0 > 0.) { + inc_L: + L++; + inex = STRTOG_Inexact - inex; + } + } + dval(&adj) = L; + } + } + y = rve + rvbits; + + /* adj *= ulp(dval(&rv)); */ + /* if (asub) rv -= adj; else rv += adj; */ + + if (!denorm && rvbits < nbits) { + rvb = lshift(rvb, j = nbits - rvbits); + rve -= j; + rvbits = nbits; + } + ab = d2b(dval(&adj), &abe, &abits); + if (abe < 0) + rshift(ab, -abe); + else if (abe > 0) + ab = lshift(ab, abe); + rvb0 = rvb; + if (asub) { + /* rv -= adj; */ + j = hi0bits(rvb->x[rvb->wds-1]); + rvb = diff(rvb, ab); + k = rvb0->wds - 1; + if (denorm) + /* do nothing */; + else if (rvb->wds <= k + || hi0bits( rvb->x[k]) > + hi0bits(rvb0->x[k])) { + /* unlikely; can only have lost 1 high bit */ + if (rve1 == emin) { + --rvbits; + denorm = 1; + } + else { + rvb = lshift(rvb, 1); + --rve; + --rve1; + L = finished = 0; + } + } + } + else { + rvb = sum(rvb, ab); + k = rvb->wds - 1; + if (k >= rvb0->wds + || hi0bits(rvb->x[k]) < hi0bits(rvb0->x[k])) { + if (denorm) { + if (++rvbits == nbits) + denorm = 0; + } + else { + rshift(rvb, 1); + rve++; + rve1++; + L = 0; + } + } + } + Bfree(ab); + Bfree(rvb0); + if (finished) + break; + + z = rve + rvbits; + if (y == z && L) { + /* Can we stop now? */ + tol = dval(&adj) * 5e-16; /* > max rel error */ + dval(&adj) = adj0 - .5; + if (dval(&adj) < -tol) { + if (adj0 > tol) { + irv |= inex; + break; + } + } + else if (dval(&adj) > tol && adj0 < 1. - tol) { + irv |= inex; + break; + } + } + bb0 = denorm ? 0 : trailz(rvb); + Bfree(bb); + Bfree(bd); + Bfree(bs); + Bfree(delta); + } + if (!denorm && (j = nbits - rvbits)) { + if (j > 0) + rvb = lshift(rvb, j); + else + rshift(rvb, -j); + rve -= j; + } + *exp = rve; + Bfree(bb); + Bfree(bd); + Bfree(bs); + Bfree(bd0); + Bfree(delta); + if (rve > fpi->emax) { + switch(fpi->rounding & 3) { + case FPI_Round_near: + goto huge; + case FPI_Round_up: + if (!sign) + goto huge; + break; + case FPI_Round_down: + if (sign) + goto huge; + } + /* Round to largest representable magnitude */ + Bfree(rvb); + rvb = 0; + irv = STRTOG_Normal | STRTOG_Inexlo; + *exp = fpi->emax; + b = bits; + be = b + ((fpi->nbits + 31) >> 5); + while(b < be) + *b++ = -1; + if ((j = fpi->nbits & 0x1f)) + *--be >>= (32 - j); + goto ret; + huge: + rvb->wds = 0; + irv = STRTOG_Infinite | STRTOG_Overflow | STRTOG_Inexhi; +#ifndef NO_ERRNO + errno = ERANGE; +#endif + infnanexp: + *exp = fpi->emax + 1; + } + ret: + if (denorm) { + if (sudden_underflow) { + rvb->wds = 0; + irv = STRTOG_Underflow | STRTOG_Inexlo; +#if !defined(NO_ERRNO) && __DARWIN_UNIX03 + errno = ERANGE; +#endif + } + else { + irv = (irv & ~STRTOG_Retmask) | + (rvb->wds > 0 ? STRTOG_Denormal : STRTOG_Zero); + if (irv & STRTOG_Inexact) { + irv |= STRTOG_Underflow; +#if !defined(NO_ERRNO) && __DARWIN_UNIX03 + errno = ERANGE; +#endif + } + } + } + if (se) + *se = (char *)s; + if (sign) + irv |= STRTOG_Neg; + if (rvb) { + copybits(bits, nbits, rvb); + Bfree(rvb); + } + if (strunc) +#ifdef FREE + FREE(strunc); +#else + free(strunc); +#endif + return irv; + } diff --git a/gdtoa/FreeBSD/gdtoa-strtof.c b/gdtoa/FreeBSD/gdtoa-strtof.c new file mode 100644 index 0000000..1f84d7d --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-strtof.c @@ -0,0 +1,94 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 2000 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "xlocale_private.h" + +#include "gdtoaimp.h" + + float +#ifdef KR_headers +strtof_l(s, sp, loc) CONST char *s; char **sp; locale_t loc; +#else +strtof_l(CONST char *s, char **sp, locale_t loc) +#endif +{ + static CONST FPI fpi0 = { 24, 1-127-24+1, 254-127-24+1, 1, SI }; + ULong bits[1]; + Long exp; + int k; + union { ULong L[1]; float f; } u; +#ifdef Honor_FLT_ROUNDS +#include "gdtoa_fltrnds.h" +#else +#define fpi &fpi0 +#endif + + NORMALIZE_LOCALE(loc); + k = strtodg(s, sp, fpi, &exp, bits, loc); + switch(k & STRTOG_Retmask) { + case STRTOG_NoNumber: + u.L[0] = 0; + return u.f; // avoid setting sign + + case STRTOG_Zero: + u.L[0] = 0; + break; + + case STRTOG_Normal: + case STRTOG_NaNbits: + u.L[0] = (bits[0] & 0x7fffff) | ((exp + 0x7f + 23) << 23); + break; + + case STRTOG_Denormal: + u.L[0] = bits[0]; + break; + + case STRTOG_Infinite: + u.L[0] = 0x7f800000; + break; + + case STRTOG_NaN: + u.L[0] = f_QNAN; + } + if (k & STRTOG_Neg) + u.L[0] |= 0x80000000L; + return u.f; + } + + float +#ifdef KR_headers +strtof(s, sp) CONST char *s; char **sp; +#else +strtof(CONST char *s, char **sp) +#endif +{ + return strtof_l(s, sp, __current_locale()); +} diff --git a/gdtoa/FreeBSD/gdtoa-strtopdd.c b/gdtoa/FreeBSD/gdtoa-strtopdd.c new file mode 100644 index 0000000..48f9204 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-strtopdd.c @@ -0,0 +1,241 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 2000 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "xlocale_private.h" + +#include "gdtoaimp.h" + +#ifdef __APPLE__ +/* + * IEEE specifies that the most significant (head) double is required to + * be equal to the long double rounded to the nearest double, so that means + * the tail double might be the opposite sign as the head. We can do this + * adding (long double)0 to the number, which will fix it up. + */ +#define fixLDBL(x) ((x) += 0.L) +#endif /* __APPLE__ */ + + int +#ifdef KR_headers +strtopdd(s, sp, dd, loc) CONST char *s; char **sp; double *dd; locale_t loc; +#else +strtopdd(CONST char *s, char **sp, double *dd, locale_t loc) +#endif +{ +#ifdef Sudden_Underflow + static CONST FPI fpi0 = { 106, 1-1023, 2046-1023-106+1, 1, 1 }; +#else + static CONST FPI fpi0 = { 106, 1-1023-53+1, 2046-1023-106+1, 1, 0 }; +#endif + ULong bits[4]; + Long exp; + int i, j, rv; + typedef union { + double d[2]; + ULong L[4]; +#ifdef __APPLE__ + long double ld; +#endif /* __APPLE__ */ + } U; + U *u; +#ifdef Honor_FLT_ROUNDS +#include "gdtoa_fltrnds.h" +#else +#define fpi &fpi0 +#endif + + rv = strtodg(s, sp, fpi, &exp, bits, loc); + u = (U*)dd; + switch(rv & STRTOG_Retmask) { + case STRTOG_NoNumber: + u->d[0] = u->d[1] = 0.; + return rv; // avoid setting sign + + case STRTOG_Zero: + u->d[0] = u->d[1] = 0.; + break; + + case STRTOG_Normal: + u->L[_1] = (bits[1] >> 21 | bits[2] << 11) & 0xffffffffL; + u->L[_0] = (bits[2] >> 21) | ((bits[3] << 11) & 0xfffff) + | ((exp + 0x3ff + 105) << 20); + exp += 0x3ff + 52; + if (bits[1] &= 0x1fffff) { + i = hi0bits(bits[1]) - 11; + if (i >= exp) { + i = exp - 1; + exp = 0; + } + else + exp -= i; + if (i > 0) { + bits[1] = bits[1] << i | bits[0] >> (32-i); + bits[0] = bits[0] << i & 0xffffffffL; + } + } + else if (bits[0]) { + i = hi0bits(bits[0]) + 21; + if (i >= exp) { + i = exp - 1; + exp = 0; + } + else + exp -= i; + if (i < 32) { + bits[1] = bits[0] >> (32 - i); + bits[0] = bits[0] << i & 0xffffffffL; + } + else { + bits[1] = bits[0] << (i - 32); + bits[0] = 0; + } + } + else { + u->L[2] = u->L[3] = 0; + break; + } + u->L[2+_1] = bits[0]; + u->L[2+_0] = (bits[1] & 0xfffff) | (exp << 20); +#ifdef __APPLE__ + fixLDBL(u->ld); +#endif /* __APPLE__ */ + break; + + case STRTOG_Denormal: + if (bits[3]) + goto nearly_normal; + if (bits[2]) + goto partly_normal; + if (bits[1] & 0xffe00000) + goto hardly_normal; + /* completely denormal */ + u->L[2] = u->L[3] = 0; + u->L[_1] = bits[0]; + u->L[_0] = bits[1]; + break; + + nearly_normal: + i = hi0bits(bits[3]) - 11; /* i >= 12 */ + j = 32 - i; + u->L[_0] = ((bits[3] << i | bits[2] >> j) & 0xfffff) + | ((65 - i) << 20); + u->L[_1] = (bits[2] << i | bits[1] >> j) & 0xffffffffL; + u->L[2+_0] = bits[1] & ((1L << j) - 1); + u->L[2+_1] = bits[0]; +#ifdef __APPLE__ + fixLDBL(u->ld); +#endif /* __APPLE__ */ + break; + + partly_normal: + i = hi0bits(bits[2]) - 11; + if (i < 0) { + j = -i; + i += 32; + u->L[_0] = (bits[2] >> j & 0xfffff) | (33 + j) << 20; + u->L[_1] = ((bits[2] << i) | (bits[1] >> j)) & 0xffffffffL; + u->L[2+_0] = bits[1] & ((1L << j) - 1); + u->L[2+_1] = bits[0]; +#ifdef __APPLE__ + fixLDBL(u->ld); +#endif /* __APPLE__ */ + break; + } + if (i == 0) { + u->L[_0] = (bits[2] & 0xfffff) | (33 << 20); + u->L[_1] = bits[1]; + u->L[2+_0] = 0; + u->L[2+_1] = bits[0]; +#ifdef __APPLE__ + fixLDBL(u->ld); +#endif /* __APPLE__ */ + break; + } + j = 32 - i; + u->L[_0] = (((bits[2] << i) | (bits[1] >> j)) & 0xfffff) + | ((j + 1) << 20); + u->L[_1] = (bits[1] << i | bits[0] >> j) & 0xffffffffL; + u->L[2+_0] = 0; + u->L[2+_1] = bits[0] & ((1L << j) - 1); +#ifdef __APPLE__ + fixLDBL(u->ld); +#endif /* __APPLE__ */ + break; + + hardly_normal: + j = 11 - hi0bits(bits[1]); + i = 32 - j; + u->L[_0] = (bits[1] >> j & 0xfffff) | ((j + 1) << 20); + u->L[_1] = (bits[1] << i | bits[0] >> j) & 0xffffffffL; + u->L[2+_0] = 0; + u->L[2+_1] = bits[0] & ((1L << j) - 1); +#ifdef __APPLE__ + fixLDBL(u->ld); +#endif /* __APPLE__ */ + break; + + case STRTOG_Infinite: +#ifdef __APPLE__ + u->L[_0] = 0x7ff00000; + u->L[_1] = u->L[2+_0] = u->L[2+_1] = 0; +#else /* __APPLE__ */ + u->L[_0] = u->L[2+_0] = 0x7ff00000; + u->L[_1] = u->L[2+_1] = 0; +#endif /* __APPLE__ */ + break; + + case STRTOG_NaN: +#ifdef __APPLE__ + u->L[0] = d_QNAN0; + u->L[1] = d_QNAN1; + u->L[2] = u->L[3] = 0; +#else /* __APPLE__ */ + u->L[0] = u->L[2] = d_QNAN0; + u->L[1] = u->L[3] = d_QNAN1; +#endif /* __APPLE__ */ + break; +#ifdef __APPLE__ + case STRTOG_NaNbits: + u->L[0] = d_QNAN0 | ((bits[2] >> 20 | bits[3] << 12) & 0xfffff); + u->L[1] = d_QNAN1 | bits[1] >> 20 | bits[2] << 12; + u->L[2] = u->L[3] = 0; +#endif /* __APPLE__ */ + } + if (rv & STRTOG_Neg) { + u->L[ _0] |= 0x80000000L; +#ifdef __APPLE__ + u->L[2+_0] ^= 0x80000000L; +#else /* __APPLE__ */ + u->L[2+_0] |= 0x80000000L; +#endif /* __APPLE__ */ + } + return rv; + } diff --git a/gdtoa/FreeBSD/gdtoa-strtopx.c b/gdtoa/FreeBSD/gdtoa-strtopx.c new file mode 100644 index 0000000..b8e8a34 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-strtopx.c @@ -0,0 +1,114 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 2000 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "xlocale_private.h" + +#include "gdtoaimp.h" + +#undef _0 +#undef _1 + +/* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */ + +#ifdef IEEE_MC68k +#define _0 0 +#define _1 1 +#define _2 2 +#define _3 3 +#define _4 4 +#endif +#ifdef IEEE_8087 +#define _0 4 +#define _1 3 +#define _2 2 +#define _3 1 +#define _4 0 +#endif + + int +#ifdef KR_headers +strtopx(s, sp, V, loc) CONST char *s; char **sp; void *V; locale_t loc; +#else +strtopx(CONST char *s, char **sp, void *V, locale_t loc) +#endif +{ + static FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI }; + ULong bits[2]; + Long exp; + int k; + UShort *L = (UShort*)V; +#ifdef Honor_FLT_ROUNDS +#include "gdtoa_fltrnds.h" +#else +#define fpi &fpi0 +#endif + + k = strtodg(s, sp, fpi, &exp, bits, loc); + switch(k & STRTOG_Retmask) { + case STRTOG_NoNumber: + L[0] = L[1] = L[2] = L[3] = L[4] = 0; + return k; // avoid setting sign + + case STRTOG_Zero: + L[0] = L[1] = L[2] = L[3] = L[4] = 0; + break; + + case STRTOG_Denormal: + L[_0] = 0; + goto normal_bits; + + case STRTOG_Normal: + case STRTOG_NaNbits: + L[_0] = exp + 0x3fff + 63; + normal_bits: + L[_4] = (UShort)bits[0]; + L[_3] = (UShort)(bits[0] >> 16); + L[_2] = (UShort)bits[1]; + L[_1] = (UShort)(bits[1] >> 16); + break; + + case STRTOG_Infinite: + L[_0] = 0x7fff; + L[_1] = 0x8000; + L[_2] = L[_3] = L[_4] = 0; + break; + + case STRTOG_NaN: + L[0] = ldus_QNAN0; + L[1] = ldus_QNAN1; + L[2] = ldus_QNAN2; + L[3] = ldus_QNAN3; + L[4] = ldus_QNAN4; + } + if (k & STRTOG_Neg) + L[_0] |= 0x8000; + return k; + } diff --git a/gdtoa/FreeBSD/gdtoa-strtord.c b/gdtoa/FreeBSD/gdtoa-strtord.c new file mode 100644 index 0000000..2500488 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-strtord.c @@ -0,0 +1,69 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 2000 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + + void +#ifdef KR_headers +ULtod(L, bits, exp, k) ULong *L; ULong *bits; Long exp; int k; +#else +ULtod(ULong *L, ULong *bits, Long exp, int k) +#endif +{ + switch(k & STRTOG_Retmask) { + case STRTOG_NoNumber: + case STRTOG_Zero: + L[0] = L[1] = 0; + break; + + case STRTOG_Denormal: + L[_1] = bits[0]; + L[_0] = bits[1]; + break; + + case STRTOG_Normal: + case STRTOG_NaNbits: + L[_1] = bits[0]; + L[_0] = (bits[1] & ~0x100000) | ((exp + 0x3ff + 52) << 20); + break; + + case STRTOG_Infinite: + L[_0] = 0x7ff00000; + L[_1] = 0; + break; + + case STRTOG_NaN: + L[0] = d_QNAN0; + L[1] = d_QNAN1; + } + if (k & STRTOG_Neg) + L[_0] |= 0x80000000L; + } diff --git a/gdtoa/FreeBSD/gdtoa-sum.c b/gdtoa/FreeBSD/gdtoa-sum.c new file mode 100644 index 0000000..dc0c88b --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-sum.c @@ -0,0 +1,98 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + + Bigint * +#ifdef KR_headers +sum(a, b) Bigint *a; Bigint *b; +#else +sum(Bigint *a, Bigint *b) +#endif +{ + Bigint *c; + ULong carry, *xc, *xa, *xb, *xe, y; +#ifdef Pack_32 + ULong z; +#endif + + if (a->wds < b->wds) { + c = b; b = a; a = c; + } + c = Balloc(a->k); + c->wds = a->wds; + carry = 0; + xa = a->x; + xb = b->x; + xc = c->x; + xe = xc + b->wds; +#ifdef Pack_32 + do { + y = (*xa & 0xffff) + (*xb & 0xffff) + carry; + carry = (y & 0x10000) >> 16; + z = (*xa++ >> 16) + (*xb++ >> 16) + carry; + carry = (z & 0x10000) >> 16; + Storeinc(xc, z, y); + } + while(xc < xe); + xe += a->wds - b->wds; + while(xc < xe) { + y = (*xa & 0xffff) + carry; + carry = (y & 0x10000) >> 16; + z = (*xa++ >> 16) + carry; + carry = (z & 0x10000) >> 16; + Storeinc(xc, z, y); + } +#else + do { + y = *xa++ + *xb++ + carry; + carry = (y & 0x10000) >> 16; + *xc++ = y & 0xffff; + } + while(xc < xe); + xe += a->wds - b->wds; + while(xc < xe) { + y = *xa++ + carry; + carry = (y & 0x10000) >> 16; + *xc++ = y & 0xffff; + } +#endif + if (carry) { + if (c->wds == c->maxwds) { + b = Balloc(c->k + 1); + Bcopy(b, c); + Bfree(c); + c = b; + } + c->x[c->wds++] = 1; + } + return c; + } diff --git a/gdtoa/FreeBSD/gdtoa-ulp.c b/gdtoa/FreeBSD/gdtoa-ulp.c new file mode 100644 index 0000000..17e9f86 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa-ulp.c @@ -0,0 +1,70 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998, 1999 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#include "gdtoaimp.h" + + double +ulp +#ifdef KR_headers + (x) U *x; +#else + (U *x) +#endif +{ + Long L; + U a; + + L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; +#ifndef Sudden_Underflow + if (L > 0) { +#endif +#ifdef IBM + L |= Exp_msk1 >> 4; +#endif + word0(&a) = L; + word1(&a) = 0; +#ifndef Sudden_Underflow + } + else { + L = -L >> Exp_shift; + if (L < Exp_shift) { + word0(&a) = 0x80000 >> L; + word1(&a) = 0; + } + else { + word0(&a) = 0; + L -= Exp_shift; + word1(&a) = L >= 31 ? 1 : 1 << (31 - L); + } + } +#endif + return dval(&a); + } diff --git a/gdtoa/FreeBSD/gdtoa.h b/gdtoa/FreeBSD/gdtoa.h new file mode 100644 index 0000000..317612d --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa.h @@ -0,0 +1,154 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +#ifndef GDTOA_H_INCLUDED +#define GDTOA_H_INCLUDED + +#include "arith.h" +#include /* for size_t */ + +#ifndef Long +#define Long long +#endif +#ifndef ULong +typedef unsigned Long ULong; +#endif +#ifndef UShort +typedef unsigned short UShort; +#endif + +#ifndef ANSI +#ifdef KR_headers +#define ANSI(x) () +#define Void /*nothing*/ +#else +#define ANSI(x) x +#define Void void +#endif +#endif /* ANSI */ + +#ifndef CONST +#ifdef KR_headers +#define CONST /* blank */ +#else +#define CONST const +#endif +#endif /* CONST */ + + enum { /* return values from strtodg */ + STRTOG_Zero = 0, + STRTOG_Normal = 1, + STRTOG_Denormal = 2, + STRTOG_Infinite = 3, + STRTOG_NaN = 4, + STRTOG_NaNbits = 5, + STRTOG_NoNumber = 6, + STRTOG_Retmask = 7, + + /* The following may be or-ed into one of the above values. */ + + STRTOG_Neg = 0x08, /* does not affect STRTOG_Inexlo or STRTOG_Inexhi */ + STRTOG_Inexlo = 0x10, /* returned result rounded toward zero */ + STRTOG_Inexhi = 0x20, /* returned result rounded away from zero */ + STRTOG_Inexact = 0x30, + STRTOG_Underflow= 0x40, + STRTOG_Overflow = 0x80 + }; + + typedef struct +FPI { + int nbits; + int emin; + int emax; + int rounding; + int sudden_underflow; + } FPI; + +enum { /* FPI.rounding values: same as FLT_ROUNDS */ + FPI_Round_zero = 0, + FPI_Round_near = 1, + FPI_Round_up = 2, + FPI_Round_down = 3 + }; + +#ifdef __cplusplus +extern "C" { +#endif + +extern char* dtoa ANSI((double d, int mode, int ndigits, int *decpt, + int *sign, char **rve)); +extern char* gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp, + int mode, int ndigits, int *decpt, char **rve)); +extern void freedtoa ANSI((char*)); +extern float strtof ANSI((CONST char *, char **)); +extern double strtod ANSI((CONST char *, char **)); +extern int strtodg ANSI((CONST char*, char**, CONST FPI*, Long*, ULong*, locale_t)) __DARWIN_ALIAS(strtodg); + +extern char* g_ddfmt ANSI((char*, double*, int, size_t)); +extern char* g_dfmt ANSI((char*, double*, int, size_t)); +extern char* g_ffmt ANSI((char*, float*, int, size_t)); +extern char* g_Qfmt ANSI((char*, void*, int, size_t)); +extern char* g_xfmt ANSI((char*, void*, int, size_t)); +extern char* g_xLfmt ANSI((char*, void*, int, size_t)); + +extern int strtoId ANSI((CONST char*, char**, double*, double*)); +extern int strtoIdd ANSI((CONST char*, char**, double*, double*)); +extern int strtoIf ANSI((CONST char*, char**, float*, float*)); +extern int strtoIQ ANSI((CONST char*, char**, void*, void*)); +extern int strtoIx ANSI((CONST char*, char**, void*, void*)); +extern int strtoIxL ANSI((CONST char*, char**, void*, void*)); +extern int strtord ANSI((CONST char*, char**, int, double*)); +extern int strtordd ANSI((CONST char*, char**, int, double*)); +extern int strtorf ANSI((CONST char*, char**, int, float*)); +extern int strtorQ ANSI((CONST char*, char**, int, void*)); +extern int strtorx ANSI((CONST char*, char**, int, void*)); +extern int strtorxL ANSI((CONST char*, char**, int, void*)); +#if 1 +extern int strtodI ANSI((CONST char*, char**, double*)); +extern int strtopd ANSI((CONST char*, char**, double*)); +extern int strtopdd ANSI((CONST char*, char**, double*, locale_t)); +extern int strtopf ANSI((CONST char*, char**, float*)); +extern int strtopQ ANSI((CONST char*, char**, void*)); +extern int strtopx ANSI((CONST char*, char**, void*, locale_t)); +extern int strtopxL ANSI((CONST char*, char**, void*)); +#else +#define strtopd(s,se,x) strtord(s,se,1,x) +#define strtopdd(s,se,x) strtordd(s,se,1,x) +#define strtopf(s,se,x) strtorf(s,se,1,x) +#define strtopQ(s,se,x) strtorQ(s,se,1,x) +#define strtopx(s,se,x) strtorx(s,se,1,x) +#define strtopxL(s,se,x) strtorxL(s,se,1,x) +#endif + +#ifdef __cplusplus +} +#endif +#endif /* GDTOA_H_INCLUDED */ diff --git a/gdtoa/FreeBSD/gdtoa_fltrnds.h b/gdtoa/FreeBSD/gdtoa_fltrnds.h new file mode 100644 index 0000000..f170de5 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoa_fltrnds.h @@ -0,0 +1,19 @@ + CONST FPI *fpi; + FPI fpi1; + int Rounding; +#ifdef Trust_FLT_ROUNDS /*{{ only define this if FLT_ROUNDS really works! */ + Rounding = Flt_Rounds; +#else /*}{*/ + Rounding = 1; + switch(fegetround()) { + case FE_TOWARDZERO: Rounding = 0; break; + case FE_UPWARD: Rounding = 2; break; + case FE_DOWNWARD: Rounding = 3; + } +#endif /*}}*/ + fpi = &fpi0; + if (Rounding != 1) { + fpi1 = fpi0; + fpi = &fpi1; + fpi1.rounding = Rounding; + } diff --git a/gdtoa/FreeBSD/gdtoaimp.h b/gdtoa/FreeBSD/gdtoaimp.h new file mode 100644 index 0000000..b967e81 --- /dev/null +++ b/gdtoa/FreeBSD/gdtoaimp.h @@ -0,0 +1,741 @@ +/**************************************************************** + +The author of this software is David M. Gay. + +Copyright (C) 1998-2000 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +****************************************************************/ + +/* This is a variation on dtoa.c that converts arbitary binary + floating-point formats to and from decimal notation. It uses + double-precision arithmetic internally, so there are still + various #ifdefs that adapt the calculations to the native + double-precision arithmetic (any of IEEE, VAX D_floating, + or IBM mainframe arithmetic). + + Please send bug reports to David M. Gay (dmg at acm dot org, + with " at " changed at "@" and " dot " changed to "."). + */ + +/* On a machine with IEEE extended-precision registers, it is + * necessary to specify double-precision (53-bit) rounding precision + * before invoking strtod or dtoa. If the machine uses (the equivalent + * of) Intel 80x87 arithmetic, the call + * _control87(PC_53, MCW_PC); + * does this with many compilers. Whether this or another call is + * appropriate depends on the compiler; for this to work, it may be + * necessary to #include "float.h" or another system-dependent header + * file. + */ + +/* strtod for IEEE-, VAX-, and IBM-arithmetic machines. + * + * This strtod returns a nearest machine number to the input decimal + * string (or sets errno to ERANGE). With IEEE arithmetic, ties are + * broken by the IEEE round-even rule. Otherwise ties are broken by + * biased rounding (add half and chop). + * + * Inspired loosely by William D. Clinger's paper "How to Read Floating + * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 112-126]. + * + * Modifications: + * + * 1. We only require IEEE, IBM, or VAX double-precision + * arithmetic (not IEEE double-extended). + * 2. We get by with floating-point arithmetic in a case that + * Clinger missed -- when we're computing d * 10^n + * for a small integer d and the integer n is not too + * much larger than 22 (the maximum integer k for which + * we can represent 10^k exactly), we may be able to + * compute (d*10^k) * 10^(e-k) with just one roundoff. + * 3. Rather than a bit-at-a-time adjustment of the binary + * result in the hard case, we use floating-point + * arithmetic to determine the adjustment to within + * one bit; only in really hard cases do we need to + * compute a second residual. + * 4. Because of 3., we don't need a large table of powers of 10 + * for ten-to-e (just some small tables, e.g. of 10^k + * for 0 <= k <= 22). + */ + +/* + * #define IEEE_8087 for IEEE-arithmetic machines where the least + * significant byte has the lowest address. + * #define IEEE_MC68k for IEEE-arithmetic machines where the most + * significant byte has the lowest address. + * #define Long int on machines with 32-bit ints and 64-bit longs. + * #define Sudden_Underflow for IEEE-format machines without gradual + * underflow (i.e., that flush to zero on underflow). + * #define IBM for IBM mainframe-style floating-point arithmetic. + * #define VAX for VAX-style floating-point arithmetic (D_floating). + * #define No_leftright to omit left-right logic in fast floating-point + * computation of dtoa. + * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3. + * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines + * that use extended-precision instructions to compute rounded + * products and quotients) with IBM. + * #define ROUND_BIASED for IEEE-format with biased rounding. + * #define Inaccurate_Divide for IEEE-format with correctly rounded + * products but inaccurate quotients, e.g., for Intel i860. + * #define NO_LONG_LONG on machines that do not have a "long long" + * integer type (of >= 64 bits). On such machines, you can + * #define Just_16 to store 16 bits per 32-bit Long when doing + * high-precision integer arithmetic. Whether this speeds things + * up or slows things down depends on the machine and the number + * being converted. If long long is available and the name is + * something other than "long long", #define Llong to be the name, + * and if "unsigned Llong" does not work as an unsigned version of + * Llong, #define #ULLong to be the corresponding unsigned type. + * #define KR_headers for old-style C function headers. + * #define Bad_float_h if your system lacks a float.h or if it does not + * define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP, + * FLT_RADIX, FLT_ROUNDS, and DBL_MAX. + * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n) + * if memory is available and otherwise does something you deem + * appropriate. If MALLOC is undefined, malloc will be invoked + * directly -- and assumed always to succeed. Similarly, if you + * want something other than the system's free() to be called to + * recycle memory acquired from MALLOC, #define FREE to be the + * name of the alternate routine. (FREE or free is only called in + * pathological cases, e.g., in a gdtoa call after a gdtoa return in + * mode 3 with thousands of digits requested.) + * #define Omit_Private_Memory to omit logic (added Jan. 1998) for making + * memory allocations from a private pool of memory when possible. + * When used, the private pool is PRIVATE_MEM bytes long: 2304 bytes, + * unless #defined to be a different length. This default length + * suffices to get rid of MALLOC calls except for unusual cases, + * such as decimal-to-binary conversion of a very long string of + * digits. When converting IEEE double precision values, the + * longest string gdtoa can return is about 751 bytes long. For + * conversions by strtod of strings of 800 digits and all gdtoa + * conversions of IEEE doubles in single-threaded executions with + * 8-byte pointers, PRIVATE_MEM >= 7400 appears to suffice; with + * 4-byte pointers, PRIVATE_MEM >= 7112 appears adequate. + * #define NO_INFNAN_CHECK if you do not wish to have INFNAN_CHECK + * #defined automatically on IEEE systems. On such systems, + * when INFNAN_CHECK is #defined, strtod checks + * for Infinity and NaN (case insensitively). + * When INFNAN_CHECK is #defined and No_Hex_NaN is not #defined, + * strtodg also accepts (case insensitively) strings of the form + * NaN(x), where x is a string of hexadecimal digits (optionally + * preceded by 0x or 0X) and spaces; if there is only one string + * of hexadecimal digits, it is taken for the fraction bits of the + * resulting NaN; if there are two or more strings of hexadecimal + * digits, each string is assigned to the next available sequence + * of 32-bit words of fractions bits (starting with the most + * significant), right-aligned in each sequence. + * Unless GDTOA_NON_PEDANTIC_NANCHECK is #defined, input "NaN(...)" + * is consumed even when ... has the wrong form (in which case the + * "(...)" is consumed but ignored). + * #define MULTIPLE_THREADS if the system offers preemptively scheduled + * multiple threads. In this case, you must provide (or suitably + * #define) two locks, acquired by ACQUIRE_DTOA_LOCK(n) and freed + * by FREE_DTOA_LOCK(n) for n = 0 or 1. (The second lock, accessed + * in pow5mult, ensures lazy evaluation of only one copy of high + * powers of 5; omitting this lock would introduce a small + * probability of wasting memory, but would otherwise be harmless.) + * You must also invoke freedtoa(s) to free the value s returned by + * dtoa. You may do so whether or not MULTIPLE_THREADS is #defined. + * #define IMPRECISE_INEXACT if you do not care about the setting of + * the STRTOG_Inexact bits in the special case of doing IEEE double + * precision conversions (which could also be done by the strtod in + * dtoa.c). + * #define NO_HEX_FP to disable recognition of C9x's hexadecimal + * floating-point constants. + * #define -DNO_ERRNO to suppress setting errno (in strtod.c and + * strtodg.c). + * #define NO_STRING_H to use private versions of memcpy. + * On some K&R systems, it may also be necessary to + * #define DECLARE_SIZE_T in this case. + * #define USE_LOCALE to use the current locale's decimal_point value. + */ + +#ifndef GDTOAIMP_H_INCLUDED +#define GDTOAIMP_H_INCLUDED +/* + * Paranoia: Protect exported symbols, including ones in files we don't + * compile right now. The standard strtof and strtod survive. + */ +#define dtoa __dtoa +#define gdtoa __gdtoa +#define freedtoa __freedtoa +#define strtodg __strtodg +#define g_ddfmt __g_ddfmt +#define g_dfmt __g_dfmt +#define g_ffmt __g_ffmt +#define g_Qfmt __g_Qfmt +#define g_xfmt __g_xfmt +#define g_xLfmt __g_xLfmt +#define strtoId __strtoId +#define strtoIdd __strtoIdd +#define strtoIf __strtoIf +#define strtoIQ __strtoIQ +#define strtoIx __strtoIx +#define strtoIxL __strtoIxL +#define strtord __strtord +#define strtordd __strtordd +#define strtorf __strtorf +#define strtorQ __strtorQ +#define strtorx __strtorx +#define strtorxL __strtorxL +#define strtodI __strtodI +#define strtopd __strtopd +#define strtopdd __strtopdd +#define strtopf __strtopf +#define strtopQ __strtopQ +#define strtopx __strtopx +#define strtopxL __strtopxL + +/* Protect gdtoa-internal symbols */ +#define Balloc __Balloc_D2A +#define Bfree __Bfree_D2A +#define ULtoQ __ULtoQ_D2A +#define ULtof __ULtof_D2A +#define ULtod __ULtod_D2A +#define ULtodd __ULtodd_D2A +#define ULtox __ULtox_D2A +#define ULtoxL __ULtoxL_D2A +#define any_on __any_on_D2A +#define b2d __b2d_D2A +#define bigtens __bigtens_D2A +#define cmp __cmp_D2A +#define copybits __copybits_D2A +#define d2b __d2b_D2A +#define decrement __decrement_D2A +#define diff __diff_D2A +#define dtoa_result __dtoa_result_D2A +#define g__fmt __g__fmt_D2A +#define gethex __gethex_D2A +#define hexdig __hexdig_D2A +#define hexdig_init_D2A __hexdig_init_D2A +#define hexnan __hexnan_D2A +#define hi0bits __hi0bits_D2A +#define hi0bits_D2A __hi0bits_D2A +#define i2b __i2b_D2A +#define increment __increment_D2A +#define lo0bits __lo0bits_D2A +#define lshift __lshift_D2A +#define match __match_D2A +#define mult __mult_D2A +#define multadd __multadd_D2A +#define nrv_alloc __nrv_alloc_D2A +#define pow5mult __pow5mult_D2A +#define quorem __quorem_D2A +#define ratio __ratio_D2A +#define rshift __rshift_D2A +#define rv_alloc __rv_alloc_D2A +#define s2b __s2b_D2A +#define set_ones __set_ones_D2A +#define strcp __strcp_D2A +#define strcp_D2A __strcp_D2A +#define strtoIg __strtoIg_D2A +#define sum __sum_D2A +#define tens __tens_D2A +#define tinytens __tinytens_D2A +#define tinytens __tinytens_D2A +#define trailz __trailz_D2A +#define ulp __ulp_D2A + +#include +#include "gdtoa.h" +#include "gd_qnan.h" +#ifdef Honor_FLT_ROUNDS +#include +#endif + +#ifdef DEBUG +#include "stdio.h" +#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);} +#endif + +#include "limits.h" +#include "stdlib.h" +#include "string.h" +#include "libc_private.h" +#include "spinlock.h" + +#ifdef KR_headers +#define Char char +#else +#define Char void +#endif + +#ifdef MALLOC +extern Char *MALLOC ANSI((size_t)); +#else +#define MALLOC malloc +#endif + +#define INFNAN_CHECK +#define USE_LOCALE +#define NO_LOCALE_CACHE + +#undef IEEE_Arith +#undef Avoid_Underflow +#ifdef IEEE_MC68k +#define IEEE_Arith +#endif +#ifdef IEEE_8087 +#define IEEE_Arith +#endif + +#include "errno.h" +#ifdef Bad_float_h + +#ifdef IEEE_Arith +#define DBL_DIG 15 +#define DBL_MAX_10_EXP 308 +#define DBL_MAX_EXP 1024 +#define FLT_RADIX 2 +#define DBL_MAX 1.7976931348623157e+308 +#endif + +#ifdef IBM +#define DBL_DIG 16 +#define DBL_MAX_10_EXP 75 +#define DBL_MAX_EXP 63 +#define FLT_RADIX 16 +#define DBL_MAX 7.2370055773322621e+75 +#endif + +#ifdef VAX +#define DBL_DIG 16 +#define DBL_MAX_10_EXP 38 +#define DBL_MAX_EXP 127 +#define FLT_RADIX 2 +#define DBL_MAX 1.7014118346046923e+38 +#define n_bigtens 2 +#endif + +#ifndef LONG_MAX +#define LONG_MAX 2147483647 +#endif + +#else /* ifndef Bad_float_h */ +#include "float.h" +#endif /* Bad_float_h */ + +#ifdef IEEE_Arith +#define Scale_Bit 0x10 +#define n_bigtens 5 +#endif + +#ifdef IBM +#define n_bigtens 3 +#endif + +#ifdef VAX +#define n_bigtens 2 +#endif + +#ifndef __MATH_H__ +#include "math.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1 +Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined. +#endif + +typedef union { double d; ULong L[2]; } U; + +#ifdef IEEE_8087 +#define word0(x) (x)->L[1] +#define word1(x) (x)->L[0] +#else +#define word0(x) (x)->L[0] +#define word1(x) (x)->L[1] +#endif +#define dval(x) (x)->d + +/* The following definition of Storeinc is appropriate for MIPS processors. + * An alternative that might be better on some machines is + * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) + */ +#if defined(IEEE_8087) + defined(VAX) +#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ +((unsigned short *)a)[0] = (unsigned short)c, a++) +#else +#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ +((unsigned short *)a)[1] = (unsigned short)c, a++) +#endif + +/* #define P DBL_MANT_DIG */ +/* Ten_pmax = floor(P*log(2)/log(5)) */ +/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ +/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ +/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ + +#ifdef IEEE_Arith +#define Exp_shift 20 +#define Exp_shift1 20 +#define Exp_msk1 0x100000 +#define Exp_msk11 0x100000 +#define Exp_mask 0x7ff00000 +#define P 53 +#define Bias 1023 +#define Emin (-1022) +#define Exp_1 0x3ff00000 +#define Exp_11 0x3ff00000 +#define Ebits 11 +#define Frac_mask 0xfffff +#define Frac_mask1 0xfffff +#define Ten_pmax 22 +#define Bletch 0x10 +#define Bndry_mask 0xfffff +#define Bndry_mask1 0xfffff +#define LSB 1 +#define Sign_bit 0x80000000 +#define Log2P 1 +#define Tiny0 0 +#define Tiny1 1 +#define Quick_max 14 +#define Int_max 14 + +#ifndef Flt_Rounds +#ifdef FLT_ROUNDS +#define Flt_Rounds FLT_ROUNDS +#else +#define Flt_Rounds 1 +#endif +#endif /*Flt_Rounds*/ + +#else /* ifndef IEEE_Arith */ +#undef Sudden_Underflow +#define Sudden_Underflow +#ifdef IBM +#undef Flt_Rounds +#define Flt_Rounds 0 +#define Exp_shift 24 +#define Exp_shift1 24 +#define Exp_msk1 0x1000000 +#define Exp_msk11 0x1000000 +#define Exp_mask 0x7f000000 +#define P 14 +#define Bias 65 +#define Exp_1 0x41000000 +#define Exp_11 0x41000000 +#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ +#define Frac_mask 0xffffff +#define Frac_mask1 0xffffff +#define Bletch 4 +#define Ten_pmax 22 +#define Bndry_mask 0xefffff +#define Bndry_mask1 0xffffff +#define LSB 1 +#define Sign_bit 0x80000000 +#define Log2P 4 +#define Tiny0 0x100000 +#define Tiny1 0 +#define Quick_max 14 +#define Int_max 15 +#else /* VAX */ +#undef Flt_Rounds +#define Flt_Rounds 1 +#define Exp_shift 23 +#define Exp_shift1 7 +#define Exp_msk1 0x80 +#define Exp_msk11 0x800000 +#define Exp_mask 0x7f80 +#define P 56 +#define Bias 129 +#define Exp_1 0x40800000 +#define Exp_11 0x4080 +#define Ebits 8 +#define Frac_mask 0x7fffff +#define Frac_mask1 0xffff007f +#define Ten_pmax 24 +#define Bletch 2 +#define Bndry_mask 0xffff007f +#define Bndry_mask1 0xffff007f +#define LSB 0x10000 +#define Sign_bit 0x8000 +#define Log2P 1 +#define Tiny0 0x80 +#define Tiny1 0 +#define Quick_max 15 +#define Int_max 15 +#endif /* IBM, VAX */ +#endif /* IEEE_Arith */ + +#ifndef IEEE_Arith +#define ROUND_BIASED +#endif + +#ifdef RND_PRODQUOT +#define rounded_product(a,b) a = rnd_prod(a, b) +#define rounded_quotient(a,b) a = rnd_quot(a, b) +#ifdef KR_headers +extern double rnd_prod(), rnd_quot(); +#else +extern double rnd_prod(double, double), rnd_quot(double, double); +#endif +#else +#define rounded_product(a,b) a *= b +#define rounded_quotient(a,b) a /= b +#endif + +#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) +#define Big1 0xffffffff + +#undef Pack_16 +#ifndef Pack_32 +#define Pack_32 +#endif + +#ifdef NO_LONG_LONG +#undef ULLong +#ifdef Just_16 +#undef Pack_32 +#define Pack_16 +/* When Pack_32 is not defined, we store 16 bits per 32-bit Long. + * This makes some inner loops simpler and sometimes saves work + * during multiplications, but it often seems to make things slightly + * slower. Hence the default is now to store 32 bits per Long. + */ +#endif +#else /* long long available */ +#ifndef Llong +#define Llong long long +#endif +#ifndef ULLong +#define ULLong unsigned Llong +#endif +#endif /* NO_LONG_LONG */ + +#ifdef Pack_32 +#define ULbits 32 +#define kshift 5 +#define kmask 31 +#define ALL_ON 0xffffffff +#else +#define ULbits 16 +#define kshift 4 +#define kmask 15 +#define ALL_ON 0xffff +#endif + +#define MULTIPLE_THREADS +extern spinlock_t __gdtoa_locks[2]; +#define ACQUIRE_DTOA_LOCK(n) do { \ + if (__isthreaded) _SPINLOCK(&__gdtoa_locks[n]); \ +} while(0) +#define FREE_DTOA_LOCK(n) do { \ + if (__isthreaded) _SPINUNLOCK(&__gdtoa_locks[n]); \ +} while(0) + +#define Kmax 9 + + struct +Bigint { + struct Bigint *next; + int k, maxwds, sign, wds; + ULong x[1]; + }; + + typedef struct Bigint Bigint; + +#ifdef NO_STRING_H +#ifdef DECLARE_SIZE_T +typedef unsigned int size_t; +#endif +extern void memcpy_D2A ANSI((void*, const void*, size_t)); +#define Bcopy(x,y) memcpy_D2A(&x->sign,&y->sign,y->wds*sizeof(ULong) + 2*sizeof(int)) +#else /* !NO_STRING_H */ +#define Bcopy(x,y) memcpy(&x->sign,&y->sign,y->wds*sizeof(ULong) + 2*sizeof(int)) +#endif /* NO_STRING_H */ + + extern char *dtoa_result; + extern CONST double bigtens[], tens[], tinytens[]; + extern CONST unsigned char hexdig[]; + + extern Bigint *Balloc ANSI((int)); + extern void Bfree ANSI((Bigint*)); + extern void ULtof ANSI((ULong*, ULong*, Long, int)); + extern void ULtod ANSI((ULong*, ULong*, Long, int)); + extern void ULtodd ANSI((ULong*, ULong*, Long, int)); + extern void ULtoQ ANSI((ULong*, ULong*, Long, int)); + extern void ULtox ANSI((UShort*, ULong*, Long, int)); + extern void ULtoxL ANSI((ULong*, ULong*, Long, int)); + extern ULong any_on ANSI((Bigint*, int)); + extern double b2d ANSI((Bigint*, int*)); + extern int cmp ANSI((Bigint*, Bigint*)); + extern void copybits ANSI((ULong*, int, Bigint*)); + extern Bigint *d2b ANSI((double, int*, int*)); + extern void decrement ANSI((Bigint*)); + extern Bigint *diff ANSI((Bigint*, Bigint*)); + extern char *dtoa ANSI((double d, int mode, int ndigits, + int *decpt, int *sign, char **rve)); + extern char *g__fmt ANSI((char*, char*, char*, int, ULong, size_t)); + extern int gethex ANSI((CONST char**, CONST FPI*, Long*, Bigint**, int, locale_t)); + extern void hexdig_init_D2A(Void); + extern int hexnan ANSI((CONST char**, CONST FPI*, ULong*)); + extern int hi0bits_D2A ANSI((ULong)); + extern Bigint *i2b ANSI((int)); + extern Bigint *increment ANSI((Bigint*)); + extern int lo0bits ANSI((ULong*)); + extern Bigint *lshift ANSI((Bigint*, int)); + extern int match ANSI((CONST char**, char*)); + extern Bigint *mult ANSI((Bigint*, Bigint*)); + extern Bigint *multadd ANSI((Bigint*, int, int)); + extern char *nrv_alloc ANSI((char*, char **, int)); + extern Bigint *pow5mult ANSI((Bigint*, int)); + extern int quorem ANSI((Bigint*, Bigint*)); + extern double ratio ANSI((Bigint*, Bigint*)); + extern void rshift ANSI((Bigint*, int)); + extern char *rv_alloc ANSI((int)); + extern Bigint *s2b ANSI((CONST char*, int, int, ULong, int)); + extern Bigint *set_ones ANSI((Bigint*, int)); + extern char *strcp ANSI((char*, const char*)); + extern int strtoIg ANSI((CONST char*, char**, FPI*, Long*, Bigint**, int*)); + extern double strtod ANSI((const char *s00, char **se)); + extern double strtod_l ANSI((const char *s00, char **se, locale_t)); + extern Bigint *sum ANSI((Bigint*, Bigint*)); + extern int trailz ANSI((Bigint*)); + extern double ulp ANSI((U*)); + +#ifdef __cplusplus +} +#endif +/* + * NAN_WORD0 and NAN_WORD1 are only referenced in strtod.c. Prior to + * 20050115, they used to be hard-wired here (to 0x7ff80000 and 0, + * respectively), but now are determined by compiling and running + * qnan.c to generate gd_qnan.h, which specifies d_QNAN0 and d_QNAN1. + * Formerly gdtoaimp.h recommended supplying suitable -DNAN_WORD0=... + * and -DNAN_WORD1=... values if necessary. This should still work. + * (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.) + */ +#ifdef IEEE_Arith +#ifndef NO_INFNAN_CHECK +#undef INFNAN_CHECK +#define INFNAN_CHECK +#endif +#ifdef IEEE_MC68k +#define _0 0 +#define _1 1 +#ifndef NAN_WORD0 +#define NAN_WORD0 d_QNAN0 +#endif +#ifndef NAN_WORD1 +#define NAN_WORD1 d_QNAN1 +#endif +#else +#define _0 1 +#define _1 0 +#ifndef NAN_WORD0 +#define NAN_WORD0 d_QNAN1 +#endif +#ifndef NAN_WORD1 +#define NAN_WORD1 d_QNAN0 +#endif +#endif +#else +#undef INFNAN_CHECK +#endif + +#undef SI +#ifdef Sudden_Underflow +#define SI 1 +#else +#define SI 0 +#endif + +/* + * For very large strings, strtod and family might exhaust memory in tight + * memory conditions (especially in 32-bits). Such large strings could also + * tie up a CPU for minutes at a time. Either can be considered a denial-of- + * service vunerability. + * + * To fix, we limit the string size to the maximum we need to calculate the + * rounding point correctly. The longest string corresponding to the exact + * value of a floating point number occuring at 1.f...f p^-n, where n is + * the (absolute value of the) smallest exponent for a normalize number. + * + * To calculate this number of decimal digits, we use the formula: + * + * (n + m) - int(n * log10(2)) + 3 + * + * where m is the number of bits in the f...f fraction. This is the number + * of decimal digits for the least significant bit minus the number of leading + * zeros for the most significant bit (the '1'), plus a few to compensate for + * an extra digits due to the full 1.f...f value, an extra digit for the + * mid-way point for rounding and an extra guard digit. + * + * Using the approximation log10(2) ~ 1233 / (2^12), converting to the fpi.emin + * and fpi.nbits values, we get: + * + * -fpi.emin -((1233 * (-fpi.nbits - fpi.emin)) >> 12) + 3 + * + * Finally, we add an extra digit, either '1' or '0', to represent whether + * to-be-truncated digits contain a non-zero digit, or are all zeros, + * respectively. + * + * The truncated string is allocated on the heap, so code using + * TRUNCATE_DIGITS() will need to free that space when no longer needed. + * Pass a char * as the second argument, initialized to NULL; if its value + * becomes non-NULL, memory was allocated. + */ +#define LOG2NUM 1233 +#define LOG2DENOMSHIFT 12 +#define TRUNCATEDIGITS(_nbits, _emin) (-(_emin) - ((LOG2NUM * (-(_nbits) - (_emin))) >> LOG2DENOMSHIFT) + 3) + +#define TRUNCATE_DIGITS(_s0, _temp, _nd, _nd0, _nf, _nbits, _emin, _dplen) \ +{ \ + int _maxdigits = TRUNCATEDIGITS((_nbits), (_emin)); \ + if ((_nd) > _maxdigits && \ + ((_temp) = MALLOC(_maxdigits + (_dplen) + 2)) != NULL) { \ + char *_tp = (_temp) + _maxdigits; \ + if ((_nd0) >= _maxdigits) { \ + memcpy((_temp), (_s0), _maxdigits); \ + if ((_nd) > (_nd0)) *_tp++ = '1'; \ + else { \ + const char *_q = (_s0) + _maxdigits; \ + int _n = (_nd0) - _maxdigits; \ + for(; _n > 0 && *_q == '0'; _n--, _q++) {} \ + *_tp++ = _n > 0 ? '1' : '0'; \ + } \ + (_nf) = -((_nd0) - (_maxdigits + 1)); \ + (_nd0) = _maxdigits + 1; \ + } \ + else if ((_nd0) == 0) { \ + memcpy((_temp), (_s0), _maxdigits); \ + *_tp++ = '1'; \ + (_nf) -= ((_nd) - (_maxdigits + 1)); \ + } \ + else { \ + memcpy((_temp), (_s0), _maxdigits + (_dplen)); \ + _tp += (_dplen); \ + *_tp++ = '1'; \ + (_nf) = (_maxdigits + 1) - (_nd0); \ + } \ + *_tp = 0; \ + (_nd) = _maxdigits + 1; \ + (_s0) = (_temp); \ + } \ + } + +#endif /* GDTOAIMP_H_INCLUDED */ diff --git a/gdtoa/FreeBSD/glue.c b/gdtoa/FreeBSD/glue.c new file mode 100644 index 0000000..0db1914 --- /dev/null +++ b/gdtoa/FreeBSD/glue.c @@ -0,0 +1,10 @@ +/* + * Machine-independent glue to integrate David Gay's gdtoa + * package into libc. + * + * $FreeBSD: src/lib/libc/gdtoa/glue.c,v 1.1 2003/03/12 20:29:58 das Exp $ + */ + +#include "spinlock.h" + +spinlock_t __gdtoa_locks[2]; diff --git a/gdtoa/FreeBSD/machdep_ldisQ.c b/gdtoa/FreeBSD/machdep_ldisQ.c new file mode 100644 index 0000000..fca9c29 --- /dev/null +++ b/gdtoa/FreeBSD/machdep_ldisQ.c @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Machine-dependent glue to integrate David Gay's gdtoa + * package into libc for architectures where a long double + * uses quad precision, such as sparc64. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisQ.c,v 1.2 2003/04/09 05:58:43 das Exp $"); + +#include "gdtoaimp.h" + +long double +strtold(const char * __restrict s, char ** __restrict sp) +{ + long double result; + + strtopQ(s, sp, &result); + return result; +} diff --git a/gdtoa/FreeBSD/machdep_ldisd.c b/gdtoa/FreeBSD/machdep_ldisd.c new file mode 100644 index 0000000..f674ebc --- /dev/null +++ b/gdtoa/FreeBSD/machdep_ldisd.c @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Machine-dependent glue to integrate David Gay's gdtoa + * package into libc for architectures where a long double + * is the same as a double, such as the Alpha. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisd.c,v 1.1 2003/03/12 20:29:58 das Exp $"); + +#include "gdtoaimp.h" + +long double +strtold(const char * __restrict s, char ** __restrict sp) +{ + + return strtod(s, sp); +} + +long double +strtold_l(const char * __restrict s, char ** __restrict sp, locale_t loc) +{ + + return strtod_l(s, sp, loc); +} + diff --git a/gdtoa/FreeBSD/machdep_ldisdd.c b/gdtoa/FreeBSD/machdep_ldisdd.c new file mode 100644 index 0000000..a07a21b --- /dev/null +++ b/gdtoa/FreeBSD/machdep_ldisdd.c @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Machine-dependent glue to integrate David Gay's gdtoa + * package into libc for architectures where a long double + * is a head/tail pair of doubles + */ + +#include + +#include "xlocale_private.h" + +#include "gdtoaimp.h" + +long double +strtold(const char * __restrict s, char ** __restrict sp) +{ + long double result; + + strtopdd(s, sp, (double *)&result, __current_locale()); + return result; +} + +long double +strtold_l(const char * __restrict s, char ** __restrict sp, locale_t loc) +{ + long double result; + + NORMALIZE_LOCALE(loc); + strtopdd(s, sp, (double *)&result, loc); + return result; +} diff --git a/gdtoa/FreeBSD/machdep_ldisx.c b/gdtoa/FreeBSD/machdep_ldisx.c new file mode 100644 index 0000000..64b14d4 --- /dev/null +++ b/gdtoa/FreeBSD/machdep_ldisx.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Machine-dependent glue to integrate David Gay's gdtoa + * package into libc for architectures where a long double + * is an IEEE extended precision number. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisx.c,v 1.2 2003/04/09 05:58:43 das Exp $"); + +#include "xlocale_private.h" + +#include "gdtoaimp.h" + +long double +strtold(const char * __restrict s, char ** __restrict sp) +{ + long double result; + + strtopx(s, sp, &result, __current_locale()); + return result; +} + +long double +strtold_l(const char * __restrict s, char ** __restrict sp, locale_t loc) +{ + long double result; + + NORMALIZE_LOCALE(loc); + strtopx(s, sp, &result, loc); + return result; +} diff --git a/gdtoa/_ldbl_util.c b/gdtoa/_ldbl_util.c new file mode 100644 index 0000000..5028b20 --- /dev/null +++ b/gdtoa/_ldbl_util.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2004, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http:www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include + +#include "fpmath.h" + +#define BITS64 64 +#define DBL_BIAS (DBL_MAX_EXP - 1) +#define DBL_SUBEXP (-DBL_BIAS + 1) +#define LL_BITS (8 * sizeof(int64_t)) +#define LL_HIGHBIT (1LL << 63) + +__private_extern__ int +_ldbl2array32dd(union IEEEl2bits u, uint32_t *a) +{ + int bit, shift, highbit, dexp; + uint64_t a64[2]; + int64_t t64; + int extrabit = 0; + + if(u.d[0] == 0.0) { + a[0] = a[1] = a[2] = a[3] = 0; + return 0; + } + + bzero(a64, sizeof(a64)); + + switch (__fpclassifyd(u.d[0])) { + case FP_NORMAL: + /* + * special case: if the head double only has the high (hidden) + * bit set, and the tail double is non-zero and is opposite + * in sign, then we increment extrabit to keep 106 bit + * precision in the results. + */ + if(u.bits.manh == 0 && u.d[1] != 0 && u.bits.sign != u.bits.sign2) + extrabit++; + a64[1] = (1LL << (LDBL_MANT_DIG - BITS64 - 1 + extrabit)); + a64[1] |= ((uint64_t)u.bits.manh >> (BITS64 - LDBL_MANL_SIZE - extrabit)); + a64[0] = ((uint64_t)u.bits.manh << (LDBL_MANL_SIZE + extrabit)); + break; + case FP_SUBNORMAL: + a64[1] |= ((uint64_t)u.bits.manh >> (BITS64 - LDBL_MANL_SIZE)); + a64[0] = ((uint64_t)u.bits.manh << LDBL_MANL_SIZE); + /* the tail double will be zero, so we are done */ + goto done; + default: + goto done; + } + + dexp = (int)u.bits.exp - (int)u.bits.exp2; + /* + * if the tail double is so small to not fit in LDBL_MANT_DIG bits, + * then just skip it. + */ + if (dexp >= LDBL_MANT_DIG + extrabit) { + reshift: + if (extrabit) { + bit = a64[1] & 1; + a64[1] >>= 1; + a64[0] >>= 1; + a64[0] |= ((uint64_t)bit) << (BITS64 - 1); + extrabit = 0; + } + goto done; + } + + switch (__fpclassifyd(u.d[1])) { + case FP_NORMAL: + bit = LDBL_MANT_DIG - dexp - 1 + extrabit; + t64 = (1LL << bit); + break; + case FP_SUBNORMAL: + bit = LDBL_MANT_DIG - (int)u.bits.exp + extrabit; + t64 = 0; + break; + default: + /* should never get here */ + goto reshift; + } + shift = LDBL_MANL_SIZE - bit - 1; + if (shift >= 0) + t64 |= (u.bits.manl >> shift); + else + t64 |= (u.bits.manl << (-shift)); + highbit = ((a64[0] & LL_HIGHBIT) != 0); + if (u.bits.sign == u.bits.sign2) { + a64[0] += t64; + if (highbit && !(a64[0] & LL_HIGHBIT)) /* carry */ + a64[1]++; + } else { + a64[0] -= t64; + if (!highbit && (a64[0] & LL_HIGHBIT)) /* borrow */ + a64[1]--; + } + + done: + a[0] = (uint32_t)a64[0]; + a[1] = (uint32_t)(a64[0] >> 32); + a[2] = (uint32_t)a64[1]; + a[3] = (uint32_t)(a64[1] >> 32); + return extrabit; +} diff --git a/gdtoa/arith.h b/gdtoa/arith.h new file mode 100644 index 0000000..0f5dd96 --- /dev/null +++ b/gdtoa/arith.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * These values generated by arithchk.c in the FreeBSD contrib/gdtoa package + * and spliced together for the different architectures. + */ + +#if defined(__i386__) +#define IEEE_8087 +#define Arith_Kind_ASL 1 +#elif defined(__x86_64__) +#define IEEE_8087 +#define Arith_Kind_ASL 1 +#define Long int +#define Intcast (int)(long) +#define Double_Align +#define X64_bit_pointers +#elif defined(__arm__) +#if __VFP_FP__ +#define IEEE_8087 +#else +#define IEEE_MC68k +#endif +#define Arith_Kind_ASL 1 +#elif defined(__arm64__) +#define IEEE_8087 +#define Arith_Kind_ASL 1 +#define Long int +#define Intcast (int)(long) +#define Double_Align +#define X64_bit_pointers +#else +#error Unsupported architecture +#endif + +#define Honor_FLT_ROUNDS +#define Trust_FLT_ROUNDS diff --git a/gdtoa/gd_qnan.h b/gdtoa/gd_qnan.h new file mode 100644 index 0000000..7c570ba --- /dev/null +++ b/gdtoa/gd_qnan.h @@ -0,0 +1,33 @@ +#if defined(__ppc__) || defined(__ppc64__) + +#define f_QNAN 0x7fc00000 +#define d_QNAN0 0x7ff80000 +#define d_QNAN1 0x0 +#define ld_QNAN0 0x7ff80000 +#define ld_QNAN1 0x0 +#define ld_QNAN2 0x0 +#define ld_QNAN3 0x0 +#define ldus_QNAN0 0x7ff8 +#define ldus_QNAN1 0x0 +#define ldus_QNAN2 0x0 +#define ldus_QNAN3 0x0 +#define ldus_QNAN4 0x0 + +#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__arm64__) + +#define f_QNAN 0x7fc00000 +#define d_QNAN0 0x0 +#define d_QNAN1 0x7ff80000 +#define ld_QNAN0 0x0 +#define ld_QNAN1 0xc0000000 +#define ld_QNAN2 0x7fff +#define ld_QNAN3 0x0 +#define ldus_QNAN0 0x0 +#define ldus_QNAN1 0x0 +#define ldus_QNAN2 0x0 +#define ldus_QNAN3 0xc000 +#define ldus_QNAN4 0x7fff + +#else +#error unknown architecture +#endif diff --git a/gdtoa/gdtoa.tgz b/gdtoa/gdtoa.tgz new file mode 100644 index 0000000000000000000000000000000000000000..24495296a90391f521bd2d6a42cd9306123700ea GIT binary patch literal 118424 zcmV()K;OR~iwFRcpBzg71Jqki)H*UbAIh)T?GaTros3&y61DI81^28*=1y*ADwbSF{<1pGZ zEh3CD8!if)S2`+fHP1|ClQydRr#L*CbEJ>V&5bDsdiy}1gfT98=8qsG5)T?hD=9effO1KhTTCNbl`E9qv8dQzQe-zI~cIn;1MBW3s}{U+K$YY0Aq( z8O6p910E!abwxh>Y+P#A1HJq51V?8x?;@}z|f^b+DUIybR#4uTx$ zxt+~*`#Rn+Gf2FBZ=^LXAk3;FygxI!DWlYW#Z(1M3f2QLX;+n1k!Us>#GZDgiE(jh zCngb997VS_(dQ%mYlIbS9~LDUX}Z=|MNOun-?Em6N8a{Ggj@cXq1@AljX+$`gpKj+ zK^~=R2g^T?@|tE{RBG#@80nWg!`+>MerwWHpG6bc?0H?5(OSQ=Y09GBd9AkQRke8a z_;H+#CU|fNox4$7WccE7>>e-YQS~^=7AeB&$@SxsmJ3;r7H%~As#I?hIo_jQL}jH5 z`dnaKhJGtUTJ3xn^|e5&`u8B&=@4qXj0r78KplGOMtGN zfo31F2sbb4G|>}!5ffAe+ennNe|NlYpngC2W1wN@r*F@P8N$M}jIsx;sWk((j1t04 zp|VL`=~LZHvRPlvBdpLBdK#73F_buuU;;XxN7x80p)#(b&18Cs!DJcUNt=mO$KHa$ zmk(P#*`FBNj6L;x0m^X%nz1p`v-d(=_gOJ?*P6O6Aoi#-iUk2vVMDLs$g>=3ezG^5 z*eZC8IKg^h^ry2TpCNkbjpvkEEsC5J7oPKvVSybfLu_RfL(>1oTBAB(vZ0A#`y94W&~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6UI9>i>dbxI*Ice%d zNZKp)Lsd<$v&N{pVLXvc`|GpIS*4wk6>lfIQ&9;x?b17I`63yDeJN*WMZJ&lh-pYGOJvbF`e)XgL+f_K&xqf zZ%|d#jzb#8nF*e7nxEpbb*#uFaZKCRF0v-Ct*){}Fp0~vCs$U2Ktmm~`C)=|U6sz{ z1^%^*i&;{ZDlZ@k?hJR6e@uG=5kgd2(vCngxtKk;sSC70XWG#wuIl)VVc4~L_R#kb)J--%v$NXk6QH!D!31^v_ebM;qywrIk@kBGf z{@Rlx4V057Lb>^a-uwN1S!0;4NDkTJ*fGD0E-Nf&MXP7uuVWf21Jz(gn)$9Z-*HtG zS>Di=zS-`y>a~APSsKYDZeZ5VzBoNc6rJRab*gr>k8Jh@ji6>_!DUt920iQe9kHn4 zQWhCBiEF9m+u!_NLQ%T1h6*UQ*cC_Dje)M04pUFgM)uBgNMx$iHH|>cpW`)8aaXg3 zrUIL{_ng3VVzvgSrJjlAoak{vXW$X$h*k4VcYaW+R2fu6&iQ=q$*D!fvz)d7IzGGZ zsVQn+lY!ten_u_TXbW|%K@H8d#d#>0Wsq-KmqaC)cJ-E?p|~pY%2A(k;xiOUT@^}~ xAdgwCKTwZ5e#X!E89(D^{EVORGk(U;_!&RrXZ(zx@w3~{{|9x5?ePFG3;-YdgWdoD literal 0 HcmV?d00001 diff --git a/gen/CMakeLists.txt b/gen/CMakeLists.txt new file mode 100644 index 0000000..e972dd2 --- /dev/null +++ b/gen/CMakeLists.txt @@ -0,0 +1,226 @@ +project(libc-gen) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -fblocks -DPRIVATE") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") + +set(gen_sources + authentication.c + backtrace.c + clock_gettime.c + confstr.c + crypt.c + devname.c + dirfd.c + disklabel.c + errlst.c + filesec.c + fts.c + get_compat.c + getloadavg.c + getttyent.c + getusershell.c + getvfsbyname.c + nanosleep.c + nftw.c + nlist.c + oldsyslog.c + raise.c + setlogin.c + sigsetops.c + strtofflags.c + sync_volume_np.c + thread_stack_pcs.c + uname.c + utmpx-darwin.c +) + +set(gen_sources ${gen_sources} + FreeBSD/alarm.c + FreeBSD/arc4random.c + FreeBSD/assert.c + FreeBSD/basename.c + FreeBSD/clock.c + FreeBSD/closedir.c + FreeBSD/ctermid.c + FreeBSD/daemon.c + FreeBSD/dirname.c + FreeBSD/drand48.c + FreeBSD/erand48.c + FreeBSD/err.c + FreeBSD/exec.c + FreeBSD/fmtcheck.c + FreeBSD/fmtmsg.c + FreeBSD/fnmatch.c + FreeBSD/ftok.c + FreeBSD/getbsize.c + FreeBSD/getcap.c + FreeBSD/getcwd.c + FreeBSD/gethostname.c + FreeBSD/getlogin.c + FreeBSD/getmntinfo.c + FreeBSD/getmntinfo64.c + FreeBSD/getpagesize.c + FreeBSD/getpeereid.c + FreeBSD/getprogname.c + FreeBSD/glob.c + FreeBSD/isatty.c + FreeBSD/jrand48.c + FreeBSD/lcong48.c + FreeBSD/lockf.c + FreeBSD/lrand48.c + FreeBSD/mrand48.c + FreeBSD/nice.c + FreeBSD/nrand48.c + FreeBSD/opendir.c + FreeBSD/pause.c + FreeBSD/popen.c + FreeBSD/psignal.c + FreeBSD/_rand48.c + FreeBSD/readdir.c + FreeBSD/readpassphrase.c + FreeBSD/rewinddir.c + FreeBSD/scandir_b.c + FreeBSD/scandir.c + FreeBSD/seed48.c + FreeBSD/seekdir.c + FreeBSD/sethostname.c + FreeBSD/setmode.c + FreeBSD/setprogname.c + FreeBSD/siginterrupt.c + FreeBSD/siglist.c + FreeBSD/signal.c + FreeBSD/sleep.c + FreeBSD/srand48.c + FreeBSD/stringlist.c + FreeBSD/sysconf.c + FreeBSD/sysctlbyname.c + FreeBSD/sysctl.c + FreeBSD/sysctlnametomib.c + FreeBSD/telldir.c + FreeBSD/termios.c + FreeBSD/time.c + FreeBSD/times.c + FreeBSD/timespec_get.c + #FreeBSD/timezone.c # legacy only + FreeBSD/ttyname.c + FreeBSD/ttyslot.c + FreeBSD/ualarm.c + FreeBSD/ulimit.c + FreeBSD/unvis.c + FreeBSD/usleep.c + FreeBSD/utime.c + FreeBSD/vis.c + FreeBSD/wait.c + FreeBSD/waitpid.c + FreeBSD/wait3.c + FreeBSD/wordexp.c + NetBSD/rb.c + NetBSD/utmpx.c + ) + +SET_SOURCE_FILES_PROPERTIES(FreeBSD/clock.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_CLOCK") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/daemon.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_DAEMON") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/closedir.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_CLOSEDIR -include __dirent.h") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/glob.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_GLOB") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/fnmatch.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_FNMATCH") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/nice.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_NICE") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/opendir.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS___OPENDIR2 -DLIBC_ALIAS_OPENDIR -include __dirent.h") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/pause.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_PAUSE -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/popen.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_POPEN -U_DARWIN_C_SOURCE -U_POSIX_C_SOURCE -D__DARWIN_C_LEVEL=200000L") +#SET_SOURCE_FILES_PROPERTIES(FreeBSD/pselect.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_PSELECT -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h -U_DARWIN_C_SOURCE -U_POSIX_C_SOURCE -D__DARWIN_C_LEVEL=200000L") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/readdir.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -include __dirent.h") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/rewinddir.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_REWINDDIR -include __dirent.h") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/seekdir.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_SEEKDIR -include __dirent.h") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/setmode.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_SETMODE") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/sleep.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_SLEEP -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/telldir.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS__SEEKDIR -DLIBC_ALIAS_TELLDIR -include __dirent.h") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/termios.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_TCDRAIN -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") +#SET_SOURCE_FILES_PROPERTIES(FreeBSD/timezone.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_TIMEZONE") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/ttyname.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_TTYNAME_R") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/usleep.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_USLEEP") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/wait.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_WAIT") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/waitpid.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_WAITPID") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/lockf.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_LOCKF -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") +SET_SOURCE_FILES_PROPERTIES(nanosleep.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_NANOSLEEP") +SET_SOURCE_FILES_PROPERTIES(confstr.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_CONFSTR") +SET_SOURCE_FILES_PROPERTIES(crypt.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_ENCRYPT") +SET_SOURCE_FILES_PROPERTIES(fwt.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_NFTW -DLIBC_ALIAS_FTW") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/termios.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_TCDRAIN") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/wait.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_WAIT") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/waitpid.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_WAITPID") + +set(gen_sources ${gen_sources} + NetBSD/utmpx.c +) + +add_darling_object_library(libc-gen ${gen_sources}) + +# *** +# Cancelable variants +# *** +set(gen-cancelable_sources FreeBSD/lockf.c nanosleep.c FreeBSD/pause.c FreeBSD/sleep.c FreeBSD/termios.c FreeBSD/usleep.c FreeBSD/wait.c FreeBSD/waitpid.c) +add_library(libc-gen_cancelable OBJECT ${gen-cancelable_sources}) +#SET_TARGET_PROPERTIES(libc-gen_cancelable PROPERTIES COMPILE_DEFINITIONS "BUILDING_VARIANT;VARIANT_CANCELABLE") +set_target_properties(libc-gen_cancelable PROPERTIES COMPILE_FLAGS "-D__DARWIN_NON_CANCELABLE=0 -DBUILDING_VARIANT -DVARIANT_CANCELABLE") + + +# *** +# No-INODE64 variants +# *** +set(gen-noinode64_sources FreeBSD/seekdir.c FreeBSD/readdir.c FreeBSD/scandir.c FreeBSD/rewinddir.c FreeBSD/telldir.c fts.c FreeBSD/getmntinfo.c FreeBSD/glob.c FreeBSD/opendir.c nftw.c) +add_library(libc-gen_noinode64 OBJECT ${gen-noinode64_sources}) +SET_TARGET_PROPERTIES(libc-gen_noinode64 PROPERTIES COMPILE_FLAGS "-U__DARWIN_UNIX03 -U__DARWIN_64_BIT_INO_T -DVARIANT_INODE32 -DBUILDING_VARIANT -D_DARWIN_NO_64_BIT_INODE") + + +# *** +# Legacy variants +# *** + +if (TARGET_i386) + set(gen-legacy_sources FreeBSD/clock.c FreeBSD/closedir.c FreeBSD/fnmatch.c + FreeBSD/lockf.c FreeBSD/pause.c FreeBSD/popen.c FreeBSD/rewinddir.c + FreeBSD/seekdir.c FreeBSD/setmode.c FreeBSD/sleep.c FreeBSD/telldir.c + FreeBSD/ttyname.c FreeBSD/usleep.c FreeBSD/wait.c FreeBSD/waitpid.c + FreeBSD/timezone.c FreeBSD/termios.c FreeBSD/nice.c + confstr.c crypt.c nftw.c FreeBSD/opendir.c nanosleep.c) + + add_library(libc-gen_legacy OBJECT ${gen-legacy_sources}) + SET_TARGET_PROPERTIES(libc-gen_legacy PROPERTIES COMPILE_FLAGS + "-DBUILDING_VARIANT -DVARIANT_LEGACY -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0 -U__DARWIN_64_BIT_INO_T -D_DARWIN_NO_64_BIT_INODE") +endif (TARGET_i386) + +# *** +# DARWIN_EXTSN variants +# +set(gen-extsn_sources FreeBSD/popen.c) +add_library(libc-gen_extsn OBJECT ${gen-extsn_sources}) +SET_TARGET_PROPERTIES(libc-gen_extsn PROPERTIES COMPILE_DEFINITIONS "_DARWIN_UNLIMITED_STREAMS;_DARWIN_UNLIMITED_SELECT;BUILDING_VARIANT") + +# *** +# DARWIN_EXTSN cancelable variants +# +#set(gen-extsn_canc_sources FreeBSD/pselect.c) +#add_library(libc-gen_extsn_canc OBJECT ${gen-extsn_canc_sources}) +#SET_TARGET_PROPERTIES(libc-gen_extsn_canc PROPERTIES COMPILE_DEFINITIONS "_DARWIN_UNLIMITED_STREAMS;_DARWIN_UNLIMITED_SELECT;BUILDING_VARIANT;VARIANT_CANCELABLE") + +# *** +# PRE1050 variants +# *** + +set(gen-pre1050_sources FreeBSD/daemon.c) + +add_library(libc-gen_pre1050 OBJECT ${gen-pre1050_sources}) +SET_TARGET_PROPERTIES(libc-gen_pre1050 PROPERTIES COMPILE_FLAGS "-DBUILDING_VARIANT -DVARIANT_PRE1050 -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0") + +# *** +# DYLD variants +# *** + +add_library(libc-gen_dyld OBJECT FreeBSD/arc4random.c FreeBSD/closedir.c dirfd.c FreeBSD/getcwd.c FreeBSD/getpagesize.c nanosleep.c FreeBSD/opendir.c + FreeBSD/readdir.c FreeBSD/scandir.c FreeBSD/sysctl.c FreeBSD/sysctlbyname.c FreeBSD/telldir.c FreeBSD/usleep.c FreeBSD/sysconf.c + FreeBSD/isatty.c FreeBSD/termios.c FreeBSD/getprogname.c FreeBSD/vis.c FreeBSD/err.c FreeBSD/usleep.c errlst.c) + +SET_TARGET_PROPERTIES(libc-gen_dyld PROPERTIES COMPILE_FLAGS "-UBUILDING_VARIANT -DVARIANT_DYLD -DVARIANT_DARWINEXTSN -D__DARWIN_NON_CANCELABLE=1 -D__DARWIN_UNIX03=1") + diff --git a/gen/FreeBSD/_rand48.c b/gen/FreeBSD/_rand48.c new file mode 100644 index 0000000..da4d69e --- /dev/null +++ b/gen/FreeBSD/_rand48.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/_rand48.c,v 1.2 2002/03/22 21:52:05 obrien Exp $"); + +#include "rand48.h" + +uint48 _rand48_seed = RAND48_SEED; +uint48 _rand48_mult = RAND48_MULT; +uint48 _rand48_add = RAND48_ADD; diff --git a/gen/FreeBSD/alarm.3 b/gen/FreeBSD/alarm.3 new file mode 100644 index 0000000..9826ce1 --- /dev/null +++ b/gen/FreeBSD/alarm.3 @@ -0,0 +1,94 @@ +.\" Copyright (c) 1980, 1991, 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)alarm.3 8.2 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/gen/alarm.3,v 1.17 2007/01/09 00:27:52 imp Exp $ +.\" +.Dd April 19, 1994 +.Dt ALARM 3 +.Os +.Sh NAME +.Nm alarm +.Nd set signal timer alarm +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft unsigned +.Fn alarm "unsigned seconds" +.Sh DESCRIPTION +.Bf -symbolic +This interface is made obsolete by +.Xr setitimer 2 . +.Ef +.Pp +The +.Fn alarm +function sets a timer to deliver the signal +.Dv SIGALRM +to the calling process after the specified number of +.Fa seconds . +If an alarm has already been set with +.Fn alarm +but has not been delivered, another call to +.Fn alarm +will supersede the prior call. +The request +.Fn alarm "0" +voids the current +alarm and the signal SIGALRM will not be delivered. +.Pp +Due to +.Xr setitimer 2 +restriction the maximum number of +.Fa seconds +allowed is 100000000. +.Sh RETURN VALUES +The return value of +.Fn alarm +is the amount of time left on the timer from a previous call to +.Fn alarm . +If no alarm is currently set, the return value is 0. +.Sh SEE ALSO +.Xr setitimer 2 , +.Xr sigaction 2 , +.Xr sigpause 2 , +.Xr sigvec 2 , +.Xr signal 3 , +.Xr sleep 3 , +.Xr ualarm 3 , +.Xr usleep 3 +.\" .Sh STANDARDS +.\" The +.\" .Fn alarm +.\" function conforms to +.\" .St -p1003.1-90 . +.Sh HISTORY +An +.Fn alarm +function appeared in +.At v7 . diff --git a/gen/FreeBSD/alarm.c b/gen/FreeBSD/alarm.c new file mode 100644 index 0000000..6846af3 --- /dev/null +++ b/gen/FreeBSD/alarm.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)alarm.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/alarm.c,v 1.3 2007/01/09 00:27:53 imp Exp $"); + +/* + * Backwards compatible alarm. + */ +#include +#include + +unsigned int +alarm(secs) + unsigned int secs; +{ + struct itimerval it, oitv; + struct itimerval *itp = ⁢ + + timerclear(&itp->it_interval); + itp->it_value.tv_sec = secs; + itp->it_value.tv_usec = 0; + if (setitimer(ITIMER_REAL, itp, &oitv) < 0) + return (-1); + if (oitv.it_value.tv_usec) + oitv.it_value.tv_sec++; + return (oitv.it_value.tv_sec); +} diff --git a/gen/FreeBSD/arc4random.3 b/gen/FreeBSD/arc4random.3 new file mode 100644 index 0000000..a6b7f3d --- /dev/null +++ b/gen/FreeBSD/arc4random.3 @@ -0,0 +1,100 @@ +.\" $OpenBSD: arc4random.3,v 1.34 2014/07/19 16:11:16 naddy Exp $ +.\" +.\" Copyright 1997 Niels Provos +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Niels Provos. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" Manual page, using -mandoc macros +.\" +.Dd July 30, 2015 +.Dt ARC4RANDOM 3 +.Os +.Sh NAME +.Nm arc4random , +.Nm arc4random_buf , +.Nm arc4random_uniform +.Nd random number generator +.Sh SYNOPSIS +.In stdlib.h +.Ft uint32_t +.Fn arc4random "void" +.Ft void +.Fn arc4random_buf "void *buf" "size_t nbytes" +.Ft uint32_t +.Fn arc4random_uniform "uint32_t upper_bound" +.Sh DESCRIPTION +.Pp +These functions use a cryptographic pseudo-random number generator to generate +high quality random bytes very quickly. One data pool is used for all +consumers in a process, so that consumption under program flow can act as +additional stirring. The subsystem is re-seeded from the kernel random number +subsystem on a regular basis, and also upon +.Xr fork 2 . +.Pp +This family of functions provides higher quality random data than those +described in +.Xr rand 3 , +.Xr random 3 , +and +.Xr rand48 3 . +They can be called in almost all environments, including +.Xr chroot 2 , +and their use is encouraged over all other standard library functions for +random numbers. +.Pp +.Fn arc4random +returns a single 32-bit value. +.Pp +.Fn arc4random_buf +fills the region +.Fa buf +of length +.Fa nbytes +with random data. +.Pp +.Fn arc4random_uniform +will return a single 32-bit value, uniformly distributed but less than +.Fa upper_bound . +This is recommended over constructions like +.Dq Li arc4random() % upper_bound +as it avoids "modulo bias" when the upper bound is not a power of two. +In the worst case, this function may require multiple iterations +to ensure uniformity. +.Sh RETURN VALUES +These functions are always successful, and no return value is +reserved to indicate an error. +.Sh SEE ALSO +.Xr rand 3 , +.Xr rand48 3 , +.Xr random 3 , +.Xr random 4 +.Sh HISTORY +The original version of this random number generator used the RC4 (also known +as ARC4) algorithm. In OS X 10.12 it was replaced with the NIST-approved AES +cipher, and it may be replaced again in the future as cryptographic techniques +advance. A good mnemonic is +.Dq A Replacement Call for Random . diff --git a/gen/FreeBSD/arc4random.c b/gen/FreeBSD/arc4random.c new file mode 100644 index 0000000..7c6ec08 --- /dev/null +++ b/gen/FreeBSD/arc4random.c @@ -0,0 +1,414 @@ +/* + * Copyright (c) 1996, David Mazieres + * Copyright (c) 2008, Damien Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Arc4 random number generator for OpenBSD. + * + * This code is derived from section 17.1 of Applied Cryptography, + * second edition, which describes a stream cipher allegedly + * compatible with RSA Labs "RC4" cipher (the actual description of + * which is a trade secret). The same algorithm is used as a stream + * cipher called "arcfour" in Tatu Ylonen's ssh package. + * + * Here the stream cipher has been modified always to include the time + * when initializing the state. That makes it impossible to + * regenerate the same random sequence twice, so this can't be used + * for encryption, but will generate good random numbers. + * + * RC4 is a registered trademark of RSA Laboratories. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/arc4random.c,v 1.25 2008/09/09 09:46:36 ache Exp $"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#if !TARGET_OS_DRIVERKIT +#define OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE 1 +#endif +#include +#include + +#include "string.h" +#include "libc_private.h" + +#if defined(__APPLE__) && !defined(VARIANT_STATIC) +#include + +static struct ccrng_state *rng; + +static void +arc4_init(void) +{ + int err; + + if (rng != NULL) return; + + rng = ccrng(&err); + if (rng == NULL) { +#if OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE + os_crash("arc4random: unable to get ccrng() handle (%d)", err); +#else + os_crash("arc4random: unable to get ccrng() handle"); +#endif + } +} + +void +arc4random_addrandom(__unused u_char *dat, __unused int datlen) +{ + /* NOP - deprecated */ +} + +uint32_t +arc4random(void) +{ + uint32_t rand; + + arc4random_buf(&rand, sizeof(rand)); + + return rand; +} + +void +arc4random_buf(void *buf, size_t buf_size) +{ + arc4_init(); + ccrng_generate(rng, buf_size, buf); +} + +void +arc4random_stir(void) +{ + /* NOP */ +} + +uint32_t +arc4random_uniform(uint32_t upper_bound) +{ + uint64_t rand; + + arc4_init(); + ccrng_uniform(rng, upper_bound, &rand); + + return (uint32_t)rand; +} + +__private_extern__ void +_arc4_fork_child(void) +{ + /* NOP */ +} + +#else /* __APPLE__ && !VARIANT_STATIC */ + +#define RANDOMDEV "/dev/random" + +static void +_my_getentropy(uint8_t *buf, size_t size){ + int fd; + ssize_t ret; + if (getentropy(buf, size) == 0) { + return; + } + + // The above should never fail, but we'll try /dev/random anyway + fd = open(RANDOMDEV, O_RDONLY, 0); + if (fd == -1) { +#if !defined(VARIANT_STATIC) + os_crash("arc4random: unable to open /dev/random"); +#else + abort(); +#endif + } +shortread: + ret = read(fd, buf, size); + if (ret == -1) { +#if !defined(VARIANT_STATIC) + os_crash("arc4random: unable to read from /dev/random"); +#else + abort(); +#endif + } else if ((size_t)ret < size) { + size -= (size_t)ret; + buf += ret; + goto shortread; + } + (void)close(fd); +} + +struct arc4_stream { + u_int8_t i; + u_int8_t j; + u_int8_t s[256]; +}; + +#define KEYSIZE 128 + +static struct arc4_stream rs = { + .i = 0, + .j = 0, + .s = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + } +}; +static int rs_stired; + +static inline u_int8_t arc4_getbyte(void); +static void arc4_stir(void); + +static struct { + struct timeval tv; + pid_t pid; + u_int8_t rnd[KEYSIZE]; +} rdat; +static volatile int rs_data_available = 0; + +static inline void +arc4_addrandom(u_char *dat, int datlen) +{ + int n; + u_int8_t si; + + rs.i--; + for (n = 0; n < 256; n++) { + rs.i = (rs.i + 1); + si = rs.s[rs.i]; + rs.j = (rs.j + si + dat[n % datlen]); + rs.s[rs.i] = rs.s[rs.j]; + rs.s[rs.j] = si; + } + rs.j = rs.i; +} + +static void +arc4_fetch(void) +{ + _my_getentropy((uint8_t*)&rdat, KEYSIZE); +} + +static os_unfair_lock arc4_lock = OS_UNFAIR_LOCK_INIT; +static int arc4_count; + +static void +arc4_stir(void) +{ + int n; + /* + * If we don't have data, we need some now before we can integrate + * it into the static buffers + */ + if (!rs_data_available) + { + arc4_fetch(); + } + rs_data_available = 0; + __sync_synchronize(); + + arc4_addrandom((u_char *)&rdat, KEYSIZE); + + /* + * Throw away the first N bytes of output, as suggested in the + * paper "Weaknesses in the Key Scheduling Algorithm of RC4" + * by Fluher, Mantin, and Shamir. N=1024 is based on + * suggestions in the paper "(Not So) Random Shuffles of RC4" + * by Ilya Mironov. + */ + for (n = 0; n < 1024; n++) + (void) arc4_getbyte(); + arc4_count = 1600000; + rs_stired = 1; +} + +static inline u_int8_t +arc4_getbyte(void) +{ + u_int8_t si, sj; + + rs.i = (rs.i + 1); + si = rs.s[rs.i]; + rs.j = (rs.j + si); + sj = rs.s[rs.j]; + rs.s[rs.i] = sj; + rs.s[rs.j] = si; + + return (rs.s[(si + sj) & 0xff]); +} + +static inline u_int32_t +arc4_getword(void) +{ + u_int32_t val; + + val = arc4_getbyte() << 24; + val |= arc4_getbyte() << 16; + val |= arc4_getbyte() << 8; + val |= arc4_getbyte(); + + return (val); +} + +/* 7944700: force restir in child */ +__private_extern__ void +_arc4_fork_child(void) +{ + arc4_lock = OS_UNFAIR_LOCK_INIT; + rs_stired = 0; + rs_data_available = 0; +} + +static inline int +arc4_check_stir(void) +{ + if (!rs_stired || arc4_count <= 0) { + arc4_stir(); + return 1; + } + return 0; +} + +void +arc4random_addrandom(u_char *dat, int datlen) +{ + os_unfair_lock_lock(&arc4_lock); + arc4_check_stir(); + arc4_addrandom(dat, datlen); + os_unfair_lock_unlock(&arc4_lock); +} + +u_int32_t +arc4random(void) +{ + u_int32_t rnd; + + os_unfair_lock_lock(&arc4_lock); + + int did_stir = arc4_check_stir(); + rnd = arc4_getword(); + arc4_count -= 4; + + os_unfair_lock_unlock(&arc4_lock); + if (did_stir) + { + /* stirring used up our data pool, we need to read in new data outside of the lock */ + arc4_fetch(); + rs_data_available = 1; + __sync_synchronize(); + } + + return (rnd); +} + +void +arc4random_buf(void *_buf, size_t n) +{ + u_char *buf = (u_char *)_buf; + int did_stir = 0; + + os_unfair_lock_lock(&arc4_lock); + + while (n--) { + if (arc4_check_stir()) + { + did_stir = 1; + } + buf[n] = arc4_getbyte(); + arc4_count--; + } + + os_unfair_lock_unlock(&arc4_lock); + if (did_stir) + { + /* stirring used up our data pool, we need to read in new data outside of the lock */ + arc4_fetch(); + rs_data_available = 1; + __sync_synchronize(); + } +} + +void +arc4random_stir(void) +{ + os_unfair_lock_lock(&arc4_lock); + arc4_stir(); + os_unfair_lock_unlock(&arc4_lock); +} + +/* + * Calculate a uniformly distributed random number less than upper_bound + * avoiding "modulo bias". + * + * Uniformity is achieved by trying successive ranges of bits from the random + * value, each large enough to hold the desired upper bound, until a range + * holding a value less than the bound is found. + */ +uint32_t +arc4random_uniform(uint32_t upper_bound) +{ + if (upper_bound < 2) + return 0; + + // find smallest 2**n -1 >= upper_bound + int zeros = __builtin_clz(upper_bound); + int bits = CHAR_BIT * sizeof(uint32_t) - zeros; + uint32_t mask = 0xFFFFFFFFU >> zeros; + + do { + uint32_t value = arc4random(); + + // If low 2**n-1 bits satisfy the requested condition, return result + uint32_t result = value & mask; + if (result < upper_bound) { + return result; + } + + // otherwise consume remaining bits of randomness looking for a satisfactory result. + int bits_left = zeros; + while (bits_left >= bits) { + value >>= bits; + result = value & mask; + if (result < upper_bound) { + return result; + } + bits_left -= bits; + } + } while (1); +} + +#endif /* __APPLE__ */ diff --git a/gen/FreeBSD/assert.c b/gen/FreeBSD/assert.c new file mode 100644 index 0000000..0d4c06e --- /dev/null +++ b/gen/FreeBSD/assert.c @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)assert.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/assert.c,v 1.8 2007/01/09 00:27:53 imp Exp $"); + +#include +#include +#include +#if __has_include() +#include +#else +#define CRGetCrashLogMessage() NULL +#define CRSetCrashLogMessage(...) +#endif +#include "_simple.h" + +void +__assert_rtn(func, file, line, failedexpr) + const char *func, *file; + int line; + const char *failedexpr; +{ + if (func == (const char *)-1L) { + /* 8462256: special case to replace __eprintf */ + _simple_dprintf(STDERR_FILENO, + "%s:%d: failed assertion `%s'\n", file, line, failedexpr); + if (!CRGetCrashLogMessage()) { + _SIMPLE_STRING s = _simple_salloc(); + if (s) { + _simple_sprintf(s, + "%s:%d: failed assertion `%s'\n", + file, line, failedexpr); + CRSetCrashLogMessage(_simple_string(s)); + } else + CRSetCrashLogMessage(failedexpr); + } + } else if (func == NULL) { + _simple_dprintf(STDERR_FILENO, + "Assertion failed: (%s), file %s, line %d.\n", failedexpr, + file, line); + if (!CRGetCrashLogMessage()) { + _SIMPLE_STRING s = _simple_salloc(); + if (s) { + _simple_sprintf(s, + "Assertion failed: (%s), file %s, line %d.\n", + failedexpr, file, line); + CRSetCrashLogMessage(_simple_string(s)); + } else + CRSetCrashLogMessage(failedexpr); + } + } else { + _simple_dprintf(STDERR_FILENO, + "Assertion failed: (%s), function %s, file %s, line %d.\n", + failedexpr, func, file, line); + if (!CRGetCrashLogMessage()) { + _SIMPLE_STRING s = _simple_salloc(); + if (s) { + _simple_sprintf(s, + "Assertion failed: (%s), function %s, file %s, line %d.\n", + failedexpr, func, file, line); + CRSetCrashLogMessage(_simple_string(s)); + } else + CRSetCrashLogMessage(failedexpr); + } + } + abort(); + /* NOTREACHED */ +} diff --git a/gen/FreeBSD/basename.3 b/gen/FreeBSD/basename.3 new file mode 100644 index 0000000..e37802c --- /dev/null +++ b/gen/FreeBSD/basename.3 @@ -0,0 +1,116 @@ +.\" $OpenBSD: basename.3,v 1.20 2007/05/31 19:19:28 jmc Exp $ +.\" +.\" Copyright (c) 1997 Todd C. Miller +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 31, 2010 +.Dt BASENAME 3 +.Os +.Sh NAME +.Nm basename +.Nd extract the base portion of a pathname +.Sh SYNOPSIS +.In libgen.h +.Ft char * +.Fn basename "char *path" +.Ft char * +.Fn basename_r "const char *path" "char *bname" +.Sh DESCRIPTION +The +.Fn basename +function returns the last component from the pathname pointed to by +.Fa path , +deleting any trailing +.Sq \&/ +characters. +If +.Fa path +consists entirely of +.Sq \&/ +characters, a pointer to the string +.Qq \&/ +is returned. +If +.Fa path +is a null pointer or the empty string, a pointer to the string +.Qq \&. +is returned. +.Pp +The +.Fn basename_r +variation accepts a buffer of at least +.Dv MAXPATHLEN +bytes in which to store the resulting component. +.Sh IMPLEMENTATION NOTES +The +.Fn basename +function +returns a pointer to internal storage space allocated on the first call +that will be overwritten +by subsequent calls. +.Fn basename_r +is therefore preferred for threaded applications. +.Sh RETURN VALUES +On successful completion, +.Fn basename +and +.Fn basename_r +return pointers to the last component of +.Fa path . +.Pp +If they fail, a null pointer is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The following error codes may be set in +.Va errno : +.Bl -tag -width Er +.It Bq Er ENAMETOOLONG +The path component to be returned was larger than +.Dv MAXPATHLEN . +.El +.Sh SEE ALSO +.Xr basename 1 , +.Xr dirname 1 , +.Xr dirname 3 +.Sh STANDARDS +The +.Fn basename +function conforms to +.St -xpg4.2 . +.Sh HISTORY +The +.Fn basename +function first appeared in +.Ox 2.2 +and +.Fx 4.2 . +The +.Fn basename_r +function first appeared in OS X 10.12. +.Sh AUTHORS +.An Todd C. Miller +.Sh CAVEATS +.Fn basename +returns a pointer to internal static storage space that will be overwritten +by subsequent calls. +.Pp +Other vendor implementations of +.Fn basename +may modify the contents of the string passed to +.Fn basename ; +this should be taken into account when writing code which calls this function +if portability is desired. diff --git a/gen/FreeBSD/basename.c b/gen/FreeBSD/basename.c new file mode 100644 index 0000000..140ccbb --- /dev/null +++ b/gen/FreeBSD/basename.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 1997 Todd C. Miller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if 0 +#ifndef lint +static char rcsid[] = "$OpenBSD: basename.c,v 1.4 1999/05/30 17:10:30 espie Exp $"; +#endif /* not lint */ +#endif +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/basename.c,v 1.7 2002/12/30 01:41:14 marcel Exp $"); + +#include +#include +#include +#include +#include + +char * +basename_r(const char *path, char *bname) +{ + const char *endp, *startp; + size_t len; + + /* Empty or NULL string gets treated as "." */ + if (path == NULL || *path == '\0') { + bname[0] = '.'; + bname[1] = '\0'; + return (bname); + } + + /* Strip any trailing slashes */ + endp = path + strlen(path) - 1; + while (endp > path && *endp == '/') + endp--; + + /* All slashes becomes "/" */ + if (endp == path && *endp == '/') { + bname[0] = '/'; + bname[1] = '\0'; + return (bname); + } + + /* Find the start of the base */ + startp = endp; + while (startp > path && *(startp - 1) != '/') + startp--; + + len = endp - startp + 1; + if (len >= MAXPATHLEN) { + errno = ENAMETOOLONG; + return (NULL); + } + memcpy(bname, startp, len); + bname[len] = '\0'; + return (bname); +} + +#if __DARWIN_UNIX03 +#define const /**/ +#endif + +char * +basename(const char *path) +{ + static char *bname = NULL; + + if (bname == NULL) { + bname = (char *)malloc(MAXPATHLEN); + if (bname == NULL) + return (NULL); + } + return (basename_r(path, bname)); +} diff --git a/gen/FreeBSD/clock.3 b/gen/FreeBSD/clock.3 new file mode 100644 index 0000000..2b79771 --- /dev/null +++ b/gen/FreeBSD/clock.3 @@ -0,0 +1,71 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)clock.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd June 4, 1993 +.Dt CLOCK 3 +.Os +.Sh NAME +.Nm clock +.Nd determine processor time used +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft clock_t +.Fn clock void +.Sh DESCRIPTION +The +.Fn clock +function +determines the amount of processor time used since the invocation of the +calling process, measured in +.Dv CLOCKS_PER_SEC Ns s +of a second. +.Sh RETURN VALUES +The +.Fn clock +function returns the amount of time used unless an error occurs, in which +case the return value is \-1. +.Sh SEE ALSO +.Xr getrusage 2 +.Sh STANDARDS +The +.Fn clock +function conforms to +.St -isoC +and +.St -susv3 +which requires +.Dv CLOCKS_PER_SEC +to be defined as one million. diff --git a/gen/FreeBSD/clock.c b/gen/FreeBSD/clock.c new file mode 100644 index 0000000..8a4ec9e --- /dev/null +++ b/gen/FreeBSD/clock.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)clock.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/clock.c,v 1.4 2007/01/09 00:27:53 imp Exp $"); + +#include +#include +#include + +/* + * Convert usec to clock ticks; could do (usec * CLOCKS_PER_SEC) / 1000000, + * but this would overflow if we switch to nanosec. + */ +#define CONVTCK(r) ((r).tv_sec * CLOCKS_PER_SEC \ + + (r).tv_usec / (1000000 / CLOCKS_PER_SEC)) + +clock_t +clock() +{ + struct rusage ru; + + if (getrusage(RUSAGE_SELF, &ru)) + return ((clock_t) -1); + return((clock_t)((CONVTCK(ru.ru_utime) + CONVTCK(ru.ru_stime)))); +} diff --git a/gen/FreeBSD/closedir.c b/gen/FreeBSD/closedir.c new file mode 100644 index 0000000..e69e0ec --- /dev/null +++ b/gen/FreeBSD/closedir.c @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1983, 1993 + * Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)closedir.c 8.1 (Berkeley) 6/10/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" +#include "telldir.h" + +/* + * close a directory. + */ +static int +_fdclosedir(DIR *dirp) +{ + int fd; + + if (__isthreaded) + _pthread_mutex_lock(&dirp->dd_lock); + fd = dirp->dd_fd; + dirp->dd_fd = -1; + dirp->dd_loc = 0; + free((void *)dirp->dd_buf); + _reclaim_telldir(dirp); + if (__isthreaded) { + _pthread_mutex_unlock(&dirp->dd_lock); + _pthread_mutex_destroy(&dirp->dd_lock); + } + free((void *)dirp); + return (fd); +} + +int +closedir(DIR *dirp) +{ + + return (_close(_fdclosedir(dirp))); +} diff --git a/gen/FreeBSD/ctermid.3 b/gen/FreeBSD/ctermid.3 new file mode 100644 index 0000000..c1ba297 --- /dev/null +++ b/gen/FreeBSD/ctermid.3 @@ -0,0 +1,112 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ctermid.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd October 1, 2011 +.Dt CTERMID 3 +.Os +.Sh NAME +.Nm ctermid , +.Nm ctermid_r +.Nd generate terminal pathname +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft char * +.Fn ctermid "char *buf" +.Ft char * +.Fn ctermid_r "char *buf" +.Sh DESCRIPTION +The +.Fn ctermid +function generates a string, that, when used as a pathname, refers to +the current controlling terminal of the calling process. +.Pp +If +.Fa buf +is the +.Dv NULL +pointer, a pointer to a static area is returned. +Otherwise, the pathname is copied into the memory referenced by +.Fa buf . +The argument +.Fa buf +is assumed to be at least +.Dv L_ctermid +(as defined in the include +file +.In stdio.h ) +bytes long. +.Pp +The +.Fn ctermid_r +function +provides the same functionality as +.Fn ctermid +except that if +.Fa buf +is a +.Dv NULL +pointer, +.Dv NULL +is returned. +.Pp +The current implementation simply returns +.Ql /dev/tty . +.Sh RETURN VALUES +The +.Fn ctermid +function returns +.Fa buf +if it is +.Pf non- Dv NULL , +otherwise it returns the address of a static buffer. +The +.Fn ctermid_r +function always returns +.Fa buf , +even if it is the NULL pointer. +.Sh ERRORS +The current implementation detects no error conditions. +.Sh SEE ALSO +.Xr ttyname 3 +.Sh STANDARDS +The +.Fn ctermid +function conforms to +.St -p1003.1-88 . +.Sh BUGS +By default the +.Fn ctermid +function +writes all information to an internal static object. +Subsequent calls to +.Fn ctermid +will modify the same object. diff --git a/gen/FreeBSD/ctermid.c b/gen/FreeBSD/ctermid.c new file mode 100644 index 0000000..d517719 --- /dev/null +++ b/gen/FreeBSD/ctermid.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ctermid.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/ctermid.c,v 1.4 2007/01/09 00:27:53 imp Exp $"); + +#include +#include +#include + +char * +ctermid(char *s) +{ + static char def[] = _PATH_TTY; + + if (s) { + bcopy(def, s, sizeof(_PATH_TTY)); + return(s); + } + return(def); +} + + +char * +ctermid_r(char *s) +{ + return (s) ? ctermid(s) : NULL; +} diff --git a/gen/FreeBSD/daemon.3 b/gen/FreeBSD/daemon.3 new file mode 100644 index 0000000..0df7cd1 --- /dev/null +++ b/gen/FreeBSD/daemon.3 @@ -0,0 +1,134 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)daemon.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/gen/daemon.3,v 1.15 2007/01/09 00:27:53 imp Exp $ +.\" +.Dd June 9, 1993 +.Dt DAEMON 3 +.Os +.Sh NAME +.Nm daemon +.Nd run in the background +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fn daemon "int nochdir" "int noclose" +.Sh DESCRIPTION +The +.Fn daemon +function is for programs wishing to detach themselves from the +controlling terminal and run in the background as system daemons. +The +.Xr fork 2 +system call is used; see CAVEATS below about the environment after a +.Fn fork +(without a corresponding call to one of the exec routines). +On Mac OS X, the use of this API is discouraged in favor of using +.Xr launchd 8 . +.Pp +Unless the argument +.Fa nochdir +is non-zero, +.Fn daemon +changes the current working directory to the root +.Pq Pa / . +.Pp +Unless the argument +.Fa noclose +is non-zero, +.Fn daemon +will redirect standard input, standard output, and standard error to +.Pa /dev/null . +.Sh RETURN VALUES +.Rv -std daemon +.Sh ERRORS +The +.Fn daemon +function may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr fork 2 +and +.Xr setsid 2 . +.Sh SEE ALSO +.Xr fork 2 , +.Xr launchd 8 , +.Xr setsid 2 , +.Xr sigaction 2 +.Sh HISTORY +The +.Fn daemon +function first appeared in +.Bx 4.4 . +.Sh CAVEATS +There are limits to what you can do in the child process. +To be totally safe you should restrict yourself to only +executing async-signal safe operations (see +.Xr sigaction 2 ) +until such time +as one of the exec functions is called. +All APIs, including global data symbols, in any framework or library +should be assumed to be unsafe after a +.Fn fork +unless explicitly documented to be safe or async-signal safe. +If you need to use these frameworks in the child +process, you must exec. +In this situation it is reasonable to exec yourself. +.Pp +Unless the +.Fa noclose +argument is non-zero, +.Fn daemon +will close the first three file descriptors and redirect them to +.Pa /dev/null . +Normally, these correspond to standard input, standard output, and +standard error. +However, if any of those file descriptors refer to something else, they +will still be closed, resulting in incorrect behavior of the calling program. +This can happen if any of standard input, standard output, or standard +error have been closed before the program was run. +Programs using +.Fn daemon +should therefore either call +.Fn daemon +before opening any files or sockets, or verify that any file +descriptors obtained have values greater than 2. +.Pp +The +.Fn daemon +function temporarily ignores +.Dv SIGHUP +while calling +.Xr setsid 2 +to prevent a parent session group leader's calls to +.Xr fork 2 +and then +.Xr _exit 2 +from prematurely terminating the child process. diff --git a/gen/FreeBSD/daemon.c b/gen/FreeBSD/daemon.c new file mode 100644 index 0000000..ea9a15f --- /dev/null +++ b/gen/FreeBSD/daemon.c @@ -0,0 +1,124 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)daemon.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/daemon.c,v 1.8 2007/01/09 00:27:53 imp Exp $"); + +#ifndef VARIANT_PRE1050 +#include +#include +#endif /* !VARIANT_PRE1050 */ +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#ifndef VARIANT_PRE1050 +static void +move_to_root_bootstrap(void) +{ + mach_port_t parent_port = 0; + mach_port_t previous_port = 0; + + do { + if (previous_port) { + mach_port_deallocate(mach_task_self(), previous_port); + previous_port = parent_port; + } else { + previous_port = bootstrap_port; + } + + if (bootstrap_parent(previous_port, &parent_port) != 0) { + return; + } + } while (parent_port != previous_port); + + task_set_bootstrap_port(mach_task_self(), parent_port); + bootstrap_port = parent_port; +} +#endif /* !VARIANT_PRE1050 */ + +int daemon(int, int) __DARWIN_1050(daemon); + +int +daemon(nochdir, noclose) + int nochdir, noclose; +{ + struct sigaction osa, sa; + int fd; + pid_t newgrp; + int oerrno; + int osa_ok; + + /* A SIGHUP may be thrown when the parent exits below. */ + sigemptyset(&sa.sa_mask); + sa.sa_handler = SIG_IGN; + sa.sa_flags = 0; + osa_ok = _sigaction(SIGHUP, &sa, &osa); +#ifndef VARIANT_PRE1050 + move_to_root_bootstrap(); +#endif /* !VARIANT_PRE1050 */ + switch (fork()) { + case -1: + return (-1); + case 0: + break; + default: + _exit(0); + } + + newgrp = setsid(); + oerrno = errno; + if (osa_ok != -1) + _sigaction(SIGHUP, &osa, NULL); + + if (newgrp == -1) { + errno = oerrno; + return (-1); + } + + if (!nochdir) + (void)chdir("/"); + + if (!noclose && (fd = _open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { + (void)_dup2(fd, STDIN_FILENO); + (void)_dup2(fd, STDOUT_FILENO); + (void)_dup2(fd, STDERR_FILENO); + if (fd > 2) + (void)_close(fd); + } + return (0); +} diff --git a/gen/FreeBSD/dirname.3 b/gen/FreeBSD/dirname.3 new file mode 100644 index 0000000..9c9d7f1 --- /dev/null +++ b/gen/FreeBSD/dirname.3 @@ -0,0 +1,127 @@ +.\" $OpenBSD: dirname.3,v 1.17 2007/05/31 19:19:28 jmc Exp $ +.\" +.\" Copyright (c) 1997 Todd C. Miller +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD: src/lib/libc/gen/dirname.3,v 1.10 2008/11/03 05:19:45 delphij Exp $ +.\" +.Dd October 12, 2006 +.Dt DIRNAME 3 +.Os +.Sh NAME +.Nm dirname +.Nd extract the directory part of a pathname +.Sh SYNOPSIS +.In libgen.h +.Ft char * +.Fo dirname +.Fa "char *path" +.Fc +.Ft char * +.Fo dirname_r +.Fa "const char *path" "char *dname" +.Fc +.Sh DESCRIPTION +The +.Fn dirname +function is the converse of +.Xr basename 3 ; +it returns a pointer to the parent directory of the pathname pointed to by +.Fa path . +Any trailing +.Sq \&/ +characters are not counted as part of the directory +name. +If +.Fa path +is a null pointer, the empty string, or contains no +.Sq \&/ +characters, +.Fn dirname +returns a pointer to the string +.Qq \&. , +signifying the current directory. +.Sh IMPLEMENTATION NOTES +The +.Fn dirname +function +returns a pointer to internal storage space allocated on the first call +that will be overwritten +by subsequent calls. +.Fn dirname_r +is therefore preferred for threaded applications. +.Pp +Other vendor implementations of +.Fn dirname +may modify the contents of the string passed to +.Fn dirname ; +if portability is desired, +this should be taken into account when writing code which calls this function. +.Sh LEGACY SYNOPSIS +.Fd #include +.Pp +.Ft char * +.br +.Fo dirname +.Fa "const char *path" +.Fc ; +.Pp +In legacy mode, +.Fa path +will not be changed. +.Sh RETURN VALUES +On successful completion, +.Fn dirname +returns a pointer to the parent directory of +.Fa path . +.Pp +If +.Fn dirname +fails, a null pointer is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The following error codes may be set in +.Va errno : +.Bl -tag -width Er +.It Bq Er ENAMETOOLONG +The path component to be returned was larger than +.Dv MAXPATHLEN . +.It Bq Er ENOMEM +The static buffer used for storing the path in +.Fn dirname +could not be allocated. +.El +.Sh SEE ALSO +.Xr basename 1 , +.Xr dirname 1 , +.Xr basename 3 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn dirname +function conforms to +.St -xpg4.2 . +.Sh HISTORY +The +.Fn dirname +function first appeared in +.Ox 2.2 +and +.Fx 4.2 . +The +.Fn dirname_r +function first appeared in OS X 10.12. +.Sh AUTHORS +.An "Todd C. Miller" diff --git a/gen/FreeBSD/dirname.c b/gen/FreeBSD/dirname.c new file mode 100644 index 0000000..7def49a --- /dev/null +++ b/gen/FreeBSD/dirname.c @@ -0,0 +1,87 @@ +/* $OpenBSD: dirname.c,v 1.13 2005/08/08 08:05:33 espie Exp $ */ + +/* + * Copyright (c) 1997, 2004 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/dirname.c,v 1.8 2008/11/03 05:19:45 delphij Exp $"); + +#include +#include +#include +#include +#include + +char * +dirname_r(const char *path, char *dname) +{ + const char *endp; + size_t len; + + /* Empty or NULL string gets treated as "." */ + if (path == NULL || *path == '\0') { + dname[0] = '.'; + dname[1] = '\0'; + return (dname); + } + + /* Strip any trailing slashes */ + endp = path + strlen(path) - 1; + while (endp > path && *endp == '/') + endp--; + + /* Find the start of the dir */ + while (endp > path && *endp != '/') + endp--; + + /* Either the dir is "/" or there are no slashes */ + if (endp == path) { + dname[0] = *endp == '/' ? '/' : '.'; + dname[1] = '\0'; + return (dname); + } else { + /* Move forward past the separating slashes */ + do { + endp--; + } while (endp > path && *endp == '/'); + } + + len = endp - path + 1; + if (len >= MAXPATHLEN) { + errno = ENAMETOOLONG; + return (NULL); + } + memmove(dname, path, len); + dname[len] = '\0'; + return (dname); +} + +#if __DARWIN_UNIX03 +#define const /**/ +#endif + +char * +dirname(const char *path) +{ + static char *dname = NULL; + + if (dname == NULL) { + dname = (char *)malloc(MAXPATHLEN); + if (dname == NULL) + return (NULL); + } + return (dirname_r(path, dname)); +} diff --git a/gen/FreeBSD/drand48.c b/gen/FreeBSD/drand48.c new file mode 100644 index 0000000..52e9693 --- /dev/null +++ b/gen/FreeBSD/drand48.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/drand48.c,v 1.2 2002/03/22 21:52:05 obrien Exp $"); + +#include "rand48.h" + +double +drand48(void) +{ + ERAND48_BEGIN; + _DORAND48(_rand48_seed); + ERAND48_END(_rand48_seed); +} diff --git a/gen/FreeBSD/erand48.c b/gen/FreeBSD/erand48.c new file mode 100644 index 0000000..9887547 --- /dev/null +++ b/gen/FreeBSD/erand48.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/erand48.c,v 1.2 2002/03/22 21:52:05 obrien Exp $"); + +#include "rand48.h" + +double +erand48(unsigned short xseed[3]) +{ + uint48 tmp; + ERAND48_BEGIN; + DORAND48(tmp, xseed); + ERAND48_END(tmp); +} diff --git a/gen/FreeBSD/err.3 b/gen/FreeBSD/err.3 new file mode 100644 index 0000000..a4c953f --- /dev/null +++ b/gen/FreeBSD/err.3 @@ -0,0 +1,263 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From: @(#)err.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/gen/err.3,v 1.24 2008/10/31 15:14:40 rwatson Exp $ +.\" +.Dd May 20, 2008 +.Dt ERR 3 +.Os +.Sh NAME +.Nm err , +.Nm verr , +.Nm errc , +.Nm verrc , +.Nm errx , +.Nm verrx , +.Nm warn , +.Nm vwarn , +.Nm warnc , +.Nm vwarnc , +.Nm warnx , +.Nm vwarnx , +.Nm err_set_exit , +#ifdef UNIFDEF_BLOCKS +.Nm err_set_exit_b , +#endif +.Nm err_set_file +.Nd formatted error messages +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In err.h +.Ft void +.Fn err "int eval" "const char *fmt" "..." +.Ft void +.Fn err_set_exit "void (*exitf)(int)" +#ifdef UNIFDEF_BLOCKS +.Ft void +.Fn err_set_exit_b "void (^exitb)(int)" +#endif +.Ft void +.Fn err_set_file "void *vfp" +.Ft void +.Fn errc "int eval" "int code" "const char *fmt" "..." +.Ft void +.Fn errx "int eval" "const char *fmt" "..." +.Ft void +.Fn warn "const char *fmt" "..." +.Ft void +.Fn warnc "int code" "const char *fmt" "..." +.Ft void +.Fn warnx "const char *fmt" "..." +.In stdarg.h +.Ft void +.Fn verr "int eval" "const char *fmt" "va_list args" +.Ft void +.Fn verrc "int eval" "int code" "const char *fmt" "va_list args" +.Ft void +.Fn verrx "int eval" "const char *fmt" "va_list args" +.Ft void +.Fn vwarn "const char *fmt" "va_list args" +.Ft void +.Fn vwarnc "int code" "const char *fmt" "va_list args" +.Ft void +.Fn vwarnx "const char *fmt" "va_list args" +.Sh DESCRIPTION +The +.Fn err +and +.Fn warn +family of functions display a formatted error message on the standard +error output, or on another file specified using the +.Fn err_set_file +function. +In all cases, the last component of the program name, a colon character, +and a space are output. +If the +.Fa fmt +argument is not NULL, the +.Xr printf 3 Ns +-like formatted error message is output. +The output is terminated by a newline character. +.Pp +The +.Fn err , +.Fn errc , +.Fn verr , +.Fn verrc , +.Fn warn , +.Fn warnc , +.Fn vwarn , +and +.Fn vwarnc +functions append an error message obtained from +.Xr strerror 3 +based on a supplied error code value or the global variable +.Va errno , +preceded by another colon and space unless the +.Fa fmt +argument is +.Dv NULL . +.Pp +In the case of the +.Fn errc , +.Fn verrc , +.Fn warnc , +and +.Fn vwarnc +functions, +the +.Fa code +argument is used to look up the error message. +.Pp +The +.Fn err , +.Fn verr , +.Fn warn , +and +.Fn vwarn +functions use the global variable +.Va errno +to look up the error message. +.Pp +The +.Fn errx +and +.Fn warnx +functions do not append an error message. +.Pp +The +.Fn err , +.Fn verr , +.Fn errc , +.Fn verrc , +.Fn errx , +and +.Fn verrx +functions do not return, but exit with the value of the argument +.Fa eval . +It is recommended that the standard values defined in +.Xr sysexits 3 +be used for the value of +.Fa eval . +The +.Fn err_set_exit +function can be used to specify a function which is called before +.Xr exit 3 +to perform any necessary cleanup; passing a null function pointer for +.Va exitf +resets the hook to do nothing. +#ifdef UNIFDEF_BLOCKS +The +.Fn err_set_exit_b +function is like +.Fn err_set_exit +except it takes a block pointer instead of a function pointer. +.Bd -ragged -offset indent +Note: The +.Fn Block_copy +function (defined in +.In Blocks.h ) +is used by +.Fn err_set_exit_b +to make a copy of the block, especially for the case when a stack-based +block might go out of scope when the subroutine returns. +.Ed +.Pp +#endif +The +.Fn err_set_file +function sets the output stream used by the other functions. +Its +.Fa vfp +argument must be either a pointer to an open stream +(possibly already converted to void *) +or a null pointer +(in which case the output stream is set to standard error). +.Sh EXAMPLES +Display the current errno information string and exit: +.Bd -literal -offset indent +if ((p = malloc(size)) == NULL) + err(EX_OSERR, NULL); +if ((fd = open(file_name, O_RDONLY, 0)) == -1) + err(EX_NOINPUT, "%s", file_name); +.Ed +.Pp +Display an error message and exit: +.Bd -literal -offset indent +if (tm.tm_hour < START_TIME) + errx(EX_DATAERR, "too early, wait until %s", + start_time_string); +.Ed +.Pp +Warn of an error: +.Bd -literal -offset indent +if ((fd = open(raw_device, O_RDONLY, 0)) == -1) + warnx("%s: %s: trying the block device", + raw_device, strerror(errno)); +if ((fd = open(block_device, O_RDONLY, 0)) == -1) + err(EX_OSFILE, "%s", block_device); +.Ed +.Pp +Warn of an error without using the global variable +.Va errno : +.Bd -literal -offset indent +error = my_function(); /* returns a value from */ +if (error != 0) + warnc(error, "my_function"); +.Ed +.Sh SEE ALSO +.Xr exit 3 , +.Xr fmtmsg 3 , +.Xr printf 3 , +.Xr strerror 3 , +.Xr sysexits 3 +.Sh HISTORY +The +.Fn err +and +.Fn warn +functions first appeared in +.Bx 4.4 . +The +.Fn err_set_exit +and +.Fn err_set_file +functions first appeared in +.Fx 2.1 . +The +.Fn errc +and +.Fn warnc +functions first appeared in +.Fx 3.0 . +#ifdef UNIFDEF_BLOCKS +The +.Fn err_set_exit_b +function first appeared in Mac OS X 10.6. +#endif diff --git a/gen/FreeBSD/err.c b/gen/FreeBSD/err.c new file mode 100644 index 0000000..f763764 --- /dev/null +++ b/gen/FreeBSD/err.c @@ -0,0 +1,328 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/err.c,v 1.15 2008/04/03 20:36:44 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#ifdef __BLOCKS__ +#include +#endif /* __BLOCKS__ */ +#include "libc_private.h" + +#define ERR_EXIT_UNDEF 0 +#ifdef __BLOCKS__ +#define ERR_EXIT_BLOCK 1 +#endif /* __BLOCKS__ */ +#define ERR_EXIT_FUNC 2 +struct _e_err_exit { + unsigned int type; +#ifdef __BLOCKS__ + union { +#endif /* __BLOCKS__ */ + void (*func)(int); +#ifdef __BLOCKS__ + void (^block)(int); + }; +#endif /* __BLOCKS__ */ +}; + +#ifdef BUILDING_VARIANT + +__private_extern__ FILE *_e_err_file; /* file to use for error output */ +__private_extern__ struct _e_err_exit _e_err_exit; +__private_extern__ void _e_visprintf(FILE * __restrict, const char * __restrict, va_list); + +#else /* !BUILDING_VARIANT */ + +__private_extern__ FILE *_e_err_file = NULL; /* file to use for error output */ +__private_extern__ struct _e_err_exit _e_err_exit = {ERR_EXIT_UNDEF}; + +/* + * zero means pass as is + * 255 means use \nnn (octal) + * otherwise use \x (x is value) + * (NUL isn't used) + */ +static const unsigned char escape[256] = { + /* NUL */ + 0, /* Unused: strings can't contain nulls */ + /* SOH STX ETX EOT ENQ ACK BEL */ + 255, 255, 255, 255, 255, 255, 'a', + /* BS HT NL VT NP CR SO SI */ + 'b', 0, 0, 'v', 'f', 'r', 255, 255, + /* DLE DC1 DC2 DC3 DC4 NAK SYN ETB */ + 255, 255, 255, 255, 255, 255, 255, 255, + /* CAN EM SUB ESC FS GS RS US */ + 255, 255, 255, 255, 255, 255, 255, 255, + /* the rest are zero */ +}; + +/* + * Make characters visible. If we can't allocate enough + * memory, we fall back on vfprintf(). + */ +__private_extern__ void +_e_visprintf(FILE * __restrict stream, const char * __restrict format, va_list ap) +{ + int failed = 0; + char *str, *visstr; + va_list backup; + + va_copy(backup, ap); + vasprintf(&str, format, ap); + if (str != NULL) { + if ((visstr = malloc(4 * strlen(str) + 1)) != NULL) { + unsigned char *fp = (unsigned char *)str; + unsigned char *tp = (unsigned char *)visstr; + while(*fp) { + switch(escape[*fp]) { + case 0: + *tp++ = *fp; + break; + case 255: + sprintf((char *)tp, "\\%03o", *fp); + tp += 4; + break; + default: + *tp++ = '\\'; + *tp++ = escape[*fp]; + break; + } + fp++; + } + *tp = 0; + fputs(visstr, stream); + free(visstr); + } else + failed = 1; + free(str); + } else + failed = 1; + if (failed) + vfprintf(stream, format, backup); + va_end(backup); +} + +/* + * This is declared to take a `void *' so that the caller is not required + * to include first. However, it is really a `FILE *', and the + * manual page documents it as such. + */ +void +err_set_file(void *fp) +{ + if (fp) + _e_err_file = fp; + else + _e_err_file = stderr; +} + +void +err_set_exit(void (*ef)(int)) +{ +#ifdef __BLOCKS__ + if (_e_err_exit.type == ERR_EXIT_BLOCK) { + Block_release(_e_err_exit.block); + _e_err_exit.block = NULL; + } +#endif /* __BLOCKS__ */ + _e_err_exit.type = ef ? ERR_EXIT_FUNC : ERR_EXIT_UNDEF; + _e_err_exit.func = ef; +} + +#ifdef __BLOCKS__ +void +err_set_exit_b(void (^ef)(int)) +{ + if (_e_err_exit.type == ERR_EXIT_BLOCK) { + Block_release(_e_err_exit.block); + } + _e_err_exit.type = ef ? ERR_EXIT_BLOCK : ERR_EXIT_UNDEF; + _e_err_exit.block = Block_copy(ef); +} +#endif /* __BLOCKS__ */ +#endif /* !BUILDING_VARIANT */ + +__weak_reference(_err, err); + +void +_err(int eval, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + verrc(eval, errno, fmt, ap); + va_end(ap); +} + +void +verr(eval, fmt, ap) + int eval; + const char *fmt; + va_list ap; +{ + verrc(eval, errno, fmt, ap); +} + +void +errc(int eval, int code, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + verrc(eval, code, fmt, ap); + va_end(ap); +} + +void +verrc(int eval, int code, const char *fmt, va_list ap) +{ + if (_e_err_file == 0) + err_set_file((FILE *)0); + fprintf(_e_err_file, "%s: ", _getprogname()); + if (fmt != NULL) { + _e_visprintf(_e_err_file, fmt, ap); + fprintf(_e_err_file, ": "); + } + fprintf(_e_err_file, "%s\n", strerror(code)); + if (_e_err_exit.type) { +#ifdef __BLOCKS__ + if (_e_err_exit.type == ERR_EXIT_BLOCK) { + _e_err_exit.block(eval); + } else { + _e_err_exit.func(eval); + } +#else + _e_err_exit.func(eval); +#endif /* __BLOCKS__ */ + } + exit(eval); +} + +void +errx(int eval, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + verrx(eval, fmt, ap); + va_end(ap); +} + +void +verrx(int eval, const char *fmt, va_list ap) +{ + if (_e_err_file == 0) + err_set_file((FILE *)0); + fprintf(_e_err_file, "%s: ", _getprogname()); + if (fmt != NULL) + _e_visprintf(_e_err_file, fmt, ap); + fprintf(_e_err_file, "\n"); + if (_e_err_exit.type) { +#ifdef __BLOCKS__ + if (_e_err_exit.type == ERR_EXIT_BLOCK) { + _e_err_exit.block(eval); + } else { + _e_err_exit.func(eval); + } +#else + _e_err_exit.func(eval); +#endif /* __BLOCKS__ */ + } + exit(eval); +} + +__weak_reference(_warn, warn); + +void +_warn(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vwarnc(errno, fmt, ap); + va_end(ap); +} + +void +vwarn(const char *fmt, va_list ap) +{ + vwarnc(errno, fmt, ap); +} + +void +warnc(int code, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vwarnc(code, fmt, ap); + va_end(ap); +} + +void +vwarnc(int code, const char *fmt, va_list ap) +{ + if (_e_err_file == 0) + err_set_file((FILE *)0); + fprintf(_e_err_file, "%s: ", _getprogname()); + if (fmt != NULL) { + _e_visprintf(_e_err_file, fmt, ap); + fprintf(_e_err_file, ": "); + } + fprintf(_e_err_file, "%s\n", strerror(code)); +} + +void +warnx(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vwarnx(fmt, ap); + va_end(ap); +} + +void +vwarnx(const char *fmt, va_list ap) +{ + if (_e_err_file == 0) + err_set_file((FILE *)0); + fprintf(_e_err_file, "%s: ", _getprogname()); + if (fmt != NULL) + _e_visprintf(_e_err_file, fmt, ap); + fprintf(_e_err_file, "\n"); +} diff --git a/gen/FreeBSD/exec.3 b/gen/FreeBSD/exec.3 new file mode 100644 index 0000000..2f49ef3 --- /dev/null +++ b/gen/FreeBSD/exec.3 @@ -0,0 +1,326 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)exec.3 8.3 (Berkeley) 1/24/94 +.\" $FreeBSD: src/lib/libc/gen/exec.3,v 1.28 2008/06/23 05:22:06 ed Exp $ +.\" +.Dd January 24, 1994 +.Dt EXEC 3 +.Os +.Sh NAME +.Nm execl , +.Nm execle , +.Nm execlp , +.Nm execv , +.Nm execvp , +.Nm execvP +.Nd execute a file +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Vt extern char **environ ; +.Ft int +.Fo execl +.Fa "const char *path" +.Fa "const char *arg0" +.Fa ... /* "(char *)0" */ +.Fc +.Ft int +.Fo execle +.Fa "const char *path" +.Fa "const char *arg0" +.Fa ... +.Fa /* +.Bk -words +.Fa "(char *)0" "char *const envp[]" */ +.Ek +.Fc +.Ft int +.Fo execlp +.Fa "const char *file" +.Fa "const char *arg0" +.Fa ... /* "(char *)0" */ +.Fc +.Ft int +.Fo execv +.Fa "const char *path" +.Fa "char *const argv[]" +.Fc +.Ft int +.Fo execvp +.Fa "const char *file" +.Fa "char *const argv[]" +.Fc +.Ft int +.Fo execvP +.Fa "const char *file" +.Fa "const char *search_path" +.Fa "char *const argv[]" +.Fc +.Sh DESCRIPTION +The +.Nm exec +family of functions replaces the current process image with a +new process image. +The functions described in this manual page are front-ends for the function +.Xr execve 2 . +(See the manual page for +.Xr execve 2 +for detailed information about the replacement of the current process.) +.Pp +The initial argument for these functions is the pathname of a file which +is to be executed. +.Pp +The +.Fa "const char *arg0" +and subsequent ellipses in the +.Fn execl , +.Fn execlp , +and +.Fn execle +functions can be thought of as +.Em arg0 , +.Em arg1 , +\&..., +.Em argn . +Together they describe a list of one or more pointers to null-terminated +strings that represent the argument list available to the executed program. +The first argument, by convention, should point to the file name associated +with the file being executed. +The list of arguments +.Em must +be terminated by a +.Dv NULL +pointer. +.Pp +The +.Fn execv , +.Fn execvp , +and +.Fn execvP +functions provide an array of pointers to null-terminated strings that +represent the argument list available to the new program. +The first argument, by convention, should point to the file name associated +with the file being executed. +The array of pointers +.Sy must +be terminated by a +.Dv NULL +pointer. +.Pp +The +.Fn execle +function also specifies the environment of the executed process +by following the +.Dv NULL +pointer that terminates the list of arguments in the argument list +or the pointer to the argv array with an additional argument. +This additional argument is an array of pointers to null-terminated strings +and +.Em must +be terminated by a +.Dv NULL +pointer. +The other functions take the environment for the new process image from the +external variable +.Va environ +in the current process. +.Pp +Some of these functions have special semantics. +.Pp +The functions +.Fn execlp , +.Fn execvp , +and +.Fn execvP +will duplicate the actions of the shell in searching for an executable file +if the specified file name does not contain a slash +.Dq Li / +character. +For +.Fn execlp +and +.Fn execvp , +search path is the path specified in the environment by +.Dq Ev PATH +variable. +If this variable is not specified, +the default path is set according to the +.Dv _PATH_DEFPATH +definition in +.In paths.h , +which is set to +.Dq Ev /usr/bin:/bin . +For +.Fn execvP , +the search path is specified as an argument to the function. +In addition, certain errors are treated specially. +.Pp +If an error is ambiguous (for simplicity, we shall consider all +errors except +.Er ENOEXEC +as being ambiguous here, although only the critical error +.Er EACCES +is really ambiguous), +then these functions will act as if they stat the file to determine +whether the file exists and has suitable execute permissions. +If it does, they will return immediately with the global variable +.Va errno +restored to the value set by +.Fn execve . +Otherwise, the search will be continued. +If the search completes without performing a successful +.Fn execve +or terminating due to an error, +these functions will return with the global variable +.Va errno +set to +.Er EACCES +or +.Er ENOENT +according to whether at least one file with suitable execute permissions +was found. +.Pp +If the header of a file is not recognized (the attempted +.Fn execve +returned +.Er ENOEXEC ) , +these functions will execute the shell with the path of +the file as its first argument. +(If this attempt fails, no further searching is done.) +.Sh RETURN VALUES +If any of the +.Fn exec +functions returns, an error will have occurred. +The return value is \-1, and the global variable +.Va errno +will be set to indicate the error. +.Sh FILES +.Bl -tag -width /bin/sh -compact +.It Pa /bin/sh +The shell. +.El +.Sh COMPATIBILITY +Historically, the default path for the +.Fn execlp +and +.Fn execvp +functions was +.Dq Pa :/bin:/usr/bin . +This was changed to place the current directory last to enhance system +security. +.Pp +The behavior of +.Fn execlp +and +.Fn execvp +when errors occur while attempting to execute the file is not quite historic +practice, and has not traditionally been documented and is not specified +by the +.Tn POSIX +standard. +.Pp +Traditionally, the functions +.Fn execlp +and +.Fn execvp +ignored all errors except for the ones described above and +.Er ETXTBSY , +upon which they retried after sleeping for several seconds, and +.Er ENOMEM +and +.Er E2BIG , +upon which they returned. +They now return for +.Er ETXTBSY , +and determine existence and executability more carefully. +In particular, +.Er EACCES +for inaccessible directories in the path prefix is no longer +confused with +.Er EACCES +for files with unsuitable execute permissions. +In +.Bx 4.4 , +they returned upon all errors except +.Er EACCES , +.Er ENOENT , +.Er ENOEXEC +and +.Er ETXTBSY . +This was inferior to the traditional error handling, +since it breaks the ignoring of errors for path prefixes +and only improves the handling of the unusual ambiguous error +.Er EFAULT +and the unusual error +.Er EIO . +The behaviour was changed to match the behaviour of +.Xr sh 1 . +.Sh ERRORS +The +.Fn execl , +.Fn execle , +.Fn execlp , +.Fn execvp , +and +.Fn execvP +functions +may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr execve 2 +and +.Xr malloc 3 . +.Pp +The +.Fn execv +function may fail and set +.Va errno +for any of the errors specified for the library function +.Xr execve 2 . +.Sh SEE ALSO +.Xr sh 1 , +.Xr execve 2 , +.Xr fork 2 , +.Xr ptrace 2 , +.Xr environ 7 +.Sh STANDARDS +The +.Fn execl , +.Fn execv , +.Fn execle , +.Fn execlp , +and +.Fn execvp +functions +conform to +.St -p1003.1-88 . +The +.Fn execvP +function first appeared in +.Fx 5.2 . diff --git a/gen/FreeBSD/exec.c b/gen/FreeBSD/exec.c new file mode 100644 index 0000000..86cf335 --- /dev/null +++ b/gen/FreeBSD/exec.c @@ -0,0 +1,289 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/exec.c,v 1.27 2009/12/05 18:55:16 ed Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "un-namespace.h" +#include "libc_private.h" + +#include +#define environ (*_NSGetEnviron()) + +int +_execvpe(const char *name, char * const argv[], char * const envp[]); + +int +execl(const char *name, const char *arg, ...) +{ + va_list ap; + const char **argv; + int n; + + va_start(ap, arg); + n = 1; + while (va_arg(ap, char *) != NULL) + n++; + va_end(ap); + argv = alloca((n + 1) * sizeof(*argv)); + if (argv == NULL) { + errno = ENOMEM; + return (-1); + } + va_start(ap, arg); + n = 1; + argv[0] = arg; + while ((argv[n] = va_arg(ap, char *)) != NULL) + n++; + va_end(ap); + return (_execve(name, __DECONST(char **, argv), environ)); +} + +int +execle(const char *name, const char *arg, ...) +{ + va_list ap; + const char **argv; + char **envp; + int n; + + va_start(ap, arg); + n = 1; + while (va_arg(ap, char *) != NULL) + n++; + va_end(ap); + argv = alloca((n + 1) * sizeof(*argv)); + if (argv == NULL) { + errno = ENOMEM; + return (-1); + } + va_start(ap, arg); + n = 1; + argv[0] = arg; + while ((argv[n] = va_arg(ap, char *)) != NULL) + n++; + envp = va_arg(ap, char **); + va_end(ap); + return (_execve(name, __DECONST(char **, argv), envp)); +} + +int +execlp(const char *name, const char *arg, ...) +{ + va_list ap; + const char **argv; + int n; + + va_start(ap, arg); + n = 1; + while (va_arg(ap, char *) != NULL) + n++; + va_end(ap); + argv = alloca((n + 1) * sizeof(*argv)); + if (argv == NULL) { + errno = ENOMEM; + return (-1); + } + va_start(ap, arg); + n = 1; + argv[0] = arg; + while ((argv[n] = va_arg(ap, char *)) != NULL) + n++; + va_end(ap); + return (execvp(name, __DECONST(char **, argv))); +} + +int +execv(name, argv) + const char *name; + char * const *argv; +{ + (void)_execve(name, argv, environ); + return (-1); +} + +int +execvp(const char *name, char * const *argv) +{ + return (_execvpe(name, argv, environ)); +} + +static int +execvPe(const char *name, const char *path, char * const *argv, + char * const *envp) +{ + const char **memp; + size_t cnt, lp, ln; + int eacces, save_errno; + char *cur, buf[MAXPATHLEN]; + const char *p, *bp; + struct stat sb; + + eacces = 0; + + /* If it's an absolute or relative path name, it's easy. */ + if (index(name, '/')) { + bp = name; + cur = NULL; + goto retry; + } + bp = buf; + + /* If it's an empty path name, fail in the usual POSIX way. */ + if (*name == '\0') { + errno = ENOENT; + return (-1); + } + + cur = alloca(strlen(path) + 1); + if (cur == NULL) { + errno = ENOMEM; + return (-1); + } + strcpy(cur, path); + while ((p = strsep(&cur, ":")) != NULL) { + /* + * It's a SHELL path -- double, leading and trailing colons + * mean the current directory. + */ + if (*p == '\0') { + p = "."; + lp = 1; + } else + lp = strlen(p); + ln = strlen(name); + + /* + * If the path is too long complain. This is a possible + * security issue; given a way to make the path too long + * the user may execute the wrong program. + */ + if (lp + ln + 2 > sizeof(buf)) { + (void)_write(STDERR_FILENO, "execvP: ", 8); + (void)_write(STDERR_FILENO, p, lp); + (void)_write(STDERR_FILENO, ": path too long\n", + 16); + continue; + } + bcopy(p, buf, lp); + buf[lp] = '/'; + bcopy(name, buf + lp + 1, ln); + buf[lp + ln + 1] = '\0'; + +retry: (void)_execve(bp, argv, envp); + switch (errno) { + case E2BIG: + goto done; + case ELOOP: + case ENAMETOOLONG: + case ENOENT: + break; + case ENOEXEC: + for (cnt = 0; argv[cnt]; ++cnt) + ; + memp = alloca((cnt + 2) * sizeof(char *)); + if (memp == NULL) { + /* errno = ENOMEM; XXX override ENOEXEC? */ + goto done; + } + memp[0] = "sh"; + memp[1] = bp; + bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); + (void)_execve(_PATH_BSHELL, + __DECONST(char **, memp), envp); + goto done; + case ENOMEM: + goto done; + case ENOTDIR: + break; + case ETXTBSY: + /* + * We used to retry here, but sh(1) doesn't. + */ + goto done; + default: + /* + * EACCES may be for an inaccessible directory or + * a non-executable file. Call stat() to decide + * which. This also handles ambiguities for EFAULT + * and EIO, and undocumented errors like ESTALE. + * We hope that the race for a stat() is unimportant. + */ + save_errno = errno; + if (stat(bp, &sb) != 0) + break; + if (save_errno == EACCES) { + eacces = 1; + continue; + } + errno = save_errno; + goto done; + } + } + if (eacces) + errno = EACCES; + else if (cur) + errno = ENOENT; + /* else use existing errno from _execve */ +done: + return (-1); +} + +int +execvP(const char *name, const char *path, char * const argv[]) +{ + return execvPe(name, path, argv, environ); +} + +__private_extern__ int +_execvpe(const char *name, char * const argv[], char * const envp[]) +{ + const char *path; + + /* Get the path we're searching. */ + if ((path = getenv("PATH")) == NULL) + path = _PATH_DEFPATH; + + return (execvPe(name, path, argv, envp)); +} diff --git a/gen/FreeBSD/fmtcheck.3 b/gen/FreeBSD/fmtcheck.3 new file mode 100644 index 0000000..90d0f03 --- /dev/null +++ b/gen/FreeBSD/fmtcheck.3 @@ -0,0 +1,115 @@ +.\" Copyright (c) 2000 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This file was contributed to The NetBSD Foundation by Allen Briggs. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the NetBSD +.\" Foundation, Inc. and its contributors. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/fmtcheck.3,v 1.10 2008/08/02 06:02:42 das Exp $ +.Dd October 16, 2002 +.Os +.Dt FMTCHECK 3 +.Sh NAME +.Nm fmtcheck +.Nd sanitizes user-supplied +.Xr printf 3 Ns -style +format string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft const char * +.Fn fmtcheck "const char *fmt_suspect" "const char *fmt_default" +.Sh DESCRIPTION +The +.Fn fmtcheck +scans +.Fa fmt_suspect +and +.Fa fmt_default +to determine if +.Fa fmt_suspect +will consume the same argument types as +.Fa fmt_default +and to ensure that +.Fa fmt_suspect +is a valid format string. +.Pp +The +.Xr printf 3 +family of functions cannot verify the types of arguments that they are +passed at run-time. +In some cases, like +.Xr catgets 3 , +it is useful or necessary to use a user-supplied format string with no +guarantee that the format string matches the specified arguments. +.Pp +The +.Fn fmtcheck +was designed to be used in these cases, as in: +.Bd -literal -offset indent +printf(fmtcheck(user_format, standard_format), arg1, arg2); +.Ed +.Pp +In the check, field widths, fillers, precisions, etc.\& are ignored (unless +the field width or precision is an asterisk +.Ql * +instead of a digit string). +Also, any text other than the format specifiers +is completely ignored. +.Sh RETURN VALUES +If +.Fa fmt_suspect +is a valid format and consumes the same argument types as +.Fa fmt_default , +then the +.Fn fmtcheck +will return +.Fa fmt_suspect . +Otherwise, it will return +.Fa fmt_default . +.Sh SECURITY CONSIDERATIONS +Note that the formats may be quite different as long as they accept the +same arguments. +For example, +.Qq Li "%p %o %30s %#llx %-10.*e %n" +is compatible with +.Qq Li "This number %lu %d%% and string %s has %qd numbers and %.*g floats (%n)" . +However, +.Qq Li %o +is not equivalent to +.Qq Li %lx +because +the first requires an integer and the second requires a long. +.Sh SEE ALSO +.Xr printf 3 +.Sh BUGS +The +.Fn fmtcheck +function does not recognize positional parameters. diff --git a/gen/FreeBSD/fmtcheck.c b/gen/FreeBSD/fmtcheck.c new file mode 100644 index 0000000..74b1d21 --- /dev/null +++ b/gen/FreeBSD/fmtcheck.c @@ -0,0 +1,325 @@ +/* $NetBSD: fmtcheck.c,v 1.8 2008/04/28 20:22:59 martin Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code was contributed to The NetBSD Foundation by Allen Briggs. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/fmtcheck.c,v 1.10 2009/06/23 23:52:12 delphij Exp $"); + +#include +#include +#include + +__weak_reference(__fmtcheck, fmtcheck); + +enum __e_fmtcheck_types { + FMTCHECK_START, + FMTCHECK_SHORT, + FMTCHECK_INT, + FMTCHECK_WINTT, + FMTCHECK_LONG, + FMTCHECK_QUAD, + FMTCHECK_INTMAXT, + FMTCHECK_PTRDIFFT, + FMTCHECK_SIZET, + FMTCHECK_CHARPOINTER, + FMTCHECK_SHORTPOINTER, + FMTCHECK_INTPOINTER, + FMTCHECK_LONGPOINTER, + FMTCHECK_QUADPOINTER, + FMTCHECK_INTMAXTPOINTER, + FMTCHECK_PTRDIFFTPOINTER, + FMTCHECK_SIZETPOINTER, +#ifndef NO_FLOATING_POINT + FMTCHECK_DOUBLE, + FMTCHECK_LONGDOUBLE, +#endif + FMTCHECK_STRING, + FMTCHECK_WSTRING, + FMTCHECK_WIDTH, + FMTCHECK_PRECISION, + FMTCHECK_DONE, + FMTCHECK_UNKNOWN +}; +typedef enum __e_fmtcheck_types EFT; + +enum e_modifier { + MOD_NONE, + MOD_CHAR, + MOD_SHORT, + MOD_LONG, + MOD_QUAD, + MOD_INTMAXT, + MOD_LONGDOUBLE, + MOD_PTRDIFFT, + MOD_SIZET, +}; + +#define RETURN(pf,f,r) do { \ + *(pf) = (f); \ + return r; \ + } /*NOTREACHED*/ /*CONSTCOND*/ while (0) + +static EFT +get_next_format_from_precision(const char **pf) +{ + enum e_modifier modifier; + const char *f; + + f = *pf; + switch (*f) { + case 'h': + f++; + if (!*f) RETURN(pf,f,FMTCHECK_UNKNOWN); + if (*f == 'h') { + f++; + modifier = MOD_CHAR; + } else { + modifier = MOD_SHORT; + } + break; + case 'j': + f++; + modifier = MOD_INTMAXT; + break; + case 'l': + f++; + if (!*f) RETURN(pf,f,FMTCHECK_UNKNOWN); + if (*f == 'l') { + f++; + modifier = MOD_QUAD; + } else { + modifier = MOD_LONG; + } + break; + case 'q': + f++; + modifier = MOD_QUAD; + break; + case 't': + f++; + modifier = MOD_PTRDIFFT; + break; + case 'z': + f++; + modifier = MOD_SIZET; + break; + case 'L': + f++; + modifier = MOD_LONGDOUBLE; + break; + default: + modifier = MOD_NONE; + break; + } + if (!*f) RETURN(pf,f,FMTCHECK_UNKNOWN); + if (strchr("diouxX", *f)) { + switch (modifier) { + case MOD_LONG: + RETURN(pf,f,FMTCHECK_LONG); + case MOD_QUAD: + RETURN(pf,f,FMTCHECK_QUAD); + case MOD_INTMAXT: + RETURN(pf,f,FMTCHECK_INTMAXT); + case MOD_PTRDIFFT: + RETURN(pf,f,FMTCHECK_PTRDIFFT); + case MOD_SIZET: + RETURN(pf,f,FMTCHECK_SIZET); + case MOD_CHAR: + case MOD_SHORT: + case MOD_NONE: + RETURN(pf,f,FMTCHECK_INT); + default: + RETURN(pf,f,FMTCHECK_UNKNOWN); + } + } + if (*f == 'n') { + switch (modifier) { + case MOD_CHAR: + RETURN(pf,f,FMTCHECK_CHARPOINTER); + case MOD_SHORT: + RETURN(pf,f,FMTCHECK_SHORTPOINTER); + case MOD_LONG: + RETURN(pf,f,FMTCHECK_LONGPOINTER); + case MOD_QUAD: + RETURN(pf,f,FMTCHECK_QUADPOINTER); + case MOD_INTMAXT: + RETURN(pf,f,FMTCHECK_INTMAXTPOINTER); + case MOD_PTRDIFFT: + RETURN(pf,f,FMTCHECK_PTRDIFFTPOINTER); + case MOD_SIZET: + RETURN(pf,f,FMTCHECK_SIZETPOINTER); + case MOD_NONE: + RETURN(pf,f,FMTCHECK_INTPOINTER); + default: + RETURN(pf,f,FMTCHECK_UNKNOWN); + } + } + if (strchr("DOU", *f)) { + if (modifier != MOD_NONE) + RETURN(pf,f,FMTCHECK_UNKNOWN); + RETURN(pf,f,FMTCHECK_LONG); + } +#ifndef NO_FLOATING_POINT + if (strchr("aAeEfFgG", *f)) { + switch (modifier) { + case MOD_LONGDOUBLE: + RETURN(pf,f,FMTCHECK_LONGDOUBLE); + case MOD_LONG: + case MOD_NONE: + RETURN(pf,f,FMTCHECK_DOUBLE); + default: + RETURN(pf,f,FMTCHECK_UNKNOWN); + } + } +#endif + if (*f == 'c') { + switch (modifier) { + case MOD_LONG: + RETURN(pf,f,FMTCHECK_WINTT); + case MOD_NONE: + RETURN(pf,f,FMTCHECK_INT); + default: + RETURN(pf,f,FMTCHECK_UNKNOWN); + } + } + if (*f == 'C') { + if (modifier != MOD_NONE) + RETURN(pf,f,FMTCHECK_UNKNOWN); + RETURN(pf,f,FMTCHECK_WINTT); + } + if (*f == 's') { + switch (modifier) { + case MOD_LONG: + RETURN(pf,f,FMTCHECK_WSTRING); + case MOD_NONE: + RETURN(pf,f,FMTCHECK_STRING); + default: + RETURN(pf,f,FMTCHECK_UNKNOWN); + } + } + if (*f == 'S') { + if (modifier != MOD_NONE) + RETURN(pf,f,FMTCHECK_UNKNOWN); + RETURN(pf,f,FMTCHECK_WSTRING); + } + if (*f == 'p') { + if (modifier != MOD_NONE) + RETURN(pf,f,FMTCHECK_UNKNOWN); + RETURN(pf,f,FMTCHECK_LONG); + } + RETURN(pf,f,FMTCHECK_UNKNOWN); + /*NOTREACHED*/ +} + +static EFT +get_next_format_from_width(const char **pf) +{ + const char *f; + + f = *pf; + if (*f == '.') { + f++; + if (*f == '*') { + RETURN(pf,f,FMTCHECK_PRECISION); + } + /* eat any precision (empty is allowed) */ + while (isdigit(*f)) f++; + if (!*f) RETURN(pf,f,FMTCHECK_UNKNOWN); + } + RETURN(pf,f,get_next_format_from_precision(pf)); + /*NOTREACHED*/ +} + +static EFT +get_next_format(const char **pf, EFT eft) +{ + int infmt; + const char *f; + + if (eft == FMTCHECK_WIDTH) { + (*pf)++; + return get_next_format_from_width(pf); + } else if (eft == FMTCHECK_PRECISION) { + (*pf)++; + return get_next_format_from_precision(pf); + } + + f = *pf; + infmt = 0; + while (!infmt) { + f = strchr(f, '%'); + if (f == NULL) + RETURN(pf,f,FMTCHECK_DONE); + f++; + if (!*f) + RETURN(pf,f,FMTCHECK_UNKNOWN); + if (*f != '%') + infmt = 1; + else + f++; + } + + /* Eat any of the flags */ + while (*f && (strchr("#'0- +", *f))) + f++; + + if (*f == '*') { + RETURN(pf,f,FMTCHECK_WIDTH); + } + /* eat any width */ + while (isdigit(*f)) f++; + if (!*f) { + RETURN(pf,f,FMTCHECK_UNKNOWN); + } + + RETURN(pf,f,get_next_format_from_width(pf)); + /*NOTREACHED*/ +} + +const char * +__fmtcheck(const char *f1, const char *f2) +{ + const char *f1p, *f2p; + EFT f1t, f2t; + + if (!f1) return f2; + + f1p = f1; + f1t = FMTCHECK_START; + f2p = f2; + f2t = FMTCHECK_START; + while ((f1t = get_next_format(&f1p, f1t)) != FMTCHECK_DONE) { + if (f1t == FMTCHECK_UNKNOWN) + return f2; + f2t = get_next_format(&f2p, f2t); + if (f1t != f2t) + return f2; + } + return f1; +} diff --git a/gen/FreeBSD/fmtmsg.3 b/gen/FreeBSD/fmtmsg.3 new file mode 100644 index 0000000..3320bd0 --- /dev/null +++ b/gen/FreeBSD/fmtmsg.3 @@ -0,0 +1,260 @@ +.\" +.\" Copyright (c) 2002 Mike Barcroft +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/fmtmsg.3,v 1.4 2002/12/04 18:57:44 ru Exp $ +.\" +.Dd August 5, 2002 +.Dt FMTMSG 3 +.Os +.Sh NAME +.Nm fmtmsg +.Nd display a detailed diagnostic message +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In fmtmsg.h +.Ft int +.Fo fmtmsg +.Fa "long classification" "const char *label" "int severity" +.Fa "const char *text" "const char *action" "const char *tag" +.Fc +.Sh DESCRIPTION +The +.Fn fmtmsg +function displays a detailed diagnostic message, based on +the supplied arguments, to +.Dv stderr +and/or the system console. +.Pp +The +.Fa classification +argument is the bitwise inclusive +.Tn OR +of zero or one of the manifest constants from +each of the classification groups below. +The Output classification group is an exception since both +.Dv MM_PRINT +and +.Dv MM_CONSOLE +may be specified. +.Bl -tag -width indent +.It Output +.Bl -tag -width ".Dv MM_CONSOLE" +.It Dv MM_PRINT +Output should take place on +.Dv stderr . +.It Dv MM_CONSOLE +Output should take place on the system console. +.El +.It "Source of Condition (Major)" +.Bl -tag -width ".Dv MM_CONSOLE" +.It Dv MM_HARD +The source of the condition is hardware related. +.It Dv MM_SOFT +The source of the condition is software related. +.It Dv MM_FIRM +The source of the condition is firmware related. +.El +.It "Source of Condition (Minor)" +.Bl -tag -width ".Dv MM_CONSOLE" +.It Dv MM_APPL +The condition was detected at the application level. +.It Dv MM_UTIL +The condition was detected at the utility level. +.It Dv MM_OPSYS +The condition was detected at the operating system level. +.El +.It Status +.Bl -tag -width ".Dv MM_CONSOLE" +.It Dv MM_RECOVER +The application can recover from the condition. +.It Dv MM_NRECOV +The application is unable to recover from the condition. +.El +.El +.Pp +Alternatively, the +.Dv MM_NULLMC +manifest constant may be used to specify no classification. +.Pp +The +.Fa label +argument indicates the source of the message. +It is made up of two fields separated by a colon +.Pq Ql \&: . +The first field can be up to 10 bytes, +and the second field can be up to 14 bytes. +The +.Dv MM_NULLLBL +manifest constant may be used to specify no label. +.Pp +The +.Fa severity +argument identifies the importance of the condition. +One of the following manifest constants should be used for this argument. +.Bl -tag -offset indent -width ".Dv MM_WARNING" +.It Dv MM_HALT +The application has confronted a serious fault and is halting. +.It Dv MM_ERROR +The application has detected a fault. +.It Dv MM_WARNING +The application has detected an unusual condition, +that could be indicative of a problem. +.It Dv MM_INFO +The application is providing information about a non-error condition. +.It Dv MM_NOSEV +No severity level supplied. +.El +.Pp +The +.Fa text +argument details the error condition that caused the message. +There is no limit on the size of this character string. +The +.Dv MM_NULLTXT +manifest constant may be used to specify no text. +.Pp +The +.Fa action +argument details how the error-recovery process should begin. +Upon output, +.Fn fmtmsg +will prefix +.Qq Li "TO FIX:" +to the beginning of the +.Fa action +argument. +The +.Dv MM_NULLACT +manifest constant may be used to specify no action. +.Pp +The +.Fa tag +argument should reference online documentation for the message. +This usually includes the +.Fa label +and a unique identifying number. +An example tag is +.Qq Li BSD:ls:168 . +The +.Dv MM_NULLTAG +manifest constant may be used to specify no tag. +.Sh RETURN VALUES +The +.Fn fmtmsg +function returns +.Dv MM_OK +upon success, +.Dv MM_NOMSG +to indicate output to +.Dv stderr +failed, +.Dv MM_NOCON +to indicate output to the system console failed, or +.Dv MM_NOTOK +to indicate output to +.Dv stderr +and the system console failed. +.Sh ENVIRONMENT +The +.Ev MSGVERB +(message verbosity) +environment variable specifies which arguments to +.Fn fmtmsg +will be output to +.Dv stderr , +and in which order. +.Ev MSGVERB +should be a colon +.Pq Ql \&: +separated list of identifiers. +Valid identifiers include: +.Li label , severity , text , action , +and +.Li tag . +If invalid identifiers are specified or incorrectly separated, +the default message verbosity and ordering will be used. +The default ordering is equivalent to a +.Ev MSGVERB +with a value of +.Qq Li label:severity:text:action:tag . +.Sh EXAMPLES +The code: +.Bd -literal -offset indent +fmtmsg(MM_UTIL | MM_PRINT, "BSD:ls", MM_ERROR, + "illegal option -- z", "refer to manual", "BSD:ls:001"); +.Ed +.Pp +will output: +.Bd -literal -offset indent +BSD:ls: ERROR: illegal option -- z +TO FIX: refer to manual BSD:ls:001 +.Ed +.Pp +to +.Dv stderr . +.Pp +The same code, with +.Ev MSGVERB +set to +.Qq Li "text:severity:action:tag" , +produces: +.Bd -literal -offset indent +illegal option -- z: ERROR +TO FIX: refer to manual BSD:ls:001 +.Ed +.Sh SEE ALSO +.Xr err 3 , +.Xr exit 3 , +.Xr strerror 3 +.Sh STANDARDS +The +.Fn fmtmsg +function conforms to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn fmtmsg +function first appeared in +.Fx 5.0 . +.Sh BUGS +Specifying +.Dv MM_NULLMC +for the +.Fa classification +argument makes little sense, since without an output specified, +.Fn fmtmsg +is unable to do anything useful. +.Pp +In order for +.Fn fmtmsg +to output to the system console, the effective +user must have appropriate permission to write to +.Pa /dev/console . +This means that on most systems +.Fn fmtmsg +will return +.Dv MM_NOCON +unless the effective user is root. diff --git a/gen/FreeBSD/fmtmsg.c b/gen/FreeBSD/fmtmsg.c new file mode 100644 index 0000000..ada1c9d --- /dev/null +++ b/gen/FreeBSD/fmtmsg.c @@ -0,0 +1,271 @@ +/*- + * Copyright (c) 2002 Mike Barcroft + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/fmtmsg.c,v 1.6 2009/11/08 14:02:54 brueffer Exp $"); + +#include +#include +#include +#include +#include +#include + +/* Default value for MSGVERB. */ +#define DFLT_MSGVERB "label:severity:text:action:tag" + +/* Maximum valid size for a MSGVERB. */ +#define MAX_MSGVERB sizeof(DFLT_MSGVERB) + +static char *printfmt(char *, long, const char *, int, const char *, + const char *, const char *); +static char *nextcomp(const char *); +static const char + *sevinfo(int); +static int validmsgverb(const char *); + +static const char * const validlist[] = { + "label", "severity", "text", "action", "tag", NULL +}; + +int +fmtmsg(long class, const char *label, int sev, const char *text, + const char *action, const char *tag) +{ + FILE *fp; + char *env, *msgverb, *output; + int ret = MM_OK; + + if (action == NULL) action = ""; + + if (class & MM_PRINT) { + if ((env = getenv("MSGVERB")) != NULL && *env != '\0' && + strlen(env) <= strlen(DFLT_MSGVERB)) { + if ((msgverb = strdup(env)) == NULL) + return (MM_NOTOK); + else if (validmsgverb(msgverb) == 0) { + free(msgverb); + goto def; + } + } else { +def: + if ((msgverb = strdup(DFLT_MSGVERB)) == NULL) + return (MM_NOTOK); + } + output = printfmt(msgverb, class, label, sev, text, action, + tag); + if (output == NULL) { + free(msgverb); + return (MM_NOTOK); + } + if (*output != '\0') { + int out_len = fprintf(stderr, "%s", output); + if (out_len < 0) { + ret = MM_NOMSG; + } + } + free(msgverb); + free(output); + } + if (class & MM_CONSOLE) { + output = printfmt(DFLT_MSGVERB, class, label, sev, text, + action, tag); + if (output == NULL) + return (MM_NOCON); + if (*output != '\0') { + +/* +// /-------------\ +// / \ +// / \ +// / \ +// | XXXX XXXX | +// | XXXX XXXX | +// | XXX XXX | +// \ X / +// --\ XXX /-- +// | | XXX | | +// | | | | +// | I I I I I I I | +// | I I I I I I | +// \ / +// -- -- +// \-------/ +// +// DO NOT INTEGRATE THIS CHANGE +// +// Integrating it means DEATH. +// (see Revelation 6:8 for full details) + + XXX this is a *huge* kludge to pass the SuSv3 tests, + I don't think of it as cheating because they are + looking in the wrong place (/realdev/console) to do + their testing, but they can't look in the "right" + place for various reasons */ + char *cpath = "/dev/console"; + struct stat sb; + int rc = stat("/realdev/console", &sb); + if (rc == 0 && (sb.st_mode & S_IFDIR)) { + cpath = "/realdev/console"; + } + /* XXX thus ends the kludge - changes after + this point may be safely integrated */ + + if ((fp = fopen(cpath, "a")) == NULL) { + if (ret == MM_OK) { + ret = MM_NOCON; + } else { + ret = MM_NOTOK; + } + } else { + fprintf(fp, "%s", output); + fclose(fp); + } + } + free(output); + } + return (ret); +} + +#define INSERT_COLON \ + if (*output != '\0') \ + strlcat(output, ": ", size) +#define INSERT_NEWLINE \ + if (*output != '\0') \ + strlcat(output, "\n", size) +#define INSERT_SPACE \ + if (*output != '\0') \ + strlcat(output, " ", size) + +/* + * Returns NULL on memory allocation failure, otherwise returns a pointer to + * a newly malloc()'d output buffer. + */ +static char * +printfmt(char *msgverb, long class, const char *label, int sev, + const char *text, const char *act, const char *tag) +{ + size_t size; + char *comp, *output; + const char *sevname; + + size = 32; + if (label != MM_NULLLBL) + size += strlen(label); + if ((sevname = sevinfo(sev)) != NULL) + size += strlen(sevname); + if (text != MM_NULLTXT) + size += strlen(text); + if (act != MM_NULLACT) + size += strlen(act); + if (tag != MM_NULLTAG) + size += strlen(tag); + + if ((output = malloc(size)) == NULL) + return (NULL); + *output = '\0'; + while ((comp = nextcomp(msgverb)) != NULL) { + if (strcmp(comp, "label") == 0 && label != MM_NULLLBL) { + INSERT_COLON; + strlcat(output, label, size); + } else if (strcmp(comp, "severity") == 0 && sevname != NULL) { + INSERT_COLON; + strlcat(output, sevinfo(sev), size); + } else if (strcmp(comp, "text") == 0 && text != MM_NULLTXT) { + INSERT_COLON; + strlcat(output, text, size); + } else if (strcmp(comp, "action") == 0 && act != MM_NULLACT) { + INSERT_NEWLINE; + strlcat(output, "TO FIX: ", size); + strlcat(output, act, size); + } else if (strcmp(comp, "tag") == 0 && tag != MM_NULLTAG) { + INSERT_SPACE; + strlcat(output, tag, size); + } + } + INSERT_NEWLINE; + return (output); +} + +/* + * Returns a component of a colon delimited string. NULL is returned to + * indicate that there are no remaining components. This function must be + * called until it returns NULL in order for the local state to be cleared. + */ +static char * +nextcomp(const char *msgverb) +{ + static char lmsgverb[MAX_MSGVERB], *state; + char *retval; + + if (*lmsgverb == '\0') { + strlcpy(lmsgverb, msgverb, sizeof(lmsgverb)); + retval = strtok_r(lmsgverb, ":", &state); + } else { + retval = strtok_r(NULL, ":", &state); + } + if (retval == NULL) + *lmsgverb = '\0'; + return (retval); +} + +static const char * +sevinfo(int sev) +{ + + switch (sev) { + case MM_HALT: + return ("HALT"); + case MM_ERROR: + return ("ERROR"); + case MM_WARNING: + return ("WARNING"); + case MM_INFO: + return ("INFO"); + default: + return (NULL); + } +} + +/* + * Returns 1 if the msgverb list is valid, otherwise 0. + */ +static int +validmsgverb(const char *msgverb) +{ + char *msgcomp; + int i, equality; + + equality = 0; + while ((msgcomp = nextcomp(msgverb)) != NULL) { + equality--; + for (i = 0; validlist[i] != NULL; i++) { + if (strcmp(msgcomp, validlist[i]) == 0) + equality++; + } + } + return (!equality); +} diff --git a/gen/FreeBSD/fnmatch.3 b/gen/FreeBSD/fnmatch.3 new file mode 100644 index 0000000..f3aa885 --- /dev/null +++ b/gen/FreeBSD/fnmatch.3 @@ -0,0 +1,162 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Guido van Rossum. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fnmatch.3 8.3 (Berkeley) 4/28/95 +.\" $FreeBSD: src/lib/libc/gen/fnmatch.3,v 1.19 2007/01/09 00:27:53 imp Exp $ +.\" +.Dd July 18, 2004 +.Dt FNMATCH 3 +.Os +.Sh NAME +.Nm fnmatch +.Nd test whether a filename or pathname matches a shell-style pattern +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In fnmatch.h +.Ft int +.Fn fnmatch "const char *pattern" "const char *string" "int flags" +.Sh DESCRIPTION +The +.Fn fnmatch +function +matches patterns according to the rules used by the shell. +It checks the string specified by the +.Fa string +argument to see if it matches the pattern specified by the +.Fa pattern +argument. +.Pp +The +.Fa flags +argument modifies the interpretation of +.Fa pattern +and +.Fa string . +The value of +.Fa flags +is the bitwise inclusive +.Tn OR +of any of the following +constants, which are defined in the include file +.In fnmatch.h . +.Bl -tag -width FNM_PATHNAME +.It Dv FNM_NOESCAPE +Normally, every occurrence of a backslash +.Pq Ql \e +followed by a character in +.Fa pattern +is replaced by that character. +This is done to negate any special meaning for the character. +If the +.Dv FNM_NOESCAPE +flag is set, a backslash character is treated as an ordinary character. +.It Dv FNM_PATHNAME +Slash characters in +.Fa string +must be explicitly matched by slashes in +.Fa pattern . +If this flag is not set, then slashes are treated as regular characters. +.It Dv FNM_PERIOD +Leading periods in +.Fa string +must be explicitly matched by periods in +.Fa pattern . +If this flag is not set, then leading periods are treated as regular +characters. +The definition of +.Dq leading +is related to the specification of +.Dv FNM_PATHNAME . +A period is always +.Dq leading +if it is the first character in +.Fa string . +Additionally, if +.Dv FNM_PATHNAME +is set, +a period is +leading +if it immediately follows a slash. +.It Dv FNM_LEADING_DIR +Ignore +.Dq Li /* +rest after successful +.Fa pattern +matching. +.It Dv FNM_CASEFOLD +Ignore case distinctions in both the +.Fa pattern +and the +.Fa string . +.El +.Sh RETURN VALUES +The +.Fn fnmatch +function returns zero if +.Fa string +matches the pattern specified by +.Fa pattern . +It returns the value +.Dv FNM_NOMATCH +if no match is found. +Otherwise, another non-zero value is returned on error. +.Sh LEGACY RETURN VALUES +The +.Fn fnmatch +function returns zero if +.Fa string +matches the pattern specified by +.Fa pattern ; +otherwise, it returns the value +.Dv FNM_NOMATCH . +.Sh SEE ALSO +.Xr sh 1 , +.Xr glob 3 , +.Xr regex 3 +.Sh STANDARDS +The current implementation of the +.Fn fnmatch +function +.Em does not +conform to +.St -p1003.2 . +Collating symbol expressions, equivalence class expressions and +character class expressions are not supported. +.Sh HISTORY +The +.Fn fnmatch +function first appeared in +.Bx 4.4 . +.Sh BUGS +The pattern +.Ql * +matches the empty string, even if +.Dv FNM_PATHNAME +is specified. diff --git a/gen/FreeBSD/fnmatch.c b/gen/FreeBSD/fnmatch.c new file mode 100644 index 0000000..f016eef --- /dev/null +++ b/gen/FreeBSD/fnmatch.c @@ -0,0 +1,472 @@ +/* + * Copyright (c) 1989, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Guido van Rossum. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/fnmatch.c,v 1.19 2010/04/16 22:29:24 jilles Exp $"); + +#include "xlocale_private.h" + +/* + * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. + * Compares a filename or pathname to a pattern. + */ + +/* + * Some notes on multibyte character support: + * 1. Patterns with illegal byte sequences match nothing. + * 2. Illegal byte sequences in the "string" argument are handled by treating + * them as single-byte characters with a value of the first byte of the + * sequence cast to wchar_t. + * 3. Multibyte conversion state objects (mbstate_t) are passed around and + * used for most, but not all, conversions. Further work will be required + * to support state-dependent encodings. + */ + +#include +#include +#include +#include +#include + +#include "collate.h" + +#define EOS '\0' + +#define RETURN_ERROR 2 /* neither 0 or FNM_NOMATCH */ +#define RANGE_MATCH 1 +#define RANGE_NOMATCH 0 +#define RANGE_ERROR (-1) + +#define RECURSION_MAX 64 + +__private_extern__ int rangematch(const char *, wchar_t, const char *, int, char **, char **, mbstate_t *, mbstate_t *, locale_t); +static int fnmatch1(const char *, const char *, const char *, int, mbstate_t, + mbstate_t, locale_t, int); + +int +fnmatch(pattern, string, flags) + const char *pattern, *string; + int flags; +{ + static const mbstate_t initial; +#if __DARWIN_UNIX03 + return (fnmatch1(pattern, string, string, flags, initial, initial, __current_locale(), RECURSION_MAX)); +#else /* !__DARWIN_UNIX03 */ + return (fnmatch1(pattern, string, string, flags, initial, initial, __current_locale(), RECURSION_MAX) != 0 ? FNM_NOMATCH : 0); +#endif /* __DARWIN_UNIX03 */ +} + +static int +fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs, loc, recursion) + const char *pattern, *string, *stringstart; + int flags; + mbstate_t patmbs, strmbs; + locale_t loc; + int recursion; +{ + char *newp, *news; + char c; + wchar_t pc, sc; + size_t pclen, sclen; + + if (recursion-- <= 0) + return RETURN_ERROR; + for (;;) { + pclen = mbrtowc_l(&pc, pattern, MB_LEN_MAX, &patmbs, loc); + if (pclen == (size_t)-1 || pclen == (size_t)-2) +#if __DARWIN_UNIX03 + return (RETURN_ERROR); +#else /* !__DARWIN_UNIX03 */ + return (FNM_NOMATCH); +#endif /* __DARWIN_UNIX03 */ + pattern += pclen; + sclen = mbrtowc_l(&sc, string, MB_LEN_MAX, &strmbs, loc); + if (sclen == (size_t)-1 || sclen == (size_t)-2) { + sc = (unsigned char)*string; + sclen = 1; + memset(&strmbs, 0, sizeof(strmbs)); + } + switch (pc) { + case EOS: + if ((flags & FNM_LEADING_DIR) && sc == '/') + return (0); + return (sc == EOS ? 0 : FNM_NOMATCH); + case '?': + if (sc == EOS) + return (FNM_NOMATCH); + if (sc == '/' && (flags & FNM_PATHNAME)) + return (FNM_NOMATCH); + if (sc == '.' && (flags & FNM_PERIOD) && + (string == stringstart || + ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) + return (FNM_NOMATCH); + string += sclen; + break; + case '*': + c = *pattern; + /* Collapse multiple stars. */ + while (c == '*') + c = *++pattern; + + if (sc == '.' && (flags & FNM_PERIOD) && + (string == stringstart || + ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) + return (FNM_NOMATCH); + + /* Optimize for pattern with * at end or before /. */ + if (c == EOS) + if (flags & FNM_PATHNAME) + return ((flags & FNM_LEADING_DIR) || + strchr(string, '/') == NULL ? + 0 : FNM_NOMATCH); + else + return (0); + else if (c == '/' && flags & FNM_PATHNAME) { + if ((string = strchr(string, '/')) == NULL) + return (FNM_NOMATCH); + break; + } + + /* General case, use recursion. */ + int ret; + while (sc != EOS) { + if ((ret = fnmatch1(pattern, string, stringstart, + flags, patmbs, strmbs, loc, recursion)) != FNM_NOMATCH) + return (ret); + sclen = mbrtowc_l(&sc, string, MB_LEN_MAX, + &strmbs, loc); + if (sclen == (size_t)-1 || + sclen == (size_t)-2) { + sc = (unsigned char)*string; + sclen = 1; + memset(&strmbs, 0, sizeof(strmbs)); + } + if (sc == '/' && flags & FNM_PATHNAME) + break; + string += sclen; + } + return (FNM_NOMATCH); + case '[': + if (sc == EOS) + return (FNM_NOMATCH); + if (sc == '/' && (flags & FNM_PATHNAME)) + return (FNM_NOMATCH); + if (sc == '.' && (flags & FNM_PERIOD) && + (string == stringstart || + ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) + return (FNM_NOMATCH); + + switch (rangematch(pattern, sc, string + sclen, flags, + &newp, &news, &patmbs, &strmbs, loc)) { + case RANGE_ERROR: +#if __DARWIN_UNIX03 + return (RETURN_ERROR); +#else /* !__DARWIN_UNIX03 */ + goto norm; +#endif /* __DARWIN_UNIX03 */ + case RANGE_MATCH: + pattern = newp; + string = news; + break; + case RANGE_NOMATCH: + return (FNM_NOMATCH); + } + break; + case '\\': + if (!(flags & FNM_NOESCAPE)) { + pclen = mbrtowc_l(&pc, pattern, MB_LEN_MAX, + &patmbs, loc); + if (pclen == (size_t)-1 || pclen == (size_t)-2) +#if __DARWIN_UNIX03 + return (RETURN_ERROR); +#else /* !__DARWIN_UNIX03 */ + return (FNM_NOMATCH); +#endif /* __DARWIN_UNIX03 */ + if (pclen == 0) + pc = '\\'; + pattern += pclen; + } + /* FALLTHROUGH */ + default: +#if !__DARWIN_UNIX03 + norm: +#endif /* !__DARWIN_UNIX03 */ + if (pc == sc) + ; + else if ((flags & FNM_CASEFOLD) && + (towlower_l(pc, loc) == towlower_l(sc, loc))) + ; + else + return (FNM_NOMATCH); + string += sclen; + break; + } + } + /* NOTREACHED */ +} + +#ifndef BUILDING_VARIANT +__private_extern__ int +rangematch(pattern, test, string, flags, newp, news, patmbs, strmbs, loc) + const char *pattern, *string; + wchar_t test; + int flags; + char **newp, **news; + mbstate_t *patmbs, *strmbs; + locale_t loc; +{ + int negate, ok, special; + wchar_t c, c2; + wchar_t buf[STR_LEN]; /* STR_LEN defined in collate.h */ + size_t pclen, sclen, len; + const char *origpat, *cp, *savestring; + mbstate_t save; + + /* + * A bracket expression starting with an unquoted circumflex + * character produces unspecified results (IEEE 1003.2-1992, + * 3.13.2). This implementation treats it like '!', for + * consistency with the regular expression syntax. + * J.T. Conklin (conklin@ngai.kaleida.com) + */ + if ( (negate = (*pattern == '!' || *pattern == '^')) ) + ++pattern; + + if (flags & FNM_CASEFOLD) + test = towlower_l(test, loc); + + /* + * A right bracket shall lose its special meaning and represent + * itself in a bracket expression if it occurs first in the list. + * -- POSIX.2 2.8.3.2 + */ + ok = 0; + origpat = pattern; + for (;;) { + c = 0; + if (*pattern == ']' && pattern > origpat) { + break; + } else if (*pattern == '\0') { + return (RANGE_ERROR); + } else if (*pattern == '/' && (flags & FNM_PATHNAME)) { + return (RANGE_NOMATCH); + } else if (*pattern == '\\' && !(flags & FNM_NOESCAPE)) + pattern++; + else if (*pattern == '[' && ((special = *(pattern + 1)) == '.' || special == '=' || special == ':')) { + cp = (pattern += 2); + while((cp = strchr(cp, special))) { + if (*(cp + 1) == ']') + break; + cp++; + } + if (!cp) + return (RANGE_ERROR); + if (special == '.') { +treat_like_collating_symbol: + len = __collate_collating_symbol(buf, STR_LEN, pattern, cp - pattern, patmbs, loc); + if (len == (size_t)-1 || len == 0) + return (RANGE_ERROR); + pattern = cp + 2; + if (len > 1) { + wchar_t *wp, sc; + /* no multi-character collation symbols as start of range */ + if (*(cp + 2) == '-' && *(cp + 3) != EOS + && *(cp + 3) != ']') + return (RANGE_ERROR); + wp = buf; + if (test != *wp++) + continue; + if (len == 1) { + ok = 1; + break; + } + memcpy(&save, strmbs, sizeof(save)); + savestring = string; + while (--len > 0) { + sclen = mbrtowc_l(&sc, string, MB_LEN_MAX, strmbs, loc); + if (sclen == (size_t)-1 || sclen == (size_t)-2) { + sc = (unsigned char)*string; + sclen = 1; + memset(&strmbs, 0, sizeof(strmbs)); + } + if (sc != *wp++) { + memcpy(strmbs, &save, sizeof(save)); + string = savestring; + break; + } + string += sclen; + } + if (len == 0) { + ok = 1; + break; + } + continue; /* no match */ + } + c = *buf; + } else if (special == '=') { + int ec; + memcpy(&save, patmbs, sizeof(save)); + ec = __collate_equiv_class(pattern, cp - pattern, patmbs, loc); + if (ec < 0) + return (RANGE_ERROR); + if (ec == 0) { + memcpy(patmbs, &save, sizeof(save)); + goto treat_like_collating_symbol; + } + pattern = cp + 2; + /* no equivalence classes as start of range */ + if (*(cp + 2) == '-' && *(cp + 3) != EOS && + *(cp + 3) != ']') + return (RANGE_ERROR); + len = __collate_equiv_match(ec, NULL, 0, test, string, strlen(string), strmbs, &sclen, loc); + if (len == (size_t)-1) { + return (RANGE_ERROR); + } + if (len > 0) { + ok = 1; + string += sclen; + break; + } + continue; + } else { /* special == ':' */ + wctype_t charclass; + char name[CHARCLASS_NAME_MAX + 1]; + /* no character classes as start of range */ + if (*(cp + 2) == '-' && *(cp + 3) != EOS && + *(cp + 3) != ']') + return (RANGE_ERROR); + /* assume character class names are ascii */ + if (cp - pattern > CHARCLASS_NAME_MAX) + return (RANGE_ERROR); + strlcpy(name, pattern, cp - pattern + 1); + pattern = cp + 2; + if ((charclass = wctype(name)) == 0) + return (RANGE_ERROR); + if (iswctype_l(test, charclass, loc)) { + ok = 1; + break; + } + continue; + } + } + if (!c) { + pclen = mbrtowc_l(&c, pattern, MB_LEN_MAX, patmbs, loc); + if (pclen == (size_t)-1 || pclen == (size_t)-2) + return (RANGE_ERROR); + pattern += pclen; + } + + if (flags & FNM_CASEFOLD) + c = towlower_l(c, loc); + + if (*pattern == '-' && *(pattern + 1) != EOS && + *(pattern + 1) != ']') { + if (*++pattern == '\\' && !(flags & FNM_NOESCAPE)) + if (*pattern != EOS) + pattern++; + pclen = mbrtowc_l(&c2, pattern, MB_LEN_MAX, patmbs, loc); + if (pclen == (size_t)-1 || pclen == (size_t)-2) + return (RANGE_ERROR); + pattern += pclen; + if (c2 == EOS) + return (RANGE_ERROR); + + if ((c2 == '[' && (special = *pattern) == '.') || special == '=' || special == ':') { + /* no equivalence classes or character classes as end of range */ + if (special == '=' || special == ':') + return (RANGE_ERROR); + cp = ++pattern; + while((cp = strchr(cp, special))) { + if (*(cp + 1) == ']') + break; + cp++; + } + if (!cp) + return (RANGE_ERROR); + len = __collate_collating_symbol(buf, STR_LEN, pattern, cp - pattern, patmbs, loc); + /* no multi-character collation symbols as end of range */ + if (len != 1) + return (RANGE_ERROR); + pattern = cp + 2; + c2 = *buf; + } + + if (flags & FNM_CASEFOLD) + c2 = towlower_l(c2, loc); + + if (loc->__collate_load_error ? + c <= test && test <= c2 : + __collate_range_cmp(c, test, loc) <= 0 + && __collate_range_cmp(test, c2, loc) <= 0 + ) { + ok = 1; + break; + } + } else if (c == test) { + ok = 1; + break; + } + } + /* go to end of bracket expression */ + special = 0; + while(*pattern != ']') { + if (*pattern == 0) + return (RANGE_ERROR); + if (*pattern == special) { + if (*++pattern == ']') { + special = 0; + pattern++; + } + continue; + } + if (!special && *pattern == '[') { + special = *++pattern; + if (special != '.' && special != '=' && special != ':') + special = 0; + else + pattern++; + continue; + } + pclen = mbrtowc_l(&c, pattern, MB_LEN_MAX, patmbs, loc); + if (pclen == (size_t)-1 || pclen == (size_t)-2) + return (RANGE_ERROR); + pattern += pclen; + } + + *newp = (char *)++pattern; + *news = (char *)string; + return (ok == negate ? RANGE_NOMATCH : RANGE_MATCH); +} +#endif /* BUILDING_VARIANT */ diff --git a/gen/FreeBSD/ftok.3 b/gen/FreeBSD/ftok.3 new file mode 100644 index 0000000..88a3a23 --- /dev/null +++ b/gen/FreeBSD/ftok.3 @@ -0,0 +1,88 @@ +.\" Copyright (c) 1994 SigmaSoft, Th. Lockert +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/ftok.3,v 1.17 2009/07/13 12:53:43 trasz Exp $ +.Dd July 9, 2009 +.Os +.Dt FTOK 3 +.Sh NAME +.Nm ftok +.Nd create IPC identifier from path name +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/ipc.h +.Ft key_t +.Fn ftok "const char *path" "int id" +.Sh DESCRIPTION +The +.Fn ftok +function attempts to create a unique key suitable for use with the +.Xr semget 2 , +and +.Xr shmget 2 +functions, given the +.Fa path +of an existing file and a user-selectable +.Fa id . +.Pp +The specified +.Fa path +must specify an existing file that is accessible to the calling process +or the call will fail. +Also, note that links to files will return the +same key, given the same +.Fa id . +.Sh RETURN VALUES +The +.Fn ftok +function will return -1 if +.Fa path +does not exist or if it cannot be accessed by the calling process. +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/types.h +is necessary. +.Sh SEE ALSO +.Xr semget 2 , +.Xr shmget 2 , +.Xr compat 5 +.Sh HISTORY +The +.Fn ftok +function originates with System V and is typically used by programs +that use the System V IPC routines. +.Sh AUTHORS +.An Thorsten Lockert Aq tholo@sigmasoft.com +.Sh BUGS +The returned key is computed based on the device minor number and inode +of the specified +.Fa path , +in combination with the lower 8 bits of the given +.Fa id . +Thus, it is quite possible for the routine to return duplicate keys. diff --git a/gen/FreeBSD/ftok.c b/gen/FreeBSD/ftok.c new file mode 100644 index 0000000..6c7157a --- /dev/null +++ b/gen/FreeBSD/ftok.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1994 SigmaSoft, Th. Lockert + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/ftok.c,v 1.7 2004/06/01 06:53:07 tjr Exp $"); + +#include +#include +#include + +key_t +ftok(path, id) + const char *path; + int id; +{ + struct stat st; + + if (stat(path, &st) < 0) + return (key_t)-1; + + return (key_t) (id << 24 | (st.st_dev & 0xff) << 16 | (st.st_ino & 0xffff)); +} diff --git a/gen/FreeBSD/getbsize.3 b/gen/FreeBSD/getbsize.3 new file mode 100644 index 0000000..2caf5fe --- /dev/null +++ b/gen/FreeBSD/getbsize.3 @@ -0,0 +1,94 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getbsize.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd November 16, 2012 +.Dt GETBSIZE 3 +.Os +.Sh NAME +.Nm getbsize +.Nd get preferred block size +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft char * +.Fn getbsize "int *headerlenp" "long *blocksizep" +.Sh DESCRIPTION +The +.Fn getbsize +function returns a preferred block size for reporting by system utilities +.Xr df 1 , +.Xr du 1 , +.Xr ls 1 +and +.Xr systat 1 , +based on the value of the +.Ev BLOCKSIZE +environment variable. +.Ev BLOCKSIZE +may be specified directly in bytes, or in multiples of a kilobyte by +specifying a number followed by ``K'' or ``k'', in multiples of a +megabyte by specifying a number followed by ``M'' or ``m'' or in +multiples of a gigabyte by specifying a number followed by ``G'' or +``g''. +Multiples must be integers. +.Pp +Valid values of +.Ev BLOCKSIZE +are 512 bytes to 1 gigabyte. +Sizes less than 512 bytes are rounded up to 512 bytes, and sizes +greater than 1 GB are rounded down to 1 GB. +In each case +.Fn getbsize +produces a warning message. +.Pp +The +.Fn getbsize +function returns a pointer to a null-terminated string describing +the block size, something like +.Dq 1K-blocks . +The memory referenced by +.Fa headerlenp +is filled in with the length of the string (not including the +terminating null). +The memory referenced by +.Fa blocksizep +is filled in with block size, in bytes. +.Sh SEE ALSO +.Xr df 1 , +.Xr du 1 , +.Xr ls 1 , +.Xr systat 1 , +.Xr environ 7 +.Sh HISTORY +The +.Fn getbsize +function first appeared in +.Bx 4.4 . diff --git a/gen/FreeBSD/getbsize.c b/gen/FreeBSD/getbsize.c new file mode 100644 index 0000000..bbf5b1e --- /dev/null +++ b/gen/FreeBSD/getbsize.c @@ -0,0 +1,104 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getbsize.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +char * +getbsize(int *headerlenp, long *blocksizep) +{ + static char header[20]; + long n, max, mul, blocksize; + char *ep, *p; + const char *form; + +#define KB (1024L) +#define MB (1024L * 1024L) +#define GB (1024L * 1024L * 1024L) +#define MAXB GB /* No tera, peta, nor exa. */ + form = ""; + if ((p = getenv("BLOCKSIZE")) != NULL && *p != '\0') { + if ((n = strtol(p, &ep, 10)) < 0) + goto underflow; + if (n == 0) + n = 1; + if (*ep && ep[1]) + goto fmterr; + switch (*ep) { + case 'G': case 'g': + form = "G"; + max = MAXB / GB; + mul = GB; + break; + case 'K': case 'k': + form = "K"; + max = MAXB / KB; + mul = KB; + break; + case 'M': case 'm': + form = "M"; + max = MAXB / MB; + mul = MB; + break; + case '\0': + max = MAXB; + mul = 1; + break; + default: +fmterr: warnx("%s: unknown blocksize", p); + n = 512; + max = MAXB; + mul = 1; + break; + } + if (n > max) { + warnx("maximum blocksize is %ldG", MAXB / GB); + n = max; + } + if ((blocksize = n * mul) < 512) { +underflow: warnx("minimum blocksize is 512"); + form = ""; + blocksize = n = 512; + } + } else + blocksize = n = 512; + + (void)snprintf(header, sizeof(header), "%ld%s-blocks", n, form); + *headerlenp = strlen(header); + *blocksizep = blocksize; + return (header); +} diff --git a/gen/FreeBSD/getcap.3 b/gen/FreeBSD/getcap.3 new file mode 100644 index 0000000..60c383a --- /dev/null +++ b/gen/FreeBSD/getcap.3 @@ -0,0 +1,567 @@ +.\" Copyright (c) 1992, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Casey Leedom of Lawrence Livermore National Laboratory. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getcap.3 8.4 (Berkeley) 5/13/94 +.\" $FreeBSD: src/lib/libc/gen/getcap.3,v 1.30 2007/02/11 18:14:49 maxim Exp $ +.\" +.Dd March 22, 2002 +.Dt GETCAP 3 +.Os +.Sh NAME +.Nm cgetent , +.Nm cgetset , +.Nm cgetmatch , +.Nm cgetcap , +.Nm cgetnum , +.Nm cgetstr , +.Nm cgetustr , +.Nm cgetfirst , +.Nm cgetnext , +.Nm cgetclose +.Nd capability database access routines +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fn cgetent "char **buf" "char **db_array" "const char *name" +.Ft int +.Fn cgetset "const char *ent" +.Ft int +.Fn cgetmatch "const char *buf" "const char *name" +.Ft char * +.Fn cgetcap "char *buf" "const char *cap" "int type" +.Ft int +.Fn cgetnum "char *buf" "const char *cap" "long *num" +.Ft int +.Fn cgetstr "char *buf" "const char *cap" "char **str" +.Ft int +.Fn cgetustr "char *buf" "const char *cap" "char **str" +.Ft int +.Fn cgetfirst "char **buf" "char **db_array" +.Ft int +.Fn cgetnext "char **buf" "char **db_array" +.Ft int +.Fn cgetclose "void" +.Sh DESCRIPTION +The +.Fn cgetent +function extracts the capability +.Fa name +from the database specified by the +.Dv NULL +terminated file array +.Fa db_array +and returns a pointer to a +.Xr malloc 3 Ns \&'d +copy of it in +.Fa buf . +The +.Fn cgetent +function will first look for files ending in +.Pa .db +(see +.Xr cap_mkdb 1 ) +before accessing the ASCII file. +The +.Fa buf +argument +must be retained through all subsequent calls to +.Fn cgetmatch , +.Fn cgetcap , +.Fn cgetnum , +.Fn cgetstr , +and +.Fn cgetustr , +but may then be +.Xr free 3 Ns \&'d . +On success 0 is returned, 1 if the returned +record contains an unresolved +.Ic tc +expansion, +\-1 if the requested record could not be found, +\-2 if a system error was encountered (could not open/read a file, etc.) also +setting +.Va errno , +and \-3 if a potential reference loop is detected (see +.Ic tc= +comments below). +.Pp +The +.Fn cgetset +function enables the addition of a character buffer containing a single capability +record entry +to the capability database. +Conceptually, the entry is added as the first ``file'' in the database, and +is therefore searched first on the call to +.Fn cgetent . +The entry is passed in +.Fa ent . +If +.Fa ent +is +.Dv NULL , +the current entry is removed from the database. +A call to +.Fn cgetset +must precede the database traversal. +It must be called before the +.Fn cgetent +call. +If a sequential access is being performed (see below), it must be called +before the first sequential access call +.Fn ( cgetfirst +or +.Fn cgetnext ) , +or be directly preceded by a +.Fn cgetclose +call. +On success 0 is returned and \-1 on failure. +.Pp +The +.Fn cgetmatch +function will return 0 if +.Fa name +is one of the names of the capability record +.Fa buf , +\-1 if +not. +.Pp +The +.Fn cgetcap +function searches the capability record +.Fa buf +for the capability +.Fa cap +with type +.Fa type . +A +.Fa type +is specified using any single character. +If a colon (`:') is used, an +untyped capability will be searched for (see below for explanation of +types). +A pointer to the value of +.Fa cap +in +.Fa buf +is returned on success, +.Dv NULL +if the requested capability could not be +found. +The end of the capability value is signaled by a `:' or +.Tn ASCII +.Dv NUL +(see below for capability database syntax). +.Pp +The +.Fn cgetnum +function retrieves the value of the numeric capability +.Fa cap +from the capability record pointed to by +.Fa buf . +The numeric value is returned in the +.Ft long +pointed to by +.Fa num . +0 is returned on success, \-1 if the requested numeric capability could not +be found. +.Pp +The +.Fn cgetstr +function retrieves the value of the string capability +.Fa cap +from the capability record pointed to by +.Fa buf . +A pointer to a decoded, +.Dv NUL +terminated, +.Xr malloc 3 Ns \&'d +copy of the string is returned in the +.Ft char * +pointed to by +.Fa str . +The number of characters in the decoded string not including the trailing +.Dv NUL +is returned on success, \-1 if the requested string capability could not +be found, \-2 if a system error was encountered (storage allocation +failure). +.Pp +The +.Fn cgetustr +function is identical to +.Fn cgetstr +except that it does not expand special characters, but rather returns each +character of the capability string literally. +.Pp +The +.Fn cgetfirst +and +.Fn cgetnext +functions comprise a function group that provides for sequential +access of the +.Dv NULL +pointer terminated array of file names, +.Fa db_array . +The +.Fn cgetfirst +function returns the first record in the database and resets the access +to the first record. +The +.Fn cgetnext +function returns the next record in the database with respect to the +record returned by the previous +.Fn cgetfirst +or +.Fn cgetnext +call. +If there is no such previous call, the first record in the database is +returned. +Each record is returned in a +.Xr malloc 3 Ns \&'d +copy pointed to by +.Fa buf . +.Ic Tc +expansion is done (see +.Ic tc= +comments below). +Upon completion of the database 0 is returned, 1 is returned upon successful +return of record with possibly more remaining (we have not reached the end of +the database yet), 2 is returned if the record contains an unresolved +.Ic tc +expansion, \-1 is returned if a system error occurred, and \-2 +is returned if a potential reference loop is detected (see +.Ic tc= +comments below). +Upon completion of database (0 return) the database is closed. +.Pp +The +.Fn cgetclose +function closes the sequential access and frees any memory and file descriptors +being used. +Note that it does not erase the buffer pushed by a call to +.Fn cgetset . +.Sh CAPABILITY DATABASE SYNTAX +Capability databases are normally +.Tn ASCII +and may be edited with standard +text editors. +Blank lines and lines beginning with a `#' are comments +and are ignored. +Lines ending with a `\|\e' indicate that the next line +is a continuation of the current line; the `\|\e' and following newline +are ignored. +Long lines are usually continued onto several physical +lines by ending each line except the last with a `\|\e'. +.Pp +Capability databases consist of a series of records, one per logical +line. +Each record contains a variable number of `:'-separated fields +(capabilities). +Empty fields consisting entirely of white space +characters (spaces and tabs) are ignored. +.Pp +The first capability of each record specifies its names, separated by `|' +characters. +These names are used to reference records in the database. +By convention, the last name is usually a comment and is not intended as +a lookup tag. +For example, the +.Em vt100 +record from the +.Xr termcap 5 +database begins: +.Pp +.Dl "d0\||\|vt100\||\|vt100-am\||\|vt100am\||\|dec vt100:" +.Pp +giving four names that can be used to access the record. +.Pp +The remaining non-empty capabilities describe a set of (name, value) +bindings, consisting of a names optionally followed by a typed value: +.Bl -column "nameTvalue" +.It name Ta "typeless [boolean] capability" +.Em name No "is present [true]" +.It name Ns Em \&T Ns value Ta capability +.Pq Em name , \&T +has value +.Em value +.It name@ Ta "no capability" Em name No exists +.It name Ns Em T Ns \&@ Ta capability +.Pq Em name , T +does not exist +.El +.Pp +Names consist of one or more characters. +Names may contain any character +except `:', but it is usually best to restrict them to the printable +characters and avoid use of graphics like `#', `=', `%', `@', etc. +Types +are single characters used to separate capability names from their +associated typed values. +Types may be any character except a `:'. +Typically, graphics like `#', `=', `%', etc.\& are used. +Values may be any +number of characters and may contain any character except `:'. +.Sh CAPABILITY DATABASE SEMANTICS +Capability records describe a set of (name, value) bindings. +Names may +have multiple values bound to them. +Different values for a name are +distinguished by their +.Fa types . +The +.Fn cgetcap +function will return a pointer to a value of a name given the capability +name and the type of the value. +.Pp +The types `#' and `=' are conventionally used to denote numeric and +string typed values, but no restriction on those types is enforced. +The +functions +.Fn cgetnum +and +.Fn cgetstr +can be used to implement the traditional syntax and semantics of `#' +and `='. +Typeless capabilities are typically used to denote boolean objects with +presence or absence indicating truth and false values respectively. +This interpretation is conveniently represented by: +.Pp +.Dl "(getcap(buf, name, ':') != NULL)" +.Pp +A special capability, +.Ic tc= name , +is used to indicate that the record specified by +.Fa name +should be substituted for the +.Ic tc +capability. +.Ic Tc +capabilities may interpolate records which also contain +.Ic tc +capabilities and more than one +.Ic tc +capability may be used in a record. +A +.Ic tc +expansion scope (i.e., where the argument is searched for) contains the +file in which the +.Ic tc +is declared and all subsequent files in the file array. +.Pp +When a database is searched for a capability record, the first matching +record in the search is returned. +When a record is scanned for a +capability, the first matching capability is returned; the capability +.Ic :nameT@: +will hide any following definition of a value of type +.Em T +for +.Fa name ; +and the capability +.Ic :name@: +will prevent any following values of +.Fa name +from being seen. +.Pp +These features combined with +.Ic tc +capabilities can be used to generate variations of other databases and +records by either adding new capabilities, overriding definitions with new +definitions, or hiding following definitions via `@' capabilities. +.Sh EXAMPLES +.Bd -unfilled -offset indent +example\||\|an example of binding multiple values to names:\e + :foo%bar:foo^blah:foo@:\e + :abc%xyz:abc^frap:abc$@:\e + :tc=more: +.Ed +.Pp +The capability foo has two values bound to it (bar of type `%' and blah of +type `^') and any other value bindings are hidden. +The capability abc +also has two values bound but only a value of type `$' is prevented from +being defined in the capability record more. +.Pp +.Bd -unfilled -offset indent +file1: + new\||\|new_record\||\|a modification of "old":\e + :fript=bar:who-cares@:tc=old:blah:tc=extensions: +file2: + old\||\|old_record\||\|an old database record:\e + :fript=foo:who-cares:glork#200: +.Ed +.Pp +The records are extracted by calling +.Fn cgetent +with file1 preceding file2. +In the capability record new in file1, fript=bar overrides the definition +of fript=foo interpolated from the capability record old in file2, +who-cares@ prevents the definition of any who-cares definitions in old +from being seen, glork#200 is inherited from old, and blah and anything +defined by the record extensions is added to those definitions in old. +Note that the position of the fript=bar and who-cares@ definitions before +tc=old is important here. +If they were after, the definitions in old +would take precedence. +.Sh CGETNUM AND CGETSTR SYNTAX AND SEMANTICS +Two types are predefined by +.Fn cgetnum +and +.Fn cgetstr : +.Bl -column "nameXnumber" +.Sm off +.It Em name No \&# Em number Ta numeric +.Sm on +capability +.Em name +has value +.Em number +.Sm off +.It Em name No = Em string Ta "string capability" +.Sm on +.Em name +has value +.Em string +.Sm off +.It Em name No \&#@ Ta "the numeric capability" +.Sm on +.Em name +does not exist +.Sm off +.It Em name No \&=@ Ta "the string capability" +.Sm on +.Em name +does not exist +.El +.Pp +Numeric capability values may be given in one of three numeric bases. +If the number starts with either +.Ql 0x +or +.Ql 0X +it is interpreted as a hexadecimal number (both upper and lower case a-f +may be used to denote the extended hexadecimal digits). +Otherwise, if the number starts with a +.Ql 0 +it is interpreted as an octal number. +Otherwise the number is interpreted as a decimal number. +.Pp +String capability values may contain any character. +Non-printable +.Dv ASCII +codes, new lines, and colons may be conveniently represented by the use +of escape sequences: +.Bl -column "\e\|X,X\e\|X" "(ASCII octal nnn)" +^X ('X' & 037) control-X +\e\|b, \e\|B (ASCII 010) backspace +\e\|t, \e\|T (ASCII 011) tab +\e\|n, \e\|N (ASCII 012) line feed (newline) +\e\|f, \e\|F (ASCII 014) form feed +\e\|r, \e\|R (ASCII 015) carriage return +\e\|e, \e\|E (ASCII 027) escape +\e\|c, \e\|C (:) colon +\e\|\e (\e\|) back slash +\e\|^ (^) caret +\e\|nnn (ASCII octal nnn) +.El +.Pp +A `\|\e' may be followed by up to three octal digits directly specifies +the numeric code for a character. +The use of +.Tn ASCII +.Dv NUL Ns s , +while easily +encoded, causes all sorts of problems and must be used with care since +.Dv NUL Ns s +are typically used to denote the end of strings; many applications +use `\e\|200' to represent a +.Dv NUL . +.Sh DIAGNOSTICS +The +.Fn cgetent , +.Fn cgetset , +.Fn cgetmatch , +.Fn cgetnum , +.Fn cgetstr , +.Fn cgetustr , +.Fn cgetfirst , +and +.Fn cgetnext +functions +return a value greater than or equal to 0 on success and a value less +than 0 on failure. +The +.Fn cgetcap +function returns a character pointer on success and a +.Dv NULL +on failure. +.Pp +The +.Fn cgetent , +and +.Fn cgetset +functions may fail and set +.Va errno +for any of the errors specified for the library functions: +.Xr fopen 3 , +.Xr fclose 3 , +.Xr open 2 , +and +.Xr close 2 . +.Pp +The +.Fn cgetent , +.Fn cgetset , +.Fn cgetstr , +and +.Fn cgetustr +functions +may fail and set +.Va errno +as follows: +.Bl -tag -width Er +.It Bq Er ENOMEM +No memory to allocate. +.El +.Sh SEE ALSO +.Xr cap_mkdb 1 , +.Xr malloc 3 +.Sh BUGS +Colons (`:') cannot be used in names, types, or values. +.Pp +There are no checks for +.Ic tc Ns = Ns Ic name +loops in +.Fn cgetent . +.Pp +The buffer added to the database by a call to +.Fn cgetset +is not unique to the database but is rather prepended to any database used. diff --git a/gen/FreeBSD/getcap.c b/gen/FreeBSD/getcap.c new file mode 100644 index 0000000..ea8425f --- /dev/null +++ b/gen/FreeBSD/getcap.c @@ -0,0 +1,1058 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Casey Leedom of Lawrence Livermore National Laboratory. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getcap.c 8.3 (Berkeley) 3/25/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/getcap.c,v 1.23 2009/11/25 04:45:45 wollman Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include + +#define BFRAG 1024 +#define BSIZE 1024 +#define ESC ('[' & 037) /* ASCII ESC */ +#define MAX_RECURSION 32 /* maximum getent recursion */ +#define SFRAG 100 /* cgetstr mallocs in SFRAG chunks */ + +#define RECOK (char)0 +#define TCERR (char)1 +#define SHADOW (char)2 + +static size_t topreclen; /* toprec length */ +static char *toprec; /* Additional record specified by cgetset() */ +static int gottoprec; /* Flag indicating retrieval of toprecord */ + +static int cdbget(DB *, char **, const char *); +static int getent(char **, u_int *, char **, int, const char *, int, char *, locale_t); +static int nfcmp(char *, char *); + +/* + * Cgetset() allows the addition of a user specified buffer to be added + * to the database array, in effect "pushing" the buffer on top of the + * virtual database. 0 is returned on success, -1 on failure. + */ +int +cgetset(const char *ent) +{ + if (ent == NULL) { + if (toprec) + free(toprec); + toprec = NULL; + topreclen = 0; + return (0); + } + topreclen = strlen(ent); + if ((toprec = malloc (topreclen + 1)) == NULL) { + errno = ENOMEM; + return (-1); + } + gottoprec = 0; + (void)strcpy(toprec, ent); + return (0); +} + +/* + * Cgetcap searches the capability record buf for the capability cap with + * type `type'. A pointer to the value of cap is returned on success, NULL + * if the requested capability couldn't be found. + * + * Specifying a type of ':' means that nothing should follow cap (:cap:). + * In this case a pointer to the terminating ':' or NUL will be returned if + * cap is found. + * + * If (cap, '@') or (cap, terminator, '@') is found before (cap, terminator) + * return NULL. + */ +char * +cgetcap(char *buf, const char *cap, int type) +{ + char *bp; + const char *cp; + + bp = buf; + for (;;) { + /* + * Skip past the current capability field - it's either the + * name field if this is the first time through the loop, or + * the remainder of a field whose name failed to match cap. + */ + for (;;) + if (*bp == '\0') + return (NULL); + else + if (*bp++ == ':') + break; + + /* + * Try to match (cap, type) in buf. + */ + for (cp = cap; *cp == *bp && *bp != '\0'; cp++, bp++) + continue; + if (*cp != '\0') + continue; + if (*bp == '@') + return (NULL); + if (type == ':') { + if (*bp != '\0' && *bp != ':') + continue; + return(bp); + } + if (*bp != type) + continue; + bp++; + return (*bp == '@' ? NULL : bp); + } + /* NOTREACHED */ +} + +/* + * Cgetent extracts the capability record name from the NULL terminated file + * array db_array and returns a pointer to a malloc'd copy of it in buf. + * Buf must be retained through all subsequent calls to cgetcap, cgetnum, + * cgetflag, and cgetstr, but may then be free'd. 0 is returned on success, + * -1 if the requested record couldn't be found, -2 if a system error was + * encountered (couldn't open/read a file, etc.), and -3 if a potential + * reference loop is detected. + */ +int +cgetent(char **buf, char **db_array, const char *name) +{ + u_int dummy; + + return (getent(buf, &dummy, db_array, -1, name, 0, NULL, __current_locale())); +} + +/* + * Getent implements the functions of cgetent. If fd is non-negative, + * *db_array has already been opened and fd is the open file descriptor. We + * do this to save time and avoid using up file descriptors for tc= + * recursions. + * + * Getent returns the same success/failure codes as cgetent. On success, a + * pointer to a malloc'ed capability record with all tc= capabilities fully + * expanded and its length (not including trailing ASCII NUL) are left in + * *cap and *len. + * + * Basic algorithm: + * + Allocate memory incrementally as needed in chunks of size BFRAG + * for capability buffer. + * + Recurse for each tc=name and interpolate result. Stop when all + * names interpolated, a name can't be found, or depth exceeds + * MAX_RECURSION. + */ +static int +getent(char **cap, u_int *len, char **db_array, int fd, const char *name, + int depth, char *nfield, locale_t loc) +{ + DB *capdbp; + char *r_end, *rp, **db_p; + int myfd, eof, foundit, retval; + char *record, *cbuf; + int tc_not_resolved; + char pbuf[_POSIX_PATH_MAX]; + + /* + * Return with ``loop detected'' error if we've recursed more than + * MAX_RECURSION times. + */ + if (depth > MAX_RECURSION) + return (-3); + + /* + * Check if we have a top record from cgetset(). + */ + if (depth == 0 && toprec != NULL && cgetmatch(toprec, name) == 0) { + if ((record = malloc (topreclen + BFRAG)) == NULL) { + errno = ENOMEM; + return (-2); + } + (void)strcpy(record, toprec); + myfd = 0; + db_p = db_array; + rp = record + topreclen + 1; + r_end = rp + BFRAG; + goto tc_exp; + } + /* + * Allocate first chunk of memory. + */ + if ((record = malloc(BFRAG)) == NULL) { + errno = ENOMEM; + return (-2); + } + r_end = record + BFRAG; + foundit = 0; + /* + * Loop through database array until finding the record. + */ + + for (db_p = db_array; *db_p != NULL; db_p++) { + eof = 0; + + /* + * Open database if not already open. + */ + + if (fd >= 0) { + (void)lseek(fd, (off_t)0, SEEK_SET); + myfd = 0; + } else { + (void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); + if ((capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0)) + != NULL) { + free(record); + retval = cdbget(capdbp, &record, name); + if (retval < 0) { + /* no record available */ + (void)capdbp->close(capdbp); + return (retval); + } + /* save the data; close frees it */ + cbuf = strdup(record); + if (capdbp->close(capdbp) < 0) { + free(cbuf); + return (-2); + } + if (cbuf == NULL) { + errno = ENOMEM; + return (-2); + } + *len = strlen(cbuf); + *cap = cbuf; + return (retval); + } else { + fd = _open(*db_p, O_RDONLY, 0); + if (fd < 0) + continue; + myfd = 1; + } + } + /* + * Find the requested capability record ... + */ + { + char buf[BUFSIZ]; + char *b_end, *bp; + int c; + + /* + * Loop invariants: + * There is always room for one more character in record. + * R_end always points just past end of record. + * Rp always points just past last character in record. + * B_end always points just past last character in buf. + * Bp always points at next character in buf. + */ + b_end = buf; + bp = buf; + for (;;) { + + /* + * Read in a line implementing (\, newline) + * line continuation. + */ + rp = record; + for (;;) { + if (bp >= b_end) { + int n; + + n = _read(fd, buf, sizeof(buf)); + if (n <= 0) { + if (myfd) + (void)_close(fd); + if (n < 0) { + free(record); + return (-2); + } else { + fd = -1; + eof = 1; + break; + } + } + b_end = buf+n; + bp = buf; + } + + c = *bp++; + if (c == '\n') { + if (rp > record && *(rp-1) == '\\') { + rp--; + continue; + } else + break; + } + *rp++ = c; + + /* + * Enforce loop invariant: if no room + * left in record buffer, try to get + * some more. + */ + if (rp >= r_end) { + u_int pos; + size_t newsize; + + pos = rp - record; + newsize = r_end - record + BFRAG; + record = reallocf(record, newsize); + if (record == NULL) { + errno = ENOMEM; + if (myfd) + (void)_close(fd); + return (-2); + } + r_end = record + newsize; + rp = record + pos; + } + } + /* loop invariant let's us do this */ + *rp++ = '\0'; + + /* + * If encountered eof check next file. + */ + if (eof) + break; + + /* + * Toss blank lines and comments. + */ + if (*record == '\0' || *record == '#') + continue; + + /* + * See if this is the record we want ... + */ + if (cgetmatch(record, name) == 0) { + if (nfield == NULL || !nfcmp(nfield, record)) { + foundit = 1; + break; /* found it! */ + } + } + } + } + if (foundit) + break; + } + + if (!foundit) { + free(record); + return (-1); + } + + /* + * Got the capability record, but now we have to expand all tc=name + * references in it ... + */ +tc_exp: { + char *newicap, *s; + int newilen; + u_int ilen; + int diff, iret, tclen; + char *icap, *scan, *tc, *tcstart, *tcend; + + /* + * Loop invariants: + * There is room for one more character in record. + * R_end points just past end of record. + * Rp points just past last character in record. + * Scan points at remainder of record that needs to be + * scanned for tc=name constructs. + */ + scan = record; + tc_not_resolved = 0; + for (;;) { + if ((tc = cgetcap(scan, "tc", '=')) == NULL) + break; + + /* + * Find end of tc=name and stomp on the trailing `:' + * (if present) so we can use it to call ourselves. + */ + s = tc; + for (;;) + if (*s == '\0') + break; + else + if (*s++ == ':') { + *(s - 1) = '\0'; + break; + } + tcstart = tc - 3; + tclen = s - tcstart; + tcend = s; + + iret = getent(&icap, &ilen, db_p, fd, tc, depth+1, + NULL, loc); + newicap = icap; /* Put into a register. */ + newilen = ilen; + if (iret != 0) { + /* an error */ + if (iret < -1) { + if (myfd) + (void)_close(fd); + free(record); + return (iret); + } + if (iret == 1) + tc_not_resolved = 1; + /* couldn't resolve tc */ + if (iret == -1) { + *(s - 1) = ':'; + scan = s - 1; + tc_not_resolved = 1; + continue; + + } + } + /* not interested in name field of tc'ed record */ + s = newicap; + for (;;) + if (*s == '\0') + break; + else + if (*s++ == ':') + break; + newilen -= s - newicap; + newicap = s; + + /* make sure interpolated record is `:'-terminated */ + s += newilen; + if (*(s-1) != ':') { + *s = ':'; /* overwrite NUL with : */ + newilen++; + } + + /* + * Make sure there's enough room to insert the + * new record. + */ + diff = newilen - tclen; + if (diff >= r_end - rp) { + u_int pos, tcpos, tcposend; + size_t newsize; + + pos = rp - record; + newsize = r_end - record + diff + BFRAG; + tcpos = tcstart - record; + tcposend = tcend - record; + record = reallocf(record, newsize); + if (record == NULL) { + errno = ENOMEM; + if (myfd) + (void)_close(fd); + free(icap); + return (-2); + } + r_end = record + newsize; + rp = record + pos; + tcstart = record + tcpos; + tcend = record + tcposend; + } + + /* + * Insert tc'ed record into our record. + */ + s = tcstart + newilen; + bcopy(tcend, s, rp - tcend); + bcopy(newicap, tcstart, newilen); + rp += diff; + free(icap); + + /* + * Start scan on `:' so next cgetcap works properly + * (cgetcap always skips first field). + */ + scan = s-1; + } + + } + /* + * Close file (if we opened it), give back any extra memory, and + * return capability, length and success. + */ + if (myfd) + (void)_close(fd); + *len = rp - record - 1; /* don't count NUL */ + if (r_end > rp) + if ((record = + reallocf(record, (size_t)(rp - record))) == NULL) { + errno = ENOMEM; + return (-2); + } + + *cap = record; + if (tc_not_resolved) + return (1); + return (0); +} + +static int +cdbget(DB *capdbp, char **bp, const char *name) +{ + DBT key, data; + char *namebuf; + + namebuf = strdup(name); + if (namebuf == NULL) + return (-2); + key.data = namebuf; + key.size = strlen(namebuf); + + for (;;) { + /* Get the reference. */ + switch(capdbp->get(capdbp, &key, &data, 0)) { + case -1: + free(namebuf); + return (-2); + case 1: + free(namebuf); + return (-1); + } + + /* If not an index to another record, leave. */ + if (((char *)data.data)[0] != SHADOW) + break; + + key.data = (char *)data.data + 1; + key.size = data.size - 1; + } + + *bp = (char *)data.data + 1; + free(namebuf); + return (((char *)(data.data))[0] == TCERR ? 1 : 0); +} + +/* + * Cgetmatch will return 0 if name is one of the names of the capability + * record buf, -1 if not. + */ +int +cgetmatch(const char *buf, const char *name) +{ + const char *np, *bp; + + if (name == NULL || *name == '\0') + return -1; + + /* + * Start search at beginning of record. + */ + bp = buf; + for (;;) { + /* + * Try to match a record name. + */ + np = name; + for (;;) + if (*np == '\0') + if (*bp == '|' || *bp == ':' || *bp == '\0') + return (0); + else + break; + else + if (*bp++ != *np++) + break; + + /* + * Match failed, skip to next name in record. + */ + bp--; /* a '|' or ':' may have stopped the match */ + for (;;) + if (*bp == '\0' || *bp == ':') + return (-1); /* match failed totally */ + else + if (*bp++ == '|') + break; /* found next name */ + } +} + + + + + +int +cgetfirst(char **buf, char **db_array) +{ + (void)cgetclose(); + return (cgetnext(buf, db_array)); +} + +static FILE *pfp; +static int slash; +static char **dbp; + +int +cgetclose(void) +{ + if (pfp != NULL) { + (void)fclose(pfp); + pfp = NULL; + } + dbp = NULL; + gottoprec = 0; + slash = 0; + return(0); +} + +/* + * Cgetnext() gets either the first or next entry in the logical database + * specified by db_array. It returns 0 upon completion of the database, 1 + * upon returning an entry with more remaining, and -1 if an error occurs. + */ +int +cgetnext(char **bp, char **db_array) +{ + size_t len; + int done, hadreaderr, savederrno, status; + char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE]; + u_int dummy; + locale_t loc = __current_locale(); + + if (dbp == NULL) + dbp = db_array; + + if (pfp == NULL && (pfp = fopen(*dbp, "r")) == NULL) { + (void)cgetclose(); + return (-1); + } + for (;;) { + if (toprec && !gottoprec) { + gottoprec = 1; + line = toprec; + } else { + line = fgetln(pfp, &len); + if (line == NULL && pfp) { + hadreaderr = ferror(pfp); + if (hadreaderr) + savederrno = errno; + fclose(pfp); + pfp = NULL; + if (hadreaderr) { + cgetclose(); + errno = savederrno; + return (-1); + } else { + if (*++dbp == NULL) { + (void)cgetclose(); + return (0); + } else if ((pfp = + fopen(*dbp, "r")) == NULL) { + (void)cgetclose(); + return (-1); + } else + continue; + } + } else + line[len - 1] = '\0'; + if (len == 1) { + slash = 0; + continue; + } + if (isspace_l((unsigned char)*line, loc) || + *line == ':' || *line == '#' || slash) { + if (line[len - 2] == '\\') + slash = 1; + else + slash = 0; + continue; + } + if (line[len - 2] == '\\') + slash = 1; + else + slash = 0; + } + + + /* + * Line points to a name line. + */ + done = 0; + np = nbuf; + for (;;) { + for (cp = line; *cp != '\0'; cp++) { + if (*cp == ':') { + *np++ = ':'; + done = 1; + break; + } + if (*cp == '\\') + break; + *np++ = *cp; + } + if (done) { + *np = '\0'; + break; + } else { /* name field extends beyond the line */ + line = fgetln(pfp, &len); + if (line == NULL && pfp) { + /* Name extends beyond the EOF! */ + hadreaderr = ferror(pfp); + if (hadreaderr) + savederrno = errno; + fclose(pfp); + pfp = NULL; + if (hadreaderr) { + cgetclose(); + errno = savederrno; + return (-1); + } else { + cgetclose(); + return (-1); + } + } else + line[len - 1] = '\0'; + } + } + rp = buf; + for(cp = nbuf; *cp != '\0'; cp++) + if (*cp == '|' || *cp == ':') + break; + else + *rp++ = *cp; + + *rp = '\0'; + /* + * XXX + * Last argument of getent here should be nbuf if we want true + * sequential access in the case of duplicates. + * With NULL, getent will return the first entry found + * rather than the duplicate entry record. This is a + * matter of semantics that should be resolved. + */ + status = getent(bp, &dummy, db_array, -1, buf, 0, NULL, loc); + if (status == -2 || status == -3) + (void)cgetclose(); + + return (status + 1); + } + /* NOTREACHED */ +} + +/* + * Cgetstr retrieves the value of the string capability cap from the + * capability record pointed to by buf. A pointer to a decoded, NUL + * terminated, malloc'd copy of the string is returned in the char * + * pointed to by str. The length of the string not including the trailing + * NUL is returned on success, -1 if the requested string capability + * couldn't be found, -2 if a system error was encountered (storage + * allocation failure). + */ +int +cgetstr(char *buf, const char *cap, char **str) +{ + u_int m_room; + char *bp, *mp; + int len; + char *mem; + + /* + * Find string capability cap + */ + bp = cgetcap(buf, cap, '='); + if (bp == NULL) + return (-1); + + /* + * Conversion / storage allocation loop ... Allocate memory in + * chunks SFRAG in size. + */ + if ((mem = malloc(SFRAG)) == NULL) { + errno = ENOMEM; + return (-2); /* couldn't even allocate the first fragment */ + } + m_room = SFRAG; + mp = mem; + + while (*bp != ':' && *bp != '\0') { + /* + * Loop invariants: + * There is always room for one more character in mem. + * Mp always points just past last character in mem. + * Bp always points at next character in buf. + */ + if (*bp == '^') { + bp++; + if (*bp == ':' || *bp == '\0') + break; /* drop unfinished escape */ + if (*bp == '?') { + *mp++ = '\177'; + bp++; + } else + *mp++ = *bp++ & 037; + } else if (*bp == '\\') { + bp++; + if (*bp == ':' || *bp == '\0') + break; /* drop unfinished escape */ + if ('0' <= *bp && *bp <= '7') { + int n, i; + + n = 0; + i = 3; /* maximum of three octal digits */ + do { + n = n * 8 + (*bp++ - '0'); + } while (--i && '0' <= *bp && *bp <= '7'); + *mp++ = n; + } + else switch (*bp++) { + case 'b': case 'B': + *mp++ = '\b'; + break; + case 't': case 'T': + *mp++ = '\t'; + break; + case 'n': case 'N': + *mp++ = '\n'; + break; + case 'f': case 'F': + *mp++ = '\f'; + break; + case 'r': case 'R': + *mp++ = '\r'; + break; + case 'e': case 'E': + *mp++ = ESC; + break; + case 'c': case 'C': + *mp++ = ':'; + break; + default: + /* + * Catches '\', '^', and + * everything else. + */ + *mp++ = *(bp-1); + break; + } + } else + *mp++ = *bp++; + m_room--; + + /* + * Enforce loop invariant: if no room left in current + * buffer, try to get some more. + */ + if (m_room == 0) { + size_t size = mp - mem; + + if ((mem = reallocf(mem, size + SFRAG)) == NULL) + return (-2); + m_room = SFRAG; + mp = mem + size; + } + } + *mp++ = '\0'; /* loop invariant let's us do this */ + m_room--; + len = mp - mem - 1; + + /* + * Give back any extra memory and return value and success. + */ + if (m_room != 0) + if ((mem = reallocf(mem, (size_t)(mp - mem))) == NULL) + return (-2); + *str = mem; + return (len); +} + +/* + * Cgetustr retrieves the value of the string capability cap from the + * capability record pointed to by buf. The difference between cgetustr() + * and cgetstr() is that cgetustr does not decode escapes but rather treats + * all characters literally. A pointer to a NUL terminated malloc'd + * copy of the string is returned in the char pointed to by str. The + * length of the string not including the trailing NUL is returned on success, + * -1 if the requested string capability couldn't be found, -2 if a system + * error was encountered (storage allocation failure). + */ +int +cgetustr(char *buf, const char *cap, char **str) +{ + u_int m_room; + char *bp, *mp; + int len; + char *mem; + + /* + * Find string capability cap + */ + if ((bp = cgetcap(buf, cap, '=')) == NULL) + return (-1); + + /* + * Conversion / storage allocation loop ... Allocate memory in + * chunks SFRAG in size. + */ + if ((mem = malloc(SFRAG)) == NULL) { + errno = ENOMEM; + return (-2); /* couldn't even allocate the first fragment */ + } + m_room = SFRAG; + mp = mem; + + while (*bp != ':' && *bp != '\0') { + /* + * Loop invariants: + * There is always room for one more character in mem. + * Mp always points just past last character in mem. + * Bp always points at next character in buf. + */ + *mp++ = *bp++; + m_room--; + + /* + * Enforce loop invariant: if no room left in current + * buffer, try to get some more. + */ + if (m_room == 0) { + size_t size = mp - mem; + + if ((mem = reallocf(mem, size + SFRAG)) == NULL) + return (-2); + m_room = SFRAG; + mp = mem + size; + } + } + *mp++ = '\0'; /* loop invariant let's us do this */ + m_room--; + len = mp - mem - 1; + + /* + * Give back any extra memory and return value and success. + */ + if (m_room != 0) + if ((mem = reallocf(mem, (size_t)(mp - mem))) == NULL) + return (-2); + *str = mem; + return (len); +} + +/* + * Cgetnum retrieves the value of the numeric capability cap from the + * capability record pointed to by buf. The numeric value is returned in + * the long pointed to by num. 0 is returned on success, -1 if the requested + * numeric capability couldn't be found. + */ +int +cgetnum(char *buf, const char *cap, long *num) +{ + long n; + int base, digit; + char *bp; + + /* + * Find numeric capability cap + */ + bp = cgetcap(buf, cap, '#'); + if (bp == NULL) + return (-1); + + /* + * Look at value and determine numeric base: + * 0x... or 0X... hexadecimal, + * else 0... octal, + * else decimal. + */ + if (*bp == '0') { + bp++; + if (*bp == 'x' || *bp == 'X') { + bp++; + base = 16; + } else + base = 8; + } else + base = 10; + + /* + * Conversion loop ... + */ + n = 0; + for (;;) { + if ('0' <= *bp && *bp <= '9') + digit = *bp - '0'; + else if ('a' <= *bp && *bp <= 'f') + digit = 10 + *bp - 'a'; + else if ('A' <= *bp && *bp <= 'F') + digit = 10 + *bp - 'A'; + else + break; + + if (digit >= base) + break; + + n = n * base + digit; + bp++; + } + + /* + * Return value and success. + */ + *num = n; + return (0); +} + + +/* + * Compare name field of record. + */ +static int +nfcmp(char *nf, char *rec) +{ + char *cp, tmp; + int ret; + + for (cp = rec; *cp != ':'; cp++) + ; + + tmp = *(cp + 1); + *(cp + 1) = '\0'; + ret = strcmp(nf, rec); + *(cp + 1) = tmp; + + return (ret); +} diff --git a/gen/FreeBSD/getcwd.3 b/gen/FreeBSD/getcwd.3 new file mode 100644 index 0000000..707b8b8 --- /dev/null +++ b/gen/FreeBSD/getcwd.3 @@ -0,0 +1,164 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getcwd.3 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD$ +.\" +.Dd April 17, 2010 +.Dt GETCWD 3 +.Os +.Sh NAME +.Nm getcwd , +.Nm getwd +.Nd get working directory pathname +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft char * +.Fn getcwd "char *buf" "size_t size" +.Ft char * +.Fn getwd "char *buf" +.Sh DESCRIPTION +The +.Fn getcwd +function copies the absolute pathname of the current working directory +into the memory referenced by +.Fa buf +and returns a pointer to +.Fa buf . +The +.Fa size +argument is the size, in bytes, of the array referenced by +.Fa buf . +.Pp +If +.Fa buf +is +.Dv NULL , +space is allocated as necessary to store the pathname and +.Fa size +is ignored. +This space may later be +.Xr free 3 Ns 'd . +.Pp +The function +.Fn getwd +is a compatibility routine which calls +.Fn getcwd +with its +.Fa buf +argument and a size of +.Dv MAXPATHLEN +(as defined in the include +file +.In sys/param.h ) . +Obviously, +.Fa buf +should be at least +.Dv MAXPATHLEN +bytes in length. +.Pp +These routines have traditionally been used by programs to save the +name of a working directory for the purpose of returning to it. +A much faster and less error-prone method of accomplishing this is to +open the current directory +.Pq Ql .\& +and use the +.Xr fchdir 2 +function to return. +.Sh RETURN VALUES +Upon successful completion, a pointer to the pathname is returned. +Otherwise a +.Dv NULL +pointer is returned and the global variable +.Va errno +is set to indicate the error. +In addition, +.Fn getwd +copies the error message associated with +.Va errno +into the memory referenced by +.Fa buf . +.Sh ERRORS +The +.Fn getcwd +function +will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa size +argument is zero. +.It Bq Er ENOENT +A component of the pathname no longer exists. +.It Bq Er ENOMEM +Insufficient memory is available. +.It Bq Er ERANGE +The +.Fa size +argument is greater than zero but smaller than the length of the pathname +plus 1. +.El +.Pp +The +.Fn getcwd +function +may fail if: +.Bl -tag -width Er +.It Bq Er EACCES +Read or search permission was denied for a component of the pathname. +This is only checked in limited cases, depending on implementation details. +.El +.Sh SEE ALSO +.Xr chdir 2 , +.Xr fchdir 2 , +.Xr malloc 3 , +.Xr strerror 3 +.Sh STANDARDS +The +.Fn getcwd +function +conforms to +.St -p1003.1-90 . +The ability to specify a +.Dv NULL +pointer and have +.Fn getcwd +allocate memory as necessary is an extension. +.Sh HISTORY +The +.Fn getwd +function appeared in +.Bx 4.0 . +.Sh BUGS +The +.Fn getwd +function +does not do sufficient error checking and is not able to return very +long, but valid, paths. +It is provided for compatibility. diff --git a/gen/FreeBSD/getcwd.c b/gen/FreeBSD/getcwd.c new file mode 100644 index 0000000..4a19890 --- /dev/null +++ b/gen/FreeBSD/getcwd.c @@ -0,0 +1,338 @@ +/* + * Copyright (c) 1989, 1991, 1993, 1995 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getcwd.c 8.5 (Berkeley) 2/7/95"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/getcwd.c,v 1.29 2007/01/09 00:27:53 imp Exp $"); + +#include "namespace.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#define ISDOT(dp) \ + (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ + (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) + +/* + * If __getcwd() ever becomes a syscall, we can remove this workaround. + * The problem here is that fcntl() assumes a buffer of size MAXPATHLEN, + * if size is less than MAXPATHLEN, we need to use a temporary buffer + * and see if it fits. We also have to assume that open() or fcntl() + * don't fail with errno=ERANGE. + */ +static inline int +__getcwd(char *buf, size_t size) +{ + int fd, err, save; + struct stat dot, pt; + char *b; + + if ((fd = open(".", O_RDONLY)) < 0) + return -1; + if (fstat(fd, &dot) < 0) { + save = errno; + close(fd); + errno = save; + return -1; + } + /* check that the device and inode are non-zero, otherwise punt */ + if (dot.st_dev == 0 || dot.st_ino == 0) { + close(fd); + errno = EINVAL; + return -1; + } + if (size < MAXPATHLEN) { + /* the hard case; allocate a buffer of size MAXPATHLEN to use */ + b = (char *)alloca(MAXPATHLEN); + if (b == NULL) { + close(fd); + errno = ENOMEM; /* make sure it isn't ERANGE */ + return -1; + } + } else + b = buf; + + err = fcntl(fd, F_GETPATH, b); + if (err) { + save = errno; + close(fd); + errno = save; + return err; + } + close(fd); + /* + * now double-check that the path returned by fcntl() has the same + * device and inode number as '.'. + */ + if (stat(b, &pt) < 0) + return -1; + /* + * Since dot.st_dev and dot.st_ino are non-zero, we don't need to + * separately test for pt.st_dev and pt.st_ino being non-zero, because + * they have to match + */ + if (dot.st_dev != pt.st_dev || dot.st_ino != pt.st_ino) { + errno = EINVAL; + return -1; + } + /* + * For the case where we allocated a buffer, check that it can fit + * in the real buffer, and copy it over. + */ + if (size < MAXPATHLEN) { + if (strlen(b) >= size) { + errno = ERANGE; + return -1; + } + strcpy(buf, b); + } + return 0; +} + +__private_extern__ char * +__private_getcwd(pt, size, usegetpath) + char *pt; + size_t size; + int usegetpath; +{ + struct dirent *dp; + DIR *dir = NULL; + dev_t dev; + ino_t ino; + int first; + char *bpt, *bup; + struct stat s; + dev_t root_dev; + ino_t root_ino; + size_t ptsize, upsize; + int save_errno; + char *ept, *eup, *up; + + /* + * If no buffer specified by the user, allocate one as necessary. + * If a buffer is specified, the size has to be non-zero. The path + * is built from the end of the buffer backwards. + */ + if (pt) { + ptsize = 0; + if (!size) { + errno = EINVAL; + return (NULL); + } + if (size == 1) { + errno = ERANGE; + return (NULL); + } + ept = pt + size; + } else { + if ((pt = malloc(ptsize = MAXPATHLEN)) == NULL) + return (NULL); + ept = pt + ptsize; + } + if (usegetpath) { + if (__getcwd(pt, ept - pt) == 0) { + return (pt); + } else if (errno == ERANGE) /* failed because buffer too small */ + return NULL; + } + bpt = ept - 1; + *bpt = '\0'; + + /* + * Allocate MAXPATHLEN bytes for the string of "../"'s. + * Should always be enough. If it's not, allocate + * as necessary. Special case the first stat, it's ".", not "..". + */ + if ((up = malloc(upsize = MAXPATHLEN)) == NULL) + goto err; + eup = up + MAXPATHLEN; + bup = up; + up[0] = '.'; + up[1] = '\0'; + + /* Save root values, so know when to stop. */ + if (stat("/", &s)) + goto err; + root_dev = s.st_dev; + root_ino = s.st_ino; + + errno = 0; /* XXX readdir has no error return. */ + + for (first = 1;; first = 0) { + /* Stat the current level. */ + if (lstat(up, &s)) + goto err; + + /* Save current node values. */ + ino = s.st_ino; + dev = s.st_dev; + + /* Check for reaching root. */ + if (root_dev == dev && root_ino == ino) { + *--bpt = '/'; + /* + * It's unclear that it's a requirement to copy the + * path to the beginning of the buffer, but it's always + * been that way and stuff would probably break. + */ + bcopy(bpt, pt, ept - bpt); + free(up); + return (pt); + } + + /* + * Build pointer to the parent directory, allocating memory + * as necessary. Max length is 3 for "../", the largest + * possible component name, plus a trailing NUL. + */ + while (bup + 3 + MAXNAMLEN + 1 >= eup) { + if ((up = reallocf(up, upsize *= 2)) == NULL) + goto err; + bup = up; + eup = up + upsize; + } + *bup++ = '.'; + *bup++ = '.'; + *bup = '\0'; + + /* Open and stat parent directory. */ + if (!(dir = opendir(up)) || _fstat(dirfd(dir), &s)) + goto err; + + /* Add trailing slash for next directory. */ + *bup++ = '/'; + *bup = '\0'; + + /* + * If it's a mount point, have to stat each element because + * the inode number in the directory is for the entry in the + * parent directory, not the inode number of the mounted file. + */ + save_errno = 0; + if (s.st_dev == dev) { + for (;;) { + if (!(dp = readdir(dir))) + goto notfound; + if (dp->d_fileno == ino) + break; + } + } else + for (;;) { + if (!(dp = readdir(dir))) + goto notfound; + if (ISDOT(dp)) + continue; + bcopy(dp->d_name, bup, dp->d_namlen + 1); + + /* Save the first error for later. */ + if (lstat(up, &s)) { + if (!save_errno) + save_errno = errno; + errno = 0; + continue; + } + if (s.st_dev == dev && s.st_ino == ino) + break; + } + + /* + * Check for length of the current name, preceding slash, + * leading slash. + */ + while (bpt - pt < dp->d_namlen + (first ? 1 : 2)) { + size_t len, off; + + if (!ptsize) { + errno = ERANGE; + goto err; + } + off = bpt - pt; + len = ept - bpt; + if ((pt = reallocf(pt, ptsize *= 2)) == NULL) + goto err; + bpt = pt + off; + ept = pt + ptsize; + bcopy(bpt, ept - len, len); + bpt = ept - len; + } + if (!first) + *--bpt = '/'; + bpt -= dp->d_namlen; + bcopy(dp->d_name, bpt, dp->d_namlen); + (void) closedir(dir); + dir = NULL; + + /* Truncate any file name. */ + *bup = '\0'; + } + +notfound: + /* + * If readdir set errno, use it, not any saved error; otherwise, + * didn't find the current directory in its parent directory, set + * errno to ENOENT. + */ + if (!errno) + errno = save_errno ? save_errno : ENOENT; + /* FALLTHROUGH */ +err: + save_errno = errno; + + if (ptsize) + free(pt); + if (dir) + (void) closedir(dir); + free(up); + + errno = save_errno; + return (NULL); +} + +char * +getcwd(pt, size) + char *pt; + size_t size; +{ + return __private_getcwd(pt, size, 1); +} +#pragma clang diagnostic pop diff --git a/gen/FreeBSD/gethostname.3 b/gen/FreeBSD/gethostname.3 new file mode 100644 index 0000000..eed2346 --- /dev/null +++ b/gen/FreeBSD/gethostname.3 @@ -0,0 +1,131 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)gethostname.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/gethostname.3,v 1.17 2007/01/09 00:27:54 imp Exp $ +.\" +.Dd August 18, 2003 +.Dt GETHOSTNAME 3 +.Os +.Sh NAME +.Nm gethostname , +.Nm sethostname +.Nd get/set name of current host +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn gethostname "char *name" "size_t namelen" +.Ft int +.Fn sethostname "const char *name" "int namelen" +.Sh DESCRIPTION +The +.Fn gethostname +function +returns the standard host name for the current processor, as +previously set by +.Fn sethostname . +The +.Fa namelen +argument +specifies the size of the +.Fa name +array. +The returned name is null-terminated, unless insufficient space is provided. +.Pp +The +.Fn sethostname +function +sets the name of the host machine to be +.Fa name , +which has length +.Fa namelen . +This call is restricted to the super-user and +is normally used only when the system is bootstrapped. +.Pp +Host names are limited in length to +.Brq Dv sysconf(_SC_HOST_NAME_MAX) +characters, not including the trailing null, currently 255. +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +The following errors may be returned by these calls: +.Bl -tag -width Er +.It Bq Er EFAULT +The +.Fa name +or +.Fa namelen +argument gave an +invalid address. +.It Bq Er ENAMETOOLONG +The current host name is longer than +.Fa namelen . +(For +.Fn gethostname +only.) +.It Bq Er EPERM +The caller tried to set the host name and was not the super-user. +.El +.Sh SEE ALSO +.Xr sysconf 3 , +.Xr sysctl 3 +.Sh STANDARDS +The +.Fn gethostname +function conforms to +.St -p1003.1-2001 . +Callers should be aware that +.Brq Dv sysconf(_SC_HOST_NAME_MAX) +may be variable or infinite, but is guaranteed to be no less than +.Brq Dv _POSIX_HOST_NAME_MAX . +On older systems, this limit was defined in the non-standard header +.In sys/param.h +as +.Dv MAXHOSTNAMELEN , +and counted the terminating null. +The +.Fn sethostname +function and the error returns for +.Fn gethostname +are not standardized. +.Sh HISTORY +The +.Fn gethostname +function appeared in +.Bx 4.2 . +The +.Fa namelen +argument to +.Fn gethostname +was changed to +.Vt size_t +in +.Fx 5.2 +for alignment with +.St -p1003.1-2001 . diff --git a/gen/FreeBSD/gethostname.c b/gen/FreeBSD/gethostname.c new file mode 100644 index 0000000..031e2c8 --- /dev/null +++ b/gen/FreeBSD/gethostname.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gethostname.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/gethostname.c,v 1.8 2007/01/09 00:27:54 imp Exp $"); + +#include +#include +#include +#include + +#include +#include + +int +gethostname(name, namelen) + char *name; + size_t namelen; +{ + int mib[2]; + + mib[0] = CTL_KERN; + mib[1] = KERN_HOSTNAME; + if (namelen < MAXHOSTNAMELEN + 1) { + char local_buf[MAXHOSTNAMELEN + 1]; + size_t local_len = sizeof(local_buf); + if (sysctl(mib, 2, local_buf, &local_len, NULL, 0) == -1) { + if (errno == ENOMEM) + errno = ENAMETOOLONG; + return (-1); + } + strncpy(name, local_buf, namelen); + name[namelen - 1] = 0; + } else { + if (sysctl(mib, 2, name, &namelen, NULL, 0) == -1) { + if (errno == ENOMEM) + errno = ENAMETOOLONG; + return (-1); + } + } + return (0); +} diff --git a/gen/FreeBSD/getlogin.c b/gen/FreeBSD/getlogin.c new file mode 100644 index 0000000..8f0d988 --- /dev/null +++ b/gen/FreeBSD/getlogin.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getlogin.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/getlogin.c,v 1.11 2009/12/05 19:04:21 ed Exp $"); + +#include +#include +#include +#include +#include +#include +#include +#include "namespace.h" +#include +#include "un-namespace.h" + +#include "libc_private.h" + +extern int __getlogin(char *, int); + +__private_extern__ pthread_mutex_t __logname_mutex = PTHREAD_MUTEX_INITIALIZER; +__private_extern__ char *__logname = NULL; + +static char * +getlogin_basic(int *status) +{ + if (__logname == NULL) { + __logname = calloc(1, MAXLOGNAME); + if (__logname == NULL) { + *status = ENOMEM; + return (NULL); + } + } + + if (__logname[0] == 0) { + if (__getlogin(__logname, MAXLOGNAME) < 0) { + *status = errno; + return (NULL); + } + } + *status = 0; + return (*__logname ? __logname : NULL); +} + +char * +getlogin(void) +{ + char *result; + int status; + + pthread_mutex_lock(&__logname_mutex); + result = getlogin_basic(&status); + pthread_mutex_unlock(&__logname_mutex); + return (result); +} + +int +getlogin_r(char *logname, size_t namelen) +{ + char *result; + int status; + + pthread_mutex_lock(&__logname_mutex); + result = getlogin_basic(&status); + if (status == 0) { + if (strlcpy(logname, __logname, namelen) > namelen) { + status = ERANGE; + } + } + pthread_mutex_unlock(&__logname_mutex); + + return (status); +} diff --git a/gen/FreeBSD/getmntinfo.3 b/gen/FreeBSD/getmntinfo.3 new file mode 100644 index 0000000..9bf03b4 --- /dev/null +++ b/gen/FreeBSD/getmntinfo.3 @@ -0,0 +1,174 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getmntinfo.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/gen/getmntinfo.3,v 1.13 2007/01/09 00:27:54 imp Exp $ +.\" +.Dd April 12, 2017 +.Dt GETMNTINFO 3 +.Os +.Sh NAME +.Nm getmntinfo +.Nm getmntinfo_r_np +.Nm getmntinfo64 +.Nd get information about mounted file systems +.Sh SYNOPSIS +.In sys/param.h +.In sys/ucred.h +.In sys/mount.h +.Ft int +.Fn getmntinfo "struct statfs **mntbufp" "int flags" +.Ft int +.Fn getmntinfo_r_np "struct statfs **mntbufp" "int flags" +.Sh TRANSITIIONAL SYNOPSIS (NOW DEPRECATED) +.Ft int +.br +.Fn getmntinfo64 "struct statfs64 **mntbufp" "int flags" ; +.Sh DESCRIPTION +The +.Fn getmntinfo +function +returns an array of +.Ft statfs +structures describing each currently mounted file system (see +.Xr statfs 2 ) . +As +.Xr statfs 2 +indicates, the structure is defined differently depending on +whether the macro _DARWIN_FEATURE_64_BIT_INODE is defined (see +.Xr stat 2 +for more information on this macro). +.Pp +The +.Fn getmntinfo +and +.Fn getmntinfo_r_np +functions +pass their +.Fa flags +argument transparently to +.Xr getfsstat 2 . +.Pp +The +.Fn getmntinfo +function maintains ownership of the results buffer it allocates, +and may overwrite or free this buffer in subsequent calls to +.Fn getmntinfo . +For this reason, +.Fn getmntinfo +is not thread-safe. +.Pp +The +.Fn getmntinfo_r_np +function is a thread-safe equivalent of +.Fn getmntinfo +that allocates a new results buffer on every call and transfers ownership +of this buffer to the caller. +The caller is responsible for freeing this memory with +.Xr free 3 . +.Sh RETURN VALUES +On successful completion, +.Fn getmntinfo +and +.Fn getmntinfo_r_np +return a count of the number of elements in the array. +The pointer to the array is stored into +.Fa mntbufp . +.Pp +If an error occurs, zero is returned and the external variable +.Va errno +is set to indicate the error. +The +.Fn getmntinfo +function may modify the +.Fa mbtbufp +pointer even in the case of an error. +In this situation, callers should consider any previous information +returned by +.Fn getmntinfo +to be lost. +The +.Fn getmntinfo_r_np +function will not modify the +.Fa mntbufp +pointer in the case of an error. +.Sh ERRORS +The +.Fn getmntinfo +and +.Fn getmntinfo_r_np +functions +may fail and set errno for any of the errors specified for the library +routines +.Xr getfsstat 2 +or +.Xr malloc 3 . +.Sh TRANSITIONAL DESCRIPTION (NOW DEPRECATED) +The +.Fn getmntinfo64 +routine is equivalent to its corresponding non-64-suffixed routine, +when 64-bit inodes are in effect. +It was added before there was support for the symbol variants, and so is +now deprecated. +Instead of using it, set the +.Dv _DARWIN_USE_64_BIT_INODE +macro before including header files to force 64-bit inode support. +.Pp +The +.Ft statfs64 +structure used by this deprecated routine is the same as the +.Ft statfs +structure when 64-bit inodes are in effect. +.Sh SEE ALSO +.Xr getfsstat 2 , +.Xr mount 2 , +.Xr stat 2 , +.Xr statfs 2 , +.Xr mount 8 +.Sh HISTORY +The +.Fn getmntinfo +function first appeared in +.Bx 4.4 . +The +.Fn getmntinfo_r_np +function first appeared in macOS 10.13. +.Sh BUGS +The +.Fn getmntinfo +function writes the array of structures to an internal static object +and returns +a pointer to that object. +Subsequent calls to +.Fn getmntinfo +will modify the same object. +.Pp +The memory allocated by +.Fn getmntinfo +cannot be +.Xr free 3 Ns 'd +by the application. diff --git a/gen/FreeBSD/getmntinfo.c b/gen/FreeBSD/getmntinfo.c new file mode 100644 index 0000000..6f4bda7 --- /dev/null +++ b/gen/FreeBSD/getmntinfo.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getmntinfo.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/getmntinfo.c,v 1.5 2007/01/09 00:27:54 imp Exp $"); + +#include +#include +#include +#include +#include + +struct getmntinfo_vars { + struct statfs *mntbuf; + int mntsize; + long bufsize; +}; + +/* + * Return information about mounted filesystems. + */ +static int +getmntinfo_internal(struct getmntinfo_vars *vars, int flags) +{ + + if (vars->mntsize <= 0 && + (vars->mntsize = getfsstat(0, 0, MNT_NOWAIT)) < 0) { + return (0); + } + if (vars->bufsize > 0 && + (vars->mntsize = + getfsstat(vars->mntbuf, vars->bufsize, flags)) < 0) { + return (0); + } + while (vars->bufsize <= vars->mntsize * sizeof(struct statfs)) { + if (vars->mntbuf) { + free(vars->mntbuf); + } + vars->bufsize = (vars->mntsize + 1) * sizeof(struct statfs); + if ((vars->mntbuf = + (struct statfs *)malloc(vars->bufsize)) == 0) { + return (0); + } + if ((vars->mntsize = + getfsstat(vars->mntbuf, vars->bufsize, flags)) < 0) { + return (0); + } + } + return (vars->mntsize); +} + +/* Legacy version that keeps the buffer around. */ +int +getmntinfo(struct statfs **mntbufp, int flags) +{ + static struct getmntinfo_vars vars; + int rv; + + rv = getmntinfo_internal(&vars, flags); + /* Unconditional assignment matches legacy behavior. */ + *mntbufp = vars.mntbuf; + return (rv); +} + +/* Thread-safe version where the caller owns the newly-allocated buffer. */ +int +getmntinfo_r_np(struct statfs **mntbufp, int flags) +{ + struct getmntinfo_vars vars = { 0 }; + int rv, save_errno; + + if ((rv = getmntinfo_internal(&vars, flags)) != 0) { + *mntbufp = vars.mntbuf; + } else { + save_errno = errno; + free(vars.mntbuf); + errno = save_errno; + } + return (rv); +} diff --git a/gen/FreeBSD/getmntinfo64.c b/gen/FreeBSD/getmntinfo64.c new file mode 100644 index 0000000..f4f3a28 --- /dev/null +++ b/gen/FreeBSD/getmntinfo64.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getmntinfo.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/getmntinfo.c,v 1.5 2007/01/09 00:27:54 imp Exp $"); + +#include +#include +#include +#include + +/* + * Return information about mounted filesystems. + */ +int +getmntinfo64(mntbufp, flags) + struct statfs64 **mntbufp; + int flags; +{ + static struct statfs64 *mntbuf; + static int mntsize; + static long bufsize; + + if (mntsize <= 0 && (mntsize = getfsstat64(0, 0, MNT_NOWAIT)) < 0) + return (0); + if (bufsize > 0 && (mntsize = getfsstat64(mntbuf, bufsize, flags)) < 0) + return (0); + while (bufsize <= mntsize * sizeof(struct statfs64)) { + if (mntbuf) + free(mntbuf); + bufsize = (mntsize + 1) * sizeof(struct statfs64); + if ((mntbuf = (struct statfs64 *)malloc(bufsize)) == 0) + return (0); + if ((mntsize = getfsstat64(mntbuf, bufsize, flags)) < 0) + return (0); + } + *mntbufp = mntbuf; + return (mntsize); +} diff --git a/gen/FreeBSD/getpagesize.3 b/gen/FreeBSD/getpagesize.3 new file mode 100644 index 0000000..2c10efd --- /dev/null +++ b/gen/FreeBSD/getpagesize.3 @@ -0,0 +1,61 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getpagesize.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/getpagesize.3,v 1.12 2007/01/09 00:27:54 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt GETPAGESIZE 3 +.Os +.Sh NAME +.Nm getpagesize +.Nd get system page size +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn getpagesize void +.Sh DESCRIPTION +The +.Fn getpagesize +function +returns the number of bytes in a page. +Page granularity is the granularity of many of the memory +management calls. +.Pp +The page size is a system +page size and may not be the same as the underlying +hardware page size. +.Sh SEE ALSO +.Xr pagesize 1 , +.Xr sbrk 2 +.Sh HISTORY +The +.Fn getpagesize +function appeared in +.Bx 4.2 . diff --git a/gen/FreeBSD/getpagesize.c b/gen/FreeBSD/getpagesize.c new file mode 100644 index 0000000..1467ca8 --- /dev/null +++ b/gen/FreeBSD/getpagesize.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getpagesize.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/getpagesize.c,v 1.6 2007/01/09 00:27:54 imp Exp $"); + +#include +#include + +#include + +/* + * This is unlikely to change over the running time of any + * program, so we cache the result to save some syscalls. + * + * NB: This function may be called from malloc(3) at initialization + * NB: so must not result in a malloc(3) related call! + */ + +int +getpagesize() +{ + int mib[2]; + static int value; + size_t size; + + if (!value) { + mib[0] = CTL_HW; + mib[1] = HW_PAGESIZE; + size = sizeof value; + if (sysctl(mib, 2, &value, &size, NULL, 0) == -1) + return (-1); + } + return (value); +} diff --git a/gen/FreeBSD/getpass.3 b/gen/FreeBSD/getpass.3 new file mode 100644 index 0000000..62d20a7 --- /dev/null +++ b/gen/FreeBSD/getpass.3 @@ -0,0 +1,93 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getpass.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/getpass.3,v 1.12 2007/01/09 00:27:54 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt GETPASS 3 +.Os +.Sh NAME +.Nm getpass +.Nd get a password +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In pwd.h +.In unistd.h +.Ft char * +.Fn getpass "const char *prompt" +.Sh DESCRIPTION +The +.Fn getpass +function displays a prompt to, and reads in a password from, +.Pa /dev/tty . +If this file is not accessible, +.Fn getpass +displays the prompt on the standard error output and reads from the standard +input. +.Pp +The password may be up to _PASSWORD_LEN (currently 128) +characters in length. +Any additional +characters and the terminating newline character are discarded. +.Pp +The +.Fn getpass +function turns off character echoing while reading the password. +.Sh RETURN VALUES +The +.Fn getpass +function returns a pointer to the null terminated password. +.Sh FILES +.Bl -tag -width /dev/tty -compact +.It Pa /dev/tty +.El +.Sh SEE ALSO +.Xr crypt 3 , +.Xr readpassphrase 3 +.Sh HISTORY +A +.Fn getpass +function appeared in +.At v7 . +.Sh BUGS +The +.Fn getpass +function leaves its result in an internal static object and returns +a pointer to that object. +Subsequent calls to +.Fn getpass +will modify the same object. +.Pp +The calling process should zero the password as soon as possible to +avoid leaving the cleartext password visible in the process's address +space. +.Pp +Upon receipt of a SIGTSTP, the input buffer will be flushed, so any +partially typed password must be retyped when the process +continues. diff --git a/gen/FreeBSD/getpeereid.3 b/gen/FreeBSD/getpeereid.3 new file mode 100644 index 0000000..6b5aed0 --- /dev/null +++ b/gen/FreeBSD/getpeereid.3 @@ -0,0 +1,137 @@ +.\" +.\" Copyright (c) 2001 Dima Dorfman. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/getpeereid.3,v 1.6 2002/12/18 10:13:54 ru Exp $ +.\" +.Dd July 15, 2001 +.Dt GETPEEREID 3 +.Os +.Sh NAME +.Nm getpeereid +.Nd get the effective credentials of a UNIX-domain peer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In unistd.h +.Ft int +.Fn getpeereid "int s" "uid_t *euid" "gid_t *egid" +.Sh DESCRIPTION +The +.Fn getpeereid +function returns the effective user and group IDs of the +peer connected to a +.Ux Ns -domain +socket. +The argument +.Fa s +must be a +.Ux Ns -domain +socket +.Pq Xr unix 4 +of type +.Dv SOCK_STREAM +on which either +.Xr connect 2 +or +.Xr listen 2 +have been called. +The effective used ID is placed in +.Fa euid , +and the effective group ID in +.Fa egid . +.Pp +The credentials returned to the +.Xr listen 2 +caller are those of its peer at the time it called +.Xr connect 2 ; +the credentials returned to the +.Xr connect 2 +caller are those of its peer at the time it called +.Xr listen 2 . +This mechanism is reliable; there is no way for either side to influence +the credentials returned to its peer except by calling the appropriate +system call (i.e., either +.Xr connect 2 +or +.Xr listen 2 ) +under different effective credentials. +.Pp +One common use of this routine is for a +.Ux Ns -domain +server +to verify the credentials of its client. +Likewise, the client can verify the credentials of the server. +.Sh IMPLEMENTATION NOTES +On +.Fx , +.Fn getpeereid +is implemented in terms of the +.Dv LOCAL_PEERCRED +.Xr unix 4 +socket option. +.Sh RETURN VALUES +.Rv -std getpeereid +.Sh ERRORS +The +.Fn getpeereid +function +fails if: +.Bl -tag -width Er +.It Bq Er EBADF +The argument +.Fa s +is not a valid descriptor. +.It Bq Er ENOTSOCK +The argument +.Fa s +is a file, not a socket. +.It Bq Er ENOTCONN +The argument +.Fa s +does not refer to a socket on which +.Xr connect 2 +or +.Xr listen 2 +have been called. +.It Bq Er EINVAL +The argument +.Fa s +does not refer to a socket of type +.Dv SOCK_STREAM , +or the kernel returned invalid data. +.El +.Sh SEE ALSO +.Xr connect 2 , +.Xr getpeername 2 , +.Xr getsockname 2 , +.Xr getsockopt 2 , +.Xr listen 2 , +.Xr unix 4 +.Sh HISTORY +The +.Fn getpeereid +function appeared in +.Fx 4.6 . diff --git a/gen/FreeBSD/getpeereid.c b/gen/FreeBSD/getpeereid.c new file mode 100644 index 0000000..482dfd0 --- /dev/null +++ b/gen/FreeBSD/getpeereid.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2001 Dima Dorfman. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/getpeereid.c,v 1.6 2002/12/16 13:42:13 maxim Exp $"); + +#include +#include +#include +#include + +#include +#include + +int +getpeereid(int s, uid_t *euid, gid_t *egid) +{ + struct xucred xuc; + socklen_t xuclen; + int error; + + xuclen = sizeof(xuc); + error = getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); + if (error != 0) + return (error); + if (xuc.cr_version != XUCRED_VERSION) { + errno = EINVAL; + return (-1); + } + *euid = xuc.cr_uid; + *egid = xuc.cr_gid; + return (0); +} diff --git a/gen/FreeBSD/getprogname.3 b/gen/FreeBSD/getprogname.3 new file mode 100644 index 0000000..b7b9c99 --- /dev/null +++ b/gen/FreeBSD/getprogname.3 @@ -0,0 +1,93 @@ +.\" +.\" Copyright (c) 2001 Christopher G. Demetriou +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed for the +.\" NetBSD Project. See http://www.netbsd.org/ for +.\" information about NetBSD. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/getprogname.3,v 1.5 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd May 1, 2001 +.Dt GETPROGNAME 3 +.Os +.Sh NAME +.Nm getprogname , +.Nm setprogname +.Nd get or set the program name +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft const char * +.Fn getprogname "void" +.Ft void +.Fn setprogname "const char *progname" +.Sh DESCRIPTION +The +.Fn getprogname +and +.Fn setprogname +functions manipulate the name of the current program. +They are used by error-reporting routines to produce +consistent output. +.Pp +The +.Fn getprogname +function returns the name of the program. +If the name has not been set yet, it will return +.Dv NULL . +.Pp +The +.Fn setprogname +function sets the name of the program to be the last component of the +.Fa progname +argument. +Since a pointer to the given string is kept as the program name, +it should not be modified for the rest of the program's lifetime. +.Pp +In +.Fx , +the name of the program is set by the start-up code that is run before +.Fn main ; +thus, +running +.Fn setprogname +is not necessary. +Programs that desire maximum portability should still call it; +on another operating system, +these functions may be implemented in a portability library. +Calling +.Fn setprogname +allows the aforementioned library to learn the program name without +modifications to the start-up code. +.Sh SEE ALSO +.Xr err 3 +.Sh HISTORY +These functions first appeared in +.Nx 1.6 , +and made their way into +.Fx 4.4 . diff --git a/gen/FreeBSD/getprogname.c b/gen/FreeBSD/getprogname.c new file mode 100644 index 0000000..a736f65 --- /dev/null +++ b/gen/FreeBSD/getprogname.c @@ -0,0 +1,19 @@ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/getprogname.c,v 1.4 2002/03/29 22:43:41 markm Exp $"); + +#include "namespace.h" +#include +#include +#define __progname (*_NSGetProgname()) +#include "un-namespace.h" + +#include "libc_private.h" + +__weak_reference(_getprogname, getprogname); + +const char * +_getprogname(void) +{ + + return (__progname); +} diff --git a/gen/FreeBSD/glob.3 b/gen/FreeBSD/glob.3 new file mode 100644 index 0000000..75bebc4 --- /dev/null +++ b/gen/FreeBSD/glob.3 @@ -0,0 +1,502 @@ +.\" Copyright (c) 1989, 1991, 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Guido van Rossum. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)glob.3 8.3 (Berkeley) 4/16/94 +.\" $FreeBSD$ +.\" +.Dd June 11, 2017 +.Dt GLOB 3 +.Os +.Sh NAME +.Nm glob , +.Nm glob_b , +.Nm globfree +.Nd generate pathnames matching a pattern +.Sh SYNOPSIS +.In glob.h +.Ft int +.Fn glob "const char * restrict pattern" "int flags" "int (*errfunc)(const char *epath, int errno)" "glob_t * restrict pglob" +.Ft int +.Fn glob_b "const char * restrict pattern" "int flags" "int (^errblk)(const char *epath, int errno)" "glob_t * restrict pglob" +.Ft void +.Fn globfree "glob_t *pglob" +.Sh DESCRIPTION +The +.Fn glob +function +is a pathname generator that implements the rules for file name pattern +matching used by the shell. +.Pp +The include file +.In glob.h +defines the structure type +.Fa glob_t , +which contains at least the following fields: +.Bd -literal +typedef struct { + size_t gl_pathc; /* count of total paths so far */ + int gl_matchc; /* count of paths matching pattern */ + size_t gl_offs; /* reserved at beginning of gl_pathv */ + int gl_flags; /* returned flags */ + char **gl_pathv; /* list of paths matching pattern */ +} glob_t; +.Ed +.Pp +The argument +.Fa pattern +is a pointer to a pathname pattern to be expanded. +The +.Fn glob +argument +matches all accessible pathnames against the pattern and creates +a list of the pathnames that match. +In order to have access to a pathname, +.Fn glob +requires search permission on every component of a path except the last +and read permission on each directory of any filename component of +.Fa pattern +that contains any of the special characters +.Ql * , +.Ql ?\& +or +.Ql \&[ . +.Pp +The +.Fn glob +argument +stores the number of matched pathnames into the +.Fa gl_pathc +field, and a pointer to a list of pointers to pathnames into the +.Fa gl_pathv +field. +The first pointer after the last pathname is +.Dv NULL . +If the pattern does not match any pathnames, the returned number of +matched paths is set to zero. +.Pp +It is the caller's responsibility to create the structure pointed to by +.Fa pglob . +The +.Fn glob +function allocates other space as needed, including the memory pointed +to by +.Fa gl_pathv . +.Pp +The argument +.Fa flags +is used to modify the behavior of +.Fn glob . +The value of +.Fa flags +is the bitwise inclusive +.Tn OR +of any of the following +values defined in +.In glob.h : +.Bl -tag -width GLOB_ALTDIRFUNC +.It Dv GLOB_APPEND +Append pathnames generated to the ones from a previous call (or calls) +to +.Fn glob . +The value of +.Fa gl_pathc +will be the total matches found by this call and the previous call(s). +The pathnames are appended to, not merged with the pathnames returned by +the previous call(s). +Between calls, the caller must not change the setting of the +.Dv GLOB_DOOFFS +flag, nor change the value of +.Fa gl_offs +when +.Dv GLOB_DOOFFS +is set, nor (obviously) call +.Fn globfree +for +.Fa pglob . +.It Dv GLOB_DOOFFS +Make use of the +.Fa gl_offs +field. +If this flag is set, +.Fa gl_offs +is used to specify how many +.Dv NULL +pointers to prepend to the beginning +of the +.Fa gl_pathv +field. +In other words, +.Fa gl_pathv +will point to +.Fa gl_offs +.Dv NULL +pointers, +followed by +.Fa gl_pathc +pathname pointers, followed by a +.Dv NULL +pointer. +.It Dv GLOB_ERR +Causes +.Fn glob +to return when it encounters a directory that it cannot open or read. +Ordinarily, +.Fn glob +continues to find matches. +.It Dv GLOB_MARK +Each pathname that is a directory that matches +.Fa pattern +has a slash +appended. +.It Dv GLOB_NOCHECK +If +.Fa pattern +does not match any pathname, then +.Fn glob +returns a list +consisting of only +.Fa pattern , +with the number of total pathnames set to 1, and the number of matched +pathnames set to 0. +The effect of backslash escaping is present in the pattern returned. +.It Dv GLOB_NOESCAPE +By default, a backslash +.Pq Ql \e +character is used to escape the following character in the pattern, +avoiding any special interpretation of the character. +If +.Dv GLOB_NOESCAPE +is set, backslash escaping is disabled. +.It Dv GLOB_NOSORT +By default, the pathnames are sorted in ascending +collation +order; +this flag prevents that sorting (speeding up +.Fn glob ) . +.El +.Pp +The following values may also be included in +.Fa flags , +however, they are non-standard extensions to +.St -p1003.2 . +.Bl -tag -width GLOB_ALTDIRFUNC +.It Dv GLOB_ALTDIRFUNC +The following additional fields in the pglob structure have been +initialized with alternate functions for glob to use to open, read, +and close directories and to get stat information on names found +in those directories. +.Bd -literal +void *(*gl_opendir)(const char * name); +struct dirent *(*gl_readdir)(void *); +void (*gl_closedir)(void *); +int (*gl_lstat)(const char *name, struct stat *st); +int (*gl_stat)(const char *name, struct stat *st); +.Ed +.Pp +This extension is provided to allow programs such as +.Xr restore 8 +to provide globbing from directories stored on tape. +.It Dv GLOB_BRACE +Pre-process the pattern string to expand +.Ql {pat,pat,...} +strings like +.Xr csh 1 . +The pattern +.Ql {} +is left unexpanded for historical reasons (and +.Xr csh 1 +does the same thing to +ease typing +of +.Xr find 1 +patterns). +.It Dv GLOB_MAGCHAR +Set by the +.Fn glob +function if the pattern included globbing characters. +See the description of the usage of the +.Fa gl_matchc +structure member for more details. +.It Dv GLOB_NOMAGIC +Is the same as +.Dv GLOB_NOCHECK +but it only appends the +.Fa pattern +if it does not contain any of the special characters ``*'', ``?'' or ``[''. +.Dv GLOB_NOMAGIC +is provided to simplify implementing the historic +.Xr csh 1 +globbing behavior and should probably not be used anywhere else. +.It Dv GLOB_TILDE +Expand patterns that start with +.Ql ~ +to user name home directories. +.It Dv GLOB_LIMIT +Limit the total number of returned pathnames to the value provided in +.Fa gl_matchc +(default +.Dv ARG_MAX ) . +This option should be set for programs +that can be coerced into a denial of service attack +via patterns that expand to a very large number of matches, +such as a long string of +.Ql */../*/.. . +.El +.Pp +If, during the search, a directory is encountered that cannot be opened +or read and +.Fa errfunc +is +.Pf non- Dv NULL , +.Fn glob +calls +.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) . +This may be unintuitive: a pattern like +.Ql */Makefile +will try to +.Xr stat 2 +.Ql foo/Makefile +even if +.Ql foo +is not a directory, resulting in a +call to +.Fa errfunc . +The error routine can suppress this action by testing for +.Er ENOENT +and +.Er ENOTDIR ; +however, the +.Dv GLOB_ERR +flag will still cause an immediate +return when this happens. +.Pp +If +.Fa errfunc +returns non-zero, +.Fn glob +stops the scan and returns +.Dv GLOB_ABORTED +after setting +.Fa gl_pathc +and +.Fa gl_pathv +to reflect any paths already matched. +This also happens if an error is encountered and +.Dv GLOB_ERR +is set in +.Fa flags , +regardless of the return value of +.Fa errfunc , +if called. +If +.Dv GLOB_ERR +is not set and either +.Fa errfunc +is +.Dv NULL +or +.Fa errfunc +returns zero, the error is ignored. +.Pp +The +.Fn glob_b +function is like +.Fn glob +except that the error callback is a block pointer instead of a function +pointer. +.Pp +The +.Fn globfree +function frees any space associated with +.Fa pglob +from a previous call(s) to +.Fn glob +or +.Fn glob_b . +.Sh RETURN VALUES +On successful completion, +.Fn glob +and +.Fn glob_b +return zero. +In addition, the fields of +.Fa pglob +contain the values described below: +.Bl -tag -width GLOB_NOCHECK +.It Fa gl_pathc +contains the total number of matched pathnames so far. +This includes other matches from previous invocations of +.Fn glob +or +.Fn glob_b +if +.Dv GLOB_APPEND +was specified. +.It Fa gl_matchc +contains the number of matched pathnames in the current invocation of +.Fn glob +or +.Fn glob_b . +.It Fa gl_flags +contains a copy of the +.Fa flags +argument with the bit +.Dv GLOB_MAGCHAR +set if +.Fa pattern +contained any of the special characters ``*'', ``?'' or ``['', cleared +if not. +.It Fa gl_pathv +contains a pointer to a +.Dv NULL Ns -terminated +list of matched pathnames. +However, if +.Fa gl_pathc +is zero, the contents of +.Fa gl_pathv +are undefined. +.El +.Pp +If +.Fn glob +or +.Fn glob_b +terminates due to an error, it sets errno and returns one of the +following non-zero constants, which are defined in the include +file +.In glob.h : +.Bl -tag -width GLOB_NOCHECK +.It Dv GLOB_NOSPACE +An attempt to allocate memory failed, or if +.Fa errno +was E2BIG, +.Dv GLOB_LIMIT +was specified in the flags and +.Fa pglob\->gl_matchc +or more patterns were matched. +.It Dv GLOB_ABORTED +The scan was stopped because an error was encountered and either +.Dv GLOB_ERR +was set or +.Fa \*(lp*errfunc\*(rp\*(lp\*(rp +returned non-zero. +.It Dv GLOB_NOMATCH +The pattern did not match a pathname and +.Dv GLOB_NOCHECK +was not set. +.El +.Pp +The arguments +.Fa pglob\->gl_pathc +and +.Fa pglob\->gl_pathv +are still set as specified above. +.Sh EXAMPLES +A rough equivalent of +.Ql "ls -l *.c *.h" +can be obtained with the +following code: +.Bd -literal -offset indent +glob_t g; + +g.gl_offs = 2; +glob("*.c", GLOB_DOOFFS, NULL, &g); +glob("*.h", GLOB_DOOFFS | GLOB_APPEND, NULL, &g); +g.gl_pathv[0] = "ls"; +g.gl_pathv[1] = "-l"; +execvp("ls", g.gl_pathv); +.Ed +.Sh CAVEATS +The +.Fn glob +and +.Fn glob_b +functions +will not match filenames that begin with a period +unless this is specifically requested (e.g., by ".*"). +.Sh SEE ALSO +.Xr sh 1 , +.Xr fnmatch 3 , +.Xr regexp 3 +.Sh STANDARDS +The current implementation of the +.Fn glob +function +.Em does not +conform to +.St -p1003.2 . +Collating symbol expressions, equivalence class expressions and +character class expressions are not supported. +.Pp +The flags +.Dv GLOB_ALTDIRFUNC , +.Dv GLOB_BRACE , +.Dv GLOB_LIMIT , +.Dv GLOB_MAGCHAR , +.Dv GLOB_NOMAGIC , +and +.Dv GLOB_TILDE , +and the fields +.Fa gl_matchc +and +.Fa gl_flags +are extensions to the +.Tn POSIX +standard and +should not be used by applications striving for strict +conformance. +.Sh HISTORY +The +.Fn glob +and +.Fn globfree +functions first appeared in +.Bx 4.4 . +The +.Fn glob_b +function first appeared in Mac OS X 10.6. +.Sh BUGS +Patterns longer than +.Dv MAXPATHLEN +may cause unchecked errors. +.Pp +The +.Fn glob +and +.Fn glob_b +functions +may fail and set errno for any of the errors specified for the +library routines +.Xr stat 2 , +.Xr closedir 3 , +.Xr opendir 3 , +.Xr readdir 3 , +.Xr malloc 3 , +and +.Xr free 3 . diff --git a/gen/FreeBSD/glob.c b/gen/FreeBSD/glob.c new file mode 100644 index 0000000..9419e3d --- /dev/null +++ b/gen/FreeBSD/glob.c @@ -0,0 +1,1177 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Guido van Rossum. + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "xlocale_private.h" + +/* + * glob(3) -- a superset of the one defined in POSIX 1003.2. + * + * The [!...] convention to negate a range is supported (SysV, Posix, ksh). + * + * Optional extra services, controlled by flags not defined by POSIX: + * + * GLOB_QUOTE: + * Escaping convention: \ inhibits any special meaning the following + * character might have (except \ at end of string is retained). + * GLOB_MAGCHAR: + * Set in gl_flags if pattern contained a globbing character. + * GLOB_NOMAGIC: + * Same as GLOB_NOCHECK, but it will only append pattern if it did + * not contain any magic characters. [Used in csh style globbing] + * GLOB_ALTDIRFUNC: + * Use alternately specified directory access functions. + * GLOB_TILDE: + * expand ~user/foo to the /home/dir/of/user/foo + * GLOB_BRACE: + * expand {1,2}{a,b} to 1a 1b 2a 2b + * gl_matchc: + * Number of matches in the current invocation of glob. + */ + +/* + * Some notes on multibyte character support: + * 1. Patterns with illegal byte sequences match nothing - even if + * GLOB_NOCHECK is specified. + * 2. Illegal byte sequences in filenames are handled by treating them as + * single-byte characters with a values of such bytes of the sequence + * cast to wchar_t. + * 3. State-dependent encodings are not currently supported. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "collate.h" + +/* + * glob(3) expansion limits. Stop the expansion if any of these limits + * is reached. This caps the runtime in the face of DoS attacks. See + * also CVE-2010-2632 + */ +#define GLOB_LIMIT_BRACE 128 /* number of brace calls */ +#define GLOB_LIMIT_PATH 1024 /* number of path elements */ +#define GLOB_LIMIT_READDIR 16384 /* number of readdirs */ +#define GLOB_LIMIT_STAT 128 /* number of stat system calls */ +#define GLOB_LIMIT_STRING 65536 /* maximum total size for paths */ + +struct glob_limit { + size_t l_brace_cnt; + size_t l_path_lim; + size_t l_readdir_cnt; + size_t l_stat_cnt; + size_t l_string_cnt; +}; + +#define DOT L'.' +#define EOS L'\0' +#define LBRACKET L'[' +#define NOT L'!' +#define QUESTION L'?' +#define QUOTE L'\\' +#define RANGE L'-' +#define RBRACKET L']' +#define SEP L'/' +#define STAR L'*' +#define TILDE L'~' +#define LBRACE L'{' +#define RBRACE L'}' +#define COMMA L',' + +#define M_QUOTE 0x8000000000ULL +#define M_PROTECT 0x4000000000ULL +#define M_MASK 0xffffffffffULL +#define M_CHAR 0x00ffffffffULL + +typedef uint_fast64_t Char; + +#define CHAR(c) ((Char)((c)&M_CHAR)) +#define META(c) ((Char)((c)|M_QUOTE)) +#define UNPROT(c) ((c) & ~M_PROTECT) +#define M_ALL META(L'*') +#define M_END META(L']') +#define M_NOT META(L'!') +#define M_ONE META(L'?') +#define M_RNG META(L'-') +#define M_SET META(L'[') +#define ismeta(c) (((c)&M_QUOTE) != 0) +#ifdef DEBUG +#define isprot(c) (((c)&M_PROTECT) != 0) +#endif + + +#define compare __gl_compare +#define g_Ctoc __gl_g_Ctoc +#define g_strchr __gl_g_strchr +#define globextend __gl_globextend +#define globtilde __gl_globtilde +#define match __gl_match + +__private_extern__ int compare(const void *, const void *); +__private_extern__ int g_Ctoc(const Char *, char *, size_t, locale_t); +static int g_lstat(Char *, struct stat *, glob_t *, locale_t); +static DIR *g_opendir(Char *, glob_t *, locale_t); +__private_extern__ const Char *g_strchr(const Char *, wchar_t); +#ifdef notdef +static Char *g_strcat(Char *, const Char *); +#endif +static int g_stat(Char *, struct stat *, glob_t *, locale_t); +static int glob0(const Char *, glob_t *, struct glob_limit *, + const char *,locale_t); +static int glob1(Char *, glob_t *, struct glob_limit *, locale_t); +static int glob2(Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *, locale_t); +static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *, locale_t); +__private_extern__ int globextend(const Char *, glob_t *, struct glob_limit *, + const char *, locale_t); +__private_extern__ const Char * globtilde(const Char *, Char *, size_t, glob_t *, + locale_t); +static int globexp0(const Char *, glob_t *, struct glob_limit *, + const char *, locale_t); +static int globexp1(const Char *, glob_t *, struct glob_limit *, locale_t); +static int globexp2(const Char *, const Char *, glob_t *, + struct glob_limit *, locale_t); +static int globfinal(glob_t *, struct glob_limit *, size_t, + const char *, locale_t); +__private_extern__ int match(Char *, Char *, Char *, locale_t); +static int err_nomatch(glob_t *, struct glob_limit *, const char *, locale_t loc); +static int err_aborted(glob_t *, int, char *); +#ifdef DEBUG +static void qprintf(const char *, Char *); +#endif + +static int +__glob(const char *pattern, glob_t *pglob) +{ + struct glob_limit limit = { 0, 0, 0, 0, 0 }; + const char *patnext; + Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; + mbstate_t mbs; + wchar_t wc; + size_t clen; + int too_long; + locale_t loc = __current_locale(); + int mb_cur_max = MB_CUR_MAX_L(loc); + + patnext = pattern; + if (!(pglob->gl_flags & GLOB_APPEND)) { + pglob->gl_pathc = 0; + pglob->gl_pathv = NULL; + if (!(pglob->gl_flags & GLOB_DOOFFS)) + pglob->gl_offs = 0; + } + if (pglob->gl_flags & GLOB_LIMIT) { + limit.l_path_lim = pglob->gl_matchc; + if (limit.l_path_lim == 0) + limit.l_path_lim = GLOB_LIMIT_PATH; + } + pglob->gl_matchc = 0; + + bufnext = patbuf; + bufend = bufnext + MAXPATHLEN - 1; + too_long = 1; + if (pglob->gl_flags & GLOB_NOESCAPE) { + memset(&mbs, 0, sizeof(mbs)); + while (bufend - bufnext >= mb_cur_max) { + clen = mbrtowc_l(&wc, patnext, MB_LEN_MAX, &mbs, loc); + if (clen == (size_t)-1 || clen == (size_t)-2) + return (err_nomatch(pglob, &limit, pattern, loc)); + else if (clen == 0) { + too_long = 0; + break; + } + *bufnext++ = wc; + patnext += clen; + } + } else { + /* Protect the quoted characters. */ + memset(&mbs, 0, sizeof(mbs)); + while (bufend - bufnext >= mb_cur_max) { + if (*patnext == '\\') { + if (*++patnext == '\0') { + *bufnext++ = QUOTE; + continue; + } + prot = M_PROTECT; + } else + prot = 0; + clen = mbrtowc_l(&wc, patnext, MB_LEN_MAX, &mbs, loc); + if (clen == (size_t)-1 || clen == (size_t)-2) + return (err_nomatch(pglob, &limit, pattern, loc)); + else if (clen == 0) { + too_long = 0; + break; + } + *bufnext++ = wc | prot; + patnext += clen; + } + } + if (too_long) + return (err_nomatch(pglob, &limit, pattern, loc)); + *bufnext = EOS; + + if (pglob->gl_flags & GLOB_BRACE) + return globexp0(patbuf, pglob, &limit, pattern, loc); + else + return glob0(patbuf, pglob, &limit, pattern, loc); +} + +int +glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) +{ +#ifdef __BLOCKS__ + pglob->gl_flags = flags & ~(GLOB_MAGCHAR | _GLOB_ERR_BLOCK); +#else /* !__BLOCKS__ */ + pglob->gl_flags = flags & ~GLOB_MAGCHAR; +#endif /* __BLOCKS__ */ + pglob->gl_errfunc = errfunc; + return __glob(pattern, pglob); +} + +#ifdef __BLOCKS__ +int +glob_b(const char *pattern, int flags, int (^errblk)(const char *, int), glob_t *pglob) +{ + pglob->gl_flags = flags & ~GLOB_MAGCHAR; + pglob->gl_flags |= _GLOB_ERR_BLOCK; + pglob->gl_errblk = errblk; + return __glob(pattern, pglob); +} +#endif /* __BLOCKS__ */ + +static int +globexp0(const Char *pattern, glob_t *pglob, struct glob_limit *limit, + const char *origpat, locale_t loc) { + int rv; + size_t oldpathc; + + /* Protect a single {}, for find(1), like csh */ + if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) { + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + return (glob0(pattern, pglob, limit, origpat, loc)); + } + + oldpathc = pglob->gl_pathc; + + if ((rv = globexp1(pattern, pglob, limit, loc)) != 0) + return rv; + + return (globfinal(pglob, limit, oldpathc, origpat, loc)); +} + +/* + * Expand recursively a glob {} pattern. When there is no more expansion + * invoke the standard globbing routine to glob the rest of the magic + * characters + */ +static int +globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit, locale_t loc) +{ + const Char* ptr; + + if ((ptr = g_strchr(pattern, LBRACE)) != NULL) { + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + return (globexp2(ptr, pattern, pglob, limit, loc)); + } + + return (glob0(pattern, pglob, limit, NULL, loc)); +} + + +/* + * Recursive brace globbing helper. Tries to expand a single brace. + * If it succeeds then it invokes globexp1 with the new pattern. + * If it fails then it tries to glob the rest of the pattern and returns. + */ +static int +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, + struct glob_limit *limit, locale_t loc) +{ + int i, rv; + Char *lm, *ls; + const Char *pe, *pm, *pm1, *pl; + Char patbuf[MAXPATHLEN]; + + /* copy part up to the brace */ + for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++) + continue; + *lm = EOS; + ls = lm; + + /* Find the balanced brace */ + for (i = 0, pe = ++ptr; *pe != EOS; pe++) + if (*pe == LBRACKET) { + /* Ignore everything between [] */ + for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++) + continue; + if (*pe == EOS) { + /* + * We could not find a matching RBRACKET. + * Ignore and just look for RBRACE + */ + pe = pm; + } + } + else if (*pe == LBRACE) + i++; + else if (*pe == RBRACE) { + if (i == 0) + break; + i--; + } + + /* Non matching braces; just glob the pattern */ + if (i != 0 || *pe == EOS) + return (glob0(pattern, pglob, limit, NULL, loc)); + + for (i = 0, pl = pm = ptr; pm <= pe; pm++) + switch (*pm) { + case LBRACKET: + /* Ignore everything between [] */ + for (pm1 = pm++; *pm != RBRACKET && *pm != EOS; pm++) + continue; + if (*pm == EOS) { + /* + * We could not find a matching RBRACKET. + * Ignore and just look for RBRACE + */ + pm = pm1; + } + break; + + case LBRACE: + i++; + break; + + case RBRACE: + if (i) { + i--; + break; + } + /* FALLTHROUGH */ + case COMMA: + if (i && *pm == COMMA) + break; + else { + /* Append the current string */ + for (lm = ls; (pl < pm); *lm++ = *pl++) + continue; + /* + * Append the rest of the pattern after the + * closing brace + */ + for (pl = pe + 1; (*lm++ = *pl++) != EOS;) + continue; + + /* Expand the current pattern */ +#ifdef DEBUG + qprintf("globexp2:", patbuf); +#endif + rv = globexp1(patbuf, pglob, limit, loc); + if (rv) + return (rv); + + /* move after the comma, to the next string */ + pl = pm + 1; + } + break; + + default: + break; + } + return (0); +} + + + +#ifndef BUILDING_VARIANT +/* + * expand tilde from the passwd file. + */ +__private_extern__ const Char * +globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob, locale_t loc) +{ + struct passwd *pwd; + char *h, *sc; + const Char *p; + Char *b, *eb; + wchar_t wc; + wchar_t wbuf[MAXPATHLEN]; + wchar_t *wbufend, *dc; + size_t clen; + mbstate_t mbs; + int too_long; + + if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE)) + return (pattern); + + /* + * Copy up to the end of the string or / + */ + eb = &patbuf[patbuf_len - 1]; + for (p = pattern + 1, b = patbuf; + b < eb && *p != EOS && UNPROT(*p) != SEP; *b++ = *p++) + continue; + + if (*p != EOS && UNPROT(*p) != SEP) + return (NULL); + + *b = EOS; + h = NULL; + + if (patbuf[0] == EOS) { + /* + * handle a plain ~ or ~/ by expanding $HOME first (iff + * we're not running setuid or setgid) and then trying + * the password file + */ + if (issetugid() != 0 || + (h = getenv("HOME")) == NULL) { + if (((h = getlogin()) != NULL && + (pwd = getpwnam(h)) != NULL) || + (pwd = getpwuid(getuid())) != NULL) + h = pwd->pw_dir; + else + return (pattern); + } + } + else { + /* + * Expand a ~user + */ + if (g_Ctoc(patbuf, (char *)wbuf, sizeof(wbuf), loc)) + return (NULL); + if ((pwd = getpwnam((char *)wbuf)) == NULL) + return (pattern); + else + h = pwd->pw_dir; + } + + /* Copy the home directory */ + dc = wbuf; + sc = h; + wbufend = wbuf + MAXPATHLEN - 1; + too_long = 1; + memset(&mbs, 0, sizeof(mbs)); + while (dc <= wbufend) { + clen = mbrtowc(&wc, sc, MB_LEN_MAX, &mbs); + if (clen == (size_t)-1 || clen == (size_t)-2) { + /* XXX See initial comment #2. */ + wc = (unsigned char)*sc; + clen = 1; + memset(&mbs, 0, sizeof(mbs)); + } + if ((*dc++ = wc) == EOS) { + too_long = 0; + break; + } + sc += clen; + } + if (too_long) + return (NULL); + + dc = wbuf; + for (b = patbuf; b < eb && *dc != EOS; *b++ = *dc++ | M_PROTECT) + continue; + if (*dc != EOS) + return (NULL); + + /* Append the rest of the pattern */ + if (*p != EOS) { + too_long = 1; + while (b <= eb) { + if ((*b++ = *p++) == EOS) { + too_long = 0; + break; + } + } + if (too_long) + return (NULL); + } else + *b = EOS; + + return (patbuf); +} +#endif /* BUILDING_VARIANT */ + + +/* + * The main glob() routine: compiles the pattern (optionally processing + * quotes), calls glob1() to do the real pattern matching, and finally + * sorts the list (unless unsorted operation is requested). Returns 0 + * if things went well, nonzero if errors occurred. + */ +static int +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit, + const char *origpat, locale_t loc) +{ + const Char *qpatnext; + int err; + size_t oldpathc; + Char *bufnext, c, patbuf[MAXPATHLEN]; + + qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob, loc); + if (qpatnext == NULL) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + oldpathc = pglob->gl_pathc; + bufnext = patbuf; + + /* We don't need to check for buffer overflow any more. */ + while ((c = *qpatnext++) != EOS) { + switch (c) { + case LBRACKET: + c = *qpatnext; + if (c == NOT) + ++qpatnext; + if (*qpatnext == EOS || + g_strchr(qpatnext+1, RBRACKET) == NULL) { + *bufnext++ = LBRACKET; + if (c == NOT) + --qpatnext; + break; + } + *bufnext++ = M_SET; + if (c == NOT) + *bufnext++ = M_NOT; + c = *qpatnext++; + do { + *bufnext++ = CHAR(c); + if (*qpatnext == RANGE && + (c = qpatnext[1]) != RBRACKET) { + *bufnext++ = M_RNG; + *bufnext++ = CHAR(c); + qpatnext += 2; + } + } while ((c = *qpatnext++) != RBRACKET); + pglob->gl_flags |= GLOB_MAGCHAR; + *bufnext++ = M_END; + break; + case QUESTION: + pglob->gl_flags |= GLOB_MAGCHAR; + *bufnext++ = M_ONE; + break; + case STAR: + pglob->gl_flags |= GLOB_MAGCHAR; + /* collapse adjacent stars to one, + * to ensure "**" at the end continues to match the + * empty string + */ + if (bufnext == patbuf || bufnext[-1] != M_ALL) + *bufnext++ = M_ALL; + break; + default: + *bufnext++ = CHAR(c); + break; + } + } + *bufnext = EOS; +#ifdef DEBUG + qprintf("glob0:", patbuf); +#endif + + if ((err = glob1(patbuf, pglob, limit, loc)) != 0) + return(err); + + if (origpat != NULL) + return (globfinal(pglob, limit, oldpathc, origpat, loc)); + + return (0); +} + +static int +globfinal(glob_t *pglob, struct glob_limit *limit, size_t oldpathc, + const char *origpat, locale_t loc) { + if (pglob->gl_pathc == oldpathc) + return (err_nomatch(pglob, limit, origpat, loc)); + + if (!(pglob->gl_flags & GLOB_NOSORT)) + qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, + pglob->gl_pathc - oldpathc, sizeof(char *), compare); + + return (0); +} + +#ifndef BUILDING_VARIANT +__private_extern__ int +compare(const void *p, const void *q) +{ + return(strcoll(*(char **)p, *(char **)q)); +} +#endif /* BUILDING_VARIANT */ + +static int +glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit, locale_t loc) +{ + Char pathbuf[MAXPATHLEN]; + + /* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */ + if (*pattern == EOS) + return (0); + return (glob2(pathbuf, pathbuf, pathbuf + MAXPATHLEN - 1, + pattern, pglob, limit, loc)); +} + +/* + * The functions glob2 and glob3 are mutually recursive; there is one level + * of recursion for each segment in the pattern that contains one or more + * meta characters. + */ +static int +glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, + glob_t *pglob, struct glob_limit *limit, locale_t loc) +{ + struct stat sb; + Char *p, *q; + int anymeta; + + /* + * Loop over pattern segments until end of pattern or until + * segment with meta character found. + */ + for (anymeta = 0;;) { + if (*pattern == EOS) { /* End of pattern? */ + *pathend = EOS; + if (g_lstat(pathbuf, &sb, pglob, loc)) + return (0); + + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + if ((pglob->gl_flags & GLOB_MARK) && + UNPROT(pathend[-1]) != SEP && + (S_ISDIR(sb.st_mode) || + (S_ISLNK(sb.st_mode) && + g_stat(pathbuf, &sb, pglob, loc) == 0 && + S_ISDIR(sb.st_mode)))) { + if (pathend + 1 > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + *pathend++ = SEP; + *pathend = EOS; + } + ++pglob->gl_matchc; + return (globextend(pathbuf, pglob, limit, NULL, loc)); + } + + /* Find end of next segment, copy tentatively to pathend. */ + q = pathend; + p = pattern; + while (*p != EOS && UNPROT(*p) != SEP) { + if (ismeta(*p)) + anymeta = 1; + if (q + 1 > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + *q++ = *p++; + } + + if (!anymeta) { /* No expansion, do next segment. */ + pathend = q; + pattern = p; + while (UNPROT(*pattern) == SEP) { + if (pathend + 1 > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + *pathend++ = *pattern++; + } + } else /* Need expansion, recurse. */ + return(glob3(pathbuf, pathend, pathend_last, pattern, + p, pglob, limit, loc)); + } + /* NOTREACHED */ +} + +static int +glob3(Char *pathbuf, Char *pathend, Char *pathend_last, + Char *pattern, Char *restpattern, + glob_t *pglob, struct glob_limit *limit, locale_t loc) +{ + struct dirent *dp; + DIR *dirp; + int err, too_long, saverrno, saverrno2; + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; + + /* + * The readdirfunc declaration can't be prototyped, because it is + * assigned, below, to two functions which are prototyped in glob.h + * and dirent.h as taking pointers to differently typed opaque + * structures. + */ + struct dirent *(*readdirfunc)(); + + if (pathend > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + *pathend = EOS; + if ((pglob->gl_errfunc != NULL || pglob->gl_errblk != NULL) && + g_Ctoc(pathbuf, buf, sizeof(buf), loc)) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + + saverrno = errno; + errno = 0; + + if ((dirp = g_opendir(pathbuf, pglob, loc)) == NULL) { + if (errno == ENOENT || errno == ENOTDIR) + return (0); + + err = err_aborted(pglob, errno, buf); + if (errno == 0) + errno = saverrno; + return (err); + } + + err = 0; + + if (pglob->gl_flags & GLOB_ALTDIRFUNC) + readdirfunc = pglob->gl_readdir; + else + readdirfunc = readdir; + + errno = 0; + /* Search directory for matching names. */ + while ((dp = (*readdirfunc)(dirp)) != NULL) { + char *sc; + Char *dc; + wchar_t wc; + size_t clen; + mbstate_t mbs; + + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { + errno = E2BIG; + err = GLOB_NOSPACE; + break; + } + + /* Initial DOT must be matched literally. */ + if (dp->d_name[0] == '.' && UNPROT(*pattern) != DOT) { + errno = 0; + continue; + } + memset(&mbs, 0, sizeof(mbs)); + dc = pathend; + sc = dp->d_name; + too_long = 1; + while (dc <= pathend_last) { + clen = mbrtowc_l(&wc, sc, MB_LEN_MAX, &mbs, loc); + if (clen == (size_t)-1 || clen == (size_t)-2) { + /* XXX See initial comment #2. */ + wc = (unsigned char)*sc; + clen = 1; + memset(&mbs, 0, sizeof(mbs)); + } + if ((*dc++ = wc) == EOS) { + too_long = 0; + break; + } + sc += clen; + } + if (too_long && (err = err_aborted(pglob, ENAMETOOLONG, + buf))) { + errno = ENAMETOOLONG; + break; + } + if (too_long || !match(pathend, pattern, restpattern, loc)) { + *pathend = EOS; + errno = 0; + continue; + } + if (errno == 0) + errno = saverrno; + err = glob2(pathbuf, --dc, pathend_last, restpattern, + pglob, limit, loc); + if (err) + break; + errno = 0; + } + + saverrno2 = errno; + if (pglob->gl_flags & GLOB_ALTDIRFUNC) + (*pglob->gl_closedir)(dirp); + else + closedir(dirp); + errno = saverrno2; + + if (err) + return (err); + + if (dp == NULL && errno != 0 && + (err = err_aborted(pglob, errno, buf))) + return (err); + + if (errno == 0) + errno = saverrno; + return (0); +} + + +#ifndef BUILDING_VARIANT +/* + * Extend the gl_pathv member of a glob_t structure to accommodate a new item, + * add the new item, and update gl_pathc. + * + * This assumes the BSD realloc, which only copies the block when its size + * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic + * behavior. + * + * Return 0 if new item added, error code if memory couldn't be allocated. + * + * Invariant of the glob_t structure: + * Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and + * gl_pathv points to (gl_offs + gl_pathc + 1) items. + */ +__private_extern__ int +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit, + const char *origpat, locale_t loc) +{ + char **pathv; + size_t i, newn, len; + char *copy; + const Char *p; + + if ((pglob->gl_flags & GLOB_LIMIT) && + pglob->gl_matchc > limit->l_path_lim) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + + newn = 2 + pglob->gl_pathc + pglob->gl_offs; + /* reallocarray(NULL, newn, size) is equivalent to malloc(newn*size). */ + pathv = reallocarray(pglob->gl_pathv, newn, sizeof(*pathv)); + if (pathv == NULL) + return (GLOB_NOSPACE); + + if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { + /* first time around -- clear initial gl_offs items */ + pathv += pglob->gl_offs; + for (i = pglob->gl_offs + 1; --i > 0; ) + *--pathv = NULL; + } + pglob->gl_pathv = pathv; + + if (origpat != NULL) + copy = strdup(origpat); + else { + for (p = path; *p++ != EOS;) + continue; + len = MB_CUR_MAX_L(loc) * (size_t)(p - path); /* XXX overallocation */ + if ((copy = malloc(len)) != NULL) { + if (g_Ctoc(path, copy, len, loc)) { + free(copy); + errno = E2BIG; + return (GLOB_NOSPACE); + } + } + } + if (copy != NULL) { + limit->l_string_cnt += strlen(copy) + 1; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { + free(copy); + errno = E2BIG; + return (GLOB_NOSPACE); + } + pathv[pglob->gl_offs + pglob->gl_pathc++] = copy; + } + pathv[pglob->gl_offs + pglob->gl_pathc] = NULL; + return (copy == NULL ? GLOB_NOSPACE : 0); +} + +/* + * pattern matching function for filenames. + */ +__private_extern__ int +match(Char *name, Char *pat, Char *patend, locale_t loc) +{ + int ok, negate_range; + Char c, k, *nextp, *nextn; + + nextn = NULL; + nextp = NULL; + + while (1) { + while (pat < patend) { + c = *pat++; + switch (c & M_MASK) { + case M_ALL: + if (pat == patend) + return (1); + if (*name == EOS) + return (0); + nextn = name + 1; + nextp = pat - 1; + break; + case M_ONE: + if (*name++ == EOS) + goto fail; + break; + case M_SET: + ok = 0; + if ((k = *name++) == EOS) + goto fail; + negate_range = ((*pat & M_MASK) == M_NOT); + if (negate_range != 0) + ++pat; + while (((c = *pat++) & M_MASK) != M_END) + if ((*pat & M_MASK) == M_RNG) { + if (loc->__collate_load_error ? + CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) : + __collate_range_cmp(CHAR(c), CHAR(k), loc) <= 0 + && __collate_range_cmp(CHAR(k), CHAR(pat[1]), loc) <= 0 + ) { + ok = 1; + } + pat += 2; + } else if (c == k) + ok = 1; + if (ok == negate_range) + goto fail; + break; + default: + if (*name++ != c) + goto fail; + break; + } + } + if (*name == EOS) + return (1); + + fail: + if (nextn == NULL) + break; + pat = nextp; + name = nextn; + } + return (0); +} + +/* Free allocated data belonging to a glob_t structure. */ +void +globfree(glob_t *pglob) +{ + size_t i; + char **pp; + + if (pglob->gl_pathv != NULL) { + pp = pglob->gl_pathv + pglob->gl_offs; + for (i = pglob->gl_pathc; i--; ++pp) + if (*pp) + free(*pp); + free(pglob->gl_pathv); + pglob->gl_pathv = NULL; + } +} +#endif /* !BUILDING_VARIANT */ + +static DIR * +g_opendir(Char *str, glob_t *pglob, locale_t loc) +{ + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; + + if (*str == EOS) + strcpy(buf, "."); + else { + if (g_Ctoc(str, buf, sizeof(buf), loc)) { + errno = ENAMETOOLONG; + return (NULL); + } + } + + if (pglob->gl_flags & GLOB_ALTDIRFUNC) + return ((*pglob->gl_opendir)(buf)); + + return (opendir(buf)); +} + +static int +g_lstat(Char *fn, struct stat *sb, glob_t *pglob, locale_t loc) +{ + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; + + if (g_Ctoc(fn, buf, sizeof(buf), loc)) { + errno = ENAMETOOLONG; + return (-1); + } + if (pglob->gl_flags & GLOB_ALTDIRFUNC) + return((*pglob->gl_lstat)(buf, sb)); + return (lstat(buf, sb)); +} + +static int +g_stat(Char *fn, struct stat *sb, glob_t *pglob, locale_t loc) +{ + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; + + if (g_Ctoc(fn, buf, sizeof(buf), loc)) { + errno = ENAMETOOLONG; + return (-1); + } + if (pglob->gl_flags & GLOB_ALTDIRFUNC) + return ((*pglob->gl_stat)(buf, sb)); + return (stat(buf, sb)); +} + +#ifndef BUILDING_VARIANT +__private_extern__ const Char * +g_strchr(const Char *str, wchar_t ch) +{ + + do { + if (*str == ch) + return (str); + } while (*str++); + return (NULL); +} + +__private_extern__ int +g_Ctoc(const Char *str, char *buf, size_t len, locale_t loc) +{ + mbstate_t mbs; + size_t clen; + int mb_cur_max = MB_CUR_MAX_L(loc); + + memset(&mbs, 0, sizeof(mbs)); + while (len >= mb_cur_max) { + clen = wcrtomb_l(buf, *str, &mbs, loc); + if (clen == (size_t)-1) { + /* XXX See initial comment #2. */ + *buf = (char)CHAR(*str); + clen = 1; + memset(&mbs, 0, sizeof(mbs)); + } + if (CHAR(*str) == EOS) + return (0); + str++; + buf += clen; + len -= clen; + } + return (1); +} +#endif /* !BUILDING_VARIANT */ + +static int +err_nomatch(glob_t *pglob, struct glob_limit *limit, const char *origpat, locale_t loc) { + /* + * If there was no match we are going to append the origpat + * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified + * and the origpat did not contain any magic characters + * GLOB_NOMAGIC is there just for compatibility with csh. + */ + if ((pglob->gl_flags & GLOB_NOCHECK) || + ((pglob->gl_flags & GLOB_NOMAGIC) && + !(pglob->gl_flags & GLOB_MAGCHAR))) + return (globextend(NULL, pglob, limit, origpat, loc)); + return (GLOB_NOMATCH); +} + +static int +err_aborted(glob_t *pglob, int err, char *buf) { +#ifdef __BLOCKS__ + if (pglob->gl_flags & _GLOB_ERR_BLOCK && pglob->gl_errblk(buf, errno)) { + return (GLOB_ABORTED); + } else +#endif /* __BLOCKS__ */ + if (pglob->gl_errfunc != NULL && pglob->gl_errfunc(buf, errno)) { + return (GLOB_ABORTED); + } else if (pglob->gl_flags & GLOB_ERR) { + return (GLOB_ABORTED); + } + return (0); +} + +#ifdef DEBUG +static void +qprintf(const char *str, Char *s) +{ + Char *p; + + (void)printf("%s\n", str); + if (s != NULL) { + for (p = s; *p != EOS; p++) + (void)printf("%c", (char)CHAR(*p)); + (void)printf("\n"); + for (p = s; *p != EOS; p++) + (void)printf("%c", (isprot(*p) ? '\\' : ' ')); + (void)printf("\n"); + for (p = s; *p != EOS; p++) + (void)printf("%c", (ismeta(*p) ? '_' : ' ')); + (void)printf("\n"); + } +} +#endif +#pragma clang diagnostic pop diff --git a/gen/FreeBSD/isatty.c b/gen/FreeBSD/isatty.c new file mode 100644 index 0000000..54a0fa0 --- /dev/null +++ b/gen/FreeBSD/isatty.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)isatty.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/isatty.c,v 1.6 2007/01/09 00:27:54 imp Exp $"); + +#include +#include +#include +#include +#include +#include + +int +isatty(fd) + int fd; +{ + int retval, type; + struct termios t; + + if(ioctl(fd, FIODTYPE, &type) != -1) { + if((retval = (type == D_TTY)) == 0) + errno = ENOTTY; + } else + retval = (tcgetattr(fd, &t) != -1); + return(retval); +} diff --git a/gen/FreeBSD/jrand48.c b/gen/FreeBSD/jrand48.c new file mode 100644 index 0000000..40d6a6f --- /dev/null +++ b/gen/FreeBSD/jrand48.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/jrand48.c,v 1.2 2002/03/22 21:52:05 obrien Exp $"); + +#include "rand48.h" + +long +jrand48(unsigned short xseed[3]) +{ + uint48 tmp; + DORAND48(tmp, xseed); + return (int)((tmp >> 16) & 0xffffffff); +} diff --git a/gen/FreeBSD/lcong48.c b/gen/FreeBSD/lcong48.c new file mode 100644 index 0000000..8a13d64 --- /dev/null +++ b/gen/FreeBSD/lcong48.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/lcong48.c,v 1.2 2002/03/22 21:52:05 obrien Exp $"); + +#include "rand48.h" + +void +lcong48(unsigned short p[7]) +{ + LOADRAND48(_rand48_seed, &p[0]); + LOADRAND48(_rand48_mult, &p[3]); + _rand48_add = p[6]; +} diff --git a/gen/FreeBSD/lockf.3 b/gen/FreeBSD/lockf.3 new file mode 100644 index 0000000..fc48307 --- /dev/null +++ b/gen/FreeBSD/lockf.3 @@ -0,0 +1,270 @@ +.\" $NetBSD: lockf.3,v 1.10 2008/04/30 13:10:50 martin Exp $ +.\" +.\" Copyright (c) 1997 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Klaus Klein and S.P. Zeidler. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/lockf.3,v 1.14 2009/03/04 01:01:26 delphij Exp $ +.\" +.Dd December 19, 1997 +.Dt LOCKF 3 +.Os +.Sh NAME +.Nm lockf +.Nd record locking on files +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn lockf "int fildes" "int function" "off_t size" +.Sh DESCRIPTION +The +.Fn lockf +function allows sections of a file to be locked with advisory-mode locks. +Calls to +.Fn lockf +from other processes which attempt to lock the locked file section will +either return an error value or block until the section becomes unlocked. +All of the locks for a process are removed when the process terminates. +.Pp +The argument +.Fa fildes +is an open file descriptor. +The file descriptor must have been opened either for write-only +.Dv ( O_WRONLY ) +or read/write +.Dv ( O_RDWR ) +operation. +.Pp +The +.Fa function +argument is a control value which specifies the action to be taken. +The permissible values for +.Fa function +are as follows: +.Bl -tag -width F_ULOCKXX -compact -offset indent +.It Sy Function +.Sy Description +.It Dv F_ULOCK +unlock locked sections +.It Dv F_LOCK +lock a section for exclusive use +.It Dv F_TLOCK +test and lock a section for exclusive use +.It Dv F_TEST +test a section for locks by other processes +.El +.Pp +.Dv F_ULOCK +removes locks from a section of the file; +.Dv F_LOCK +and +.Dv F_TLOCK +both lock a section of a file if the section is available; +.Dv F_TEST +detects if a lock by another process is present on the specified section. +.Pp +The +.Fa size +argument is the number of contiguous bytes to be locked or +unlocked. +The section to be locked or unlocked starts at the current +offset in the file and extends forward for a positive size or backward +for a negative size (the preceding bytes up to but not including the +current offset). +However, it is not permitted to lock a section that +starts or extends before the beginning of the file. +If +.Fa size +is 0, the section from the current offset through the largest possible +file offset is locked (that is, from the current offset through the +present or any future end-of-file). +.Pp +The sections locked with +.Dv F_LOCK +or +.Dv F_TLOCK +may, in whole or in part, contain or be contained by a previously +locked section for the same process. +When this occurs, or if adjacent +locked sections would occur, the sections are combined into a single +locked section. +If the request would cause the number of locks to +exceed a system-imposed limit, the request will fail. +.Pp +.Dv F_LOCK +and +.Dv F_TLOCK +requests differ only by the action taken if the section is not +available. +.Dv F_LOCK +blocks the calling process until the section is available. +.Dv F_TLOCK +makes the function fail if the section is already locked by another +process. +.Pp +File locks are released on first close by the locking process of any +file descriptor for the file. +.Pp +.Dv F_ULOCK +requests release (wholly or in part) one or more locked sections +controlled by the process. +Locked sections will be unlocked starting +at the current file offset through +.Fa size +bytes or to the end of file if size is 0. +When all of a locked section +is not released (that is, when the beginning or end of the area to be +unlocked falls within a locked section), the remaining portions of +that section are still locked by the process. +Releasing the center +portion of a locked section will cause the remaining locked beginning +and end portions to become two separate locked sections. +If the +request would cause the number of locks in the system to exceed a +system-imposed limit, the request will fail. +.Pp +An +.Dv F_ULOCK +request in which size is non-zero and the offset of the last byte of +the requested section is the maximum value for an object of type +off_t, when the process has an existing lock in which size is 0 and +which includes the last byte of the requested section, will be treated +as a request to unlock from the start of the requested section with a +size equal to 0. +Otherwise an +.Dv F_ULOCK +request will attempt to unlock only the requested section. +.Pp +A potential for deadlock occurs if a process controlling a locked +region is put to sleep by attempting to lock the locked region of +another process. +This implementation detects that sleeping until a +locked region is unlocked would cause a deadlock and fails with an +.Er EDEADLK +error. +.Pp +The +.Fn lockf , +.Xr fcntl 2 , +and +.Xr flock 2 +locks are compatible. +Processes using different locking interfaces can cooperate +over the same file safely. +However, only one of such interfaces should be used within +the same process. +If a file is locked by a process through +.Xr flock 2 , +any record within the file will be seen as locked +from the viewpoint of another process using +.Xr fcntl 2 +or +.Fn lockf , +and vice versa. +.Pp +Blocking on a section is interrupted by any signal. +.Sh RETURN VALUES +.Rv -std lockf +In the case of a failure, existing locks are not changed. +.Sh ERRORS +The +.Fn lockf +function +will fail if: +.Bl -tag -width Er +.It Bq Er EAGAIN +The argument +.Fa function +is +.Dv F_TLOCK +or +.Dv F_TEST +and the section is already locked by another process. +.It Bq Er EBADF +The argument +.Fa fildes +is not a valid open file descriptor. +.Pp +The argument +.Fa function +is +.Dv F_LOCK +or +.Dv F_TLOCK , +and +.Fa fildes +is not a valid file descriptor open for writing. +.It Bq Er EDEADLK +The argument +.Fa function +is +.Dv F_LOCK +and a deadlock is detected. +.It Bq Er EINTR +The argument +.Fa function +is F_LOCK +and +.Fn lockf +was interrupted by the delivery of a signal. +.It Bq Er EINVAL +The argument +.Fa function +is not one of +.Dv F_LOCK , +.Dv F_TEST , +.Dv F_TLOCK , +or +.Dv F_ULOCK . +.Pp +The argument +.Fa fildes +refers to a file that does not support advisory locking. +.It Bq Er ENOLCK +The argument +.Fa function +is +.Dv F_LOCK , +.Dv F_TLOCK , +or +.Dv F_ULOCK +and satisfying the lock or unlock request would result in the number +of locked regions in the system exceeding a system-imposed limit. +.It Bq Er EOPNOTSUPP +The argument +.Fa fildes +refers to a socket; these do not support advisory locking. +.El +.Sh SEE ALSO +.Xr fcntl 2 , +.Xr flock 2 +.Sh STANDARDS +The +.Fn lockf +function conforms to +.St -xpg4.2 . diff --git a/gen/FreeBSD/lockf.c b/gen/FreeBSD/lockf.c new file mode 100644 index 0000000..bc8de89 --- /dev/null +++ b/gen/FreeBSD/lockf.c @@ -0,0 +1,96 @@ +/* $NetBSD: lockf.c,v 1.3 2008/04/28 20:22:59 martin Exp $ */ +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Klaus Klein. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/lockf.c,v 1.10 2009/03/04 01:01:26 delphij Exp $"); + +#ifdef VARIANT_CANCELABLE +int __fcntl(int, int, void *); +#else /* !VARIANT_CANCELABLE */ +int __fcntl_nocancel(int, int, void *); +#endif /* VARIANT_CANCELABLE */ + + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" + +int +lockf(int filedes, int function, off_t size) +{ + struct flock fl; + int cmd; + + fl.l_start = 0; + fl.l_len = size; + fl.l_whence = SEEK_CUR; + + switch (function) { + case F_ULOCK: + cmd = F_SETLK; + fl.l_type = F_UNLCK; + break; + case F_LOCK: + cmd = F_SETLKW; + fl.l_type = F_WRLCK; + break; + case F_TLOCK: + cmd = F_SETLK; + fl.l_type = F_WRLCK; + break; + case F_TEST: + fl.l_type = F_WRLCK; +#ifdef VARIANT_CANCELABLE + if (__fcntl(filedes, F_GETLK, &fl) == -1) + return (-1); +#else /* !VARIANT_CANCELABLE */ + if (__fcntl_nocancel(filedes, F_GETLK, &fl) == -1) + return (-1); +#endif /* VARIANT_CANCELABLE */ + if (fl.l_type == F_UNLCK || fl.l_pid == getpid()) + return (0); + errno = EAGAIN; + return (-1); + /* NOTREACHED */ + default: + errno = EINVAL; + return (-1); + /* NOTREACHED */ + } + +#ifdef VARIANT_CANCELABLE + return (__fcntl(filedes, cmd, &fl)); +#else /* !VARIANT_CANCELABLE */ + return (__fcntl_nocancel(filedes, cmd, &fl)); +#endif /* VARIANT_CANCELABLE */ +} + diff --git a/gen/FreeBSD/lrand48.c b/gen/FreeBSD/lrand48.c new file mode 100644 index 0000000..3b01e85 --- /dev/null +++ b/gen/FreeBSD/lrand48.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/lrand48.c,v 1.2 2002/03/22 21:52:05 obrien Exp $"); + +#include "rand48.h" + +long +lrand48(void) +{ + _DORAND48(_rand48_seed); + return (_rand48_seed >> 17) & 0x7fffffff; +} diff --git a/gen/FreeBSD/mrand48.c b/gen/FreeBSD/mrand48.c new file mode 100644 index 0000000..5453ceb --- /dev/null +++ b/gen/FreeBSD/mrand48.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/mrand48.c,v 1.2 2002/03/22 21:52:05 obrien Exp $"); + +#include "rand48.h" + +long +mrand48(void) +{ + _DORAND48(_rand48_seed); + return (int)((_rand48_seed >> 16) & 0xffffffff); +} diff --git a/gen/FreeBSD/nice.3 b/gen/FreeBSD/nice.3 new file mode 100644 index 0000000..2bb58a3 --- /dev/null +++ b/gen/FreeBSD/nice.3 @@ -0,0 +1,69 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)nice.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/nice.3,v 1.12 2007/01/09 00:27:54 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt NICE 3 +.Os +.Sh NAME +.Nm nice +.Nd set program scheduling priority +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn nice "int incr" +.Sh DESCRIPTION +.Bf -symbolic +This interface is obsoleted by +.Xr setpriority 2 . +.Ef +.Pp +The +.Fn nice +function obtains the scheduling priority of the process +from the system and sets it to the priority value specified in +.Fa incr . +The priority is a value in the range -20 to 20. +The default priority is 0; lower priorities cause more favorable scheduling. +Only the super-user may lower priorities. +.Pp +Children inherit the priority of their parent processes via +.Xr fork 2 . +.Sh SEE ALSO +.Xr nice 1 , +.Xr fork 2 , +.Xr setpriority 2 , +.Xr renice 8 +.Sh HISTORY +A +.Fn nice +syscall appeared in +.At v6 . diff --git a/gen/FreeBSD/nice.c b/gen/FreeBSD/nice.c new file mode 100644 index 0000000..962eee1 --- /dev/null +++ b/gen/FreeBSD/nice.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)nice.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/nice.c,v 1.4 2007/01/09 00:27:54 imp Exp $"); + +#include +#include +#include +#include +#include +#if __DARWIN_UNIX03 +#include +#endif /* __DARWIN_UNIX03 */ +/* + * Backwards compatible nice. + */ +int +nice(incr) + int incr; +{ + int prio, rv; + + errno = 0; + prio = getpriority(PRIO_PROCESS, 0); + if (prio == -1 && errno) + return (-1); +#if __DARWIN_UNIX03 + if (prio + incr > NZERO-1) + incr = NZERO-1-prio; +#endif /* __DARWIN_UNIX03 */ + rv = setpriority(PRIO_PROCESS, 0, prio + incr); + if (rv == -1 && errno == EACCES) + errno = EPERM; + return (rv == -1) ? rv : getpriority(PRIO_PROCESS, 0); +} diff --git a/gen/FreeBSD/nrand48.c b/gen/FreeBSD/nrand48.c new file mode 100644 index 0000000..1790b23 --- /dev/null +++ b/gen/FreeBSD/nrand48.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/nrand48.c,v 1.2 2002/03/22 21:52:05 obrien Exp $"); + +#include "rand48.h" + +long +nrand48(unsigned short xseed[3]) +{ + uint48 tmp; + DORAND48(tmp, xseed); + return (tmp >> 17) & 0x7fffffff; +} diff --git a/gen/FreeBSD/opendir.c b/gen/FreeBSD/opendir.c new file mode 100644 index 0000000..c681be0 --- /dev/null +++ b/gen/FreeBSD/opendir.c @@ -0,0 +1,428 @@ +/*- + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)opendir.c 8.8 (Berkeley) 5/1/95"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "telldir.h" + +static bool +__kernel_supports_unionfs(void) +{ + static int8_t kernel_supports_unionfs = -1; + if (kernel_supports_unionfs == -1) { + int value = 0; + size_t len = sizeof(value); + sysctlbyname("kern.secure_kernel", &value, &len, NULL, 0); + kernel_supports_unionfs = !value; + } + return kernel_supports_unionfs; +} + +static int +__fd_is_on_union_mount(int fd) +{ + struct statfs stbuf; + int rc; + + rc = fstatfs(fd, &stbuf); + if (rc < 0) { + return rc; + } + return (stbuf.f_flags & MNT_UNION) != 0; +} + +static DIR * __opendir_common(int, int, bool); + +/* + * Open a directory. + */ +DIR * +opendir(const char *name) +{ + + return (__opendir2(name, DTF_HIDEW|DTF_NODUP)); +} + +/* + * Open a directory with existing file descriptor. + */ +DIR * +fdopendir(int fd) +{ + struct stat statb; + + /* Check that fd is associated with a directory. */ + if (_fstat(fd, &statb) != 0) + return (NULL); + if (!S_ISDIR(statb.st_mode)) { + errno = ENOTDIR; + return (NULL); + } + /* Make sure CLOEXEC is set on the fd */ + if (_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) + return (NULL); + return (__opendir_common(fd, DTF_HIDEW|DTF_NODUP, true)); +} + +DIR * +__opendir2(const char *name, int flags) +{ + int fd; + DIR *dir; + int saved_errno; + + if ((flags & (__DTF_READALL | __DTF_SKIPREAD)) != 0) + return (NULL); + if ((fd = _open(name, + O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC)) == -1) + return (NULL); + + dir = __opendir_common(fd, flags, false); + if (dir == NULL) { + saved_errno = errno; + _close(fd); + errno = saved_errno; + } + return (dir); +} + +static int +opendir_compar(const void *p1, const void *p2) +{ + + return (strcmp((*(const struct dirent **)p1)->d_name, + (*(const struct dirent **)p2)->d_name)); +} + +#if defined(DARLING) && defined(VARIANT_LEGACY) +// not included in legacy variant for the same reason `_fixtelldir` isn't included +// in it: the noinode64 variant already has the same exact function defined, and keeping +// this one in the legacy variant causes duplicate symbol errors +extern bool _filldir(DIR *dirp, bool use_current_pos); +#else +/* + * For a directory at the top of a unionfs stack, the entire directory's + * contents are read and cached locally until the next call to rewinddir(). + * For the fdopendir() case, the initial seek position must be preserved. + * For rewinddir(), the full directory should always be re-read from the + * beginning. + * + * If an error occurs, the existing buffer and state of 'dirp' is left + * unchanged. + */ +bool +_filldir(DIR *dirp, bool use_current_pos) +{ + struct dirent **dpv; + char *buf, *ddptr, *ddeptr; + off_t pos; + int fd2, incr, len, n, saved_errno, space; + + len = 0; + space = 0; + buf = NULL; + ddptr = NULL; + + /* + * Use the system page size if that is a multiple of DIRBLKSIZ. + * Hopefully this can be a big win someday by allowing page + * trades to user space to be done by _getdirentries(). + */ + incr = getpagesize(); + if ((incr % DIRBLKSIZ) != 0) + incr = DIRBLKSIZ; + + /* + * The strategy here is to read all the directory + * entries into a buffer, sort the buffer, and + * remove duplicate entries by setting the inode + * number to zero. + * + * We reopen the directory because _getdirentries() + * on a MNT_UNION mount modifies the open directory, + * making it refer to the lower directory after the + * upper directory's entries are exhausted. + * This would otherwise break software that uses + * the directory descriptor for fchdir or *at + * functions, such as fts.c. + */ + if ((fd2 = openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1) + return (false); + + if (use_current_pos) { + pos = lseek(dirp->dd_fd, 0, SEEK_CUR); + if (pos == -1 || lseek(fd2, pos, SEEK_SET) == -1) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + } + + do { + /* + * Always make at least DIRBLKSIZ bytes + * available to _getdirentries + */ + if (space < DIRBLKSIZ) { + space += incr; + len += incr; + buf = reallocf(buf, len); + if (buf == NULL) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + ddptr = buf + (len - space); + } + +#if __DARWIN_64_BIT_INO_T + n = (int)__getdirentries64(fd2, ddptr, space, &dirp->dd_td->seekoff); +#else /* !__DARWIN_64_BIT_INO_T */ + n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); +#endif /* __DARWIN_64_BIT_INO_T */ + if (n > 0) { + ddptr += n; + space -= n; + } + if (n < 0) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + } while (n > 0); + _close(fd2); + + ddeptr = ddptr; + + /* + * There is now a buffer full of (possibly) duplicate + * names. + */ + dirp->dd_buf = buf; + + /* + * Go round this loop twice... + * + * Scan through the buffer, counting entries. + * On the second pass, save pointers to each one. + * Then sort the pointers and remove duplicate names. + */ + for (dpv = NULL;;) { + n = 0; + ddptr = buf; + while (ddptr < ddeptr) { + struct dirent *dp; + + dp = (struct dirent *) ddptr; + if ((long)dp & 03L) + break; + if ((dp->d_reclen <= 0) || + (dp->d_reclen > (ddeptr + 1 - ddptr))) + break; + ddptr += dp->d_reclen; + if (dp->d_fileno) { + if (dpv) + dpv[n] = dp; + n++; + } + } + + if (dpv) { + struct dirent *xp; + + /* + * This sort must be stable. + */ + mergesort(dpv, n, sizeof(*dpv), opendir_compar); + + dpv[n] = NULL; + xp = NULL; + + /* + * Scan through the buffer in sort order, + * zapping the inode number of any + * duplicate names. + */ + for (n = 0; dpv[n]; n++) { + struct dirent *dp = dpv[n]; + + if ((xp == NULL) || + strcmp(dp->d_name, xp->d_name)) { + xp = dp; + } else { + dp->d_fileno = 0; + } + if (dp->d_type == DT_WHT && + (dirp->dd_flags & DTF_HIDEW)) + dp->d_fileno = 0; + } + + free(dpv); + break; + } else { + dpv = malloc((n+1) * sizeof(struct dirent *)); + if (dpv == NULL) + break; + } + } + + dirp->dd_len = len; + dirp->dd_size = ddptr - dirp->dd_buf; + return (true); +} +#endif + + +/* + * Common routine for opendir(3), __opendir2(3) and fdopendir(3). + */ +static DIR * +__opendir_common(int fd, int flags, bool use_current_pos) +{ + DIR *dirp; + int saved_errno; + int unionstack; + + if ((dirp = malloc(sizeof(DIR) + sizeof(struct _telldir))) == NULL) + return (NULL); + + dirp->dd_buf = NULL; + dirp->dd_fd = fd; + dirp->dd_flags = flags; + dirp->dd_loc = 0; + dirp->dd_lock = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER; + dirp->dd_td = (struct _telldir *)((char *)dirp + sizeof(DIR)); + LIST_INIT(&dirp->dd_td->td_locq); + dirp->dd_td->td_loccnt = 0; + + /* + * Determine whether this directory is the top of a union stack. + */ + if ((flags & DTF_NODUP) && __kernel_supports_unionfs()) { + unionstack = __fd_is_on_union_mount(fd); + if (unionstack < 0) + goto fail; + } else { + unionstack = 0; + } + + if (unionstack) { + if (!_filldir(dirp, use_current_pos)) + goto fail; + dirp->dd_flags |= __DTF_READALL; + } else { + /* + * Start with a small-ish size to avoid allocating full pages. + * readdir() will allocate a larger buffer if it didn't fit + * to stay fast for large directories. + */ + _Static_assert(GETDIRENTRIES64_EXTENDED_BUFSIZE <= READDIR_INITIAL_SIZE, + "Make sure we'll get extended metadata"); + dirp->dd_len = READDIR_INITIAL_SIZE; + dirp->dd_buf = malloc(dirp->dd_len); + if (dirp->dd_buf == NULL) + goto fail; + if (use_current_pos) { + /* + * Read the first batch of directory entries + * to prime dd_seek. This also checks if the + * fd passed to fdopendir() is a directory. + */ +#if __DARWIN_64_BIT_INO_T + /* + * sufficiently recent kernels when the buffer is large enough, + * will use the last bytes of the buffer to return status. + * + * To support older kernels: + * - make sure it's 0 initialized + * - make sure it's past `dd_size` before reading it + */ + getdirentries64_flags_t *gdeflags = + (getdirentries64_flags_t *)(dirp->dd_buf + dirp->dd_len - + sizeof(getdirentries64_flags_t)); + *gdeflags = 0; + dirp->dd_size = (long)__getdirentries64(dirp->dd_fd, + dirp->dd_buf, dirp->dd_len, &dirp->dd_td->seekoff); + if (dirp->dd_size >= 0 && + dirp->dd_size <= dirp->dd_len - sizeof(getdirentries64_flags_t)) { + if (*gdeflags & GETDIRENTRIES64_EOF) { + dirp->dd_flags |= __DTF_ATEND; + } + } +#else /* !__DARWIN_64_BIT_INO_T */ + dirp->dd_size = _getdirentries(dirp->dd_fd, + dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); +#endif /* __DARWIN_64_BIT_INO_T */ + if (dirp->dd_size < 0) { + if (errno == EINVAL) + errno = ENOTDIR; + goto fail; + } + dirp->dd_flags |= __DTF_SKIPREAD; + } else { + dirp->dd_size = 0; +#if __DARWIN_64_BIT_INO_T + dirp->dd_td->seekoff = 0; +#else /* !__DARWIN_64_BIT_INO_T */ + dirp->dd_seek = 0; +#endif /* __DARWIN_64_BIT_INO_T */ + } + } + + return (dirp); + +fail: + saved_errno = errno; + free(dirp->dd_buf); + free(dirp); + errno = saved_errno; + return (NULL); +} diff --git a/gen/FreeBSD/pause.3 b/gen/FreeBSD/pause.3 new file mode 100644 index 0000000..815995a --- /dev/null +++ b/gen/FreeBSD/pause.3 @@ -0,0 +1,81 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)pause.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/pause.3,v 1.9 2007/01/09 00:27:54 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt PAUSE 3 +.Os +.Sh NAME +.Nm pause +.Nd stop until signal +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn pause void +.Sh DESCRIPTION +.Sy Pause is made obsolete by +.Xr sigsuspend 2 . +.Pp +The +.Fn pause +function causes the calling thread to pause until a signal is received from +either the +.Xr kill 2 +function +or an interval timer. +(See +.Xr setitimer 2 . ) +Upon termination of a signal handler started during a +.Fn pause , +the +.Fn pause +call will return. +.Sh RETURN VALUES +Always returns \-1. +.Sh ERRORS +The +.Fn pause +function +always returns: +.Bl -tag -width Er +.It Bq Er EINTR +The call was interrupted. +.El +.Sh SEE ALSO +.Xr kill 2 , +.Xr select 2 , +.Xr sigsuspend 2 +.Sh HISTORY +A +.Fn pause +syscall +appeared in +.At v6 . diff --git a/gen/FreeBSD/pause.c b/gen/FreeBSD/pause.c new file mode 100644 index 0000000..2cb962c --- /dev/null +++ b/gen/FreeBSD/pause.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(VARIANT_CANCELABLE) && __DARWIN_NON_CANCELABLE != 0 +#error cancellable call vs. __DARWIN_NON_CANCELABLE mismatch +#endif + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)pause.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/pause.c,v 1.8 2009/12/05 19:31:38 ed Exp $"); + +#include +#include + +/* + * Backwards compatible pause. + */ +int +__pause(void) +{ + sigset_t set; + + sigprocmask(0, NULL, &set); + return sigsuspend(&set); +} +__weak_reference(__pause, pause); +__weak_reference(__pause, _pause); diff --git a/gen/FreeBSD/popen.3 b/gen/FreeBSD/popen.3 new file mode 100644 index 0000000..5f4a8c6 --- /dev/null +++ b/gen/FreeBSD/popen.3 @@ -0,0 +1,205 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)popen.3 8.2 (Berkeley) 5/3/95 +.\" $FreeBSD: src/lib/libc/gen/popen.3,v 1.16 2003/06/08 10:01:51 charnier Exp $ +.\" +.Dd May 3, 1995 +.Dt POPEN 3 +.Os +.Sh NAME +.Nm pclose , +.Nm popen +.Nd process +.Tn I/O +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft FILE * +.Fo popen +.Fa "const char *command" +.Fa "const char *mode" +.Fc +.Ft int +.Fo pclose +.Fa "FILE *stream" +.Fc +.Sh DESCRIPTION +The +.Fn popen +function +.Dq opens +a process by creating a bidirectional pipe, forking, +and invoking the shell. +Any streams opened by previous +.Fn popen +calls in the parent process are closed in the new child process. +Historically, +.Fn popen +was implemented with a unidirectional pipe; +hence, many implementations of +.Fn popen +only allow the +.Fa mode +argument to specify reading or writing, not both. +Because +.Fn popen +is now implemented using a bidirectional pipe, the +.Fa mode +argument may request a bidirectional data flow. +The +.Fa mode +argument is a pointer to a null-terminated string +which must be +.Ql r +for reading, +.Ql w +for writing, or +.Ql r+ +for reading and writing. +.Pp +The +.Fa command +argument is a pointer to a null-terminated string +containing a shell command line. +This command is passed to +.Pa /bin/sh , +using the +.Fl c +flag; interpretation, if any, is performed by the shell. +.Pp +The return value from +.Fn popen +is a normal standard +.Tn I/O +stream in all respects, +save that it must be closed with +.Fn pclose +rather than +.Fn fclose . +Writing to such a stream +writes to the standard input of the command; +the command's standard output is the same as that of the process that called +.Fn popen , +unless this is altered by the command itself. +Conversely, reading from a +.Dq popened +stream reads the command's standard output, and +the command's standard input is the same as that of the process that called +.Fn popen . +.Pp +Note that output +.Fn popen +streams are fully buffered, by default. +.Pp +The +.Fn pclose +function waits for the associated process to terminate; +it returns the exit status of the command, +as returned by +.Xr wait4 2 . +.Sh RETURN VALUES +The +.Fn popen +function returns +.Dv NULL +if the +.Xr fork 2 +or +.Xr pipe 2 +calls fail, +or if it cannot allocate memory. +.Pp +The +.Fn pclose +function +returns \-1 if +.Fa stream +is not associated with a +.Dq popened +command, if +.Fa stream +already +.Dq pclosed , +or if +.Xr wait4 2 +returns an error. +.Sh ERRORS +The +.Fn popen +function does not reliably set +.Va errno . +.Sh SEE ALSO +.Xr sh 1 , +.Xr fork 2 , +.Xr pipe 2 , +.Xr wait4 2 , +.Xr fclose 3 , +.Xr fflush 3 , +.Xr fopen 3 , +.Xr stdio 3 , +.Xr system 3 +.Sh BUGS +Since the standard input of a command opened for reading +shares its seek offset with the process that called +.Fn popen , +if the original process has done a buffered read, +the command's input position may not be as expected. +Similarly, the output from a command opened for writing +may become intermingled with that of the original process. +The latter can be avoided by calling +.Xr fflush 3 +before +.Fn popen . +.Pp +Failure to execute the shell +is indistinguishable from the shell's failure to execute command, +or an immediate exit of the command. +The only hint is an exit status of 127. +.Pp +The +.Fn popen +function +always calls +.Xr sh 1 , +never calls +.Xr csh 1 . +.Sh HISTORY +A +.Fn popen +and a +.Fn pclose +function appeared in +.At v7 . +.Pp +Bidirectional functionality was added in +.Fx 2.2.6 . diff --git a/gen/FreeBSD/popen.c b/gen/FreeBSD/popen.c new file mode 100644 index 0000000..d4aea86 --- /dev/null +++ b/gen/FreeBSD/popen.c @@ -0,0 +1,262 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software written by Ken Arnold and + * published in UNIX Review, Vol. 6, No. 8. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifdef VARIANT_DARWINEXTSN +#define _DARWIN_UNLIMITED_STREAMS +#endif /* VARIANT_DARWINEXTSN */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)popen.c 8.3 (Berkeley) 5/3/95"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/popen.c,v 1.21 2009/05/27 19:28:04 ed Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include /* fwide() */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +#include +#define environ (*_NSGetEnviron()) + +/* Our queue.h doesn't have SLIST_REMOVE_AFTER in it yet + * API: Add SLIST_REMOVE_AFTER to sys/queue.h (from FreeBSD) + */ +#ifndef SLIST_REMOVE_AFTER +#define SLIST_REMOVE_AFTER(elm, field) do { \ + SLIST_NEXT(elm, field) = \ + SLIST_NEXT(SLIST_NEXT(elm, field), field); \ +} while (0) +#endif + +/* 3516149 - store file descriptor and use that to close to prevent blocking */ +struct pid { + SLIST_ENTRY(pid) next; + FILE *fp; + int fd; + pid_t pid; +}; +#define pidlist __popen_pidlist +#define pidlist_mutex __popen_pidlist_mutex +#ifndef BUILDING_VARIANT +__private_extern__ SLIST_HEAD(, pid) pidlist = SLIST_HEAD_INITIALIZER(pidlist); +__private_extern__ pthread_mutex_t pidlist_mutex = PTHREAD_MUTEX_INITIALIZER; +#else /* BUILDING_VARIANT */ +extern SLIST_HEAD(, pid) pidlist; +extern pthread_mutex_t pidlist_mutex; +#endif /* !BUILDING_VARIANT */ + +#define THREAD_LOCK() if (__isthreaded) _pthread_mutex_lock(&pidlist_mutex) +#define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&pidlist_mutex) + +FILE * +popen(command, type) + const char *command, *type; +{ + struct pid *cur; + FILE *iop; + int pdes[2], pid, twoway, other; + char *argv[4]; + struct pid *p; + posix_spawn_file_actions_t file_actions; + int err; + + if (type == NULL) { + errno = EINVAL; + return (NULL); + } + if (strcmp(type, "r+") == 0) { + twoway = 1; + type = "r+"; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, pdes) < 0) + return (NULL); + } else { + twoway = 0; + if ((*type != 'r' && *type != 'w') || type[1]) { + errno = EINVAL; + return (NULL); + } + if (pipe(pdes) < 0) + return (NULL); + } + + /* fdopen can now fail */ + if (*type == 'r') { + iop = fdopen(pdes[0], type); + other = pdes[1]; + } else { + iop = fdopen(pdes[1], type); + other = pdes[0]; + } + if (iop == NULL) { + (void)_close(pdes[0]); + (void)_close(pdes[1]); + return (NULL); + } + + if ((cur = malloc(sizeof(struct pid))) == NULL) { + (void)fclose(iop); + (void)_close(other); + return (NULL); + } + + if ((err = posix_spawn_file_actions_init(&file_actions)) != 0) { + (void)fclose(iop); + (void)_close(other); + free(cur); + errno = err; + return (NULL); + } + if (*type == 'r') { + /* + * The dup2() to STDIN_FILENO is repeated to avoid + * writing to pdes[1], which might corrupt the + * parent's copy. This isn't good enough in + * general, since the _exit() is no return, so + * the compiler is free to corrupt all the local + * variables. + */ + (void)posix_spawn_file_actions_addclose(&file_actions, pdes[0]); + if (pdes[1] != STDOUT_FILENO) { + (void)posix_spawn_file_actions_adddup2(&file_actions, pdes[1], STDOUT_FILENO); + (void)posix_spawn_file_actions_addclose(&file_actions, pdes[1]); + if (twoway) + (void)posix_spawn_file_actions_adddup2(&file_actions, STDOUT_FILENO, STDIN_FILENO); + } else if (twoway && (pdes[1] != STDIN_FILENO)) + (void)posix_spawn_file_actions_adddup2(&file_actions, pdes[1], STDIN_FILENO); + } else { + if (pdes[0] != STDIN_FILENO) { + (void)posix_spawn_file_actions_adddup2(&file_actions, pdes[0], STDIN_FILENO); + (void)posix_spawn_file_actions_addclose(&file_actions, pdes[0]); + } + (void)posix_spawn_file_actions_addclose(&file_actions, pdes[1]); + } + SLIST_FOREACH(p, &pidlist, next) + (void)posix_spawn_file_actions_addclose(&file_actions, p->fd); + + argv[0] = "sh"; + argv[1] = "-c"; + argv[2] = (char *)command; + argv[3] = NULL; + + err = posix_spawn(&pid, _PATH_BSHELL, &file_actions, NULL, argv, environ); + posix_spawn_file_actions_destroy(&file_actions); + + if (err == ENOMEM || err == EAGAIN) { /* as if fork failed */ + (void)fclose(iop); + (void)_close(other); + free(cur); + errno = err; + return (NULL); + } else if (err != 0) { /* couldn't exec the shell */ + pid = -1; + } + + if (*type == 'r') { + cur->fd = pdes[0]; + (void)_close(pdes[1]); + } else { + cur->fd = pdes[1]; + (void)_close(pdes[0]); + } + + /* Link into list of file descriptors. */ + cur->fp = iop; + cur->pid = pid; + THREAD_LOCK(); + SLIST_INSERT_HEAD(&pidlist, cur, next); + THREAD_UNLOCK(); + fwide(iop, -1); /* byte stream */ + return (iop); +} + +#ifndef BUILDING_VARIANT +/* + * pclose -- + * Pclose returns -1 if stream is not associated with a `popened' command, + * if already `pclosed', or waitpid returns an error. + */ +int +pclose(iop) + FILE *iop; +{ + struct pid *cur, *last = NULL; + int pstat; + pid_t pid; + + /* + * Find the appropriate file pointer and remove it from the list. + */ + THREAD_LOCK(); + SLIST_FOREACH(cur, &pidlist, next) { + if (cur->fp == iop) + break; + last = cur; + } + if (cur == NULL) { + THREAD_UNLOCK(); + return (-1); + } + if (last == NULL) + SLIST_REMOVE_HEAD(&pidlist, next); + else + SLIST_REMOVE_AFTER(last, next); + THREAD_UNLOCK(); + + (void)fclose(iop); + + if (cur->pid < 0) { + free(cur); + return W_EXITCODE(127, 0); + } + do { + pid = _wait4(cur->pid, &pstat, 0, (struct rusage *)0); + } while (pid == -1 && errno == EINTR); + + free(cur); + + return (pid == -1 ? -1 : pstat); +} +#endif /* !BUILDING_VARIANT */ diff --git a/gen/FreeBSD/psignal.3 b/gen/FreeBSD/psignal.3 new file mode 100644 index 0000000..84976af --- /dev/null +++ b/gen/FreeBSD/psignal.3 @@ -0,0 +1,122 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)psignal.3 8.2 (Berkeley) 2/27/95 +.\" $FreeBSD: src/lib/libc/gen/psignal.3,v 1.17 2007/01/09 00:27:54 imp Exp $ +.\" +.Dd February 27, 1995 +.Dt PSIGNAL 3 +.Os +.Sh NAME +.Nm psignal , +.Nm strsignal , +.Nm sys_siglist , +.Nm sys_signame +.Nd system signal messages +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.Ft void +.Fn psignal "unsigned sig" "const char *s" +.Vt extern const char * const sys_siglist[] ; +.Vt extern const char * const sys_signame[] ; +.In string.h +.Ft "char *" +.Fn strsignal "int sig" +.Sh DESCRIPTION +The +.Fn psignal +and +.Fn strsignal +functions locate the descriptive message +string for a signal number. +.Pp +The +.Fn strsignal +function accepts a signal number argument +.Fa sig +and returns a pointer to the corresponding message string. +.Pp +The +.Fn psignal +function accepts a signal number argument +.Fa sig +and writes it to the standard error. +If the argument +.Fa s +is +.Pf non- Dv NULL +and does not point to the null character, +.Fa s +is written to the standard error file descriptor +prior to the message string, +immediately followed by a colon and a space. +If the signal number is not recognized +.Pq Xr sigaction 2 , +the string +.Dq "Unknown signal +is produced. +.Pp +The message strings can be accessed directly +through the external array +.Va sys_siglist , +indexed by recognized signal numbers. +The external array +.Va sys_signame +is used similarly and +contains short, lower-case abbreviations for signals +which are useful for recognizing signal names +in user input. +The defined variable +.Dv NSIG +contains a count of the strings in +.Va sys_siglist +and +.Va sys_signame . +.Sh RETURN VALUES +.Fn strsignal +a pointer to the desired message or a NULL value indicating an error. This +string is not to be freed by the caller. Beginning with Mac OSX 10.7, this +string is unique to each thread. +.Sh ERRORS +.Fn strsignal +will fail and no additional memory will be allocated if +one of the following are true: +.Bl -tag -width Er +.It Bq Er ENOMEM +There was insufficient memory to allocate storage space for the return value in the running thread. +.El +.Sh SEE ALSO +.Xr sigaction 2 , +.Xr perror 3 , +.Xr strerror 3 +.Sh HISTORY +The +.Fn psignal +function appeared in +.Bx 4.2 . diff --git a/gen/FreeBSD/psignal.c b/gen/FreeBSD/psignal.c new file mode 100644 index 0000000..8894b1b --- /dev/null +++ b/gen/FreeBSD/psignal.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)psignal.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/psignal.c,v 1.8 2007/01/09 00:27:54 imp Exp $"); + +/* + * Print the name of the signal indicated + * along with the supplied message. + */ +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" + +void +psignal(sig, s) + unsigned int sig; + const char *s; +{ + const char *c; + + if (sig < NSIG) + c = sys_siglist[sig]; + else + c = "Unknown signal"; + if (s != NULL && *s != '\0') { + (void)_write(STDERR_FILENO, s, strlen(s)); + (void)_write(STDERR_FILENO, ": ", 2); + } + (void)_write(STDERR_FILENO, c, strlen(c)); + (void)_write(STDERR_FILENO, "\n", 1); +} diff --git a/gen/FreeBSD/raise.3 b/gen/FreeBSD/raise.3 new file mode 100644 index 0000000..59649b2 --- /dev/null +++ b/gen/FreeBSD/raise.3 @@ -0,0 +1,74 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)raise.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd September 21, 2016 +.Dt RAISE 3 +.Os +.Sh NAME +.Nm raise +.Nd send a signal to the current thread +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.Ft int +.Fn raise "int sig" +.Sh DESCRIPTION +The +.Fn raise +function sends the signal +.Fa sig +to the current thread. +.Sh RETURN VALUES +.Rv -std raise +.Sh ERRORS +The +.Fn raise +function +may fail and set +.Va errno +for any of the errors specified for the +library functions +.Xr getpid 2 +and +.Xr pthread_kill 2 . +.Sh SEE ALSO +.Xr kill 2 , +.Xr pthread_kill 2 +.Sh STANDARDS +The +.Fn raise +function +conforms to +.St -isoC . diff --git a/gen/FreeBSD/rand48.3 b/gen/FreeBSD/rand48.3 new file mode 100644 index 0000000..6bc96d6 --- /dev/null +++ b/gen/FreeBSD/rand48.3 @@ -0,0 +1,201 @@ +.\" Copyright (c) 1993 Martin Birgmeier +.\" All rights reserved. +.\" +.\" You may redistribute unmodified or modified versions of this source +.\" code provided that the above copyright notice and this and the +.\" following conditions are retained. +.\" +.\" This software is provided ``as is'', and comes with no warranties +.\" of any kind. I shall in no event be liable for anything that happens +.\" to anyone/anything when using this software. +.\" +.\" @(#)rand48.3 V1.0 MB 8 Oct 1993 +.\" $FreeBSD: src/lib/libc/gen/rand48.3,v 1.17 2005/01/20 09:17:02 ru Exp $ +.\" +.Dd October 8, 1993 +.Dt RAND48 3 +.Os +.Sh NAME +.Nm drand48 , +.Nm erand48 , +.Nm jrand48 , +.Nm lcong48 , +.Nm lrand48 , +.Nm mrand48 , +.Nm nrand48 , +.Nm seed48 , +.Nm srand48 +.Nd pseudo random number generators and initialization routines +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft double +.Fo drand48 +.Fa void +.Fc +.Ft double +.Fo erand48 +.Fa "unsigned short xsubi[3]" +.Fc +.Ft long +.Fo jrand48 +.Fa "unsigned short xsubi[3]" +.Fc +.Ft void +.Fo lcong48 +.Fa "unsigned short param[7]" +.Fc +.Ft long +.Fo lrand48 +.Fa void +.Fc +.Ft long +.Fo mrand48 +.Fa void +.Fc +.Ft long +.Fo nrand48 +.Fa "unsigned short xsubi[3]" +.Fc +.Ft "unsigned short *" +.Fo seed48 +.Fa "unsigned short seed16v[3]" +.Fc +.Ft void +.Fo srand48 +.Fa "long seedval" +.Fc +.Sh DESCRIPTION +The +.Fn rand48 +family of functions generates pseudo-random numbers, using a linear +congruential algorithm working on integers 48 bits in size. +The +particular formula employed is +r(n+1) = (a * r(n) + c) mod m. +The default value for the multiplicand `a' is 0x5deece66d (25214903917). +The default value for the the addend `c' is 0xb (11). +The modulo is always fixed at m = 2 ** 48. +r(n) is called the seed of the random number generator. +.Pp +For the six generator routines described next, the first +computational step is to perform a single iteration of the algorithm. +.Pp +The +.Fn drand48 +and +.Fn erand48 +functions +return values of type double. +The full 48 bits of r(n+1) are +loaded into the mantissa of the returned value, with the exponent set +such that the values produced lie in the interval [0.0, 1.0). +.Pp +The +.Fn lrand48 +and +.Fn nrand48 +functions +return values of type long in the range +[0, 2**31-1]. +The high-order (31) bits of +r(n+1) are loaded into the lower bits of the returned value, with +the topmost (sign) bit set to zero. +.Pp +The +.Fn mrand48 +and +.Fn jrand48 +functions +return values of type long in the range +[-2**31, 2**31-1]. +The high-order (32) bits of +r(n+1) are loaded into the returned value. +.Pp +The +.Fn drand48 , +.Fn lrand48 , +and +.Fn mrand48 +functions +use an internal buffer to store r(n). +For these functions +the initial value of r(0) = 0x1234abcd330e = 20017429951246. +.Pp +On the other hand, +.Fn erand48 , +.Fn nrand48 , +and +.Fn jrand48 +use a user-supplied buffer to store the seed r(n), +which consists of an array of 3 shorts, where the zeroth member +holds the least significant bits. +.Pp +All functions share the same multiplicand and addend. +.Pp +The +.Fn srand48 +function +is used to initialize the internal buffer r(n) of +.Fn drand48 , +.Fn lrand48 , +and +.Fn mrand48 , +such that the 32 bits of the seed value are copied into the upper 32 bits +of r(n), with the lower 16 bits of r(n) arbitrarily being set to 0x330e. +Additionally, the constant multiplicand and addend of the algorithm are +reset to the default values given above. +.Pp +The +.Fn seed48 +function +also initializes the internal buffer r(n) of +.Fn drand48 , +.Fn lrand48 , +and +.Fn mrand48 , +but here all 48 bits of the seed can be specified in an array of 3 shorts, +where the zeroth member specifies the lowest bits. +Again, +the constant multiplicand and addend of the algorithm are +reset to the default values given above. +The +.Fn seed48 +function +returns a pointer to an array of 3 shorts which contains the old seed. +This array is statically allocated; thus, its contents are lost after +each new call to +.Fn seed48 . +.Pp +Finally, +.Fn lcong48 +allows full control over the multiplicand and addend used in +.Fn drand48 , +.Fn erand48 , +.Fn lrand48 , +.Fn nrand48 , +.Fn mrand48 , +and +.Fn jrand48 , +and the seed used in +.Fn drand48 , +.Fn lrand48 , +and +.Fn mrand48 . +An array of 7 shorts is passed as argument; the first three shorts are +used to initialize the seed; the second three are used to initialize the +multiplicand; and the last short is used to initialize the addend. +It is thus not possible to use values greater than 0xffff as the addend. +.Pp +Note that all three methods of seeding the random number generator +always also set the multiplicand and addend for any of the six +generator calls. +.Pp +For a more powerful random number generator, see +.Xr random 3 . +.Sh SEE ALSO +.Xr rand 3 , +.Xr random 3 +.Sh AUTHORS +.An Martin Birgmeier diff --git a/gen/FreeBSD/rand48.h b/gen/FreeBSD/rand48.h new file mode 100644 index 0000000..e799eba --- /dev/null +++ b/gen/FreeBSD/rand48.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + * + * $FreeBSD: src/lib/libc/gen/rand48.h,v 1.2 2002/02/01 01:32:19 obrien Exp $ + */ + +#ifndef _RAND48_H_ +#define _RAND48_H_ + +#include +#include + +#define RAND48_SEED_0 (0x330e) +#define RAND48_SEED_1 (0xabcd) +#define RAND48_SEED_2 (0x1234) +#define RAND48_MULT_0 (0xe66d) +#define RAND48_MULT_1 (0xdeec) +#define RAND48_MULT_2 (0x0005) +#define RAND48_ADD (0x000b) + +typedef unsigned long long uint48; + +extern uint48 _rand48_seed; +extern uint48 _rand48_mult; +extern uint48 _rand48_add; + +#define TOUINT48(x,y,z) \ + ((uint48)(x) + (((uint48)(y)) << 16) + (((uint48)(z)) << 32)) + +#define RAND48_SEED TOUINT48(RAND48_SEED_0, RAND48_SEED_1, RAND48_SEED_2) +#define RAND48_MULT TOUINT48(RAND48_MULT_0, RAND48_MULT_1, RAND48_MULT_2) + +#define LOADRAND48(l,x) \ + (l) = TOUINT48((x)[0], (x)[1], (x)[2]) + +#define STORERAND48(l,x) \ + (x)[0] = (unsigned short)(l); \ + (x)[1] = (unsigned short)((l) >> 16); \ + (x)[2] = (unsigned short)((l) >> 32) + +#define _DORAND48(l) \ + (l) = (l) * _rand48_mult + _rand48_add + +#define DORAND48(l,x) \ + LOADRAND48(l, x); \ + _DORAND48(l); \ + STORERAND48(l, x) + +#include "fpmath.h" + +/* + * Optimization for speed: avoid int-to-double conversion. Assume doubles + * are IEEE-754 and insert the bits directly. To normalize, the (1 << 52) + * is the hidden bit, which the first set bit is shifted to. + */ +#define ERAND48_BEGIN \ + union { \ + union IEEEd2bits ieee; \ + unsigned long long l; \ + } u; \ + int s + +#define ERAND48_END(x) \ + u.l = ((x) & 0xffffffffffffULL); \ + if (u.l == 0) \ + return 0.0; \ + u.l <<= 5; \ + for(s = 0; !(u.l & (1LL << 52)); s++, u.l <<= 1) {} \ + u.ieee.bits.exp = 1022 - s; \ + return u.ieee.d + +#endif /* _RAND48_H_ */ diff --git a/gen/FreeBSD/readdir.c b/gen/FreeBSD/readdir.c new file mode 100644 index 0000000..c78c6bf --- /dev/null +++ b/gen/FreeBSD/readdir.c @@ -0,0 +1,174 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)readdir.c 8.3 (Berkeley) 9/29/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" +#include "telldir.h" + +/* + * get next entry in a directory. + */ +struct dirent * +_readdir_unlocked(DIR *dirp, int skip) +{ + struct dirent *dp; + long initial_seek; + long initial_loc = 0; + + for (;;) { + if (dirp->dd_loc >= dirp->dd_size) { + if (dirp->dd_flags & (__DTF_READALL | __DTF_ATEND)) + return (NULL); + initial_loc = dirp->dd_loc; + dirp->dd_flags &= ~__DTF_SKIPREAD; + dirp->dd_loc = 0; + } + if (dirp->dd_loc == 0 && + !(dirp->dd_flags & (__DTF_READALL | __DTF_ATEND | __DTF_SKIPREAD))) { + if (dirp->dd_len == READDIR_INITIAL_SIZE) { + /* + * If we need to read more, and we still have the original size, + * then grow the internal buffer to a large size to amortize + * the cost of __getdirentries64 calls. + */ + int len = READDIR_LARGE_SIZE; + char *buf = malloc(len); + if (buf) { + free(dirp->dd_buf); + dirp->dd_buf = buf; + dirp->dd_len = len; + } + } +#if __DARWIN_64_BIT_INO_T + /* + * sufficiently recent kernels when the buffer is large enough, + * will use the last bytes of the buffer to return status. + * + * To support older kernels: + * - make sure it's 0 initialized + * - make sure it's past `dd_size` before reading it + */ + getdirentries64_flags_t *gdeflags = + (getdirentries64_flags_t *)(dirp->dd_buf + dirp->dd_len - + sizeof(getdirentries64_flags_t)); + *gdeflags = 0; + initial_seek = dirp->dd_td->seekoff; + dirp->dd_size = (long)__getdirentries64(dirp->dd_fd, + dirp->dd_buf, dirp->dd_len, &dirp->dd_td->seekoff); + if (dirp->dd_size >= 0 && + dirp->dd_size <= dirp->dd_len - sizeof(getdirentries64_flags_t)) { + if (*gdeflags & GETDIRENTRIES64_EOF) { + dirp->dd_flags |= __DTF_ATEND; + } + } +#else /* !__DARWIN_64_BIT_INO_T */ + initial_seek = dirp->dd_seek; + dirp->dd_size = _getdirentries(dirp->dd_fd, + dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); +#endif /* __DARWIN_64_BIT_INO_T */ + if (dirp->dd_size <= 0) + return (NULL); + _fixtelldir(dirp, initial_seek, initial_loc); + } + dirp->dd_flags &= ~__DTF_SKIPREAD; + dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); + if ((long)dp & 03L) /* bogus pointer check */ + return (NULL); + if (dp->d_reclen <= 0 || + dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc) + return (NULL); + dirp->dd_loc += dp->d_reclen; + if (dp->d_ino == 0 && skip) + continue; + if (dp->d_type == DT_WHT && (dirp->dd_flags & DTF_HIDEW)) + continue; + return (dp); + } +} + +struct dirent * +readdir(DIR *dirp) +{ + struct dirent *dp; + + if (__isthreaded) { + _pthread_mutex_lock(&dirp->dd_lock); + dp = _readdir_unlocked(dirp, 1); + _pthread_mutex_unlock(&dirp->dd_lock); + } + else + dp = _readdir_unlocked(dirp, 1); + return (dp); +} + +int +readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) +{ + struct dirent *dp; + int saved_errno; + + saved_errno = errno; + errno = 0; + if (__isthreaded) { + _pthread_mutex_lock(&dirp->dd_lock); + if ((dp = _readdir_unlocked(dirp, 1)) != NULL) + memcpy(entry, dp, _GENERIC_DIRSIZ(dp)); + _pthread_mutex_unlock(&dirp->dd_lock); + } + else if ((dp = _readdir_unlocked(dirp, 1)) != NULL) + memcpy(entry, dp, _GENERIC_DIRSIZ(dp)); + + if (errno != 0) { + if (dp == NULL) + return (errno); + } else + errno = saved_errno; + + if (dp != NULL) + *result = entry; + else + *result = NULL; + + return (0); +} diff --git a/gen/FreeBSD/readpassphrase.3 b/gen/FreeBSD/readpassphrase.3 new file mode 100644 index 0000000..9f74b2f --- /dev/null +++ b/gen/FreeBSD/readpassphrase.3 @@ -0,0 +1,183 @@ +.\" $OpenBSD: readpassphrase.3,v 1.17 2007/05/31 19:19:28 jmc Exp $ +.\" +.\" Copyright (c) 2000, 2002 Todd C. Miller +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" Sponsored in part by the Defense Advanced Research Projects +.\" Agency (DARPA) and Air Force Research Laboratory, Air Force +.\" Materiel Command, USAF, under agreement number F39502-99-1-0512. +.\" +.\" $FreeBSD$ +.\" +.Dd May 31, 2007 +.Dt READPASSPHRASE 3 +.Os +.Sh NAME +.Nm readpassphrase +.Nd get a passphrase from the user +.Sh SYNOPSIS +.In readpassphrase.h +.Ft "char *" +.Fn readpassphrase "const char *prompt" "char *buf" "size_t bufsiz" "int flags" +.Sh DESCRIPTION +The +.Fn readpassphrase +function displays a prompt to, and reads in a passphrase from, +.Pa /dev/tty . +If this file is inaccessible +and the +.Dv RPP_REQUIRE_TTY +flag is not set, +.Fn readpassphrase +displays the prompt on the standard error output and reads from the standard +input. +In this case it is generally not possible to turn off echo. +.Pp +Up to +.Fa bufsiz +\- 1 characters (one is for the +.Dv NUL ) +are read into the provided buffer +.Fa buf . +Any additional +characters and the terminating newline (or return) character are discarded. +.Pp +The +.Fn readpassphrase +function +takes the following optional +.Fa flags : +.Pp +.Bl -tag -width ".Dv RPP_REQUIRE_TTY" -compact +.It Dv RPP_ECHO_OFF +turn off echo (default behavior) +.It Dv RPP_ECHO_ON +leave echo on +.It Dv RPP_REQUIRE_TTY +fail if there is no tty +.It Dv RPP_FORCELOWER +force input to lower case +.It Dv RPP_FORCEUPPER +force input to upper case +.It Dv RPP_SEVENBIT +strip the high bit from input +.It Dv RPP_STDIN +force read of passphrase from stdin +.El +.Pp +The calling process should zero the passphrase as soon as possible to +avoid leaving the cleartext passphrase visible in the process's address +space. +.Sh RETURN VALUES +Upon successful completion, +.Fn readpassphrase +returns a pointer to the NUL-terminated passphrase. +If an error is encountered, the terminal state is restored and +a +.Dv NULL +pointer is returned. +.Sh FILES +.Bl -tag -width ".Pa /dev/tty" -compact +.It Pa /dev/tty +.El +.Sh EXAMPLES +The following code fragment will read a passphrase from +.Pa /dev/tty +into the buffer +.Fa passbuf . +.Bd -literal -offset indent +char passbuf[1024]; + +\&... + +if (readpassphrase("Response: ", passbuf, sizeof(passbuf), + RPP_REQUIRE_TTY) == NULL) + errx(1, "unable to read passphrase"); + +if (compare(transform(passbuf), epass) != 0) + errx(1, "bad passphrase"); + +\&... + +memset(passbuf, 0, sizeof(passbuf)); +.Ed +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINTR +The +.Fn readpassphrase +function was interrupted by a signal. +.It Bq Er EINVAL +The +.Ar bufsiz +argument was zero. +.It Bq Er EIO +The process is a member of a background process attempting to read +from its controlling terminal, the process is ignoring or blocking +the +.Dv SIGTTIN +signal, or the process group is orphaned. +.It Bq Er EMFILE +The process has already reached its limit for open file descriptors. +.It Bq Er ENFILE +The system file table is full. +.It Bq Er ENOTTY +There is no controlling terminal and the +.Dv RPP_REQUIRE_TTY +flag was specified. +.El +.Sh SIGNALS +The +.Fn readpassphrase +function +will catch the following signals: +.Bd -literal -offset indent +SIGALRM SIGHUP SIGINT +SIGPIPE SIGQUIT SIGTERM +SIGTSTP SIGTTIN SIGTTOU +.Ed +.Pp +When one of the above signals is intercepted, terminal echo will +be restored if it had previously been turned off. +If a signal handler was installed for the signal when +.Fn readpassphrase +was called, that handler is then executed. +If no handler was previously installed for the signal then the +default action is taken as per +.Xr sigaction 2 . +.Pp +The +.Dv SIGTSTP , SIGTTIN +and +.Dv SIGTTOU +signals (stop signals generated from keyboard or due to terminal I/O +from a background process) are treated specially. +When the process is resumed after it has been stopped, +.Fn readpassphrase +will reprint the prompt and the user may then enter a passphrase. +.Sh SEE ALSO +.Xr sigaction 2 , +.Xr getpass 3 +.Sh STANDARDS +The +.Fn readpassphrase +function is an +extension and should not be used if portability is desired. +.Sh HISTORY +The +.Fn readpassphrase +function first appeared in +.Ox 2.9 . +.Dv RPP_STDIN +was introduced in OS X 10.12. diff --git a/gen/FreeBSD/readpassphrase.c b/gen/FreeBSD/readpassphrase.c new file mode 100644 index 0000000..646a8c6 --- /dev/null +++ b/gen/FreeBSD/readpassphrase.c @@ -0,0 +1,213 @@ +/* $OpenBSD: readpassphrase.c,v 1.24 2013/11/24 23:51:29 deraadt Exp $ */ + +/* + * Copyright (c) 2000-2002, 2007, 2010 + * Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ + +#include + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +static volatile int signo[NSIG]; + +static void handler(int); + +char * +readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) +{ + ssize_t nr; + int input, output, save_errno, i, need_restart, input_is_tty; + char ch, *p, *end; + struct termios term, oterm; + struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; + struct sigaction savetstp, savettin, savettou, savepipe; + locale_t loc = __current_locale(); + + /* I suppose we could alloc on demand in this case (XXX). */ + if (bufsiz == 0) { + errno = EINVAL; + return(NULL); + } + +restart: + for (i = 0; i < NSIG; i++) + signo[i] = 0; + nr = -1; + save_errno = 0; + need_restart = 0; + /* + * Read and write to /dev/tty if available. If not, read from + * stdin and write to stderr unless a tty is required. + */ + input_is_tty = 0; + if (!(flags & RPP_STDIN)) { + input = output = _open(_PATH_TTY, O_RDWR | O_CLOEXEC); + if (input == -1) { + if (flags & RPP_REQUIRE_TTY) { + errno = ENOTTY; + return(NULL); + } + input = STDIN_FILENO; + output = STDERR_FILENO; + } else { + input_is_tty = 1; + } + } else { + input = STDIN_FILENO; + output = STDERR_FILENO; + } + + /* + * Turn off echo if possible. + * If we are using a tty but are not the foreground pgrp this will + * generate SIGTTOU, so do it *before* installing the signal handlers. + */ + if (input_is_tty && tcgetattr(input, &oterm) == 0) { + memcpy(&term, &oterm, sizeof(term)); + if (!(flags & RPP_ECHO_ON)) + term.c_lflag &= ~(ECHO | ECHONL); + if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) + term.c_cc[VSTATUS] = _POSIX_VDISABLE; + (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); + } else { + memset(&term, 0, sizeof(term)); + term.c_lflag |= ECHO; + memset(&oterm, 0, sizeof(oterm)); + oterm.c_lflag |= ECHO; + } + + /* + * Catch signals that would otherwise cause the user to end + * up with echo turned off in the shell. Don't worry about + * things like SIGXCPU and SIGVTALRM for now. + */ + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; /* don't restart system calls */ + sa.sa_handler = handler; + (void)_sigaction(SIGALRM, &sa, &savealrm); + (void)_sigaction(SIGHUP, &sa, &savehup); + (void)_sigaction(SIGINT, &sa, &saveint); + (void)_sigaction(SIGPIPE, &sa, &savepipe); + (void)_sigaction(SIGQUIT, &sa, &savequit); + (void)_sigaction(SIGTERM, &sa, &saveterm); + (void)_sigaction(SIGTSTP, &sa, &savetstp); + (void)_sigaction(SIGTTIN, &sa, &savettin); + (void)_sigaction(SIGTTOU, &sa, &savettou); + + if (!(flags & RPP_STDIN)) + (void)_write(output, prompt, strlen(prompt)); + end = buf + bufsiz - 1; + p = buf; + while ((nr = _read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') { + if (p < end) { + if ((flags & RPP_SEVENBIT)) + ch &= 0x7f; + if (isalpha_l(ch, loc)) { + if ((flags & RPP_FORCELOWER)) + ch = (char)tolower_l(ch, loc); + if ((flags & RPP_FORCEUPPER)) + ch = (char)toupper_l(ch, loc); + } + *p++ = ch; + } + } + *p = '\0'; + save_errno = errno; + if (!(term.c_lflag & ECHO)) + (void)_write(output, "\n", 1); + + /* Restore old terminal settings and signals. */ + if (memcmp(&term, &oterm, sizeof(term)) != 0) { + while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 && + errno == EINTR && !signo[SIGTTOU]) + continue; + } + (void)_sigaction(SIGALRM, &savealrm, NULL); + (void)_sigaction(SIGHUP, &savehup, NULL); + (void)_sigaction(SIGINT, &saveint, NULL); + (void)_sigaction(SIGQUIT, &savequit, NULL); + (void)_sigaction(SIGPIPE, &savepipe, NULL); + (void)_sigaction(SIGTERM, &saveterm, NULL); + (void)_sigaction(SIGTSTP, &savetstp, NULL); + (void)_sigaction(SIGTTIN, &savettin, NULL); + (void)_sigaction(SIGTTOU, &savettou, NULL); + if (input_is_tty) + (void)_close(input); + + /* + * If we were interrupted by a signal, resend it to ourselves + * now that we have restored the signal handlers. + */ + for (i = 0; i < NSIG; i++) { + if (signo[i]) { + kill(getpid(), i); + switch (i) { + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: + need_restart = 1; + } + } + } + if (need_restart) + goto restart; + + if (save_errno) + errno = save_errno; + return(nr == -1 ? NULL : buf); +} + +char * +getpass(const char *prompt) +{ + const size_t bufsiz = _PASSWORD_LEN + 1; + static char *buf = NULL; + + if (buf == NULL) { + buf = malloc(bufsiz); + if (buf == NULL) { + return NULL; + } + } + + if (readpassphrase(prompt, buf, bufsiz, RPP_ECHO_OFF) == NULL) { + buf[0] = '\0'; + } + return buf; +} + +static void handler(int s) +{ + signo[s] = 1; +} diff --git a/gen/FreeBSD/rewinddir.c b/gen/FreeBSD/rewinddir.c new file mode 100644 index 0000000..66deadc --- /dev/null +++ b/gen/FreeBSD/rewinddir.c @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rewinddir.c 8.1 (Berkeley) 6/8/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" +#include "telldir.h" + +void +rewinddir(DIR *dirp) +{ + + if (__isthreaded) + _pthread_mutex_lock(&dirp->dd_lock); + dirp->dd_flags &= ~(__DTF_SKIPREAD | __DTF_ATEND); /* current contents are invalid */ + if (dirp->dd_flags & __DTF_READALL) + _filldir(dirp, false); + else { + (void) lseek(dirp->dd_fd, 0, SEEK_SET); +#if __DARWIN_64_BIT_INO_T + dirp->dd_td->seekoff = 0; +#else /* !__DARWIN_64_BIT_INO_T */ + dirp->dd_seek = 0; +#endif /* __DARWIN_64_BIT_INO_T */ + } + dirp->dd_loc = 0; + _reclaim_telldir(dirp); + if (__isthreaded) + _pthread_mutex_unlock(&dirp->dd_lock); +} diff --git a/gen/FreeBSD/scandir.3 b/gen/FreeBSD/scandir.3 new file mode 100644 index 0000000..f09b094 --- /dev/null +++ b/gen/FreeBSD/scandir.3 @@ -0,0 +1,128 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)scandir.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/scandir.3,v 1.9 2007/01/09 00:27:55 imp Exp $ +.\" +.Dd May 20, 2008 +.Dt SCANDIR 3 +.Os +.Sh NAME +.Nm scandir , +#ifdef UNIFDEF_BLOCKS +.Nm scandir_b , +#endif +.Nm alphasort +.Nd scan a directory +.Sh SYNOPSIS +.In sys/types.h +.In dirent.h +.Ft int +.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \\*(lp*select\\*(rp\\*(lpconst struct dirent *\\*(rp" "int \\*(lp*compar\\*(rp\\*(lpconst struct dirent **, const struct dirent **\\*(rp" +.Ft int +.Fn alphasort "const struct dirent **d1" "const struct dirent **d2" +#ifdef UNIFDEF_BLOCKS +.Ft int +.Fn scandir_b "const char *dirname" "struct dirent ***namelist" "int \\*(lp^select\\*(rp\\*(lpconst struct dirent *\\*(rp" "int \\*(lp^compar\\*(rp\\*(lpconst struct dirent **, const struct dirent **\\*(rp" +#endif +.Sh DESCRIPTION +The +.Fn scandir +function +reads the directory +.Fa dirname +and builds an array of pointers to directory +entries using +.Xr malloc 3 . +It returns the number of entries in the array. +A pointer to the array of directory entries is stored in the location +referenced by +.Fa namelist +(even if the number of entries is 0). +.Pp +The +.Fa select +argument is a pointer to a user supplied subroutine which is called by +.Fn scandir +to select which entries are to be included in the array. +The select routine is passed a +pointer to a directory entry and should return a non-zero +value if the directory entry is to be included in the array. +If +.Fa select +is null, then all the directory entries will be included. +.Pp +The +.Fa compar +argument is a pointer to a user supplied subroutine which is passed to +.Xr qsort 3 +to sort the completed array. +If this pointer is null, the array is not sorted. +.Pp +The +.Fn alphasort +function +is a routine which can be used for the +.Fa compar +argument to sort the array alphabetically. +.Pp +The memory allocated for the array can be deallocated with +.Xr free 3 , +by freeing each pointer in the array and then the array itself. +#ifdef UNIFDEF_BLOCKS +.Pp +The +.Fn scandir_b +function works the same way as the +.Fn scandir +function, except that +.Fa select +and +.Fa compar +are blocks instead of subroutines. +#endif +.Sh DIAGNOSTICS +Returns \-1 if the directory cannot be opened for reading or if +.Xr malloc 3 +cannot allocate enough memory to hold all the data structures. +.Sh SEE ALSO +.Xr directory 3 , +.Xr malloc 3 , +.Xr qsort 3 , +.Xr dir 5 +.Sh HISTORY +The +.Fn scandir +and +.Fn alphasort +functions appeared in +.Bx 4.2 . +#ifdef UNIFDEF_BLOCKS +The +.Fn scandir_b +function appeared in Mac OS X 10.6. +#endif diff --git a/gen/FreeBSD/scandir.c b/gen/FreeBSD/scandir.c new file mode 100644 index 0000000..b47983e --- /dev/null +++ b/gen/FreeBSD/scandir.c @@ -0,0 +1,153 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)scandir.c 8.3 (Berkeley) 1/2/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +/* + * Scan the directory dirname calling select to make a list of selected + * directory entries then sort using qsort and compare routine dcomp. + * Returns the number of entries and a pointer to a list of pointers to + * struct dirent (through namelist). Returns -1 if there were any errors. + */ + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" + +/* + * The DIRSIZ macro is the minimum record length which will hold the directory + * entry. This requires the amount of space in struct dirent without the + * d_name field, plus enough space for the name and a terminating nul byte + * (dp->d_namlen + 1), rounded up to a 4 byte boundary. + */ +#undef DIRSIZ +#define DIRSIZ(dp) \ + ((sizeof(struct dirent) - sizeof(dp)->d_name) + \ + (((dp)->d_namlen + 1 + 3) &~ 3)) + +int +#ifdef I_AM_SCANDIR_B +scandir_b(const char *dirname, struct dirent ***namelist, + int (^select)(const struct dirent *), + int (^_dcomp)(const struct dirent **, const struct dirent **)) +#else +scandir(const char *dirname, struct dirent ***namelist, + int (*select)(const struct dirent *), + int (*_dcomp)(const struct dirent **, const struct dirent **)) +#endif +{ + struct dirent *d, *p, **names = NULL; + size_t nitems = 0; + long arraysz; + DIR *dirp; + + /* see */ +#ifdef I_AM_SCANDIR_B + int (^dcomp)(const void *, const void *) = (void *)_dcomp; +#else + int (*dcomp)(const void *, const void *) = (void *)_dcomp; +#endif + + if ((dirp = opendir(dirname)) == NULL) + return(-1); + + arraysz = 32; /* initial estimate of the array size */ + names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *)); + if (names == NULL) + goto fail; + + while ((d = readdir(dirp)) != NULL) { + if (select != NULL && !select(d)) + continue; /* just selected names */ + /* + * Make a minimum size copy of the data + */ + p = (struct dirent *)malloc(DIRSIZ(d)); + if (p == NULL) + goto fail; + p->d_fileno = d->d_fileno; + p->d_type = d->d_type; + p->d_reclen = d->d_reclen; + p->d_namlen = d->d_namlen; + bcopy(d->d_name, p->d_name, p->d_namlen + 1); + /* + * Check to make sure the array has space left and + * realloc the maximum size. + */ + if (nitems >= arraysz) { + struct dirent **names2; + + names2 = (struct dirent **)realloc((char *)names, + (arraysz * 2) * sizeof(struct dirent *)); + if (names2 == NULL) { + free(p); + goto fail; + } + names = names2; + arraysz *= 2; + } + names[nitems++] = p; + } + closedir(dirp); + if (nitems && dcomp != NULL) +#ifdef I_AM_SCANDIR_B + qsort_b(names, nitems, sizeof(struct dirent *), dcomp); +#else + qsort(names, nitems, sizeof(struct dirent *), dcomp); +#endif + *namelist = names; + return (int) (nitems); + +fail: + while (nitems > 0) + free(names[--nitems]); + free(names); + closedir(dirp); + return (-1); +} + +#ifndef I_AM_SCANDIR_B +/* + * Alphabetic order comparison routine for those who want it. + * POSIX 2008 requires that alphasort() uses strcoll(). + */ +int +alphasort(const struct dirent **d1, const struct dirent **d2) +{ + + return (strcoll((*d1)->d_name, (*d2)->d_name)); +} +#endif // I_AM_SCANDIR_B + diff --git a/gen/FreeBSD/scandir_b.c b/gen/FreeBSD/scandir_b.c new file mode 100644 index 0000000..92a7727 --- /dev/null +++ b/gen/FreeBSD/scandir_b.c @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2014 David Chisnall + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifdef __BLOCKS__ +#define I_AM_SCANDIR_B +#include "scandir.c" +#endif /* __BLOCKS__ */ + diff --git a/gen/FreeBSD/seed48.c b/gen/FreeBSD/seed48.c new file mode 100644 index 0000000..73d63ff --- /dev/null +++ b/gen/FreeBSD/seed48.c @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/seed48.c,v 1.2 2002/03/22 21:52:05 obrien Exp $"); + +#include "rand48.h" + +unsigned short * +seed48(unsigned short xseed[3]) +{ + static unsigned short sseed[3]; + + STORERAND48(_rand48_seed, sseed); + LOADRAND48(_rand48_seed, xseed); + _rand48_mult = RAND48_MULT; + _rand48_add = RAND48_ADD; + return sseed; +} diff --git a/gen/FreeBSD/seekdir.c b/gen/FreeBSD/seekdir.c new file mode 100644 index 0000000..71eb393 --- /dev/null +++ b/gen/FreeBSD/seekdir.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)seekdir.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" +#include "telldir.h" + +/* + * Seek to an entry in a directory. + * _seekdir is in telldir.c so that it can share opaque data structures. + */ +void +seekdir(DIR *dirp, long loc) +{ + if (__isthreaded) + _pthread_mutex_lock(&dirp->dd_lock); + _seekdir(dirp, loc); + if (__isthreaded) + _pthread_mutex_unlock(&dirp->dd_lock); +} diff --git a/gen/FreeBSD/sethostname.c b/gen/FreeBSD/sethostname.c new file mode 100644 index 0000000..af1a129 --- /dev/null +++ b/gen/FreeBSD/sethostname.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sethostname.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/sethostname.c,v 1.6 2007/01/09 00:27:55 imp Exp $"); + +#include +#include + +#include + +int +sethostname(const char *name, int namelen) +{ + int mib[2]; + + mib[0] = CTL_KERN; + mib[1] = KERN_HOSTNAME; + if (sysctl(mib, 2, NULL, NULL, (void *)name, namelen) == -1) + return (-1); + return (0); +} diff --git a/gen/FreeBSD/setmode.3 b/gen/FreeBSD/setmode.3 new file mode 100644 index 0000000..94fd5d1 --- /dev/null +++ b/gen/FreeBSD/setmode.3 @@ -0,0 +1,114 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)setmode.3 8.2 (Berkeley) 4/28/95 +.\" $FreeBSD: src/lib/libc/gen/setmode.3,v 1.12 2007/01/09 00:27:55 imp Exp $ +.\" +.Dd April 28, 1995 +.Dt SETMODE 3 +.Os +.Sh NAME +.Nm getmode , +.Nm setmode +.Nd modify mode bits +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft mode_t +.Fn getmode "const void *set" "mode_t mode" +.Ft void * +.Fn setmode "const char *mode_str" +.Sh DESCRIPTION +The +.Fn getmode +function +returns a copy of the file permission bits +.Fa mode +as altered by the values pointed to by +.Fa set . +While only the mode bits are altered, other parts of the file mode +may be examined. +.Pp +The +.Fn setmode +function +takes an absolute (octal) or symbolic value, as described in +.Xr chmod 1 , +as an argument +and returns a pointer to mode values to be supplied to +.Fn getmode . +Because some of the symbolic values are relative to the file +creation mask, +.Fn setmode +may call +.Xr umask 2 . +If this occurs, the file creation mask will be restored before +.Fn setmode +returns. +If the calling program changes the value of its file creation mask +after calling +.Fn setmode , +.Fn setmode +must be called again if +.Fn getmode +is to modify future file modes correctly. +.Pp +If the mode passed to +.Fn setmode +is invalid or if memory cannot be allocated for the return value, +.Fn setmode +returns +.Dv NULL . +.Pp +The value returned from +.Fn setmode +is obtained from +.Fn malloc +and should be returned to the system with +.Fn free +when the program is done with it, generally after a call to +.Fn getmode . +.Sh ERRORS +The +.Fn setmode +function +may fail and set errno for any of the errors specified for the library +routine +.Xr malloc 3 . +.Sh SEE ALSO +.Xr chmod 1 , +.Xr stat 2 , +.Xr umask 2 , +.Xr malloc 3 +.Sh HISTORY +The +.Fn getmode +and +.Fn setmode +functions first appeared in +.Bx 4.4 . diff --git a/gen/FreeBSD/setmode.c b/gen/FreeBSD/setmode.c new file mode 100644 index 0000000..53b79d2 --- /dev/null +++ b/gen/FreeBSD/setmode.c @@ -0,0 +1,469 @@ +/* + * Copyright (c) 1989, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Dave Borman at Cray Research, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setmode.c 8.2 (Berkeley) 3/25/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/setmode.c,v 1.11 2007/01/09 00:27:55 imp Exp $"); + +#include "namespace.h" +#include +#include + +#include +#include +#include +#include +#include + +#ifdef SETMODE_DEBUG +#include +#endif +#include "un-namespace.h" + +#define SET_LEN 6 /* initial # of bitcmd struct to malloc */ +#define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */ + +typedef struct bitcmd { + char cmd; + char cmd2; + mode_t bits; +} BITCMD; + +#define CMD2_CLR 0x01 +#define CMD2_SET 0x02 +#define CMD2_GBITS 0x04 +#define CMD2_OBITS 0x08 +#define CMD2_UBITS 0x10 + +#define compress_mode _sm_compress_mode + +static BITCMD *addcmd(BITCMD *, int, int, int, u_int); +__private_extern__ void compress_mode(BITCMD *); +#ifdef SETMODE_DEBUG +static void dumpmode(BITCMD *); +#endif + +#ifndef BUILDING_VARIANT +/* + * Given the old mode and an array of bitcmd structures, apply the operations + * described in the bitcmd structures to the old mode, and return the new mode. + * Note that there is no '=' command; a strict assignment is just a '-' (clear + * bits) followed by a '+' (set bits). + */ +mode_t +getmode(const void *bbox, mode_t omode) +{ + const BITCMD *set; + mode_t clrval, newmode, value; + + set = (const BITCMD *)bbox; + newmode = omode; + for (value = 0;; set++) + switch(set->cmd) { + /* + * When copying the user, group or other bits around, we "know" + * where the bits are in the mode so that we can do shifts to + * copy them around. If we don't use shifts, it gets real + * grundgy with lots of single bit checks and bit sets. + */ + case 'u': + value = (newmode & S_IRWXU) >> 6; + goto common; + + case 'g': + value = (newmode & S_IRWXG) >> 3; + goto common; + + case 'o': + value = newmode & S_IRWXO; +common: if (set->cmd2 & CMD2_CLR) { + clrval = + (set->cmd2 & CMD2_SET) ? S_IRWXO : value; + if (set->cmd2 & CMD2_UBITS) + newmode &= ~((clrval<<6) & set->bits); + if (set->cmd2 & CMD2_GBITS) + newmode &= ~((clrval<<3) & set->bits); + if (set->cmd2 & CMD2_OBITS) + newmode &= ~(clrval & set->bits); + } + if (set->cmd2 & CMD2_SET) { + if (set->cmd2 & CMD2_UBITS) + newmode |= (value<<6) & set->bits; + if (set->cmd2 & CMD2_GBITS) + newmode |= (value<<3) & set->bits; + if (set->cmd2 & CMD2_OBITS) + newmode |= value & set->bits; + } + break; + + case '+': + newmode |= set->bits; + break; + + case '-': + newmode &= ~set->bits; + break; + + case 'X': + if (omode & (S_IFDIR|S_IXUSR|S_IXGRP|S_IXOTH)) + newmode |= set->bits; + break; + + case '\0': + default: +#ifdef SETMODE_DEBUG + (void)printf("getmode:%04o -> %04o\n", omode, newmode); +#endif + return (newmode); + } +} +#endif /* BUILDING_VARIANT */ + +#define ADDCMD(a, b, c, d) \ + if (set >= endset) { \ + BITCMD *newset; \ + setlen += SET_LEN_INCR; \ + newset = realloc(saveset, sizeof(BITCMD) * setlen); \ + if (!newset) { \ + if (saveset) \ + free(saveset); \ + saveset = NULL; \ + return (NULL); \ + } \ + set = newset + (set - saveset); \ + saveset = newset; \ + endset = newset + (setlen - 2); \ + } \ + set = addcmd(set, (a), (b), (c), (d)) + +#ifndef VARIANT_LEGACY +#define STANDARD_BITS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO|S_ISTXT) +#else /* VARIANT_LEGACY */ +#define STANDARD_BITS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) +#endif /* !VARIANT_LEGACY */ + +void * +setmode(const char *p) +{ + int perm, who; + char op, *ep; + BITCMD *set, *saveset, *endset; + sigset_t sigset, sigoset; + mode_t mask; + int equalopdone=0, permXbits, setlen; + long perml; + + if (!*p) + return (NULL); + + /* + * Get a copy of the mask for the permissions that are mask relative. + * Flip the bits, we want what's not set. Since it's possible that + * the caller is opening files inside a signal handler, protect them + * as best we can. + */ + sigfillset(&sigset); + (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset); + (void)umask(mask = umask(0)); + mask = ~mask; + (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL); + + setlen = SET_LEN + 2; + + if ((set = malloc((u_int)(sizeof(BITCMD) * setlen))) == NULL) + return (NULL); + saveset = set; + endset = set + (setlen - 2); + + /* + * If an absolute number, get it and return; disallow non-octal digits + * or illegal bits. + */ + if (isdigit((unsigned char)*p)) { + perml = strtol(p, &ep, 8); +#ifndef VARIANT_LEGACY + if (*ep || perml < 0 || perml & ~STANDARD_BITS) +#else /* VARIANT_LEGACY */ + if (*ep || perml < 0 || perml & ~(STANDARD_BITS|S_ISTXT)) +#endif /* !VARIANT_LEGACY */ + { + free(saveset); + return (NULL); + } + perm = (mode_t)perml; +#ifndef VARIANT_LEGACY + ADDCMD('=', STANDARD_BITS, perm, mask); +#else /* VARIANT_LEGACY */ + ADDCMD('=', (STANDARD_BITS|S_ISTXT), perm, mask); +#endif /* !VARIANT_LEGACY */ + set->cmd = 0; + return (saveset); + } + + /* + * Build list of structures to set/clear/copy bits as described by + * each clause of the symbolic mode. + */ + for (;;) { + /* First, find out which bits might be modified. */ + for (who = 0;; ++p) { + switch (*p) { + case 'a': + who |= STANDARD_BITS; + break; + case 'u': + who |= S_ISUID|S_IRWXU; + break; + case 'g': + who |= S_ISGID|S_IRWXG; + break; + case 'o': + who |= S_IRWXO; + break; + default: + goto getop; + } + } + +getop: if ((op = *p++) != '+' && op != '-' && op != '=') { + free(saveset); + return (NULL); + } + if (op == '=') + equalopdone = 0; + +#ifdef VARIANT_LEGACY + who &= ~S_ISTXT; +#endif /* VARIANT_LEGACY */ + for (perm = 0, permXbits = 0;; ++p) { + switch (*p) { + case 'r': + perm |= S_IRUSR|S_IRGRP|S_IROTH; + break; + case 's': + /* If only "other" bits ignore set-id. */ + if (!who || who & ~S_IRWXO) + perm |= S_ISUID|S_ISGID; + break; + case 't': + /* If only "other" bits ignore sticky. */ + if (!who || who & ~S_IRWXO) { +#ifdef VARIANT_LEGACY + who |= S_ISTXT; +#endif /* VARIANT_LEGACY */ + perm |= S_ISTXT; + } + break; + case 'w': + perm |= S_IWUSR|S_IWGRP|S_IWOTH; + break; + case 'X': + permXbits = S_IXUSR|S_IXGRP|S_IXOTH; + break; + case 'x': + perm |= S_IXUSR|S_IXGRP|S_IXOTH; + break; + case 'u': + case 'g': + case 'o': + /* + * When ever we hit 'u', 'g', or 'o', we have + * to flush out any partial mode that we have, + * and then do the copying of the mode bits. + */ + if (perm) { + ADDCMD(op, who, perm, mask); + perm = 0; + } + if (op == '=') + equalopdone = 1; + if (op == '+' && permXbits) { + ADDCMD('X', who, permXbits, mask); + permXbits = 0; + } + ADDCMD(*p, who, op, mask); + break; + + default: + /* + * Add any permissions that we haven't already + * done. + */ + if (perm || (op == '=' && !equalopdone)) { + if (op == '=') + equalopdone = 1; + ADDCMD(op, who, perm, mask); + perm = 0; + } + if (permXbits) { + ADDCMD('X', who, permXbits, mask); + permXbits = 0; + } + goto apply; + } + } + +apply: if (!*p) + break; + if (*p != ',') + goto getop; + ++p; + } + set->cmd = 0; +#ifdef SETMODE_DEBUG + (void)printf("Before compress_mode()\n"); + dumpmode(saveset); +#endif + compress_mode(saveset); +#ifdef SETMODE_DEBUG + (void)printf("After compress_mode()\n"); + dumpmode(saveset); +#endif + return (saveset); +} + +static BITCMD * +addcmd(BITCMD *set, int op, int who, int oparg, u_int mask) +{ + switch (op) { + case '=': + set->cmd = '-'; + set->bits = who ? who : STANDARD_BITS; + set++; + + op = '+'; + /* FALLTHROUGH */ + case '+': + case '-': + case 'X': + set->cmd = op; + set->bits = (who ? who : mask) & oparg; + break; + + case 'u': + case 'g': + case 'o': + set->cmd = op; + if (who) { + set->cmd2 = ((who & S_IRUSR) ? CMD2_UBITS : 0) | + ((who & S_IRGRP) ? CMD2_GBITS : 0) | + ((who & S_IROTH) ? CMD2_OBITS : 0); + set->bits = (mode_t)~0; + } else { + set->cmd2 = CMD2_UBITS | CMD2_GBITS | CMD2_OBITS; + set->bits = mask; + } + + if (oparg == '+') + set->cmd2 |= CMD2_SET; + else if (oparg == '-') + set->cmd2 |= CMD2_CLR; + else if (oparg == '=') + set->cmd2 |= CMD2_SET|CMD2_CLR; + break; + } + return (set + 1); +} + +#ifdef SETMODE_DEBUG +static void +dumpmode(BITCMD *set) +{ + for (; set->cmd; ++set) + (void)printf("cmd: '%c' bits %04o%s%s%s%s%s%s\n", + set->cmd, set->bits, set->cmd2 ? " cmd2:" : "", + set->cmd2 & CMD2_CLR ? " CLR" : "", + set->cmd2 & CMD2_SET ? " SET" : "", + set->cmd2 & CMD2_UBITS ? " UBITS" : "", + set->cmd2 & CMD2_GBITS ? " GBITS" : "", + set->cmd2 & CMD2_OBITS ? " OBITS" : ""); +} +#endif + +#ifndef BUILDING_VARIANT +/* + * Given an array of bitcmd structures, compress by compacting consecutive + * '+', '-' and 'X' commands into at most 3 commands, one of each. The 'u', + * 'g' and 'o' commands continue to be separate. They could probably be + * compacted, but it's not worth the effort. + */ +__private_extern__ void +compress_mode(BITCMD *set) +{ + BITCMD *nset; + int setbits, clrbits, Xbits, op; + + for (nset = set;;) { + /* Copy over any 'u', 'g' and 'o' commands. */ + while ((op = nset->cmd) != '+' && op != '-' && op != 'X') { + *set++ = *nset++; + if (!op) + return; + } + + for (setbits = clrbits = Xbits = 0;; nset++) { + if ((op = nset->cmd) == '-') { + clrbits |= nset->bits; + setbits &= ~nset->bits; + Xbits &= ~nset->bits; + } else if (op == '+') { + setbits |= nset->bits; + clrbits &= ~nset->bits; + Xbits &= ~nset->bits; + } else if (op == 'X') + Xbits |= nset->bits & ~setbits; + else + break; + } + if (clrbits) { + set->cmd = '-'; + set->cmd2 = 0; + set->bits = clrbits; + set++; + } + if (setbits) { + set->cmd = '+'; + set->cmd2 = 0; + set->bits = setbits; + set++; + } + if (Xbits) { + set->cmd = 'X'; + set->cmd2 = 0; + set->bits = Xbits; + set++; + } + } +} +#endif /* BUILDING_VARIANT */ diff --git a/gen/FreeBSD/setprogname.c b/gen/FreeBSD/setprogname.c new file mode 100644 index 0000000..2392a66 --- /dev/null +++ b/gen/FreeBSD/setprogname.c @@ -0,0 +1,33 @@ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/setprogname.c,v 1.8 2002/03/29 22:43:41 markm Exp $"); + +#include +#include +#include +#include +#include +#define __progname (*_NSGetProgname()) + +#include "libc_private.h" + +void +setprogname(const char *progname) +{ + const char *p; + char buf[2*MAXCOMLEN+1]; + int mib[2]; + + p = strrchr(progname, '/'); + if (p != NULL) + __progname = (char *)(p = p + 1); + else + __progname = (char *)(p = progname); + + strlcpy(&buf[0], (char *)(p), sizeof(buf)); + + mib[0] = CTL_KERN; + mib[1] = KERN_PROCNAME; + + /* ignore errors as this is not a hard error */ + sysctl(mib, 2, NULL, NULL, &buf[0], strlen(buf)); +} diff --git a/gen/FreeBSD/siginterrupt.3 b/gen/FreeBSD/siginterrupt.3 new file mode 100644 index 0000000..6e2fd5f --- /dev/null +++ b/gen/FreeBSD/siginterrupt.3 @@ -0,0 +1,120 @@ +.\" Copyright (c) 1985, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)siginterrupt.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/siginterrupt.3,v 1.15 2007/01/09 00:27:55 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt SIGINTERRUPT 3 +.Os +.Sh NAME +.Nm siginterrupt +.Nd allow signals to interrupt system calls +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.Ft int +.Fn siginterrupt "int sig" "int flag" +.Sh DESCRIPTION +The +.Fn siginterrupt +function +is used to change the system call restart +behavior when a system call is interrupted by the specified signal. +If the flag is false (0), then system calls will be restarted if +they are interrupted by the specified signal +and no data has been transferred yet. +System call restart has been the default behavior since +.Bx 4.2 , +and is the default behaviour for +.Xr signal 3 +on +.Fx . +.Pp +If the flag is true (1), +then restarting of system calls is disabled. +If a system call is interrupted by the specified signal +and no data has been transferred, +the system call will return \-1 with the global variable +.Va errno +set to +.Er EINTR . +Interrupted system calls that have started transferring +data will return the amount of data actually transferred. +System call interrupt is the signal behavior found on +.Bx 4.1 +and +.At V +systems. +.Pp +Note that the new +.Bx 4.2 +signal handling semantics are not +altered in any other way. +Most notably, signal handlers always remain installed until +explicitly changed by a subsequent +.Xr sigaction 2 +call, and the signal mask operates as documented in +.Xr sigaction 2 . +Programs may switch between restartable and interruptible +system call operation as often as desired in the execution of a program. +.Pp +Issuing a +.Fn siginterrupt 3 +call during the execution of a signal handler will cause +the new action to take place on the next signal to be caught. +.Sh NOTES +This library routine uses an extension of the +.Xr sigaction 2 +system call that is not available in +.Bx 4.2 ; +hence, it should not be used if backward compatibility is needed. +.Sh RETURN VALUES +.Rv -std siginterrupt +.Sh ERRORS +The +.Fn siginterrupt +call fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa sig +argument +is not a valid signal number. +.El +.Sh SEE ALSO +.Xr sigaction 2 , +.Xr sigblock 2 , +.Xr sigpause 2 , +.Xr sigsetmask 2 , +.Xr signal 3 +.Sh HISTORY +The +.Fn siginterrupt +function appeared in +.Bx 4.3 . diff --git a/gen/FreeBSD/siginterrupt.c b/gen/FreeBSD/siginterrupt.c new file mode 100644 index 0000000..8620ebe --- /dev/null +++ b/gen/FreeBSD/siginterrupt.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)siginterrupt.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/siginterrupt.c,v 1.5 2007/01/09 00:27:55 imp Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" + +/* + * Set signal state to prevent restart of system calls + * after an instance of the indicated signal. + */ +int +siginterrupt(sig, flag) + int sig, flag; +{ + extern sigset_t _sigintr; + struct sigaction sa; + int ret; + + if ((ret = _sigaction(sig, (struct sigaction *)0, &sa)) < 0) + return (ret); + if (flag) { + sigaddset(&_sigintr, sig); + sa.sa_flags &= ~SA_RESTART; + } else { + sigdelset(&_sigintr, sig); + sa.sa_flags |= SA_RESTART; + } + return (_sigaction(sig, &sa, (struct sigaction *)0)); +} diff --git a/gen/FreeBSD/siglist.c b/gen/FreeBSD/siglist.c new file mode 100644 index 0000000..a222989 --- /dev/null +++ b/gen/FreeBSD/siglist.c @@ -0,0 +1,106 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)siglist.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/siglist.c,v 1.6 2007/01/20 08:24:01 maxim Exp $"); + +#include + +const char *const sys_signame[NSIG] = { + "Signal 0", + "hup", /* SIGHUP */ + "int", /* SIGINT */ + "quit", /* SIGQUIT */ + "ill", /* SIGILL */ + "trap", /* SIGTRAP */ + "abrt", /* SIGABRT */ + "emt", /* SIGEMT */ + "fpe", /* SIGFPE */ + "kill", /* SIGKILL */ + "bus", /* SIGBUS */ + "segv", /* SIGSEGV */ + "sys", /* SIGSYS */ + "pipe", /* SIGPIPE */ + "alrm", /* SIGALRM */ + "term", /* SIGTERM */ + "urg", /* SIGURG */ + "stop", /* SIGSTOP */ + "tstp", /* SIGTSTP */ + "cont", /* SIGCONT */ + "chld", /* SIGCHLD */ + "ttin", /* SIGTTIN */ + "ttou", /* SIGTTOU */ + "io", /* SIGIO */ + "xcpu", /* SIGXCPU */ + "xfsz", /* SIGXFSZ */ + "vtalrm", /* SIGVTALRM */ + "prof", /* SIGPROF */ + "winch", /* SIGWINCH */ + "info", /* SIGINFO */ + "usr1", /* SIGUSR1 */ + "usr2" /* SIGUSR2 */ +}; + +const char *const sys_siglist[NSIG] = { + "Signal 0", + "Hangup", /* SIGHUP */ + "Interrupt", /* SIGINT */ + "Quit", /* SIGQUIT */ + "Illegal instruction", /* SIGILL */ + "Trace/BPT trap", /* SIGTRAP */ + "Abort trap", /* SIGABRT */ + "EMT trap", /* SIGEMT */ + "Floating point exception", /* SIGFPE */ + "Killed", /* SIGKILL */ + "Bus error", /* SIGBUS */ + "Segmentation fault", /* SIGSEGV */ + "Bad system call", /* SIGSYS */ + "Broken pipe", /* SIGPIPE */ + "Alarm clock", /* SIGALRM */ + "Terminated", /* SIGTERM */ + "Urgent I/O condition", /* SIGURG */ + "Suspended (signal)", /* SIGSTOP */ + "Suspended", /* SIGTSTP */ + "Continued", /* SIGCONT */ + "Child exited", /* SIGCHLD */ + "Stopped (tty input)", /* SIGTTIN */ + "Stopped (tty output)", /* SIGTTOU */ + "I/O possible", /* SIGIO */ + "Cputime limit exceeded", /* SIGXCPU */ + "Filesize limit exceeded", /* SIGXFSZ */ + "Virtual timer expired", /* SIGVTALRM */ + "Profiling timer expired", /* SIGPROF */ + "Window size changes", /* SIGWINCH */ + "Information request", /* SIGINFO */ + "User defined signal 1", /* SIGUSR1 */ + "User defined signal 2" /* SIGUSR2 */ +}; diff --git a/gen/FreeBSD/signal.3 b/gen/FreeBSD/signal.3 new file mode 100644 index 0000000..f18d1cf --- /dev/null +++ b/gen/FreeBSD/signal.3 @@ -0,0 +1,276 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)signal.3 8.3 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/gen/signal.3,v 1.43 2008/07/17 21:54:23 simon Exp $ +.\" +.Dd June 7, 2004 +.Dt SIGNAL 3 +.Os +.Sh NAME +.Nm signal +.Nd simplified software signal facilities +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.\" XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX +.\" The prototype for signal(3) cannot be cleanly marked up in -mdoc +.\" without the following lower-level tweak. +.nr in-synopsis-section 0 +.Pp +.Ft "void \*(lp*" Ns +.Fo signal +.Fa "int sig" +.Fa "void \*(lp*func\*(rp\*(lpint\*(rp" +.Fc Ns +.Ft "\*(rp\*(lpint\*(rp" ; +.Pp +.nr in-synopsis-section 1 +.\" XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX +or in the equivalent but easier to read typedef'd version: +.Ft typedef "void \*(lp*sig_t\*(rp \*(lpint\*(rp" ; +.Pp +.Ft sig_t +.Fn signal "int sig" "sig_t func" +.Sh DESCRIPTION +This +.Fn signal +facility +is a simplified interface to the more general +.Xr sigaction 2 +facility. +.Pp +Signals allow the manipulation of a process from outside its domain, +as well as allowing the process to manipulate itself +or copies of itself (children). +There are two general types of signals: +those that cause termination of a process and those that do not. +Signals which cause termination of a program might result from +an irrecoverable error or might be the result of a user at a terminal +typing the `interrupt' character. +Signals are used when a process is stopped because it wishes to access +its control terminal while in the background (see +.Xr tty 4 ) . +Signals are optionally generated +when a process resumes after being stopped, +when the status of child processes changes, +or when input is ready at the control terminal. +Most signals result in the termination of the process receiving them, +if no action is taken; +some signals instead cause the process receiving them to be stopped, +or are simply discarded if the process has not requested otherwise. +Except for the +.Dv SIGKILL +and +.Dv SIGSTOP +signals, the +.Fn signal +function allows for a signal to be caught, to be ignored, or to generate +an interrupt. +These signals are defined in the file +.In signal.h : +.Bl -column No ".Dv SIGVTALRM" "create core image" +.It Sy "No Name Default Action Description" +.It 1 Ta Dv SIGHUP Ta "terminate process" Ta "terminal line hangup" +.It 2 Ta Dv SIGINT Ta "terminate process" Ta "interrupt program" +.It 3 Ta Dv SIGQUIT Ta "create core image" Ta "quit program" +.It 4 Ta Dv SIGILL Ta "create core image" Ta "illegal instruction" +.It 5 Ta Dv SIGTRAP Ta "create core image" Ta "trace trap" +.It 6 Ta Dv SIGABRT Ta "create core image" Ta "abort program" +(formerly +.Dv SIGIOT ) +.It 7 Ta Dv SIGEMT Ta "create core image" Ta "emulate instruction executed" +.It 8 Ta Dv SIGFPE Ta "create core image" Ta "floating-point exception" +.It 9 Ta Dv SIGKILL Ta "terminate process" Ta "kill program" +.It 10 Ta Dv SIGBUS Ta "create core image" Ta "bus error" +.It 11 Ta Dv SIGSEGV Ta "create core image" Ta "segmentation violation" +.It 12 Ta Dv SIGSYS Ta "create core image" Ta "non-existent system call invoked" +.It 13 Ta Dv SIGPIPE Ta "terminate process" Ta "write on a pipe with no reader" +.It 14 Ta Dv SIGALRM Ta "terminate process" Ta "real-time timer expired" +.It 15 Ta Dv SIGTERM Ta "terminate process" Ta "software termination signal" +.It 16 Ta Dv SIGURG Ta "discard signal" Ta "urgent condition present on socket" +.It 17 Ta Dv SIGSTOP Ta "stop process" Ta "stop (cannot be caught or ignored)" +.It 18 Ta Dv SIGTSTP Ta "stop process" Ta "stop signal generated from keyboard" +.It 19 Ta Dv SIGCONT Ta "discard signal" Ta "continue after stop" +.It 20 Ta Dv SIGCHLD Ta "discard signal" Ta "child status has changed" +.It 21 Ta Dv SIGTTIN Ta "stop process" Ta "background read attempted from" +control terminal +.It 22 Ta Dv SIGTTOU Ta "stop process" Ta "background write attempted to" +control terminal +.It 23 Ta Dv SIGIO Ta "discard signal" Ta Tn "I/O" +is possible on a descriptor (see +.Xr fcntl 2 ) +.It 24 Ta Dv SIGXCPU Ta "terminate process" Ta "cpu time limit exceeded (see" +.Xr setrlimit 2 ) +.It 25 Ta Dv SIGXFSZ Ta "terminate process" Ta "file size limit exceeded (see" +.Xr setrlimit 2 ) +.It 26 Ta Dv SIGVTALRM Ta "terminate process" Ta "virtual time alarm (see" +.Xr setitimer 2 ) +.It 27 Ta Dv SIGPROF Ta "terminate process" Ta "profiling timer alarm (see" +.Xr setitimer 2 ) +.It 28 Ta Dv SIGWINCH Ta "discard signal" Ta "Window size change" +.It 29 Ta Dv SIGINFO Ta "discard signal" Ta "status request from keyboard" +.It 30 Ta Dv SIGUSR1 Ta "terminate process" Ta "User defined signal 1" +.It 31 Ta Dv SIGUSR2 Ta "terminate process" Ta "User defined signal 2" +.El +.Pp +The +.Fa sig +argument specifies which signal was received. +The +.Fa func +procedure allows a user to choose the action upon receipt of a signal. +To set the default action of the signal to occur as listed above, +.Fa func +should be +.Dv SIG_DFL . +A +.Dv SIG_DFL +resets the default action. +To ignore the signal, +.Fa func +should be +.Dv SIG_IGN . +This will cause subsequent instances of the signal to be ignored +and pending instances to be discarded. +If +.Dv SIG_IGN +is not used, +further occurrences of the signal are +automatically blocked and +.Fa func +is called. +.Pp +The handled signal is unblocked when the +function returns and +the process continues from where it left off when the signal occurred. +.Bf -symbolic +Unlike previous signal facilities, the handler +func() remains installed after a signal has been delivered. +.Ef +.Pp +For some system calls, if a signal is caught while the call is +executing and the call is prematurely terminated, +the call is automatically restarted. +Any handler installed with +.Xr signal 3 +will have the +.Dv SA_RESTART +flag set, meaning that any restartable system call will not return on +receipt of a signal. +The affected system calls include +.Xr read 2 , +.Xr write 2 , +.Xr sendto 2 , +.Xr recvfrom 2 , +.Xr sendmsg 2 , +and +.Xr recvmsg 2 +on a communications channel or a low speed device +and during a +.Xr ioctl 2 +or +.Xr wait 2 . +However, calls that have already committed are not restarted, +but instead return a partial success (for example, a short read count). +These semantics could be changed with +.Xr siginterrupt 3 . +.Pp +When a process which has installed signal handlers forks, +the child process inherits the signals. +All caught signals may be reset to their default action by a call +to the +.Xr execve 2 +function; +ignored signals remain ignored. +.Pp +If a process explicitly specifies +.Dv SIG_IGN +as the action for the signal +.Dv SIGCHLD , +the system will not create zombie processes when children +of the calling process exit. +As a consequence, the system will discard the exit status +from the child processes. +If the calling process subsequently issues a call to +.Xr wait 2 +or equivalent, it will block until all of the calling process's +children terminate, and then return a value of \-1 with +.Va errno +set to +.Er ECHILD . +.Pp +See +.Xr sigaction 2 +for a list of functions +that are considered safe for use in signal handlers. +.Sh RETURN VALUES +The previous action is returned on a successful call. +Otherwise, SIG_ERR is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn signal +function +will fail and no action will take place if one of the +following occur: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa sig +argument +is not a valid signal number. +.It Bq Er EINVAL +An attempt is made to ignore or supply a handler for +.Dv SIGKILL +or +.Dv SIGSTOP . +.El +.Sh SEE ALSO +.Xr kill 1 , +.Xr kill 2 , +.Xr ptrace 2 , +.Xr sigaction 2 , +.Xr sigaltstack 2 , +.Xr sigprocmask 2 , +.Xr sigsuspend 2 , +.Xr wait 2 , +.Xr fpsetmask 3 , +.Xr setjmp 3 , +.Xr siginterrupt 3 , +.Xr tty 4 +.Sh HISTORY +The +.Nm +facility appeared in +.Bx 4.0 . +The option to avoid the creation of child zombies through ignoring +.Dv SIGCHLD +appeared in +.Fx 5.0 . diff --git a/gen/FreeBSD/signal.c b/gen/FreeBSD/signal.c new file mode 100644 index 0000000..fd96452 --- /dev/null +++ b/gen/FreeBSD/signal.c @@ -0,0 +1,95 @@ +/* + * Copyright (c) 1985, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)signal.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/signal.c,v 1.4 2007/01/09 00:27:55 imp Exp $"); + +/* + * Almost backwards compatible signal. + */ +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" + +sigset_t _sigintr; /* shared with siginterrupt */ + +extern int _sigaction_nobind (int sig, const struct sigaction *nsv, struct sigaction *osv); + +static sig_t +signal__(s, a, bind) + int s; + sig_t a; + int bind; +{ + struct sigaction sa, osa; + + sa.sa_handler = a; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + if (!sigismember(&_sigintr, s)) + sa.sa_flags |= SA_RESTART; +#if defined(__DYNAMIC__) + if (bind) { +#endif /* __DYNAMIC__ */ + if (_sigaction(s, &sa, &osa) < 0) + return (SIG_ERR); +#if defined(__DYNAMIC__) + } else { + if (_sigaction_nobind(s, &sa, &osa) < 0) + return (SIG_ERR); + } +#endif /* __DYNAMIC__ */ + return (osa.sa_handler); +} + +sig_t +signal(s, a) + int s; + sig_t a; +{ + return signal__(s, a, 1); +} + +#if defined(__DYNAMIC__) +sig_t +_signal_nobind(s, a) + int s; + sig_t a; +{ + return signal__(s, a, 0); +} +#endif /* __DYNAMIC__ */ +#pragma clang diagnostic pop diff --git a/gen/FreeBSD/signbit.3 b/gen/FreeBSD/signbit.3 new file mode 100644 index 0000000..7d9c8d8 --- /dev/null +++ b/gen/FreeBSD/signbit.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) 2003 Mike Barcroft +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/signbit.3,v 1.3 2003/02/24 22:53:20 ru Exp $ +.\" +.Dd February 11, 2003 +.Dt SIGNBIT 3 +.Os +.Sh NAME +.Nm signbit +.Nd "determine whether a floating-point number's sign is negative" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In math.h +.Ft int +.Fn signbit "real-floating x" +.Sh DESCRIPTION +The +.Fn signbit +macro takes an argument of +.Fa x . +It returns non-zero if the value of the argument's sign is negative, +otherwise 0. +.Sh SEE ALSO +.Xr fpclassify 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn signbit +macro conforms to +.St -isoC-99 . diff --git a/gen/FreeBSD/sleep.3 b/gen/FreeBSD/sleep.3 new file mode 100644 index 0000000..f540a15 --- /dev/null +++ b/gen/FreeBSD/sleep.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) 1986, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)sleep.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/sleep.3,v 1.17 2007/01/09 00:27:55 imp Exp $ +.\" +.Dd February 13, 1998 +.Dt SLEEP 3 +.Os +.Sh NAME +.Nm sleep +.Nd suspend thread execution for an interval measured in seconds +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft unsigned int +.Fn sleep "unsigned int seconds" +.Sh DESCRIPTION +The +.Fn sleep +function suspends execution of the calling thread until either +.Fa seconds +seconds have elapsed or a signal is delivered to the thread and its +action is to invoke a signal-catching function or to terminate the +thread or process. +System activity may lengthen the sleep by an indeterminate amount. +.Pp +This function is implemented using +.Xr nanosleep 2 +by pausing for +.Fa seconds +seconds or until a signal occurs. +Consequently, in this implementation, +sleeping has no effect on the state of process timers, +and there is no special handling for SIGALRM. +.Sh RETURN VALUES +If the +.Fn sleep +function returns because the requested time has elapsed, the value +returned will be zero. +If the +.Fn sleep +function returns due to the delivery of a signal, the value returned +will be the unslept amount (the requested time minus the time actually +slept) in seconds. +.Sh SEE ALSO +.Xr nanosleep 2 , +.Xr usleep 3 +.Sh STANDARDS +The +.Fn sleep +function conforms to +.St -p1003.1-90 . +.Sh HISTORY +A +.Fn sleep +function appeared in +.At v7 . diff --git a/gen/FreeBSD/sleep.c b/gen/FreeBSD/sleep.c new file mode 100644 index 0000000..a04789d --- /dev/null +++ b/gen/FreeBSD/sleep.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(VARIANT_CANCELABLE) && __DARWIN_NON_CANCELABLE != 0 +#error cancellable call vs. __DARWIN_NON_CANCELABLE mismatch +#endif + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sleep.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/sleep.c,v 1.33 2009/12/05 19:31:38 ed Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" + +unsigned int +__sleep(unsigned int seconds) +{ + struct timespec time_to_sleep; + struct timespec time_remaining; + + /* + * Avoid overflow when `seconds' is huge. This assumes that + * the maximum value for a time_t is >= INT_MAX. + */ + if (seconds > INT_MAX) + return (seconds - INT_MAX + __sleep(INT_MAX)); + + time_to_sleep.tv_sec = seconds; + time_to_sleep.tv_nsec = 0; + if (_nanosleep(&time_to_sleep, &time_remaining) != -1) + return (0); + if (errno != EINTR) + return (seconds); /* best guess */ + return (time_remaining.tv_sec + + (time_remaining.tv_nsec != 0)); /* round up */ +} + +__weak_reference(__sleep, sleep); +__weak_reference(__sleep, _sleep); diff --git a/gen/FreeBSD/srand48.c b/gen/FreeBSD/srand48.c new file mode 100644 index 0000000..c9f8426 --- /dev/null +++ b/gen/FreeBSD/srand48.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 1993 Martin Birgmeier + * All rights reserved. + * + * You may redistribute unmodified or modified versions of this source + * code provided that the above copyright notice and this and the + * following conditions are retained. + * + * This software is provided ``as is'', and comes with no warranties + * of any kind. I shall in no event be liable for anything that happens + * to anyone/anything when using this software. + */ + +#include "rand48.h" + +void +srand48(long seed) +{ + _rand48_seed = TOUINT48(RAND48_SEED_0, (unsigned short) seed, (unsigned short) (seed >> 16)); + _rand48_mult = RAND48_MULT; + _rand48_add = RAND48_ADD; +} diff --git a/gen/FreeBSD/stringlist.3 b/gen/FreeBSD/stringlist.3 new file mode 100644 index 0000000..d1dd2f4 --- /dev/null +++ b/gen/FreeBSD/stringlist.3 @@ -0,0 +1,135 @@ +.\" $NetBSD: stringlist.3,v 1.5 1999/03/22 19:44:46 garbled Exp $ +.\" +.\" Copyright (c) 1997, 1999 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This file was contributed to The NetBSD Foundation by Luke Mewburn. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the NetBSD +.\" Foundation, Inc. and its contributors. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/stringlist.3,v 1.11 2005/02/13 23:45:46 ru Exp $ +.\" +.Dd November 28, 1999 +.Os +.Dt STRINGLIST 3 +.Sh NAME +.Nm stringlist , +.Nm sl_init , +.Nm sl_add , +.Nm sl_free , +.Nm sl_find +.Nd stringlist manipulation functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stringlist.h +.Ft StringList * +.Fn sl_init +.Ft int +.Fn sl_add "StringList *sl" "char *item" +.Ft void +.Fn sl_free "StringList *sl" "int freeall" +.Ft char * +.Fn sl_find "StringList *sl" "char *item" +.Sh DESCRIPTION +The +.Nm +functions manipulate stringlists, which are lists of +strings that extend automatically if necessary. +.Pp +The +.Vt StringList +structure has the following definition: +.Bd -literal -offset indent +typedef struct _stringlist { + char **sl_str; + size_t sl_max; + size_t sl_cur; +} StringList; +.Ed +.Pp +.Bl -tag -width "sl_str" -offset indent +.It Va sl_str +a pointer to the base of the array containing the list. +.It Va sl_max +the size of +.Va sl_str . +.It Va sl_cur +the offset in +.Va sl_str +of the current element. +.El +.Pp +The following stringlist manipulation functions are available: +.Bl -tag -width "sl_init()" +.It Fn sl_init +Create a stringlist. +Returns a pointer to a +.Vt StringList , +or +.Dv NULL +in case of failure. +.It Fn sl_free +Releases memory occupied by +.Fa sl +and the +.Fa sl->sl_str +array. +If +.Fa freeall +is non-zero, then each of the items within +.Fa sl->sl_str +is released as well. +.It Fn sl_add +Add +.Fa item +to +.Fa sl->sl_str +at +.Fa sl->sl_cur , +extending the size of +.Fa sl->sl_str . +Returns zero upon success, \-1 upon failure. +.It Fn sl_find +Find +.Fa item +in +.Fa sl , +returning NULL if it is not found. +.El +.Sh SEE ALSO +.Xr free 3 , +.Xr malloc 3 +.Sh HISTORY +The +.Nm +functions appeared in +.Fx 2.2.6 +and +.Nx 1.3 . diff --git a/gen/FreeBSD/stringlist.c b/gen/FreeBSD/stringlist.c new file mode 100644 index 0000000..a4ad68a --- /dev/null +++ b/gen/FreeBSD/stringlist.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1994 Christos Zoulas + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char *rcsid = "$NetBSD: stringlist.c,v 1.2 1997/01/17 07:26:20 lukem Exp $"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/stringlist.c,v 1.8 2007/01/09 00:27:55 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#define _SL_CHUNKSIZE 20 + +/* + * sl_init(): Initialize a string list + */ +StringList * +sl_init() +{ + StringList *sl; + + sl = malloc(sizeof(StringList)); + if (sl == NULL) + _err(1, "stringlist: %m"); + + sl->sl_cur = 0; + sl->sl_max = _SL_CHUNKSIZE; + sl->sl_str = malloc(sl->sl_max * sizeof(char *)); + if (sl->sl_str == NULL) + _err(1, "stringlist: %m"); + return sl; +} + + +/* + * sl_add(): Add an item to the string list + */ +int +sl_add(sl, name) + StringList *sl; + char *name; +{ + if (sl->sl_cur == sl->sl_max - 1) { + sl->sl_max += _SL_CHUNKSIZE; + sl->sl_str = reallocf(sl->sl_str, sl->sl_max * sizeof(char *)); + if (sl->sl_str == NULL) + return (-1); + } + sl->sl_str[sl->sl_cur++] = name; + return (0); +} + + +/* + * sl_free(): Free a stringlist + */ +void +sl_free(sl, all) + StringList *sl; + int all; +{ + size_t i; + + if (sl == NULL) + return; + if (sl->sl_str) { + if (all) + for (i = 0; i < sl->sl_cur; i++) + free(sl->sl_str[i]); + free(sl->sl_str); + } + free(sl); +} + + +/* + * sl_find(): Find a name in the string list + */ +char * +sl_find(sl, name) + StringList *sl; + char *name; +{ + size_t i; + + for (i = 0; i < sl->sl_cur; i++) + if (strcmp(sl->sl_str[i], name) == 0) + return sl->sl_str[i]; + + return NULL; +} diff --git a/gen/FreeBSD/sysconf.3 b/gen/FreeBSD/sysconf.3 new file mode 100644 index 0000000..5fca1ba --- /dev/null +++ b/gen/FreeBSD/sysconf.3 @@ -0,0 +1,223 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)sysconf.3 8.3 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/gen/sysconf.3,v 1.25 2007/01/09 00:27:55 imp Exp $ +.\" +.Dd December 14, 2006 +.Dt SYSCONF 3 +.Os +.Sh NAME +.Nm sysconf +.Nd get configurable system variables +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft long +.Fn sysconf "int name" +.Sh DESCRIPTION +This interface is defined by +.St -p1003.1-88 . +A far more complete interface is available using +.Xr sysctl 3 . +.Pp +The +.Fn sysconf +function provides a method for applications to determine the current +value of a configurable system limit or option variable. +The +.Fa name +argument specifies the system variable to be queried. +Symbolic constants for each name value are found in the include file +.In unistd.h . +Shell programmers who need access to these parameters should use the +.Xr getconf 1 +utility. +.Pp +The available values are as follows: +.Pp +.Bl -tag -width 6n +.Pp +.It Li _SC_ARG_MAX +The maximum bytes of argument to +.Xr execve 2 . +.It Li _SC_CHILD_MAX +The maximum number of simultaneous processes per user id. +.It Li _SC_CLK_TCK +The frequency of the statistics clock in ticks per second. +.It Li _SC_IOV_MAX +The maximum number of elements in the I/O vector used by +.Xr readv 2 , +.Xr writev 2 , +.Xr recvmsg 2 , +and +.Xr sendmsg 2 . +.It Li _SC_NGROUPS_MAX +The maximum number of supplemental groups. +.It Li _SC_NPROCESSORS_CONF +The number of processors configured. +.It Li _SC_NPROCESSORS_ONLN +The number of processors currently online. +.It Li _SC_OPEN_MAX +The maximum number of open files per user id. +.It Li _SC_PAGESIZE +The size of a system page in bytes. +.It Li _SC_STREAM_MAX +The minimum maximum number of streams that a process may have open +at any one time. +.It Li _SC_TZNAME_MAX +The minimum maximum number of types supported for the name of a +timezone. +.It Li _SC_JOB_CONTROL +Return 1 if job control is available on this system, otherwise \-1. +.It Li _SC_SAVED_IDS +Returns 1 if saved set-group and saved set-user ID is available, +otherwise \-1. +.It Li _SC_VERSION +The version of +.St -p1003.1 +with which the system +attempts to comply. +.It Li _SC_BC_BASE_MAX +The maximum ibase/obase values in the +.Xr bc 1 +utility. +.It Li _SC_BC_DIM_MAX +The maximum array size in the +.Xr bc 1 +utility. +.It Li _SC_BC_SCALE_MAX +The maximum scale value in the +.Xr bc 1 +utility. +.It Li _SC_BC_STRING_MAX +The maximum string length in the +.Xr bc 1 +utility. +.It Li _SC_COLL_WEIGHTS_MAX +The maximum number of weights that can be assigned to any entry of +the LC_COLLATE order keyword in the locale definition file. +.It Li _SC_EXPR_NEST_MAX +The maximum number of expressions that can be nested within +parenthesis by the +.Xr expr 1 +utility. +.It Li _SC_LINE_MAX +The maximum length in bytes of a text-processing utility's input +line. +.It Li _SC_RE_DUP_MAX +The maximum number of repeated occurrences of a regular expression +permitted when using interval notation. +.It Li _SC_2_VERSION +The version of +.St -p1003.2 +with which the system attempts to comply. +.It Li _SC_2_C_BIND +Return 1 if the system's C-language development facilities support the +C-Language Bindings Option, otherwise \-1. +.It Li _SC_2_C_DEV +Return 1 if the system supports the C-Language Development Utilities Option, +otherwise \-1. +.It Li _SC_2_CHAR_TERM +Return 1 if the system supports at least one terminal type capable of +all operations described in +.St -p1003.2 , +otherwise \-1. +.It Li _SC_2_FORT_DEV +Return 1 if the system supports the FORTRAN Development Utilities Option, +otherwise \-1. +.It Li _SC_2_FORT_RUN +Return 1 if the system supports the FORTRAN Runtime Utilities Option, +otherwise \-1. +.It Li _SC_2_LOCALEDEF +Return 1 if the system supports the creation of locales, otherwise \-1. +.It Li _SC_2_SW_DEV +Return 1 if the system supports the Software Development Utilities Option, +otherwise \-1. +.It Li _SC_2_UPE +Return 1 if the system supports the User Portability Utilities Option, +otherwise \-1. +.El +.Pp +These values also exist, but may not be standard: +.Pp +.Bl -tag -width 6n +.Pp +.It Li _SC_PHYS_PAGES +The number of pages of physical memory. +Note that it is possible that the product of this value and the value of +.Li _SC_PAGESIZE +will overflow a +.Vt long +in some configurations on a 32bit machine. +.El +.Sh RETURN VALUES +If the call to +.Fn sysconf +is not successful, \-1 is returned and +.Va errno +is set appropriately. +Otherwise, if the variable is associated with functionality that is not +supported, \-1 is returned and +.Va errno +is not modified. +Otherwise, the current variable value is returned. +.Sh ERRORS +The +.Fn sysconf +function may fail and set +.Va errno +for any of the errors specified for the library function +.Xr sysctl 3 . +In addition, the following error may be reported: +.Bl -tag -width Er +.It Bq Er EINVAL +The value of the +.Fa name +argument is invalid. +.El +.Sh SEE ALSO +.Xr getconf 1 , +.Xr pathconf 2 , +.Xr confstr 3 , +.Xr sysctl 3 +.Sh STANDARDS +Except for the fact that values returned by +.Fn sysconf +may change over the lifetime of the calling process, +this function conforms to +.St -p1003.1-88 . +.Sh HISTORY +The +.Fn sysconf +function first appeared in +.Bx 4.4 . +.Sh BUGS +The value for _SC_STREAM_MAX is a minimum maximum, and required to be +the same as ANSI C's FOPEN_MAX, so the returned value is a ridiculously +small and misleading number. diff --git a/gen/FreeBSD/sysconf.c b/gen/FreeBSD/sysconf.c new file mode 100644 index 0000000..ca90c7a --- /dev/null +++ b/gen/FreeBSD/sysconf.c @@ -0,0 +1,685 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Sean Eric Fagan of Cygnus Support. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sysconf.c 8.2 (Berkeley) 3/20/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: lib/libc/gen/sysconf.c r168718 $"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include /* we just need the limits */ +#include +#include + +#include "../../stdlib/FreeBSD/atexit.h" +#include "../../stdtime/FreeBSD/tzfile.h" + +#define _PATH_ZONEINFO TZDIR /* from tzfile.h */ + +/* + * sysconf -- + * get configurable system variables. + * + * XXX + * POSIX 1003.1 (ISO/IEC 9945-1, 4.8.1.3) states that the variable values + * not change during the lifetime of the calling process. This would seem + * to require that any change to system limits kill all running processes. + * A workaround might be to cache the values when they are first retrieved + * and then simply return the cached value on subsequent calls. This is + * less useful than returning up-to-date values, however. + */ +long +sysconf(name) + int name; +{ + struct rlimit rl; + quad_t qdvalue; /* for kern.sysv.shmmin */ + size_t len; + int mib[3], sverrno, value; + long lvalue, defaultresult; + const char *path; + + defaultresult = -1; + + switch (name) { + case _SC_ARG_MAX: + mib[0] = CTL_KERN; + mib[1] = KERN_ARGMAX; + break; + case _SC_CHILD_MAX: + if (getrlimit(RLIMIT_NPROC, &rl) != 0) + return (-1); + if (rl.rlim_cur == RLIM_INFINITY) + return (-1); + if (rl.rlim_cur > LONG_MAX) { + errno = EOVERFLOW; + return (-1); + } + return ((long)rl.rlim_cur); + case _SC_CLK_TCK: + return (CLK_TCK); + case _SC_NGROUPS_MAX: + mib[0] = CTL_KERN; + mib[1] = KERN_NGROUPS; + break; + case _SC_OPEN_MAX: + case _SC_STREAM_MAX: /* assume fds run out before memory does */ + if (getrlimit(RLIMIT_NOFILE, &rl) != 0) + return (-1); + if (rl.rlim_cur == RLIM_INFINITY) + return (-1); + if (rl.rlim_cur > LONG_MAX) { + errno = EOVERFLOW; + return (-1); + } + return ((long)rl.rlim_cur); + case _SC_JOB_CONTROL: + return (_POSIX_JOB_CONTROL); + case _SC_SAVED_IDS: + /* XXX - must be 1 */ + mib[0] = CTL_KERN; + mib[1] = KERN_SAVED_IDS; + goto yesno; + case _SC_VERSION: + mib[0] = CTL_KERN; + mib[1] = KERN_POSIX1; + break; + case _SC_BC_BASE_MAX: + return (BC_BASE_MAX); + case _SC_BC_DIM_MAX: + return (BC_DIM_MAX); + case _SC_BC_SCALE_MAX: + return (BC_SCALE_MAX); + case _SC_BC_STRING_MAX: + return (BC_STRING_MAX); + case _SC_COLL_WEIGHTS_MAX: + return (COLL_WEIGHTS_MAX); + case _SC_EXPR_NEST_MAX: + return (EXPR_NEST_MAX); + case _SC_LINE_MAX: + return (LINE_MAX); + case _SC_RE_DUP_MAX: + return (RE_DUP_MAX); + case _SC_2_VERSION: + /* + * This is something of a lie, but it would be silly at + * this point to try to deduce this from the contents + * of the filesystem. + */ + return (_POSIX2_VERSION); + case _SC_2_C_BIND: + return (_POSIX2_C_BIND); + case _SC_2_C_DEV: + return (_POSIX2_C_DEV); + case _SC_2_CHAR_TERM: + return (_POSIX2_CHAR_TERM); + case _SC_2_FORT_DEV: + return (_POSIX2_FORT_DEV); + case _SC_2_FORT_RUN: + return (_POSIX2_FORT_RUN); + case _SC_2_LOCALEDEF: + return (_POSIX2_LOCALEDEF); + case _SC_2_SW_DEV: + return (_POSIX2_SW_DEV); + case _SC_2_UPE: + return (_POSIX2_UPE); + case _SC_TZNAME_MAX: + path = _PATH_ZONEINFO; +do_NAME_MAX: + sverrno = errno; + errno = 0; + lvalue = pathconf(path, _PC_NAME_MAX); + if (lvalue == -1 && errno != 0) + return (-1); + errno = sverrno; + return (lvalue); + + case _SC_ASYNCHRONOUS_IO: +#if _POSIX_ASYNCHRONOUS_IO == 0 + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_ASYNCHRONOUS_IO; + break; +#else + return (_POSIX_ASYNCHRONOUS_IO); +#endif + case _SC_MAPPED_FILES: + return (_POSIX_MAPPED_FILES); + case _SC_MEMLOCK: + return (_POSIX_MEMLOCK); + case _SC_MEMLOCK_RANGE: + return (_POSIX_MEMLOCK_RANGE); + case _SC_MEMORY_PROTECTION: + return (_POSIX_MEMORY_PROTECTION); + case _SC_MESSAGE_PASSING: +#if _POSIX_MESSAGE_PASSING == 0 + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_MESSAGE_PASSING; + goto yesno; +#else + return (_POSIX_MESSAGE_PASSING); +#endif + case _SC_PRIORITIZED_IO: +#if _POSIX_PRIORITIZED_IO == 0 + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_PRIORITIZED_IO; + goto yesno; +#else + return (_POSIX_PRIORITIZED_IO); +#endif + case _SC_PRIORITY_SCHEDULING: +#if _POSIX_PRIORITY_SCHEDULING == 0 + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_PRIORITY_SCHEDULING; + goto yesno; +#else + return (_POSIX_PRIORITY_SCHEDULING); +#endif + case _SC_REALTIME_SIGNALS: +#if _POSIX_REALTIME_SIGNALS == 0 + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_REALTIME_SIGNALS; + goto yesno; +#else + return (_POSIX_REALTIME_SIGNALS); +#endif + case _SC_SEMAPHORES: +#if _POSIX_SEMAPHORES == 0 + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_SEMAPHORES; + goto yesno; +#else + return (_POSIX_SEMAPHORES); +#endif + case _SC_FSYNC: + return (_POSIX_FSYNC); + + case _SC_SHARED_MEMORY_OBJECTS: + return (_POSIX_SHARED_MEMORY_OBJECTS); + case _SC_SYNCHRONIZED_IO: +#if _POSIX_SYNCHRONIZED_IO == 0 + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_SYNCHRONIZED_IO; + goto yesno; +#else + return (_POSIX_SYNCHRONIZED_IO); +#endif + case _SC_TIMERS: +#if _POSIX_TIMERS == 0 + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_TIMERS; + goto yesno; +#else + return (_POSIX_TIMERS); +#endif + case _SC_AIO_LISTIO_MAX: +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_AIO_LISTIO_MAX) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_AIO_LISTIO_MAX; +#else + mib[0] = CTL_KERN;; + mib[1] = KERN_AIOMAX; +#endif + break; + case _SC_AIO_MAX: +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_AIO_MAX) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_AIO_MAX; +#else + mib[0] = CTL_KERN;; + mib[1] = KERN_AIOMAX; +#endif + break; + case _SC_AIO_PRIO_DELTA_MAX: +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_AIO_PRIO_DELTA_MAX) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_AIO_PRIO_DELTA_MAX; + break; +#else + return (-1); +#endif + case _SC_DELAYTIMER_MAX: +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_DELAYTIMER_MAX) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_DELAYTIMER_MAX; + goto yesno; +#else + return (-1); +#endif + case _SC_MQ_OPEN_MAX: +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_MQ_OPEN_MAX) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_MQ_OPEN_MAX; + goto yesno; +#else + return (-1); +#endif + case _SC_PAGESIZE: + defaultresult = getpagesize(); +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_PAGESIZE) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_PAGESIZE; + goto yesno; +#else + return defaultresult; +#endif + case _SC_RTSIG_MAX: +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_RTSIG_MAX) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_RTSIG_MAX; + goto yesno; +#else + return (-1); +#endif + case _SC_SEM_NSEMS_MAX: +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_RTSIG_MAX) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_SEM_NSEMS_MAX; + goto yesno; +#else + len = sizeof(value); + return (sysctlbyname("kern.sysv.semmns", &value, &len, NULL, 0) == -1 ? -1 : value); +#endif + + case _SC_SEM_VALUE_MAX: +#if SEM_VALUE_MAX == 0 + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_SEM_VALUE_MAX; + goto yesno; +#else + return (SEM_VALUE_MAX); +#endif + case _SC_SIGQUEUE_MAX: +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_SIGQUEUE_MAX) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_SIGQUEUE_MAX; + goto yesno; +#else + return (-1); +#endif + case _SC_TIMER_MAX: +#if defined(CTL_P1003_1B) && defined(CTL_P1003_1B_TIMER_MAX) + mib[0] = CTL_P1003_1B; + mib[1] = CTL_P1003_1B_TIMER_MAX; +#else + return (-1); +#endif + +yesno: + len = sizeof(value); + if (sysctl(mib, 2, &value, &len, NULL, 0) == -1) + return (-1); + if (value == 0) + return (defaultresult); + return ((long)value); + + case _SC_2_PBS: + case _SC_2_PBS_ACCOUNTING: + case _SC_2_PBS_CHECKPOINT: + case _SC_2_PBS_LOCATE: + case _SC_2_PBS_MESSAGE: + case _SC_2_PBS_TRACK: +#if _POSIX2_PBS == 0 +#error "don't know how to determine _SC_2_PBS" + /* + * This probably requires digging through the filesystem + * to see if the appropriate package has been installed. + * Since we don't currently support this option at all, + * it's not worth the effort to write the code now. + * Figuring out which of the sub-options are supported + * would be even more difficult, so it's probably easier + * to always say ``no''. + */ +#else + return (_POSIX2_PBS); +#endif + case _SC_ADVISORY_INFO: +#if _POSIX_ADVISORY_INFO == 0 +#error "_POSIX_ADVISORY_INFO" +#else + return (_POSIX_ADVISORY_INFO); +#endif + case _SC_BARRIERS: +#if _POSIX_BARRIERS == 0 +#error "_POSIX_BARRIERS" +#else + return (_POSIX_BARRIERS); +#endif + case _SC_CLOCK_SELECTION: +#if _POSIX_CLOCK_SELECTION == 0 +#error "_POSIX_CLOCK_SELECTION" +#else + return (_POSIX_CLOCK_SELECTION); +#endif + case _SC_CPUTIME: +#if _POSIX_CPUTIME == 0 +#error "_POSIX_CPUTIME" +#else + return (_POSIX_CPUTIME); +#endif + case _SC_FILE_LOCKING: + case _SC_GETGR_R_SIZE_MAX: +/* return sizeof(group) + group_name_max + group_passwd_max + max_group_member*(MAXLOGNAME+1); */ + return 4096; /* INT_MAX is too big for Perl */ + case _SC_GETPW_R_SIZE_MAX: + return 4096; + case _SC_HOST_NAME_MAX: + return (MAXHOSTNAMELEN - 1); /* does not include \0 */ + case _SC_LOGIN_NAME_MAX: + return (MAXLOGNAME); + case _SC_MONOTONIC_CLOCK: +#if _POSIX_MONOTONIC_CLOCK == 0 +#error "_POSIX_MONOTONIC_CLOCK" +#else + return (_POSIX_MONOTONIC_CLOCK); +#endif + case _SC_MQ_PRIO_MAX: + return (-1); + case _SC_READER_WRITER_LOCKS: + return (_POSIX_READER_WRITER_LOCKS); + case _SC_REGEXP: + return (_POSIX_REGEXP); + case _SC_SHELL: + return (_POSIX_SHELL); + case _SC_SPAWN: + return (_POSIX_SPAWN); + case _SC_SPIN_LOCKS: + return (_POSIX_SPIN_LOCKS); + case _SC_SPORADIC_SERVER: +#if _POSIX_SPORADIC_SERVER == 0 +#error "_POSIX_SPORADIC_SERVER" +#else + return (_POSIX_SPORADIC_SERVER); +#endif + case _SC_THREAD_ATTR_STACKADDR: + return (_POSIX_THREAD_ATTR_STACKADDR); + case _SC_THREAD_ATTR_STACKSIZE: + return (_POSIX_THREAD_ATTR_STACKSIZE); + case _SC_THREAD_CPUTIME: + return (_POSIX_THREAD_CPUTIME); + case _SC_THREAD_DESTRUCTOR_ITERATIONS: + return (PTHREAD_DESTRUCTOR_ITERATIONS); + case _SC_THREAD_KEYS_MAX: + return (PTHREAD_KEYS_MAX); + case _SC_THREAD_PRIO_INHERIT: + return (_POSIX_THREAD_PRIO_INHERIT); + case _SC_THREAD_PRIO_PROTECT: + return (_POSIX_THREAD_PRIO_PROTECT); + case _SC_THREAD_PRIORITY_SCHEDULING: + return (_POSIX_THREAD_PRIORITY_SCHEDULING); + case _SC_THREAD_PROCESS_SHARED: + return (_POSIX_THREAD_PROCESS_SHARED); + case _SC_THREAD_SAFE_FUNCTIONS: + return (_POSIX_THREAD_SAFE_FUNCTIONS); + case _SC_THREAD_SPORADIC_SERVER: + return (_POSIX_THREAD_SPORADIC_SERVER); + case _SC_THREAD_STACK_MIN: + return (PTHREAD_STACK_MIN); + case _SC_THREAD_THREADS_MAX: +#ifdef PTHREAD_THREADS_MAX + return (PTHREAD_THREADS_MAX); /* XXX wrong type! */ +#else + return (-1); +#endif + case _SC_TIMEOUTS: + return (_POSIX_TIMEOUTS); + case _SC_THREADS: + return (_POSIX_THREADS); + case _SC_TRACE: +#if _POSIX_TRACE == 0 +#error "_POSIX_TRACE" + /* While you're implementing this, also do the ones below. */ +#else + return (_POSIX_TRACE); +#endif + case _SC_TRACE_EVENT_FILTER: + return (_POSIX_TRACE_EVENT_FILTER); + case _SC_TRACE_INHERIT: + return (_POSIX_TRACE_INHERIT); + case _SC_TRACE_LOG: + return (_POSIX_TRACE_LOG); + case _SC_TTY_NAME_MAX: + path = "/"; // should be _PATH_DEV (PR-3624562) + goto do_NAME_MAX; + case _SC_TYPED_MEMORY_OBJECTS: +#if _POSIX_TYPED_MEMORY_OBJECTS == 0 +#error "_POSIX_TYPED_MEMORY_OBJECTS" +#else + return (_POSIX_TYPED_MEMORY_OBJECTS); +#endif + case _SC_V6_ILP32_OFF32: +#if _V6_ILP32_OFF32 == 0 + if (sizeof(int) * CHAR_BIT == 32 && + sizeof(int) == sizeof(long) && + sizeof(long) == sizeof(void *) && + sizeof(void *) == sizeof(off_t)) + return 1; + else + return -1; +#else + return (_V6_ILP32_OFF32); +#endif + case _SC_V6_ILP32_OFFBIG: +#if _V6_ILP32_OFFBIG == 0 + if (sizeof(int) * CHAR_BIT == 32 && + sizeof(int) == sizeof(long) && + sizeof(long) == sizeof(void *) && + sizeof(off_t) * CHAR_BIT >= 64) + return 1; + else + return -1; +#else + return (_V6_ILP32_OFFBIG); +#endif + case _SC_V6_LP64_OFF64: +#if _V6_LP64_OFF64 == 0 + if (sizeof(int) * CHAR_BIT == 32 && + sizeof(long) * CHAR_BIT == 64 && + sizeof(long) == sizeof(void *) && + sizeof(void *) == sizeof(off_t)) + return 1; + else + return -1; +#else + return (_V6_LP64_OFF64); +#endif + case _SC_V6_LPBIG_OFFBIG: +#if _V6_LPBIG_OFFBIG == 0 + if (sizeof(int) * CHAR_BIT >= 32 && + sizeof(long) * CHAR_BIT >= 64 && + sizeof(void *) * CHAR_BIT >= 64 && + sizeof(off_t) * CHAR_BIT >= 64) + return 1; + else + return -1; +#else + return (_V6_LPBIG_OFFBIG); +#endif + case _SC_ATEXIT_MAX: + return (INT_MAX); /* unlimited */ + case _SC_IOV_MAX: +#ifdef KERN_IOV_MAX + mib[0] = CTL_KERN; + mib[1] = KERN_IOV_MAX; + break; +#else + return (IOV_MAX); +#endif + case _SC_XOPEN_CRYPT: + return (_XOPEN_CRYPT); + case _SC_XOPEN_ENH_I18N: + return (_XOPEN_ENH_I18N); + case _SC_XOPEN_LEGACY: + return (_XOPEN_LEGACY); + case _SC_XOPEN_REALTIME: +#if _XOPEN_REALTIME == 0 + sverrno = errno; + value = sysconf(_SC_ASYNCHRONOUS_IO) > 0 && + sysconf(_SC_MEMLOCK) > 0 && + sysconf(_SC_MEMLOCK_RANGE) > 0 && + sysconf(_SC_MESSAGE_PASSING) > 0 && + sysconf(_SC_PRIORITY_SCHEDULING) > 0 && + sysconf(_SC_REALTIME_SIGNALS) > 0 && + sysconf(_SC_SEMAPHORES) > 0 && + sysconf(_SC_SHARED_MEMORY_OBJECTS) > 0 && + sysconf(_SC_SYNCHRONIZED_IO) > 0 && + sysconf(_SC_TIMERS) > 0; + errno = sverrno; + if (value) + return (200112L); + else + return (-1); +#else + return (_XOPEN_REALTIME); +#endif + case _SC_XOPEN_REALTIME_THREADS: +#if _XOPEN_REALTIME_THREADS == 0 +#error "_XOPEN_REALTIME_THREADS" +#else + return (_XOPEN_REALTIME_THREADS); +#endif + case _SC_XOPEN_SHM: + sverrno = errno; + len = sizeof(qdvalue); + if (sysctlbyname("kern.sysv.shmmin", &qdvalue, &len, NULL, + 0) == -1) { + errno = sverrno; + return (-1); + } + errno = sverrno; + return (1); + case _SC_XOPEN_STREAMS: + return (_XOPEN_STREAMS); + case _SC_XOPEN_UNIX: + return (_XOPEN_UNIX); +#ifdef _XOPEN_VERSION + case _SC_XOPEN_VERSION: + return (_XOPEN_VERSION); +#endif +#ifdef _XOPEN_XCU_VERSION + case _SC_XOPEN_XCU_VERSION: + return (_XOPEN_XCU_VERSION); +#endif + case _SC_SYMLOOP_MAX: + return (MAXSYMLINKS); + case _SC_RAW_SOCKETS: + return (_POSIX_RAW_SOCKETS); + case _SC_IPV6: +#if _POSIX_IPV6 == 0 + sverrno = errno; + value = socket(PF_INET6, SOCK_DGRAM, 0); + errno = sverrno; + if (value >= 0) { + close(value); + return (200112L); + } else + return (0); +#else + return (_POSIX_IPV6); +#endif + +#ifdef _SC_NPROCESSORS_CONF + case _SC_NPROCESSORS_CONF: +#endif +#ifdef _SC_NPROCESSORS_ONLN + case _SC_NPROCESSORS_ONLN: +#endif +#if defined(_SC_NPROCESSORS_CONF) || defined(_SC_NPROCESSORS_ONLN) + mib[0] = CTL_HW; + mib[1] = HW_NCPU; + break; +#endif + case _SC_XBS5_ILP32_OFF32: + return (_XBS5_ILP32_OFF32); + case _SC_XBS5_ILP32_OFFBIG: + return (_XBS5_ILP32_OFFBIG); + case _SC_XBS5_LP64_OFF64: + return (_XBS5_LP64_OFF64); + case _SC_XBS5_LPBIG_OFFBIG: + return (_XBS5_LPBIG_OFFBIG); + case _SC_SS_REPL_MAX: + return (_POSIX_SS_REPL_MAX); + case _SC_TRACE_EVENT_NAME_MAX: + return (_POSIX_TRACE_EVENT_NAME_MAX); + case _SC_TRACE_NAME_MAX: + return (_POSIX_TRACE_NAME_MAX); + case _SC_TRACE_SYS_MAX: + return (_POSIX_TRACE_SYS_MAX); + case _SC_TRACE_USER_EVENT_MAX: + return (_POSIX_TRACE_USER_EVENT_MAX); + case _SC_PASS_MAX: + return (PASS_MAX); + +#ifdef _SC_PHYS_PAGES + case _SC_PHYS_PAGES: +#ifdef __APPLE__ + { + long memsize; + long pagesize; + + len = sizeof(memsize); + if (sysctlbyname("hw.memsize", &memsize, &len, NULL, 0) == -1) + return (-1); + + len = sizeof(pagesize); + if (sysctlbyname("hw.pagesize", &pagesize, &len, NULL, 0) == -1) + return (-1); + + return (memsize / pagesize); + } +#else + len = sizeof(lvalue); + if (sysctlbyname("hw.availpages", &lvalue, &len, NULL, 0) == -1) + return (-1); + return (lvalue); +#endif +#endif + + default: + errno = EINVAL; + return (-1); + } + len = sizeof(value); + if (sysctl(mib, 2, &value, &len, NULL, 0) == -1) + value = -1; + return ((long)value); +} diff --git a/gen/FreeBSD/sysctl.3 b/gen/FreeBSD/sysctl.3 new file mode 100644 index 0000000..90c1990 --- /dev/null +++ b/gen/FreeBSD/sysctl.3 @@ -0,0 +1,727 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 +.\" $FreeBSD$ +.\" +.Dd May 17, 2013 +.Dt SYSCTL 3 +.Os +.Sh NAME +.Nm sysctl , +.Nm sysctlbyname , +.Nm sysctlnametomib +.Nd get or set system information +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/sysctl.h +.Ft int +.Fn sysctl "int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" +.Ft int +.Fn sysctlbyname "const char *name" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" +.Ft int +.Fn sysctlnametomib "const char *name" "int *mibp" "size_t *sizep" +.Sh DESCRIPTION +The +.Fn sysctl +function retrieves system information and allows processes with +appropriate privileges to set system information. +The information available from +.Fn sysctl +consists of integers, strings, and tables. +Information may be retrieved and set from the command interface +using the +.Xr sysctl 8 +utility. +.Pp +Unless explicitly noted below, +.Fn sysctl +returns a consistent snapshot of the data requested. +Consistency is obtained by locking the destination +buffer into memory so that the data may be copied out without blocking. +Calls to +.Fn sysctl +are serialized to avoid deadlock. +.Pp +The state is described using a ``Management Information Base'' (MIB) +style name, listed in +.Fa name , +which is a +.Fa namelen +length array of integers. +.Pp +The +.Fn sysctlbyname +function accepts an ASCII representation of the name and internally +looks up the integer name vector. +Apart from that, it behaves the same +as the standard +.Fn sysctl +function. +.Pp +The information is copied into the buffer specified by +.Fa oldp . +The size of the buffer is given by the location specified by +.Fa oldlenp +before the call, +and that location gives the amount of data copied after a successful call +and after a call that returns with the error code +.Er ENOMEM . +If the amount of data available is greater +than the size of the buffer supplied, +the call supplies as much data as fits in the buffer provided +and returns with the error code +.Er ENOMEM . +If the old value is not desired, +.Fa oldp +and +.Fa oldlenp +should be set to NULL. +.Pp +The size of the available data can be determined by calling +.Fn sysctl +with the +.Dv NULL +argument for +.Fa oldp . +The size of the available data will be returned in the location pointed to by +.Fa oldlenp . +For some operations, the amount of space may change often. +For these operations, +the system attempts to round up so that the returned size is +large enough for a call to return the data shortly thereafter. +.Pp +To set a new value, +.Fa newp +is set to point to a buffer of length +.Fa newlen +from which the requested value is to be taken. +If a new value is not to be set, +.Fa newp +should be set to NULL and +.Fa newlen +set to 0. +.Pp +The +.Fn sysctlnametomib +function accepts an ASCII representation of the name, +looks up the integer name vector, +and returns the numeric representation in the mib array pointed to by +.Fa mibp . +The number of elements in the mib array is given by the location specified by +.Fa sizep +before the call, +and that location gives the number of entries copied after a successful call. +The resulting +.Fa mib +and +.Fa size +may be used in subsequent +.Fn sysctl +calls to get the data associated with the requested ASCII name. +This interface is intended for use by applications that want to +repeatedly request the same variable (the +.Fn sysctl +function runs in about a third the time as the same request made via the +.Fn sysctlbyname +function). +.Pp +The top level names are defined with a CTL_ prefix in +.In sys/sysctl.h , +and are as follows. +The next and subsequent levels down are found in the include files +listed here, and described in separate sections below. +.Bl -column CTLXMACHDEPXXX "Next level namesXXXXXX" -offset indent +.It Sy "Name Next level names Description" +.It "CTL_DEBUG sys/sysctl.h Debugging" +.It "CTL_VFS sys/mount.h File system" +.It "CTL_HW sys/sysctl.h Generic CPU, I/O" +.It "CTL_KERN sys/sysctl.h High kernel limits" +.It "CTL_MACHDEP sys/sysctl.h Machine dependent" +.It "CTL_NET sys/socket.h Networking" +.It "CTL_USER sys/sysctl.h User-level" +.It "CTL_VM sys/resources.h Virtual memory (struct loadavg)" +.El +.Pp +For example, the following retrieves the maximum number of processes allowed +in the system: +.Pp +.Bd -literal -offset indent -compact +int maxproc; +size_t len = sizeof(maxproc); +sysctlbyname("kern.maxproc", &maxproc, &len, NULL, 0); +.Ed +.Pp +To retrieve the standard search path for the system utilities: +.Pp +.Bd -literal -offset indent -compact +char *p; +size_t len; +sysctlbyname("user.cs_path", NULL, &len, NULL, 0); +p = malloc(len); +sysctlbyname("user.cs_path", p, &len, NULL, 0); +.Ed +.Ss CTL_VFS +A distinguished second level name, VFS_GENERIC, +is used to get general information about all file systems. +One of its third level identifiers is VFS_MAXTYPENUM +that gives the highest valid file system type number. +Its other third level identifier is VFS_CONF that +returns configuration information about the file system +type given as a fourth level identifier (see +.Xr getvfsbyname 3 +as an example of its use). +The remaining second level identifiers are the +file system type number returned by a +.Xr statfs 2 +call or from VFS_CONF. +The third level identifiers available for each file system +are given in the header file that defines the mount +argument structure for that file system. +.Ss CTL_HW +The string and integer information available for the CTL_HW level +is detailed below. +The changeable column shows whether a process with appropriate +privilege may change the value. +.Bl -column "xxxxxxxxxxxxxxxxxxxxxxxxx" "xxxxxxxxxx" -offset indent +.It Sy "Name Type Changeable" +.It "hw.activecpu int32_t no" +.It "hw.byteorder int32_t no" +.It "hw.cacheconfig uint64_t[] no" +.It "hw.cachelinesize int64_t no" +.It "hw.cachesize uint64_t[] no" +.It "hw.cpu64bit_capable int32_t no" +.It "hw.cpufamily int32_t no" +.It "hw.cpufrequency int64_t no" +.It "hw.cpufrequency_max int64_t no" +.It "hw.cpufrequency_min int64_t no" +.It "hw.cpusubtype int32_t no" +.It "hw.cputhreadtype int32_t no" +.It "hw.cputype int32_t no" +.It "hw.l1dcachesize int64_t no" +.It "hw.l1icachesize int64_t no" +.It "hw.l2cachesize int64_t no" +.It "hw.l3cachesize int64_t no" +.It "hw.logicalcpu int32_t no" +.It "hw.logicalcpu_max int32_t no" +.It "hw.machine char[] no" +.It "hw.memsize int64_t no" +.It "hw.model char[] no" +.It "hw.ncpu int32_t no" +.It "hw.packages int32_t no" +.It "hw.pagesize int64_t no" +.It "hw.physicalcpu int32_t no" +.It "hw.physicalcpu_max int32_t no" +.It "hw.tbfrequency int64_t no" +.El +.Bl -tag -width 6n +.It Li "hw.byteorder" +The byte order (4321 or 1234). +.It Li "hw.model" +The machine model. +.It Li "hw.ncpu" +The number of cpus. This attribute is deprecated and it is recommended that +.Va "hw.logicalcpu" , +.Va "hw.logicalcpu_max" , +.Va "hw.physicalcpu" , +or +.Va "hw.physicalcpu_max" +be used instead. +.It Li "hw.logicalcpu" +The number of logical processors available in the current power management mode. +.It Li "hw.logicalcpu_max" +The maximum number of logical processors that could be available this boot. +.It Li "hw.physicalcpu" +The number of physical processors available in the current power management mode. +.It Li "hw.physicalcpu_max" +The maximum number of physical processors that could be available this boot. +.It Li "hw.pagesize" +The software page size in bytes. +.El +.Ss CTL_KERN +The string and integer information available for the CTL_KERN level +is detailed below. +The changeable column shows whether a process with appropriate +privilege may change the value. +The types of data currently available are process information, +system vnodes, the open file entries, routing table entries, +virtual memory statistics, load average history, and clock rate +information. +.Bl -column "xxxxxxxxxxxxxxxxxxxxxxxxx" "xxxxxxxxxxxxxxxxxxxx" -offset indent +.It Sy "Name Type Changeable" +.It "kern.argmax int32_t no" +.It "kern.bootargs char[] no" +.It "kern.boottime struct timeval no" +.It "kern.check_openevt int32_t yes" +.It "kern.clockrate struct clockinfo no" +.It "kern.coredump int32_t yes" +.It "kern.corefile char[] yes" +.It "kern.flush_cache_on_write int32_t yes" +.It "kern.hostid int32_t yes" +.It "kern.hostname char[] yes" +.It "kern.job_control int32_t no" +.It "kern.maxfiles int32_t yes" +.It "kern.maxfilesperproc int32_t yes" +.It "kern.maxnbuf int32_t yes" +.It "kern.maxproc int32_t yes" +.It "kern.maxprocperuid int32_t yes" +.It "kern.maxvnodes int32_t yes" +.It "kern.msgbuf int32_t yes" +.It "kern.nbuf int32_t no" +.It "kern.netboot int32_t no" +.It "kern.ngroups int32_t no" +.It "kern.nisdomainname char[] yes" +.It "kern.num_files int32_t no" +.It "kern.num_tasks int32_t no" +.It "kern.num_taskthreads int32_t no" +.It "kern.num_threads int32_t no" +.It "kern.num_vnodes int32_t no" +.It "kern.nx int32_t yes" +.It "kern.osrelease char[] no" +.It "kern.osrevision int32_t no" +.It "kern.ostype char[] no" +.It "kern.osversion char[] yes" +.It "kern.posix1version int32_t no" +.It "kern.procname char[] yes" +.It "kern.safeboot int32_t no" +.It "kern.saved_ids int32_t no" +.It "kern.secure_kernel int32_t no" +.It "kern.securelevel int32_t yes" +.It "kern.singleuser int32_t no" +.It "kern.sleeptime struct timeval no" +.It "kern.slide int32_t no" +.It "kern.stack_depth_max int32_t no" +.It "kern.stack_size int32_t no" +.It "kern.sugid_coredump int32_t yes" +.It "kern.sugid_scripts int32_t yes" +.It "kern.symfile char[] no" +.It "kern.usrstack int32_t no" +.It "kern.usrstack64 int64_t no" +.It "kern.uuid char[] no" +.It "kern.version char[] no" +.It "kern.waketime struct timeval no" +.El +.Bl -tag -width 6n +.It Li "kern.argmax" +The maximum bytes of argument to +.Xr execve 2 . +.It Li "kern.boottime" +A +.Va struct timeval +structure is returned. +This structure contains the time that the system was booted. +.It Li "kern.clockrate" +A +.Va struct clockinfo +structure is returned. +This structure contains the clock, statistics clock and profiling clock +frequencies, the number of micro-seconds per hz tick and the skew rate. +.It Li "kern.hostid" +Get or set the host id. +.It Li "kern.hostname" +Get or set the hostname. +.It Li "kern.job_control" +Return 1 if job control is available on this system, otherwise 0. +.It Li "kern.maxfiles" +The maximum number of files that may be open in the system. +.It Li "kern.maxfilesperproc" +The maximum number of files that may be open for a single process. +This limit only applies to processes with an effective uid of nonzero +at the time of the open request. +Files that have already been opened are not affected if the limit +or the effective uid is changed. +.It Li "kern.maxproc" +The maximum number of concurrent processes the system will allow. +.It Li "kern.maxprocperuid" +The maximum number of concurrent processes the system will allow +for a single effective uid. +This limit only applies to processes with an effective uid of nonzero +at the time of a fork request. +Processes that have already been started are not affected if the limit +is changed. +.It Li "kern.maxvnodes" +The maximum number of vnodes available on the system. +.It Li "kern.ngroups" +The maximum number of supplemental groups. +.It Li "kern.nisdomainname" +The name of the current YP/NIS domain. +.It Li "kern.osrelease" +The system release string. +.It Li "kern.osrevision" +The system revision number. +.It Li "kern.ostype" +The system type string. +.It Li "kern.posix1version" +The version of +.St -p1003.1 +with which the system +attempts to comply. +.It Li "kern.saved_ids" +Returns 1 if saved set-group and saved set-user ID is available. +.It Li "kern.securelevel" +The system security level. +This level may be raised by processes with appropriate privilege. +It may not be lowered. +.It Li "kern.version" +The system version string. +.El +.Ss CTL_MACHDEP +The set of variables defined is architecture dependent. +The following variables are defined for the i386 architecture. +.Bl -column "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "xxxxxxxxxx" -offset indent +.It Sy "Name Type Changeable" +.It "machdep.cpu.address_bits.physical int32_t no" +.It "machdep.cpu.address_bits.virtual int32_t no" +.It "machdep.cpu.brand int32_t no" +.It "machdep.cpu.brand_string char[] no" +.It "machdep.cpu.cache.L2_associativity int32_t no" +.It "machdep.cpu.cache.linesize int32_t no" +.It "machdep.cpu.cache.size int32_t no" +.It "machdep.cpu.core_count int32_t no" +.It "machdep.cpu.cores_per_package int32_t no" +.It "machdep.cpu.extfamily int32_t no" +.It "machdep.cpu.extfeature_bits int64_t no" +.It "machdep.cpu.extfeatures char[] no" +.It "machdep.cpu.extmodel int32_t no" +.It "machdep.cpu.family int32_t no" +.It "machdep.cpu.feature_bits int64_t no" +.It "machdep.cpu.features char[] no" +.It "machdep.cpu.leaf7_feature_bits uint32_t no" +.It "machdep.cpu.leaf7_features char[] no" +.It "machdep.cpu.logical_per_package int32_t no" +.It "machdep.cpu.max_basic uint32_t no" +.It "machdep.cpu.max_ext uint32_t no" +.It "machdep.cpu.microcode_version int32_t no" +.It "machdep.cpu.model int32_t no" +.It "machdep.cpu.processor_flag int32_t no" +.It "machdep.cpu.signature int32_t no" +.It "machdep.cpu.stepping int32_t no" +.It "machdep.cpu.thread_count int32_t no" +.It "machdep.cpu.tlb.data.large int32_t no" +.It "machdep.cpu.tlb.data.large_level1 int32_t no" +.It "machdep.cpu.tlb.data.small int32_t no" +.It "machdep.cpu.tlb.data.small_level1 int32_t no" +.It "machdep.cpu.tlb.inst.large int32_t no" +.It "machdep.cpu.tlb.inst.small int32_t no" +.It "machdep.cpu.tlb.shared int32_t no" +.It "machdep.cpu.ucupdate int32_t yes" +.It "machdep.cpu.vendor char[] no" +.It "machdep.cpu.xsave.extended_state uint32_t no" +.It "machdep.tsc.deep_idle_rebase uint32_t yes" +.It "machdep.tsc.frequency int64_t no" +.It "machdep.tsc.nanotime.generation uint32_t no" +.It "machdep.tsc.nanotime.shift uint32_t no" +.El +.Ss CTL_NET +The string and integer information available for the CTL_NET level +is detailed below. +The changeable column shows whether a process with appropriate +privilege may change the value. +.Bl -column "Second level nameXXXXXX" "routing messagesXXX" -offset indent +.It Sy "Second level name Type Changeable" +.It "PF_ROUTE routing messages no" +.It "PF_INET IPv4 values yes" +.It "PF_INET6 IPv6 values yes" +.El +.Bl -tag -width 6n +.It Li PF_ROUTE +Return the entire routing table or a subset of it. +The data is returned as a sequence of routing messages (see +.Xr route 4 +for the header file, format and meaning). +The length of each message is contained in the message header. +.Pp +The third level name is a protocol number, which is currently always 0. +The fourth level name is an address family, which may be set to 0 to +select all address families. +The fifth, sixth, and seventh level names are as follows: +.Bl -column -offset indent "Fifth level Sixth level" "Seventh level" +.It Sy "Fifth level Sixth level" Ta Sy "Seventh level" +.It "NET_RT_FLAGS rtflags" Ta "None" +.It "NET_RT_DUMP None" Ta "None or fib number" +.It "NET_RT_IFLIST 0 or if_index" Ta None +.It "NET_RT_IFMALIST 0 or if_index" Ta None +.It "NET_RT_IFLISTL 0 or if_index" Ta None +.El +.Pp +The +.Dv NET_RT_IFMALIST +name returns information about multicast group memberships on all interfaces +if 0 is specified, or for the interface specified by +.Va if_index . +.It Li PF_INET +Get or set various global information about the IPv4 +(Internet Protocol version 4). +The third level name is the protocol. +The fourth level name is the variable name. +The currently defined protocols and names are: +.Bl -column ProtocolXX VariableXX TypeXX ChangeableXX +.It Sy "Protocol Variable Type Changeable" +.It "icmp bmcastecho integer yes" +.It "icmp maskrepl integer yes" +.It "ip forwarding integer yes" +.It "ip redirect integer yes" +.It "ip ttl integer yes" +.It "udp checksum integer yes" +.El +.Pp +The variables are as follows: +.Bl -tag -width 6n +.It Li icmp.bmcastecho +Returns 1 if an ICMP echo request to a broadcast or multicast address is +to be answered. +.It Li icmp.maskrepl +Returns 1 if ICMP network mask requests are to be answered. +.It Li ip.forwarding +Returns 1 when IP forwarding is enabled for the host, +meaning that the host is acting as a router. +.It Li ip.redirect +Returns 1 when ICMP redirects may be sent by the host. +This option is ignored unless the host is routing IP packets, +and should normally be enabled on all systems. +.It Li ip.ttl +The maximum time-to-live (hop count) value for an IP packet sourced by +the system. +This value applies to normal transport protocols, not to ICMP. +.It Li udp.checksum +Returns 1 when UDP checksums are being computed and checked. +Disabling UDP checksums is strongly discouraged. +.Pp +For variables net.inet.*.ipsec, please refer to +.Xr ipsec 4 . +.El +.It Li PF_INET6 +Get or set various global information about the IPv6 +(Internet Protocol version 6). +The third level name is the protocol. +The fourth level name is the variable name. +.Pp +For variables net.inet6.* please refer to +.Xr inet6 4 . +For variables net.inet6.*.ipsec6, please refer to +.Xr ipsec 4 . +.El +.Ss CTL_USER +The string and integer information available for the CTL_USER level +is detailed below. +The changeable column shows whether a process with appropriate +privilege may change the value. +.Bl -column "xxxxxxxxxxxxxxxxxxxxxxxxx" "xxxxxxxxxx" -offset indent +.It Sy "Name Type Changeable" +.It "user.bc_base_max int32_t no" +.It "user.bc_dim_max int32_t no" +.It "user.bc_scale_max int32_t no" +.It "user.bc_string_max int32_t no" +.It "user.coll_weights_max int32_t no" +.It "user.cs_path char[] no" +.It "user.expr_nest_max int32_t no" +.It "user.line_max int32_t no" +.It "user.posix2_c_bind int32_t no" +.It "user.posix2_c_dev int32_t no" +.It "user.posix2_char_term int32_t no" +.It "user.posix2_fort_dev int32_t no" +.It "user.posix2_fort_run int32_t no" +.It "user.posix2_localedef int32_t no" +.It "user.posix2_sw_dev int32_t no" +.It "user.posix2_upe int32_t no" +.It "user.posix2_version int32_t no" +.It "user.re_dup_max int32_t no" +.It "user.stream_max int32_t no" +.It "user.tzname_max int32_t no" +.El +.Bl -tag -width 6n +.Pp +.It Li "user.bc_base_max" +The maximum ibase/obase values in the +.Xr bc 1 +utility. +.It Li "user.bc_dim_max" +The maximum array size in the +.Xr bc 1 +utility. +.It Li "user.bc_scale_max" +The maximum scale value in the +.Xr bc 1 +utility. +.It Li "user.bc_string_max" +The maximum string length in the +.Xr bc 1 +utility. +.It Li "user.coll_weights_max" +The maximum number of weights that can be assigned to any entry of +the LC_COLLATE order keyword in the locale definition file. +.It Li "user.cs_path" +Return a value for the +.Ev PATH +environment variable that finds all the standard utilities. +.It Li "user.expr_nest_max" +The maximum number of expressions that can be nested within +parenthesis by the +.Xr expr 1 +utility. +.It Li "user.line_max" +The maximum length in bytes of a text-processing utility's input +line. +.It Li "user.posix2_c_bind" +Return 1 if the system's C-language development facilities support the +C-Language Bindings Option, otherwise 0. +.It Li "user.posix2_c_dev" +Return 1 if the system supports the C-Language Development Utilities Option, +otherwise 0. +.It Li "user.posix2_char_term" +Return 1 if the system supports at least one terminal type capable of +all operations described in +.St -p1003.2 , +otherwise 0. +.It Li "user.posix2_fort_dev" +Return 1 if the system supports the FORTRAN Development Utilities Option, +otherwise 0. +.It Li "user.posix2_fort_run" +Return 1 if the system supports the FORTRAN Runtime Utilities Option, +otherwise 0. +.It Li "user.posix2_localedef" +Return 1 if the system supports the creation of locales, otherwise 0. +.It Li "user.posix2_sw_dev" +Return 1 if the system supports the Software Development Utilities Option, +otherwise 0. +.It Li "user.posix2_upe" +Return 1 if the system supports the User Portability Utilities Option, +otherwise 0. +.It Li "user.posix2_version" +The version of +.St -p1003.2 +with which the system attempts to comply. +.It Li "user.re_dup_max" +The maximum number of repeated occurrences of a regular expression +permitted when using interval notation. +.It Li "user.stream_max" +The minimum maximum number of streams that a process may have open +at any one time. +.It Li "user.tzname_max" +The minimum maximum number of types supported for the name of a +timezone. +.El +.Ss CTL_VM +The string and integer information available for the CTL_VM level +is detailed below. +The changeable column shows whether a process with appropriate +privilege may change the value. +.Bl -column "xxxxxxxxxxxxxxxxxxxxxxxxx" "xxxxxxxxxx" -offset indent +.It Sy "Name Type Changeable" +.It "vm.loadavg struct loadavg no" +.It "vm.swapusage struct xsw_usage no" +.El +.Pp +.Bl -tag -width 6n +.It Li "vm.loadavg" +Return the load average history. +The returned data consists of a +.Va struct loadavg . +.El +.Sh RETURN VALUES +.Rv -std +.Sh FILES +.Bl -tag -width -compact +.It In sys/sysctl.h +definitions for top level identifiers, second level kernel and hardware +identifiers, and user level identifiers +.It In sys/socket.h +definitions for second level network identifiers +.It In netinet/in.h +definitions for third level IPv4/IPv6 identifiers and +fourth level IPv4/v6 identifiers +.It In netinet/icmp_var.h +definitions for fourth level ICMP identifiers +.It In netinet/icmp6.h +definitions for fourth level ICMPv6 identifiers +.It In netinet/udp_var.h +definitions for fourth level UDP identifiers +.El +.Sh ERRORS +The following errors may be reported: +.Bl -tag -width Er +.It Bq Er EFAULT +The buffer +.Fa name , +.Fa oldp , +.Fa newp , +or length pointer +.Fa oldlenp +contains an invalid address. +.It Bq Er EINVAL +The +.Fa name +array is less than two or greater than CTL_MAXNAME. +.It Bq Er EINVAL +A non-null +.Fa newp +is given and its specified length in +.Fa newlen +is too large or too small. +.It Bq Er ENOMEM +The length pointed to by +.Fa oldlenp +is too short to hold the requested value. +.It Bq Er ENOMEM +The smaller of either the length pointed to by +.Fa oldlenp +or the estimated size of the returned data exceeds the +system limit on locked memory. +.It Bq Er ENOMEM +Locking the buffer +.Fa oldp , +or a portion of the buffer if the estimated size of the data +to be returned is smaller, +would cause the process to exceed its per-process locked memory limit. +.It Bq Er ENOTDIR +The +.Fa name +array specifies an intermediate rather than terminal name. +.It Bq Er EISDIR +The +.Fa name +array specifies a terminal name, but the actual name is not terminal. +.It Bq Er ENOENT +The +.Fa name +array specifies a value that is unknown. +.It Bq Er EPERM +An attempt is made to set a read-only value. +.It Bq Er EPERM +A process without appropriate privilege attempts to set a value. +.El +.Sh SEE ALSO +.Xr confstr 3 , +.Xr sysconf 3 , +.Xr sysctl 8 +.Sh HISTORY +The +.Fn sysctl +function first appeared in +.Bx 4.4 . diff --git a/gen/FreeBSD/sysctl.c b/gen/FreeBSD/sysctl.c new file mode 100644 index 0000000..c890aae --- /dev/null +++ b/gen/FreeBSD/sysctl.c @@ -0,0 +1,206 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sysctl.c 8.2 (Berkeley) 1/4/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/sysctl.c,v 1.6 2007/01/09 00:27:55 imp Exp $"); + +#include +#include + +#include +#include +#include +#include +#include +#include + +extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen); + +int +sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) +__attribute__((disable_tail_calls)) +{ + if (name[0] != CTL_USER) { + if (namelen == 2 && name[0] == CTL_KERN && name[1] == KERN_EXEC) { + /* + * 7723306: intercept kern.exec and fake a return of + * a dummy string ("/" in this case) + */ + if (newp != NULL) { + errno = EPERM; + return -1; + } + if (oldp == NULL) { + if (oldlenp != NULL) *oldlenp = 2; + return 0; + } + if (oldlenp == NULL) { + errno = EFAULT; + return -1; + } + if (*oldlenp < 2) { + errno = ENOMEM; + return -1; + } + memmove(oldp, "/", 2); + *oldlenp = 2; + return 0; + } + return (__sysctl(name, namelen, oldp, oldlenp, newp, newlen)); + } + + if (newp != NULL) { + errno = EPERM; + return (-1); + } + if (namelen != 2) { + errno = EINVAL; + return (-1); + } + + switch (name[1]) { + case USER_CS_PATH: + if (oldp && *oldlenp < sizeof(_PATH_STDPATH)) { + errno = ENOMEM; + return -1; + } + *oldlenp = sizeof(_PATH_STDPATH); + if (oldp != NULL) + memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); + return (0); + } + + if (oldp && *oldlenp < sizeof(int)) { + errno = ENOMEM; + return (-1); + } + *oldlenp = sizeof(int); + if (oldp == NULL) + return (0); + + switch (name[1]) { + case USER_BC_BASE_MAX: + *(int *)oldp = BC_BASE_MAX; + return (0); + case USER_BC_DIM_MAX: + *(int *)oldp = BC_DIM_MAX; + return (0); + case USER_BC_SCALE_MAX: + *(int *)oldp = BC_SCALE_MAX; + return (0); + case USER_BC_STRING_MAX: + *(int *)oldp = BC_STRING_MAX; + return (0); + case USER_COLL_WEIGHTS_MAX: + *(int *)oldp = COLL_WEIGHTS_MAX; + return (0); + case USER_EXPR_NEST_MAX: + *(int *)oldp = EXPR_NEST_MAX; + return (0); + case USER_LINE_MAX: + *(int *)oldp = LINE_MAX; + return (0); + case USER_RE_DUP_MAX: + *(int *)oldp = RE_DUP_MAX; + return (0); + case USER_POSIX2_VERSION: + *(int *)oldp = _POSIX2_VERSION; + return (0); + case USER_POSIX2_C_BIND: +#ifdef POSIX2_C_BIND + *(int *)oldp = 1; +#else + *(int *)oldp = 0; +#endif + return (0); + case USER_POSIX2_C_DEV: +#ifdef POSIX2_C_DEV + *(int *)oldp = 1; +#else + *(int *)oldp = 0; +#endif + return (0); + case USER_POSIX2_CHAR_TERM: +#ifdef POSIX2_CHAR_TERM + *(int *)oldp = 1; +#else + *(int *)oldp = 0; +#endif + return (0); + case USER_POSIX2_FORT_DEV: +#ifdef POSIX2_FORT_DEV + *(int *)oldp = 1; +#else + *(int *)oldp = 0; +#endif + return (0); + case USER_POSIX2_FORT_RUN: +#ifdef POSIX2_FORT_RUN + *(int *)oldp = 1; +#else + *(int *)oldp = 0; +#endif + return (0); + case USER_POSIX2_LOCALEDEF: +#ifdef POSIX2_LOCALEDEF + *(int *)oldp = 1; +#else + *(int *)oldp = 0; +#endif + return (0); + case USER_POSIX2_SW_DEV: +#ifdef POSIX2_SW_DEV + *(int *)oldp = 1; +#else + *(int *)oldp = 0; +#endif + return (0); + case USER_POSIX2_UPE: +#ifdef POSIX2_UPE + *(int *)oldp = 1; +#else + *(int *)oldp = 0; +#endif + return (0); + case USER_STREAM_MAX: + *(int *)oldp = FOPEN_MAX; + return (0); + case USER_TZNAME_MAX: + *(int *)oldp = NAME_MAX; + return (0); + default: + errno = EINVAL; + return (-1); + } + /* NOTREACHED */ +} diff --git a/gen/FreeBSD/sysctlbyname.c b/gen/FreeBSD/sysctlbyname.c new file mode 100644 index 0000000..c79d132 --- /dev/null +++ b/gen/FreeBSD/sysctlbyname.c @@ -0,0 +1,54 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp + * ---------------------------------------------------------------------------- + * + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/sysctlbyname.c,v 1.5 2002/02/01 00:57:29 obrien Exp $"); + +#include +#include +#include +#include +#include + +extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen); +extern int +__sysctlbyname(const char *name, size_t namelen, void *oldp, size_t *oldlenp, void *newp, + size_t newlen); + +int +sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp, + size_t newlen) +{ + int name2oid_oid[2]; + int real_oid[CTL_MAXNAME+2]; + int error; + size_t oidlen; + +#if !TARGET_IPHONE_SIMULATOR + /* Try primary system call first, fall back if not supported */ + error = __sysctlbyname(name, strlen(name), oldp, oldlenp, newp, newlen); + if ((error == 0) || (errno != ENOSYS)) + return error; +#endif /* !TARGET_IPHONE_SIMULATOR */ + + name2oid_oid[0] = 0; /* This is magic & undocumented! */ + name2oid_oid[1] = 3; + + oidlen = sizeof(real_oid); + error = __sysctl(name2oid_oid, 2, real_oid, &oidlen, (void *)name, + strlen(name)); + if (error < 0) + return error; + oidlen /= sizeof (int); + error = __sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen); + return (error); +} + diff --git a/gen/FreeBSD/sysctlnametomib.c b/gen/FreeBSD/sysctlnametomib.c new file mode 100644 index 0000000..3b19413 --- /dev/null +++ b/gen/FreeBSD/sysctlnametomib.c @@ -0,0 +1,58 @@ +/* + * Copyright 2001 The FreeBSD Project. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/sysctlnametomib.c,v 1.4 2003/01/04 00:11:11 tjr Exp $"); + +#include +#include +#include + +extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen); + +/* + * This function uses a presently undocumented interface to the kernel + * to walk the tree and get the type so it can print the value. + * This interface is under work and consideration, and should probably + * be killed with a big axe by the first person who can find the time. + * (be aware though, that the proper interface isn't as obvious as it + * may seem, there are various conflicting requirements. + */ +int +sysctlnametomib(const char *name, int *mibp, size_t *sizep) +{ + int oid[2]; + int error; + + oid[0] = 0; + oid[1] = 3; + + *sizep *= sizeof (int); + error = __sysctl(oid, 2, mibp, sizep, (void *)name, strlen(name)); + *sizep /= sizeof (int); + return (error); +} diff --git a/gen/FreeBSD/telldir.c b/gen/FreeBSD/telldir.c new file mode 100644 index 0000000..838876c --- /dev/null +++ b/gen/FreeBSD/telldir.c @@ -0,0 +1,197 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)telldir.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" +#include "telldir.h" + +/* + * return a pointer into a directory + */ +long +telldir(DIR *dirp) +{ + struct ddloc *lp; + long idx; + + if (__isthreaded) + _pthread_mutex_lock(&dirp->dd_lock); + LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { +#if __DARWIN_64_BIT_INO_T + if (lp->loc_seek == dirp->dd_td->seekoff && +#else /* !__DARWIN_64_BIT_INO_T */ + if (lp->loc_seek == dirp->dd_seek && +#endif /* __DARWIN_64_BIT_INO_T */ + lp->loc_loc == dirp->dd_loc) + break; + } + if (lp == NULL) { + lp = malloc(sizeof(struct ddloc)); + if (lp == NULL) { + if (__isthreaded) + _pthread_mutex_unlock(&dirp->dd_lock); + return (-1); + } + lp->loc_index = dirp->dd_td->td_loccnt++; +#if __DARWIN_64_BIT_INO_T + lp->loc_seek = dirp->dd_td->seekoff; +#else /* !__DARWIN_64_BIT_INO_T */ + lp->loc_seek = dirp->dd_seek; +#endif /* __DARWIN_64_BIT_INO_T */ + lp->loc_loc = dirp->dd_loc; + LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); + } + idx = lp->loc_index; + if (__isthreaded) + _pthread_mutex_unlock(&dirp->dd_lock); + return (idx); +} + +/* + * seek to an entry in a directory. + * Only values returned by "telldir" should be passed to seekdir. + */ +void +_seekdir(DIR *dirp, long loc) +{ + struct ddloc *lp; + struct dirent *dp; + + LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { + if (lp->loc_index == loc) + break; + } + if (lp == NULL) + return; +#if __DARWIN_64_BIT_INO_T + if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_td->seekoff) +#else /* !__DARWIN_64_BIT_INO_T */ + if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) +#endif /* __DARWIN_64_BIT_INO_T */ + return; + + /* If it's within the same chunk of data, don't bother reloading. */ +#if __DARWIN_64_BIT_INO_T + if (lp->loc_seek == dirp->dd_td->seekoff) { +#else /* !__DARWIN_64_BIT_INO_T */ + if (lp->loc_seek == dirp->dd_seek) { +#endif /* __DARWIN_64_BIT_INO_T */ + /* + * If we go back to 0 don't make the next readdir + * trigger a call to getdirentries(). + */ + if (lp->loc_loc == 0) + dirp->dd_flags |= __DTF_SKIPREAD; + dirp->dd_loc = lp->loc_loc; + return; + } + (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); +#if __DARWIN_64_BIT_INO_T + dirp->dd_td->seekoff = lp->loc_seek; +#else /* !__DARWIN_64_BIT_INO_T */ + dirp->dd_seek = lp->loc_seek; +#endif /* __DARWIN_64_BIT_INO_T */ + dirp->dd_loc = 0; + dirp->dd_flags &= ~(__DTF_SKIPREAD | __DTF_ATEND); /* current contents are invalid */ + while (dirp->dd_loc < lp->loc_loc) { + dp = _readdir_unlocked(dirp, 0); + if (dp == NULL) + break; + } +} + +#if defined(DARLING) && defined(VARIANT_LEGACY) +// we can't include this in libc-gen_legacy because the noinode64 variant already +// defines it exactly as it is in the legacy variant, and it causes a duplicate +// symbol error (which we resolve here be removing it from the legacy variant since, +// as noted earlier, the legacy and noinode64 version are exactly the same) +extern void _fixtelldir(DIR *dirp, long oldseek, long oldloc); +#else +/* + * After readdir returns the last entry in a block, a call to telldir + * returns a location that is after the end of that last entry. + * However, that location doesn't refer to a valid directory entry. + * Ideally, the call to telldir would return a location that refers to + * the first entry in the next block. That location is not known + * until the next block is read, so readdir calls this function after + * fetching a new block to fix any such telldir locations. + */ +void +_fixtelldir(DIR *dirp, long oldseek, long oldloc) +{ + struct ddloc *lp; + + lp = LIST_FIRST(&dirp->dd_td->td_locq); + if (lp != NULL) { + if (lp->loc_loc == oldloc && + lp->loc_seek == oldseek) { +#if __DARWIN_64_BIT_INO_T + lp->loc_seek = dirp->dd_td->seekoff; +#else /* !__DARWIN_64_BIT_INO_T */ + lp->loc_seek = dirp->dd_seek; +#endif /* __DARWIN_64_BIT_INO_T */ + lp->loc_loc = dirp->dd_loc; + } + } +} +#endif + +#ifndef BUILDING_VARIANT +/* + * Reclaim memory for telldir cookies which weren't used. + */ +void +_reclaim_telldir(DIR *dirp) +{ + struct ddloc *lp; + struct ddloc *templp; + + lp = LIST_FIRST(&dirp->dd_td->td_locq); + while (lp != NULL) { + templp = lp; + lp = LIST_NEXT(lp, loc_lqe); + free(templp); + } + LIST_INIT(&dirp->dd_td->td_locq); +} +#endif diff --git a/gen/FreeBSD/telldir.h b/gen/FreeBSD/telldir.h new file mode 100644 index 0000000..6b7902d --- /dev/null +++ b/gen/FreeBSD/telldir.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Copyright (c) 2000 + * Daniel Eischen. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/gen/telldir.h,v 1.3 2008/05/05 14:05:23 kib Exp $ + */ + +#ifndef _TELLDIR_H_ +#define _TELLDIR_H_ + +#include +#include + +/* + * One of these structures is malloced to describe the current directory + * position each time telldir is called. It records the current magic + * cookie returned by getdirentries and the offset within the buffer + * associated with that return value. + */ +struct ddloc { + LIST_ENTRY(ddloc) loc_lqe; /* entry in list */ + long loc_index; /* key associated with structure */ +#if __DARWIN_64_BIT_INO_T + __darwin_off_t loc_seek; /* returned by lseek */ +#else /* !__DARWIN_64_BIT_INO_T */ + long loc_seek; /* magic cookie returned by getdirentries */ +#endif /* __DARWIN_64_BIT_INO_T */ + long loc_loc; /* offset of entry in buffer */ +}; + +/* + * One of these structures is malloced for each DIR to record telldir + * positions. + */ +struct _telldir { + LIST_HEAD(, ddloc) td_locq; /* list of locations */ + long td_loccnt; /* index of entry for sequential readdir's */ +#if __DARWIN_64_BIT_INO_T + __darwin_off_t seekoff; /* 64-bit seek offset */ +#endif /* __DARWIN_64_BIT_INO_T */ +}; + +/* + * This lets paths like `/` or top-level bundles to return in a single + * __getdirentries64 while keeping pressure on malloc small. + */ +#define READDIR_INITIAL_SIZE 2048 +#define READDIR_LARGE_SIZE (8 << 10) + +#if __DARWIN_64_BIT_INO_T +size_t __getdirentries64(int fd, void *buf, size_t bufsize, __darwin_off_t *basep); +#endif /* __DARWIN_64_BIT_INO_T */ +__attribute__ ((visibility ("hidden"))) +bool _filldir(DIR *, bool) __DARWIN_INODE64(_filldir); +struct dirent *_readdir_unlocked(DIR *, int) __DARWIN_INODE64(_readdir_unlocked); +void _reclaim_telldir(DIR *); +void _seekdir(DIR *, long) __DARWIN_ALIAS_I(_seekdir); +__attribute__ ((visibility ("hidden"))) +void _fixtelldir(DIR *dirp, long oldseek, long oldloc) __DARWIN_INODE64(_fixtelldir); +long telldir(DIR *) __DARWIN_ALIAS_I(telldir); + +#endif diff --git a/gen/FreeBSD/termios.c b/gen/FreeBSD/termios.c new file mode 100644 index 0000000..9b0bb2c --- /dev/null +++ b/gen/FreeBSD/termios.c @@ -0,0 +1,280 @@ +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)termios.c 8.2 (Berkeley) 2/21/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/termios.c,v 1.16 2009/05/07 13:49:48 ed Exp $"); + +#if __DARWIN_UNIX03 +#ifdef VARIANT_CANCELABLE +#include +#endif /* VARIANT_CANCELABLE */ +#endif /* __DARWIN_UNIX03 */ + +#include "namespace.h" +#include +#include +#include +#include + +#include +#include +#include +#include "un-namespace.h" + +#ifndef BUILDING_VARIANT +int +tcgetattr(fd, t) + int fd; + struct termios *t; +{ + + return (_ioctl(fd, TIOCGETA, t)); +} + +int +tcsetattr(fd, opt, t) + int fd, opt; + const struct termios *t; +{ + struct termios localterm; + + if (opt & TCSASOFT) { + localterm = *t; + localterm.c_cflag |= CIGNORE; + t = &localterm; + } + switch (opt & ~TCSASOFT) { + case TCSANOW: + return (_ioctl(fd, TIOCSETA, t)); + case TCSADRAIN: + return (_ioctl(fd, TIOCSETAW, t)); + case TCSAFLUSH: + return (_ioctl(fd, TIOCSETAF, t)); + default: + errno = EINVAL; + return (-1); + } +} + +int +tcsetpgrp(int fd, pid_t pgrp) +{ + int s; + + if (isatty(fd) == 0) + return (-1); + + s = pgrp; + return (_ioctl(fd, TIOCSPGRP, &s)); +} + +pid_t +tcgetpgrp(fd) + int fd; +{ + int s; + + if (isatty(fd) == 0) + return ((pid_t)-1); + + if (_ioctl(fd, TIOCGPGRP, &s) < 0) + return ((pid_t)-1); + + return ((pid_t)s); +} + +#if 0 // Needs API review first +pid_t +tcgetsid(int fd) +{ + int s; + + if (_ioctl(fd, TIOCGSID, &s) < 0) + return ((pid_t)-1); + + return ((pid_t)s); +} + +int +tcsetsid(int fd, pid_t pid) +{ + + if (pid != getsid(0)) { + errno = EINVAL; + return (-1); + } + + return (_ioctl(fd, TIOCSCTTY, NULL)); +} +#endif + +speed_t +cfgetospeed(t) + const struct termios *t; +{ + + return (t->c_ospeed); +} + +speed_t +cfgetispeed(t) + const struct termios *t; +{ + + return (t->c_ispeed); +} + +int +cfsetospeed(t, speed) + struct termios *t; + speed_t speed; +{ + + t->c_ospeed = speed; + return (0); +} + +int +cfsetispeed(t, speed) + struct termios *t; + speed_t speed; +{ + + t->c_ispeed = speed; + return (0); +} + +int +cfsetspeed(t, speed) + struct termios *t; + speed_t speed; +{ + + t->c_ispeed = t->c_ospeed = speed; + return (0); +} + +/* + * Make a pre-existing termios structure into "raw" mode: character-at-a-time + * mode with no characters interpreted, 8-bit data path. + */ +void +cfmakeraw(t) + struct termios *t; +{ + + t->c_iflag &= ~(IMAXBEL|IXOFF|INPCK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IGNPAR); + t->c_iflag |= IGNBRK; + t->c_oflag &= ~OPOST; + t->c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN|NOFLSH|TOSTOP|PENDIN); + t->c_cflag &= ~(CSIZE|PARENB); + t->c_cflag |= CS8|CREAD; + t->c_cc[VMIN] = 1; + t->c_cc[VTIME] = 0; +} + +int +tcsendbreak(fd, len) + int fd, len; +{ + struct timeval sleepytime; + + sleepytime.tv_sec = 0; + sleepytime.tv_usec = 400000; + if (_ioctl(fd, TIOCSBRK, 0) == -1) + return (-1); + (void)_select(0, 0, 0, 0, &sleepytime); + if (_ioctl(fd, TIOCCBRK, 0) == -1) + return (-1); + return (0); +} +#endif /* BUILDING_VARIANT */ + +int +__tcdrain(fd) + int fd; +{ +#if __DARWIN_UNIX03 +#ifdef VARIANT_CANCELABLE + pthread_testcancel(); +#endif /* VARIANT_CANCELABLE */ +#endif /* __DARWIN_UNIX03 */ + return (_ioctl(fd, TIOCDRAIN, 0)); +} + +__weak_reference(__tcdrain, tcdrain); +__weak_reference(__tcdrain, _tcdrain); + +#ifndef BUILDING_VARIANT +int +tcflush(fd, which) + int fd, which; +{ + int com; + + switch (which) { + case TCIFLUSH: + com = FREAD; + break; + case TCOFLUSH: + com = FWRITE; + break; + case TCIOFLUSH: + com = FREAD | FWRITE; + break; + default: + errno = EINVAL; + return (-1); + } + return (_ioctl(fd, TIOCFLUSH, &com)); +} + +int +tcflow(fd, action) + int fd, action; +{ + switch (action) { + case TCOOFF: + return (_ioctl(fd, TIOCSTOP, 0)); + case TCOON: + return (_ioctl(fd, TIOCSTART, 0)); + case TCION: + return (_ioctl(fd, TIOCIXON, 0)); + case TCIOFF: + return (_ioctl(fd, TIOCIXOFF, 0)); + default: + errno = EINVAL; + return (-1); + } + /* NOTREACHED */ +} +#endif /* BUILDING_VARIANT */ diff --git a/gen/FreeBSD/time.3 b/gen/FreeBSD/time.3 new file mode 100644 index 0000000..e694537 --- /dev/null +++ b/gen/FreeBSD/time.3 @@ -0,0 +1,101 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)time.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/time.3,v 1.15 2007/01/09 00:27:55 imp Exp $ +.\" +.Dd July 18, 2003 +.Dt TIME 3 +.Os +.Sh NAME +.Nm time +.Nd get time of day +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft time_t +.Fn time "time_t *tloc" +.Sh DESCRIPTION +The +.Fn time +function +returns the value of time in seconds since 0 hours, 0 minutes, +0 seconds, January 1, 1970, Coordinated Universal Time, +without including leap seconds. +If an error occurs, +.Fn time +returns the value +.Po Vt time_t Pc Ns \-1 . +.Pp +The return value is also stored in +.No \&* Ns Va tloc , +provided that +.Va tloc +is non-null. +.Sh ERRORS +The +.Fn time +function may fail for any of the reasons described in +.Xr gettimeofday 2 . +.Sh SEE ALSO +.Xr gettimeofday 2 , +.Xr ctime 3 +.Sh STANDARDS +The +.Nm +function conforms to +.St -p1003.1-2001 . +.Sh HISTORY +A +.Fn time +function appeared in +.At v6 . +.Sh BUGS +Neither +.St -isoC-99 +nor +.St -p1003.1-2001 +requires +.Fn time +to set +.Va errno +on failure; thus, it is impossible for an application to distinguish +the valid time value \-1 (representing the last UTC second of 1969) +from the error return value. +.Pp +Systems conforming to earlier versions of the C and +.Tn POSIX +standards (including older versions of +.Fx ) +did not set +.No \&* Ns Va tloc +in the error case. diff --git a/gen/FreeBSD/time.c b/gen/FreeBSD/time.c new file mode 100644 index 0000000..d77e38a --- /dev/null +++ b/gen/FreeBSD/time.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/time.c,v 1.5 2007/01/09 00:27:55 imp Exp $"); + +#include +#include +#include + +time_t +time(t) + time_t *t; +{ + struct timeval tt; + time_t retval; +#ifdef FE_DFL_ENV + fenv_t fenv; +#endif /* FE_DFL_ENV */ + +#ifdef FE_DFL_ENV + fegetenv(&fenv); /* 3965505 - need to preserve floating point enviroment */ +#endif /* FE_DFL_ENV */ + if (gettimeofday(&tt, (struct timezone *)0) < 0) + retval = -1; + else + retval = tt.tv_sec; + if (t != NULL) + *t = retval; +#ifdef FE_DFL_ENV + fesetenv(&fenv); +#endif /* FE_DFL_ENV */ + return (retval); +} diff --git a/gen/FreeBSD/times.3 b/gen/FreeBSD/times.3 new file mode 100644 index 0000000..261c1ae --- /dev/null +++ b/gen/FreeBSD/times.3 @@ -0,0 +1,139 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)times.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd December 1, 2008 +.Dt TIMES 3 +.Os +.Sh NAME +.Nm times +.Nd process times +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/times.h +.Ft clock_t +.Fn times "struct tms *tp" +.Sh DESCRIPTION +.Bf -symbolic +This interface is obsoleted by +.Xr getrusage 2 +and +.Xr gettimeofday 2 . +.Ef +.Pp +The +.Fn times +function returns the value of time in +.Dv CLK_TCK Ns 's +of a second since +0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal +Time. +.Pp +It also fills in the structure pointed to by +.Fa tp +with time-accounting information. +.Pp +The +.Vt tms +structure is defined as follows: +.Bd -literal -offset indent +struct tms { + clock_t tms_utime; + clock_t tms_stime; + clock_t tms_cutime; + clock_t tms_cstime; +}; +.Ed +.Pp +The elements of this structure are defined as follows: +.Bl -tag -width ".Va tms_cutime" +.It Va tms_utime +The +.Tn CPU +time charged for the execution of user instructions. +.It Va tms_stime +The +.Tn CPU +time charged for execution by the system on behalf of +the process. +.It Va tms_cutime +The sum of the +.Va tms_utime Ns s +and +.Va tms_cutime Ns s +of the child processes. +.It Va tms_cstime +The sum of the +.Fa tms_stime Ns s +and +.Fa tms_cstime Ns s +of the child processes. +.El +.Pp +All times are in +.Dv CLK_TCK Ns 's +of a second. +.Pp +The times of a terminated child process are included in the +.Va tms_cutime +and +.Va tms_cstime +elements of the parent when one of the +.Xr wait 2 +functions returns the process ID of the terminated child to the parent. +If an error occurs, +.Fn times +returns the value +.Pq Po Vt clock_t Pc Ns \-1 , +and sets +.Va errno +to indicate the error. +.Sh ERRORS +The +.Fn times +function +may fail and set the global variable +.Va errno +for any of the errors specified for the library +routines +.Xr getrusage 2 +and +.Xr gettimeofday 2 . +.Sh SEE ALSO +.Xr time 1 , +.Xr getrusage 2 , +.Xr gettimeofday 2 , +.Xr wait 2 +.Sh STANDARDS +The +.Fn times +function +conforms to +.St -p1003.1-88 . diff --git a/gen/FreeBSD/times.c b/gen/FreeBSD/times.c new file mode 100644 index 0000000..5bdc607 --- /dev/null +++ b/gen/FreeBSD/times.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)times.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/times.c,v 1.2 2002/02/01 01:08:48 obrien Exp $"); + +#include +#include +#include +#include + +/* + * Convert usec to clock ticks; could do (usec * CLK_TCK) / 1000000, + * but this would overflow if we switch to nanosec. + */ +#define CONVTCK(r) (r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK)) + +clock_t +times(tp) + struct tms *tp; +{ + struct rusage ru; + struct timeval t; + + if (getrusage(RUSAGE_SELF, &ru) < 0) + return ((clock_t)-1); + tp->tms_utime = CONVTCK(ru.ru_utime); + tp->tms_stime = CONVTCK(ru.ru_stime); + if (getrusage(RUSAGE_CHILDREN, &ru) < 0) + return ((clock_t)-1); + tp->tms_cutime = CONVTCK(ru.ru_utime); + tp->tms_cstime = CONVTCK(ru.ru_stime); + if (gettimeofday(&t, (struct timezone *)0)) + return ((clock_t)-1); + return ((clock_t)(CONVTCK(t))); +} diff --git a/gen/FreeBSD/timespec_get.3 b/gen/FreeBSD/timespec_get.3 new file mode 100644 index 0000000..3406300 --- /dev/null +++ b/gen/FreeBSD/timespec_get.3 @@ -0,0 +1,81 @@ +.\" $NetBSD: timespec_get.3,v 1.2 2016/10/04 10:46:40 wiz Exp $ +.\" +.\" Copyright (c) 2016 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Kamil Rytarowski. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 26, 2018 +.Dt TIMESPEC_GET 3 +.Os +.Sh NAME +.Nm timespec_get +.Nd get current calendar time +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft int +.Fn timespec_get "struct timespec *ts" "int base" +.Sh DESCRIPTION +The +.Nm +function sets the interval pointed to by +.Fa ts +to hold the current calendar time based on the specified time base in +.Fa base . +.Pp +The base +.Dv TIME_UTC +returns the time since the epoch. +This time is expressed in seconds and nanoseconds since midnight (0 hour), January 1, 1970. +This corresponds to +.Dv CLOCK_REALTIME . +.Sh RETURN VALUES +The +.Nm +function returns the passed value of +.Fa base +if successful, otherwise +.Dv 0 +on failure. +.Sh SEE ALSO +.Xr gettimeofday 2 , +.Xr clock_gettime 2 , +.Xr time 3 +.Sh STANDARDS +The +.Nm +function with a +.Fa base +of +.Dv TIME_UTC +conforms to +.St -isoC-2011 . +.Sh AUTHORS +.An Kamil Rytarowski Aq Mt kamil@NetBSD.org +.An Warner Losh Aq Mt imp@FreeBSD.org diff --git a/gen/FreeBSD/timespec_get.c b/gen/FreeBSD/timespec_get.c new file mode 100644 index 0000000..1dd0147 --- /dev/null +++ b/gen/FreeBSD/timespec_get.c @@ -0,0 +1,54 @@ +/* $NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $ */ + +/*- + * Copyright (c) 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Kamil Rytarowski. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__RCSID("$NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $"); +__FBSDID("$FreeBSD$"); + +#include + +/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ + +int +timespec_get(struct timespec *ts, int base) +{ + + switch (base) { + case TIME_UTC: + if (clock_gettime(CLOCK_REALTIME, ts) == -1) + return 0; + break; + default: + return 0; + } + + return base; +} diff --git a/gen/FreeBSD/timezone.3 b/gen/FreeBSD/timezone.3 new file mode 100644 index 0000000..450c5b2 --- /dev/null +++ b/gen/FreeBSD/timezone.3 @@ -0,0 +1,69 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)timezone.3 8.2 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/gen/timezone.3,v 1.10 2007/01/09 00:27:55 imp Exp $ +.\" +.Dd April 19, 1994 +.Dt TIMEZONE 3 +.Os +.Sh NAME +.Nm timezone +.Nd return the timezone abbreviation +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.Ft char * +.Fn timezone "int zone" "int dst" +.Sh DESCRIPTION +.Bf Sy +This interface is for compatibility only; it is impossible to reliably +map timezone's arguments to a time zone abbreviation. +See +.Xr ctime 3 . +.Ef +.Pp +The +.Fn timezone +function returns a pointer to a time zone abbreviation for the specified +.Fa zone +and +.Fa dst +values. +The +.Fa zone +argument +is the number of minutes west of GMT and +.Fa dst +is non-zero if daylight savings time is in effect. +.Sh SEE ALSO +.Xr ctime 3 +.Sh HISTORY +A +.Fn timezone +function appeared in +.At v7 . diff --git a/gen/FreeBSD/timezone.c b/gen/FreeBSD/timezone.c new file mode 100644 index 0000000..6f0e68d --- /dev/null +++ b/gen/FreeBSD/timezone.c @@ -0,0 +1,137 @@ +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)timezone.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/timezone.c,v 1.6 2007/01/09 00:27:55 imp Exp $"); + +#include +#include +#include +#include +#include +#define TZ_MAX_CHARS 255 + +char *_tztab(); + +/* + * timezone -- + * The arguments are the number of minutes of time you are westward + * from Greenwich and whether DST is in effect. It returns a string + * giving the name of the local timezone. Should be replaced, in the + * application code, by a call to localtime. + */ + +static char czone[TZ_MAX_CHARS]; /* space for zone name */ + +char * +timezone(zone, dst) + int zone, + dst; +{ + char *beg, + *end; + + if ( (beg = getenv("TZNAME")) ) { /* set in environment */ + if ( (end = index(beg, ',')) ) {/* "PST,PDT" */ + if (dst) + return(++end); + *end = '\0'; + (void)strncpy(czone,beg,sizeof(czone) - 1); + czone[sizeof(czone) - 1] = '\0'; + *end = ','; + return(czone); + } + return(beg); + } + return(_tztab(zone,dst)); /* default: table or created zone */ +} + +static struct zone { + int offset; + char *stdzone; + char *dlzone; +} zonetab[] = { + {-1*60, "MET", "MET DST"}, /* Middle European */ + {-2*60, "EET", "EET DST"}, /* Eastern European */ + {4*60, "AST", "ADT"}, /* Atlantic */ + {5*60, "EST", "EDT"}, /* Eastern */ + {6*60, "CST", "CDT"}, /* Central */ + {7*60, "MST", "MDT"}, /* Mountain */ + {8*60, "PST", "PDT"}, /* Pacific */ +#ifdef notdef + /* there's no way to distinguish this from WET */ + {0, "GMT", 0}, /* Greenwich */ +#endif + {0*60, "WET", "WET DST"}, /* Western European */ + {-10*60,"EST", "EST"}, /* Aust: Eastern */ + {-10*60+30,"CST", "CST"}, /* Aust: Central */ + {-8*60, "WST", 0}, /* Aust: Western */ + {-1} +}; + +/* + * _tztab -- + * check static tables or create a new zone name; broken out so that + * we can make a guess as to what the zone is if the standard tables + * aren't in place in /etc. DO NOT USE THIS ROUTINE OUTSIDE OF THE + * STANDARD LIBRARY. + */ +char * +_tztab(zone,dst) + int zone; + int dst; +{ + struct zone *zp; + char sign; + + for (zp = zonetab; zp->offset != -1;++zp) /* static tables */ + if (zp->offset == zone) { + if (dst && zp->dlzone) + return(zp->dlzone); + if (!dst && zp->stdzone) + return(zp->stdzone); + } + + if (zone < 0) { /* create one */ + zone = -zone; + sign = '+'; + } + else + sign = '-'; + (void)snprintf(czone, sizeof(czone), + "GMT%c%d:%02d",sign,zone / 60,zone % 60); + return(czone); +} +#pragma clang diagnostic pop diff --git a/gen/FreeBSD/ttyname.3 b/gen/FreeBSD/ttyname.3 new file mode 100644 index 0000000..05a20b6 --- /dev/null +++ b/gen/FreeBSD/ttyname.3 @@ -0,0 +1,141 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ttyname.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd July 18, 2014 +.Dt TTYNAME 3 +.Os +.Sh NAME +.Nm ttyname , +.Nm ttyname_r , +.Nm isatty +.Nd get name of associated terminal (tty) from file descriptor +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft char * +.Fn ttyname "int fd" +.Ft int +.Fn ttyname_r "int fd" "char *buf" "size_t len" +.Ft int +.Fn isatty "int fd" +.Sh DESCRIPTION +These functions operate on file descriptors for terminal type devices. +.Pp +The +.Fn isatty +function +determines if the file descriptor +.Fa fd +refers to a valid +terminal type device. +.Pp +The +.Fn ttyname +function +gets the related device name of +a file descriptor for which +.Fn isatty +is true. +.Pp +The +.Fn ttyname +function +returns the name stored in a static buffer which will be overwritten +on subsequent calls. +The +.Fn ttyname_r +function +takes a buffer and length as arguments to avoid this problem. +.Sh RETURN VALUES +The +.Fn isatty +function returns 1 if +.Fa fd +refers to a terminal type device; +otherwise, it returns 0 and may set +.Va errno +to indicate the error. +The +.Fn ttyname +function +returns the null terminated name if the device is found and +.Fn isatty +is true; otherwise +a +.Dv NULL +pointer is returned. +The +.Fn ttyname_r +function returns 0 if successful. +Otherwise an error number is returned. +.Sh ERRORS +These functions may fail if: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument +is not a valid file descriptor. +.It Bq Er ENOTTY +The file associated with +.Fa fd +is not a terminal. +.El +.Pp +Additionally, +.Fn ttyname_r +may fail if: +.Bl -tag -width Er +.It Bq Er ERANGE +The +.Fa bufsize +argument +is smaller than the length of the string to be returned. +.El +.Sh SEE ALSO +.Xr ioctl 2 , +.Xr ptsname 3 , +.Xr tcgetattr 3 , +.Xr tty 4 , +.Xr ttys 5 +.Sh HISTORY +The +.Fn isatty +and +.Fn ttyname +functions +appeared in +.At v7 . +The +.Fn ttyname_r +function +appeared in +.Fx 6.0 . diff --git a/gen/FreeBSD/ttyname.c b/gen/FreeBSD/ttyname.c new file mode 100644 index 0000000..aa5483a --- /dev/null +++ b/gen/FreeBSD/ttyname.c @@ -0,0 +1,212 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ttyname.c 8.2 (Berkeley) 1/27/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/ttyname.c,v 1.16 2004/01/06 18:26:14 nectar Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" + +#ifndef BUILDING_VARIANT +static pthread_once_t ttyname_buf_control = PTHREAD_ONCE_INIT; +static char *buf = NULL; +static char *ttyname_threaded(int fd); +static char *ttyname_unthreaded(int fd); + +static pthread_mutex_t ttyname_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_key_t ttyname_key; +static int ttyname_init = 0; + +char * +ttyname(int fd) +{ + char *ret; + + if (__isthreaded == 0) + ret = ttyname_unthreaded(fd); + else + ret = ttyname_threaded(fd); + return (ret); +} +#endif /* !BUILDING_VARIANT */ + +#if __DARWIN_UNIX03 +int +#else /* !__DARWIN_UNIX03 */ +char * +#endif /* __DARWIN_UNIX03 */ +ttyname_r(int fd, char *thrbuf, size_t len) +{ + struct stat sb; + +#if __DARWIN_UNIX03 + if (_fstat(fd, &sb) < 0) + return (EBADF); + /* Must be a terminal. */ + if (!isatty(fd)) + return (ENOTTY); + /* Must be a character device. */ + if (!S_ISCHR(sb.st_mode)) + return (ENOTTY); + /* Must have enough room */ + if (len <= sizeof(_PATH_DEV)) + return (ERANGE); +#else /* !__DARWIN_UNIX03 */ + /* Must be a terminal. */ + if (!isatty(fd)) + return (NULL); + /* Must be a character device. */ + if (_fstat(fd, &sb)) + return (NULL); + if (!S_ISCHR(sb.st_mode)) { + errno = ENOTTY; + return (NULL); + } + /* Must have enough room */ + if (len <= sizeof(_PATH_DEV)) { + errno = ERANGE; + return (NULL); + } +#endif /* __DARWIN_UNIX03 */ + + strlcpy(thrbuf, _PATH_DEV, len); + if (devname_r(sb.st_rdev, S_IFCHR, + thrbuf + strlen(thrbuf), len - strlen(thrbuf)) == NULL) +#if __DARWIN_UNIX03 + return (ERANGE); + return (0); +#else /* !__DARWIN_UNIX03 */ + { + errno = ERANGE; + return (NULL); + } + return (thrbuf); +#endif /* __DARWIN_UNIX03 */ +} + +#ifndef BUILDING_VARIANT +static char * +ttyname_threaded(int fd) +{ + char *buf; + + if (ttyname_init == 0) { + _pthread_mutex_lock(&ttyname_lock); + if (ttyname_init == 0) { + /* __PTK_LIBC_TTYNAME_KEY */ + ttyname_key = __LIBC_PTHREAD_KEY_TTYNAME; + if (pthread_key_init_np(ttyname_key, free)) { + int save = errno; + _pthread_mutex_unlock(&ttyname_lock); + errno = save; + return (NULL); + } + ttyname_init = 1; + } + _pthread_mutex_unlock(&ttyname_lock); + } + + /* Must have thread specific data field to put data */ + if ((buf = _pthread_getspecific(ttyname_key)) == NULL) { + if ((buf = malloc(sizeof(_PATH_DEV) + MAXNAMLEN)) != NULL) { + if (_pthread_setspecific(ttyname_key, buf) != 0) { + int save = errno; + free(buf); + errno = save; + return (NULL); + } + } else { + return (NULL); + } + } +#if __DARWIN_UNIX03 + return (ttyname_r(fd, buf, sizeof(_PATH_DEV) + MAXNAMLEN) == 0 ? buf : NULL); +#else /* !__DARWIN_UNIX03 */ + return (ttyname_r(fd, buf, sizeof(_PATH_DEV) + MAXNAMLEN)); +#endif /* __DARWIN_UNIX03 */ +} + +static void +ttyname_buf_allocate(void) +{ + buf = malloc(sizeof(_PATH_DEV) + MAXNAMLEN); +} + +static char * +ttyname_unthreaded(int fd) +{ + struct stat sb; + struct termios ttyb; + + /* Must be a terminal. */ + if (tcgetattr(fd, &ttyb) < 0) + return (NULL); + /* Must be a character device. */ + if (_fstat(fd, &sb)) + return (NULL); + if (!S_ISCHR(sb.st_mode)) { + errno = ENOTTY; + return (NULL); + } + + if (pthread_once(&ttyname_buf_control, ttyname_buf_allocate) + || !buf) { + errno = ENOMEM; + return (NULL); + } + + strlcpy(buf, _PATH_DEV, sizeof(_PATH_DEV) + MAXNAMLEN); + if (devname_r(sb.st_rdev, S_IFCHR, + buf + strlen(buf), sizeof(_PATH_DEV) + MAXNAMLEN - strlen(buf)) == NULL) { + errno = ERANGE; + return (NULL); + } + return (buf); +} +#endif /* !BUILDING_VARIANT */ diff --git a/gen/FreeBSD/ttyslot.c b/gen/FreeBSD/ttyslot.c new file mode 100644 index 0000000..d437a48 --- /dev/null +++ b/gen/FreeBSD/ttyslot.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ttyslot.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +int +ttyslot() +{ + + return (0); +} diff --git a/gen/FreeBSD/ualarm.3 b/gen/FreeBSD/ualarm.3 new file mode 100644 index 0000000..01a681f --- /dev/null +++ b/gen/FreeBSD/ualarm.3 @@ -0,0 +1,100 @@ +.\" Copyright (c) 1986, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From: @(#)ualarm.3 8.2 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/gen/ualarm.3,v 1.20 2007/01/09 00:27:56 imp Exp $ +.\" +.Dd April 19, 1994 +.Dt UALARM 3 +.Os +.Sh NAME +.Nm ualarm +.Nd schedule signal after specified time +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft useconds_t +.Fo ualarm +.Fa "useconds_t useconds" +.Fa "useconds_t interval" +.Fc +.Sh DESCRIPTION +.Bf -symbolic +This is a simplified interface to +.Xr setitimer 2 . +.Ef +.Pp +The +.Fn ualarm +function +waits a count of +.Fa useconds +before asserting the terminating signal +.Dv SIGALRM . +System activity or time used in processing the call may cause a slight +delay. +.Pp +If the +.Fa interval +argument is non-zero, the +.Dv SIGALRM +signal will be sent +to the process every +.Fa interval +microseconds after the timer expires (e.g., after +.Fa useconds +number of microseconds have passed). +.Pp +Due to a +.Xr setitimer 2 +restriction, the maximum number of +.Fa useconds +and +.Fa interval +is limited to 100,000,000,000,000 +(in case this value fits in the unsigned integer). +.Sh RETURN VALUES +When the signal has successfully been caught, +.Fn ualarm +returns the amount of time left on the clock. +.Sh NOTES +A microsecond is 0.000001 seconds. +.Sh SEE ALSO +.Xr getitimer 2 , +.Xr setitimer 2 , +.Xr sigpause 2 , +.Xr sigvec 2 , +.Xr alarm 3 , +.Xr signal 3 , +.Xr sleep 3 , +.Xr usleep 3 +.Sh HISTORY +The +.Fn ualarm +function appeared in +.Bx 4.3 . diff --git a/gen/FreeBSD/ualarm.c b/gen/FreeBSD/ualarm.c new file mode 100644 index 0000000..23e8161 --- /dev/null +++ b/gen/FreeBSD/ualarm.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1985, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ualarm.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/ualarm.c,v 1.5 2007/01/09 00:27:56 imp Exp $"); + +#include +#include + +#define USPS 1000000 /* # of microseconds in a second */ + +/* + * Generate a SIGALRM signal in ``usecs'' microseconds. + * If ``reload'' is non-zero, keep generating SIGALRM + * every ``reload'' microseconds after the first signal. + */ +useconds_t +ualarm(usecs, reload) + useconds_t usecs; + useconds_t reload; +{ + struct itimerval new, old; + + new.it_interval.tv_usec = reload % USPS; + new.it_interval.tv_sec = reload / USPS; + + new.it_value.tv_usec = usecs % USPS; + new.it_value.tv_sec = usecs / USPS; + + if (setitimer(ITIMER_REAL, &new, &old) == 0) + return (old.it_value.tv_sec * USPS + old.it_value.tv_usec); + /* else */ + return (-1); +} diff --git a/gen/FreeBSD/ulimit.3 b/gen/FreeBSD/ulimit.3 new file mode 100644 index 0000000..f19e152 --- /dev/null +++ b/gen/FreeBSD/ulimit.3 @@ -0,0 +1,101 @@ +.\" Copyright (c) 2002 Kyle Martin. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/gen/ulimit.3,v 1.5 2003/01/04 01:11:49 tjr Exp $ +.\" +.Dd January 4, 2003 +.Dt ULIMIT 3 +.Os +.Sh NAME +.Nm ulimit +.Nd get and set process limits +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ulimit.h +.Ft long +.Fo ulimit +.Fa "int cmd" +.Fa "..." +.Fc +.Sh DESCRIPTION +The +.Fn ulimit +function will get and set process limits. +Currently, this is limited to the maximum file size. +The +.Fa cmd +argument is one of the following: +.Bl -tag -width ".Dv UL_GETFSIZE" +.It Dv UL_GETFSIZE +will return the maximum file size of the current process, +in units of 512-byte blocks. +.It Dv UL_SETFSIZE +will attempt to set the maximum file size of the current +process and its children, using the second argument (expressed as a long). +.El +.Sh RETURN VALUES +Upon successful completion, +.Fn ulimit +returns the value requested; +otherwise, the value \-1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn ulimit +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The command specified was invalid. +.It Bq Er EPERM +The limit specified to +.Fn ulimit +would have raised the maximum limit value, +and the caller is not the super-user. +.El +.Sh SEE ALSO +.Xr getrlimit 2 +.Sh STANDARDS +The +.Fn ulimit +function conforms to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn ulimit +function first appeared in +.Fx 5.0 . +.Sh BUGS +The +.Fn ulimit +function provides limited precision for +setting and retrieving process limits. +If there is a need for greater precision than the +type +.Vt long +provides, the +.Xr getrlimit 2 +and +.Xr setrlimit 2 +functions should be considered. diff --git a/gen/FreeBSD/ulimit.c b/gen/FreeBSD/ulimit.c new file mode 100644 index 0000000..d25ff47 --- /dev/null +++ b/gen/FreeBSD/ulimit.c @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2002 Kyle Martin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/gen/ulimit.c,v 1.3 2003/01/04 01:11:49 tjr Exp $ + */ + +#include +#include +#include + +#include +#include +#include +#include + +long +ulimit(int cmd, ...) +{ + struct rlimit limit; + va_list ap; + long arg; + + if (cmd == UL_GETFSIZE) { + if (getrlimit(RLIMIT_FSIZE, &limit) == -1) + return (-1); + limit.rlim_cur /= 512; + if (limit.rlim_cur > LONG_MAX) + return (LONG_MAX); + return ((long)limit.rlim_cur); + } else if (cmd == UL_SETFSIZE) { + va_start(ap, cmd); + arg = va_arg(ap, long); + va_end(ap); + limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512; + + /* The setrlimit() function sets errno to EPERM if needed. */ + if (setrlimit(RLIMIT_FSIZE, &limit) == -1) + return (-1); + if (arg * 512 > LONG_MAX) + return (LONG_MAX); + return (arg); + } else { + errno = EINVAL; + return (-1); + } +} diff --git a/gen/FreeBSD/unvis.3 b/gen/FreeBSD/unvis.3 new file mode 100644 index 0000000..73b91da --- /dev/null +++ b/gen/FreeBSD/unvis.3 @@ -0,0 +1,259 @@ +.\" $NetBSD: unvis.3,v 1.27 2012/12/15 07:34:36 wiz Exp $ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)unvis.3 8.2 (Berkeley) 12/11/93 +.\" +.Dd March 12, 2011 +.Dt UNVIS 3 +.Os +.Sh NAME +.Nm unvis , +.Nm strunvis +.Nd decode a visual representation of characters +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In vis.h +.Ft int +.Fn unvis "char *cp" "int c" "int *astate" "int flag" +.Ft int +.Fn strunvis "char *dst" "const char *src" +.Ft int +.Fn strnunvis "char *dst" "size_t dlen" "const char *src" +.Ft int +.Fn strunvisx "char *dst" "const char *src" "int flag" +.Ft int +.Fn strnunvisx "char *dst" "size_t dlen" "const char *src" "int flag" +.Sh DESCRIPTION +The +.Fn unvis , +.Fn strunvis +and +.Fn strunvisx +functions +are used to decode a visual representation of characters, as produced +by the +.Xr vis 3 +function, back into +the original form. +.Pp +The +.Fn unvis +function is called with successive characters in +.Ar c +until a valid sequence is recognized, at which time the decoded +character is available at the character pointed to by +.Ar cp . +.Pp +The +.Fn strunvis +function decodes the characters pointed to by +.Ar src +into the buffer pointed to by +.Ar dst . +The +.Fn strunvis +function simply copies +.Ar src +to +.Ar dst , +decoding any escape sequences along the way, +and returns the number of characters placed into +.Ar dst , +or \-1 if an +invalid escape sequence was detected. +The size of +.Ar dst +should be equal to the size of +.Ar src +(that is, no expansion takes place during decoding). +.Pp +The +.Fn strunvisx +function does the same as the +.Fn strunvis +function, +but it allows you to add a flag that specifies the style the string +.Ar src +is encoded with. +Currently, the supported flags are: +.Dv VIS_HTTPSTYLE +and +.Dv VIS_MIMESTYLE . +.Pp +The +.Fn unvis +function implements a state machine that can be used to decode an +arbitrary stream of bytes. +All state associated with the bytes being decoded is stored outside the +.Fn unvis +function (that is, a pointer to the state is passed in), so +calls decoding different streams can be freely intermixed. +To start decoding a stream of bytes, first initialize an integer to zero. +Call +.Fn unvis +with each successive byte, along with a pointer +to this integer, and a pointer to a destination character. +The +.Fn unvis +function has several return codes that must be handled properly. +They are: +.Bl -tag -width UNVIS_VALIDPUSH +.It Li \&0 No (zero) +Another character is necessary; nothing has been recognized yet. +.It Dv UNVIS_VALID +A valid character has been recognized and is available at the location +pointed to by +.Fa cp . +.It Dv UNVIS_VALIDPUSH +A valid character has been recognized and is available at the location +pointed to by +.Fa cp ; +however, the character currently passed in should be passed in again. +.It Dv UNVIS_NOCHAR +A valid sequence was detected, but no character was produced. +This return code is necessary to indicate a logical break between characters. +.It Dv UNVIS_SYNBAD +An invalid escape sequence was detected, or the decoder is in an unknown state. +The decoder is placed into the starting state. +.El +.Pp +When all bytes in the stream have been processed, call +.Fn unvis +one more time with flag set to +.Dv UNVIS_END +to extract any remaining character (the character passed in is ignored). +.Pp +The +.Fa flag +argument is also used to specify the encoding style of the source. +If set to +.Dv VIS_HTTPSTYLE +or +.Dv VIS_HTTP1808 , +.Fn unvis +will decode URI strings as specified in RFC 1808. +If set to +.Dv VIS_HTTP1866 , +.Fn unvis +will decode entity references and numeric character references +as specified in RFC 1866. +If set to +.Dv VIS_MIMESTYLE , +.Fn unvis +will decode MIME Quoted-Printable strings as specified in RFC 2045. +If set to +.Dv VIS_NOESCAPE , +.Fn unvis +will not decode +.Ql \e +quoted characters. +.Pp +The following code fragment illustrates a proper use of +.Fn unvis . +.Bd -literal -offset indent +int state = 0; +char out; + +while ((ch = getchar()) != EOF) { +again: + switch(unvis(\*[Am]out, ch, \*[Am]state, 0)) { + case 0: + case UNVIS_NOCHAR: + break; + case UNVIS_VALID: + (void)putchar(out); + break; + case UNVIS_VALIDPUSH: + (void)putchar(out); + goto again; + case UNVIS_SYNBAD: + errx(EXIT_FAILURE, "Bad character sequence!"); + } +} +if (unvis(\*[Am]out, '\e0', \*[Am]state, UNVIS_END) == UNVIS_VALID) + (void)putchar(out); +.Ed +.Sh ERRORS +The functions +.Fn strunvis , +.Fn strnunvis , +.Fn strunvisx , +and +.Fn strnunvisx +will return \-1 on error and set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er EINVAL +An invalid escape sequence was detected, or the decoder is in an unknown state. +.El +.Pp +In addition the functions +.Fn strnunvis +and +.Fn strnunvisx +will can also set +.Va errno +on error to: +.Bl -tag -width Er +.It Bq Er ENOSPC +Not enough space to perform the conversion. +.El +.Sh SEE ALSO +.Xr unvis 1 , +.Xr vis 1 , +.Xr vis 3 +.Rs +.%A R. Fielding +.%T Relative Uniform Resource Locators +.%O RFC1808 +.Re +.Sh HISTORY +The +.Fn unvis +function +first appeared in +.Bx 4.4 . +The +.Fn strnunvis +and +.Fn strnunvisx +functions appeared in OS X 10.12. +.Sh BUGS +The names +.Dv VIS_HTTP1808 +and +.Dv VIS_HTTP1866 +are wrong. +Percent-encoding was defined in RFC 1738, the original RFC for URL. +RFC 1866 defines HTML 2.0, an application of SGML, from which it +inherits concepts of numeric character references and entity +references. diff --git a/gen/FreeBSD/unvis.c b/gen/FreeBSD/unvis.c new file mode 100644 index 0000000..f8ff22b --- /dev/null +++ b/gen/FreeBSD/unvis.c @@ -0,0 +1,557 @@ +/* $NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $ */ + +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; +#else +__RCSID("$NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $"); +#endif +#endif /* LIBC_SCCS and not lint */ +#include "xlocale_private.h" + +#include + +#include +#include +#include +#include +#include +#include + +#define _DIAGASSERT(x) assert(x) + +/* + * Return the number of elements in a statically-allocated array, + * __x. + */ +#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) + +#if !HAVE_VIS +/* + * decode driven by state machine + */ +#define S_GROUND 0 /* haven't seen escape char */ +#define S_START 1 /* start decoding special sequence */ +#define S_META 2 /* metachar started (M) */ +#define S_META1 3 /* metachar more, regular char (-) */ +#define S_CTRL 4 /* control char started (^) */ +#define S_OCTAL2 5 /* octal digit 2 */ +#define S_OCTAL3 6 /* octal digit 3 */ +#define S_HEX 7 /* mandatory hex digit */ +#define S_HEX1 8 /* http hex digit */ +#define S_HEX2 9 /* http hex digit 2 */ +#define S_MIME1 10 /* mime hex digit 1 */ +#define S_MIME2 11 /* mime hex digit 2 */ +#define S_EATCRNL 12 /* mime eating CRNL */ +#define S_AMP 13 /* seen & */ +#define S_NUMBER 14 /* collecting number */ +#define S_STRING 15 /* collecting string */ + +#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') +#define xtod(c) (isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10)) +#define XTOD(c) (isdigit(c) ? (c - '0') : ((c - 'A') + 10)) + +/* + * RFC 1866 + */ +static const struct nv { + char name[7]; + uint8_t value; +} nv[] = { + { "AElig", 198 }, /* capital AE diphthong (ligature) */ + { "Aacute", 193 }, /* capital A, acute accent */ + { "Acirc", 194 }, /* capital A, circumflex accent */ + { "Agrave", 192 }, /* capital A, grave accent */ + { "Aring", 197 }, /* capital A, ring */ + { "Atilde", 195 }, /* capital A, tilde */ + { "Auml", 196 }, /* capital A, dieresis or umlaut mark */ + { "Ccedil", 199 }, /* capital C, cedilla */ + { "ETH", 208 }, /* capital Eth, Icelandic */ + { "Eacute", 201 }, /* capital E, acute accent */ + { "Ecirc", 202 }, /* capital E, circumflex accent */ + { "Egrave", 200 }, /* capital E, grave accent */ + { "Euml", 203 }, /* capital E, dieresis or umlaut mark */ + { "Iacute", 205 }, /* capital I, acute accent */ + { "Icirc", 206 }, /* capital I, circumflex accent */ + { "Igrave", 204 }, /* capital I, grave accent */ + { "Iuml", 207 }, /* capital I, dieresis or umlaut mark */ + { "Ntilde", 209 }, /* capital N, tilde */ + { "Oacute", 211 }, /* capital O, acute accent */ + { "Ocirc", 212 }, /* capital O, circumflex accent */ + { "Ograve", 210 }, /* capital O, grave accent */ + { "Oslash", 216 }, /* capital O, slash */ + { "Otilde", 213 }, /* capital O, tilde */ + { "Ouml", 214 }, /* capital O, dieresis or umlaut mark */ + { "THORN", 222 }, /* capital THORN, Icelandic */ + { "Uacute", 218 }, /* capital U, acute accent */ + { "Ucirc", 219 }, /* capital U, circumflex accent */ + { "Ugrave", 217 }, /* capital U, grave accent */ + { "Uuml", 220 }, /* capital U, dieresis or umlaut mark */ + { "Yacute", 221 }, /* capital Y, acute accent */ + { "aacute", 225 }, /* small a, acute accent */ + { "acirc", 226 }, /* small a, circumflex accent */ + { "acute", 180 }, /* acute accent */ + { "aelig", 230 }, /* small ae diphthong (ligature) */ + { "agrave", 224 }, /* small a, grave accent */ + { "amp", 38 }, /* ampersand */ + { "aring", 229 }, /* small a, ring */ + { "atilde", 227 }, /* small a, tilde */ + { "auml", 228 }, /* small a, dieresis or umlaut mark */ + { "brvbar", 166 }, /* broken (vertical) bar */ + { "ccedil", 231 }, /* small c, cedilla */ + { "cedil", 184 }, /* cedilla */ + { "cent", 162 }, /* cent sign */ + { "copy", 169 }, /* copyright sign */ + { "curren", 164 }, /* general currency sign */ + { "deg", 176 }, /* degree sign */ + { "divide", 247 }, /* divide sign */ + { "eacute", 233 }, /* small e, acute accent */ + { "ecirc", 234 }, /* small e, circumflex accent */ + { "egrave", 232 }, /* small e, grave accent */ + { "eth", 240 }, /* small eth, Icelandic */ + { "euml", 235 }, /* small e, dieresis or umlaut mark */ + { "frac12", 189 }, /* fraction one-half */ + { "frac14", 188 }, /* fraction one-quarter */ + { "frac34", 190 }, /* fraction three-quarters */ + { "gt", 62 }, /* greater than */ + { "iacute", 237 }, /* small i, acute accent */ + { "icirc", 238 }, /* small i, circumflex accent */ + { "iexcl", 161 }, /* inverted exclamation mark */ + { "igrave", 236 }, /* small i, grave accent */ + { "iquest", 191 }, /* inverted question mark */ + { "iuml", 239 }, /* small i, dieresis or umlaut mark */ + { "laquo", 171 }, /* angle quotation mark, left */ + { "lt", 60 }, /* less than */ + { "macr", 175 }, /* macron */ + { "micro", 181 }, /* micro sign */ + { "middot", 183 }, /* middle dot */ + { "nbsp", 160 }, /* no-break space */ + { "not", 172 }, /* not sign */ + { "ntilde", 241 }, /* small n, tilde */ + { "oacute", 243 }, /* small o, acute accent */ + { "ocirc", 244 }, /* small o, circumflex accent */ + { "ograve", 242 }, /* small o, grave accent */ + { "ordf", 170 }, /* ordinal indicator, feminine */ + { "ordm", 186 }, /* ordinal indicator, masculine */ + { "oslash", 248 }, /* small o, slash */ + { "otilde", 245 }, /* small o, tilde */ + { "ouml", 246 }, /* small o, dieresis or umlaut mark */ + { "para", 182 }, /* pilcrow (paragraph sign) */ + { "plusmn", 177 }, /* plus-or-minus sign */ + { "pound", 163 }, /* pound sterling sign */ + { "quot", 34 }, /* double quote */ + { "raquo", 187 }, /* angle quotation mark, right */ + { "reg", 174 }, /* registered sign */ + { "sect", 167 }, /* section sign */ + { "shy", 173 }, /* soft hyphen */ + { "sup1", 185 }, /* superscript one */ + { "sup2", 178 }, /* superscript two */ + { "sup3", 179 }, /* superscript three */ + { "szlig", 223 }, /* small sharp s, German (sz ligature) */ + { "thorn", 254 }, /* small thorn, Icelandic */ + { "times", 215 }, /* multiply sign */ + { "uacute", 250 }, /* small u, acute accent */ + { "ucirc", 251 }, /* small u, circumflex accent */ + { "ugrave", 249 }, /* small u, grave accent */ + { "uml", 168 }, /* umlaut (dieresis) */ + { "uuml", 252 }, /* small u, dieresis or umlaut mark */ + { "yacute", 253 }, /* small y, acute accent */ + { "yen", 165 }, /* yen sign */ + { "yuml", 255 }, /* small y, dieresis or umlaut mark */ +}; + +/* + * unvis - decode characters previously encoded by vis + */ +int +unvis(char *cp, int c, int *astate, int flag) +{ + unsigned char uc = (unsigned char)c; + unsigned char st, ia, is, lc; + +/* + * Bottom 8 bits of astate hold the state machine state. + * Top 8 bits hold the current character in the http 1866 nv string decoding + */ +#define GS(a) ((a) & 0xff) +#define SS(a, b) (((uint32_t)(a) << 24) | (b)) +#define GI(a) ((uint32_t)(a) >> 24) + + _DIAGASSERT(cp != NULL); + _DIAGASSERT(astate != NULL); + st = GS(*astate); + + if (flag & UNVIS_END) { + switch (st) { + case S_OCTAL2: + case S_OCTAL3: + case S_HEX2: + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case S_GROUND: + return UNVIS_NOCHAR; + default: + return UNVIS_SYNBAD; + } + } + + switch (st) { + + case S_GROUND: + *cp = 0; + if ((flag & VIS_NOESCAPE) == 0 && c == '\\') { + *astate = SS(0, S_START); + return UNVIS_NOCHAR; + } + if ((flag & VIS_HTTP1808) && c == '%') { + *astate = SS(0, S_HEX1); + return UNVIS_NOCHAR; + } + if ((flag & VIS_HTTP1866) && c == '&') { + *astate = SS(0, S_AMP); + return UNVIS_NOCHAR; + } + if ((flag & VIS_MIMESTYLE) && c == '=') { + *astate = SS(0, S_MIME1); + return UNVIS_NOCHAR; + } + *cp = c; + return UNVIS_VALID; + + case S_START: + switch(c) { + case '\\': + *cp = c; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + *cp = (c - '0'); + *astate = SS(0, S_OCTAL2); + return UNVIS_NOCHAR; + case 'M': + *cp = (char)0200; + *astate = SS(0, S_META); + return UNVIS_NOCHAR; + case '^': + *astate = SS(0, S_CTRL); + return UNVIS_NOCHAR; + case 'n': + *cp = '\n'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'r': + *cp = '\r'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'b': + *cp = '\b'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'a': + *cp = '\007'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'v': + *cp = '\v'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 't': + *cp = '\t'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'f': + *cp = '\f'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 's': + *cp = ' '; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'E': + *cp = '\033'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'x': + *astate = SS(0, S_HEX); + return UNVIS_NOCHAR; + case '\n': + /* + * hidden newline + */ + *astate = SS(0, S_GROUND); + return UNVIS_NOCHAR; + case '$': + /* + * hidden marker + */ + *astate = SS(0, S_GROUND); + return UNVIS_NOCHAR; + } + goto bad; + + case S_META: + if (c == '-') + *astate = SS(0, S_META1); + else if (c == '^') + *astate = SS(0, S_CTRL); + else + goto bad; + return UNVIS_NOCHAR; + + case S_META1: + *astate = SS(0, S_GROUND); + *cp |= c; + return UNVIS_VALID; + + case S_CTRL: + if (c == '?') + *cp |= 0177; + else + *cp |= c & 037; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + + case S_OCTAL2: /* second possible octal digit */ + if (isoctal(uc)) { + /* + * yes - and maybe a third + */ + *cp = (*cp << 3) + (c - '0'); + *astate = SS(0, S_OCTAL3); + return UNVIS_NOCHAR; + } + /* + * no - done with current sequence, push back passed char + */ + *astate = SS(0, S_GROUND); + return UNVIS_VALIDPUSH; + + case S_OCTAL3: /* third possible octal digit */ + *astate = SS(0, S_GROUND); + if (isoctal(uc)) { + *cp = (*cp << 3) + (c - '0'); + return UNVIS_VALID; + } + /* + * we were done, push back passed char + */ + return UNVIS_VALIDPUSH; + + case S_HEX: + if (!isxdigit(uc)) + goto bad; + /*FALLTHROUGH*/ + case S_HEX1: + if (isxdigit(uc)) { + *cp = xtod(uc); + *astate = SS(0, S_HEX2); + return UNVIS_NOCHAR; + } + /* + * no - done with current sequence, push back passed char + */ + *astate = SS(0, S_GROUND); + return UNVIS_VALIDPUSH; + + case S_HEX2: + *astate = S_GROUND; + if (isxdigit(uc)) { + *cp = xtod(uc) | (*cp << 4); + return UNVIS_VALID; + } + return UNVIS_VALIDPUSH; + + case S_MIME1: + if (uc == '\n' || uc == '\r') { + *astate = SS(0, S_EATCRNL); + return UNVIS_NOCHAR; + } + if (isxdigit(uc) && (isdigit(uc) || isupper(uc))) { + *cp = XTOD(uc); + *astate = SS(0, S_MIME2); + return UNVIS_NOCHAR; + } + goto bad; + + case S_MIME2: + if (isxdigit(uc) && (isdigit(uc) || isupper(uc))) { + *astate = SS(0, S_GROUND); + *cp = XTOD(uc) | (*cp << 4); + return UNVIS_VALID; + } + goto bad; + + case S_EATCRNL: + switch (uc) { + case '\r': + case '\n': + return UNVIS_NOCHAR; + case '=': + *astate = SS(0, S_MIME1); + return UNVIS_NOCHAR; + default: + *cp = uc; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + } + + case S_AMP: + *cp = 0; + if (uc == '#') { + *astate = SS(0, S_NUMBER); + return UNVIS_NOCHAR; + } + *astate = SS(0, S_STRING); + /*FALLTHROUGH*/ + + case S_STRING: + ia = *cp; /* index in the array */ + is = GI(*astate); /* index in the string */ + lc = is == 0 ? 0 : nv[ia].name[is - 1]; /* last character */ + + if (uc == ';') + uc = '\0'; + + for (; ia < __arraycount(nv); ia++) { + if (is != 0 && nv[ia].name[is - 1] != lc) + goto bad; + if (nv[ia].name[is] == uc) + break; + } + + if (ia == __arraycount(nv)) + goto bad; + + if (uc != 0) { + *cp = ia; + *astate = SS(is + 1, S_STRING); + return UNVIS_NOCHAR; + } + + *cp = nv[ia].value; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + + case S_NUMBER: + if (uc == ';') + return UNVIS_VALID; + if (!isdigit(uc)) + goto bad; + *cp += (*cp * 10) + uc - '0'; + return UNVIS_NOCHAR; + + default: + bad: + /* + * decoder in unknown state - (probably uninitialized) + */ + *astate = SS(0, S_GROUND); + return UNVIS_SYNBAD; + } +} + +/* + * strnunvisx - decode src into dst + * + * Number of chars decoded into dst is returned, -1 on error. + * Dst is null terminated. + */ + +int +strnunvisx(char *dst, size_t dlen, const char *src, int flag) +{ + char c; + char t = '\0', *start = dst; + int state = 0; + + _DIAGASSERT(src != NULL); + _DIAGASSERT(dst != NULL); +#define CHECKSPACE() \ + do { \ + if (dlen-- == 0) { \ + errno = ENOSPC; \ + return -1; \ + } \ + } while (/*CONSTCOND*/0) + + while ((c = *src++) != '\0') { + again: + switch (unvis(&t, c, &state, flag)) { + case UNVIS_VALID: + CHECKSPACE(); + *dst++ = t; + break; + case UNVIS_VALIDPUSH: + CHECKSPACE(); + *dst++ = t; + goto again; + case 0: + case UNVIS_NOCHAR: + break; + case UNVIS_SYNBAD: + errno = EINVAL; + return -1; + default: + _DIAGASSERT(/*CONSTCOND*/0); + errno = EINVAL; + return -1; + } + } + if (unvis(&t, c, &state, UNVIS_END) == UNVIS_VALID) { + CHECKSPACE(); + *dst++ = t; + } + CHECKSPACE(); + *dst = '\0'; + return (int)(dst - start); +} + +int +strunvisx(char *dst, const char *src, int flag) +{ + return strnunvisx(dst, (size_t)~0, src, flag); +} + +int +strunvis(char *dst, const char *src) +{ + return strnunvisx(dst, (size_t)~0, src, 0); +} + +int +strnunvis(char *dst, size_t dlen, const char *src) +{ + return strnunvisx(dst, dlen, src, 0); +} +#endif diff --git a/gen/FreeBSD/usleep.3 b/gen/FreeBSD/usleep.3 new file mode 100644 index 0000000..12b9274 --- /dev/null +++ b/gen/FreeBSD/usleep.3 @@ -0,0 +1,92 @@ +.\" Copyright (c) 1986, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)usleep.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd February 13, 1998 +.Dt USLEEP 3 +.Os +.Sh NAME +.Nm usleep +.Nd suspend thread execution for an interval measured in microseconds +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn usleep "useconds_t microseconds" +.Sh DESCRIPTION +The +.Fn usleep +function suspends execution of the calling thread until either +.Fa microseconds +microseconds have elapsed or a signal is delivered to the thread and its +action is to invoke a signal-catching function or to terminate the +process. +System activity or limitations may lengthen the sleep by an indeterminate amount. +.Pp +This function is implemented using +.Xr nanosleep 2 +by pausing for +.Fa microseconds +microseconds or until a signal occurs. +Consequently, in this implementation, +sleeping has no effect on the state of process timers, +and there is no special handling for SIGALRM. +Also, this implementation does not put a limit on the value of +.Fa microseconds +(other than that limited by the size of the +.Ft useconds_t +type); some other platforms require it to be less than one million. +.Sh NOTE +The +.Fn usleep +function is obsolescent. +Use +.Xr nanosleep 2 +instead. +.Sh RETURN VALUES +.Rv -std usleep +.Sh ERRORS +The +.Fn usleep +function +will fail if: +.Bl -tag -width Er +.It Bq Er EINTR +A signal was delivered to the process and its +action was to invoke a signal-catching function. +.El +.Sh SEE ALSO +.Xr nanosleep 2 , +.Xr sleep 3 +.Sh HISTORY +The +.Fn usleep +function appeared in +.Bx 4.3 . diff --git a/gen/FreeBSD/usleep.c b/gen/FreeBSD/usleep.c new file mode 100644 index 0000000..47525d3 --- /dev/null +++ b/gen/FreeBSD/usleep.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(VARIANT_CANCELABLE) && __DARWIN_NON_CANCELABLE != 0 +#error cancellable call vs. __DARWIN_NON_CANCELABLE mismatch +#endif + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)usleep.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/usleep.c,v 1.31 2009/12/05 19:31:38 ed Exp $"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" + +int +usleep(useconds_t useconds) +{ + struct timespec time_to_sleep; + + time_to_sleep.tv_nsec = (useconds % 1000000) * 1000; + time_to_sleep.tv_sec = useconds / 1000000; + return (_nanosleep(&time_to_sleep, NULL)); +} diff --git a/gen/FreeBSD/utime.3 b/gen/FreeBSD/utime.3 new file mode 100644 index 0000000..c96ab2e --- /dev/null +++ b/gen/FreeBSD/utime.3 @@ -0,0 +1,95 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)utime.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/utime.3,v 1.14 2007/01/09 00:27:56 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt UTIME 3 +.Os +.Sh NAME +.Nm utime +.Nd set file times +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In utime.h +.Ft int +.Fo utime +.Fa "const char *path" +.Fa "const struct utimbuf *times" +.Fc +.Sh DESCRIPTION +.Bf -symbolic +This interface is obsoleted by +.Xr utimes 2 . +.Ef +.Pp +The +.Fn utime +function sets the access and modification times of the named file, +based on the +.Va actime +and +.Va modtime +fields of the +.Vt "struct utimbuf" +pointed at by +.Fa times . +.Pp +If the times are specified (the +.Fa times +argument is +.Pf non- Dv NULL ) , +the caller must be the owner of the file or be the super-user. +.Pp +If the times are not specified (the +.Fa times +argument is +.Dv NULL ) , +the caller must be the owner of the file, +have permission to write the file, or be the super-user. +.Sh ERRORS +The +.Fn utime +function may fail and set +.Va errno +for any of the errors specified for the library function +.Xr utimes 2 . +.Sh SEE ALSO +.Xr stat 2 , +.Xr utimes 2 +.Sh STANDARDS +The +.Fn utime +function conforms to +.St -p1003.1-88 . +.Sh HISTORY +A +.Fn utime +function appeared in +.At v7 . diff --git a/gen/FreeBSD/utime.c b/gen/FreeBSD/utime.c new file mode 100644 index 0000000..f5a5d8a --- /dev/null +++ b/gen/FreeBSD/utime.c @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)utime.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/utime.c,v 1.3 2007/01/09 00:27:56 imp Exp $"); + +#include + +#include + +int +utime(path, times) + const char *path; + const struct utimbuf *times; +{ + struct timeval tv[2], *tvp; + + if (times) { + tv[0].tv_sec = times->actime; + tv[1].tv_sec = times->modtime; + tv[0].tv_usec = tv[1].tv_usec = 0; + tvp = tv; + } else + tvp = NULL; + return (utimes(path, tvp)); +} diff --git a/gen/FreeBSD/vis.3 b/gen/FreeBSD/vis.3 new file mode 100644 index 0000000..7ad9562 --- /dev/null +++ b/gen/FreeBSD/vis.3 @@ -0,0 +1,506 @@ +.\" $NetBSD: vis.3,v 1.39 2013/02/20 20:05:26 christos Exp $ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)vis.3 8.1 (Berkeley) 6/9/93 +.\" +.Dd February 19, 2013 +.Dt VIS 3 +.Os +.Sh NAME +.Nm vis , +.Nm nvis , +.Nm strvis , +.Nm strnvis , +.Nm strvisx , +.Nm strnvisx , +.Nm strenvisx , +.Nm svis , +.Nm snvis , +.Nm strsvis , +.Nm strsnvis , +.Nm strsvisx , +.Nm strsnvisx , +.Nm strsenvisx +.Nd visually encode characters +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In vis.h +.Ft char * +.Fn vis "char *dst" "int c" "int flag" "int nextc" +.Ft char * +.Fn nvis "char *dst" "size_t dlen" "int c" "int flag" "int nextc" +.Ft int +.Fn strvis "char *dst" "const char *src" "int flag" +.Ft int +.Fn strnvis "char *dst" "size_t dlen" "const char *src" "int flag" +.Ft int +.Fn strvisx "char *dst" "const char *src" "size_t len" "int flag" +.Ft int +.Fn strnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" +.Ft int +.Fn strenvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "int *cerr_ptr" +.Ft char * +.Fn svis "char *dst" "int c" "int flag" "int nextc" "const char *extra" +.Ft char * +.Fn snvis "char *dst" "size_t dlen" "int c" "int flag" "int nextc" "const char *extra" +.Ft int +.Fn strsvis "char *dst" "const char *src" "int flag" "const char *extra" +.Ft int +.Fn strsnvis "char *dst" "size_t dlen" "const char *src" "int flag" "const char *extra" +.Ft int +.Fn strsvisx "char *dst" "const char *src" "size_t len" "int flag" "const char *extra" +.Ft int +.Fn strsnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "const char *extra" +.Ft int +.Fn strsenvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "const char *extra" "int *cerr_ptr" +.Sh DESCRIPTION +The +.Fn vis +function +copies into +.Fa dst +a string which represents the character +.Fa c . +If +.Fa c +needs no encoding, it is copied in unaltered. +The string is null terminated, and a pointer to the end of the string is +returned. +The maximum length of any encoding is four +bytes (not including the trailing +.Dv NUL ) ; +thus, when +encoding a set of characters into a buffer, the size of the buffer should +be four times the number of bytes encoded, plus one for the trailing +.Dv NUL . +The flag parameter is used for altering the default range of +characters considered for encoding and for altering the visual +representation. +The additional character, +.Fa nextc , +is only used when selecting the +.Dv VIS_CSTYLE +encoding format (explained below). +.Pp +The +.Fn strvis , +.Fn strnvis , +.Fn strvisx , +and +.Fn strnvisx +functions copy into +.Fa dst +a visual representation of +the string +.Fa src . +The +.Fn strvis +and +.Fn strnvis +functions encode characters from +.Fa src +up to the +first +.Dv NUL . +The +.Fn strvisx +and +.Fn strnvisx +functions encode exactly +.Fa len +characters from +.Fa src +(this +is useful for encoding a block of data that may contain +.Dv NUL Ns 's ) . +Both forms +.Dv NUL +terminate +.Fa dst . +The size of +.Fa dst +must be four times the number +of bytes encoded from +.Fa src +(plus one for the +.Dv NUL ) . +Both +forms return the number of characters in +.Fa dst +(not including the trailing +.Dv NUL ) . +The +.Dq Nm n +versions of the functions also take an additional argument +.Fa dlen +that indicates the length of the +.Fa dst +buffer. +If +.Fa dlen +is not large enough to fit the converted string then the +.Fn strnvis +and +.Fn strnvisx +functions return \-1 and set +.Va errno +to +.Dv ENOSPC . +The +.Fn strenvisx +function takes an additional argument, +.Fa cerr_ptr , +that is used to pass in and out a multibyte conversion error flag. +This is useful when processing single characters at a time when +it is possible that the locale may be set to something other +than the locale of the characters in the input data. +.Pp +The functions +.Fn svis , +.Fn snvis , +.Fn strsvis , +.Fn strsnvis , +.Fn strsvisx , +.Fn strsnvisx , +and +.Fn strsenvisx +correspond to +.Fn vis , +.Fn nvis , +.Fn strvis , +.Fn strnvis , +.Fn strvisx , +.Fn strnvisx , +and +.Fn strenvisx +but have an additional argument +.Fa extra , +pointing to a +.Dv NUL +terminated list of characters. +These characters will be copied encoded or backslash-escaped into +.Fa dst . +These functions are useful e.g. to remove the special meaning +of certain characters to shells. +.Pp +The encoding is a unique, invertible representation composed entirely of +graphic characters; it can be decoded back into the original form using +the +.Xr unvis 3 , +.Xr strunvis 3 +or +.Xr strnunvis 3 +functions. +.Pp +There are two parameters that can be controlled: the range of +characters that are encoded (applies only to +.Fn vis , +.Fn nvis , +.Fn strvis , +.Fn strnvis , +.Fn strvisx , +and +.Fn strnvisx ) , +and the type of representation used. +By default, all non-graphic characters, +except space, tab, and newline are encoded (see +.Xr isgraph 3 ) . +The following flags +alter this: +.Bl -tag -width VIS_WHITEX +.It Dv VIS_GLOB +Also encode the magic characters +.Ql ( * , +.Ql \&? , +.Ql \&[ +and +.Ql # ) +recognized by +.Xr glob 3 . +.It Dv VIS_SP +Also encode space. +.It Dv VIS_TAB +Also encode tab. +.It Dv VIS_NL +Also encode newline. +.It Dv VIS_WHITE +Synonym for +.Dv VIS_SP +\&| +.Dv VIS_TAB +\&| +.Dv VIS_NL . +.It Dv VIS_SAFE +Only encode +.Dq unsafe +characters. +Unsafe means control characters which may cause common terminals to perform +unexpected functions. +Currently this form allows space, tab, newline, backspace, bell, and +return \(em in addition to all graphic characters \(em unencoded. +.El +.Pp +(The above flags have no effect for +.Fn svis , +.Fn snvis , +.Fn strsvis , +.Fn strsnvis , +.Fn strsvisx , +and +.Fn strsnvisx . +When using these functions, place all graphic characters to be +encoded in an array pointed to by +.Fa extra . +In general, the backslash character should be included in this array, see the +warning on the use of the +.Dv VIS_NOSLASH +flag below). +.Pp +There are four forms of encoding. +All forms use the backslash character +.Ql \e +to introduce a special +sequence; two backslashes are used to represent a real backslash, +except +.Dv VIS_HTTPSTYLE +that uses +.Ql % , +or +.Dv VIS_MIMESTYLE +that uses +.Ql = . +These are the visual formats: +.Bl -tag -width VIS_CSTYLE +.It (default) +Use an +.Ql M +to represent meta characters (characters with the 8th +bit set), and use caret +.Ql ^ +to represent control characters (see +.Xr iscntrl 3 ) . +The following formats are used: +.Bl -tag -width xxxxx +.It Dv \e^C +Represents the control character +.Ql C . +Spans characters +.Ql \e000 +through +.Ql \e037 , +and +.Ql \e177 +(as +.Ql \e^? ) . +.It Dv \eM-C +Represents character +.Ql C +with the 8th bit set. +Spans characters +.Ql \e241 +through +.Ql \e376 . +.It Dv \eM^C +Represents control character +.Ql C +with the 8th bit set. +Spans characters +.Ql \e200 +through +.Ql \e237 , +and +.Ql \e377 +(as +.Ql \eM^? ) . +.It Dv \e040 +Represents +.Tn ASCII +space. +.It Dv \e240 +Represents Meta-space. +.El +.Pp +.It Dv VIS_CSTYLE +Use C-style backslash sequences to represent standard non-printable +characters. +The following sequences are used to represent the indicated characters: +.Bd -unfilled -offset indent +.Li \ea Tn \(em BEL No (007) +.Li \eb Tn \(em BS No (010) +.Li \ef Tn \(em NP No (014) +.Li \en Tn \(em NL No (012) +.Li \er Tn \(em CR No (015) +.Li \es Tn \(em SP No (040) +.Li \et Tn \(em HT No (011) +.Li \ev Tn \(em VT No (013) +.Li \e0 Tn \(em NUL No (000) +.Ed +.Pp +When using this format, the +.Fa nextc +parameter is looked at to determine if a +.Dv NUL +character can be encoded as +.Ql \e0 +instead of +.Ql \e000 . +If +.Fa nextc +is an octal digit, the latter representation is used to +avoid ambiguity. +.It Dv VIS_OCTAL +Use a three digit octal sequence. +The form is +.Ql \eddd +where +.Em d +represents an octal digit. +.It Dv VIS_HTTPSTYLE +Use URI encoding as described in RFC 1738. +The form is +.Ql %xx +where +.Em x +represents a lower case hexadecimal digit. +.It Dv VIS_MIMESTYLE +Use MIME Quoted-Printable encoding as described in RFC 2045, only don't +break lines and don't handle CRLF. +The form is +.Ql =XX +where +.Em X +represents an upper case hexadecimal digit. +.El +.Pp +There is one additional flag, +.Dv VIS_NOSLASH , +which inhibits the +doubling of backslashes and the backslash before the default +format (that is, control characters are represented by +.Ql ^C +and +meta characters as +.Ql M-C ) . +With this flag set, the encoding is +ambiguous and non-invertible. +.Sh MULTIBYTE CHARACTER SUPPORT +These functions support multibyte character input. +The encoding conversion is influenced by the setting of the +.Ev LC_CTYPE +environment variable which defines the set of characters +that can be copied without encoding. +.Pp +When 8-bit data is present in the input, +.Ev LC_CTYPE +must be set to the correct locale or to the C locale. +If the locales of the data and the conversion are mismatched, +multibyte character recognition may fail and encoding will be performed +byte-by-byte instead. +.Pp +As noted above, +.Fa dst +must be four times the number of bytes processed from +.Fa src . +But note that each multibyte character can be up to +.Dv MB_LEN_MAX +bytes +.\" (see +.\" .Xr multibyte 3 ) +so in terms of multibyte characters, +.Fa dst +must be four times +.Dv MB_LEN_MAX +times the number of characters processed from +.Fa src . +.Sh ENVIRONMENT +.Bl -tag -width ".Ev LC_CTYPE" +.It Ev LC_CTYPE +Specify the locale of the input data. +Set to C if the input data locale is unknown. +.El +.Sh ERRORS +The functions +.Fn nvis +and +.Fn snvis +will return +.Dv NULL +and the functions +.Fn strnvis , +.Fn strnvisx , +.Fn strsnvis , +and +.Fn strsnvisx , +will return \-1 when the +.Fa dlen +destination buffer size is not enough to perform the conversion while +setting +.Va errno +to: +.Bl -tag -width ".Bq Er ENOSPC" +.It Bq Er ENOSPC +The destination buffer size is not large enough to perform the conversion. +.El +.Sh SEE ALSO +.Xr unvis 1 , +.Xr vis 1 , +.Xr glob 3 , +.\" .Xr multibyte 3 , +.Xr unvis 3 +.Rs +.%A T. Berners-Lee +.%T Uniform Resource Locators (URL) +.%O "RFC 1738" +.Re +.Rs +.%T "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies" +.%O "RFC 2045" +.Re +.Sh HISTORY +The +.Fn vis , +.Fn strvis , +and +.Fn strvisx +functions first appeared in +.Bx 4.4 . +The +.Fn svis , +.Fn strsvis , +.Fn strsvisx +.Fn nvis , +.Fn strnvis , +.Fn strnvisx , +.Fn snvis , +.Fn strsnvis +and +.Fn strsnvisx +functions as well as multibyte character support were added in OS X 10.12. diff --git a/gen/FreeBSD/vis.c b/gen/FreeBSD/vis.c new file mode 100644 index 0000000..23e0bbc --- /dev/null +++ b/gen/FreeBSD/vis.c @@ -0,0 +1,667 @@ +/* $NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $ */ + +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/*- + * Copyright (c) 1999, 2005 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $"); +#endif /* LIBC_SCCS and not lint */ +#ifdef __FBSDID +__FBSDID("$FreeBSD$"); +#define _DIAGASSERT(x) assert(x) +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include + +#if !HAVE_VIS || !HAVE_SVIS +#include +#include +#include +#include + +/* + * The reason for going through the trouble to deal with character encodings + * in vis(3), is that we use this to safe encode output of commands. This + * safe encoding varies depending on the character set. For example if we + * display ps output in French, we don't want to display French characters + * as M-foo. + */ + +static wchar_t *do_svis(wchar_t *, wint_t, int, wint_t, const wchar_t *); + +#undef BELL +#define BELL L'\a' + +#define iswoctal(c) (((u_char)(c)) >= L'0' && ((u_char)(c)) <= L'7') +#define iswwhite(c) (c == L' ' || c == L'\t' || c == L'\n') +#define iswsafe(c) (c == L'\b' || c == BELL || c == L'\r') +#define xtoa(c) L"0123456789abcdef"[c] +#define XTOA(c) L"0123456789ABCDEF"[c] + +#define MAXEXTRAS 10 + +_Static_assert(MB_LEN_MAX <= sizeof(uint64_t), "MB_LEN_MAX is less than 64-bits"); + +/* + * This is do_hvis, for HTTP style (RFC 1808) + */ +static wchar_t * +do_hvis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) +{ + if (iswalnum(c) + /* safe */ + || c == L'$' || c == L'-' || c == L'_' || c == L'.' || c == L'+' + /* extra */ + || c == L'!' || c == L'*' || c == L'\'' || c == L'(' || c == L')' + || c == L',') + dst = do_svis(dst, c, flags, nextc, extra); + else { + *dst++ = L'%'; + *dst++ = xtoa(((unsigned int)c >> 4) & 0xf); + *dst++ = xtoa((unsigned int)c & 0xf); + } + + return dst; +} + +/* + * This is do_mvis, for Quoted-Printable MIME (RFC 2045) + * NB: No handling of long lines or CRLF. + */ +static wchar_t * +do_mvis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) +{ + if ((c != L'\n') && + /* Space at the end of the line */ + ((iswspace(c) && (nextc == L'\r' || nextc == L'\n')) || + /* Out of range */ + (!iswspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) || + /* Specific char to be escaped */ + wcschr(L"#$@[\\]^`{|}~", c) != NULL)) { + *dst++ = L'='; + *dst++ = XTOA(((unsigned int)c >> 4) & 0xf); + *dst++ = XTOA((unsigned int)c & 0xf); + } else + dst = do_svis(dst, c, flags, nextc, extra); + return dst; +} + +/* + * Output single byte of multibyte character. + */ +static wchar_t * +do_mbyte(wchar_t *dst, wint_t c, int flags, wint_t nextc, int iswextra) +{ + if (flags & VIS_CSTYLE) { + switch (c) { + case L'\n': + *dst++ = L'\\'; *dst++ = L'n'; + return dst; + case L'\r': + *dst++ = L'\\'; *dst++ = L'r'; + return dst; + case L'\b': + *dst++ = L'\\'; *dst++ = L'b'; + return dst; + case BELL: + *dst++ = L'\\'; *dst++ = L'a'; + return dst; + case L'\v': + *dst++ = L'\\'; *dst++ = L'v'; + return dst; + case L'\t': + *dst++ = L'\\'; *dst++ = L't'; + return dst; + case L'\f': + *dst++ = L'\\'; *dst++ = L'f'; + return dst; + case L' ': + *dst++ = L'\\'; *dst++ = L's'; + return dst; + case L'\0': + *dst++ = L'\\'; *dst++ = L'0'; + if (iswoctal(nextc)) { + *dst++ = L'0'; + *dst++ = L'0'; + } + return dst; + default: + if (iswgraph(c)) { + *dst++ = L'\\'; + *dst++ = c; + return dst; + } + } + } + if (iswextra || ((c & 0177) == L' ') || (flags & VIS_OCTAL)) { + *dst++ = L'\\'; + *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + L'0'; + *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + L'0'; + *dst++ = (c & 07) + L'0'; + } else { + if ((flags & VIS_NOSLASH) == 0) + *dst++ = L'\\'; + + if (c & 0200) { + c &= 0177; + *dst++ = L'M'; + } + + if (iswcntrl(c)) { + *dst++ = L'^'; + if (c == 0177) + *dst++ = L'?'; + else + *dst++ = c + L'@'; + } else { + *dst++ = L'-'; + *dst++ = c; + } + } + + return dst; +} + +/* + * This is do_vis, the central code of vis. + * dst: Pointer to the destination buffer + * c: Character to encode + * flags: Flags word + * nextc: The character following 'c' + * extra: Pointer to the list of extra characters to be + * backslash-protected. + */ +static wchar_t * +do_svis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) +{ + int iswextra, i, shft; + uint64_t bmsk, wmsk; + + iswextra = wcschr(extra, c) != NULL; + if (!iswextra && (iswgraph(c) || iswwhite(c) || + ((flags & VIS_SAFE) && iswsafe(c)))) { + *dst++ = c; + return dst; + } + + /* See comment in istrsenvisx() output loop, below. */ + wmsk = 0; + for (i = sizeof(wmsk) - 1; i >= 0; i--) { + shft = i * NBBY; + bmsk = (uint64_t)0xffLL << shft; + wmsk |= bmsk; + if ((c & wmsk) || i == 0) + dst = do_mbyte(dst, (wint_t)( + (uint64_t)(c & bmsk) >> shft), + flags, nextc, iswextra); + } + + return dst; +} + +typedef wchar_t *(*visfun_t)(wchar_t *, wint_t, int, wint_t, const wchar_t *); + +/* + * Return the appropriate encoding function depending on the flags given. + */ +static visfun_t +getvisfun(int flags) +{ + if (flags & VIS_HTTPSTYLE) + return do_hvis; + if (flags & VIS_MIMESTYLE) + return do_mvis; + return do_svis; +} + +/* + * Expand list of extra characters to not visually encode. + */ +static wchar_t * +makeextralist(int flags, const char *src) +{ + wchar_t *dst, *d; + size_t len; + + len = strlen(src); + if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL) + return NULL; + + if (mbstowcs(dst, src, len) == (size_t)-1) { + size_t i; + for (i = 0; i < len; i++) + dst[i] = (wint_t)(u_char)src[i]; + d = dst + len; + } else + d = dst + wcslen(dst); + + if (flags & VIS_GLOB) { + *d++ = L'*'; + *d++ = L'?'; + *d++ = L'['; + *d++ = L'#'; + } + + if (flags & VIS_SP) *d++ = L' '; + if (flags & VIS_TAB) *d++ = L'\t'; + if (flags & VIS_NL) *d++ = L'\n'; + if ((flags & VIS_NOSLASH) == 0) *d++ = L'\\'; + *d = L'\0'; + + return dst; +} + +/* + * istrsenvisx() + * The main internal function. + * All user-visible functions call this one. + */ +static int +istrsenvisx(char *mbdst, size_t *dlen, const char *mbsrc, size_t mblength, + int flags, const char *mbextra, int *cerr_ptr) +{ + wchar_t *dst, *src, *pdst, *psrc, *start, *extra; + size_t len, olen; + uint64_t bmsk, wmsk; + wint_t c; + visfun_t f; + int clen = 0, cerr = 0, error = -1, i, shft; + ssize_t mbslength, maxolen; + + _DIAGASSERT(mbdst != NULL); + _DIAGASSERT(mbsrc != NULL || mblength == 0); + _DIAGASSERT(mbextra != NULL); + + /* + * Input (mbsrc) is a char string considered to be multibyte + * characters. The input loop will read this string pulling + * one character, possibly multiple bytes, from mbsrc and + * converting each to wchar_t in src. + * + * The vis conversion will be done using the wide char + * wchar_t string. + * + * This will then be converted back to a multibyte string to + * return to the caller. + */ + + /* Allocate space for the wide char strings */ + psrc = pdst = extra = NULL; + if ((psrc = calloc(mblength + 1, sizeof(*psrc))) == NULL) + return -1; + if ((pdst = calloc((4 * mblength) + 1, sizeof(*pdst))) == NULL) + goto out; + dst = pdst; + src = psrc; + + /* Use caller's multibyte conversion error flag. */ + if (cerr_ptr) + cerr = *cerr_ptr; + + /* + * Input loop. + * Handle up to mblength characters (not bytes). We do not + * stop at NULs because we may be processing a block of data + * that includes NULs. + */ + mbslength = (ssize_t)mblength; + /* + * When inputing a single character, must also read in the + * next character for nextc, the look-ahead character. + */ + if (mbslength == 1) + mbslength++; + while (mbslength > 0) { + /* Convert one multibyte character to wchar_t. */ + if (!cerr) + clen = mbtowc(src, mbsrc, MB_LEN_MAX); + if (cerr || clen < 0) { + /* Conversion error, process as a byte instead. */ + *src = (wint_t)(u_char)*mbsrc; + clen = 1; + cerr = 1; + } + if (clen == 0) + /* + * NUL in input gives 0 return value. process + * as single NUL byte and keep going. + */ + clen = 1; + /* Advance buffer character pointer. */ + src++; + /* Advance input pointer by number of bytes read. */ + mbsrc += clen; + /* Decrement input byte count. */ + mbslength -= clen; + } + len = src - psrc; + src = psrc; + /* + * In the single character input case, we will have actually + * processed two characters, c and nextc. Reset len back to + * just a single character. + */ + if (mblength < len) + len = mblength; + + /* Convert extra argument to list of characters for this mode. */ + extra = makeextralist(flags, mbextra); + if (!extra) { + if (dlen && *dlen == 0) { + errno = ENOSPC; + goto out; + } + *mbdst = '\0'; /* can't create extra, return "" */ + error = 0; + goto out; + } + + /* Look up which processing function to call. */ + f = getvisfun(flags); + + /* + * Main processing loop. + * Call do_Xvis processing function one character at a time + * with next character available for look-ahead. + */ + for (start = dst; len > 0; len--) { + c = *src++; + dst = (*f)(dst, c, flags, len >= 1 ? *src : L'\0', extra); + if (dst == NULL) { + errno = ENOSPC; + goto out; + } + } + + /* Terminate the string in the buffer. */ + *dst = L'\0'; + + /* + * Output loop. + * Convert wchar_t string back to multibyte output string. + * If we have hit a multi-byte conversion error on input, + * output byte-by-byte here. Else use wctomb(). + */ + len = wcslen(start); + maxolen = dlen ? *dlen : (wcslen(start) * MB_LEN_MAX + 1); + olen = 0; + for (dst = start; len > 0; len--) { + if (!cerr) + clen = wctomb(mbdst, *dst); + if (cerr || clen < 0) { + /* + * Conversion error, process as a byte(s) instead. + * Examine each byte and higher-order bytes for + * data. E.g., + * 0x000000000000a264 -> a2 64 + * 0x000000001f00a264 -> 1f 00 a2 64 + */ + clen = 0; + wmsk = 0; + for (i = sizeof(wmsk) - 1; i >= 0; i--) { + shft = i * NBBY; + bmsk = (uint64_t)0xffLL << shft; + wmsk |= bmsk; + if ((*dst & wmsk) || i == 0) + mbdst[clen++] = (char)( + (uint64_t)(*dst & bmsk) >> + shft); + } + cerr = 1; + } + /* If this character would exceed our output limit, stop. */ + if (olen + clen > (size_t)maxolen) + break; + /* Advance output pointer by number of bytes written. */ + mbdst += clen; + /* Advance buffer character pointer. */ + dst++; + /* Incrment output character count. */ + olen += clen; + } + + /* Terminate the output string. */ + *mbdst = '\0'; + + /* Pass conversion error flag out. */ + if (cerr_ptr) + *cerr_ptr = cerr; + + free(extra); + free(pdst); + free(psrc); + + return (int)olen; +out: + free(extra); + free(pdst); + free(psrc); + return error; +} + +static int +istrsenvisxl(char *mbdst, size_t *dlen, const char *mbsrc, + int flags, const char *mbextra, int *cerr_ptr) +{ + return istrsenvisx(mbdst, dlen, mbsrc, + mbsrc != NULL ? strlen(mbsrc) : 0, flags, mbextra, cerr_ptr); +} + +#endif + +#if !HAVE_SVIS +/* + * The "svis" variants all take an "extra" arg that is a pointer + * to a NUL-terminated list of characters to be encoded, too. + * These functions are useful e. g. to encode strings in such a + * way so that they are not interpreted by a shell. + */ + +char * +svis(char *mbdst, int c, int flags, int nextc, const char *mbextra) +{ + char cc[2]; + int ret; + + cc[0] = c; + cc[1] = nextc; + + ret = istrsenvisx(mbdst, NULL, cc, 1, flags, mbextra, NULL); + if (ret < 0) + return NULL; + return mbdst + ret; +} + +char * +snvis(char *mbdst, size_t dlen, int c, int flags, int nextc, const char *mbextra) +{ + char cc[2]; + int ret; + + cc[0] = c; + cc[1] = nextc; + + ret = istrsenvisx(mbdst, &dlen, cc, 1, flags, mbextra, NULL); + if (ret < 0) + return NULL; + return mbdst + ret; +} + +int +strsvis(char *mbdst, const char *mbsrc, int flags, const char *mbextra) +{ + return istrsenvisxl(mbdst, NULL, mbsrc, flags, mbextra, NULL); +} + +int +strsnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags, const char *mbextra) +{ + return istrsenvisxl(mbdst, &dlen, mbsrc, flags, mbextra, NULL); +} + +int +strsvisx(char *mbdst, const char *mbsrc, size_t len, int flags, const char *mbextra) +{ + return istrsenvisx(mbdst, NULL, mbsrc, len, flags, mbextra, NULL); +} + +int +strsnvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags, + const char *mbextra) +{ + return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, mbextra, NULL); +} + +int +strsenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags, + const char *mbextra, int *cerr_ptr) +{ + return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, mbextra, cerr_ptr); +} +#endif + +#if !HAVE_VIS +/* + * vis - visually encode characters + */ +char * +vis(char *mbdst, int c, int flags, int nextc) +{ + char cc[2]; + int ret; + + cc[0] = c; + cc[1] = nextc; + + ret = istrsenvisx(mbdst, NULL, cc, 1, flags, "", NULL); + if (ret < 0) + return NULL; + return mbdst + ret; +} + +char * +nvis(char *mbdst, size_t dlen, int c, int flags, int nextc) +{ + char cc[2]; + int ret; + + cc[0] = c; + cc[1] = nextc; + + ret = istrsenvisx(mbdst, &dlen, cc, 1, flags, "", NULL); + if (ret < 0) + return NULL; + return mbdst + ret; +} + +/* + * strvis - visually encode characters from src into dst + * + * Dst must be 4 times the size of src to account for possible + * expansion. The length of dst, not including the trailing NULL, + * is returned. + */ + +int +strvis(char *mbdst, const char *mbsrc, int flags) +{ + return istrsenvisxl(mbdst, NULL, mbsrc, flags, "", NULL); +} + +int +strnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags) +{ + return istrsenvisxl(mbdst, &dlen, mbsrc, flags, "", NULL); +} + +/* + * strvisx - visually encode characters from src into dst + * + * Dst must be 4 times the size of src to account for possible + * expansion. The length of dst, not including the trailing NULL, + * is returned. + * + * Strvisx encodes exactly len characters from src into dst. + * This is useful for encoding a block of data. + */ + +int +strvisx(char *mbdst, const char *mbsrc, size_t len, int flags) +{ + return istrsenvisx(mbdst, NULL, mbsrc, len, flags, "", NULL); +} + +int +strnvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags) +{ + return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, "", NULL); +} + +int +strenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags, + int *cerr_ptr) +{ + return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, "", cerr_ptr); +} +#endif diff --git a/gen/FreeBSD/wait.c b/gen/FreeBSD/wait.c new file mode 100644 index 0000000..8bf2b1e --- /dev/null +++ b/gen/FreeBSD/wait.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)wait.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/wait.c,v 1.7 2007/01/09 00:27:56 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" + +#ifdef VARIANT_CANCELABLE +int __wait4(pid_t, int *, int , struct rusage *); +#else /* !VARIANT_CANCELABLE */ +int __wait4_nocancel(pid_t, int *, int , struct rusage *); +#endif /* VARIANT_CANCELABLE */ + +pid_t +__wait(int *istat) +{ +#ifdef VARIANT_CANCELABLE + return (__wait4(WAIT_ANY, istat, 0, (struct rusage *)0)); +#else /* !VARIANT_CANCELABLE */ + return (__wait4_nocancel(WAIT_ANY, istat, 0, (struct rusage *)0)); +#endif /* VARIANT_CANCELABLE */ +} + +__weak_reference(__wait, wait); +__weak_reference(__wait, _wait); diff --git a/gen/FreeBSD/wait3.c b/gen/FreeBSD/wait3.c new file mode 100644 index 0000000..0aca311 --- /dev/null +++ b/gen/FreeBSD/wait3.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)wait3.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/wait3.c,v 1.4 2007/01/09 00:27:56 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" + +pid_t +wait3(istat, options, rup) + int *istat; + int options; + struct rusage *rup; +{ + return (_wait4(WAIT_ANY, istat, options, rup)); +} diff --git a/gen/FreeBSD/waitpid.c b/gen/FreeBSD/waitpid.c new file mode 100644 index 0000000..d81530f --- /dev/null +++ b/gen/FreeBSD/waitpid.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)waitpid.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/gen/waitpid.c,v 1.7 2007/01/09 00:27:56 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" + +#if __DARWIN_UNIX03 +#include +#endif /* __DARWIN_UNIX03 */ +#ifdef VARIANT_CANCELABLE +int __wait4(pid_t, int *, int , struct rusage *); +#else /* !VARIANT_CANCELABLE */ +int __wait4_nocancel(pid_t, int *, int , struct rusage *); +#endif /* VARIANT_CANCELABLE */ + +pid_t +__waitpid(pid_t pid, int *istat, int options) +{ +#if __DARWIN_UNIX03 + /* POSIX: Validate waitpid() options before calling wait4() */ + if ((options & (WCONTINUED | WNOHANG | WUNTRACED)) != options) { + errno = EINVAL; + return ((pid_t)-1); + } +#endif /* __DARWIN_UNIX03 */ + +#ifdef VARIANT_CANCELABLE + return (__wait4(pid, istat, options, (struct rusage *)0)); +#else /* !VARIANT_CANCELABLE */ + return (__wait4_nocancel(pid, istat, options, (struct rusage *)0)); +#endif /* VARIANT_CANCELABLE */ +} + +__weak_reference(__waitpid, waitpid); +__weak_reference(__waitpid, _waitpid); diff --git a/gen/FreeBSD/wordexp.3 b/gen/FreeBSD/wordexp.3 new file mode 100644 index 0000000..498ef1b --- /dev/null +++ b/gen/FreeBSD/wordexp.3 @@ -0,0 +1,206 @@ +.\" +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 29, 2004 +.Dt WORDEXP 3 +.Os +.Sh NAME +.Nm wordexp +.Nd "perform shell-style word expansions" +.\" .Sh LIBRARY +.\" .Lb libc +.Sh SYNOPSIS +.In wordexp.h +.Ft int +.Fn wordexp "const char * restrict words" "wordexp_t * restrict we" "int flags" +.Ft void +.Fn wordfree "wordexp_t *we" +.Sh DESCRIPTION +The +.Fn wordexp +function performs shell-style word expansion on +.Fa words +and places the list of words into the +.Va we_wordv +member of +.Fa we , +and the number of words into +.Va we_wordc . +.Pp +The +.Fa flags +argument is the bitwise inclusive OR of any of the following constants: +.Bl -tag -width ".Dv WRDE_SHOWERR" +.It Dv WRDE_APPEND +Append the words to those generated by a previous call to +.Fn wordexp . +.It Dv WRDE_DOOFFS +As many +.Dv NULL +pointers as are specified by the +.Va we_offs +member of +.Fa we +are added to the front of +.Va we_wordv . +.It Dv WRDE_NOCMD +Disallow command substitution in +.Fa words . +See the note in +.Sx BUGS +before using this. +.It Dv WRDE_REUSE +The +.Fa we +argument was passed to a previous successful call to +.Fn wordexp +but has not been passed to +.Fn wordfree . +The implementation may reuse the space allocated to it. +.It Dv WRDE_SHOWERR +Do not redirect shell error messages to +.Pa /dev/null . +.It Dv WRDE_UNDEF +Report error on an attempt to expand an undefined shell variable. +.El +.Pp +The +.Vt wordexp_t +structure is defined in +.In wordexp.h +as: +.Bd -literal -offset indent +typedef struct { + size_t we_wordc; /* count of words matched */ + char **we_wordv; /* pointer to list of words */ + size_t we_offs; /* slots to reserve in we_wordv */ +} wordexp_t; +.Ed +.Pp +The +.Fn wordfree +function frees the memory allocated by +.Fn wordexp . +.Sh IMPLEMENTATION NOTES +The +.Fn wordexp +function is implemented as a wrapper around the undocumented +.Ic wordexp +shell built-in command. +.Sh RETURN VALUES +The +.Fn wordexp +function returns zero if successful, otherwise it returns one of the following +error codes: +.Bl -tag -width ".Dv WRDE_NOSPACE" +.It Dv WRDE_BADCHAR +The +.Fa words +argument contains one of the following unquoted characters: +.Aq newline , +.Ql | , +.Ql & , +.Ql \&; , +.Ql < , +.Ql > , +.Ql \&( , +.Ql \&) , +.Ql { , +.Ql } . +.It Dv WRDE_BADVAL +An attempt was made to expand an undefined shell variable and +.Dv WRDE_UNDEF +is set in +.Fa flags . +.It Dv WRDE_CMDSUB +An attempt was made to use command substitution and +.Dv WRDE_NOCMD +is set in +.Fa flags . +.It Dv WRDE_NOSPACE +Not enough memory to store the result. +.It Dv WRDE_SYNTAX +Shell syntax error in +.Fa words . +.El +.Pp +The +.Fn wordfree +function returns no value. +.Sh ENVIRONMENT +.Bl -tag -width ".Ev IFS" +.It Ev IFS +Field separator. +.El +.Sh EXAMPLES +Invoke the editor on all +.Pa .c +files in the current directory +and +.Pa /etc/motd +(error checking omitted): +.Bd -literal -offset indent +wordexp_t we; + +wordexp("${EDITOR:-vi} *.c /etc/motd", &we, 0); +execvp(we.we_wordv[0], we.we_wordv); +.Ed +.Sh DIAGNOSTICS +Diagnostic messages from the shell are written to the standard error output +if +.Dv WRDE_SHOWERR +is set in +.Fa flags . +.Sh SEE ALSO +.Xr sh 1 , +.Xr fnmatch 3 , +.Xr glob 3 , +.Xr popen 3 , +.Xr system 3 +.Sh STANDARDS +The +.Fn wordexp +and +.Fn wordfree +functions conform to +.St -p1003.1-2001 . +.Sh BUGS +Do not pass untrusted user data to +.Fn wordexp , +regardless of whether the +.Dv WRDE_NOCMD +flag is set. +The +.Fn wordexp +function attempts to detect input that would cause commands to be +executed before passing it to the shell +but it does not use the same parser so it may be fooled. +.Pp +The current +.Fn wordexp +implementation does not recognize multibyte characters, since the +shell (which it invokes to perform expansions) does not. diff --git a/gen/FreeBSD/wordexp.c b/gen/FreeBSD/wordexp.c new file mode 100644 index 0000000..4a6316b --- /dev/null +++ b/gen/FreeBSD/wordexp.c @@ -0,0 +1,600 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#if TARGET_OS_IPHONE +/* */ + +#include +int wordexp(const char *restrict words __unused, wordexp_t *restrict pwordexp __unused, int flags __unused) { + return WRDE_NOSPACE; +} + +void wordfree(wordexp_t *pwordexp __unused) { +} + +#else + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#ifdef __APPLE__ +// For _NSGetEnviron() -- which gives us a pointer to environ +#include +#include +#endif /* __APPLE__ */ + +__FBSDID("$FreeBSD$"); + +#ifdef __APPLE__ +/* + * To maintain backwards compatibility with wordexp_t, we can't put + * we_strings and we_nbytes in wordexp_t. So we create a new structure, + * we_int_t, that has wi_strings and wi_nbytes, as well as the we_wordv + * storage. + */ +typedef struct { + char *wi_strings; + size_t wi_nbytes; + char *wi_wordv[0]; +} we_int_t; +/* + * Normally, we_wordv will point to wi_wordv, so we need macros to convert + * back and forth between wi_wordv and the we_int_t structure. + */ +#define WE_INT_T(x) ((we_int_t *)((char *)(x) - sizeof(we_int_t))) +#define WE_STRINGS(we) (WE_INT_T((we)->we_wordv)->wi_strings) +#define WE_WORDV(x) ((x)->wi_wordv) + +/* + * bash will return success, yet print a command substitution/syntax error + * to stderr. So we need to capture stderr, and see if it contains this error. + */ +static const char command_substitution_str[] = "command substitution"; +static const char syntax_error_str[] = "syntax error"; +static const char unbound_variable_str[] = " unbound variable"; +#endif /* __APPLE__ */ + +static int we_askshell(const char *, wordexp_t *, int); +static int we_check(const char *, int); + +/* + * wordexp -- + * Perform shell word expansion on `words' and place the resulting list + * of words in `we'. See wordexp(3). + * + * Specified by IEEE Std. 1003.1-2001. + */ +int +#ifdef __APPLE__ +wordexp(const char * __restrict words, wordexp_t * __restrict we0, int flags) +#else /* !__APPLE__ */ +wordexp(const char * __restrict words, wordexp_t * __restrict we, int flags) +#endif /* !__APPLE__ */ +{ + int error; +#ifdef __APPLE__ + wordexp_t temp; + wordexp_t *we = &temp; + + if ((error = we_check(words, flags)) != 0) return (error); + we->we_offs = we0->we_offs; + if (flags & WRDE_APPEND) { + size_t i; + size_t vofs = we0->we_wordc + (flags & WRDE_DOOFFS ? we0->we_offs : 0); + we_int_t *wi0 = WE_INT_T(we0->we_wordv); + we_int_t *wi = malloc((vofs + 1) * sizeof(char *) + sizeof(we_int_t)); + + if (!wi) return (WRDE_NOSPACE); + memcpy(wi, wi0, (vofs + 1) * sizeof(char *) + sizeof(we_int_t)); + wi->wi_strings = malloc(wi->wi_nbytes); + if (!wi->wi_strings) { + free(wi); + return (WRDE_NOSPACE); + } + memcpy(wi->wi_strings, wi0->wi_strings, wi->wi_nbytes); + for (i = 0; i < vofs; i++) + if (wi->wi_wordv[i] != NULL) + wi->wi_wordv[i] += wi->wi_strings - wi0->wi_strings; + we->we_wordc = we0->we_wordc; + we->we_wordv = WE_WORDV(wi); + } else { + we->we_wordc = 0; + we->we_wordv = NULL; + } +#else /* !__APPLE__ */ + if (flags & WRDE_REUSE) + wordfree(we); + if ((flags & WRDE_APPEND) == 0) { + we->we_wordc = 0; + we->we_wordv = NULL; + we->we_strings = NULL; + we->we_nbytes = 0; + } + if ((error = we_check(words, flags)) != 0) { + wordfree(we); + return (error); + } +#endif /* !__APPLE__ */ + if ((error = we_askshell(words, we, flags)) != 0) { +#ifdef __APPLE__ + if (error == WRDE_NOSPACE) { + if (flags & WRDE_REUSE) + wordfree(we0); + *we0 = *we; + } else { + wordfree(we); + } +#else /* !__APPLE__ */ + wordfree(we); +#endif /* !__APPLE__ */ + return (error); + } +#ifdef __APPLE__ + if (flags & WRDE_REUSE) + wordfree(we0); + *we0 = *we; +#endif /* __APPLE__ */ + return (0); +} + +static size_t +we_read_fully(int fd, char *buffer, size_t len) +{ + size_t done; + ssize_t nread; + + done = 0; + do { + nread = _read(fd, buffer + done, len - done); + if (nread == -1 && errno == EINTR) + continue; + if (nread <= 0) + break; + done += nread; + } while (done != len); + return done; +} + +/* + * we_askshell -- + * Use the `wordexp' /bin/sh builtin function to do most of the work + * in expanding the word string. This function is complicated by + * memory management. + */ +static int +we_askshell(const char *words, wordexp_t *we, int flags) +{ + int pdes[2]; /* Pipe to child */ + char bbuf[9]; /* Buffer for byte count */ + char wbuf[9]; /* Buffer for word count */ + long nwords, nbytes; /* Number of words, bytes from child */ + long i; /* Handy integer */ + size_t sofs; /* Offset into we->we_strings */ + size_t vofs; /* Offset into we->we_wordv */ + pid_t pid; /* Process ID of child */ + pid_t wpid; /* waitpid return value */ + int status; /* Child exit status */ + int error; /* Our return value */ + int serrno; /* errno to return */ + char *np, *p; /* Handy pointers */ + char *nstrings; /* Temporary for realloc() */ +#ifdef __APPLE__ + int perr[2]; /* Pipe to child error */ + we_int_t *nwv; /* Temporary for realloc() */ + int spawnerr = 0; + posix_spawn_file_actions_t file_actions; + posix_spawnattr_t attr; +#else /* !__APPLE__ */ + char **nwv; /* Temporary for realloc() */ +#endif /* !__APPLE__ */ + sigset_t newsigblock, oldsigblock; + + serrno = errno; + +#ifdef __APPLE__ + if (pipe(pdes) < 0) +#else /* !__APPLE__ */ + if (pipe2(pdes, O_CLOEXEC) < 0) +#endif /* !__APPLE__ */ + return (WRDE_NOSPACE); /* XXX */ +#ifdef __APPLE__ + if (pipe(perr) < 0) { + close(pdes[0]); + close(pdes[1]); + return (WRDE_NOSPACE); /* XXX */ + } +#endif /* __APPLE__ */ + (void)sigemptyset(&newsigblock); + (void)sigaddset(&newsigblock, SIGCHLD); + (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); +#ifdef __APPLE__ + if ((spawnerr = posix_spawnattr_init(&attr)) != 0) goto spawnerrexit; + do { + sigset_t spawnsig; + if ((spawnerr = posix_spawnattr_setflags(&attr, POSIX_SPAWN_CLOEXEC_DEFAULT)) != 0) break; + (void)sigfillset(&spawnsig); + if ((spawnerr = posix_spawnattr_setsigdefault(&attr, &spawnsig)) != 0) break; + (void)sigemptyset(&spawnsig); + if ((spawnerr = posix_spawnattr_setsigmask(&attr, &spawnsig)) != 0) break; + if ((spawnerr = posix_spawn_file_actions_init(&file_actions)) != 0) break; + do { + char *argv[7] = {"sh"}; + const char cmd[] = "[ $# -gt 0 ] && export IFS=\"$1\";/usr/lib/system/wordexp-helper "; + int a = 1; + char *buf; + int buflen; + char *IFS; + if (pdes[1] == STDOUT_FILENO) { + if ((spawnerr = posix_spawn_file_actions_addinherit_np(&file_actions, STDOUT_FILENO)) != 0) break; + } else { + if ((spawnerr = posix_spawn_file_actions_adddup2(&file_actions, pdes[1], STDOUT_FILENO)) != 0) break; + } + if (perr[1] == STDERR_FILENO) { + if ((spawnerr = posix_spawn_file_actions_addinherit_np(&file_actions, STDERR_FILENO)) != 0) break; + } else { + if ((spawnerr = posix_spawn_file_actions_adddup2(&file_actions, perr[1], STDERR_FILENO)) != 0) break; + } + if (flags & WRDE_UNDEF) argv[a++] = "-u"; + argv[a++] = "-c"; + buflen = (sizeof(cmd) - 1) + strlen(words) + 1; + if ((buf = malloc(buflen)) == NULL) { + spawnerr = errno; + break; + } + strcpy(buf, cmd); + strcat(buf, words); + argv[a++] = buf; + if ((IFS = getenv("IFS")) != NULL) { + argv[a++] = "--"; + argv[a++] = IFS; + } + argv[a] = NULL; + spawnerr = posix_spawn(&pid, _PATH_BSHELL, &file_actions, &attr, argv, *_NSGetEnviron()); + free(buf); + } while(0); + posix_spawn_file_actions_destroy(&file_actions); + } while(0); + posix_spawnattr_destroy(&attr); + if (spawnerr) { +spawnerrexit: + close(pdes[0]); + close(pdes[1]); + close(perr[0]); + close(perr[1]); + errno = spawnerr; + return (WRDE_NOSPACE); /* XXX */ + } +#else /* !__APPLE__ */ + if ((pid = fork()) < 0) { + serrno = errno; + _close(pdes[0]); + _close(pdes[1]); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + errno = serrno; + return (WRDE_NOSPACE); /* XXX */ + } + else if (pid == 0) { + /* + * We are the child; just get /bin/sh to run the wordexp + * builtin on `words'. + */ + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + if ((pdes[1] != STDOUT_FILENO ? + _dup2(pdes[1], STDOUT_FILENO) : + _fcntl(pdes[1], F_SETFD, 0)) < 0) + _exit(1); + execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u", + "-c", "eval \"$1\";eval \"wordexp $2\"", "", + flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words, + (char *)NULL); + _exit(1); + } +#endif /* !__APPLE__ */ + + /* + * We are the parent; read the output of the shell wordexp function, + * which is a 32-bit hexadecimal word count, a 32-bit hexadecimal + * byte count (not including terminating null bytes), followed by + * the expanded words separated by nulls. + */ + _close(pdes[1]); +#ifdef __APPLE__ + close(perr[1]); +#endif /* __APPLE__ */ + if (we_read_fully(pdes[0], wbuf, 8) != 8 || + we_read_fully(pdes[0], bbuf, 8) != 8) { + error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + serrno = errno; + goto cleanup; + } + wbuf[8] = bbuf[8] = '\0'; + nwords = strtol(wbuf, NULL, 16); + nbytes = strtol(bbuf, NULL, 16) + nwords; + + /* + * Allocate or reallocate (when flags & WRDE_APPEND) the word vector + * and string storage buffers for the expanded words we're about to + * read from the child. + */ +#ifndef __APPLE__ + sofs = we->we_nbytes; +#endif /* !__APPLE__ */ + vofs = we->we_wordc; + if ((flags & (WRDE_DOOFFS|WRDE_APPEND)) == (WRDE_DOOFFS|WRDE_APPEND)) + vofs += we->we_offs; + we->we_wordc += nwords; +#ifndef __APPLE__ + we->we_nbytes += nbytes; +#endif /* !__APPLE__ */ +#ifdef __APPLE__ + if ((nwv = realloc(we->we_wordv ? WE_INT_T(we->we_wordv) : NULL, (we->we_wordc + 1 + + (flags & WRDE_DOOFFS ? we->we_offs : 0)) * + sizeof(char *) + sizeof(we_int_t))) == NULL) +#else /* !__APPLE__ */ + if ((nwv = realloc(we->we_wordv, (we->we_wordc + 1 + + (flags & WRDE_DOOFFS ? we->we_offs : 0)) * + sizeof(char *))) == NULL) +#endif /* !__APPLE__ */ + { + error = WRDE_NOSPACE; + goto cleanup; + } +#ifdef __APPLE__ + if (!we->we_wordv) { + nwv->wi_strings = NULL; + nwv->wi_nbytes = 0; + } + sofs = nwv->wi_nbytes; + nwv->wi_nbytes += nbytes; + we->we_wordv = WE_WORDV(nwv); +#else /* !__APPLE__ */ + we->we_wordv = nwv; +#endif /* !__APPLE__ */ +#ifdef __APPLE__ + if ((nstrings = realloc(nwv->wi_strings, nwv->wi_nbytes)) == NULL) +#else /* !__APPLE__ */ + if ((nstrings = realloc(we->we_strings, we->we_nbytes)) == NULL) +#endif /* !__APPLE__ */ + { + error = WRDE_NOSPACE; + goto cleanup; + } + for (i = 0; i < vofs; i++) + if (we->we_wordv[i] != NULL) +#ifdef __APPLE__ + we->we_wordv[i] += nstrings - nwv->wi_strings; +#else /* !__APPLE__ */ + we->we_wordv[i] += nstrings - we->we_strings; +#endif /* !__APPLE__ */ +#ifdef __APPLE__ + nwv->wi_strings = nstrings; +#else /* !__APPLE__ */ + we->we_strings = nstrings; +#endif /* !__APPLE__ */ + +#ifdef __APPLE__ + if (we_read_fully(pdes[0], nwv->wi_strings + sofs, nbytes) != nbytes) +#else /* !__APPLE__ */ + if (we_read_fully(pdes[0], we->we_strings + sofs, nbytes) != nbytes) +#endif /* !__APPLE__ */ + { + error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + serrno = errno; + goto cleanup; + } +#ifdef __APPLE__ + char err_buf[1024]; + ssize_t err_sz = read(perr[0], err_buf, sizeof(err_buf) - 1); + if (err_sz > 0) { + err_buf[err_sz] = '\0'; + if (flags & WRDE_SHOWERR) { + fputs(err_buf, stderr); + } + } else if (err_sz < 0) { + serrno = errno; + error = WRDE_NOSPACE; + goto cleanup; + } +#endif /* __APPLE__ */ + + error = 0; +cleanup: + _close(pdes[0]); +#ifdef __APPLE__ + close(perr[0]); +#endif /* __APPLE__ */ + do + wpid = _waitpid(pid, &status, 0); + while (wpid < 0 && errno == EINTR); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + if (error != 0) { + errno = serrno; + return (error); + } + if (wpid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) + return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); +#ifdef __APPLE__ + const char *cs = strstr(err_buf, command_substitution_str); + if (cs && strstr(cs + (sizeof(command_substitution_str) - 1), syntax_error_str)) { + return (strstr(err_buf, unbound_variable_str) ? WRDE_BADVAL : WRDE_SYNTAX); + } +#endif /* __APPLE__ */ + + /* + * Break the null-terminated expanded word strings out into + * the vector. + */ + if (vofs == 0 && flags & WRDE_DOOFFS) + while (vofs < we->we_offs) + we->we_wordv[vofs++] = NULL; +#ifdef __APPLE__ + p = nwv->wi_strings + sofs; +#else /* !__APPLE__ */ + p = we->we_strings + sofs; +#endif /* !__APPLE__ */ + while (nwords-- != 0) { + we->we_wordv[vofs++] = p; + if ((np = memchr(p, '\0', nbytes)) == NULL) + return (WRDE_NOSPACE); /* XXX */ + nbytes -= np - p + 1; + p = np + 1; + } + we->we_wordv[vofs] = NULL; + + return (0); +} + +/* + * we_check -- + * Check that the string contains none of the following unquoted + * special characters: |&;<>(){} + * or command substitutions when WRDE_NOCMD is set in flags. + */ +static int +we_check(const char *words, int flags) +{ + char c; + int dquote, level, quote, squote; + + quote = squote = dquote = 0; + while ((c = *words++) != '\0') { + switch (c) { + case '\\': + if (squote == 0) + quote ^= 1; + continue; + case '\'': + if (quote + dquote == 0) + squote ^= 1; + break; + case '"': + if (quote + squote == 0) + dquote ^= 1; + break; + case '`': + if (quote + squote == 0 && flags & WRDE_NOCMD) + return (WRDE_CMDSUB); + while ((c = *words++) != '\0' && c != '`') + if (c == '\\' && (c = *words++) == '\0') + break; + if (c == '\0') + return (WRDE_SYNTAX); + break; + case '|': case '&': case ';': case '<': case '>': + case '{': case '}': case '(': case ')': case '\n': + if (quote + squote + dquote == 0) + return (WRDE_BADCHAR); + break; + case '$': + if ((c = *words++) == '\0') + break; + else if (quote + squote == 0 && c == '(') { + if (flags & WRDE_NOCMD && *words != '(') + return (WRDE_CMDSUB); + level = 1; + while ((c = *words++) != '\0') { + if (c == '\\') { + if ((c = *words++) == '\0') + break; + } else if (c == '(') + level++; + else if (c == ')' && --level == 0) + break; + } + if (c == '\0' || level != 0) + return (WRDE_SYNTAX); + } else if (quote + squote == 0 && c == '{') { + level = 1; + while ((c = *words++) != '\0') { + if (c == '\\') { + if ((c = *words++) == '\0') + break; + } else if (c == '{') + level++; + else if (c == '}' && --level == 0) + break; + } + if (c == '\0' || level != 0) + return (WRDE_SYNTAX); + } else + --words; + break; + default: + break; + } + quote = 0; + } + if (quote + squote + dquote != 0) + return (WRDE_SYNTAX); + + return (0); +} + +/* + * wordfree -- + * Free the result of wordexp(). See wordexp(3). + * + * Specified by IEEE Std. 1003.1-2001. + */ +void +wordfree(wordexp_t *we) +{ + + if (we == NULL) + return; +#ifdef __APPLE__ + if (we->we_wordv) { + free(WE_STRINGS(we)); + free(WE_INT_T(we->we_wordv)); + } +#else /* !__APPLE__ */ + free(we->we_wordv); +#endif /* !__APPLE__ */ +#ifndef __APPLE__ + free(we->we_strings); +#endif /* !__APPLE__ */ + we->we_wordv = NULL; +#ifndef __APPLE__ + we->we_strings = NULL; + we->we_nbytes = 0; +#endif /* !__APPLE__ */ + we->we_wordc = 0; +} + +#endif /* TARGET_OS_IPHONE */ diff --git a/gen/NetBSD/endutxent.3 b/gen/NetBSD/endutxent.3 new file mode 100644 index 0000000..719b98f --- /dev/null +++ b/gen/NetBSD/endutxent.3 @@ -0,0 +1,335 @@ +.\" $NetBSD: endutxent.3,v 1.5 2008/04/30 13:10:50 martin Exp $ +.\" +.\" Copyright (c) 2002 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Thomas Klausner. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd June 29, 2006 +.Dt ENDUTXENT 3 +.Os +.Sh NAME +.Nm endutxent , +.Nm getutxent , +.Nm getutxid , +.Nm getutxline , +.Nm pututxline , +.Nm setutxent +.Nd user accounting database functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In utmpx.h +.Ft void +.Fn endutxent void +.Ft struct utmpx * +.Fn getutxent void +.Ft struct utmpx * +.Fn getutxid "const struct utmpx *id" +.Ft struct utmpx * +.Fn getutxline "const struct utmpx *line" +.Ft struct utmpx * +.Fn pututxline "const struct utmpx *utx" +.Ft void +.Fn setutxent void +.Sh DESCRIPTION +These functions provide access to the +.Xr utmpx 5 +user accounting database. +.Pp +.Fn getutxent +reads the next entry from the database; +if the database was not yet open, it also opens it. +.Fn setutxent +resets the database, so that the next +.Fn getutxent +call will get the first entry. +.Fn endutxent +closes the database. +.Pp +.Fn getutxid +returns the next entry of the type specified in its argument's +.Va ut_type +field, or +.Dv NULL +if none is found. +.Fn getutxline +returns the next +.Dv LOGIN_PROCESS +or +.Dv USER_PROCESS +entry which has the same name as specified in the +.Va ut_line +field, or +.Dv NULL +if no match is found. +.Pp +.Fn pututxline +adds the argument +.Xr utmpx 5 +entry line to the accounting database, replacing a previous entry for +the same user if it exists. +Only the superuser may write to the accounting database. +.Ss The utmpx structure +The +.Nm utmpx +structure has the following definition: +.Pp +.Bd -literal +struct utmpx { + char ut_user[_UTX_USERSIZE]; /* login name */ + char ut_id[_UTX_IDSIZE]; /* id */ + char ut_line[_UTX_LINESIZE]; /* tty name */ + pid_t ut_pid; /* process id creating the entry */ + short ut_type; /* type of this entry */ + struct timeval ut_tv; /* time entry was created */ + char ut_host[_UTX_HOSTSIZE]; /* host name */ + __uint32_t ut_pad[16]; /* reserved for future use */ +}; +.Ed +.Pp +Valid entries for +.Fa ut_type +are: +.Bl -tag -width ".Dv LOGIN_PROCESSXX" -compact -offset indent +.It Dv BOOT_TIME +Time of a system boot. +.It Dv DEAD_PROCESS +A session leader exited. +.It Dv EMPTY +No valid user accounting information. +.It Dv INIT_PROCESS +A process spawned by +.Xr init 8 . +.It Dv LOGIN_PROCESS +The session leader of a logged-in user. +.It Dv NEW_TIME +Time after system clock change. +.It Dv OLD_TIME +Time before system clock change. +.It Dv RUN_LVL +Run level. +Provided for compatibility, not used. +.It Dv USER_PROCESS +A user process. +.It Dv SHUTDOWN_TIME +Time of system shutdown (extension to the standards). +.El +.Pp +For each value of +.Fa ut_type , +the other fields with meaningful values are as follows: +.Bl -tag -width ".Dv LOGIN_PROCESSXX" -compact -offset indent +.It Dv BOOT_TIME +.Fa ut_tv +.It Dv DEAD_PROCESS +.Fa ut_id , +.Fa ut_pid , +.Fa ut_tv +.It Dv EMPTY +(no others) +.It Dv INIT_PROCESS +.Fa ut_id , +.Fa ut_pid , +.Fa ut_tv +.It Dv LOGIN_PROCESS +.Fa ut_id , +.Fa ut_user +(implementation-defined name of the login process), +.Fa ut_pid , +.Fa ut_tv +.It Dv NEW_TIME +.Fa ut_tv +.It Dv OLD_TIME +.Fa ut_tv +.It Dv RUN_LVL +(no used) +.It Dv USER_PROCESS +.Fa ut_id , +.Fa ut_user +(login name of the user), +.Fa ut_line , +.Fa ut_pid , +.Fa ut_host +(hostname of remote user) +.Fa ut_tv +.It Dv SHUTDOWN_TIME +.Fa ut_tv +.El +.Ss Other extensions to the standards +The +.Fa ut_type +value may also be OR-ed with the following masks: +.Bl -tag -width XXXX -compact -offset indent +.It Dv UTMPX_AUTOFILL_MASK +Depending on the main part of +.Fa ut_type +value, other fields are automatically filled in (as specified in the +meaningful fields table above). +In particular, the +.Fa ut_id +field will be set using the convention of the last four characters of the +.Fa ut_line +field (itself filled in automatically from the tty name of the device connected +to the standard input, output or error, whichever is available). +Note that it is more efficient to fill in as many values as are already +available beforehand, rather than have then automatically filled in. +.It Dv UTMPX_DEAD_IF_CORRESPONDING_MASK +When +.Fa ut_type +value is +.Dv DEAD_PROCESS, a call to +.Fn pututxline +will succeed only if a corresponding entry already exists with a +.Fa ut_type +value of +.Dv USER_PROCESS . +.El +.Pp +Note that the above mask values do not show up in any file format, or in +any subsequent reads of the data. +.Pp +To support +.Pa wtmpx +and +.Pa lastlogx +equivalent capability, +.Fn pututxline +automatically writes to the appropriate files. +Additional APIs to read these files is available in +.Xr endutxent_wtmp 3 +and +.Xr getlastlogx 3 . +.Ss Backward compatibility +Successful calls to +.Fn pututxline +will automatically write equivalent entries into the +.Pa utmp , +.Pa wtmp +and +.Pa lastlog +files. +Programs that read these old files should work as expected. +However, directly writing to these files does not make corresponding +entries in +.Pa utmpx +and the +.Pa wtmpx +and +.Pa lastlogx +equivalent files, so such write-access is deprecated. +.Sh RETURN VALUES +.Fn getutxent +returns the next entry, or +.Dv NULL +on failure (end of database or problems reading from the database). +.Fn getutxid +and +.Fn getutxline +return the matching structure on success, or +.Dv NULL +if no match was found. +.Pp +.Fn pututxline +returns the structure that was successfully written, or +.Dv NULL +is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +No errors are defined for the +.Fn endutxent , +.Fn getutxent , +.Fn getutxid , +.Fn getutxline , +and +.Fn setutxent +functions. +.Pp +The +.Fn pututxline +function may fail if: +.Bl -tag -width Er +.It Bq Er EPERM +The process does not have appropriate privileges. +.It Bq Er EINVAL +The +.Dv UTMPX_DEAD_IF_CORRESPONDING_MASK +flags was specified along with +.Dv DEAD_PROCESS , +but no corresponding entry with +.Dv USER_PROCESS +was found. +.El +.Pp +Other errors may be returned if +.Dv UTMPX_AUTOFILL_MASK +was specified, and a field could not be auto-filled. +.Sh SEE ALSO +.Xr endutxent_wtmp 3 , +.Xr getlastlogx 3 , +.Xr utmpx 5 +.Sh STANDARDS +The +.Fn endutxent , +.Fn getutxent , +.Fn getutxid , +.Fn getutxline , +.Fn pututxline , +.Fn setutxent +all conform to +.St -p1003.1-2001 +(XSI extension), and previously to +.St -xpg4.2 . +The fields +.Fa ut_user , +.Fa ut_id , +.Fa ut_line , +.Fa ut_pid , +.Fa ut_type , +and +.Fa ut_tv +conform to +.St -p1003.1-2001 +(XSI extension), and previously to +.St -xpg4.2 . +.\" .Fa ut_host , +.\" .Fa ut_session , +.\" .Fa ut_exit , +.\" and +.\" .Fa ut_ss +.\" are from +.\" SVR3/4? +.\" .Dv RUN_LVL +.\" is for compatibility with +.\" what exactly? +.\" .Sh HISTORY +.\" The +.\" .Nm utmpx , +.\" .Nm wtmpx , +.\" and +.\" .Nm lastlogx +.\" files first appeared in +.\" SVR3? 4? diff --git a/gen/NetBSD/getlastlogx.3 b/gen/NetBSD/getlastlogx.3 new file mode 100644 index 0000000..8a70bcf --- /dev/null +++ b/gen/NetBSD/getlastlogx.3 @@ -0,0 +1,139 @@ +.\" $NetBSD: getlastlogx.3,v 1.2 2008/04/30 13:10:50 martin Exp $ +.\" +.\" Copyright (c) 2003 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Thomas Klausner. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd Dec 26, 2005 +.Dt GETLASTLOGX 3 +.Os +.Sh NAME +.Nm getlastlogx , +.Nm getlastlogxbyname , +.Nm getutmp , +.Nm getutmpx , +.Nm utmpxname +.Nd user accounting database functions +.Sh SYNOPSIS +.In utmpx.h +.Ft struct lastlogx * +.Fn getlastlogx "uid_t uid" "struct lastlogx *ll" +.Ft struct lastlogx * +.Fn getlastlogxbyname "const char *name" "struct lastlogx *ll" +.Ft void +.Fn getutmp "const struct utmpx *ux" "struct utmp *u" +.Ft void +.Fn getutmpx "const struct utmp *u" "struct utmpx *ux" +.Ft int +.Fn utmpxname "const char *fname" +.Sh DESCRIPTION +The +.Fn getlastlogx +function looks up the entry for the user with user id +.Fa uid +and returns it in +.Fa \&ll . +If the provided +.Fa \&ll +is +.Dv NULL , +the necessary space will be allocated by +.Fn getlastlogx +and should be +.Fn free Ns d +by the caller. +The +.Fn getlastlogxbyname +function is similar to +.Fn getlastlogx , +except the user name is passed. +.Pp +.Fn getutmp +function fills out the entries in the struct utmp +.Fa u +with the data provided in the struct utmpx +.Fa ux . +.Fn getutmpx +does the opposite, filling out the entries in the struct utmpx +.Fa ux +with the data provided in the struct utmp +.Fa u , +and initializing all the unknown fields to 0. +The sole exception is the +.Fa ut_type +field, which will be initialized to +.Dv USER_PROCESS . +.Pp +A +.Ft struct lastlogx +is defined like this: +.Bd -literal +struct lastlogx { + struct timeval ll_tv; /* time entry was created */ + char ll_line[_UTX_LINESIZE]; /* tty name */ + char ll_host[_UTX_HOSTSIZE]; /* host name */ +}; +.Ed +.Pp +The +.Fn utmpxname +function sets the default +.Xr utmpx 5 +database file name to +.Fa fname . +.Sh RETURN VALUES +.Fn getlastlogx +and +.Fn getlastlogxbyname +return the found entry on success, or +.Dv NULL +if it could not open the database, could not find an entry matching +.Fa uid +or +.Fa name , +or could not allocate the necessary space (in case +.Fa \&ll +was +.Dv NULL ) . +.Pp +.Fn utmpxname +returns 1 on success, or 0 if the supplied file name was too long or +did not end with +.Sq x . +.Sh SEE ALSO +.Xr endutxent 3 , +.Xr utmpx 5 +.Sh HISTORY +The functions +.Fn getutmp , +.Fn getutmpx , +and +.Fn utmpxname +first appeared in +.Tn Solaris . +.Nm getlastlogx +first appeared in +.Nx 2.0 . diff --git a/gen/NetBSD/rb.c b/gen/NetBSD/rb.c new file mode 100644 index 0000000..46221c7 --- /dev/null +++ b/gen/NetBSD/rb.c @@ -0,0 +1,1440 @@ +/* $NetBSD: rb.c,v 1.13 2014/08/22 17:19:48 matt Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Portions Copyright (c) 2012 Apple Inc. All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#undef RBSMALL +#undef RBDEBUG +#undef RBSTATS +#undef RBTEST + +#define _RBTREE_NO_OPAQUE_STRUCTS_ + +#ifdef RBTEST +#include "rbtree.h" +#else +#include +#endif + +#ifndef __predict_false +#ifdef __GNUC__ +#define __predict_false(x) ((typeof(x))__builtin_expect((long)(x), 0l)) +#else +#define __predict_false(x) (x) +#endif +#endif + +#define RB_DIR_OTHER RB_DIR_RIGHT + +#define rb_left rb_nodes[RB_DIR_LEFT] +#define rb_right rb_nodes[RB_DIR_RIGHT] + +#define RB_FLAG_POSITION 0x2 +#define RB_FLAG_RED 0x1 +#define RB_FLAG_MASK (RB_FLAG_POSITION|RB_FLAG_RED) +#define RB_FATHER(rb) \ + ((struct rb_node *)((rb)->rb_info & ~RB_FLAG_MASK)) +#define RB_SET_FATHER(rb, father) \ + ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK))) + +#define RB_SENTINEL_P(rb) ((rb) == NULL) +#define RB_LEFT_SENTINEL_P(rb) RB_SENTINEL_P((rb)->rb_left) +#define RB_RIGHT_SENTINEL_P(rb) RB_SENTINEL_P((rb)->rb_right) +#define RB_FATHER_SENTINEL_P(rb) RB_SENTINEL_P(RB_FATHER((rb))) +#define RB_CHILDLESS_P(rb) \ + (RB_SENTINEL_P(rb) || (RB_LEFT_SENTINEL_P(rb) && RB_RIGHT_SENTINEL_P(rb))) +#define RB_TWOCHILDREN_P(rb) \ + (!RB_SENTINEL_P(rb) && !RB_LEFT_SENTINEL_P(rb) && !RB_RIGHT_SENTINEL_P(rb)) + +#define RB_POSITION(rb) \ + (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT) +#define RB_RIGHT_P(rb) (RB_POSITION(rb) == RB_DIR_RIGHT) +#define RB_LEFT_P(rb) (RB_POSITION(rb) == RB_DIR_LEFT) +#define RB_RED_P(rb) (!RB_SENTINEL_P(rb) && ((rb)->rb_info & RB_FLAG_RED) != 0) +#define RB_BLACK_P(rb) (RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0) +#define RB_MARK_RED(rb) ((void)((rb)->rb_info |= RB_FLAG_RED)) +#define RB_MARK_BLACK(rb) ((void)((rb)->rb_info &= ~RB_FLAG_RED)) +#define RB_INVERT_COLOR(rb) ((void)((rb)->rb_info ^= RB_FLAG_RED)) +#define RB_ROOT_P(rbt, rb) ((rbt)->rbt_root == (rb)) +#define RB_SET_POSITION(rb, position) \ + ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \ + ((rb)->rb_info &= ~RB_FLAG_POSITION))) +#define RB_ZERO_PROPERTIES(rb) ((void)((rb)->rb_info &= ~RB_FLAG_MASK)) +#define RB_COPY_PROPERTIES(dst, src) \ + ((void)((dst)->rb_info ^= ((dst)->rb_info ^ (src)->rb_info) & RB_FLAG_MASK)) +#define RB_SWAP_PROPERTIES(a, b) do { \ + uintptr_t xorinfo = ((a)->rb_info ^ (b)->rb_info) & RB_FLAG_MASK; \ + (a)->rb_info ^= xorinfo; \ + (b)->rb_info ^= xorinfo; \ + } while (/*CONSTCOND*/ 0) + +#ifndef static_assert +#define _static_assert_concat_(a,b) a##b +#define _static_assert_concat(a,b) _static_assert_concat_(a,b) +#define static_assert(c, m) struct _static_assert_concat(static_assert_failure_, __LINE__) { int _static_assert_concat(static_assert_failure_, __LINE__)[(c)? 1 : -1]; } +#endif + +/* The size of struct_rbnode must match: + * sizeof(struct rb_node { void * opaque[3] }) + */ +typedef struct rb_node { + struct rb_node *rb_nodes[2]; + + /* + * rb_info contains the two flags and the parent back pointer. + * We put the two flags in the low two bits since we know that + * rb_node will have an alignment of 4 or 8 bytes. + */ + uintptr_t rb_info; +} rb_node_t; + +static_assert(sizeof(struct { void * opaque[3]; }) == sizeof(rb_node_t), + "Mismatch in size between opaque and internal rb_node_t"); + +typedef struct rb_tree { + struct rb_node *rbt_root; + const rb_tree_ops_t *rbt_ops; + struct rb_node *rbt_minmax[2]; + uintptr_t rbt_count; + void *unused[3]; // Unused padding for possible future use +} rb_tree_t; + +static_assert(sizeof(struct { void * opaque[8]; }) == sizeof(rb_tree_t), + "Mismatch in size between opaque and internal rb_tree_t"); + +static void rb_tree_insert_rebalance(struct rb_tree *, struct rb_node *); +static void rb_tree_removal_rebalance(struct rb_tree *, struct rb_node *, + unsigned int); +#ifdef RBDEBUG +static const struct rb_node *rb_tree_iterate_const(const struct rb_tree *, + const struct rb_node *, const unsigned int); +static bool rb_tree_check_node(const struct rb_tree *, const struct rb_node *, + const struct rb_node *, bool); + +TAILQ_HEAD(rb_node_qh, rb_node); + +#define RB_TAILQ_REMOVE(a, b, c) TAILQ_REMOVE(a, b, c) +#define RB_TAILQ_INIT(a) TAILQ_INIT(a) +#define RB_TAILQ_INSERT_HEAD(a, b, c) TAILQ_INSERT_HEAD(a, b, c) +#define RB_TAILQ_INSERT_BEFORE(a, b, c) TAILQ_INSERT_BEFORE(a, b, c) +#define RB_TAILQ_INSERT_AFTER(a, b, c, d) TAILQ_INSERT_AFTER(a, b, c, d) + +#define KASSERT(s) assert(s) +#else + +#define rb_tree_check_node(a, b, c, d) true + +#define RB_TAILQ_REMOVE(a, b, c) do { } while (/*CONSTCOND*/0) +#define RB_TAILQ_INIT(a) do { } while (/*CONSTCOND*/0) +#define RB_TAILQ_INSERT_HEAD(a, b, c) do { } while (/*CONSTCOND*/0) +#define RB_TAILQ_INSERT_BEFORE(a, b, c) do { } while (/*CONSTCOND*/0) +#define RB_TAILQ_INSERT_AFTER(a, b, c, d) do { } while (/*CONSTCOND*/0) + +#define KASSERT(s) do { } while (/*CONSTCOND*/ 0) +#endif + +#ifdef RBSTATS +#define RBSTAT_INC(v) ((void)((v)++)) +#define RBSTAT_DEC(v) ((void)((v)--)) +#else +#define RBSTAT_INC(v) do { } while (/*CONSTCOND*/0) +#define RBSTAT_DEC(v) do { } while (/*CONSTCOND*/0) +#endif + +#define RB_NODETOITEM(rbto, rbn) \ + ((void *)((uintptr_t)(rbn) - (rbto)->rbto_node_offset)) +#define RB_ITEMTONODE(rbto, rbn) \ + ((rb_node_t *)((uintptr_t)(rbn) + (rbto)->rbto_node_offset)) + +#define RB_SENTINEL_NODE NULL + +void +rb_tree_init(struct rb_tree *rbt, const rb_tree_ops_t *ops) +{ + + rbt->rbt_ops = ops; + rbt->rbt_root = RB_SENTINEL_NODE; + RB_TAILQ_INIT(&rbt->rbt_nodes); +#ifndef RBSMALL + rbt->rbt_minmax[RB_DIR_LEFT] = rbt->rbt_root; /* minimum node */ + rbt->rbt_minmax[RB_DIR_RIGHT] = rbt->rbt_root; /* maximum node */ +#endif + rbt->rbt_count = 0; +#ifdef RBSTATS + rbt->rbt_insertions = 0; + rbt->rbt_removals = 0; + rbt->rbt_insertion_rebalance_calls = 0; + rbt->rbt_insertion_rebalance_passes = 0; + rbt->rbt_removal_rebalance_calls = 0; + rbt->rbt_removal_rebalance_passes = 0; +#endif +} + +void * +rb_tree_find_node(struct rb_tree *rbt, const void *key) +{ + const rb_tree_ops_t *rbto = rbt->rbt_ops; + rbto_compare_key_fn compare_key = rbto->rbto_compare_key; + struct rb_node *parent = rbt->rbt_root; + + while (!RB_SENTINEL_P(parent)) { + void *pobj = RB_NODETOITEM(rbto, parent); + const signed int diff = (*compare_key)(rbto->rbto_context, + pobj, key); + if (diff == 0) + return pobj; + parent = parent->rb_nodes[diff < 0]; + } + + return NULL; +} + +void * +rb_tree_find_node_geq(struct rb_tree *rbt, const void *key) +{ + const rb_tree_ops_t *rbto = rbt->rbt_ops; + rbto_compare_key_fn compare_key = rbto->rbto_compare_key; + struct rb_node *parent = rbt->rbt_root, *last = NULL; + + while (!RB_SENTINEL_P(parent)) { + void *pobj = RB_NODETOITEM(rbto, parent); + const signed int diff = (*compare_key)(rbto->rbto_context, + pobj, key); + if (diff == 0) + return pobj; + if (diff > 0) + last = parent; + parent = parent->rb_nodes[diff < 0]; + } + + return last == NULL ? NULL : RB_NODETOITEM(rbto, last); +} + +void * +rb_tree_find_node_leq(struct rb_tree *rbt, const void *key) +{ + const rb_tree_ops_t *rbto = rbt->rbt_ops; + rbto_compare_key_fn compare_key = rbto->rbto_compare_key; + struct rb_node *parent = rbt->rbt_root, *last = NULL; + + while (!RB_SENTINEL_P(parent)) { + void *pobj = RB_NODETOITEM(rbto, parent); + const signed int diff = (*compare_key)(rbto->rbto_context, + pobj, key); + if (diff == 0) + return pobj; + if (diff < 0) + last = parent; + parent = parent->rb_nodes[diff < 0]; + } + + return last == NULL ? NULL : RB_NODETOITEM(rbto, last); +} + +void * +rb_tree_insert_node(struct rb_tree *rbt, void *object) +{ + const rb_tree_ops_t *rbto = rbt->rbt_ops; + rbto_compare_nodes_fn compare_nodes = rbto->rbto_compare_nodes; + struct rb_node *parent, *tmp, *self = RB_ITEMTONODE(rbto, object); + unsigned int position; + bool rebalance; + + RBSTAT_INC(rbt->rbt_insertions); + + tmp = rbt->rbt_root; + /* + * This is a hack. Because rbt->rbt_root is just a struct rb_node *, + * just like rb_node->rb_nodes[RB_DIR_LEFT], we can use this fact to + * avoid a lot of tests for root and know that even at root, + * updating RB_FATHER(rb_node)->rb_nodes[RB_POSITION(rb_node)] will + * update rbt->rbt_root. + */ + parent = (struct rb_node *)(void *)&rbt->rbt_root; + position = RB_DIR_LEFT; + + /* + * Find out where to place this new leaf. + */ + while (!RB_SENTINEL_P(tmp)) { + void *tobj = RB_NODETOITEM(rbto, tmp); + const signed int diff = (*compare_nodes)(rbto->rbto_context, + tobj, object); + if (__predict_false(diff == 0)) { + /* + * Node already exists; return it. + */ + return tobj; + } + parent = tmp; + position = (diff < 0); + tmp = parent->rb_nodes[position]; + } + +#ifdef RBDEBUG + { + struct rb_node *prev = NULL, *next = NULL; + + if (position == RB_DIR_RIGHT) + prev = parent; + else if (tmp != rbt->rbt_root) + next = parent; + + /* + * Verify our sequential position + */ + KASSERT(prev == NULL || !RB_SENTINEL_P(prev)); + KASSERT(next == NULL || !RB_SENTINEL_P(next)); + if (prev != NULL && next == NULL) + next = TAILQ_NEXT(prev, rb_link); + if (prev == NULL && next != NULL) + prev = TAILQ_PREV(next, rb_node_qh, rb_link); + KASSERT(prev == NULL || !RB_SENTINEL_P(prev)); + KASSERT(next == NULL || !RB_SENTINEL_P(next)); + KASSERT(prev == NULL || (*compare_nodes)(rbto->rbto_context, + RB_NODETOITEM(rbto, prev), RB_NODETOITEM(rbto, self)) < 0); + KASSERT(next == NULL || (*compare_nodes)(rbto->rbto_context, + RB_NODETOITEM(rbto, self), RB_NODETOITEM(rbto, next)) < 0); + } +#endif + + /* + * Initialize the node and insert as a leaf into the tree. + */ + RB_SET_FATHER(self, parent); + RB_SET_POSITION(self, position); + if (__predict_false(parent == (struct rb_node *)(void *)&rbt->rbt_root)) { + RB_MARK_BLACK(self); /* root is always black */ +#ifndef RBSMALL + rbt->rbt_minmax[RB_DIR_LEFT] = self; + rbt->rbt_minmax[RB_DIR_RIGHT] = self; +#endif + rebalance = false; + } else { + KASSERT(position == RB_DIR_LEFT || position == RB_DIR_RIGHT); +#ifndef RBSMALL + /* + * Keep track of the minimum and maximum nodes. If our + * parent is a minmax node and we on their min/max side, + * we must be the new min/max node. + */ + if (parent == rbt->rbt_minmax[position]) + rbt->rbt_minmax[position] = self; +#endif /* !RBSMALL */ + /* + * All new nodes are colored red. We only need to rebalance + * if our parent is also red. + */ + RB_MARK_RED(self); + rebalance = RB_RED_P(parent); + } + KASSERT(RB_SENTINEL_P(parent->rb_nodes[position])); + self->rb_left = parent->rb_nodes[position]; + self->rb_right = parent->rb_nodes[position]; + parent->rb_nodes[position] = self; + KASSERT(RB_CHILDLESS_P(self)); + + /* + * Insert the new node into a sorted list for easy sequential access + */ + rbt->rbt_count++; +#ifdef RBDEBUG + if (RB_ROOT_P(rbt, self)) { + RB_TAILQ_INSERT_HEAD(&rbt->rbt_nodes, self, rb_link); + } else if (position == RB_DIR_LEFT) { + KASSERT((*compare_nodes)(rbto->rbto_context, + RB_NODETOITEM(rbto, self), + RB_NODETOITEM(rbto, RB_FATHER(self))) < 0); + RB_TAILQ_INSERT_BEFORE(RB_FATHER(self), self, rb_link); + } else { + KASSERT((*compare_nodes)(rbto->rbto_context, + RB_NODETOITEM(rbto, RB_FATHER(self)), + RB_NODETOITEM(rbto, self)) < 0); + RB_TAILQ_INSERT_AFTER(&rbt->rbt_nodes, RB_FATHER(self), + self, rb_link); + } +#endif + KASSERT(rb_tree_check_node(rbt, self, NULL, !rebalance)); + + /* + * Rebalance tree after insertion + */ + if (rebalance) { + rb_tree_insert_rebalance(rbt, self); + KASSERT(rb_tree_check_node(rbt, self, NULL, true)); + } + + /* Succesfully inserted, return our node pointer. */ + return object; +} + +/* + * Swap the location and colors of 'self' and its child @ which. The child + * can not be a sentinel node. This is our rotation function. However, + * since it preserves coloring, it great simplifies both insertion and + * removal since rotation almost always involves the exchanging of colors + * as a separate step. + */ +/*ARGSUSED*/ +static void +rb_tree_reparent_nodes(struct rb_tree *rbt, struct rb_node *old_father, + const unsigned int which) +{ + const unsigned int other = which ^ RB_DIR_OTHER; + struct rb_node * const grandpa = RB_FATHER(old_father); + struct rb_node * const old_child = old_father->rb_nodes[which]; + struct rb_node * const new_father = old_child; + struct rb_node * const new_child = old_father; + + KASSERT(which == RB_DIR_LEFT || which == RB_DIR_RIGHT); + + KASSERT(!RB_SENTINEL_P(old_child)); + KASSERT(RB_FATHER(old_child) == old_father); + + KASSERT(rb_tree_check_node(rbt, old_father, NULL, false)); + KASSERT(rb_tree_check_node(rbt, old_child, NULL, false)); + KASSERT(RB_ROOT_P(rbt, old_father) || + rb_tree_check_node(rbt, grandpa, NULL, false)); + + /* + * Exchange descendant linkages. + */ + grandpa->rb_nodes[RB_POSITION(old_father)] = new_father; + new_child->rb_nodes[which] = old_child->rb_nodes[other]; + new_father->rb_nodes[other] = new_child; + + /* + * Update ancestor linkages + */ + RB_SET_FATHER(new_father, grandpa); + RB_SET_FATHER(new_child, new_father); + + /* + * Exchange properties between new_father and new_child. The only + * change is that new_child's position is now on the other side. + */ +#if 0 + { + struct rb_node tmp; + tmp.rb_info = 0; + RB_COPY_PROPERTIES(&tmp, old_child); + RB_COPY_PROPERTIES(new_father, old_father); + RB_COPY_PROPERTIES(new_child, &tmp); + } +#else + RB_SWAP_PROPERTIES(new_father, new_child); +#endif + RB_SET_POSITION(new_child, other); + + /* + * Make sure to reparent the new child to ourself. + */ + if (!RB_SENTINEL_P(new_child->rb_nodes[which])) { + RB_SET_FATHER(new_child->rb_nodes[which], new_child); + RB_SET_POSITION(new_child->rb_nodes[which], which); + } + + KASSERT(rb_tree_check_node(rbt, new_father, NULL, false)); + KASSERT(rb_tree_check_node(rbt, new_child, NULL, false)); + KASSERT(RB_ROOT_P(rbt, new_father) || + rb_tree_check_node(rbt, grandpa, NULL, false)); +} + +static void +rb_tree_insert_rebalance(struct rb_tree *rbt, struct rb_node *self) +{ + struct rb_node * father = RB_FATHER(self); + struct rb_node * grandpa = RB_FATHER(father); + struct rb_node * uncle; + unsigned int which; + unsigned int other; + + KASSERT(!RB_ROOT_P(rbt, self)); + KASSERT(RB_RED_P(self)); + KASSERT(RB_RED_P(father)); + RBSTAT_INC(rbt->rbt_insertion_rebalance_calls); + + for (;;) { + KASSERT(!RB_SENTINEL_P(self)); + + KASSERT(RB_RED_P(self)); + KASSERT(RB_RED_P(father)); + /* + * We are red and our parent is red, therefore we must have a + * grandfather and he must be black. + */ + grandpa = RB_FATHER(father); + KASSERT(RB_BLACK_P(grandpa)); + KASSERT(RB_DIR_RIGHT == 1 && RB_DIR_LEFT == 0); + which = (father == grandpa->rb_right); + other = which ^ RB_DIR_OTHER; + uncle = grandpa->rb_nodes[other]; + + if (RB_BLACK_P(uncle)) + break; + + RBSTAT_INC(rbt->rbt_insertion_rebalance_passes); + /* + * Case 1: our uncle is red + * Simply invert the colors of our parent and + * uncle and make our grandparent red. And + * then solve the problem up at his level. + */ + RB_MARK_BLACK(uncle); + RB_MARK_BLACK(father); + if (__predict_false(RB_ROOT_P(rbt, grandpa))) { + /* + * If our grandpa is root, don't bother + * setting him to red, just return. + */ + KASSERT(RB_BLACK_P(grandpa)); + return; + } + RB_MARK_RED(grandpa); + self = grandpa; + father = RB_FATHER(self); + KASSERT(RB_RED_P(self)); + if (RB_BLACK_P(father)) { + /* + * If our greatgrandpa is black, we're done. + */ + KASSERT(RB_BLACK_P(rbt->rbt_root)); + return; + } + } + + KASSERT(!RB_ROOT_P(rbt, self)); + KASSERT(RB_RED_P(self)); + KASSERT(RB_RED_P(father)); + KASSERT(RB_BLACK_P(uncle)); + KASSERT(RB_BLACK_P(grandpa)); + /* + * Case 2&3: our uncle is black. + */ + if (self == father->rb_nodes[other]) { + /* + * Case 2: we are on the same side as our uncle + * Swap ourselves with our parent so this case + * becomes case 3. Basically our parent becomes our + * child. + */ + rb_tree_reparent_nodes(rbt, father, other); + KASSERT(RB_FATHER(father) == self); + KASSERT(self->rb_nodes[which] == father); + KASSERT(RB_FATHER(self) == grandpa); + self = father; + father = RB_FATHER(self); + } + KASSERT(RB_RED_P(self) && RB_RED_P(father)); + KASSERT(grandpa->rb_nodes[which] == father); + /* + * Case 3: we are opposite a child of a black uncle. + * Swap our parent and grandparent. Since our grandfather + * is black, our father will become black and our new sibling + * (former grandparent) will become red. + */ + rb_tree_reparent_nodes(rbt, grandpa, which); + KASSERT(RB_FATHER(self) == father); + KASSERT(RB_FATHER(self)->rb_nodes[RB_POSITION(self) ^ RB_DIR_OTHER] == grandpa); + KASSERT(RB_RED_P(self)); + KASSERT(RB_BLACK_P(father)); + KASSERT(RB_RED_P(grandpa)); + + /* + * Final step: Set the root to black. + */ + RB_MARK_BLACK(rbt->rbt_root); +} + +static void +rb_tree_prune_node(struct rb_tree *rbt, struct rb_node *self, bool rebalance) +{ + const unsigned int which = RB_POSITION(self); + struct rb_node *father = RB_FATHER(self); +#ifndef RBSMALL + const bool was_root = RB_ROOT_P(rbt, self); +#endif + + KASSERT(rebalance || (RB_ROOT_P(rbt, self) || RB_RED_P(self))); + KASSERT(!rebalance || RB_BLACK_P(self)); + KASSERT(RB_CHILDLESS_P(self)); + KASSERT(rb_tree_check_node(rbt, self, NULL, false)); + + /* + * Since we are childless, we know that self->rb_left is pointing + * to the sentinel node. + */ + father->rb_nodes[which] = self->rb_left; + + /* + * Remove ourselves from the node list, decrement the count, + * and update min/max. + */ + RB_TAILQ_REMOVE(&rbt->rbt_nodes, self, rb_link); + rbt->rbt_count--; +#ifndef RBSMALL + if (__predict_false(rbt->rbt_minmax[RB_POSITION(self)] == self)) { + rbt->rbt_minmax[RB_POSITION(self)] = father; + /* + * When removing the root, rbt->rbt_minmax[RB_DIR_LEFT] is + * updated automatically, but we also need to update + * rbt->rbt_minmax[RB_DIR_RIGHT]; + */ + if (__predict_false(was_root)) { + rbt->rbt_minmax[RB_DIR_RIGHT] = father; + } + } + RB_SET_FATHER(self, NULL); +#endif + + /* + * Rebalance if requested. + */ + if (rebalance) + rb_tree_removal_rebalance(rbt, father, which); + KASSERT(was_root || rb_tree_check_node(rbt, father, NULL, true)); +} + +/* + * When deleting an interior node + */ +static void +rb_tree_swap_prune_and_rebalance(struct rb_tree *rbt, struct rb_node *self, + struct rb_node *standin) +{ + const unsigned int standin_which = RB_POSITION(standin); + unsigned int standin_other = standin_which ^ RB_DIR_OTHER; + struct rb_node *standin_son; + struct rb_node *standin_father = RB_FATHER(standin); + bool rebalance = RB_BLACK_P(standin); + + if (standin_father == self) { + /* + * As a child of self, any childen would be opposite of + * our parent. + */ + KASSERT(RB_SENTINEL_P(standin->rb_nodes[standin_other])); + standin_son = standin->rb_nodes[standin_which]; + } else { + /* + * Since we aren't a child of self, any childen would be + * on the same side as our parent. + */ + KASSERT(RB_SENTINEL_P(standin->rb_nodes[standin_which])); + standin_son = standin->rb_nodes[standin_other]; + } + + /* + * the node we are removing must have two children. + */ + KASSERT(RB_TWOCHILDREN_P(self)); + /* + * If standin has a child, it must be red. + */ + KASSERT(RB_SENTINEL_P(standin_son) || RB_RED_P(standin_son)); + + /* + * Verify things are sane. + */ + KASSERT(rb_tree_check_node(rbt, self, NULL, false)); + KASSERT(rb_tree_check_node(rbt, standin, NULL, false)); + + if (__predict_false(RB_RED_P(standin_son))) { + /* + * We know we have a red child so if we flip it to black + * we don't have to rebalance. + */ + KASSERT(rb_tree_check_node(rbt, standin_son, NULL, true)); + RB_MARK_BLACK(standin_son); + rebalance = false; + + if (standin_father == self) { + KASSERT(RB_POSITION(standin_son) == standin_which); + } else { + KASSERT(RB_POSITION(standin_son) == standin_other); + /* + * Change the son's parentage to point to his grandpa. + */ + RB_SET_FATHER(standin_son, standin_father); + RB_SET_POSITION(standin_son, standin_which); + } + } + + if (standin_father == self) { + /* + * If we are about to delete the standin's father, then when + * we call rebalance, we need to use ourselves as our father. + * Otherwise remember our original father. Also, sincef we are + * our standin's father we only need to reparent the standin's + * brother. + * + * | R --> S | + * | Q S --> Q T | + * | t --> | + */ + KASSERT(RB_SENTINEL_P(standin->rb_nodes[standin_other])); + KASSERT(!RB_SENTINEL_P(self->rb_nodes[standin_other])); + KASSERT(self->rb_nodes[standin_which] == standin); + /* + * Have our son/standin adopt his brother as his new son. + */ + standin_father = standin; + } else { + /* + * | R --> S . | + * | / \ | T --> / \ | / | + * | ..... | S --> ..... | T | + * + * Sever standin's connection to his father. + */ + standin_father->rb_nodes[standin_which] = standin_son; + /* + * Adopt the far son. + */ + standin->rb_nodes[standin_other] = self->rb_nodes[standin_other]; + RB_SET_FATHER(standin->rb_nodes[standin_other], standin); + KASSERT(RB_POSITION(self->rb_nodes[standin_other]) == standin_other); + /* + * Use standin_other because we need to preserve standin_which + * for the removal_rebalance. + */ + standin_other = standin_which; + } + + /* + * Move the only remaining son to our standin. If our standin is our + * son, this will be the only son needed to be moved. + */ + KASSERT(standin->rb_nodes[standin_other] != self->rb_nodes[standin_other]); + standin->rb_nodes[standin_other] = self->rb_nodes[standin_other]; + RB_SET_FATHER(standin->rb_nodes[standin_other], standin); + + /* + * Now copy the result of self to standin and then replace + * self with standin in the tree. + */ + RB_COPY_PROPERTIES(standin, self); + RB_SET_FATHER(standin, RB_FATHER(self)); + RB_FATHER(standin)->rb_nodes[RB_POSITION(standin)] = standin; + + /* + * Remove ourselves from the node list, decrement the count, + * and update min/max. + */ + RB_TAILQ_REMOVE(&rbt->rbt_nodes, self, rb_link); + rbt->rbt_count--; +#ifndef RBSMALL + if (__predict_false(rbt->rbt_minmax[RB_POSITION(self)] == self)) + rbt->rbt_minmax[RB_POSITION(self)] = RB_FATHER(self); + RB_SET_FATHER(self, NULL); +#endif + + KASSERT(rb_tree_check_node(rbt, standin, NULL, false)); + KASSERT(RB_FATHER_SENTINEL_P(standin) + || rb_tree_check_node(rbt, standin_father, NULL, false)); + KASSERT(RB_LEFT_SENTINEL_P(standin) + || rb_tree_check_node(rbt, standin->rb_left, NULL, false)); + KASSERT(RB_RIGHT_SENTINEL_P(standin) + || rb_tree_check_node(rbt, standin->rb_right, NULL, false)); + + if (!rebalance) + return; + + rb_tree_removal_rebalance(rbt, standin_father, standin_which); + KASSERT(rb_tree_check_node(rbt, standin, NULL, true)); +} + +/* + * We could do this by doing + * rb_tree_node_swap(rbt, self, which); + * rb_tree_prune_node(rbt, self, false); + * + * But it's more efficient to just evalate and recolor the child. + */ +static void +rb_tree_prune_blackred_branch(struct rb_tree *rbt, struct rb_node *self, + unsigned int which) +{ + struct rb_node *father = RB_FATHER(self); + struct rb_node *son = self->rb_nodes[which]; +#ifndef RBSMALL + const bool was_root = RB_ROOT_P(rbt, self); +#endif + + KASSERT(which == RB_DIR_LEFT || which == RB_DIR_RIGHT); + KASSERT(RB_BLACK_P(self) && RB_RED_P(son)); + KASSERT(!RB_TWOCHILDREN_P(son)); + KASSERT(RB_CHILDLESS_P(son)); + KASSERT(rb_tree_check_node(rbt, self, NULL, false)); + KASSERT(rb_tree_check_node(rbt, son, NULL, false)); + + /* + * Remove ourselves from the tree and give our former child our + * properties (position, color, root). + */ + RB_COPY_PROPERTIES(son, self); + father->rb_nodes[RB_POSITION(son)] = son; + RB_SET_FATHER(son, father); + + /* + * Remove ourselves from the node list, decrement the count, + * and update minmax. + */ + RB_TAILQ_REMOVE(&rbt->rbt_nodes, self, rb_link); + rbt->rbt_count--; +#ifndef RBSMALL + if (__predict_false(was_root)) { + KASSERT(rbt->rbt_minmax[which] == son); + rbt->rbt_minmax[which ^ RB_DIR_OTHER] = son; + } else if (rbt->rbt_minmax[RB_POSITION(self)] == self) { + rbt->rbt_minmax[RB_POSITION(self)] = son; + } + RB_SET_FATHER(self, NULL); +#endif + + KASSERT(was_root || rb_tree_check_node(rbt, father, NULL, true)); + KASSERT(rb_tree_check_node(rbt, son, NULL, true)); +} + +void +rb_tree_remove_node(struct rb_tree *rbt, void *object) +{ + const rb_tree_ops_t *rbto = rbt->rbt_ops; + struct rb_node *standin, *self = RB_ITEMTONODE(rbto, object); + unsigned int which; + + KASSERT(!RB_SENTINEL_P(self)); + RBSTAT_INC(rbt->rbt_removals); + + /* + * In the following diagrams, we (the node to be removed) are S. Red + * nodes are lowercase. T could be either red or black. + * + * Remember the major axiom of the red-black tree: the number of + * black nodes from the root to each leaf is constant across all + * leaves, only the number of red nodes varies. + * + * Thus removing a red leaf doesn't require any other changes to a + * red-black tree. So if we must remove a node, attempt to rearrange + * the tree so we can remove a red node. + * + * The simpliest case is a childless red node or a childless root node: + * + * | T --> T | or | R --> * | + * | s --> * | + */ + if (RB_CHILDLESS_P(self)) { + const bool rebalance = RB_BLACK_P(self) && !RB_ROOT_P(rbt, self); + rb_tree_prune_node(rbt, self, rebalance); + return; + } + KASSERT(!RB_CHILDLESS_P(self)); + if (!RB_TWOCHILDREN_P(self)) { + /* + * The next simpliest case is the node we are deleting is + * black and has one red child. + * + * | T --> T --> T | + * | S --> R --> R | + * | r --> s --> * | + */ + which = RB_LEFT_SENTINEL_P(self) ? RB_DIR_RIGHT : RB_DIR_LEFT; + KASSERT(RB_BLACK_P(self)); + KASSERT(RB_RED_P(self->rb_nodes[which])); + KASSERT(RB_CHILDLESS_P(self->rb_nodes[which])); + rb_tree_prune_blackred_branch(rbt, self, which); + return; + } + KASSERT(RB_TWOCHILDREN_P(self)); + + /* + * We invert these because we prefer to remove from the inside of + * the tree. + */ + which = RB_POSITION(self) ^ RB_DIR_OTHER; + + /* + * Let's find the node closes to us opposite of our parent + * Now swap it with ourself, "prune" it, and rebalance, if needed. + */ + standin = RB_ITEMTONODE(rbto, rb_tree_iterate(rbt, object, which)); + rb_tree_swap_prune_and_rebalance(rbt, self, standin); +} + +static void +rb_tree_removal_rebalance(struct rb_tree *rbt, struct rb_node *parent, + unsigned int which) +{ + KASSERT(!RB_SENTINEL_P(parent)); + KASSERT(RB_SENTINEL_P(parent->rb_nodes[which])); + KASSERT(which == RB_DIR_LEFT || which == RB_DIR_RIGHT); + RBSTAT_INC(rbt->rbt_removal_rebalance_calls); + + while (RB_BLACK_P(parent->rb_nodes[which])) { + unsigned int other = which ^ RB_DIR_OTHER; + struct rb_node *brother = parent->rb_nodes[other]; + + RBSTAT_INC(rbt->rbt_removal_rebalance_passes); + + KASSERT(!RB_SENTINEL_P(brother)); + /* + * For cases 1, 2a, and 2b, our brother's children must + * be black and our father must be black + */ + if (RB_BLACK_P(parent) + && RB_BLACK_P(brother->rb_left) + && RB_BLACK_P(brother->rb_right)) { + if (RB_RED_P(brother)) { + /* + * Case 1: Our brother is red, swap its + * position (and colors) with our parent. + * This should now be case 2b (unless C or E + * has a red child which is case 3; thus no + * explicit branch to case 2b). + * + * B -> D + * A d -> b E + * C E -> A C + */ + KASSERT(RB_BLACK_P(parent)); + rb_tree_reparent_nodes(rbt, parent, other); + brother = parent->rb_nodes[other]; + KASSERT(!RB_SENTINEL_P(brother)); + KASSERT(RB_RED_P(parent)); + KASSERT(RB_BLACK_P(brother)); + KASSERT(rb_tree_check_node(rbt, brother, NULL, false)); + KASSERT(rb_tree_check_node(rbt, parent, NULL, false)); + } else { + /* + * Both our parent and brother are black. + * Change our brother to red, advance up rank + * and go through the loop again. + * + * B -> *B + * *A D -> A d + * C E -> C E + */ + RB_MARK_RED(brother); + KASSERT(RB_BLACK_P(brother->rb_left)); + KASSERT(RB_BLACK_P(brother->rb_right)); + if (RB_ROOT_P(rbt, parent)) + return; /* root == parent == black */ + KASSERT(rb_tree_check_node(rbt, brother, NULL, false)); + KASSERT(rb_tree_check_node(rbt, parent, NULL, false)); + which = RB_POSITION(parent); + parent = RB_FATHER(parent); + continue; + } + } + /* + * Avoid an else here so that case 2a above can hit either + * case 2b, 3, or 4. + */ + if (RB_RED_P(parent) + && RB_BLACK_P(brother) + && RB_BLACK_P(brother->rb_left) + && RB_BLACK_P(brother->rb_right)) { + KASSERT(RB_RED_P(parent)); + KASSERT(RB_BLACK_P(brother)); + KASSERT(RB_BLACK_P(brother->rb_left)); + KASSERT(RB_BLACK_P(brother->rb_right)); + /* + * We are black, our father is red, our brother and + * both nephews are black. Simply invert/exchange the + * colors of our father and brother (to black and red + * respectively). + * + * | f --> F | + * | * B --> * b | + * | N N --> N N | + */ + RB_MARK_BLACK(parent); + RB_MARK_RED(brother); + KASSERT(rb_tree_check_node(rbt, brother, NULL, true)); + break; /* We're done! */ + } else { + /* + * Our brother must be black and have at least one + * red child (it may have two). + */ + KASSERT(RB_BLACK_P(brother)); + KASSERT(RB_RED_P(brother->rb_nodes[which]) || + RB_RED_P(brother->rb_nodes[other])); + if (RB_BLACK_P(brother->rb_nodes[other])) { + /* + * Case 3: our brother is black, our near + * nephew is red, and our far nephew is black. + * Swap our brother with our near nephew. + * This result in a tree that matches case 4. + * (Our father could be red or black). + * + * | F --> F | + * | x B --> x B | + * | n --> n | + */ + KASSERT(RB_RED_P(brother->rb_nodes[which])); + rb_tree_reparent_nodes(rbt, brother, which); + KASSERT(RB_FATHER(brother) == parent->rb_nodes[other]); + brother = parent->rb_nodes[other]; + KASSERT(RB_RED_P(brother->rb_nodes[other])); + } + /* + * Case 4: our brother is black and our far nephew + * is red. Swap our father and brother locations and + * change our far nephew to black. (these can be + * done in either order so we change the color first). + * The result is a valid red-black tree and is a + * terminal case. (again we don't care about the + * father's color) + * + * If the father is red, we will get a red-black-black + * tree: + * | f -> f --> b | + * | B -> B --> F N | + * | n -> N --> | + * + * If the father is black, we will get an all black + * tree: + * | F -> F --> B | + * | B -> B --> F N | + * | n -> N --> | + * + * If we had two red nephews, then after the swap, + * our former father would have a red grandson. + */ + KASSERT(RB_BLACK_P(brother)); + KASSERT(RB_RED_P(brother->rb_nodes[other])); + RB_MARK_BLACK(brother->rb_nodes[other]); + rb_tree_reparent_nodes(rbt, parent, other); + break; /* We're done! */ + } + } + KASSERT(rb_tree_check_node(rbt, parent, NULL, true)); +} + +void * +rb_tree_iterate(struct rb_tree *rbt, void *object, const unsigned int direction) +{ + const rb_tree_ops_t *rbto = rbt->rbt_ops; + const unsigned int other = direction ^ RB_DIR_OTHER; + struct rb_node *self; + + KASSERT(direction == RB_DIR_LEFT || direction == RB_DIR_RIGHT); + + if (object == NULL) { +#ifndef RBSMALL + if (RB_SENTINEL_P(rbt->rbt_root)) + return NULL; + return RB_NODETOITEM(rbto, rbt->rbt_minmax[direction == RB_DIR_LEFT ? RB_DIR_RIGHT : RB_DIR_LEFT]); +#else + self = rbt->rbt_root; + if (RB_SENTINEL_P(self)) + return NULL; + while (!RB_SENTINEL_P(self->rb_nodes[direction == RB_DIR_LEFT ? RB_DIR_RIGHT : RB_DIR_LEFT])) + self = self->rb_nodes[direction == RB_DIR_LEFT ? RB_DIR_RIGHT : RB_DIR_LEFT]; + return RB_NODETOITEM(rbto, self); +#endif /* !RBSMALL */ + } + self = RB_ITEMTONODE(rbto, object); + KASSERT(!RB_SENTINEL_P(self)); + /* + * We can't go any further in this direction. We proceed up in the + * opposite direction until our parent is in direction we want to go. + */ + if (RB_SENTINEL_P(self->rb_nodes[direction])) { + while (!RB_ROOT_P(rbt, self)) { + if (other == RB_POSITION(self)) + return RB_NODETOITEM(rbto, RB_FATHER(self)); + self = RB_FATHER(self); + } + return NULL; + } + + /* + * Advance down one in current direction and go down as far as possible + * in the opposite direction. + */ + self = self->rb_nodes[direction]; + KASSERT(!RB_SENTINEL_P(self)); + while (!RB_SENTINEL_P(self->rb_nodes[other])) + self = self->rb_nodes[other]; + return RB_NODETOITEM(rbto, self); +} + +#ifdef RBDEBUG +static const struct rb_node * +rb_tree_iterate_const(const struct rb_tree *rbt, const struct rb_node *self, + const unsigned int direction) +{ + const unsigned int other = direction ^ RB_DIR_OTHER; + KASSERT(direction == RB_DIR_LEFT || direction == RB_DIR_RIGHT); + + if (self == NULL) { +#ifndef RBSMALL + if (RB_SENTINEL_P(rbt->rbt_root)) + return NULL; + return rbt->rbt_minmax[direction]; +#else + self = rbt->rbt_root; + if (RB_SENTINEL_P(self)) + return NULL; + while (!RB_SENTINEL_P(self->rb_nodes[direction])) + self = self->rb_nodes[direction]; + return self; +#endif /* !RBSMALL */ + } + KASSERT(!RB_SENTINEL_P(self)); + /* + * We can't go any further in this direction. We proceed up in the + * opposite direction until our parent is in direction we want to go. + */ + if (RB_SENTINEL_P(self->rb_nodes[direction])) { + while (!RB_ROOT_P(rbt, self)) { + if (other == RB_POSITION(self)) + return RB_FATHER(self); + self = RB_FATHER(self); + } + return NULL; + } + + /* + * Advance down one in current direction and go down as far as possible + * in the opposite direction. + */ + self = self->rb_nodes[direction]; + KASSERT(!RB_SENTINEL_P(self)); + while (!RB_SENTINEL_P(self->rb_nodes[other])) + self = self->rb_nodes[other]; + return self; +} + +static unsigned int +rb_tree_count_black(const struct rb_node *self) +{ + unsigned int left, right; + + if (RB_SENTINEL_P(self)) + return 0; + + left = rb_tree_count_black(self->rb_left); + right = rb_tree_count_black(self->rb_right); + + KASSERT(left == right); + + return left + RB_BLACK_P(self); +} + +static bool +rb_tree_check_node(const struct rb_tree *rbt, const struct rb_node *self, + const struct rb_node *prev, bool red_check) +{ + const rb_tree_ops_t *rbto = rbt->rbt_ops; + rbto_compare_nodes_fn compare_nodes = rbto->rbto_compare_nodes; + + KASSERT(!RB_SENTINEL_P(self)); + KASSERT(prev == NULL || (*compare_nodes)(rbto->rbto_context, + RB_NODETOITEM(rbto, prev), RB_NODETOITEM(rbto, self)) < 0); + + /* + * Verify our relationship to our parent. + */ + if (RB_ROOT_P(rbt, self)) { + KASSERT(self == rbt->rbt_root); + KASSERT(RB_POSITION(self) == RB_DIR_LEFT); + KASSERT(RB_FATHER(self)->rb_nodes[RB_DIR_LEFT] == self); + KASSERT(RB_FATHER(self) == (const struct rb_node *) &rbt->rbt_root); + } else { + int diff = (*compare_nodes)(rbto->rbto_context, + RB_NODETOITEM(rbto, self), + RB_NODETOITEM(rbto, RB_FATHER(self))); + + KASSERT(self != rbt->rbt_root); + KASSERT(!RB_FATHER_SENTINEL_P(self)); + if (RB_POSITION(self) == RB_DIR_LEFT) { + KASSERT(diff < 0); + KASSERT(RB_FATHER(self)->rb_nodes[RB_DIR_LEFT] == self); + } else { + KASSERT(diff > 0); + KASSERT(RB_FATHER(self)->rb_nodes[RB_DIR_RIGHT] == self); + } + } + + /* + * Verify our position in the linked list against the tree itself. + */ + { + const struct rb_node *prev0 = rb_tree_iterate_const(rbt, self, RB_DIR_LEFT); + const struct rb_node *next0 = rb_tree_iterate_const(rbt, self, RB_DIR_RIGHT); + KASSERT(prev0 == TAILQ_PREV(self, rb_node_qh, rb_link)); + KASSERT(next0 == TAILQ_NEXT(self, rb_link)); +#ifndef RBSMALL + KASSERT(prev0 != NULL || self == rbt->rbt_minmax[RB_DIR_LEFT]); + KASSERT(next0 != NULL || self == rbt->rbt_minmax[RB_DIR_RIGHT]); +#endif + } + + /* + * The root must be black. + * There can never be two adjacent red nodes. + */ + if (red_check) { + KASSERT(!RB_ROOT_P(rbt, self) || RB_BLACK_P(self)); + (void) rb_tree_count_black(self); + if (RB_RED_P(self)) { + const struct rb_node *brother; + KASSERT(!RB_ROOT_P(rbt, self)); + brother = RB_FATHER(self)->rb_nodes[RB_POSITION(self) ^ RB_DIR_OTHER]; + KASSERT(RB_BLACK_P(RB_FATHER(self))); + /* + * I'm red and have no children, then I must either + * have no brother or my brother also be red and + * also have no children. (black count == 0) + */ + KASSERT(!RB_CHILDLESS_P(self) + || RB_SENTINEL_P(brother) + || RB_RED_P(brother) + || RB_CHILDLESS_P(brother)); + /* + * If I'm not childless, I must have two children + * and they must be both be black. + */ + KASSERT(RB_CHILDLESS_P(self) + || (RB_TWOCHILDREN_P(self) + && RB_BLACK_P(self->rb_left) + && RB_BLACK_P(self->rb_right))); + /* + * If I'm not childless, thus I have black children, + * then my brother must either be black or have two + * black children. + */ + KASSERT(RB_CHILDLESS_P(self) + || RB_BLACK_P(brother) + || (RB_TWOCHILDREN_P(brother) + && RB_BLACK_P(brother->rb_left) + && RB_BLACK_P(brother->rb_right))); + } else { + /* + * If I'm black and have one child, that child must + * be red and childless. + */ + KASSERT(RB_CHILDLESS_P(self) + || RB_TWOCHILDREN_P(self) + || (!RB_LEFT_SENTINEL_P(self) + && RB_RIGHT_SENTINEL_P(self) + && RB_RED_P(self->rb_left) + && RB_CHILDLESS_P(self->rb_left)) + || (!RB_RIGHT_SENTINEL_P(self) + && RB_LEFT_SENTINEL_P(self) + && RB_RED_P(self->rb_right) + && RB_CHILDLESS_P(self->rb_right))); + + /* + * If I'm a childless black node and my parent is + * black, my 2nd closet relative away from my parent + * is either red or has a red parent or red children. + */ + if (!RB_ROOT_P(rbt, self) + && RB_CHILDLESS_P(self) + && RB_BLACK_P(RB_FATHER(self))) { + const unsigned int which = RB_POSITION(self); + const unsigned int other = which ^ RB_DIR_OTHER; + const struct rb_node *relative0, *relative; + + relative0 = rb_tree_iterate_const(rbt, + self, other); + KASSERT(relative0 != NULL); + relative = rb_tree_iterate_const(rbt, + relative0, other); + KASSERT(relative != NULL); + KASSERT(RB_SENTINEL_P(relative->rb_nodes[which])); +#if 0 + KASSERT(RB_RED_P(relative) + || RB_RED_P(relative->rb_left) + || RB_RED_P(relative->rb_right) + || RB_RED_P(RB_FATHER(relative))); +#endif + } + } + /* + * A grandparent's children must be real nodes and not + * sentinels. First check out grandparent. + */ + KASSERT(RB_ROOT_P(rbt, self) + || RB_ROOT_P(rbt, RB_FATHER(self)) + || RB_TWOCHILDREN_P(RB_FATHER(RB_FATHER(self)))); + /* + * If we are have grandchildren on our left, then + * we must have a child on our right. + */ + KASSERT(RB_LEFT_SENTINEL_P(self) + || RB_CHILDLESS_P(self->rb_left) + || !RB_RIGHT_SENTINEL_P(self)); + /* + * If we are have grandchildren on our right, then + * we must have a child on our left. + */ + KASSERT(RB_RIGHT_SENTINEL_P(self) + || RB_CHILDLESS_P(self->rb_right) + || !RB_LEFT_SENTINEL_P(self)); + + /* + * If we have a child on the left and it doesn't have two + * children make sure we don't have great-great-grandchildren on + * the right. + */ + KASSERT(RB_TWOCHILDREN_P(self->rb_left) + || RB_CHILDLESS_P(self->rb_right) + || RB_CHILDLESS_P(self->rb_right->rb_left) + || RB_CHILDLESS_P(self->rb_right->rb_left->rb_left) + || RB_CHILDLESS_P(self->rb_right->rb_left->rb_right) + || RB_CHILDLESS_P(self->rb_right->rb_right) + || RB_CHILDLESS_P(self->rb_right->rb_right->rb_left) + || RB_CHILDLESS_P(self->rb_right->rb_right->rb_right)); + + /* + * If we have a child on the right and it doesn't have two + * children make sure we don't have great-great-grandchildren on + * the left. + */ + KASSERT(RB_TWOCHILDREN_P(self->rb_right) + || RB_CHILDLESS_P(self->rb_left) + || RB_CHILDLESS_P(self->rb_left->rb_left) + || RB_CHILDLESS_P(self->rb_left->rb_left->rb_left) + || RB_CHILDLESS_P(self->rb_left->rb_left->rb_right) + || RB_CHILDLESS_P(self->rb_left->rb_right) + || RB_CHILDLESS_P(self->rb_left->rb_right->rb_left) + || RB_CHILDLESS_P(self->rb_left->rb_right->rb_right)); + + /* + * If we are fully interior node, then our predecessors and + * successors must have no children in our direction. + */ + if (RB_TWOCHILDREN_P(self)) { + const struct rb_node *prev0; + const struct rb_node *next0; + + prev0 = rb_tree_iterate_const(rbt, self, RB_DIR_LEFT); + KASSERT(prev0 != NULL); + KASSERT(RB_RIGHT_SENTINEL_P(prev0)); + + next0 = rb_tree_iterate_const(rbt, self, RB_DIR_RIGHT); + KASSERT(next0 != NULL); + KASSERT(RB_LEFT_SENTINEL_P(next0)); + } + } + + return true; +} + +void +rb_tree_check(const struct rb_tree *rbt, bool red_check) +{ + const struct rb_node *self; + const struct rb_node *prev; +#ifdef RBSTATS + unsigned int count = 0; +#endif + + KASSERT(rbt->rbt_root != NULL); + KASSERT(RB_LEFT_P(rbt->rbt_root)); + +#if defined(RBSTATS) && !defined(RBSMALL) + KASSERT(rbt->rbt_count > 1 + || rbt->rbt_minmax[RB_DIR_LEFT] == rbt->rbt_minmax[RB_DIR_RIGHT]); +#endif + + prev = NULL; + TAILQ_FOREACH(self, &rbt->rbt_nodes, rb_link) { + rb_tree_check_node(rbt, self, prev, false); +#ifdef RBSTATS + count++; +#endif + } +#ifdef RBSTATS + KASSERT(rbt->rbt_count == count); +#endif + if (red_check) { + KASSERT(RB_BLACK_P(rbt->rbt_root)); + KASSERT(RB_SENTINEL_P(rbt->rbt_root) + || rb_tree_count_black(rbt->rbt_root)); + + /* + * The root must be black. + * There can never be two adjacent red nodes. + */ + TAILQ_FOREACH(self, &rbt->rbt_nodes, rb_link) { + rb_tree_check_node(rbt, self, NULL, true); + } + } +} +#endif /* RBDEBUG */ + +#ifdef RBSTATS +static void +rb_tree_mark_depth(const struct rb_tree *rbt, const struct rb_node *self, + size_t *depths, size_t depth) +{ + if (RB_SENTINEL_P(self)) + return; + + if (RB_TWOCHILDREN_P(self)) { + rb_tree_mark_depth(rbt, self->rb_left, depths, depth + 1); + rb_tree_mark_depth(rbt, self->rb_right, depths, depth + 1); + return; + } + depths[depth]++; + if (!RB_LEFT_SENTINEL_P(self)) { + rb_tree_mark_depth(rbt, self->rb_left, depths, depth + 1); + } + if (!RB_RIGHT_SENTINEL_P(self)) { + rb_tree_mark_depth(rbt, self->rb_right, depths, depth + 1); + } +} + +void +rb_tree_depths(const struct rb_tree *rbt, size_t *depths) +{ + rb_tree_mark_depth(rbt, rbt->rbt_root, depths, 1); +} +#endif /* RBSTATS */ + +size_t rb_tree_count(rb_tree_t *rbt) { + if (__predict_false(rbt == NULL)) + return 0; + + return rbt->rbt_count; +} diff --git a/gen/NetBSD/rbtree.3 b/gen/NetBSD/rbtree.3 new file mode 100644 index 0000000..56e52ed --- /dev/null +++ b/gen/NetBSD/rbtree.3 @@ -0,0 +1,326 @@ +.\" $NetBSD: rbtree.3,v 1.12 2016/08/30 05:12:00 dholland Exp $ +.\" +.\" Copyright (c) 2010 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Portions Copyright (c) 2012 Apple Inc. All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Matt Thomas, Niels Provos, and David Young. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd August 29, 2016 +.Dt RBTREE 3 +.Os +.Sh NAME +.Nm rbtree , +.Nm rb_tree_init , +.Nm rb_tree_insert_node , +.Nm rb_tree_remove_node , +.Nm rb_tree_find_node , +.Nm rb_tree_find_node_geq , +.Nm rb_tree_find_node_leq , +.Nm rb_tree_iterate , +.Nm rb_tree_count , +.Nm RB_TREE_MIN , +.Nm RB_TREE_MAX , +.Nm RB_TREE_FOREACH , +.Nm RB_TREE_FOREACH_SAFE , +.Nm RB_TREE_FOREACH_REVERSE , +.Nm RB_TREE_FOREACH_REVERSE_SAFE +.Nd red-black tree +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/rbtree.h +.Ft void +.Fn rb_tree_init "rb_tree_t *rbt" "const rb_tree_ops_t *ops" +.Ft void * +.Fn rb_tree_insert_node "rb_tree_t *rbt" "void *rb" +.Ft void +.Fn rb_tree_remove_node "rb_tree_t *rbt" "void *rb" +.Ft void * +.Fn rb_tree_find_node "rb_tree_t *rbt" "const void *key" +.Ft void * +.Fn rb_tree_find_node_geq "rb_tree_t *rbt" "const void *key" +.Ft void * +.Fn rb_tree_find_node_leq "rb_tree_t *rbt" "const void *key" +.Ft void * +.Fn rb_tree_iterate "rb_tree_t *rbt" "void *rb" "const unsigned int direction" +.Ft size_t +.Fn rb_tree_count "rb_tree_t *rbt" +.Ft void * +.Fn RB_TREE_MIN "rb_tree_t *rbt" +.Ft void * +.Fn RB_TREE_MAX "rb_tree_t *rbt" +.Fn RB_TREE_FOREACH "void *rb" "rb_tree_t *rbt" +.Fn RB_TREE_FOREACH_SAFE "void *rb" "rb_tree_t *rbt" "void *tmp" +.Fn RB_TREE_FOREACH_REVERSE "void *rb" "rb_tree_t *rbt" +.Fn RB_TREE_FOREACH_REVERSE_SAFE "void *rb" "rb_tree_t *rbt" "void *tmp" +.Sh DESCRIPTION +.Nm +provides red-black trees. +A red-black tree is a binary search tree with the node color as an +extra attribute. +It fulfills a set of conditions: +.Bl -enum -offset indent +.It +Every search path from the root to a leaf consists of the same number of +black nodes. +.It +Each red node (except for the root) has a black parent. +.It +Each leaf node is black. +.El +.Pp +Every operation on a red-black tree is bounded as O(lg n). +The maximum height of a red-black tree is 2lg (n+1). +.Sh TYPES +.Bl -tag -width compact +.It Vt rb_tree_t +A red-black tree. +.It Vt typedef signed int \ +(* rbto_compare_nodes_fn)(void *context, const void *node1, const void *node2); +The node-comparison function. +Defines an ordering on nodes. +Returns a negative value if the first node +.Ar node1 +precedes the second node +.Ar node2 . +Returns a positive value if the first node +.Ar node1 +follows the second node +.Ar node2 . +Returns 0 if the first node +.Ar node1 +and the second node +.Ar node2 +are identical according to the ordering. +.It Vt typedef signed int \ +(* rbto_compare_key_fn)(void *context, const void *node, const void *key); +The node-key comparison function. +Defines the order of nodes and keys. +Returns a negative value if the node +.Ar node +precedes the key +.Ar key . +Returns a positive value if the node +.Ar node +follows the key +.Ar key . +Returns 0 if the node +.Ar node +is identical to the key +.Ar key +according to the ordering. +.It Vt rb_tree_ops_t +Defines the function for comparing two nodes in the same tree, +the function for comparing a node in the tree with a key, +the offset of member +.Vt rb_node_t +within the node type, +and the opaque context pointer passed to the comparison functions. +Members of +.Vt rb_tree_ops_t +are +.Bd -literal + rbto_compare_nodes_fn rbto_compare_nodes; + rbto_compare_key_fn rbto_compare_key; + size_t rbto_node_offset; + void *rbto_context; +.Ed +.It Vt rb_node_t +A node in a red-black tree has this structure as a member. +The offset of the +.Vt rb_node_t +member in the caller's node structure should be provided as +.Va rbto_node_offset . +(None of the functions in the +.Nm +interface are meant to take pointers directly to the +.Vt rb_node_t +member.) +.El +.Sh FUNCTIONS +.Bl -tag -width compact +.It Fn rb_tree_init "rbt" "ops" +Initialize the red-black tree +.Fa rbt . +Let the comparison functions given by +.Fa ops +define the order of nodes in the tree for +the purposes of insertion, search, and iteration. +.Fn rb_tree_init +always succeeds. +.It Fn rb_tree_insert_node "rbt" "rb" +Insert the node +.Fa rb +into the tree +.Fa rbt . +Return inserted node on success, +already existing node on failure. +.It Fn rb_tree_remove_node "rbt" "rb" +Remove the node +.Fa rb +from the tree +.Fa rbt . +.It Fn rb_tree_find_node "rbt" "key" +Search the tree +.Fa rbt +for a node exactly matching +.Fa key . +If no such node is in the tree, return +.Dv NULL . +Otherwise, return the matching node. +.It Fn rb_tree_find_node_geq "rbt" "key" +Search the tree +.Fa rbt +for a node that exactly matches +.Fa key +and return it. +If no such node is present, return the first node following +.Fa key +or, if no such node is in the tree, return +.Dv NULL . +.It Fn rb_tree_find_node_leq "rbt" "key" +Search the tree +.Fa rbt +for a node that exactly matches +.Fa key +and return it. +If no such node is present, return the first node preceding +.Fa key +or, if no such node is in the tree, return +.Dv NULL . +.It Fn rb_tree_iterate "rbt" "rb" "direction" +If +.Fa direction +is +.Dv RB_DIR_LEFT , +return the node in the tree +.Fa rbt +immediately preceding the node +.Fa rb +or, if +.Fa rb +is +.Dv NULL , +return the first node in +.Fa rbt +or, if the tree is empty, return +.Dv NULL . +.Pp +If +.Fa direction +is +.Dv RB_DIR_RIGHT , +return the node in the tree +.Fa rbt +immediately following the node +.Fa rb +or, if +.Fa rb +is +.Dv NULL , +return the last node in +.Fa rbt +or, if the tree is empty, return +.Dv NULL . +.It Fn rb_tree_count "rbt" +Return the number of nodes in the tree +.Fa rbt . +If +.Fa rbt +is +.Dv NULL , +0 is returned. +.It Fn RB_TREE_MIN "rbt" +Return the first node in +.Fa rbt , +i.e. the node with the least key, or +.Dv NULL +if +.Fa rbt +is empty. +.It Fn RB_TREE_MAX "rbt" +Return the last node in +.Fa rbt , +i.e. the node with the greatest key, or +.Dv NULL +if +.Fa rbt +is empty. +.It Fn RB_TREE_FOREACH "rb" "rbt" +.Nm RB_TREE_FOREACH +is a macro to be used in the place of a +.Dv for +header preceding a statement to traverse the nodes in +.Fa rbt +from least to greatest, assigning +.Fa rb +to each node in turn and executing the statement. +.It Fn RB_TREE_FOREACH_SAFE "rb" "rbt" "tmp" +.Nm RB_TREE_FOREACH_SAFE +is a macro to be used like +.Nm RB_TREE_FOREACH +but which uses a temporary variable to permit safe modification or deletion of +.Fa rb +in the body of the loop. +.It Fn RB_TREE_FOREACH_REVERSE "rb" "rbt" +.Nm RB_TREE_FOREACH_REVERSE +is a macro to be used in the place of a +.Dv for +header preceding a statement to traverse the nodes in +.Fa rbt +from greatest to least, assigning +.Fa rb +to each node in turn and executing the statement. +.It Fn RB_TREE_FOREACH_REVERSE_SAFE "rb" "rbt" "tmp" +.Nm RB_TREE_FOREACH_REVERSE_SAFE +is a macro to be used like +.Nm RB_TREE_FOREACH_REVERSE +but which uses a temporary variable to permit safe modification or deletion of +.Fa rb +in the body of the loop. +.El +.Sh SEE ALSO +.Xr queue 3 , +.Xr tree 3 +.Sh HISTORY +The +.Nm +interface first appeared in +.Nx 6.0 . +.Sh AUTHORS +.An Matt Thomas Aq Mt matt@NetBSD.org +wrote +.Nm . +.Pp +.An Niels Provos Aq Mt provos@citi.umich.edu +wrote the +.Xr tree 3 +manual page. +Portions of this page derive from that page. +.\" .Sh CAVEATS +.\" .Sh BUGS +.\" .Sh SECURITY CONSIDERATIONS diff --git a/gen/NetBSD/utmpx.5 b/gen/NetBSD/utmpx.5 new file mode 100644 index 0000000..6068b09 --- /dev/null +++ b/gen/NetBSD/utmpx.5 @@ -0,0 +1,101 @@ +.\" $NetBSD: utmpx.5,v 1.7 2008/04/30 13:10:57 martin Exp $ +.\" +.\" Copyright (c) 2002 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Thomas Klausner. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd January 31, 2007 +.Dt UTMPX 5 +.Os +.Sh NAME +.Nm utmpx +.Nd user accounting database +.Sh SYNOPSIS +.In utmpx.h +.Sh DESCRIPTION +In contrast to +.Pa utmp +and +.Pa wtmp , +the extended databases in +.Pa utmpx +and +.Pa wtmpx +reserve more space for logging hostnames, and also +information on a process' ID, termination signal and exit status. +.Pp +The +.Aq Pa utmpx.h +header defines the structures and functions for logging user. +Currently logged in users are tracked in +.Pa /var/run/utmpx . +The interface to the +.Nm utmpx +file is described in +.Xr endutxent 3 . +The file is not automatically created if they do not exist; it +must be created manually. +.Pp +Traditionally, separate files would be used to store the running log of +the logins and logouts +.Pf ( Pa wtmpx ) , +and the last login of each user +.Pf ( Pa lastlogx ) . +With the availability of the Apple system log facility +.Xr asl 3 , +these separate files can be replace with log entries, which are automatically +generated when +.Nm utmpx +entries are written. +The API to access the logins and logouts is described in +.Xr endutxent_wtmp 3 +while the last login info is accessible with +.Xr getlastlogx 3 . +.Pp +For compatibility, changes to +.Nm utmpx +are reflected in +.Xr utmp 3 +(in the +.Pa utmp , +.Pa wtmp +and +.Pa lastlog +files), +but not the other way around. +.Sh FILES +.Bl -tag -width /var/log/utmpx -compact +.It Pa /var/run/utmpx +The +.Nm utmpx +file. +.El +.Sh SEE ALSO +.Xr asl 3 , +.Xr endutxent 3 , +.Xr endutxent_wtmp 3 , +.Xr getlastlogx 3 , +.Xr utmp 5 diff --git a/gen/NetBSD/utmpx.c b/gen/NetBSD/utmpx.c new file mode 100644 index 0000000..d68553e --- /dev/null +++ b/gen/NetBSD/utmpx.c @@ -0,0 +1,587 @@ +/* $NetBSD: utmpx.c,v 1.25 2008/04/28 20:22:59 martin Exp $ */ + +/*- + * Copyright (c) 2002 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include + +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: utmpx.c,v 1.25 2008/04/28 20:22:59 martin Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#ifdef UNIFDEF_LEGACY_UTMP_APIS +#include +#endif /* UNIFDEF_LEGACY_UTMP_APIS */ +#include +#include +#include +#include +#include + +static struct _utmpx *__utx__ = NULL; + +static void +__default_utx_init(void) +{ + __utx__ = calloc(1, sizeof(struct _utmpx)); + const char magic[] = __UTX_MAGIC__; + memcpy(&__utx__->magic, magic, UTMPX_MAGIC); + pthread_mutex_init(&__utx__->utmpx_mutex, NULL); + __utx__->utfile = _PATH_UTMPX; + __utx__->utfile_system = 1; +} + +struct _utmpx * +__default_utx(void) +{ + static pthread_once_t once = PTHREAD_ONCE_INIT; + pthread_once(&once, &__default_utx_init); + return __utx__; +} + +static struct utmpx *__getutxid(struct _utmpx *, const struct utmpx *); + +__private_extern__ const char _utmpx_vers[] = "utmpx-1.00"; + +__private_extern__ void +__setutxent(struct _utmpx *U) +{ + + (void)memset(&U->ut, 0, sizeof(U->ut)); + if (U->fp == NULL) + return; +#ifdef __LP64__ + (void)fseeko(U->fp, (off_t)sizeof(struct utmpx32), SEEK_SET); +#else /* __LP64__ */ + (void)fseeko(U->fp, (off_t)sizeof(U->ut), SEEK_SET); +#endif /* __LP64__ */ +} + +void +_setutxent(struct _utmpx *U) +{ + + TEST_UTMPX_T("_setutxent", U); + UTMPX_LOCK(U); + __setutxent(U); + UTMPX_UNLOCK(U); +} + + +void +setutxent(void) +{ + _setutxent(__default_utx()); +} + + +__private_extern__ void +__endutxent(struct _utmpx *U) +{ + (void)memset(&U->ut, 0, sizeof(U->ut)); + if (U->fp != NULL) { + int saveerrno = errno; + (void)fclose(U->fp); + errno = saveerrno; + U->fp = NULL; + U->readonly = 0; + } +} + + +void +_endutxent(struct _utmpx *U) +{ + TEST_UTMPX_T("_endutxent", U); + UTMPX_LOCK(U); + __endutxent(U); + UTMPX_UNLOCK(U); +} + + +void +endutxent(void) +{ + _endutxent(__default_utx()); +} + + +__private_extern__ struct utmpx * +__getutxent(struct _utmpx *U) +{ + int saveerrno; +#ifdef __LP64__ + struct utmpx32 ut32; +#endif /* __LP64__ */ + + if (U->fp == NULL) { + struct stat st; + + if ((U->fp = fopen(U->utfile, "r+")) == NULL) + if ((U->fp = fopen(U->utfile, "w+")) == NULL) { + if ((U->fp = fopen(U->utfile, "r")) == NULL) + goto fail; + else + U->readonly = 1; + } + + fcntl(fileno(U->fp), F_SETFD, 1); /* set close-on-exec flag */ + + /* get file size in order to check if new file */ + if (fstat(fileno(U->fp), &st) == -1) + goto failclose; + + if (st.st_size == 0) { + /* new file, add signature record */ +#ifdef __LP64__ + (void)memset(&ut32, 0, sizeof(ut32)); + ut32.ut_type = SIGNATURE; + (void)memcpy(ut32.ut_user, _utmpx_vers, sizeof(_utmpx_vers)); + if (fwrite(&ut32, sizeof(ut32), 1, U->fp) != 1) +#else /* __LP64__ */ + (void)memset(&U->ut, 0, sizeof(U->ut)); + U->ut.ut_type = SIGNATURE; + (void)memcpy(U->ut.ut_user, _utmpx_vers, sizeof(_utmpx_vers)); + if (fwrite(&U->ut, sizeof(U->ut), 1, U->fp) != 1) +#endif /* __LP64__ */ + goto failclose; + } else { + /* old file, read signature record */ +#ifdef __LP64__ + if (fread(&ut32, sizeof(ut32), 1, U->fp) != 1) +#else /* __LP64__ */ + if (fread(&U->ut, sizeof(U->ut), 1, U->fp) != 1) +#endif /* __LP64__ */ + goto failclose; +#ifdef __LP64__ + if (memcmp(ut32.ut_user, _utmpx_vers, sizeof(_utmpx_vers)) != 0 || + ut32.ut_type != SIGNATURE) +#else /* __LP64__ */ + if (memcmp(U->ut.ut_user, _utmpx_vers, sizeof(_utmpx_vers)) != 0 || + U->ut.ut_type != SIGNATURE) +#endif /* __LP64__ */ + { + errno = EINVAL; + goto failclose; + } + } + } + +#ifdef __LP64__ + if (fread(&ut32, sizeof(ut32), 1, U->fp) != 1) +#else /* __LP64__ */ + if (fread(&U->ut, sizeof(U->ut), 1, U->fp) != 1) +#endif /* __LP64__ */ + goto fail; + +#ifdef __LP64__ + _utmpx32_64(&ut32, &U->ut); +#endif /* __LP64__ */ + return &U->ut; +failclose: + saveerrno = errno; + (void)fclose(U->fp); + errno = saveerrno; + U->fp = NULL; +fail: + (void)memset(&U->ut, 0, sizeof(U->ut)); + return NULL; +} + + +struct utmpx * +_getutxent(struct _utmpx *U) +{ + struct utmpx *ret; + + TEST_UTMPX_T("_getutxent", U); + UTMPX_LOCK(U); + ret = __getutxent(U); + UTMPX_UNLOCK(U); + return ret; +} + + +struct utmpx * +getutxent(void) +{ + return _getutxent(__default_utx()); +} + + +struct utmpx * +_getutxid(struct _utmpx *U, const struct utmpx *utx) +{ + struct utmpx temp; + const struct utmpx *ux; + struct utmpx *ret; + + if (utx->ut_type == EMPTY) + return NULL; + + TEST_UTMPX_T("_getutxid", U); + UTMPX_LOCK(U); + /* make a copy as needed, and auto-fill if requested */ + ux = _utmpx_working_copy(utx, &temp, 1); + if (!ux) { + UTMPX_UNLOCK(U); + return NULL; + } + + ret = __getutxid(U, ux); + UTMPX_UNLOCK(U); + return ret; +} + + +struct utmpx * +getutxid(const struct utmpx *utx) +{ + return _getutxid(__default_utx(), utx); +} + + +static struct utmpx * +__getutxid(struct _utmpx *U, const struct utmpx *utx) +{ + + do { + if (U->ut.ut_type == EMPTY) + continue; + switch (utx->ut_type) { + case EMPTY: + return NULL; + case RUN_LVL: + case BOOT_TIME: + case OLD_TIME: + case NEW_TIME: + if (U->ut.ut_type == utx->ut_type) + return &U->ut; + break; + case INIT_PROCESS: + case LOGIN_PROCESS: + case USER_PROCESS: + case DEAD_PROCESS: + switch (U->ut.ut_type) { + case INIT_PROCESS: + case LOGIN_PROCESS: + case USER_PROCESS: + case DEAD_PROCESS: + if (memcmp(U->ut.ut_id, utx->ut_id, + sizeof(U->ut.ut_id)) == 0) + return &U->ut; + break; + default: + break; + } + break; + default: + return NULL; + } + } while (__getutxent(U) != NULL); + return NULL; +} + + +static struct utmpx * +__getutxline(struct _utmpx *U, const struct utmpx *utx) +{ + do { + switch (U->ut.ut_type) { + case EMPTY: + break; + case LOGIN_PROCESS: + case USER_PROCESS: + if (strncmp(U->ut.ut_line, utx->ut_line, + sizeof(U->ut.ut_line)) == 0) + return &U->ut; + break; + default: + break; + } + } while (__getutxent(U) != NULL); + return NULL; +} + + +struct utmpx * +_getutxline(struct _utmpx *U, const struct utmpx *utx) +{ + struct utmpx *ret; + + TEST_UTMPX_T("_getutxline", U); + UTMPX_LOCK(U); + ret = __getutxline(U, utx); + UTMPX_UNLOCK(U); + return ret; +} + + +struct utmpx * +getutxline(const struct utmpx *utx) +{ + return _getutxline(__default_utx(), utx); +} + + +struct utmpx * +_pututxline(struct _utmpx *U, const struct utmpx *utx) +{ + struct utmpx *ux; + + if (utx == NULL) { + errno = EINVAL; + return NULL; + } + + TEST_UTMPX_T("_pututxline", U); + UTMPX_LOCK(U); + if ((ux = __pututxline(__default_utx(), utx)) != NULL && __default_utx()->utfile_system) { + _utmpx_asl(ux); /* the equivalent of wtmpx and lastlogx */ +#ifdef UTMP_COMPAT + _write_utmp_compat(ux); +#endif /* UTMP_COMPAT */ + } + UTMPX_UNLOCK(U); + return ux; +} + + +struct utmpx * +pututxline(const struct utmpx *utx) +{ + return _pututxline(__default_utx(), utx); +} + +__private_extern__ struct utmpx * +__pututxline(struct _utmpx *U, const struct utmpx *utx) +{ + struct utmpx temp, *u = NULL, *x; + const struct utmpx *ux; +#ifdef __LP64__ + struct utmpx32 ut32; +#endif /* __LP64__ */ + struct flock fl; +#define gotlock (fl.l_start >= 0) + + fl.l_start = -1; /* also means we haven't locked */ + if (U->utfile_system) + if ((U->fp != NULL && U->readonly) || (U->fp == NULL && geteuid() != 0)) { + errno = EPERM; + return NULL; + } + + if (U->fp == NULL) { + (void)__getutxent(U); + if (U->fp == NULL || U->readonly) { + errno = EPERM; + return NULL; + } + } + + /* make a copy as needed, and auto-fill if requested */ + ux = _utmpx_working_copy(utx, &temp, 0); + if (!ux) + return NULL; + + if ((x = __getutxid(U, ux)) == NULL) { + __setutxent(U); + if ((x = __getutxid(U, ux)) == NULL) { + /* + * utx->ut_type has any original mask bits, while + * ux->ut_type has those mask bits removed. If we + * are trying to record a dead process, and + * UTMPX_DEAD_IF_CORRESPONDING_MASK is set, then since + * there is no matching entry, we return NULL. + */ + if (ux->ut_type == DEAD_PROCESS && + (utx->ut_type & UTMPX_DEAD_IF_CORRESPONDING_MASK)) { + errno = EINVAL; + return NULL; + } + /* + * Replace lockf() with fcntl() and a fixed start + * value. We should already be at EOF. + */ + if ((fl.l_start = lseek(fileno(U->fp), 0, SEEK_CUR)) < 0) + return NULL; + fl.l_len = 0; + fl.l_whence = SEEK_SET; + fl.l_type = F_WRLCK; + if (fcntl(fileno(U->fp), F_SETLKW, &fl) == -1) + return NULL; + if (fseeko(U->fp, (off_t)0, SEEK_END) == -1) + goto fail; + } + } + + if (!gotlock) { + /* + * utx->ut_type has any original mask bits, while + * ux->ut_type has those mask bits removed. If we + * are trying to record a dead process, if + * UTMPX_DEAD_IF_CORRESPONDING_MASK is set, but the found + * entry is not a (matching) USER_PROCESS, then return NULL. + */ + if (ux->ut_type == DEAD_PROCESS && + (utx->ut_type & UTMPX_DEAD_IF_CORRESPONDING_MASK) && + x->ut_type != USER_PROCESS) { + errno = EINVAL; + return NULL; + } + /* we are not appending */ +#ifdef __LP64__ + if (fseeko(U->fp, -(off_t)sizeof(ut32), SEEK_CUR) == -1) +#else /* __LP64__ */ + if (fseeko(U->fp, -(off_t)sizeof(U->ut), SEEK_CUR) == -1) +#endif /* __LP64__ */ + return NULL; + } + +#ifdef __LP64__ + _utmpx64_32(ux, &ut32); + if (fwrite(&ut32, sizeof (ut32), 1, U->fp) != 1) +#else /* __LP64__ */ + if (fwrite(ux, sizeof (*ux), 1, U->fp) != 1) +#endif /* __LP64__ */ + goto fail; + + if (fflush(U->fp) == -1) + goto fail; + + u = memcpy(&U->ut, ux, sizeof(U->ut)); + notify_post(UTMPX_CHANGE_NOTIFICATION); +fail: + if (gotlock) { + int save = errno; + fl.l_type = F_UNLCK; + if (fcntl(fileno(U->fp), F_SETLK, &fl) == -1) + return NULL; + errno = save; + } + return u; +} + + +/* + * The following are extensions and not part of the X/Open spec. + */ +__private_extern__ int +__utmpxname(struct _utmpx *U, const char *fname) +{ + size_t len; + + if (fname == NULL) { + if(!U->utfile_system) + free(U->utfile); + U->utfile = _PATH_UTMPX; + U->utfile_system = 1; + __endutxent(U); + return 1; + } + + len = strlen(fname); + + if (len >= MAXPATHLEN) + return 0; + + /* must end in x! */ + if (fname[len - 1] != 'x') + return 0; + + if (U->utfile_system) + U->utfile = NULL; + U->utfile_system = 0; + if ((U->utfile = reallocf(U->utfile, len + 1)) == NULL) + return 0; + + (void)strcpy(U->utfile, fname); + __endutxent(U); + return 1; +} + +int +_utmpxname(struct _utmpx *U, const char *fname) +{ + int ret; + + TEST_UTMPX_T("_utmpxname", U); + UTMPX_LOCK(U); + ret = __utmpxname(U, fname); + UTMPX_UNLOCK(U); + return ret; +} + +int +utmpxname(const char *fname) +{ + return _utmpxname(__default_utx(), fname); +} + +#ifdef UNIFDEF_LEGACY_UTMP_APIS +void +getutmp(const struct utmpx *ux, struct utmp *u) +{ + + bzero(u, sizeof(*u)); + (void)memcpy(u->ut_name, ux->ut_user, sizeof(u->ut_name)); + (void)memcpy(u->ut_line, ux->ut_line, sizeof(u->ut_line)); + (void)memcpy(u->ut_host, ux->ut_host, sizeof(u->ut_host)); + u->ut_time = ux->ut_tv.tv_sec; +} + +void +getutmpx(const struct utmp *u, struct utmpx *ux) +{ + + bzero(ux, sizeof(*ux)); + (void)memcpy(ux->ut_user, u->ut_name, sizeof(u->ut_name)); + ux->ut_user[sizeof(u->ut_name)] = 0; + (void)memcpy(ux->ut_line, u->ut_line, sizeof(u->ut_line)); + ux->ut_line[sizeof(u->ut_line)] = 0; + (void)memcpy(ux->ut_host, u->ut_host, sizeof(u->ut_host)); + ux->ut_host[sizeof(u->ut_host)] = 0; + ux->ut_tv.tv_sec = u->ut_time; + ux->ut_tv.tv_usec = 0; + ux->ut_pid = getpid(); + ux->ut_type = USER_PROCESS; +} +#endif /* UNIFDEF_LEGACY_UTMP_APIS */ diff --git a/gen/__dirent.h b/gen/__dirent.h new file mode 100644 index 0000000..79d4164 --- /dev/null +++ b/gen/__dirent.h @@ -0,0 +1,15 @@ +/* + * We need to prefix the elements of DIR with double-underscore to use + * the implementation namespace. We could patch all the *dir.c code, + * but it is easier to use #defines to rename the elements. This file + * then gets included by all the *dir.c. + */ +#define dd_fd __dd_fd +#define dd_loc __dd_loc +#define dd_size __dd_size +#define dd_buf __dd_buf +#define dd_len __dd_len +#define dd_seek __dd_seek +#define dd_flags __dd_flags +#define dd_lock __dd_lock +#define dd_td __dd_td diff --git a/gen/authentication.c b/gen/authentication.c new file mode 100644 index 0000000..20e3b90 --- /dev/null +++ b/gen/authentication.c @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "authentication.h" + +int isAuthenticatedAsAdministrator(void) +{ + if (isAuthenticatedAsRoot()) { + return 1; + } + // otherwise ... + return isAuthenticatedAsAdministratorForTask(0); +} + +int isAuthenticatedAsAdministratorForTask(int taskNum) +{ + int admin = 0; + uid_t ruid; + + if (isAuthenticatedAsRoot()) { + return 1; + } + + ruid = getuid(); + + if (ruid) { + gid_t groups[NGROUPS_MAX]; + int numgroups; + + /* + * Only allow those in group taskNum group (By default admin) to authenticate. + */ + if ((numgroups = getgroups(NGROUPS_MAX, groups)) > 0) { + int i; + gid_t admingid = 0; + struct group *admingroup; + + if ((admingroup = getgrnam(groupNameForTask(taskNum))) != NULL) { + admingid = admingroup->gr_gid; + + for (i = 0; i < numgroups; i++) { + if (groups[i] == admingid) { + admin = 1; + break; + } + } + } + + } + } + // otherwise + return admin; +} + +int isAuthenticatedAsRoot(void) +{ + if (getuid() == 0) { + return 1; + } + return 0; +} + +char *groupNameForTask(int taskNum) +{ + if (taskNum == 0) + return "admin"; + + return "admin"; +} + diff --git a/gen/backtrace.3 b/gen/backtrace.3 new file mode 100644 index 0000000..38b9125 --- /dev/null +++ b/gen/backtrace.3 @@ -0,0 +1,142 @@ +.\" Copyright (c) 2007 Apple Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Apple Inc. ("Apple") nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY APPLE AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" +.Dd March 1, 2018 +.Dt backtrace 3 +.Os "Darwin" +.Sh NAME +.Nm backtrace , +.Nm backtrace_symbols , +.Nm backtrace_symbols_fd , +.Nm backtrace_image_offsets , +.Nm backtrace_from_fp +.Nd call stack backtrace and display functions +.Sh SYNOPSIS +.In execinfo.h +.Ft int +.Fo backtrace +.Fa "void** array" +.Fa "int size" +.Fc +.Ft char** +.Fo backtrace_symbols +.Fa "void* const* array" +.Fa "int size" +.Fc +.Ft void +.Fo backtrace_symbols_fd +.Fa "void* const* array" +.Fa "int size" +.Fa "int fd" +.Fc +.Ft void +.Fo backtrace_image_offsets +.Fa "void* const* array" +.Fa "struct image_offset *image_offsets" +.Fa "int size" +.Fc +.Ft int +.Fo backtrace_from_fp +.Fa "void* startfp" +.Fa "void** array" +.Fa "int size" +.Fc +.Sh DESCRIPTION +These routines provide a mechanism to examine the current thread's call stack. +.Pp +.Fn backtrace +writes the function return addresses of the current call stack to the array of +pointers referenced by +.Fa array . +At most, +.Fa size +pointers are written. The number of pointers actually written to +.Fa array +is returned. +.Pp +.Fn backtrace_symbols +attempts to transform a call stack obtained by +.Fn backtrace +into an array of human-readable strings using +.Fn dladdr . +The array of strings returned has +.Fa size +elements. It is allocated using +.Fn malloc +and should be released using +.Fn free . +There is no need to free the individual strings in the array. +.Pp +.Fn backtrace_symbols_fd +performs the same operation as +.Fn backtrace_symbols , +but the resulting strings are immediately written to the file descriptor +.Fa fd , +and are not returned. +.Pp +.Fn backtrace_image_offsets +attempts to transform a call stack obtained by +.Fn backtrace +into an array of image offsets, for deferred symbolication. Each entry in the +array has an offset relative to the +.Li __TEXT +section of the image with the given UUID. The results are written to +.Fa image_offsets +which should be an array of +.Fa size +length. +.Pp +.Fn backtrace_from_fp +takes a backtrace of frames starting from the given frame pointer. +.Sh EXAMPLE +.Pp + #include + #include + ... + void* callstack[128]; + int i, frames = backtrace(callstack, 128); + char** strs = backtrace_symbols(callstack, frames); + for (i = 0; i < frames; ++i) { + printf("%s\\n", strs[i]); + } + free(strs); + ... +.Pp +.Sh HISTORY +.Fn backtrace , +.Fn backtrace_symbols , +and +.Fn backtrace_symbols_fd +first appeared in Mac OS X 10.5. +.Fn backtrace_image_offsets +and +.Fn backtrace_from_fp +first appeared macOS 10.14 and iOS 12. +.Sh SEE ALSO +.Xr dladdr 3 , +.Xr malloc 3 diff --git a/gen/backtrace.c b/gen/backtrace.c new file mode 100644 index 0000000..f3b7424 --- /dev/null +++ b/gen/backtrace.c @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2007, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "execinfo.h" + +extern void _thread_stack_pcs(vm_address_t *buffer, unsigned max, + unsigned *nb, unsigned skip, void *startfp); + +int backtrace(void** buffer, int size) { + unsigned int num_frames; + _thread_stack_pcs((vm_address_t*)buffer, size, &num_frames, 1, NULL); + while (num_frames >= 1 && buffer[num_frames-1] == NULL) num_frames -= 1; + return num_frames; +} + +int +backtrace_from_fp(void *startfp, void **buffer, int size) +{ + unsigned int num_frames; + _thread_stack_pcs((vm_address_t*)buffer, size, &num_frames, 1, startfp); + while (num_frames >= 1 && buffer[num_frames-1] == NULL) num_frames -= 1; + return num_frames; +} + +#if !TARGET_OS_DRIVERKIT + +#include +#include +#include +#include "stack_logging.h" + +#if __LP64__ +#define _BACKTRACE_FORMAT "%-4d%-35s 0x%016lx %s + %lu" +#define _BACKTRACE_FORMAT_SIZE 83 /* %lu can take up to 20, does not include %s, includes NUL */ +#define _BACKTRACE_ADDRESS_LEN 18 /* 0x + 16 (no NUL) */ +#else +#define _BACKTRACE_FORMAT "%-4d%-35s 0x%08lx %s + %lu" +#define _BACKTRACE_FORMAT_SIZE 65 /* %lu can take up to 10, does not include %s, includes NUL */ +#define _BACKTRACE_ADDRESS_LEN 10 /* 0x + 8 (no NUL) */ +#endif +#define _BACKTRACE_IMAGE_LEN 35 +#define _BACKTRACE_UUID_LEN 36 + +static int _backtrace_snprintf(char* buf, size_t size, int frame, const void* addr, const Dl_info* info) { + char addrbuf[_BACKTRACE_ADDRESS_LEN + 1]; + char imagebuf[_BACKTRACE_IMAGE_LEN + 1]; + uuid_string_t uuidbuf; + const char* image = "???"; + const char* symbol = "0x0"; + uintptr_t symbol_offset = 0; + + if (info->dli_fname) { + const char *tmp = strrchr(info->dli_fname, '/'); + if (tmp == NULL) { + strlcpy(imagebuf, info->dli_fname, sizeof(imagebuf)); + } else { + strlcpy(imagebuf, tmp + 1, sizeof(imagebuf)); + } + image = imagebuf; + } + + if (info->dli_sname) { + uuid_t uuid; + if (strcmp(info->dli_sname, "") == 0 && + _dyld_get_image_uuid(info->dli_fbase, uuid)) { + /* + * dyld returns when the symbol name has been elided in + * the shared cache. To enable symbolication later, we provide the + * UUID and UUID-offset instead. + */ + uuid_unparse(uuid, uuidbuf); + symbol = uuidbuf; + symbol_offset = (uintptr_t)addr - (uintptr_t)info->dli_fbase; + } else { + symbol = info->dli_sname; + symbol_offset = (uintptr_t)addr - (uintptr_t)info->dli_saddr; + } + } else if (info->dli_fname) { + symbol = image; + symbol_offset = (uintptr_t)addr - (uintptr_t)info->dli_fbase; + } else if (0 < snprintf(addrbuf, sizeof(addrbuf), "0x%lx", + (uintptr_t)info->dli_saddr)) { + symbol = addrbuf; + symbol_offset = (uintptr_t)addr - (uintptr_t)info->dli_saddr; + } else { + symbol_offset = (uintptr_t)addr; + } + + return snprintf(buf, size, _BACKTRACE_FORMAT, frame, image, + (uintptr_t)addr, symbol, symbol_offset); +} + +static size_t symbol_length(Dl_info *info) +{ + if (info->dli_sname) { + if (strcmp(info->dli_sname, "") == 0) { + return _BACKTRACE_UUID_LEN; + } else { + return strlen(info->dli_sname); + } + } else if (info->dli_fname) { + const char *tmp = strrchr(info->dli_fname, '/'); + if (tmp == NULL) { + return strlen(info->dli_fname); + } else { + return strlen(tmp + 1); + } + } else { + return _BACKTRACE_ADDRESS_LEN; + } +} + +char** backtrace_symbols(void* const* buffer, int size) { + int i; + size_t total_bytes; + char** result; + char** ptrs; + intptr_t strs, end; + Dl_info* info = calloc(size, sizeof (Dl_info)); + + if (info == NULL) return NULL; + + // Compute the total size for the block that is returned. + // The block will contain size number of pointers to the + // symbol descriptions. + + total_bytes = sizeof(char*) * size; + + // Plus each symbol description + for (i = 0 ; i < size; ++i) { + dladdr(buffer[i], &info[i]); + total_bytes += _BACKTRACE_FORMAT_SIZE; + total_bytes += symbol_length(&info[i]); + } + + result = (char**)malloc(total_bytes); + if (result == NULL) { + goto error; + } + end = (intptr_t)result + total_bytes; + + // Fill in the array of pointers and append the strings for + // each symbol description. + + ptrs = result; + strs = ((intptr_t)result) + sizeof(char*) * size; + + for (i = 0; i < size; ++i) { + int chk = _backtrace_snprintf((char*)strs, end - (intptr_t)strs, i, buffer[i], &info[i]); + if (chk < 0) { + goto error; + } + + ptrs[i] = (char*)strs; + strs += chk + 1; // Step over the '\0' + } + + free(info); + return result; + +error: + free(info); + free(result); + return NULL; +} + +void backtrace_symbols_fd(void* const* buffer, int size, int fd) { + int i; + char buf[BUFSIZ]; + Dl_info info; + struct iovec iov[2]; + + iov[0].iov_base = buf; + + iov[1].iov_base = "\n"; + iov[1].iov_len = 1; + + for (i = 0; i < size; ++i) { + memset(&info, 0, sizeof(info)); + dladdr(buffer[i], &info); + + iov[0].iov_len = _backtrace_snprintf(buf, sizeof(buf), i, buffer[i], &info); + + writev(fd, iov, 2); + } +} + +#endif // !TARGET_OS_DRIVERKIT + +void +backtrace_image_offsets(void* const* buffer, struct image_offset *imgoffs, int size) +{ + struct dyld_image_uuid_offset infos[size]; + _dyld_images_for_addresses(size, (const void **)buffer, infos); + + for (int i = 0; i < size; i++) { + uuid_copy(imgoffs[i].uuid, infos[i].uuid); + imgoffs[i].offset = infos[i].offsetInImage; + }; +} diff --git a/gen/clock_gettime.3 b/gen/clock_gettime.3 new file mode 100644 index 0000000..98e147a --- /dev/null +++ b/gen/clock_gettime.3 @@ -0,0 +1,186 @@ +.\" +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd January 26, 2016 +.Dt CLOCK_GETTIME 3 +.Os +.Sh NAME +.Nm clock_gettime , +.Nm clock_settime , +.Nm clock_getres , +.Nm clock_gettime_nsec_np +.Nd get/set date and time +.Sh SYNOPSIS +.Fd #include +.Ft int +.Fn clock_gettime "clockid_t clock_id" "struct timespec *tp" +.Ft int +.Fn clock_settime "clockid_t clock_id" "const struct timespec *tp" +.Ft int +.Fn clock_getres "clockid_t clock_id" "struct timespec *tp" +.Ft uint64_t +.Fn clock_gettime_nsec_np "clockid_t clock_id" +.Sh DESCRIPTION +The +.Fn clock_gettime +and +.Fn clock_settime +functions +allow the calling process to retrieve or set the value used by a clock +which is specified by +.Fa clock_id . +.Pp +.Fa clock_id +can be a value from +one of 8 predefined values: +.Bl -tag -width Er +.It Dv CLOCK_REALTIME +the system's real time (i.e. wall time) clock, expressed as the amount of time +since the Epoch. +This is the same as the value returned by +.Xr gettimeofday 2 . +.It Dv CLOCK_MONOTONIC +clock that increments monotonically, tracking the time since an arbitrary +point, and will continue to increment while the system is asleep. +.It Dv CLOCK_MONOTONIC_RAW +clock that increments monotonically, tracking the time since an arbitrary point +like CLOCK_MONOTONIC. However, this clock is unaffected by frequency or time +adjustments. It should not be compared to other system time sources. +.It Dv CLOCK_MONOTONIC_RAW_APPROX +like CLOCK_MONOTONIC_RAW, but reads a value cached by the system at context +switch. This can be read faster, but at a loss of accuracy as it may return +values that are milliseconds old. +.It Dv CLOCK_UPTIME_RAW +clock that increments monotonically, in the same manner as +.Dv CLOCK_MONOTONIC_RAW, +but that does not increment while the system is asleep. +The returned value is identical to the result of +.Fn mach_absolute_time +after the appropriate mach_timebase conversion is applied. +.It Dv CLOCK_UPTIME_RAW_APPROX +like CLOCK_UPTIME_RAW, but reads a value cached by the system at context +switch. This can be read faster, but at a loss of accuracy as it may return +values that are milliseconds old. +.It Dv CLOCK_PROCESS_CPUTIME_ID +clock that tracks the amount of CPU (in user- or kernel-mode) used by the +calling process. +.It Dv CLOCK_THREAD_CPUTIME_ID +clock that tracks the amount of CPU (in user- or kernel-mode) used by the +calling thread. +.El +.Pp +The structure pointed to by +.Fa tp +is defined in +.In sys/time.h +as: +.Bd -literal -offset indent +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* and nanoseconds */ +}; +.Ed +.Pp +Only the +.Dv CLOCK_REALTIME +clock can be set, and only the superuser may do so. +.Pp +The resolution of a clock is returned by the +.Fn clock_getres +call. +This value is placed in a (non-null) +.Fa *tp . +This value may be smaller than the actual precision of the underlying clock, +but represents a lower bound on the resolution. +.Pp +As a non-portable extension, the +.Fn clock_gettime_nsec_np +function will return the clock value in 64-bit nanoseconds. +.Sh RETURN VALUES +A 0 return value indicates that the call succeeded. +A \-1 return value indicates an error occurred, and in this +case an error code is stored into the global variable +.Va errno . +For +.Fn clock_gettime_nsec_np +a return value of non-0 indicates success. A 0 return value indicates an error +occurred and an error code is stored in +.Va errno . +.Sh ERRORS +.Fn clock_gettime , +.Fn clock_settime , +.Fn clock_getres , +and +.Fn clock_gettime_nsec_np +will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +.Fa clock_id +is not a valid value. +.It Bq Er EFAULT +The +.Fa tp +argument address referenced invalid memory. +.El +.Pp +In addition, +.Fn clock_settime +may return the following errors: +.Bl -tag -width Er +.It Bq Er EPERM +A user other than the superuser attempted to set the time. +.It Bq Er EINVAL +.Fa clock_id +specifies a clock that isn't settable, +.Fa tp +specifies a nanosecond value less than zero or greater than 1000 million, +or a value outside the range of the specified clock. +.El +.Sh SEE ALSO +.Xr date 1 , +.Xr getitimer 2 , +.Xr gettimeofday 2 , +.Sh HISTORY +These functions first appeared +in +Mac OSX 10.12 +.Sh STANDARDS +The +.Fn clock_gettime , +.Fn clock_settime , +and +.Fn clock_getres +system calls conform to +.St -p1003.1b-93 . +.Fn cleck_gettime_nsec_np +is a non-portable Darwin extension. +The clock IDs +.Fa CLOCK_MONOTONIC_RAW +and +.Fa CLOCK_UPTIME_RAW +are extensions to the POSIX interface. diff --git a/gen/clock_gettime.c b/gen/clock_gettime.c new file mode 100644 index 0000000..783a251 --- /dev/null +++ b/gen/clock_gettime.c @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2016 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern uint64_t __thread_selfusage(void); + +#define timeval2nsec(tv) (tv.tv_sec * NSEC_PER_SEC + tv.tv_usec * NSEC_PER_USEC) + +static uint64_t +_boottime_fallback_usec(void) +{ + struct timeval tv; + size_t len = sizeof(tv); + int ret = sysctlbyname("kern.boottime", &tv, &len, NULL, 0); + if (ret == -1) return 0; + return (uint64_t)tv.tv_sec * USEC_PER_SEC + (uint64_t)tv.tv_usec; +} + +static int +_mach_boottime_usec(uint64_t *boottime, struct timeval *realtime) +{ + uint64_t bt1 = 0, bt2 = 0; + int ret; + do { + bt1 = mach_boottime_usec(); + if (os_slowpath(bt1 == 0)) bt1 = _boottime_fallback_usec(); + + atomic_thread_fence(memory_order_seq_cst); + + ret = gettimeofday(realtime, NULL); + if (ret != 0) return ret; + + atomic_thread_fence(memory_order_seq_cst); + + bt2 = mach_boottime_usec(); + if (os_slowpath(bt2 == 0)) bt2 = _boottime_fallback_usec(); + } while (os_slowpath(bt1 != bt2)); + *boottime = bt1; + return 0; +} + +uint64_t +clock_gettime_nsec_np(clockid_t clock_id) +{ + switch(clock_id){ + case CLOCK_REALTIME: { + struct timeval tv; + int ret = gettimeofday(&tv, NULL); + if (ret) return 0; + return timeval2nsec(tv); + } + case CLOCK_MONOTONIC: { + struct timeval tv; + uint64_t boottime; + int ret = _mach_boottime_usec(&boottime, &tv); + if (ret) return 0; + boottime *= NSEC_PER_USEC; + return timeval2nsec(tv) - boottime; + } + case CLOCK_PROCESS_CPUTIME_ID: { + struct rusage ru; + int ret = getrusage(RUSAGE_SELF, &ru); + if (ret) return 0; + return timeval2nsec(ru.ru_utime) + timeval2nsec(ru.ru_stime); + } + default: + // calls that use mach_absolute_time units fall through into a common path + break; + } + + // Mach Absolute Time unit-based calls + mach_timebase_info_data_t tb_info; + if (mach_timebase_info(&tb_info)) return 0; + uint64_t mach_time; + + switch(clock_id){ + case CLOCK_MONOTONIC_RAW: + mach_time = mach_continuous_time(); + break; + case CLOCK_MONOTONIC_RAW_APPROX: + mach_time = mach_continuous_approximate_time(); + break; + case CLOCK_UPTIME_RAW: + mach_time = mach_absolute_time(); + break; + case CLOCK_UPTIME_RAW_APPROX: + mach_time = mach_approximate_time(); + break; + case CLOCK_THREAD_CPUTIME_ID: + mach_time = __thread_selfusage(); + break; + default: + errno = EINVAL; + return 0; + } + + return (mach_time * tb_info.numer) / tb_info.denom; +} + +int +clock_gettime(clockid_t clk_id, struct timespec *tp) +{ + switch(clk_id){ + case CLOCK_REALTIME: { + struct timeval tv; + int ret = gettimeofday(&tv, NULL); + TIMEVAL_TO_TIMESPEC(&tv, tp); + return ret; + } + case CLOCK_MONOTONIC: { + struct timeval tv; + uint64_t boottime_usec; + int ret = _mach_boottime_usec(&boottime_usec, &tv); + struct timeval boottime = { + .tv_sec = boottime_usec / USEC_PER_SEC, + .tv_usec = boottime_usec % USEC_PER_SEC + }; + timersub(&tv, &boottime, &tv); + TIMEVAL_TO_TIMESPEC(&tv, tp); + return ret; + } + case CLOCK_PROCESS_CPUTIME_ID: { + struct rusage ru; + int ret = getrusage(RUSAGE_SELF, &ru); + timeradd(&ru.ru_utime, &ru.ru_stime, &ru.ru_utime); + TIMEVAL_TO_TIMESPEC(&ru.ru_utime, tp); + return ret; + } + case CLOCK_MONOTONIC_RAW: + case CLOCK_MONOTONIC_RAW_APPROX: + case CLOCK_UPTIME_RAW: + case CLOCK_UPTIME_RAW_APPROX: + case CLOCK_THREAD_CPUTIME_ID: { + uint64_t ns = clock_gettime_nsec_np(clk_id); + if (!ns) return -1; + + tp->tv_sec = ns/NSEC_PER_SEC; + tp->tv_nsec = ns % NSEC_PER_SEC; + return 0; + } + default: + errno = EINVAL; + return -1; + } +} + +int +clock_getres(clockid_t clk_id, struct timespec *res) +{ + switch(clk_id){ + case CLOCK_REALTIME: + case CLOCK_MONOTONIC: + case CLOCK_PROCESS_CPUTIME_ID: + res->tv_nsec = NSEC_PER_USEC; + res->tv_sec = 0; + return 0; + + case CLOCK_MONOTONIC_RAW: + case CLOCK_MONOTONIC_RAW_APPROX: + case CLOCK_UPTIME_RAW: + case CLOCK_UPTIME_RAW_APPROX: + case CLOCK_THREAD_CPUTIME_ID: { + mach_timebase_info_data_t tb_info; + if (mach_timebase_info(&tb_info)){ + return -1; + } + res->tv_nsec = tb_info.numer / tb_info.denom + (tb_info.numer % tb_info.denom != 0); + res->tv_sec = 0; + return 0; + } + + default: + errno = EINVAL; + return -1; + } +} + +int +clock_settime(clockid_t clk_id, const struct timespec *tp) +{ + switch(clk_id){ + case CLOCK_REALTIME: { + struct timeval tv = { + .tv_sec = (time_t)tp->tv_sec, + .tv_usec = (suseconds_t)(tp->tv_nsec / NSEC_PER_USEC) + }; + return settimeofday(&tv, NULL); + } + default: + errno = EINVAL; + return -1; + } +} diff --git a/gen/compat.5 b/gen/compat.5 new file mode 100644 index 0000000..b711c04 --- /dev/null +++ b/gen/compat.5 @@ -0,0 +1,190 @@ +.Dd June 30, 2010 +.Os Darwin +.Dt COMPAT 5 +.Sh NAME +.Nm compat +.Nd manipulate compatibility settings +.Sh SYNOPSIS +.Ev COMMAND_MODE=legacy|unix2003 +.Lp +.Fd #define _POSIX_C_SOURCE +.Fd #define _DARWIN_C_SOURCE +.Fd #define _NONSTD_SOURCE +.Fd defined(__LP64__) +.Lp +.In sys/cdefs.h +.Fd defined(_DARWIN_FEATURE_UNIX_CONFORMANCE) +.Sh DESCRIPTION +Setting the environment variable +.Ev COMMAND_MODE +to the value legacy causes utility programs to behave as closely to +Mac OS X 10.3's utility programs as possible. When in this mode all of 10.3's +flags are accepted, and in some cases extra flags are accepted, but no flags +that were used in 10.3 will have been removed or changed in meaning. Any +behavioral changes in this mode are documented in the LEGACY sections of the +individual utilities. +.Pp +Setting the environment variable +.Ev COMMAND_MODE +to the value unix2003 causes utility programs to obey the +.St -susv3 +standards even if doing so would alter the behavior of flags used in 10.3. +.Pp +The value of +.Ev COMMAND_MODE +is case insensitive and if it is unset or set to something other than legacy +or unix2003 it behaves as if it were set to unix2003. +.Sh COMPILATION +Defining +.Dv _NONSTD_SOURCE +for i386 causes library and kernel calls to behave as closely to Mac +OS X 10.3's library and kernel calls as possible. Any behavioral changes are +documented in the LEGACY sections of the man pages for the individual function +calls. Defining this macro when compiling for any other architecture will +result in a compilation error. +.Pp +Defining +.Dv _POSIX_C_SOURCE +or +.Dv _DARWIN_C_SOURCE +causes library and kernel calls to conform to the SUSv3 +standards even if doing so would alter the behavior of functions used in 10.3. +Defining +.Dv _POSIX_C_SOURCE +also removes functions, types, and other interfaces that are not part of SUSv3 +from the normal C namespace, unless +.Dv _DARWIN_C_SOURCE +is also defined (i.e., +.Dv _DARWIN_C_SOURCE +is +.Dv _POSIX_C_SOURCE +with non-POSIX extensions). +In any of these cases, the +.Dv _DARWIN_FEATURE_UNIX_CONFORMANCE +feature macro will be defined to the SUS conformance level (it is undefined +otherwise). +.Pp +Starting in Mac OS X 10.5, if none of the macros +.Dv _NONSTD_SOURCE , +.Dv _POSIX_C_SOURCE +or +.Dv _DARWIN_C_SOURCE +are defined, and the environment variable +.Ev MACOSX_DEPLOYMENT_TARGET +is either undefined or set to 10.5 or greater (or equivalently, the +.Xr gcc 1 +option +.Fl mmacosx-version-min +is either not specified or set to 10.5 or greater), then UNIX conformance will +be on by default, and non-POSIX extensions will also be available +(this is the equivalent of defining +.Dv _DARWIN_C_SOURCE ) . +For version values less that 10.5, UNIX conformance will be off when targeting +i386 (the equivalent of defining +.Dv _NONSTD_SOURCE ) . +.Pp +In order to provide both legacy and conformance versions of functions, two +versions of affected functions are provided. Legacy variants have symbol names +with no suffix in order to maintain ABI compatibility. Conformance versions +have a $UNIX2003 suffix appended to their symbol name. These $UNIX2003 +suffixes are automatically appended by the compiler tool-chain and should not +be used directly. +.Pp +Platforms that were released after these updates only have conformance variants +available and do not have a $UNIX2003 suffix. +.Pp +.TS +center; +c s s s s +c c | c c c +c c | c c c +l c | c c c +l c | c c c +l c | c c c +l c | c c c +l c | c c c +l c | c c c +l c | c c c. +T{ +.Dv i386 +T} += +user defines deployment namespace conformance suffix + target +_ +T{ +.Em (none) +T} < 10.5 full 10.3 compatibility (none) +T{ +.Em (none) +T} >= 10.5 full SUSv3 conformance $UNIX2003 +T{ +.Em _NONSTD_SOURCE +T} (any) full 10.3 compatibility (none) +T{ +.Em _DARWIN_C_SOURCE +T} < 10.4 full 10.3 compatibility (none) +T{ +.Em _DARWIN_C_SOURCE +T} >= 10.4 full SUSv3 conformance $UNIX2003 +T{ +.Em _POSIX_C_SOURCE +T} < 10.4 strict 10.3 compatibility (none) +T{ +.Em _POSIX_C_SOURCE +T} >= 10.4 strict SUSv3 conformance $UNIX2003 +_ +.T& +c s s s s +c c | c c c +c c | c c c +l c | c c c +l c | c s s +l c | c c c +l c | c c c. +T{ +.Dv Newer Architectures +T} += +user defines deployment namespace conformance suffix + target +_ +T{ +.Em (none) +T} (any) full SUSv3 conformance (none) +T{ +.Em _NONSTD_SOURCE +T} (any) (error) +T{ +.Em _DARWIN_C_SOURCE +T} (any) full SUSv3 conformance (none) +T{ +.Em _POSIX_C_SOURCE +T} (any) strict SUSv3 conformance (none) +_ +.TE +.Sh STANDARDS +With COMMAND_MODE set to anything other than legacy, utility functions conform to +.St -susv3 . +.Pp +With +.Dv _POSIX_C_SOURCE +or +.Dv _DARWIN_C_SOURCE +for i386, or when building for any other architecture, +system and library calls conform to +.St -susv3 . +.Sh BUGS +Different parts of a program can be compiled with different compatibility +settings. +The resultant program will normally work as expected, for example a regex +created by the SUSv3 +.Fn regcomp 3 +can be passed to the legacy +.Fn regfree 3 +with no unexpected results. Some cases are less clear cut, for example +what does the programmer intend when they use the SUSv3 +.Fn regcomp 3 +to compile a regex, but the legacy +.Fn regexec 3 +to execute it? Any interpretation will surprise someone. diff --git a/gen/confstr.3 b/gen/confstr.3 new file mode 100644 index 0000000..4ea7c12 --- /dev/null +++ b/gen/confstr.3 @@ -0,0 +1,179 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)confstr.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/confstr.3,v 1.11 2001/10/01 16:08:50 ru Exp $ +.\" +.Dd June 18, 2001 +.Dt CONFSTR 3 +.Os +.Sh NAME +.Nm confstr +.Nd get string-valued configurable variables +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft size_t +.Fn confstr "int name" "char *buf" "size_t len" +.Sh DESCRIPTION +This interface is specified by +.\" .St -p1003.1-200x . +.Tn POSIX . +A more flexible (but non-portable) interface is provided by +.Xr sysctl 3 . +.Pp +The +.Fn confstr +function provides a method for applications to get configuration +defined string values. +Shell programmers needing access to these parameters should use the +.Xr getconf 1 +utility. +.Pp +The +.Fa name +argument specifies the system variable to be queried. +Symbolic constants for each name value are found in the include file +.Aq Pa unistd.h . +The +.Fa len +argument specifies the size of the buffer referenced by the +argument +.Fa buf . +If +.Fa len +is non-zero, +.Fa buf +is a non-null pointer, and +.Fa name +has a value, up to +.Fa len +\- 1 bytes of the value are copied into the buffer +.Fa buf . +The copied value is always null terminated. +.Pp +The available values are as follows: +.Pp +.Bl -tag -width 6n +.Pp +.It Li _CS_DARWIN_USER_DIR +Provides the path to a user's folder. The directory will be created if it +does not already exist. +.Pp +This directory is created with access permissions of 0755 and restricted by +the +.Xr umask 2 +of the calling process and is not intended to be used for +sensitive or temporary file storage, as all users can see files created here. +If the user's umask allows it, files created here will be world readable, +which could lead to information disclosure. +.Pp +.It Li _CS_DARWIN_USER_TEMP_DIR +Provides the path to a user's temporary items directory. The directory will be +created it if does not already exist. This directory is created with access +permissions of 0700 and restricted by the +.Xr umask 2 +of the calling process and is a good location for temporary files. +.Pp +By default, files in this location may be cleaned (removed) by the system if +they are not accessed in 3 days. +.Pp +.It Li _CS_DARWIN_USER_CACHE_DIR +Provides the path to the user's cache directory. The directory will be created +if it does not already exist. This directory is created with access permissions +of 0700 and restricted by the +.Xr umask 2 +of the calling process and is a good location for user cache data as it will not +be automatically cleaned by the system. +.Pp +Files in this location will be removed during safe boot. +.Pp +.It Li _CS_PATH +Return a value for the +.Ev PATH +environment variable that finds all the standard utilities. +.El +.Sh RETURN VALUES +If the call to +.Fn confstr +is not successful, 0 is returned and +.Va errno +is set appropriately. +Otherwise, if the variable does not have a configuration defined value, +0 is returned and +.Va errno +is not modified. +Otherwise, the buffer size needed to hold the entire configuration-defined +value is returned. +If this size is greater than the argument +.Fa len , +the string in +.Fa buf +was truncated. +.Sh ERRORS +The +.Fn confstr +function may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr malloc 3 +and +.Xr sysctl 3 . +.Pp +In addition, the following errors may be reported: +.Bl -tag -width Er +.It Bq Er EINVAL +The value of the +.Fa name +argument is invalid. +.It Bq Er ENOMEM +Insufficient storage space is available. +.It Bq Er EIO +I/O error communicating with +.Xr dirhelper 8 . +.El +.Sh LEGACY ERRORS +If the call to +.Fn confstr +is not successful, \-1 (rather than 0) is returned and +.Va errno +is set appropriately. +.Sh SEE ALSO +.Xr getconf 1 , +.Xr pathconf 2 , +.Xr sysconf 3 , +.Xr sysctl 3 +.Sh HISTORY +The +.Fn confstr +function first appeared in +.Bx 4.4 . diff --git a/gen/confstr.c b/gen/confstr.c new file mode 100644 index 0000000..a7f9613 --- /dev/null +++ b/gen/confstr.c @@ -0,0 +1,264 @@ +/* + * Copyright (c) 1999, 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include + +#include +#include +#include +#include +#include +#include /* for P_tmpdir */ + +#ifndef __has_include +#include +#else +#if __has_include() +#include +#else +typedef enum { + DIRHELPER_USER_LOCAL = 0, + DIRHELPER_USER_LOCAL_TEMP, + DIRHELPER_USER_LOCAL_CACHE, + DIRHELPER_USER_LOCAL_LAST = DIRHELPER_USER_LOCAL_CACHE +} dirhelper_which_t; +#endif +#endif + +#include "libc_private.h" + +#if __DARWIN_UNIX03 +static char *(*__dirhelper_func)(int, char *, size_t); + +__attribute__((__visibility__("hidden"))) +void +__confstr_init(const struct _libc_functions *funcs) +{ + __dirhelper_func = funcs->dirhelper; +} + +__attribute__((__visibility__("hidden"))) +char * +__dirhelper(dirhelper_which_t which, char *path, size_t pathlen) +{ + if (__dirhelper_func) { + return __dirhelper_func(which, path, pathlen); + } else { + return NULL; + } +} +#else // !__DARWIN_UNIX03 +__attribute__((__visibility__("hidden"))) +char *__dirhelper(dirhelper_which_t which, char *path, size_t pathlen); +#endif // !__DARWIN_UNIX03 + +#if __DARWIN_UNIX03 +#define CONFSTR_ERR_RET 0 +#else /* !__DARWIN_UNIX03 */ +#define CONFSTR_ERR_RET -1 +#endif /* __DARWIN_UNIX03 */ + +size_t +confstr(name, buf, len) + int name; + char *buf; + size_t len; +{ + size_t tlen; + int mib[2], sverrno; + char *p; + + switch (name) { + case _CS_PATH: + mib[0] = CTL_USER; + mib[1] = USER_CS_PATH; + if (sysctl(mib, 2, NULL, &tlen, NULL, 0) == -1) + return (CONFSTR_ERR_RET); + if (len != 0 && buf != NULL) { + if ((p = malloc(tlen)) == NULL) + return (CONFSTR_ERR_RET); + if (sysctl(mib, 2, p, &tlen, NULL, 0) == -1) { + sverrno = errno; + free(p); + errno = sverrno; + return (CONFSTR_ERR_RET); + } + /* + * POSIX 1003.2 requires partial return of + * the string -- that should be *real* useful. + */ + (void)strncpy(buf, p, len - 1); + buf[len - 1] = '\0'; + free(p); + } + return (tlen); + + case _CS_POSIX_V6_ILP32_OFF32_CFLAGS: + case _CS_XBS5_ILP32_OFF32_CFLAGS: /* legacy */ + + case _CS_POSIX_V6_ILP32_OFF32_LDFLAGS: + case _CS_XBS5_ILP32_OFF32_LDFLAGS: /* legacy */ + + case _CS_POSIX_V6_ILP32_OFF32_LIBS: + case _CS_XBS5_ILP32_OFF32_LIBS: /* legacy */ + + case _CS_XBS5_ILP32_OFF32_LINTFLAGS: /* legacy */ + + case _CS_POSIX_V6_ILP32_OFFBIG_LIBS: + case _CS_XBS5_ILP32_OFFBIG_LIBS: /* legacy */ + + case _CS_XBS5_ILP32_OFFBIG_LINTFLAGS: /* legacy */ + + case _CS_POSIX_V6_LP64_OFF64_LIBS: + case _CS_XBS5_LP64_OFF64_LIBS: /* legacy */ + + case _CS_XBS5_LP64_OFF64_LINTFLAGS: /* legacy */ + + case _CS_POSIX_V6_LPBIG_OFFBIG_LIBS: + case _CS_XBS5_LPBIG_OFFBIG_LIBS: /* legacy */ + + case _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS: /* legacy */ + /* No special flags... yet */ + p = ""; + goto docopy; + + case _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS: + case _CS_XBS5_ILP32_OFFBIG_CFLAGS: /* legacy */ + + case _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS: + case _CS_XBS5_ILP32_OFFBIG_LDFLAGS: /* legacy */ + p = "-W 32"; + goto docopy; + + case _CS_POSIX_V6_LP64_OFF64_CFLAGS: + case _CS_XBS5_LP64_OFF64_CFLAGS: /* legacy */ + + case _CS_POSIX_V6_LP64_OFF64_LDFLAGS: + case _CS_XBS5_LP64_OFF64_LDFLAGS: /* legacy */ + + case _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: + case _CS_XBS5_LPBIG_OFFBIG_CFLAGS: /* legacy */ + + case _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: + case _CS_XBS5_LPBIG_OFFBIG_LDFLAGS: /* legacy */ + p = "-W 64"; + goto docopy; + + case _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS: + if (sizeof(long) >= 8) + p = "_POSIX_V6_LP64_OFF64"; + else + p = "_POSIX_V6_ILP32_OFFBIG"; + +docopy: + if (len != 0 && buf != NULL) + strlcpy(buf, p, len); + return (strlen(p) + 1); + + case _CS_DARWIN_USER_DIR: + if ((p = alloca(PATH_MAX)) == NULL) { + errno = ENOMEM; + return (CONFSTR_ERR_RET); + } + if (__dirhelper(DIRHELPER_USER_LOCAL, p, PATH_MAX) == NULL) { + if (errno != ENOMEM) + errno = EIO; + return (CONFSTR_ERR_RET); + } + goto docopy; + + case _CS_DARWIN_USER_TEMP_DIR: + if ((p = alloca(PATH_MAX)) == NULL) { + errno = ENOMEM; + return (CONFSTR_ERR_RET); + } + if (__dirhelper(DIRHELPER_USER_LOCAL_TEMP, p, PATH_MAX) == NULL) { + int dh_errno = errno; + /* + * If __dirhelper() fails, try TMPDIR and P_tmpdir, + * finally failing otherwise. + */ + if ((p = getenv("TMPDIR")) && access(p, W_OK) == 0) + goto docopy; + if (access(p = P_tmpdir, W_OK) == 0) + goto docopy; + if (dh_errno == ENOMEM) + errno = ENOMEM; + else + errno = EIO; + return (CONFSTR_ERR_RET); + } + goto docopy; + + case _CS_DARWIN_USER_CACHE_DIR: + if ((p = alloca(PATH_MAX)) == NULL) { + errno = ENOMEM; + return (CONFSTR_ERR_RET); + } + if (__dirhelper(DIRHELPER_USER_LOCAL_CACHE, p, PATH_MAX) == NULL) { + if (errno != ENOMEM) + errno = EIO; + return (CONFSTR_ERR_RET); + } + goto docopy; + + default: + errno = EINVAL; + return (0); + } + /* NOTREACHED */ +} diff --git a/gen/crypt.3 b/gen/crypt.3 new file mode 100644 index 0000000..e307144 --- /dev/null +++ b/gen/crypt.3 @@ -0,0 +1,237 @@ +.\" $OpenBSD: crypt.3,v 1.5 1996/12/10 09:06:09 deraadt Exp $ +.\" +.\" FreeSec: libcrypt +.\" +.\" Copyright (c) 1994 David Burren +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the author nor the names of other contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" Manual page, using -mandoc macros +.\" +.Dd March 9, 1994 +.Dt CRYPT 3 +.Os "FreeSec 1.0" +.Sh NAME +.Nm crypt , +.Nm encrypt , +.Nm setkey +.Nd DES encryption +.Sh SYNOPSIS +.Fd #include +.Ft char * +.Fo crypt +.Fa "const char *key" +.Fa "const char *salt" +.Fc +.Ft void +.Fo encrypt +.Fa "char *block" +.Fa "int edflag" +.Fc +.Fd #include +.Ft void +.Fo setkey +.Fa "const char *key" +.Fc +.Sh DESCRIPTION +The +.Fn crypt +function performs password encryption, based on the +.Tn NBS +Data Encryption Standard (DES). +Additional code has been added to deter key search attempts. +The first argument to +.Fn crypt +is a +.Dv null Ns -terminated +string, typically a user's typed password. +The second is in one of two forms: +if it begins with an underscore (``_''), an extended format is used +in interpreting both the key and the salt value, as outlined below. +.Ss Extended crypt: +.Pp +The +.Ar key +is divided into groups of 8 characters (the last group is null-padded) +and the low-order 7 bits of each each character (56 bits per group) are +used to form the DES key as follows: +the first group of 56 bits becomes the initial DES key. +For each additional group, the XOR of the encryption of the current DES +key with itself and the group bits becomes the next DES key. +.Pp +The +.Ar salt +is a 9-character array consisting of an underscore, followed +by 4 bytes of iteration count and 4 bytes of salt. +These are encoded as printable characters, 6 bits per character, +least significant character first. +The values 0 to 63 are encoded as ``./0-9A-Za-z''. +This allows 24 bits for both +.Fa count +and +.Fa salt . +.Ss "Traditional" crypt: +.Pp +The first 8 bytes of the key are null-padded, and the low-order 7 bits of +each character is used to form the 56-bit +.Tn DES +key. +.Pp +The +.Fa salt +is a 2-character array of the ASCII-encoded salt. +Thus, only 12 bits of salt are used. +.Fa count +is set to 25. +.Ss Algorithm: +.Pp +The +.Fa salt +introduces disorder in the +.Tn DES +algorithm in one of 16777216 or 4096 possible ways +(ie. with 24 or 12 bits: if bit +.Em i +of the +.Ar salt +is set, then bits +.Em i +and +.Em i+24 +are swapped in the +.Tn DES +E-box output). +.Pp +The DES key is used to encrypt a 64-bit constant, using +.Ar count +iterations of +.Tn DES . +The value returned is a +.Dv null Ns -terminated +string, 20 or 13 bytes (plus null) in length, consisting of the +.Ar salt , +followed by the encoded 64-bit encryption. +.Pp +The functions, +.Fn encrypt +and +.Fn setkey +provide access to the +.Tn DES +algorithm itself. +.Fn setkey +is passed a 64-byte array of binary values (numeric 0 or 1). +A 56-bit key is extracted from this array by dividing the +array into groups of 8 and ignoring the last bit in each group. +That bit is reserved for a byte parity check by DES, but is ignored +by these functions. +.Pp +The +.Fa block +argument to +.Fn encrypt +is also a 64-byte array of binary values. +If the value of +.Fa edflag +is 0, +.Fa block +is encrypted; otherwise, it is decrypted. +The result is returned in the original array +.Fa block , +after using the key specified by +.Fn setkey +to process it. +.Pp +The function +.Fn crypt +returns a pointer to the encrypted value on success, and NULL on failure. +.Pp +The +.Fn crypt +and +.Fn setkey +functions all manipulate the same key space. +.Sh SEE ALSO +.Xr login 1 , +.Xr passwd 1 , +.Xr getpass 3 , +.Xr compat 5 , +.Xr passwd 5 +.Sh LEGACY SYNOPSIS +.Fd #include +.Pp +.Ft int +.br +.Fo encrypt +.Fa "char *block" +.Fa "int edflag" +.Fc ; +.Pp +The function +.Fn encrypt +returns 0 on success and 1 on failure. +.Pp +.Ft void +.br +.Fo setkey +.Fa "const char *key" +.Fc ; +.Pp +The include file +.In unistd.h +is necessary and sufficient for the +.Fn setkey +function. +.Sh BUGS +The +.Fn crypt +function returns a pointer to static data, and subsequent calls to +.Fn crypt +will modify the same object. +.Sh HISTORY +A rotor-based +.Fn crypt +function appeared in +.At v6 . +The current style +.Fn crypt +first appeared in +.At v7 . +.Pp +This library (FreeSec 1.0) was developed outside the United States of America +as an unencumbered replacement for the U.S.-only libcrypt encryption +library. +Programs linked against the +.Fn crypt +interface may be exported from the U.S.A. only if they use +.Fn crypt +solely for authentication purposes and avoid use of +the other programmer interfaces listed above. Special care has been taken +in the library so that programs which only use the +.Fn crypt +interface do not pull in the other components. +.Sh AUTHOR +David Burren diff --git a/gen/crypt.c b/gen/crypt.c new file mode 100644 index 0000000..ef2c601 --- /dev/null +++ b/gen/crypt.c @@ -0,0 +1,1050 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Tom Truscott. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#include +#include +#include +#include +#include +#include + +/* + * UNIX password, and DES, encryption. + * By Tom Truscott, trt@rti.rti.org, + * from algorithms by Robert W. Baldwin and James Gillogly. + * + * References: + * "Mathematical Cryptology for Computer Scientists and Mathematicians," + * by Wayne Patterson, 1987, ISBN 0-8476-7438-X. + * + * "Password Security: A Case History," R. Morris and Ken Thompson, + * Communications of the ACM, vol. 22, pp. 594-597, Nov. 1979. + * + * "DES will be Totally Insecure within Ten Years," M.E. Hellman, + * IEEE Spectrum, vol. 16, pp. 32-39, July 1979. + */ + +/* ===== Configuration ==================== */ + +/* + * define "MUST_ALIGN" if your compiler cannot load/store + * long integers at arbitrary (e.g. odd) memory locations. + * (Either that or never pass unaligned addresses to __crypt_des_cipher!) + */ +#if !defined(vax) +#define MUST_ALIGN +#endif + +#ifdef CHAR_BITS +#if CHAR_BITS != 8 + #error C_block structure assumes 8 bit characters +#endif +#endif + +/* + * define "LONG_IS_32_BITS" only if sizeof(long)==4. + * This avoids use of bit fields (your compiler may be sloppy with them). + */ +#if !defined(cray) && (LONG_BIT == 32) +#define LONG_IS_32_BITS +#endif + +/* + * define "B64" to be the declaration for a 64 bit integer. + * XXX this feature is currently unused, see "endian" comment below. + */ +#if defined(cray) +#define B64 long +#endif +#if defined(convex) +#define B64 long long +#endif + +/* + * define "LARGEDATA" to get faster permutations, by using about 72 kilobytes + * of lookup tables. This speeds up __crypt_des_setkey() and __crypt_des_cipher(), but has + * little effect on crypt(). + */ +#if defined(notdef) +#define LARGEDATA +#endif + +/* compile with "-DSTATIC=int" when profiling */ +#ifndef STATIC +#define STATIC static +#endif +#ifndef BUILDING_VARIANT +STATIC void init_des(), init_perm(), permute(); +#ifdef DEBUG +#include +STATIC void prtab(); +#endif +#endif /* BUILDING_VARIANT */ +__private_extern__ int __crypt_des_cipher(), __crypt_des_setkey(); + +/* ==================================== */ + +/* + * Cipher-block representation (Bob Baldwin): + * + * DES operates on groups of 64 bits, numbered 1..64 (sigh). One + * representation is to store one bit per byte in an array of bytes. Bit N of + * the NBS spec is stored as the LSB of the Nth byte (index N-1) in the array. + * Another representation stores the 64 bits in 8 bytes, with bits 1..8 in the + * first byte, 9..16 in the second, and so on. The DES spec apparently has + * bit 1 in the MSB of the first byte, but that is particularly noxious so we + * bit-reverse each byte so that bit 1 is the LSB of the first byte, bit 8 is + * the MSB of the first byte. Specifically, the 64-bit input data and key are + * converted to LSB format, and the output 64-bit block is converted back into + * MSB format. + * + * DES operates internally on groups of 32 bits which are expanded to 48 bits + * by permutation E and shrunk back to 32 bits by the S boxes. To speed up + * the computation, the expansion is applied only once, the expanded + * representation is maintained during the encryption, and a compression + * permutation is applied only at the end. To speed up the S-box lookups, + * the 48 bits are maintained as eight 6 bit groups, one per byte, which + * directly feed the eight S-boxes. Within each byte, the 6 bits are the + * most significant ones. The low two bits of each byte are zero. (Thus, + * bit 1 of the 48 bit E expansion is stored as the "4"-valued bit of the + * first byte in the eight byte representation, bit 2 of the 48 bit value is + * the "8"-valued bit, and so on.) In fact, a combined "SPE"-box lookup is + * used, in which the output is the 64 bit result of an S-box lookup which + * has been permuted by P and expanded by E, and is ready for use in the next + * iteration. Two 32-bit wide tables, SPE[0] and SPE[1], are used for this + * lookup. Since each byte in the 48 bit path is a multiple of four, indexed + * lookup of SPE[0] and SPE[1] is simple and fast. The key schedule and + * "salt" are also converted to this 8*(6+2) format. The SPE table size is + * 8*64*8 = 4K bytes. + * + * To speed up bit-parallel operations (such as XOR), the 8 byte + * representation is "union"ed with 32 bit values "i0" and "i1", and, on + * machines which support it, a 64 bit value "b64". This data structure, + * "C_block", has two problems. First, alignment restrictions must be + * honored. Second, the byte-order (e.g. little-endian or big-endian) of + * the architecture becomes visible. + * + * The byte-order problem is unfortunate, since on the one hand it is good + * to have a machine-independent C_block representation (bits 1..8 in the + * first byte, etc.), and on the other hand it is good for the LSB of the + * first byte to be the LSB of i0. We cannot have both these things, so we + * currently use the "little-endian" representation and avoid any multi-byte + * operations that depend on byte order. This largely precludes use of the + * 64-bit datatype since the relative order of i0 and i1 are unknown. It + * also inhibits grouping the SPE table to look up 12 bits at a time. (The + * 12 bits can be stored in a 16-bit field with 3 low-order zeroes and 1 + * high-order zero, providing fast indexing into a 64-bit wide SPE.) On the + * other hand, 64-bit datatypes are currently rare, and a 12-bit SPE lookup + * requires a 128 kilobyte table, so perhaps this is not a big loss. + * + * Permutation representation (Jim Gillogly): + * + * A transformation is defined by its effect on each of the 8 bytes of the + * 64-bit input. For each byte we give a 64-bit output that has the bits in + * the input distributed appropriately. The transformation is then the OR + * of the 8 sets of 64-bits. This uses 8*256*8 = 16K bytes of storage for + * each transformation. Unless LARGEDATA is defined, however, a more compact + * table is used which looks up 16 4-bit "chunks" rather than 8 8-bit chunks. + * The smaller table uses 16*16*8 = 2K bytes for each transformation. This + * is slower but tolerable, particularly for password encryption in which + * the SPE transformation is iterated many times. The small tables total 9K + * bytes, the large tables total 72K bytes. + * + * The transformations used are: + * IE3264: MSB->LSB conversion, initial permutation, and expansion. + * This is done by collecting the 32 even-numbered bits and applying + * a 32->64 bit transformation, and then collecting the 32 odd-numbered + * bits and applying the same transformation. Since there are only + * 32 input bits, the IE3264 transformation table is half the size of + * the usual table. + * CF6464: Compression, final permutation, and LSB->MSB conversion. + * This is done by two trivial 48->32 bit compressions to obtain + * a 64-bit block (the bit numbering is given in the "CIFP" table) + * followed by a 64->64 bit "cleanup" transformation. (It would + * be possible to group the bits in the 64-bit block so that 2 + * identical 32->32 bit transformations could be used instead, + * saving a factor of 4 in space and possibly 2 in time, but + * byte-ordering and other complications rear their ugly head. + * Similar opportunities/problems arise in the key schedule + * transforms.) + * PC1ROT: MSB->LSB, PC1 permutation, rotate, and PC2 permutation. + * This admittedly baroque 64->64 bit transformation is used to + * produce the first code (in 8*(6+2) format) of the key schedule. + * PC2ROT[0]: Inverse PC2 permutation, rotate, and PC2 permutation. + * It would be possible to define 15 more transformations, each + * with a different rotation, to generate the entire key schedule. + * To save space, however, we instead permute each code into the + * next by using a transformation that "undoes" the PC2 permutation, + * rotates the code, and then applies PC2. Unfortunately, PC2 + * transforms 56 bits into 48 bits, dropping 8 bits, so PC2 is not + * invertible. We get around that problem by using a modified PC2 + * which retains the 8 otherwise-lost bits in the unused low-order + * bits of each byte. The low-order bits are cleared when the + * codes are stored into the key schedule. + * PC2ROT[1]: Same as PC2ROT[0], but with two rotations. + * This is faster than applying PC2ROT[0] twice, + * + * The Bell Labs "salt" (Bob Baldwin): + * + * The salting is a simple permutation applied to the 48-bit result of E. + * Specifically, if bit i (1 <= i <= 24) of the salt is set then bits i and + * i+24 of the result are swapped. The salt is thus a 24 bit number, with + * 16777216 possible values. (The original salt was 12 bits and could not + * swap bits 13..24 with 36..48.) + * + * It is possible, but ugly, to warp the SPE table to account for the salt + * permutation. Fortunately, the conditional bit swapping requires only + * about four machine instructions and can be done on-the-fly with about an + * 8% performance penalty. + */ + +typedef union { + unsigned char b[8]; + struct { +#if defined(LONG_IS_32_BITS) + /* long is often faster than a 32-bit bit field */ + long i0; + long i1; +#else + long i0: 32; + long i1: 32; +#endif + } b32; +#if defined(B64) + B64 b64; +#endif +} C_block; + +/* + * Convert twenty-four-bit long in host-order + * to six bits (and 2 low-order zeroes) per char little-endian format. + */ +#define TO_SIX_BIT(rslt, src) { \ + C_block cvt; \ + cvt.b[0] = src; src >>= 6; \ + cvt.b[1] = src; src >>= 6; \ + cvt.b[2] = src; src >>= 6; \ + cvt.b[3] = src; \ + rslt = (cvt.b32.i0 & 0x3f3f3f3fL) << 2; \ + } + +/* + * These macros may someday permit efficient use of 64-bit integers. + */ +#define ZERO(d,d0,d1) d0 = 0, d1 = 0 +#define LOAD(d,d0,d1,bl) d0 = (bl).b32.i0, d1 = (bl).b32.i1 +#define LOADREG(d,d0,d1,s,s0,s1) d0 = s0, d1 = s1 +#define OR(d,d0,d1,bl) d0 |= (bl).b32.i0, d1 |= (bl).b32.i1 +#define STORE(s,s0,s1,bl) (bl).b32.i0 = s0, (bl).b32.i1 = s1 +#define DCL_BLOCK(d,d0,d1) long d0, d1 + +#if defined(LARGEDATA) + /* Waste memory like crazy. Also, do permutations in line */ +#define LGCHUNKBITS 3 +#define CHUNKBITS (1<>4]; OR(D,D0,D1,*tp); p += (1< 0); + STORE(D,D0,D1,*out); +} +#endif /* BUILDING_VARIANT */ +#endif /* LARGEDATA */ + +#ifndef BUILDING_VARIANT +__private_extern__ int __crypt_des_setkey_called = 0; +#else /* BUILDING_VARIANT */ +extern int __crypt_des_setkey_called; +#endif /* BUILDING_VARIANT */ + +/* ===== (mostly) Standard DES Tables ==================== */ + +#ifndef BUILDING_VARIANT +static const unsigned char IP[] = { /* initial permutation */ + 58, 50, 42, 34, 26, 18, 10, 2, + 60, 52, 44, 36, 28, 20, 12, 4, + 62, 54, 46, 38, 30, 22, 14, 6, + 64, 56, 48, 40, 32, 24, 16, 8, + 57, 49, 41, 33, 25, 17, 9, 1, + 59, 51, 43, 35, 27, 19, 11, 3, + 61, 53, 45, 37, 29, 21, 13, 5, + 63, 55, 47, 39, 31, 23, 15, 7, +}; + +/* The final permutation is the inverse of IP - no table is necessary */ + +static const unsigned char ExpandTr[] = { /* expansion operation */ + 32, 1, 2, 3, 4, 5, + 4, 5, 6, 7, 8, 9, + 8, 9, 10, 11, 12, 13, + 12, 13, 14, 15, 16, 17, + 16, 17, 18, 19, 20, 21, + 20, 21, 22, 23, 24, 25, + 24, 25, 26, 27, 28, 29, + 28, 29, 30, 31, 32, 1, +}; + +static const unsigned char PC1[] = { /* permuted choice table 1 */ + 57, 49, 41, 33, 25, 17, 9, + 1, 58, 50, 42, 34, 26, 18, + 10, 2, 59, 51, 43, 35, 27, + 19, 11, 3, 60, 52, 44, 36, + + 63, 55, 47, 39, 31, 23, 15, + 7, 62, 54, 46, 38, 30, 22, + 14, 6, 61, 53, 45, 37, 29, + 21, 13, 5, 28, 20, 12, 4, +}; + +static const unsigned char Rotates[] = { /* PC1 rotation schedule */ + 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, +}; + +/* note: each "row" of PC2 is left-padded with bits that make it invertible */ +static const unsigned char PC2[] = { /* permuted choice table 2 */ + 9, 18, 14, 17, 11, 24, 1, 5, + 22, 25, 3, 28, 15, 6, 21, 10, + 35, 38, 23, 19, 12, 4, 26, 8, + 43, 54, 16, 7, 27, 20, 13, 2, + + 0, 0, 41, 52, 31, 37, 47, 55, + 0, 0, 30, 40, 51, 45, 33, 48, + 0, 0, 44, 49, 39, 56, 34, 53, + 0, 0, 46, 42, 50, 36, 29, 32, +}; + +static const unsigned char S[8][64] = { /* 48->32 bit substitution tables */ + { /* S[1] */ + 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, + 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8, + 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0, + 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13, + }, + { /* S[2] */ + 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, + 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5, + 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15, + 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9, + }, + { /* S[3] */ + 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, + 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1, + 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7, + 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12, + }, + { /* S[4] */ + 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15, + 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9, + 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4, + 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14, + }, + { /* S[5] */ + 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9, + 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6, + 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14, + 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3, + }, + { /* S[6] */ + 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11, + 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8, + 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6, + 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13, + }, + { /* S[7] */ + 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1, + 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6, + 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2, + 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12, + }, + { /* S[8] */ + 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7, + 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2, + 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8, + 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11, + }, +}; + +static const unsigned char P32Tr[] = { /* 32-bit permutation function */ + 16, 7, 20, 21, + 29, 12, 28, 17, + 1, 15, 23, 26, + 5, 18, 31, 10, + 2, 8, 24, 14, + 32, 27, 3, 9, + 19, 13, 30, 6, + 22, 11, 4, 25, +}; + +static const unsigned char CIFP[] = { /* compressed/interleaved permutation */ + 1, 2, 3, 4, 17, 18, 19, 20, + 5, 6, 7, 8, 21, 22, 23, 24, + 9, 10, 11, 12, 25, 26, 27, 28, + 13, 14, 15, 16, 29, 30, 31, 32, + + 33, 34, 35, 36, 49, 50, 51, 52, + 37, 38, 39, 40, 53, 54, 55, 56, + 41, 42, 43, 44, 57, 58, 59, 60, + 45, 46, 47, 48, 61, 62, 63, 64, +}; + +static const unsigned char itoa64[] = /* 0..63 => ascii-64 */ + "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + + +/* ===== Tables that are initialized at run time ==================== */ + + +/* ascii-64 => 0..63 */ +static const unsigned char a64toi[128] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, + 0, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 0, 0, 0, 0, 0, + 0, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 0, 0, 0, 0, +}; + +/* Initial key schedule permutation */ +// static C_block PC1ROT[64/CHUNKBITS][1< final permutation table */ +// static C_block CF6464[64/CHUNKBITS][1<= 0; ) { + if ((t = (unsigned char)setting[i]) == '\0') + t = '.'; + encp[i] = t; + num_iter = (num_iter<<6) | a64toi[t]; + } + setting += 4; + encp += 4; + salt_size = 4; + break; + default: + num_iter = 25; + salt_size = 2; + } + + salt = 0; + for (i = salt_size; --i >= 0; ) { + if ((t = (unsigned char)setting[i]) == '\0') + t = '.'; + encp[i] = t; + salt = (salt<<6) | a64toi[t]; + } + encp += salt_size; + if (__crypt_des_cipher((char *)&constdatablock, (char *)&rsltblock, + salt, num_iter)) + return (NULL); + + /* + * Encode the 64 cipher bits as 11 ascii characters. + */ + i = ((long)((rsltblock.b[0]<<8) | rsltblock.b[1])<<8) | rsltblock.b[2]; + encp[3] = itoa64[i&0x3f]; i >>= 6; + encp[2] = itoa64[i&0x3f]; i >>= 6; + encp[1] = itoa64[i&0x3f]; i >>= 6; + encp[0] = itoa64[i]; encp += 4; + i = ((long)((rsltblock.b[3]<<8) | rsltblock.b[4])<<8) | rsltblock.b[5]; + encp[3] = itoa64[i&0x3f]; i >>= 6; + encp[2] = itoa64[i&0x3f]; i >>= 6; + encp[1] = itoa64[i&0x3f]; i >>= 6; + encp[0] = itoa64[i]; encp += 4; + i = ((long)((rsltblock.b[6])<<8) | rsltblock.b[7])<<2; + encp[2] = itoa64[i&0x3f]; i >>= 6; + encp[1] = itoa64[i&0x3f]; i >>= 6; + encp[0] = itoa64[i]; + + encp[3] = 0; + + return (cryptresult); +} + + +/* + * The Key Schedule, filled in by __crypt_des_setkey() or setkey(). + */ +#define KS_SIZE 16 +static C_block KS[KS_SIZE]; + +/* + * Set up the key schedule from the key. + */ +__private_extern__ int __crypt_des_setkey(key) + register const char *key; +{ + register DCL_BLOCK(K, K0, K1); + register C_block *ptabp; + register int i; + static int des_ready = 0; + + if (!des_ready) { + init_des(); + des_ready = 1; + } + + PERM6464(K,K0,K1,(unsigned char *)key,PC1ROT); + key = (char *)&KS[0]; + STORE(K&~0x03030303L, K0&~0x03030303L, K1, *(C_block *)key); + for (i = 1; i < 16; i++) { + key += sizeof(C_block); + STORE(K,K0,K1,*(C_block *)key); + ptabp = PC2ROT[Rotates[i]-1]; + PERM6464(K,K0,K1,(unsigned char *)key,ptabp); + STORE(K&~0x03030303L, K0&~0x03030303L, K1, *(C_block *)key); + } + __crypt_des_setkey_called = 1; + return (0); +} + +/* + * Encrypt (or decrypt if num_iter < 0) the 8 chars at "in" with abs(num_iter) + * iterations of DES, using the the given 24-bit salt and the pre-computed key + * schedule, and store the resulting 8 chars at "out" (in == out is permitted). + * + * NOTE: the performance of this routine is critically dependent on your + * compiler and machine architecture. + */ +__private_extern__ int __crypt_des_cipher(in, out, salt, num_iter) + const char *in; + char *out; + long salt; + int num_iter; +{ + /* variables that we want in registers, most important first */ +#if defined(pdp11) + register int j; +#endif + register long L0, L1, R0, R1, k; + register C_block *kp; + register int loop_count; + ssize_t ks_inc; + C_block B; + + L0 = salt; + TO_SIX_BIT(salt, L0); /* convert to 4*(6+2) format */ + +#if defined(vax) || defined(pdp11) + salt = ~salt; /* "x &~ y" is faster than "x & y". */ +#define SALT (~salt) +#else +#define SALT salt +#endif + +#if defined(MUST_ALIGN) + B.b[0] = in[0]; B.b[1] = in[1]; B.b[2] = in[2]; B.b[3] = in[3]; + B.b[4] = in[4]; B.b[5] = in[5]; B.b[6] = in[6]; B.b[7] = in[7]; + LOAD(L,L0,L1,B); +#else + LOAD(L,L0,L1,*(C_block *)in); +#endif + LOADREG(R,R0,R1,L,L0,L1); + L0 &= 0x55555555L; + L1 &= 0x55555555L; + L0 = (L0 << 1) | L1; /* L0 is the even-numbered input bits */ + R0 &= 0xaaaaaaaaL; + R1 = (R1 >> 1) & 0x55555555L; + L1 = R0 | R1; /* L1 is the odd-numbered input bits */ + STORE(L,L0,L1,B); + PERM3264(L,L0,L1,B.b,IE3264); /* even bits */ + PERM3264(R,R0,R1,B.b+4,IE3264); /* odd bits */ + + if (num_iter >= 0) + { /* encryption */ + kp = &KS[0]; + ks_inc = sizeof(*kp); + } + else + { /* decryption */ + num_iter = -num_iter; + kp = &KS[KS_SIZE-1]; + ks_inc = -sizeof(*kp); + } + + while (--num_iter >= 0) { + loop_count = 8; + do { + +#define SPTAB(t, i) (*(long *)((unsigned char *)t + i*(sizeof(long)/4))) +#if defined(gould) + /* use this if B.b[i] is evaluated just once ... */ +#define DOXOR(x,y,i) x^=SPTAB(&SPE[i * 64],B.b[i]); y^=SPTAB(&SPE[(8 * 64) + (i * 64)],B.b[i]); +#else +#if defined(pdp11) + /* use this if your "long" int indexing is slow */ +#define DOXOR(x,y,i) j=B.b[i]; x^=SPTAB(&SPE[i * 64],j); y^=SPTAB(&SPE[(8 * 64) + (i * 64)],j); +#else + /* use this if "k" is allocated to a register ... */ +#define DOXOR(x,y,i) k=B.b[i]; x^=SPTAB(&SPE[i * 64],k); y^=SPTAB(&SPE[(8 * 64) + (i * 64)],k); +#endif +#endif + +#define CRUNCH(p0, p1, q0, q1) \ + k = (q0 ^ q1) & SALT; \ + B.b32.i0 = k ^ q0 ^ kp->b32.i0; \ + B.b32.i1 = k ^ q1 ^ kp->b32.i1; \ + kp = (C_block *)((char *)kp+ks_inc); \ + \ + DOXOR(p0, p1, 0); \ + DOXOR(p0, p1, 1); \ + DOXOR(p0, p1, 2); \ + DOXOR(p0, p1, 3); \ + DOXOR(p0, p1, 4); \ + DOXOR(p0, p1, 5); \ + DOXOR(p0, p1, 6); \ + DOXOR(p0, p1, 7); + + CRUNCH(L0, L1, R0, R1); + CRUNCH(R0, R1, L0, L1); + } while (--loop_count != 0); + kp = (C_block *)((char *)kp-(ks_inc*KS_SIZE)); + + + /* swap L and R */ + L0 ^= R0; L1 ^= R1; + R0 ^= L0; R1 ^= L1; + L0 ^= R0; L1 ^= R1; + } + + /* store the encrypted (or decrypted) result */ + L0 = ((L0 >> 3) & 0x0f0f0f0fL) | ((L1 << 1) & 0xf0f0f0f0L); + L1 = ((R0 >> 3) & 0x0f0f0f0fL) | ((R1 << 1) & 0xf0f0f0f0L); + STORE(L,L0,L1,B); + PERM6464(L,L0,L1,B.b,CF6464); +#if defined(MUST_ALIGN) + STORE(L,L0,L1,B); + out[0] = B.b[0]; out[1] = B.b[1]; out[2] = B.b[2]; out[3] = B.b[3]; + out[4] = B.b[4]; out[5] = B.b[5]; out[6] = B.b[6]; out[7] = B.b[7]; +#else + STORE(L,L0,L1,*(C_block *)out); +#endif + return (0); +} + + +/* + * Initialize various tables. This need only be done once. It could even be + * done at compile time, if the compiler were capable of that sort of thing. + */ +STATIC void init_des() +{ + register int i, j; + register long k; + register int tableno; + unsigned char perm[64] = {0}; + + /* + * PC1ROT - bit reverse, then PC1, then Rotate, then PC2. + */ + for (i = 0; i < 64; i++) { + if ((k = PC2[i]) == 0) + continue; + k += Rotates[0]-1; + if ((k%28) < Rotates[0]) k -= 28; + k = PC1[k]; + if (k > 0) { + k--; + k = (k|07) - (k&07); + k++; + } + perm[i] = k; + } +#ifdef DEBUG + prtab("pc1tab", perm, 8); +#endif + PC1ROT = (C_block *)calloc(sizeof(C_block), (64/CHUNKBITS) * (1< 32) + k -= 32; + else if (k > 0) + k--; + if (k > 0) { + k--; + k = (k|07) - (k&07); + k++; + } + perm[i*8+j] = k; + } + } +#ifdef DEBUG + prtab("ietab", perm, 8); +#endif + IE3264 = (C_block *)calloc(sizeof(C_block), (32/CHUNKBITS) * (1< 0) { + k--; + k = (k|07) - (k&07); + k++; + } + perm[k-1] = i+1; + } +#ifdef DEBUG + prtab("cftab", perm, 8); +#endif + CF6464 = (C_block *)calloc(sizeof(C_block), (64/CHUNKBITS) * (1<> 0) &01) << 5)| + (((j >> 1) &01) << 3)| + (((j >> 2) &01) << 2)| + (((j >> 3) &01) << 1)| + (((j >> 4) &01) << 0)| + (((j >> 5) &01) << 4); + k = S[tableno][k]; + k = (((k >> 3)&01) << 0)| + (((k >> 2)&01) << 1)| + (((k >> 1)&01) << 2)| + (((k >> 0)&01) << 3); + for (i = 0; i < 4; i++) + tmp32[4 * tableno + i] = (k >> i) & 01; + k = 0; + for (i = 24; --i >= 0; ) + k = (k<<1) | tmp32[perm[i]-1]; + TO_SIX_BIT(SPE[(tableno * 64) + j], k); + k = 0; + for (i = 24; --i >= 0; ) + k = (k<<1) | tmp32[perm[i+24]-1]; + TO_SIX_BIT(SPE[(8 * 64) + (tableno * 64) + j], k); + } + } +} + +/* + * Initialize "perm" to represent transformation "p", which rearranges + * (perhaps with expansion and/or contraction) one packed array of bits + * (of size "chars_in" characters) into another array (of size "chars_out" + * characters). + * + * "perm" must be all-zeroes on entry to this routine. + */ +STATIC void init_perm(perm, p, chars_in, chars_out) + C_block *perm; + unsigned char p[64]; + int chars_in, chars_out; +{ + register int i, j, k, l; + + for (k = 0; k < chars_out*8; k++) { /* each output bit position */ + l = p[k] - 1; /* where this bit comes from */ + if (l < 0) + continue; /* output bit is always 0 */ + i = l>>LGCHUNKBITS; /* which chunk this bit comes from */ + l = 1<<(l&(CHUNKBITS-1)); /* mask for this bit */ + for (j = 0; j < (1<>3] |= 1<<(k&07); + } + } +} +#endif /* BUILDING_VARIANT */ + +/* + * "setkey" routine (for backwards compatibility) + */ +#if __DARWIN_UNIX03 +void setkey(key) +#else /* !__DARWIN_UNIX03 */ +int setkey(key) +#endif /* __DARWIN_UNIX03 */ + register const char *key; +{ + register int i, j, k; + C_block keyblock; + + for (i = 0; i < 8; i++) { + k = 0; + for (j = 0; j < 8; j++) { + k <<= 1; + k |= (unsigned char)*key++; + } + keyblock.b[i] = k; + } +#if __DARWIN_UNIX03 + __crypt_des_setkey((char *)keyblock.b); +#else /* !__DARWIN_UNIX03 */ + return (__crypt_des_setkey((char *)keyblock.b)); +#endif /* __DARWIN_UNIX03 */ +} + +/* + * "encrypt" routine (for backwards compatibility) + */ +#if __DARWIN_UNIX03 +void encrypt(block, flag) +#else /* !__DARWIN_UNIX03 */ +int encrypt(block, flag) +#endif /* __DARWIN_UNIX03 */ + register char *block; + int flag; +{ + register int i, j, k; + C_block cblock; + + /* Prevent encrypt from crashing if setkey was never called. + * This does not make a good cypher */ + if (!__crypt_des_setkey_called) { + cblock.b32.i0 = cblock.b32.i1 = 0; + __crypt_des_setkey((char *)cblock.b); + } + for (i = 0; i < 8; i++) { + k = 0; + for (j = 0; j < 8; j++) { + k <<= 1; + k |= (unsigned char)*block++; + } + cblock.b[i] = k; + } + if (__crypt_des_cipher((char *)&cblock, (char *)&cblock, 0L, (flag ? -1: 1))) +#if __DARWIN_UNIX03 + return; +#else /* !__DARWIN_UNIX03 */ + return (1); +#endif /* __DARWIN_UNIX03 */ + for (i = 7; i >= 0; i--) { + k = cblock.b[i]; + for (j = 7; j >= 0; j--) { + *--block = k&01; + k >>= 1; + } + } +#if !__DARWIN_UNIX03 + return (0); +#endif /* !__DARWIN_UNIX03 */ +} + +#ifndef BUILDING_VARIANT +#ifdef DEBUG +STATIC void +prtab(s, t, num_rows) + char *s; + unsigned char *t; + int num_rows; +{ + register int i, j; + + (void)printf("%s:\n", s); + for (i = 0; i < num_rows; i++) { + for (j = 0; j < 8; j++) { + (void)printf("%3d", t[i*8+j]); + } + (void)printf("\n"); + } + (void)printf("\n"); +} +#endif +#endif /* BUILDING_VARIANT */ + +#pragma clang diagnostic pop diff --git a/gen/devname.3 b/gen/devname.3 new file mode 100644 index 0000000..057e82f --- /dev/null +++ b/gen/devname.3 @@ -0,0 +1,94 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)devname.3 8.2 (Berkeley) 4/29/95 +.\" $FreeBSD: src/lib/libc/gen/devname.3,v 1.11 2001/10/01 16:08:50 ru Exp $ +.\" +.Dd October 25, 2004 +.Dt DEVNAME 3 +.Os +.Sh NAME +.Nm devname , +.Nm devname_r +.Nd get device name +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/stat.h +.In stdlib.h +.Ft char * +.Fo devname +.Fa "dev_t dev" +.Fa "mode_t type" +.Fc +.Ft char * +.Fo devname_r +.Fa "dev_t dev" +.Fa "mode_t type" +.Fa "char *buf" +.Fa "int len" +.Fc +.Sh DESCRIPTION +The +.Fn devname +function returns a pointer to the name of the block or character +device in +.Dq Pa /dev +with a device number of +.Fa dev , +and a file type matching the one encoded in +.Fa type +which must be one of +.Dv S_IFBLK +or +.Dv S_IFCHR . +If no device matches the specified values, or no information is +available, NULL is returned. +.Pp +The +.Fn devname +function uses a static buffer, which will be overwritten +on subsequent calls. +The +.Fn devname_r +functions takes a buffer and length as arguments to avoid this problem. +.Pp +The traditional display for applications when no device is +found is the string +.Dq ?? . +.Sh SEE ALSO +.Xr stat 2 , +.Xr dev_mkdb 8 +.Sh HISTORY +The +.Fn devname +function call appeared in +.Bx 4.4 . diff --git a/gen/devname.c b/gen/devname.c new file mode 100644 index 0000000..7774a82 --- /dev/null +++ b/gen/devname.c @@ -0,0 +1,114 @@ +/* + * Copyright (c) 1999, 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char * +devname_r(dev_t dev, mode_t type, char *buf, int len) +{ + register DIR *dp; + register struct dirent *dirp; + struct stat sb; + char _buf[sizeof(_PATH_DEV) + MAXNAMLEN]; + + strcpy(_buf, _PATH_DEV); + + if ((dp = opendir(_PATH_DEV)) == NULL) + return (NULL); + + while ( (dirp = readdir(dp)) ) { + bcopy(dirp->d_name, _buf + sizeof(_PATH_DEV) - 1, + dirp->d_namlen + 1); + if (lstat(_buf, &sb)) + continue; + if (dev != sb.st_rdev) + continue; + if (type != (sb.st_mode & S_IFMT)) + continue; + if (dirp->d_namlen + 1 > len) + break; + strcpy(buf, dirp->d_name); + (void)closedir(dp); + return (buf); + } + (void)closedir(dp); + return (NULL); +} + +char * +devname(dev_t dev, mode_t type) +{ + static char *buf = NULL; + + if( buf == NULL ) { + buf = malloc(MAXNAMLEN); + if( buf == NULL ) + return NULL; + } + + return (devname_r(dev, type, buf, MAXNAMLEN)); +} diff --git a/gen/directory.3 b/gen/directory.3 new file mode 100644 index 0000000..4e52375 --- /dev/null +++ b/gen/directory.3 @@ -0,0 +1,279 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)directory.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd May 22, 2017 +.Dt DIRECTORY 3 +.Os +.Sh NAME +.Nm opendir , +.Nm fdopendir , +.Nm readdir , +.Nm readdir_r , +.Nm telldir , +.Nm seekdir , +.Nm rewinddir , +.Nm closedir , +.Nm dirfd +.Nd directory operations +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In dirent.h +.Ft DIR * +.Fn opendir "const char *filename" +.Ft DIR * +.Fn fdopendir "int fd" +.Ft struct dirent * +.Fn readdir "DIR *dirp" +.Ft int +.Fn readdir_r "DIR *dirp" "struct dirent *entry" "struct dirent **result" +.Ft long +.Fn telldir "DIR *dirp" +.Ft void +.Fn seekdir "DIR *dirp" "long loc" +.Ft void +.Fn rewinddir "DIR *dirp" +.Ft int +.Fn closedir "DIR *dirp" +.Ft int +.Fn dirfd "DIR *dirp" +.Sh DESCRIPTION +.Bf -symbolic +The +.Fn readdir_r +interface is deprecated +because it cannot be used correctly unless +.Brq Va NAME_MAX +is a fixed value. +.Ef +.Pp +The +.Fn opendir +function +opens the directory named by +.Fa filename , +associates a +.Em directory stream +with it +and +returns a pointer to be used to identify the +.Em directory stream +in subsequent operations. +The pointer +.Dv NULL +is returned if +.Fa filename +cannot be accessed, or if it cannot +.Xr malloc 3 +enough memory to hold the whole thing. +.Pp +The +.Fn fdopendir +function is equivalent to the +.Fn opendir +function except that the directory is specified by a file descriptor +.Fa fd +rather than by a name. +./"The file offset associated with the file descriptor at the time of the call +./"determines which entries are returned. +.Pp +Upon successful return from +.Fn fdopendir , +the file descriptor is under the control of the system, +and if any attempt is made to close the file descriptor, +or to modify the state of the associated description other than by means +of +.Fn closedir , +.Fn readdir , +.Fn readdir_r , +or +.Fn rewinddir , +the behavior is undefined. +Upon calling +.Fn closedir +the file descriptor is closed. +The +.Dv FD_CLOEXEC +flag is set on the file descriptor by a successful call to +.Fn fdopendir . +.Pp +The +.Fn readdir +function +returns a pointer to the next directory entry. +The directory entry remains valid until the next call to +.Fn readdir +or +.Fn closedir +on the same +.Em directory stream . +The function returns +.Dv NULL +upon reaching the end of the directory or on error. +In the event of an error, +.Va errno +may be set to any of the values documented for the +.Xr getdirentries 2 +system call. Note that the order of the directory entries vended by +.Fn readdir +is not specified. +Some filesystems may return entries in lexicographic sort order and others may not. +Also note that not all filesystems will provide a value for +.Va d_type +and may instead set the field to +.Dv DT_UNKNOWN . +.Pp +The +.Fn readdir_r +function +provides the same functionality as +.Fn readdir , +but the caller must provide a directory +.Fa entry +buffer to store the results in. +The buffer must be large enough for a +.Vt struct dirent +with a +.Va d_name +array with +.Brq Va NAME_MAX ++ 1 elements. +If the read succeeds, +.Fa result +is pointed at the +.Fa entry ; +upon reaching the end of the directory +.Fa result +is set to +.Dv NULL . +The +.Fn readdir_r +function +returns 0 on success or an error number to indicate failure. +.Pp +The +.Fn telldir +function +returns a token representing the current location associated with the named +.Em directory stream . +Values returned by +.Fn telldir +are good only for the lifetime of the +.Dv DIR +pointer, +.Fa dirp , +from which they are derived. +If the directory is closed and then +reopened, prior values returned by +.Fn telldir +will no longer be valid. +Values returned by +.Fn telldir +are also invalidated by a call to +.Fn rewinddir . +.Pp +The +.Fn seekdir +function +sets the position of the next +.Fn readdir +operation on the +.Em directory stream . +The new position reverts to the one associated with the +.Em directory stream +when the +.Fn telldir +operation was performed. +.Pp +The +.Fn rewinddir +function +resets the position of the named +.Em directory stream +to the beginning of the directory. +.Pp +The +.Fn closedir +function +closes the named +.Em directory stream +and frees the structure associated with the +.Fa dirp +pointer, +returning 0 on success. +On failure, \-1 is returned and the global variable +.Va errno +is set to indicate the error. +.Pp +The +.Fn dirfd +function +returns the integer file descriptor associated with the named +.Em directory stream , +see +.Xr open 2 . +.Pp +Sample code which searches a directory for entry ``name'' is: +.Bd -literal -offset indent +dirp = opendir("."); +if (dirp == NULL) + return (ERROR); +len = strlen(name); +while ((dp = readdir(dirp)) != NULL) { + if (dp->d_namlen == len && strcmp(dp->d_name, name) == 0) { + (void)closedir(dirp); + return (FOUND); + } +} +(void)closedir(dirp); +return (NOT_FOUND); +.Ed +.Sh SEE ALSO +.Xr close 2 , +.Xr lseek 2 , +.Xr open 2 , +.Xr read 2 , +.Xr dir 5 +.Sh HISTORY +The +.Fn opendir , +.Fn readdir , +.Fn telldir , +.Fn seekdir , +.Fn rewinddir , +.Fn closedir , +and +.Fn dirfd +functions appeared in +.Bx 4.2 . +The +.Fn fdopendir +function appeared in +.Fx 8.0 . diff --git a/gen/dirfd.c b/gen/dirfd.c new file mode 100644 index 0000000..15ab391 --- /dev/null +++ b/gen/dirfd.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include + +int dirfd(DIR *dirp) { + if (dirp == NULL || dirp->__dd_fd < 0) { + errno = EINVAL; + return -1; + } + + return dirp->__dd_fd; +} diff --git a/gen/disklabel.c b/gen/disklabel.c new file mode 100644 index 0000000..a4ba305 --- /dev/null +++ b/gen/disklabel.c @@ -0,0 +1,218 @@ +/* + * Copyright (c) 1999, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1983, 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#define DKTYPENAMES +#include +/* from ufs/ffs/fs.h */ +#define BBSIZE 8192 +#define SBSIZE 8192 + +#include +#include +#include +#include +#include +#include +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcomma" + +#ifdef unused +static int error(int); +#endif // unused +static int gettype(const char *, const char **); + +struct disklabel * +getdiskbyname(const char *name) +{ + static struct disklabel *dp = NULL; + struct partition *pp; + char *buf; + char *db_array[2] = { _PATH_DISKTAB, 0 }; + char *cp, *cq; /* can't be register */ + char p, max, psize[3], pbsize[3], + pfsize[3], poffset[3], ptype[3]; + u_int32_t *dx; + + if (cgetent(&buf, db_array, (char *) name) < 0) + return NULL; + + if (dp == NULL) { + dp = malloc(sizeof(struct disklabel)); + if (dp == NULL) { + return NULL; + } + } + memset(dp, 0, sizeof(struct disklabel)); + + /* + * typename + */ + cq = dp->d_typename; + cp = buf; + while (cq < dp->d_typename + sizeof(dp->d_typename) - 1 && + (*cq = *cp) && *cq != '|' && *cq != ':') + cq++, cp++; + *cq = '\0'; + /* + * boot name (optional) xxboot, bootxx + */ + cgetstr(buf, "b0", &dp->d_boot0); + cgetstr(buf, "b1", &dp->d_boot1); + + if (cgetstr(buf, "ty", &cq) > 0 && strcmp(cq, "removable") == 0) + dp->d_flags |= D_REMOVABLE; + else if (cq && strcmp(cq, "simulated") == 0) + dp->d_flags |= D_RAMDISK; + if (cgetcap(buf, "sf", ':') != NULL) + dp->d_flags |= D_BADSECT; + +#define getnumdflt(field, dname, dflt) \ + { long f; (field) = (typeof(field))((cgetnum(buf, dname, &f) == -1) ? (dflt) : f); } + + getnumdflt(dp->d_secsize, "se", DEV_BSIZE); + cgetnum(buf, "nt",(long *) &dp->d_ntracks); + cgetnum(buf, "ns",(long *) &dp->d_nsectors); + cgetnum(buf, "nc",(long *) &dp->d_ncylinders); + + if (cgetstr(buf, "dt", &cq) > 0) + dp->d_type = gettype(cq, dktypenames); + else + getnumdflt(dp->d_type, "dt", 0); + getnumdflt(dp->d_secpercyl, "sc", dp->d_nsectors * dp->d_ntracks); + getnumdflt(dp->d_secperunit, "su", dp->d_secpercyl * dp->d_ncylinders); + getnumdflt(dp->d_rpm, "rm", 3600); + getnumdflt(dp->d_interleave, "il", 1); + getnumdflt(dp->d_trackskew, "sk", 0); + getnumdflt(dp->d_cylskew, "cs", 0); + getnumdflt(dp->d_headswitch, "hs", 0); + getnumdflt(dp->d_trkseek, "ts", 0); + getnumdflt(dp->d_bbsize, "bs", BBSIZE); + getnumdflt(dp->d_sbsize, "sb", SBSIZE); + strcpy(psize, "px"); + strcpy(pbsize, "bx"); + strcpy(pfsize, "fx"); + strcpy(poffset, "ox"); + strcpy(ptype, "tx"); + max = 'a' - 1; + pp = &dp->d_partitions[0]; + for (p = 'a'; p < 'a' + MAXPARTITIONS; p++, pp++) { + psize[1] = pbsize[1] = pfsize[1] = poffset[1] = ptype[1] = p; + if (cgetnum(buf, psize,(long *) &pp->p_size) == -1) + pp->p_size = 0; + else { + cgetnum(buf, poffset, (long *) &pp->p_offset); + getnumdflt(pp->p_fsize, pfsize, 0); + if (pp->p_fsize) { + long bsize; + + if (cgetnum(buf, pbsize, &bsize) == 0) + pp->p_frag = bsize / pp->p_fsize; + else + pp->p_frag = 8; + } + getnumdflt(pp->p_fstype, ptype, 0); + if (pp->p_fstype == 0 && cgetstr(buf, ptype, &cq) > 0) + pp->p_fstype = gettype(cq, fstypenames); + max = p; + } + } + dp->d_npartitions = max + 1 - 'a'; + (void)strcpy(psize, "dx"); + dx = dp->d_drivedata; + for (p = '0'; p < '0' + NDDATA; p++, dx++) { + psize[1] = p; + getnumdflt(*dx, psize, 0); + } + dp->d_magic = DISKMAGIC; + dp->d_magic2 = DISKMAGIC; + free(buf); + return (dp); +} + +static int +gettype(const char *t, const char **names) +{ + const char **nm; + + for (nm = names; *nm; nm++) + if (strcasecmp(t, *nm) == 0) + return (int)(nm - names); + if (isdigit(*t)) + return (atoi(t)); + return (0); +} + +#ifdef unused +static int +error(err) + int err; +{ + char *p; + + (void)write(STDERR_FILENO, "disktab: ", 9); + (void)write(STDERR_FILENO, _PATH_DISKTAB, sizeof(_PATH_DISKTAB) - 1); + (void)write(STDERR_FILENO, ": ", 2); + p = strerror(err); + (void)write(STDERR_FILENO, p, strlen(p)); + (void)write(STDERR_FILENO, "\n", 1); +} +#endif // unused +#pragma clang diagnostic pop + diff --git a/gen/errlst.c b/gen/errlst.c new file mode 100644 index 0000000..bde5422 --- /dev/null +++ b/gen/errlst.c @@ -0,0 +1,191 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1985, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include + +const char *const sys_errlist[] = { + "Undefined error: 0", /* 0 - ENOERROR */ + "Operation not permitted", /* 1 - EPERM */ + "No such file or directory", /* 2 - ENOENT */ + "No such process", /* 3 - ESRCH */ + "Interrupted system call", /* 4 - EINTR */ + "Input/output error", /* 5 - EIO */ + "Device not configured", /* 6 - ENXIO */ + "Argument list too long", /* 7 - E2BIG */ + "Exec format error", /* 8 - ENOEXEC */ + "Bad file descriptor", /* 9 - EBADF */ + "No child processes", /* 10 - ECHILD */ + "Resource deadlock avoided", /* 11 - EDEADLK */ + "Cannot allocate memory", /* 12 - ENOMEM */ + "Permission denied", /* 13 - EACCES */ + "Bad address", /* 14 - EFAULT */ + "Block device required", /* 15 - ENOTBLK */ + "Resource busy", /* 16 - EBUSY */ + "File exists", /* 17 - EEXIST */ + "Cross-device link", /* 18 - EXDEV */ + "Operation not supported by device", /* 19 - ENODEV */ + "Not a directory", /* 20 - ENOTDIR */ + "Is a directory", /* 21 - EISDIR */ + "Invalid argument", /* 22 - EINVAL */ + "Too many open files in system", /* 23 - ENFILE */ + "Too many open files", /* 24 - EMFILE */ + "Inappropriate ioctl for device", /* 25 - ENOTTY */ + "Text file busy", /* 26 - ETXTBSY */ + "File too large", /* 27 - EFBIG */ + "No space left on device", /* 28 - ENOSPC */ + "Illegal seek", /* 29 - ESPIPE */ + "Read-only file system", /* 30 - EROFS */ + "Too many links", /* 31 - EMLINK */ + "Broken pipe", /* 32 - EPIPE */ + +/* math software */ + "Numerical argument out of domain", /* 33 - EDOM */ + "Result too large", /* 34 - ERANGE */ + +/* non-blocking and interrupt i/o */ + "Resource temporarily unavailable", /* 35 - EAGAIN */ + /* 35 - EWOULDBLOCK */ + "Operation now in progress", /* 36 - EINPROGRESS */ + "Operation already in progress", /* 37 - EALREADY */ + +/* ipc/network software -- argument errors */ + "Socket operation on non-socket", /* 38 - ENOTSOCK */ + "Destination address required", /* 39 - EDESTADDRREQ */ + "Message too long", /* 40 - EMSGSIZE */ + "Protocol wrong type for socket", /* 41 - EPROTOTYPE */ + "Protocol not available", /* 42 - ENOPROTOOPT */ + "Protocol not supported", /* 43 - EPROTONOSUPPORT */ + "Socket type not supported", /* 44 - ESOCKTNOSUPPORT */ + "Operation not supported", /* 45 - ENOTSUP */ + "Protocol family not supported", /* 46 - EPFNOSUPPORT */ + /* 47 - EAFNOSUPPORT */ + "Address family not supported by protocol family", + "Address already in use", /* 48 - EADDRINUSE */ + "Can't assign requested address", /* 49 - EADDRNOTAVAIL */ + +/* ipc/network software -- operational errors */ + "Network is down", /* 50 - ENETDOWN */ + "Network is unreachable", /* 51 - ENETUNREACH */ + "Network dropped connection on reset", /* 52 - ENETRESET */ + "Software caused connection abort", /* 53 - ECONNABORTED */ + "Connection reset by peer", /* 54 - ECONNRESET */ + "No buffer space available", /* 55 - ENOBUFS */ + "Socket is already connected", /* 56 - EISCONN */ + "Socket is not connected", /* 57 - ENOTCONN */ + "Can't send after socket shutdown", /* 58 - ESHUTDOWN */ + "Too many references: can't splice", /* 59 - ETOOMANYREFS */ + "Operation timed out", /* 60 - ETIMEDOUT */ + "Connection refused", /* 61 - ECONNREFUSED */ + + "Too many levels of symbolic links", /* 62 - ELOOP */ + "File name too long", /* 63 - ENAMETOOLONG */ + +/* should be rearranged */ + "Host is down", /* 64 - EHOSTDOWN */ + "No route to host", /* 65 - EHOSTUNREACH */ + "Directory not empty", /* 66 - ENOTEMPTY */ + +/* quotas & mush */ + "Too many processes", /* 67 - EPROCLIM */ + "Too many users", /* 68 - EUSERS */ + "Disc quota exceeded", /* 69 - EDQUOT */ + +/* Network File System */ + "Stale NFS file handle", /* 70 - ESTALE */ + "Too many levels of remote in path", /* 71 - EREMOTE */ + "RPC struct is bad", /* 72 - EBADRPC */ + "RPC version wrong", /* 73 - ERPCMISMATCH */ + "RPC prog. not avail", /* 74 - EPROGUNAVAIL */ + "Program version wrong", /* 75 - EPROGMISMATCH */ + "Bad procedure for program", /* 76 - EPROCUNAVAIL */ + + "No locks available", /* 77 - ENOLCK */ + "Function not implemented", /* 78 - ENOSYS */ + "Inappropriate file type or format", /* 79 - EFTYPE */ + "Authentication error", /* 80 - EAUTH */ + "Need authenticator", /* 81 - ENEEDAUTH */ + + "Device power is off", /* 82 - EPWROFF */ + "Device error", /* 83 - EDEVERR */ + "Value too large to be stored in data type", /* 84 - EOVERFLOW */ + +/* program loading errors */ + "Bad executable (or shared library)", /* 85 - EBADEXEC */ + "Bad CPU type in executable", /* 86 - EBADARCH */ + "Shared library version mismatch", /* 87 - ESHLIBVERS */ + "Malformed Mach-o file", /* 88 - EBADMACHO */ + "Operation canceled", /* 89 - ECANCELED */ + "Identifier removed", /* 90 - EIDRM */ + "No message of desired type", /* 91 - ENOMSG */ + "Illegal byte sequence", /* 92 - EILSEQ */ + "Attribute not found", /* 93 - ENOATTR */ + "Bad message", /* 94 - EBADMSG */ + "EMULTIHOP (Reserved)", /* 95 - EMULTIHOP */ + "No message available on STREAM", /* 96 - ENODATA */ + "ENOLINK (Reserved)", /* 97 - ENOLINK */ + "No STREAM resources", /* 98 - ENOSR */ + "Not a STREAM", /* 99 - ENOSTR */ + "Protocol error", /* 100 - EPROTO */ + "STREAM ioctl timeout", /* 101 - ETIME */ + "Operation not supported on socket", /* 102 - EOPNOTSUPP */ + "Policy not found", /* 103 - ENOPOLICY */ + "State not recoverable", /* 104 - ENOTRECOVERABLE */ + "Previous owner died", /* 105 - EOWNERDEAD */ + + "Interface output queue is full", /* 106 - EQFULL */ +}; + +const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); diff --git a/gen/execinfo.h b/gen/execinfo.h new file mode 100644 index 0000000..97d9422 --- /dev/null +++ b/gen/execinfo.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _EXECINFO_H_ +#define _EXECINFO_H_ 1 + +#include +#include +#include +#include +#include +#include + +__BEGIN_DECLS + +int backtrace(void**,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); + +API_AVAILABLE(macosx(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +OS_EXPORT +int backtrace_from_fp(void *startfp, void **array, int size); + +char** backtrace_symbols(void* const*,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +void backtrace_symbols_fd(void* const*,int,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); + +struct image_offset { + /* + * The UUID of the image. + */ + uuid_t uuid; + + /* + * The offset is relative to the __TEXT section of the image. + */ + uint32_t offset; +}; + +API_AVAILABLE(macosx(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +OS_EXPORT +void backtrace_image_offsets(void* const* array, + struct image_offset *image_offsets, int size); + +__END_DECLS + +#endif /* !_EXECINFO_H_ */ diff --git a/gen/filesec.c b/gen/filesec.c new file mode 100644 index 0000000..64e73d0 --- /dev/null +++ b/gen/filesec.c @@ -0,0 +1,353 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include + +/* + * Versions of copy_int/copy_ext that retain native endianity. + */ +extern ssize_t acl_copy_ext_native(void *buf_p, acl_t acl, ssize_t size); +extern acl_t acl_copy_int_native(const void *buf_p); + +struct _filesec { + int fs_valid; +#define FS_VALID_UID (1<<0) +#define FS_VALID_GID (1<<1) +#define FS_VALID_UUID (1<<2) +#define FS_VALID_GRPUUID (1<<3) +#define FS_VALID_MODE (1<<4) +#define FS_VALID_ACL (1<<5) + uid_t fs_uid; + gid_t fs_gid; + uuid_t fs_uuid; + uuid_t fs_grpuuid; + mode_t fs_mode; + size_t fs_aclsize; + void *fs_aclbuf; +}; + +#define FS_ISVALID(_fsec, _bit) ((_fsec)->fs_valid & (_bit)) +#define FS_CLEAR(_fsec, _bit) ((_fsec)->fs_valid &= ~(_bit)) +#define FS_SET(_fsec, _bit) ((_fsec)->fs_valid |= (_bit)) + +static void filesec_discard_aclbuf(struct _filesec *fsec); + +filesec_t +filesec_init(void) +{ + struct _filesec *fsp; + + fsp = malloc(sizeof(*fsp)); + if (fsp != NULL) + fsp->fs_valid = 0; + return(fsp); +} + +filesec_t +filesec_dup(filesec_t fsec) +{ + struct _filesec *fsp; + + fsp = malloc(sizeof(*fsp)); + if (fsp != NULL) { + *fsp = *fsec; + if (FS_ISVALID(fsec, FS_VALID_ACL)) { + if (fsec->fs_aclbuf != _FILESEC_REMOVE_ACL) { + fsp->fs_aclbuf = malloc(fsec->fs_aclsize); + if (fsp->fs_aclbuf == NULL) { + free(fsp); + return(NULL); + } + bcopy(fsec->fs_aclbuf, fsp->fs_aclbuf, fsec->fs_aclsize); + } + } + } + return(fsp); +} + +void +filesec_free(filesec_t fsec) +{ + filesec_discard_aclbuf(fsec); + free(fsec); +} + +int +filesec_get_property(filesec_t fsec, filesec_property_t property, void *propptr) +{ + int error; + + error = 0; + switch(property) { + case FILESEC_OWNER: + if (!FS_ISVALID(fsec, FS_VALID_UID)) { + error = ENOENT; + break; + } + if (propptr != NULL) + *(uid_t *)propptr = fsec->fs_uid; + break; + case FILESEC_GROUP: + if (!FS_ISVALID(fsec, FS_VALID_GID)) { + error = ENOENT; + break; + } + if (propptr != NULL) + *(gid_t *)propptr = fsec->fs_gid; + break; + case FILESEC_UUID: + if (!FS_ISVALID(fsec, FS_VALID_UUID)) { + error = ENOENT; + break; + } + if (propptr != NULL) + uuid_copy(*(uuid_t *)propptr, fsec->fs_uuid); + break; + case FILESEC_GRPUUID: + if (!FS_ISVALID(fsec, FS_VALID_GRPUUID)) { + error = ENOENT; + break; + } + if (propptr != NULL) + uuid_copy(*(uuid_t *)propptr, fsec->fs_grpuuid); + break; + case FILESEC_MODE: + if (!FS_ISVALID(fsec, FS_VALID_MODE)) { + error = ENOENT; + break; + } + if (propptr != NULL) + *(mode_t *)propptr = fsec->fs_mode; + break; + case FILESEC_ACL: + if (!FS_ISVALID(fsec, FS_VALID_ACL)) { + error = ENOENT; + break; + } + if (propptr != NULL) { + if (fsec->fs_aclbuf == _FILESEC_REMOVE_ACL) { + *(acl_t *)propptr = _FILESEC_REMOVE_ACL; + } else { + *(acl_t *)propptr = acl_copy_int_native(fsec->fs_aclbuf); + if (*(acl_t *)propptr == NULL) + error = errno; + } + } + break; + case FILESEC_ACL_RAW: + if (!FS_ISVALID(fsec, FS_VALID_ACL)) { + error = ENOENT; + break; + } + if (propptr != NULL) + *(void **)propptr = fsec->fs_aclbuf; + break; + case FILESEC_ACL_ALLOCSIZE: + if (!FS_ISVALID(fsec, FS_VALID_ACL)) { + error = ENOENT; + break; + } + if (propptr != NULL) + *(size_t *)propptr = fsec->fs_aclsize; + break; + default: + error = EINVAL; + break; + } + if (error) { + errno = error; + return(-1); + } + return(0); +} + +int +filesec_set_property(filesec_t fsec, filesec_property_t property, const void *propptr) +{ + void *aclbuf; + ssize_t aclsize, copysize; + acl_t acl; + int error; + + error = 0; + switch(property) { + case FILESEC_OWNER: + if (propptr == _FILESEC_UNSET_PROPERTY) { + FS_CLEAR(fsec, FS_VALID_UID); + } else { + fsec->fs_uid = *(uid_t *)propptr; + FS_SET(fsec, FS_VALID_UID); + } + break; + case FILESEC_GROUP: + if (propptr == _FILESEC_UNSET_PROPERTY) { + FS_CLEAR(fsec, FS_VALID_GID); + } else { + fsec->fs_gid = *(gid_t *)propptr; + FS_SET(fsec, FS_VALID_GID); + } + break; + case FILESEC_UUID: + if (propptr == _FILESEC_UNSET_PROPERTY) { + FS_CLEAR(fsec, FS_VALID_UUID); + } else { + uuid_copy(fsec->fs_uuid, *(uuid_t *)propptr); + FS_SET(fsec, FS_VALID_UUID); + } + break; + case FILESEC_GRPUUID: + if (propptr == _FILESEC_UNSET_PROPERTY) { + FS_CLEAR(fsec, FS_VALID_GRPUUID); + } else { + uuid_copy(fsec->fs_grpuuid, *(uuid_t *)propptr); + FS_SET(fsec, FS_VALID_GRPUUID); + } + break; + case FILESEC_MODE: + if (propptr == _FILESEC_UNSET_PROPERTY) { + FS_CLEAR(fsec, FS_VALID_MODE); + } else { + fsec->fs_mode = *(mode_t *)propptr; + FS_SET(fsec, FS_VALID_MODE); + } + break; + case FILESEC_ACL: + if (propptr == _FILESEC_UNSET_PROPERTY) { + filesec_discard_aclbuf(fsec); + FS_CLEAR(fsec, FS_VALID_ACL); + } else if (propptr == _FILESEC_REMOVE_ACL) { + filesec_discard_aclbuf(fsec); + fsec->fs_aclbuf = _FILESEC_REMOVE_ACL; + fsec->fs_aclsize = 0; + FS_SET(fsec, FS_VALID_ACL); + } else { + acl = *(acl_t *)propptr; + aclsize = acl_size(acl); + if (aclsize < 0) { + error = errno; + break; + } + if ((aclbuf = malloc(aclsize)) == NULL) { + error = errno; + break; + } + copysize = acl_copy_ext_native(aclbuf, acl, aclsize); + if (copysize < 0) { + free(aclbuf); + error = EINVAL; + break; + } + filesec_discard_aclbuf(fsec); + fsec->fs_aclbuf = aclbuf; + fsec->fs_aclsize = aclsize; + FS_SET(fsec, FS_VALID_ACL); + } + break; + case FILESEC_ACL_RAW: + filesec_discard_aclbuf(fsec); + if ((propptr != NULL) && (*(void **)propptr != NULL)) { + fsec->fs_aclbuf = *(void **)propptr; + FS_SET(fsec, FS_VALID_ACL); + } + break; + case FILESEC_ACL_ALLOCSIZE: + if (propptr != NULL) { + fsec->fs_aclsize = *(size_t *)propptr; + } else { + error = EINVAL; + } + break; + default: + error = EINVAL; + break; + } + if (error != 0) { + errno = error; + return (-1); + } + return (0); +} + +int +filesec_unset_property(filesec_t fsec, filesec_property_t property) +{ + return filesec_set_property(fsec, property, _FILESEC_UNSET_PROPERTY); +} + +int +filesec_query_property(filesec_t fsec, filesec_property_t property, int *validptr) +{ + int valid, error; + + error = 0; + switch(property) { + case FILESEC_OWNER: + valid = FS_ISVALID(fsec, FS_VALID_UID); + break; + case FILESEC_GROUP: + valid = FS_ISVALID(fsec, FS_VALID_GID); + break; + case FILESEC_UUID: + valid = FS_ISVALID(fsec, FS_VALID_UUID); + break; + case FILESEC_GRPUUID: + valid = FS_ISVALID(fsec, FS_VALID_GRPUUID); + break; + case FILESEC_MODE: + valid = FS_ISVALID(fsec, FS_VALID_MODE); + break; + case FILESEC_ACL: + case FILESEC_ACL_RAW: + case FILESEC_ACL_ALLOCSIZE: + valid = FS_ISVALID(fsec, FS_VALID_ACL); + break; + default: + error = EINVAL; + break; + } + + if (error != 0) { + errno = error; + return(-1); + } + *validptr = valid; + return(0); +} + +static void +filesec_discard_aclbuf(struct _filesec *fsec) +{ + if (FS_ISVALID(fsec, FS_VALID_ACL)) { + if (fsec->fs_aclbuf != _FILESEC_REMOVE_ACL) + free(fsec->fs_aclbuf); + fsec->fs_aclbuf = NULL; + fsec->fs_aclsize = 0; + FS_CLEAR(fsec, FS_VALID_ACL); + } +} diff --git a/gen/fts.3 b/gen/fts.3 new file mode 100644 index 0000000..9b72747 --- /dev/null +++ b/gen/fts.3 @@ -0,0 +1,820 @@ +.\" Copyright (c) 1989, 1991, 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fts.3 8.5 (Berkeley) 4/16/94 +.\" $FreeBSD: src/lib/libc/gen/fts.3,v 1.13 2001/09/20 12:32:45 ru Exp $ +.\" +.Dd Sept 24, 2012 +.Dt FTS 3 +.Os +.Sh NAME +.Nm fts +.Nd traverse a file hierarchy +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/stat.h +.In fts.h +.Ft FTS * +.Fn fts_open "char * const *path_argv" "int options" "int (*compar)(const FTSENT **, const FTSENT **)" +.Ft FTS * +.Fn fts_open_b "char * const *path_argv" "int options" "int (^compar)(const FTSENT **, const FTSENT **)" +.Ft FTSENT * +.Fn fts_read "FTS *ftsp" +.Ft FTSENT * +.Fn fts_children "FTS *ftsp" "int options" +.Ft int +.Fn fts_set "FTS *ftsp" "FTSENT *f" "int options" +.Ft int +.Fn fts_close "FTS *ftsp" +.Sh DESCRIPTION +The +.Nm +functions are provided for traversing +.Tn UNIX +file hierarchies. +A simple overview is that the +.Fn fts_open +and +.Fn fts_open_b +functions return a +.Dq handle +on a file hierarchy, which is then supplied to +the other +.Nm +functions. +The function +.Fn fts_read +returns a pointer to a structure describing one of the files in the file +hierarchy. +The function +.Fn fts_children +returns a pointer to a linked list of structures, each of which describes +one of the files contained in a directory in the hierarchy. +In general, directories are visited two distinguishable times; in pre-order +(before any of their descendants are visited) and in post-order (after all +of their descendants have been visited). +Files are visited once. +It is possible to walk the hierarchy +.Dq logically +(ignoring symbolic links) +or physically (visiting symbolic links), order the walk of the hierarchy or +prune and/or re-visit portions of the hierarchy. +.Pp +Two structures are defined (and typedef'd) in the include file +.Aq Pa fts.h . +The first is +.Fa FTS , +the structure that represents the file hierarchy itself. +The second is +.Fa FTSENT , +the structure that represents a file in the file +hierarchy. +Normally, an +.Fa FTSENT +structure is returned for every file in the file +hierarchy. +In this manual page, +.Dq file +and +.Dq Fa FTSENT No structure +are generally +interchangeable. +The +.Fa FTSENT +structure contains at least the following fields, which are +described in greater detail below: +.Bd -literal +typedef struct _ftsent { + u_short fts_info; /* flags for FTSENT structure */ + char *fts_accpath; /* access path */ + char *fts_path; /* root path */ + u_short fts_pathlen; /* strlen(fts_path) */ + char *fts_name; /* file name */ + u_short fts_namelen; /* strlen(fts_name) */ + short fts_level; /* depth (\-1 to N) */ + int fts_errno; /* file errno */ + long fts_number; /* local numeric value */ + void *fts_pointer; /* local address value */ + struct ftsent *fts_parent; /* parent directory */ + struct ftsent *fts_link; /* next file structure */ + struct ftsent *fts_cycle; /* cycle structure */ + struct stat *fts_statp; /* stat(2) information */ +} FTSENT; +.Ed +.Pp +These fields are defined as follows: +.Bl -tag -width "fts_namelen" +.It Fa fts_info +One of the following values describing the returned +.Fa FTSENT +structure and +the file it represents. +With the exception of directories without errors +.Pq Dv FTS_D , +all of these +entries are terminal, that is, they will not be revisited, nor will any +of their descendants be visited. +.Bl -tag -width FTS_DEFAULT +.It Dv FTS_D +A directory being visited in pre-order. +.It Dv FTS_DC +A directory that causes a cycle in the tree. +(The +.Fa fts_cycle +field of the +.Fa FTSENT +structure will be filled in as well.) +.It Dv FTS_DEFAULT +Any +.Fa FTSENT +structure that represents a file type not explicitly described +by one of the other +.Fa fts_info +values. +.It Dv FTS_DNR +A directory which cannot be read. +This is an error return, and the +.Fa fts_errno +field will be set to indicate what caused the error. +.It Dv FTS_DOT +A file named +.Ql .\& +or +.Ql ..\& +which was not specified as a file name to +.Fn fts_open +or +.Fn fts_open_b +(see +.Dv FTS_SEEDOT ) . +.It Dv FTS_DP +A directory being visited in post-order. +The contents of the +.Fa FTSENT +structure will be unchanged from when +it was returned in pre-order, i.e. with the +.Fa fts_info +field set to +.Dv FTS_D . +.It Dv FTS_ERR +This is an error return, and the +.Fa fts_errno +field will be set to indicate what caused the error. +.It Dv FTS_F +A regular file. +.It Dv FTS_NS +A file for which no +.Xr stat 2 +information was available. +The contents of the +.Fa fts_statp +field are undefined. +This is an error return, and the +.Fa fts_errno +field will be set to indicate what caused the error. +.It Dv FTS_NSOK +A file for which no +.Xr stat 2 +information was requested. +The contents of the +.Fa fts_statp +field are undefined. +.It Dv FTS_SL +A symbolic link. +.It Dv FTS_SLNONE +A symbolic link with a non-existent target. +The contents of the +.Fa fts_statp +field reference the file characteristic information for the symbolic link +itself. +.El +.It Fa fts_accpath +A path for accessing the file from the current directory. +.It Fa fts_path +The path for the file relative to the root of the traversal. +This path contains the path specified to +.Fn fts_open +or +.Fn fts_open_b +as a prefix. +.It Fa fts_pathlen +The length of the string referenced by +.Fa fts_path . +.It Fa fts_name +The name of the file. +.It Fa fts_namelen +The length of the string referenced by +.Fa fts_name . +.It Fa fts_level +The depth of the traversal, numbered from \-1 to N, where this file +was found. +The +.Fa FTSENT +structure representing the parent of the starting point (or root) +of the traversal is numbered +.Dv FTS_ROOTPARENTLEVEL +(\-1), and the +.Fa FTSENT +structure for the root +itself is numbered +.Dv FTS_ROOTLEVEL +(0). +.It Fa fts_errno +Upon return of a +.Fa FTSENT +structure from the +.Fn fts_children +or +.Fn fts_read +functions, with its +.Fa fts_info +field set to +.Dv FTS_DNR , +.Dv FTS_ERR +or +.Dv FTS_NS , +the +.Fa fts_errno +field contains the value of the external variable +.Va errno +specifying the cause of the error. +Otherwise, the contents of the +.Fa fts_errno +field are undefined. +.It Fa fts_number +This field is provided for the use of the application program and is +not modified by the +.Nm +functions. +It is initialized to 0. +.It Fa fts_pointer +This field is provided for the use of the application program and is +not modified by the +.Nm +functions. +It is initialized to +.Dv NULL . +.It Fa fts_parent +A pointer to the +.Fa FTSENT +structure referencing the file in the hierarchy +immediately above the current file, i.e. the directory of which this +file is a member. +A parent structure for the initial entry point is provided as well, +however, only the +.Fa fts_level , +.Fa fts_number +and +.Fa fts_pointer +fields are guaranteed to be initialized. +.It Fa fts_link +Upon return from the +.Fn fts_children +function, the +.Fa fts_link +field points to the next structure in the NULL-terminated linked list of +directory members. +Otherwise, the contents of the +.Fa fts_link +field are undefined. +.It Fa fts_cycle +If a directory causes a cycle in the hierarchy (see +.Dv FTS_DC ) , +either because +of a hard link between two directories, or a symbolic link pointing to a +directory, the +.Fa fts_cycle +field of the structure will point to the +.Fa FTSENT +structure in the hierarchy that references the same file as the current +.Fa FTSENT +structure. +Otherwise, the contents of the +.Fa fts_cycle +field are undefined. +.It Fa fts_statp +A pointer to +.Xr stat 2 +information for the file. +.El +.Pp +A single buffer is used for all of the paths of all of the files in the +file hierarchy. +Therefore, the +.Fa fts_path +and +.Fa fts_accpath +fields are guaranteed to be +.Dv NUL Ns -terminated +.Em only +for the file most recently returned by +.Fn fts_read . +To use these fields to reference any files represented by other +.Fa FTSENT +structures will require that the path buffer be modified using the +information contained in that +.Fa FTSENT +structure's +.Fa fts_pathlen +field. +Any such modifications should be undone before further calls to +.Fn fts_read +are attempted. +The +.Fa fts_name +field is always +.Dv NUL Ns -terminated . +.Sh FTS_OPEN +The +.Fn fts_open +function takes a pointer to an array of character pointers naming one +or more paths which make up a logical file hierarchy to be traversed. +The array must be terminated by a +.Dv NULL +pointer. +.Pp +There are +a number of options, at least one of which (either +.Dv FTS_LOGICAL +or +.Dv FTS_PHYSICAL ) +must be specified. +The options are selected by +.Em or Ns 'ing +the following values: +.Bl -tag -width "FTS_NOSTAT_TYPE" +.It Dv FTS_COMFOLLOW +This option causes any symbolic link specified as a root path to be +followed immediately whether or not +.Dv FTS_LOGICAL +is also specified. +.It Dv FTS_LOGICAL +This option causes the +.Nm +routines to return +.Fa FTSENT +structures for the targets of symbolic links +instead of the symbolic links themselves. +If this option is set, the only symbolic links for which +.Fa FTSENT +structures +are returned to the application are those referencing non-existent files. +Either +.Dv FTS_LOGICAL +or +.Dv FTS_PHYSICAL +.Em must +be provided to the +.Fn fts_open +function. +.It Dv FTS_NOCHDIR +As a performance optimization, the +.Nm +functions change directories as they walk the file hierarchy. +This has the side-effect that an application cannot rely on being +in any particular directory during the traversal. +The +.Dv FTS_NOCHDIR +option turns off this optimization, and the +.Nm +functions will not change the current directory. +Note that applications should not themselves change their current directory +and try to access files unless +.Dv FTS_NOCHDIR +is specified and absolute +pathnames were provided as arguments to +.Fn fts_open . +.It Dv FTS_NOSTAT +By default, returned +.Fa FTSENT +structures reference file characteristic information (the +.Fa statp +field) for each file visited. +This option relaxes that requirement as a performance optimization, +not calling +.Xr stat 2 +whenever possible. +If +.Xr stat 2 +doesn't need to be called, the +.Nm +functions will set the +.Fa fts_info +field to +.Dv FTS_NSOK ; +otherwise +.Fa fts_info +will be set to the correct file information value corresponding to the +.Xr stat 2 +information. +In any case, the +.Fa statp +field will always be undefined. +Note that because +.Nm +detects directory cycles and dangling symbolic links, +.Xr stat 2 +is always called for directories and is called for symbolic links when +.Dv FTS_LOGICAL +is set. +.It Dv FTS_NOSTAT_TYPE +Like +.Dv FTS_NOSTAT +but if the file type is returned by +.Xr readdir 3 , +the corresponding file information value is returned in +.Fa fts_info +instead of +.Dv FTS_NSOK . +.It Dv FTS_PHYSICAL +This option causes the +.Nm +routines to return +.Fa FTSENT +structures for symbolic links themselves instead +of the target files they point to. +If this option is set, +.Fa FTSENT +structures for all symbolic links in the +hierarchy are returned to the application. +Either +.Dv FTS_LOGICAL +or +.Dv FTS_PHYSICAL +.Em must +be provided to the +.Fn fts_open +function. +.It Dv FTS_SEEDOT +By default, unless they are specified as path arguments to +.Fn fts_open , +any files named +.Ql .\& +or +.Ql ..\& +encountered in the file hierarchy are ignored. +This option causes the +.Nm +routines to return +.Fa FTSENT +structures for them. +.It Dv FTS_XDEV +This option prevents +.Nm +from descending into directories that have a different device number +than the file from which the descent began. +.El +.Pp +The argument +.Fn compar +specifies a user-defined function which may be used to order the traversal +of the hierarchy. +It +takes two pointers to pointers to +.Fa FTSENT +structures as arguments and +should return a negative value, zero, or a positive value to indicate +if the file referenced by its first argument comes before, in any order +with respect to, or after, the file referenced by its second argument. +The +.Fa fts_accpath , +.Fa fts_path +and +.Fa fts_pathlen +fields of the +.Fa FTSENT +structures may +.Em never +be used in this comparison. +If the +.Fa fts_info +field is set to +.Dv FTS_NS +or +.Dv FTS_NSOK , +the +.Fa fts_statp +field may not either. +If the +.Fn compar +argument is +.Dv NULL , +the directory traversal order is in the order listed in +.Fa path_argv +for the root paths, and in the order listed in the directory for +everything else. +.Sh FTS_OPEN_B +The +.Fn fts_open_b +function is like +.Fn fts_open +except +.Fa compar +is a block pointer instead of a function pointer. +This block is passed to +.Xr qsort_b 3 +(whereas +.Fn fts_open +passes its function pointer to +.Xr qsort 3 ) . +.Bd -ragged -offset indent +Note: The +.Fn Block_copy +function (defined in +.In Blocks.h ) +is used by +.Fn fts_open_b +to make a copy of the block, especially for the case when a stack-based +block might go out of scope when the subroutine returns. +.Ed +.Sh FTS_READ +The +.Fn fts_read +function returns a pointer to an +.Fa FTSENT +structure describing a file in +the hierarchy. +Directories (that are readable and do not cause cycles) are visited at +least twice, once in pre-order and once in post-order. +All other files are visited at least once. +(Hard links between directories that do not cause cycles or symbolic +links to symbolic links may cause files to be visited more than once, +or directories more than twice.) +.Pp +If all the members of the hierarchy have been returned, +.Fn fts_read +returns +.Dv NULL +and sets the external variable +.Va errno +to 0. +If an error unrelated to a file in the hierarchy occurs, +.Fn fts_read +returns +.Dv NULL +and sets +.Va errno +appropriately. +If an error related to a returned file occurs, a pointer to an +.Fa FTSENT +structure is returned, and +.Va errno +may or may not have been set (see +.Fa fts_info ) . +.Pp +The +.Fa FTSENT +structures returned by +.Fn fts_read +may be overwritten after a call to +.Fn fts_close +on the same file hierarchy stream, or, after a call to +.Fn fts_read +on the same file hierarchy stream unless they represent a file of type +directory, in which case they will not be overwritten until after a call to +.Fn fts_read +after the +.Fa FTSENT +structure has been returned by the function +.Fn fts_read +in post-order. +.Sh FTS_CHILDREN +The +.Fn fts_children +function returns a pointer to an +.Fa FTSENT +structure describing the first entry in a NULL-terminated linked list of +the files in the directory represented by the +.Fa FTSENT +structure most recently returned by +.Fn fts_read . +The list is linked through the +.Fa fts_link +field of the +.Fa FTSENT +structure, and is ordered by the user-specified comparison function, if any. +Repeated calls to +.Fn fts_children +will recreate this linked list. +.Pp +As a special case, if +.Fn fts_read +has not yet been called for a hierarchy, +.Fn fts_children +will return a pointer to the files in the logical directory specified to +.Fn fts_open , +i.e. the arguments specified to +.Fn fts_open . +Otherwise, if the +.Fa FTSENT +structure most recently returned by +.Fn fts_read +is not a directory being visited in pre-order, +or the directory does not contain any files, +.Fn fts_children +returns +.Dv NULL +and sets +.Va errno +to zero. +If an error occurs, +.Fn fts_children +returns +.Dv NULL +and sets +.Va errno +appropriately. +.Pp +The +.Fa FTSENT +structures returned by +.Fn fts_children +may be overwritten after a call to +.Fn fts_children , +.Fn fts_close +or +.Fn fts_read +on the same file hierarchy stream. +.Pp +.Em Option +may be set to the following value: +.Bl -tag -width FTS_NAMEONLY +.It Dv FTS_NAMEONLY +Only the names of the files are needed. +The contents of all the fields in the returned linked list of structures +are undefined with the exception of the +.Fa fts_name +and +.Fa fts_namelen +fields. +.El +.Sh FTS_SET +The function +.Fn fts_set +allows the user application to determine further processing for the +file +.Fa f +of the stream +.Fa ftsp . +The +.Fn fts_set +function +returns 0 on success, and \-1 if an error occurs. +.Em Option +must be set to one of the following values: +.Bl -tag -width FTS_PHYSICAL +.It Dv FTS_AGAIN +Re-visit the file; any file type may be re-visited. +The next call to +.Fn fts_read +will return the referenced file. +The +.Fa fts_stat +and +.Fa fts_info +fields of the structure will be reinitialized at that time, +but no other fields will have been changed. +This option is meaningful only for the most recently returned +file from +.Fn fts_read . +Normal use is for post-order directory visits, where it causes the +directory to be re-visited (in both pre and post-order) as well as all +of its descendants. +.It Dv FTS_FOLLOW +The referenced file must be a symbolic link. +If the referenced file is the one most recently returned by +.Fn fts_read , +the next call to +.Fn fts_read +returns the file with the +.Fa fts_info +and +.Fa fts_statp +fields reinitialized to reflect the target of the symbolic link instead +of the symbolic link itself. +If the file is one of those most recently returned by +.Fn fts_children , +the +.Fa fts_info +and +.Fa fts_statp +fields of the structure, when returned by +.Fn fts_read , +will reflect the target of the symbolic link instead of the symbolic link +itself. +In either case, if the target of the symbolic link does not exist the +fields of the returned structure will be unchanged and the +.Fa fts_info +field will be set to +.Dv FTS_SLNONE . +.Pp +If the target of the link is a directory, the pre-order return, followed +by the return of all of its descendants, followed by a post-order return, +is done. +.It Dv FTS_SKIP +No descendants of this file are visited. +The file may be one of those most recently returned by either +.Fn fts_children +or +.Fn fts_read . +.El +.Sh FTS_CLOSE +The +.Fn fts_close +function closes a file hierarchy stream +.Fa ftsp +and restores the current directory to the directory from which +.Fn fts_open +was called to open +.Fa ftsp . +The +.Fn fts_close +function +returns 0 on success, and \-1 if an error occurs. +.Sh ERRORS +The function +.Fn fts_open +may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr open 2 +and +.Xr malloc 3 . +.Pp +The function +.Fn fts_close +may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr chdir 2 +and +.Xr close 2 . +.Pp +The functions +.Fn fts_read +and +.Fn fts_children +may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr chdir 2 , +.Xr malloc 3 , +.Xr opendir 3 , +.Xr readdir 3 +and +.Xr stat 2 . +.Pp +In addition, +.Fn fts_children , +.Fn fts_open +and +.Fn fts_set +may fail and set +.Va errno +as follows: +.Bl -tag -width Er +.It Bq Er EINVAL +The options were invalid. +.El +.Sh SEE ALSO +.Xr find 1 , +.Xr chdir 2 , +.Xr stat 2 , +.Xr qsort 3 , +.Xr qsort_b 3 +.Sh STANDARDS +The +.Nm +utility is expected to be included in a future +.St -p1003.1-88 +revision. diff --git a/gen/fts.c b/gen/fts.c new file mode 100644 index 0000000..2377f49 --- /dev/null +++ b/gen/fts.c @@ -0,0 +1,1582 @@ +/* + * Copyright (c) 1999, 2000, 2003, 2005, 2008, 2012, 2016 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $OpenBSD: fts.c,v 1.51 2015/09/12 13:32:24 guenther Exp $ */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __BLOCKS__ +#include +#endif /* __BLOCKS__ */ +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +static FTSENT *fts_alloc(FTS *, char *, ssize_t); +static FTSENT *fts_build(FTS *, int); +static void fts_lfree(FTSENT *); +static void fts_load(FTS *, FTSENT *); +static size_t fts_maxarglen(char * const *); +static void fts_padjust(FTS *, FTSENT *); +static int fts_palloc(FTS *, size_t); +static FTSENT *fts_sort(FTS *, FTSENT *, int); +static u_short fts_stat(FTS *, FTSENT *, int, int); +static u_short fts_stat2(FTS *, FTSENT *, int, int, struct stat *); +static int fts_safe_changedir(FTS *, FTSENT *, int, char *); + +#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) + +#define CLR(opt) (sp->fts_options &= ~(opt)) +#define ISSET(opt) (sp->fts_options & (opt)) +#define SET(opt) (sp->fts_options |= (opt)) + +#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd)) + +/* fts_build flags */ +#define BCHILD 1 /* fts_children */ +#define BNAMES 2 /* fts_children, names only */ +#define BREAD 3 /* fts_read */ + +/* 5653270 + * For directories containing > 64k subdirectories (or HFS+ with > 64k files + * and subdirectories), struct stat's st_nlink (16 bits) will overflow. This + * causes the case with FTS_NOSTAT and FTS_PHYSICAL set to prematurely stop + * recursing into subdirectories, because of an optimization that expects + * st_nlink to be the number of subdirectories (once that number has been + * encountered, no further calls to stat should be needed). + * + * However, on Mac OS X, another optimization largely nullifies the st_nlink + * optimization. struct dirent contains d_type, which can distinguish + * directories from files without initially calling stat. So stat is only + * called on known directories, rather than on other files. With this + * optimization, the difference in also using the st_nlink optimization is + * pretty minimal (tests show an improvement of a percent or two, probably + * due to additional if statement clauses that need to be evaluated). + * + * So removing the st_nlink optimization code will fix the > 64k subdirectories + * problem. And if we replace the multiple if clause logic with a single + * switch statement, we can recover the minimal performance lose. We can + * go even further and for the case of FTS_NOSTAT and FTS_LOGICAL set, we + * can use d_type to also distinguish symbolic links, and so we only need to + * call stat on directories and symlinks, not on all files. This provides + * a significant performance boost in that special case. + */ +/* + * The following macros defines values of the dostat variable, which is or-ed + * with the value of d_type, and the result used in a switch statement to + * determine whether to call stat or not. (We order the macros to minimize + * the size of any jump table that the compiler may generate.) + */ +#define F_SHIFT 4 /* shift to leave space for d_type */ +#define F_NOSTAT (0 << F_SHIFT) /* don't do any stat's */ +#define F_STATDIRSYM (1 << F_SHIFT) /* only stat directories and symlinks (and unknowns) */ +#define F_ALWAYSSTAT (2 << F_SHIFT) /* always stat */ +#define F_STATDIR (3 << F_SHIFT) /* only stat directories (and unknowns) */ +#define F_D_TYPE (4 << F_SHIFT) /* only stat directories but use d_type */ +#define F_D_TYPESYM (5 << F_SHIFT) /* only stat directories and symlinks but use d_type */ + +static FTS * +__fts_open(char * const *argv, FTS *sp) +{ + FTSENT *p, *root; + int nitems; + FTSENT *parent, *tmp; + ssize_t len; + + /* Logical walks turn on NOCHDIR; symbolic links are too hard. */ + if (ISSET(FTS_LOGICAL)) + SET(FTS_NOCHDIR); + + /* + * Start out with 1K of path space, and enough, in any case, + * to hold the user's paths. + */ + if (fts_palloc(sp, MAX(fts_maxarglen(argv), PATH_MAX))) + goto mem1; + + /* Allocate/initialize root's parent. */ + if ((parent = fts_alloc(sp, "", 0)) == NULL) + goto mem2; + parent->fts_level = FTS_ROOTPARENTLEVEL; + + /* Allocate/initialize root(s). */ + for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) { + len = strlen(*argv); + if ((p = fts_alloc(sp, *argv, len)) == NULL) + goto mem3; + p->fts_level = FTS_ROOTLEVEL; + p->fts_parent = parent; + p->fts_accpath = p->fts_name; + p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOWDIR) ? -1 : ISSET(FTS_COMFOLLOW), -1); + + /* Command-line "." and ".." are real directories. */ + if (p->fts_info == FTS_DOT) + p->fts_info = FTS_D; + + /* + * If comparison routine supplied, traverse in sorted + * order; otherwise traverse in the order specified. + */ + if (sp->fts_compar) { + p->fts_link = root; + root = p; + } else { + p->fts_link = NULL; + if (root == NULL) + tmp = root = p; + else { + tmp->fts_link = p; + tmp = p; + } + } + } + if (sp->fts_compar && nitems > 1) + root = fts_sort(sp, root, nitems); + + /* + * Allocate a dummy pointer and make fts_read think that we've just + * finished the node before the root(s); set p->fts_info to FTS_INIT + * so that everything about the "current" node is ignored. + */ + if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL) + goto mem3; + sp->fts_cur->fts_link = root; + sp->fts_cur->fts_info = FTS_INIT; + + /* + * If using chdir(2), grab a file descriptor pointing to dot to ensure + * that we can get back here; this could be avoided for some paths, + * but almost certainly not worth the effort. Slashes, symbolic links, + * and ".." are all fairly nasty problems. Note, if we can't get the + * descriptor we run anyway, just more slowly. + */ + if (!ISSET(FTS_NOCHDIR) && + (sp->fts_rfd = open(".", O_RDONLY | O_CLOEXEC)) < 0) + SET(FTS_NOCHDIR); + + if (nitems == 0) + free(parent); + + return (sp); + +mem3: fts_lfree(root); + free(parent); +mem2: free(sp->fts_path); +mem1: free(sp); + return (NULL); +} + +FTS * +fts_open(char * const *argv, int options, int (*compar)()) +{ + FTS *sp; + + /* Options check. */ + if (options & ~FTS_OPTIONMASK) { + errno = EINVAL; + return (NULL); + } + if (options & FTS_NOSTAT_TYPE) options |= FTS_NOSTAT; + + /* Allocate/initialize the stream */ + if ((sp = calloc(1, sizeof(FTS))) == NULL) + return (NULL); + sp->fts_compar = compar; + sp->fts_options = options; + + return __fts_open(argv, sp); +} + +#ifdef __BLOCKS__ +FTS * +fts_open_b(char * const *argv, int options, int (^compar)(const FTSENT **, const FTSENT **)) +{ + FTS *sp; + + /* Options check. */ + if (options & ~FTS_OPTIONMASK) { + errno = EINVAL; + return (NULL); + } + if (options & FTS_NOSTAT_TYPE) options |= FTS_NOSTAT; + + /* Allocate/initialize the stream */ + if ((sp = calloc(1, sizeof(FTS))) == NULL) + return (NULL); + sp->fts_compar_b = (int (^)())Block_copy(compar); + sp->fts_options = options | FTS_BLOCK_COMPAR; + + return __fts_open(argv, sp); +} +#endif /* __BLOCKS__ */ + +static void +fts_load(FTS *sp, FTSENT *p) +{ + ssize_t len; + char *cp; + + /* + * Load the stream structure for the next traversal. Since we don't + * actually enter the directory until after the preorder visit, set + * the fts_accpath field specially so the chdir gets done to the right + * place and the user can access the first node. From fts_open it's + * known that the path will fit. + */ + len = p->fts_pathlen = p->fts_namelen; + memmove(sp->fts_path, p->fts_name, len + 1); + if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) { + len = strlen(++cp); + memmove(p->fts_name, cp, len + 1); + p->fts_namelen = len; + } + p->fts_accpath = p->fts_path = sp->fts_path; + sp->fts_dev = p->fts_dev; +} + +int +fts_close(FTS *sp) +{ + FTSENT *freep, *p; + int rfd, error = 0; + + /* + * This still works if we haven't read anything -- the dummy structure + * points to the root list, so we step through to the end of the root + * list which has a valid parent pointer. + */ + if (sp->fts_cur) { + for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) { + freep = p; + p = p->fts_link ? p->fts_link : p->fts_parent; + free(freep); + } + free(p); + } + + /* Stash the original directory fd if needed. */ + rfd = ISSET(FTS_NOCHDIR) ? -1 : sp->fts_rfd; + + /* Free up child linked list, sort array, path buffer, stream ptr.*/ + if (sp->fts_child){ + fts_lfree(sp->fts_child); + } + free(sp->fts_array); sp->fts_array = NULL; + free(sp->fts_path); sp->fts_path = NULL; + +#ifdef __BLOCKS__ + /* Free up any block pointer. */ + if (ISSET(FTS_BLOCK_COMPAR) && sp->fts_compar_b != NULL) + Block_release(sp->fts_compar_b); +#endif /* __BLOCKS__ */ + + /* Free up the stream pointer. */ + free(sp); + + /* Return to original directory, checking for error. */ + if (rfd != -1) { + int saved_errno = errno; + if (fchdir(rfd) != 0){ + error = -1; + saved_errno = errno; + } + if (close(rfd) != 0){ + error = -1; + saved_errno = errno; + } + errno = saved_errno; + } + + return (error); +} + +/* + * Special case a root of "/" so that slashes aren't appended which would + * cause paths to be written as "//foo". + */ +#define NAPPEND(p) \ + (p->fts_level == FTS_ROOTLEVEL && p->fts_pathlen == 1 && \ + p->fts_path[0] == '/' ? 0 : p->fts_pathlen) + +FTSENT * +fts_read(FTS *sp) +{ + FTSENT *p, *tmp; + int instr; + char *t; + int saved_errno; + + /* If finished or unrecoverable error, return NULL. */ + if (sp->fts_cur == NULL || ISSET(FTS_STOP)) + return (NULL); + + /* Set current node pointer. */ + p = sp->fts_cur; + + /* Save and zero out user instructions. */ + instr = p->fts_instr; + p->fts_instr = FTS_NOINSTR; + + /* Any type of file may be re-visited; re-stat and re-turn. */ + if (instr == FTS_AGAIN) { + p->fts_info = fts_stat(sp, p, 0, -1); + return (p); + } + + /* + * Following a symlink -- SLNONE test allows application to see + * SLNONE and recover. If indirecting through a symlink, have + * keep a pointer to current location. If unable to get that + * pointer, follow fails. + */ + if (instr == FTS_FOLLOW && + (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) { + p->fts_info = fts_stat(sp, p, 1, -1); + if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { + if ((p->fts_symfd = + open(".", O_RDONLY | O_CLOEXEC)) < 0) { + p->fts_errno = errno; + p->fts_info = FTS_ERR; + } else { + p->fts_flags |= FTS_SYMFOLLOW; + } + } + return (p); + } + + /* Directory in pre-order. */ + if (p->fts_info == FTS_D) { + /* If skipped or crossed mount point, do post-order visit. */ + if (instr == FTS_SKIP || + (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) { + if (p->fts_flags & FTS_SYMFOLLOW) + (void)close(p->fts_symfd); + if (sp->fts_child) { + fts_lfree(sp->fts_child); + sp->fts_child = NULL; + } + p->fts_info = FTS_DP; + return (p); + } + + /* Rebuild if only read the names and now traversing. */ + if (sp->fts_child && ISSET(FTS_NAMEONLY)) { + CLR(FTS_NAMEONLY); + fts_lfree(sp->fts_child); + sp->fts_child = NULL; + } + + /* + * Cd to the subdirectory. + * + * If have already read and now fail to chdir, whack the list + * to make the names come out right, and set the parent errno + * so the application will eventually get an error condition. + * Set the FTS_DONTCHDIR flag so that when we logically change + * directories back to the parent we don't do a chdir. + * + * If haven't read do so. If the read fails, fts_build sets + * FTS_STOP or the fts_info field of the node. + */ + if (sp->fts_child) { + if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) { + p->fts_errno = errno; + p->fts_flags |= FTS_DONTCHDIR; + for (p = sp->fts_child; p; p = p->fts_link) + p->fts_accpath = + p->fts_parent->fts_accpath; + } + } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) { + if (ISSET(FTS_STOP)) + return (NULL); + return (p); + } + p = sp->fts_child; + sp->fts_child = NULL; + goto name; + } + + /* Move to the next node on this level. */ +next: tmp = p; + if ((p = p->fts_link)) { + free(tmp); + + /* + * If reached the top, return to the original directory (or + * the root of the tree), and load the paths for the next root. + */ + if (p->fts_level == FTS_ROOTLEVEL) { + if (FCHDIR(sp, sp->fts_rfd)) { + SET(FTS_STOP); + return (NULL); + } + fts_load(sp, p); + return (sp->fts_cur = p); + } + + /* + * User may have called fts_set on the node. If skipped, + * ignore. If followed, get a file descriptor so we can + * get back if necessary. + */ + if (p->fts_instr == FTS_SKIP) { + goto next; + } + if (p->fts_instr == FTS_FOLLOW) { + p->fts_info = fts_stat(sp, p, 1, -1); + if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { + if ((p->fts_symfd = + open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) { + p->fts_errno = errno; + p->fts_info = FTS_ERR; + } else { + p->fts_flags |= FTS_SYMFOLLOW; + } + } + p->fts_instr = FTS_NOINSTR; + } + +name: t = sp->fts_path + NAPPEND(p->fts_parent); + *t++ = '/'; + memmove(t, p->fts_name, p->fts_namelen + 1); + return (sp->fts_cur = p); + } + + /* Move up to the parent node. */ + p = tmp->fts_parent; + free(tmp); + + if (p->fts_level == FTS_ROOTPARENTLEVEL) { + /* + * Done; free everything up and set errno to 0 so the user + * can distinguish between error and EOF. + */ + free(p); + errno = 0; + return (sp->fts_cur = NULL); + } + + /* NUL terminate the pathname. */ + sp->fts_path[p->fts_pathlen] = '\0'; + + /* + * Return to the parent directory. If at a root node or came through + * a symlink, go back through the file descriptor. Otherwise, cd up + * one directory. + */ + if (p->fts_level == FTS_ROOTLEVEL) { + if (FCHDIR(sp, sp->fts_rfd)) { + SET(FTS_STOP); + sp->fts_cur = p; + return (NULL); + } + } else if (p->fts_flags & FTS_SYMFOLLOW) { + if (FCHDIR(sp, p->fts_symfd)) { + saved_errno = errno; + (void)close(p->fts_symfd); + errno = saved_errno; + SET(FTS_STOP); + sp->fts_cur = p; + return (NULL); + } + (void)close(p->fts_symfd); + } else if (!(p->fts_flags & FTS_DONTCHDIR) && + fts_safe_changedir(sp, p->fts_parent, -1, "..")) { + SET(FTS_STOP); + sp->fts_cur = p; + return (NULL); + } + p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP; + return (sp->fts_cur = p); +} + +/* + * Fts_set takes the stream as an argument although it's not used in this + * implementation; it would be necessary if anyone wanted to add global + * semantics to fts using fts_set. An error return is allowed for similar + * reasons. + */ +/* ARGSUSED */ +int +fts_set(FTS __unused *sp, FTSENT *p, int instr) +{ + if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW && + instr != FTS_NOINSTR && instr != FTS_SKIP) { + errno = EINVAL; + return (1); + } + p->fts_instr = instr; + return (0); +} + +FTSENT * +fts_children(FTS *sp, int instr) +{ + FTSENT *p; + int fd; + + if (instr && instr != FTS_NAMEONLY) { + errno = EINVAL; + return (NULL); + } + + /* Set current node pointer. */ + p = sp->fts_cur; + + /* + * Errno set to 0 so user can distinguish empty directory from + * an error. + */ + errno = 0; + + /* Fatal errors stop here. */ + if (ISSET(FTS_STOP)) + return (NULL); + + /* Return logical hierarchy of user's arguments. */ + if (p->fts_info == FTS_INIT) + return (p->fts_link); + + /* + * If not a directory being visited in pre-order, stop here. Could + * allow FTS_DNR, assuming the user has fixed the problem, but the + * same effect is available with FTS_AGAIN. + */ + if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */) + return (NULL); + + /* Free up any previous child list. */ + if (sp->fts_child) + fts_lfree(sp->fts_child); + + if (instr == FTS_NAMEONLY) { + SET(FTS_NAMEONLY); + instr = BNAMES; + } else + instr = BCHILD; + + /* + * If using chdir on a relative path and called BEFORE fts_read does + * its chdir to the root of a traversal, we can lose -- we need to + * chdir into the subdirectory, and we don't know where the current + * directory is, so we can't get back so that the upcoming chdir by + * fts_read will work. + */ + if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' || + ISSET(FTS_NOCHDIR)) + return (sp->fts_child = fts_build(sp, instr)); + + if ((fd = open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) + return (NULL); + sp->fts_child = fts_build(sp, instr); + if (fchdir(fd)) { + (void)close(fd); + return (NULL); + } + (void)close(fd); + return (sp->fts_child); +} + +typedef struct __attribute__((packed)) __attribute__((__aligned__(4))) { + uint32_t length; + + /* common attributes */ + attribute_set_t attrset; + attrreference_t name; + dev_t st_dev; + fsobj_type_t objtype; + struct timespec st_birthtimespec; + struct timespec st_mtimespec; + struct timespec st_ctimespec; + struct timespec st_atimespec; + uid_t st_uid; + gid_t st_gid; + uint32_t accessmask; + uint32_t st_flags; + uint64_t st_ino; + + /* non-directory attributes */ + uint32_t st_nlink; + off_t allocsize; + uint32_t st_blksize; + uint32_t st_rdev; + off_t st_size; +} attrListAttributes; + +typedef struct __attribute__((packed)) { + uint32_t length; + + /* common attributes */ + attribute_set_t attrset; + attrreference_t name; + dev_t st_dev; + fsobj_type_t objtype; + uint64_t st_ino; + + /* non-directory attributes */ + uint32_t st_nlink; + uint32_t st_rdev; +} attrListAttributes_nostat; + +#define ATTR_BUF_SIZE (32*1024) + +typedef struct { + DIR *dirp; + + struct attrlist requested_attrs; + void *attrbuf; + union { + attrListAttributes *curattr; + attrListAttributes_nostat *curattr_nostat; + }; + int dirfd; + bool done; + bool nostat; + bool needs_dot; + bool needs_dotdot; + + int entry_count; + int cur_entry; +} dir_handle; + +typedef struct { + char *d_name; + size_t d_namlen; + struct stat sb; + int d_type; + bool stat_valid; +} dir_entry; + +static bool +advance_directory(dir_handle *handle) +{ + if (handle->done) return true; + + os_assert(handle->dirfd != -1); + handle->entry_count = getattrlistbulk(handle->dirfd, &handle->requested_attrs, + handle->attrbuf, ATTR_BUF_SIZE, FSOPT_PACK_INVAL_ATTRS); + if (handle->entry_count == -1) { + goto error; + } else if (handle->entry_count == 0) { + /* No more entries. */ + handle->done = true; + } + handle->cur_entry = 0; + handle->curattr = handle->attrbuf; + return true; + +error: { + int saved_errno = errno; + close(handle->dirfd); + handle->dirfd = -1; + errno = saved_errno; + return false; + } +} + +static bool +open_directory(FTS *sp, dir_handle *handle, const char *path) +{ + memset(handle, 0, sizeof(*handle)); + + handle->nostat = ISSET(FTS_NOSTAT); + handle->needs_dot = handle->needs_dotdot = ISSET(FTS_SEEDOT); + + handle->dirfd = open(path, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC); + if (handle->dirfd == -1) goto fallback; + + handle->attrbuf = malloc(ATTR_BUF_SIZE); + if (!handle->attrbuf) goto fallback; + + handle->requested_attrs.bitmapcount = ATTR_BIT_MAP_COUNT; + if (!handle->nostat) { + handle->requested_attrs.commonattr = + ATTR_CMN_RETURNED_ATTRS| + ATTR_CMN_NAME|ATTR_CMN_DEVID|ATTR_CMN_OBJTYPE| + ATTR_CMN_CRTIME|ATTR_CMN_MODTIME|ATTR_CMN_CHGTIME|ATTR_CMN_ACCTIME| + ATTR_CMN_OWNERID|ATTR_CMN_GRPID|ATTR_CMN_ACCESSMASK|ATTR_CMN_FLAGS| + ATTR_CMN_FILEID; + handle->requested_attrs.fileattr = ATTR_FILE_LINKCOUNT|ATTR_FILE_ALLOCSIZE| + ATTR_FILE_IOBLOCKSIZE|ATTR_FILE_DEVTYPE|ATTR_FILE_DATALENGTH; + } else { + handle->requested_attrs.commonattr = ATTR_CMN_RETURNED_ATTRS| + ATTR_CMN_NAME|ATTR_CMN_DEVID|ATTR_CMN_OBJTYPE| + ATTR_CMN_FILEID; + handle->requested_attrs.fileattr = ATTR_FILE_LINKCOUNT; + } + + if (advance_directory(handle)) { + /* + * We successfully read the first attribute buffer, + * so we'll use getdirentriesattr/getattrlistbulk. + */ + return true; + } + +fallback: + if (handle->dirfd != -1) close(handle->dirfd); + handle->dirfd = -1; + free(handle->attrbuf); + handle->attrbuf = NULL; + handle->dirp = opendir(path); + return (handle->dirp != NULL); +} + +static bool +read_dirent(dir_handle *handle, dir_entry *entry) +{ + if (handle->dirp) { + struct dirent *de = readdir(handle->dirp); + if (de == NULL) return false; + entry->d_name = de->d_name; + entry->d_namlen = de->d_namlen; + entry->d_type = de->d_type; + entry->stat_valid = false; + return true; + } + + /* + * There are three states that our dir_handle can be in: + * - real getattrlistbulk use (entry_count >= 0) - the rest of this function + * - fallback - handled above with dirp + * - closed fallback (dirp == NULL) - handled with this check + */ + if (handle->dirfd == -1) { + return false; + } + + if (handle->needs_dot) { + handle->needs_dot = false; + entry->d_name = "."; + entry->d_namlen = strlen("."); + entry->d_type = DT_DIR; + entry->stat_valid = false; + return true; + } else if (handle->needs_dotdot) { + handle->needs_dotdot = false; + entry->d_name = ".."; + entry->d_namlen = strlen(".."); + entry->d_type = DT_DIR; + entry->stat_valid = false; + return true; + } + + if (handle->cur_entry == handle->entry_count) { + if (handle->done) return false; /* Already done with the directory. */ + if (!advance_directory(handle)) return false; /* Reading the next buffer failed. */ + if (handle->done) return false; /* We're now done with the directory. */ + } + + bzero(entry, sizeof(*entry)); + + attrListAttributes *curattr_stat = NULL; + attrListAttributes_nostat *curattr_nostat = NULL; + if (!handle->nostat) { + curattr_stat = handle->curattr; + handle->cur_entry++; + handle->curattr = (attrListAttributes*)(((char*)curattr_stat) + curattr_stat->length); + os_assert((handle->cur_entry == handle->entry_count) || + (void*)handle->curattr + handle->curattr->length <= (void*)handle->attrbuf + ATTR_BUF_SIZE); + + os_assert(curattr_stat->name.attr_length > 0); + entry->d_name = ((char*)&curattr_stat->name) + curattr_stat->name.attr_dataoffset; + /* attr_length includes the null terminator, but readdir's d_namlen doesn't. */ + entry->d_namlen = curattr_stat->name.attr_length - 1; + os_assert((void*)entry->d_name + curattr_stat->name.attr_length <= (void*)handle->attrbuf + ATTR_BUF_SIZE); + } else { + curattr_nostat = handle->curattr_nostat; + handle->cur_entry++; + handle->curattr_nostat = (attrListAttributes_nostat*)(((char*)curattr_nostat) + curattr_nostat->length); + os_assert((handle->cur_entry == handle->entry_count) || + (void*)handle->curattr + handle->curattr->length <= (void*)handle->attrbuf + ATTR_BUF_SIZE); + + os_assert(curattr_nostat->name.attr_length > 0); + entry->d_name = ((char*)&curattr_nostat->name) + curattr_nostat->name.attr_dataoffset; + /* attr_length includes the null terminator, but readdir's d_namlen doesn't. */ + entry->d_namlen = curattr_nostat->name.attr_length - 1; + os_assert((void*)entry->d_name + curattr_nostat->name.attr_length <= (void*)handle->attrbuf + ATTR_BUF_SIZE); + } + + int stat_type = 0; + + switch (handle->nostat ? curattr_nostat->objtype : curattr_stat->objtype) { + case VREG: + entry->d_type = DT_REG; + stat_type = S_IFREG; + break; + case VDIR: + entry->d_type = DT_DIR; + /* Force a stat call so we don't have to guess on st_size, st_blocks, etc. */ + // stat_type = S_IFDIR; + break; + case VBLK: + entry->d_type = DT_BLK; + stat_type = S_IFBLK; + break; + case VCHR: + entry->d_type = DT_CHR; + stat_type = S_IFCHR; + break; + case VLNK: + entry->d_type = DT_LNK; + stat_type = S_IFLNK; + break; + case VSOCK: + entry->d_type = DT_SOCK; + stat_type = S_IFSOCK; + break; + case VFIFO: + entry->d_type = DT_FIFO; + stat_type = S_IFIFO; + break; + default: + entry->d_type = DT_UNKNOWN; + break; + } + + if (!handle->nostat && stat_type) { + entry->stat_valid = true; + + /* + * Make sure we got all the attributes we need to fill out a stat structure. + */ + + attrgroup_t requiredCommon = handle->requested_attrs.commonattr; + attrgroup_t requiredFile = handle->requested_attrs.fileattr; + + if ((entry->d_type != DT_BLK) && (entry->d_type != DT_CHR)) { + /* It's okay for ATTR_FILE_DEVTYPE to be missing if the entry isn't a block or character device. */ + curattr_stat->st_rdev = 0; + requiredFile &= ~ATTR_FILE_DEVTYPE; + } + + if ((curattr_stat->attrset.commonattr & ATTR_CMN_CRTIME) == 0) { + /* Many (most?) file systems don't support create time (see vn_stat_noauth in xnu) */ + curattr_stat->st_birthtimespec.tv_sec = curattr_stat->st_birthtimespec.tv_nsec = 0; + requiredCommon &= ~ ATTR_CMN_CRTIME; + } + + if ((curattr_stat->attrset.commonattr & requiredCommon) != requiredCommon || + (curattr_stat->attrset.fileattr & requiredFile) != requiredFile) { + /* Some of our required attributes are missing. */ + entry->stat_valid = false; + } + } else { + entry->stat_valid = false; + } + + if (entry->stat_valid) { + +#define COPY_FIELD(fld) entry->sb.fld = curattr_stat->fld + COPY_FIELD(st_dev); + /* COPY_FIELD(st_mode); Handled below. */ + COPY_FIELD(st_nlink); + COPY_FIELD(st_ino); + COPY_FIELD(st_uid); + COPY_FIELD(st_gid); + COPY_FIELD(st_rdev); + COPY_FIELD(st_atimespec); + COPY_FIELD(st_mtimespec); + COPY_FIELD(st_ctimespec); +#if __DARWIN_64_BIT_INO_T + COPY_FIELD(st_birthtimespec); +#endif /* __DARWIN_64_BIT_INO_T */ + COPY_FIELD(st_size); + /* COPY_FIELD(st_blocks); Handled below. */ + COPY_FIELD(st_blksize); + COPY_FIELD(st_flags); +#undef COPY_FIELD + + /* We have to handle some fields specially. */ + entry->sb.st_mode = (curattr_stat->accessmask & ~S_IFMT) | stat_type; + entry->sb.st_blocks = howmany(curattr_stat->allocsize, 512); /* Matches vn_stat implementation in xnu. */ + } + return true; +} + +static int +dir_fd(dir_handle *handle) +{ + return handle->dirp ? dirfd(handle->dirp) : handle->dirfd; +} + +static void +close_directory(dir_handle *handle) +{ + if (handle->dirp) { + closedir(handle->dirp); + handle->dirp = NULL; + } + if (handle->dirfd != -1) { + close(handle->dirfd); + handle->dirfd = -1; + } + free(handle->attrbuf); + handle->attrbuf = NULL; +} + +/* + * This is the tricky part -- do not casually change *anything* in here. The + * idea is to build the linked list of entries that are used by fts_children + * and fts_read. There are lots of special cases. + * + * The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is + * set, we can use d_type to determine if the entry is a directory (or for + * logical walks, a directory or symlink) and not call stat for other file + * types. This cuts the number of stat calls significantly. + */ +static FTSENT * +fts_build(FTS *sp, int type) +{ + dir_entry de = { 0 }; + dir_entry *dp = &de; + FTSENT *p, *head; + int nitems; + FTSENT *cur, *tail; + dir_handle dirp; + void *oldaddr; + int len, maxlen; + int cderrno, descend, level, dostat, doadjust; + int saved_errno; + char *cp; + + /* Set current node pointer. */ + cur = sp->fts_cur; + + /* + * Open the directory for reading. If this fails, we're done. + * If being called from fts_read, set the fts_info field. + */ + if (!open_directory(sp, &dirp, cur->fts_accpath)) { + if (type == BREAD) { + cur->fts_info = FTS_DNR; + cur->fts_errno = errno; + } + return (NULL); + } + + if (type == BNAMES) + dostat = F_NOSTAT; + else if (ISSET(FTS_NOSTAT_TYPE)) + dostat = ISSET(FTS_PHYSICAL) ? F_D_TYPE : F_D_TYPESYM; + else if (ISSET(FTS_NOSTAT)) + dostat = ISSET(FTS_PHYSICAL) ? F_STATDIR : F_STATDIRSYM; + else + dostat = F_ALWAYSSTAT; + +#ifdef notdef + (void)printf("dostat == %d\n", dostat); + (void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n", + ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT)); +#endif + /* + * If we're going to need to stat anything or we want to descend + * and stay in the directory, chdir. If this fails we keep going, + * but set a flag so we don't chdir after the post-order visit. + * We won't be able to stat anything, but we can still return the + * names themselves. Note, that since fts_read won't be able to + * chdir into the directory, it will have to return different path + * names than before, i.e. "a/b" instead of "b". Since the node + * has already been visited in pre-order, have to wait until the + * post-order visit to return the error. There is a special case + * here, if there was nothing to stat then it's not an error to + * not be able to stat. This is all fairly nasty. If a program + * needed sorted entries or stat information, they had better be + * checking FTS_NS on the returned nodes. + */ + cderrno = 0; + if (dostat || type == BREAD) { + if (fts_safe_changedir(sp, cur, dir_fd(&dirp), NULL)) { + if (dostat && type == BREAD) { + cur->fts_errno = errno; + } + cur->fts_flags |= FTS_DONTCHDIR; + descend = 0; + cderrno = errno; + close_directory(&dirp); + } else { + descend = 1; + } + } else { + descend = 0; + } + + /* + * Figure out the max file name length that can be stored in the + * current path -- the inner loop allocates more path as necessary. + * We really wouldn't have to do the maxlen calculations here, we + * could do them in fts_read before returning the path, but it's a + * lot easier here since the length is part of the dirent structure. + * + * If not changing directories set a pointer so that can just append + * each new name into the path. + */ + len = NAPPEND(cur); + if (ISSET(FTS_NOCHDIR)) { + cp = sp->fts_path + len; + *cp++ = '/'; + } + len++; + maxlen = sp->fts_pathlen - len; + + /* + * fts_level is signed so we must prevent it from wrapping + * around to FTS_ROOTLEVEL and FTS_ROOTPARENTLEVEL. + */ + level = cur->fts_level; + if (level < FTS_MAXLEVEL) + level++; + + /* Read the directory, attaching each entry to the `link' pointer. */ + doadjust = 0; + for (head = tail = NULL, nitems = 0; read_dirent(&dirp, dp) ; ) { + if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name)) + continue; + + if ((p = fts_alloc(sp, dp->d_name, (int)dp->d_namlen)) == NULL) + goto mem1; + if (dp->d_namlen >= (size_t)maxlen) { /* include space for NUL */ + oldaddr = sp->fts_path; + if (fts_palloc(sp, dp->d_namlen +len + 1)) { + /* + * No more memory for path or structures. Save + * errno, free up the current structure and the + * structures already allocated. + */ +mem1: saved_errno = errno; + free(p); + fts_lfree(head); + close_directory(&dirp); + cur->fts_info = FTS_ERR; + SET(FTS_STOP); + errno = saved_errno; + return (NULL); + } + /* Did realloc() change the pointer? */ + if (oldaddr != sp->fts_path) { + doadjust = 1; + if (ISSET(FTS_NOCHDIR)) + cp = sp->fts_path + len; + } + maxlen = sp->fts_pathlen - len; + } + + if (len + dp->d_namlen >= USHRT_MAX) { + /* + * In an FTSENT, fts_pathlen is a u_short so it is + * possible to wraparound here. If we do, free up + * the current structure and the structures already + * allocated, then error out with ENAMETOOLONG. + */ + free(p); + fts_lfree(head); + close_directory(&dirp); + cur->fts_info = FTS_ERR; + SET(FTS_STOP); + errno = ENAMETOOLONG; + return (NULL); + } + p->fts_level = level; + p->fts_parent = sp->fts_cur; + p->fts_pathlen = len + dp->d_namlen; + + if (cderrno) { + if (dostat) { + p->fts_info = FTS_NS; + p->fts_errno = cderrno; + } else + p->fts_info = FTS_NSOK; + p->fts_accpath = cur->fts_accpath; + } else { + /* + * We need to know all file types values that d_type may + * be set to. So if that changes, the following needs + * to be modified appropriately. + */ + switch(dostat | dp->d_type) { + case (F_STATDIR | DT_UNKNOWN): + case (F_STATDIR | DT_DIR): + case (F_STATDIRSYM | DT_UNKNOWN): + case (F_STATDIRSYM | DT_DIR): + case (F_STATDIRSYM | DT_LNK): + case (F_ALWAYSSTAT | DT_UNKNOWN): + case (F_ALWAYSSTAT | DT_FIFO): + case (F_ALWAYSSTAT | DT_CHR): + case (F_ALWAYSSTAT | DT_DIR): + case (F_ALWAYSSTAT | DT_BLK): + case (F_ALWAYSSTAT | DT_REG): + case (F_ALWAYSSTAT | DT_LNK): + case (F_ALWAYSSTAT | DT_SOCK): + case (F_ALWAYSSTAT | DT_WHT): + case (F_D_TYPE | DT_UNKNOWN): + case (F_D_TYPE | DT_DIR): + case (F_D_TYPESYM | DT_UNKNOWN): + case (F_D_TYPESYM | DT_DIR): + case (F_D_TYPESYM | DT_LNK): + /* Build a file name for fts_stat to stat. */ + if (ISSET(FTS_NOCHDIR)) { + p->fts_accpath = p->fts_path; + memmove(cp, p->fts_name, p->fts_namelen + 1); + p->fts_info = fts_stat2(sp, p, 0, dir_fd(&dirp), dp->stat_valid ? &dp->sb : NULL); + } else { + p->fts_accpath = p->fts_name; + p->fts_info = fts_stat2(sp, p, 0, -1, dp->stat_valid ? &dp->sb : NULL); + } + break; + case (F_D_TYPE | DT_FIFO): + case (F_D_TYPE | DT_CHR): + case (F_D_TYPE | DT_BLK): + case (F_D_TYPE | DT_SOCK): + case (F_D_TYPESYM | DT_FIFO): + case (F_D_TYPESYM | DT_CHR): + case (F_D_TYPESYM | DT_BLK): + case (F_D_TYPESYM | DT_SOCK): + p->fts_info = FTS_DEFAULT; + goto common_no_stat; + case (F_D_TYPE | DT_REG): + case (F_D_TYPESYM | DT_REG): + p->fts_info = FTS_F; + goto common_no_stat; + case (F_D_TYPE | DT_LNK): + p->fts_info = FTS_SL; + goto common_no_stat; + case (F_D_TYPE | DT_WHT): + case (F_D_TYPESYM | DT_WHT): + p->fts_info = FTS_W; + goto common_no_stat; + default: + /* No stat necessary */ + p->fts_info = FTS_NSOK; +common_no_stat: + p->fts_accpath = + ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name; + break; + } + } + + /* We walk in directory order so "ls -f" doesn't get upset. */ + p->fts_link = NULL; + if (head == NULL) + head = tail = p; + else { + tail->fts_link = p; + tail = p; + } + ++nitems; + } + close_directory(&dirp); + + /* + * If realloc() changed the address of the path, adjust the + * addresses for the rest of the tree and the dir list. + */ + if (doadjust) + fts_padjust(sp, head); + + /* + * If not changing directories, reset the path back to original + * state. + */ + if (ISSET(FTS_NOCHDIR)) { + if (len == sp->fts_pathlen || nitems == 0) + --cp; + *cp = '\0'; + } + + /* + * If descended after called from fts_children or after called from + * fts_read and nothing found, get back. At the root level we use + * the saved fd; if one of fts_open()'s arguments is a relative path + * to an empty directory, we wind up here with no other way back. If + * can't get back, we're done. + */ + if (descend && (type == BCHILD || !nitems) && + (cur->fts_level == FTS_ROOTLEVEL ? FCHDIR(sp, sp->fts_rfd) : + fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) { + cur->fts_info = FTS_ERR; + SET(FTS_STOP); + return (NULL); + } + + /* If didn't find anything, return NULL. */ + if (!nitems) { + if (type == BREAD) + cur->fts_info = FTS_DP; + return (NULL); + } + + /* Sort the entries. */ + if (sp->fts_compar && nitems > 1) + head = fts_sort(sp, head, nitems); + return (head); +} + +static u_short +fts_stat(FTS *sp, FTSENT *p, int follow, int dfd) +{ + return fts_stat2(sp, p, follow, dfd, NULL); +} + +static u_short +fts_stat2(FTS *sp, FTSENT *p, int follow, int dfd, struct stat *insb) +{ + FTSENT *t; + dev_t dev; + ino_t ino; + struct stat *sbp, sb; + int saved_errno; + const char *path; + + if (dfd == -1) { + path = p->fts_accpath; + dfd = AT_FDCWD; + } else { + path = p->fts_name; + } + + /* If user needs stat info, stat buffer already allocated. */ + sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp; + + /* + * getattrlistbulk always returns information about the link, not its + * destination, so if we are doing a logical walk we need to detect links + * and do a stat anyway. + */ + if (follow) { + insb = NULL; + } else if (insb && ISSET(FTS_LOGICAL) && ((insb->st_mode & S_IFLNK) == S_IFLNK)) { + insb = NULL; + } + + if (insb) { + memcpy(sbp, insb, sizeof(*insb)); + } else if (ISSET(FTS_LOGICAL) || follow) { + /* + * If doing a logical walk, or application requested FTS_FOLLOW, do + * a stat(2). If that fails, check for a non-existent symlink. If + * fail, set the errno from the stat call. + */ + if (fstatat(dfd, path, sbp, 0)) { + saved_errno = errno; + if (!fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { + if (saved_errno == ELOOP) + p->fts_errno = ELOOP; + errno = 0; + return (FTS_SLNONE); + } + p->fts_errno = saved_errno; + goto err; + } + /* + * For FTS_COMFOLLOWDIR, drop back to lstat unless we have + * a directory + */ + if (follow == -1 && !S_ISDIR(sbp->st_mode)) { + if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { + p->fts_errno = errno; + goto err; + } + } + } else if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { + p->fts_errno = errno; +err: memset(sbp, 0, sizeof(struct stat)); + return (FTS_NS); + } + + if (S_ISDIR(sbp->st_mode)) { + /* + * Set the device/inode. Used to find cycles and check for + * crossing mount points. Also remember the link count, used + * in fts_build to limit the number of stat calls. It is + * understood that these fields are only referenced if fts_info + * is set to FTS_D. + */ + dev = p->fts_dev = sbp->st_dev; + ino = p->fts_ino = sbp->st_ino; + p->fts_nlink = sbp->st_nlink; + + if (ISDOT(p->fts_name)) + return (FTS_DOT); + + /* + * Cycle detection is done by brute force when the directory + * is first encountered. If the tree gets deep enough or the + * number of symbolic links to directories is high enough, + * something faster might be worthwhile. + */ + for (t = p->fts_parent; + t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent) + if (ino == t->fts_ino && dev == t->fts_dev) { + p->fts_cycle = t; + return (FTS_DC); + } + return (FTS_D); + } + if (S_ISLNK(sbp->st_mode)) + return (FTS_SL); + if (S_ISREG(sbp->st_mode)) + return (FTS_F); + return (FTS_DEFAULT); +} + +static FTSENT * +fts_sort(FTS *sp, FTSENT *head, int nitems) +{ + FTSENT **ap, *p; + + /* + * Construct an array of pointers to the structures and call qsort(3). + * Reassemble the array in the order returned by qsort. If unable to + * sort for memory reasons, return the directory entries in their + * current order. Allocate enough space for the current needs plus + * 40 so don't realloc one entry at a time. + */ + if (nitems > sp->fts_nitems) { + struct _ftsent **a; + + sp->fts_nitems = nitems + 40; + if ((a = reallocarray(sp->fts_array, + sp->fts_nitems, sizeof(FTSENT *))) == NULL) { + free(sp->fts_array); + sp->fts_array = NULL; + sp->fts_nitems = 0; + return (head); + } + sp->fts_array = a; + } + for (ap = sp->fts_array, p = head; p; p = p->fts_link) + *ap++ = p; +#ifdef __BLOCKS__ + if (ISSET(FTS_BLOCK_COMPAR)) + qsort_b((void *)sp->fts_array, nitems, sizeof(FTSENT *), (int (^)(const void *, const void *))sp->fts_compar_b); + else +#endif /* __BLOCKS__ */ + qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar); + for (head = *(ap = sp->fts_array); --nitems; ++ap) + ap[0]->fts_link = ap[1]; + ap[0]->fts_link = NULL; + return (head); +} + +static FTSENT * +fts_alloc(FTS *sp, char *name, ssize_t namelen) +{ + FTSENT *p; + size_t len; + + /* + * The file name is a variable length array and no stat structure is + * necessary if the user has set the nostat bit. Allocate the FTSENT + * structure, the file name and the stat structure in one chunk, but + * be careful that the stat structure is reasonably aligned. Since the + * fts_name field is declared to be of size 1, the fts_name pointer is + * namelen + 2 before the first possible address of the stat structure. + */ + len = sizeof(FTSENT) + namelen; + if (!ISSET(FTS_NOSTAT)) + len += sizeof(struct stat) + ALIGNBYTES; + if ((p = calloc(1, len)) == NULL) + return (NULL); + + p->fts_path = sp->fts_path; + p->fts_namelen = namelen; + p->fts_instr = FTS_NOINSTR; + if (!ISSET(FTS_NOSTAT)) + p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2); + memcpy(p->fts_name, name, namelen); + + return (p); +} + +static void +fts_lfree(FTSENT *head) +{ + FTSENT *p; + + /* Free a linked list of structures. */ + while ((p = head)) { + head = head->fts_link; + free(p); + } +} + +/* + * Allow essentially unlimited paths; find, rm, ls should all work on any tree. + * Most systems will allow creation of paths much longer than PATH_MAX, even + * though the kernel won't resolve them. Add the size (not just what's needed) + * plus 256 bytes so don't realloc the path 2 bytes at a time. + */ +static int +fts_palloc(FTS *sp, size_t more) +{ + char *p; + + sp->fts_pathlen += more + 256; + /* + * Check for possible wraparound. In an FTS, fts_pathlen is + * a signed int but in an FTSENT it is an unsigned short. + * We limit fts_pathlen to USHRT_MAX to be safe in both cases. + */ + if (sp->fts_pathlen < 0 || sp->fts_pathlen >= USHRT_MAX) { + free(sp->fts_path); + sp->fts_path = NULL; + errno = ENAMETOOLONG; + return (1); + } + p = realloc(sp->fts_path, sp->fts_pathlen); + if (p == NULL) { + free(sp->fts_path); + sp->fts_path = NULL; + return (1); + } + sp->fts_path = p; + return (0); +} + +/* + * When the path is realloc'd, have to fix all of the pointers in structures + * already returned. + */ +static void +fts_padjust(FTS *sp, FTSENT *head) +{ + FTSENT *p; + char *addr = sp->fts_path; + +#define ADJUST(p) { \ + if ((p)->fts_accpath != (p)->fts_name) { \ + (p)->fts_accpath = \ + (char *)addr + ((p)->fts_accpath - (p)->fts_path); \ + } \ + (p)->fts_path = addr; \ +} + /* Adjust the current set of children. */ + for (p = sp->fts_child; p; p = p->fts_link) + ADJUST(p); + + /* Adjust the rest of the tree, including the current level. */ + for (p = head; p->fts_level >= FTS_ROOTLEVEL;) { + ADJUST(p); + p = p->fts_link ? p->fts_link : p->fts_parent; + } +} + +static size_t +fts_maxarglen(char * const *argv) +{ + size_t len, max; + + for (max = 0; *argv; ++argv) + if ((len = strlen(*argv)) > max) + max = len; + return (max + 1); +} + +/* + * Change to dir specified by fd or p->fts_accpath without getting + * tricked by someone changing the world out from underneath us. + * Assumes p->fts_dev and p->fts_ino are filled in. + */ +static int +fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path) +{ + int ret, oerrno, newfd; + struct stat sb; + + newfd = fd; + if (ISSET(FTS_NOCHDIR)) + return (0); + if (fd < 0 && (newfd = open(path, O_RDONLY|O_DIRECTORY|O_CLOEXEC)) < 0) + return (-1); + if (fstat(newfd, &sb)) { + ret = -1; + goto bail; + } + /* + * On Darwin this check causes us to not correctly descend into automounts, + * since the mount point and trigger will have a different devices and + * inodes. It would be preferable to find a way to use + * ATTR_DIR_MOUNTSTATUS and DIR_MNTSTATUS_TRIGGER to detect these cases, + * but plumbing that through will be challenging. Instead, will just + * disable it for now. + */ +#if 0 + if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) { + errno = ENOENT; /* disinformation */ + ret = -1; + goto bail; + } +#endif + + ret = fchdir(newfd); +bail: + oerrno = errno; + if (fd < 0) + (void)close(newfd); + errno = oerrno; + return (ret); +} +#pragma clang diagnostic pop diff --git a/gen/ftw.3 b/gen/ftw.3 new file mode 100644 index 0000000..b6cad17 --- /dev/null +++ b/gen/ftw.3 @@ -0,0 +1,227 @@ +.\" $OpenBSD: ftw.3,v 1.4 2003/10/30 18:52:58 jmc Exp $ +.\" +.\" Copyright (c) 2003 Todd C. Miller +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" Sponsored in part by the Defense Advanced Research Projects +.\" Agency (DARPA) and Air Force Research Laboratory, Air Force +.\" Materiel Command, USAF, under agreement number F39502-99-1-0512. +.\" +.Dd May 20, 2003 +.Dt FTW 3 +.Os +.Sh NAME +.Nm ftw, nftw +.Nd traverse (walk) a file tree +.Sh SYNOPSIS +.Fd #include +.Ft int +.Fo ftw +.Fa "const char *path" +.Fa "int (*fn)(const\ char\ *, const\ struct\ stat\ *ptr, int\ flag)" +.Fa "int depth" +.Fc +.Ft int +.Fo nftw +.Fa "const char *path" +.Fa "int (*fn)(const\ char\ *, const\ struct\ stat\ *ptr, \ + int\ flag, struct\ FTW\ *)" +.Fa "int depth" +.Fa "int flags" +.Fc +.Sh DESCRIPTION +.Bf -symbolic +These functions are provided for compatibility with legacy code. +New code should use the +.Xr fts 3 +functions. +.Ef +.Pp +The +.Fn ftw +and +.Fn nftw +functions traverse (walk) the directory hierarchy rooted in +.Fa path . +For each object in the hierarchy, these functions call the function +pointed to by +.Fa fn . +The +.Fn ftw +function passes this function a pointer to a NUL-terminated string containing +the name of the object, a pointer to a stat structure corresponding to the +object, and an integer flag. +The +.Fn nftw +function passes the aforementioned arguments plus a pointer to a +.Dv FTW +structure as defined by +.Aq Pa ftw.h +(shown below): +.Bd -literal +struct FTW { + int base; /* offset of basename into pathname */ + int level; /* directory depth relative to starting point */ +}; +.Ed +.Pp +Possible values for the flag passed to +.Fa fn +are: +.Bl -tag -width FTW_DNR +.It Dv FTW_F +A regular file. +.It Dv FTW_D +A directory being visited in pre-order. +.It Dv FTW_DNR +A directory which cannot be read. +The directory will not be descended into. +.It Dv FTW_DP +A directory being visited in post-order +.No ( Ns Fn nftw +only). +.It Dv FTW_NS +A file for which no +.Xr stat 2 +information was available. +The contents of the stat structure are undefined. +.It Dv FTW_SL +A symbolic link. +.It Dv FTW_SLN +A symbolic link with a non-existent target +.No ( Ns Fn nftw +only). +.El +.Pp +The +.Fn ftw +function traverses the tree in pre-order. +That is, it processes the directory before the directory's contents. +.Pp +The +.Fa depth +argument specifies the maximum number of file descriptors +to keep open while traversing the tree. +It has no effect in this implementation. +.Pp +The +.Fn nftw +function has an additional +.Fa flags +argument with the following possible values: +.Bl -tag -width FTW_MOUNT +.It Dv FTW_PHYS +Physical walk, don't follow symbolic links. +.It Dv FTW_MOUNT +The walk will not cross a mount point. +.It FTW_DEPTH +Process directories in post-order. +Contents of a directory are visited before the directory itself. +By default, +.Fn nftw +traverses the tree in pre-order. +.It FTW_CHDIR +Change to a directory before reading it. +By default, +.Fn nftw +will change its starting directory. +The current working directory will be restored to its original value before +.Fn nftw +returns. +.El +.Sh RETURN VALUES +If the tree was traversed successfully, the +.Fn ftw +and +.Fn nftw +functions return 0. +If the function pointed to by +.Fa fn +returns a non-zero value, +.Fn ftw +and +.Fn nftw +will stop processing the tree and return the value from +.Fa fn . +Both functions return \-1 if an error is detected. +.Sh ERRORS +The +.Fn ftw +and +.Fn nftw +functions may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr close 2 , +.Xr open 2 , +.Xr stat 2 , +.Xr malloc 3 , +.Xr opendir 3 +and +.Xr readdir 3 . +If the +.Dv FTW_CHDIR +flag is set, the +.Fn nftw +function may fail and set +.Va errno +for any of the errors specified for +.Xr chdir 2 . +In addition, either function may fail and set +.Va errno +as follows: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa depth +argument is less than 1 or greater than +.Dv OPEN_MAX . +.El +.Sh LEGACY ERRORS +The +.Fn ftw +and +.Fn nftw +functions are far more tolerant of symlink cycles and are lax in reporting +errors while accessing the initial path. When +.Fn nftw +is passed +.Dv FTW_MOUNT , +it will pass the mount point to the callback function. +.Sh SEE ALSO +.Xr chdir 2 , +.Xr close 2 , +.Xr open 2 , +.Xr stat 2 , +.Xr fts 3 , +.Xr malloc 3 , +.Xr opendir 3 , +.Xr readdir 3 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn ftw +and +.Fn nftw +functions conform to +.St -p1003.1-2001 and +.St -susv3 . +.Sh HISTORY +Prior to MacOS X 10.4 +.Nm ftw +did not follow symlinks. +.Sh BUGS +The +.Fa depth +argument is currently ignored. diff --git a/gen/get_compat.c b/gen/get_compat.c new file mode 100644 index 0000000..4a1f140 --- /dev/null +++ b/gen/get_compat.c @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Catastrophic errors only, including "out of memory" */ +static bool parse_error = false; +static bool bootstrapping = false; +static bool parsed = false; +#define UNIX2003_DEFAULT_MODE true +static bool unix2003_mode = UNIX2003_DEFAULT_MODE; + +static pthread_once_t threadsafe = PTHREAD_ONCE_INIT; + +/* There was once a lot of parsing and the ability to set diffrent commands + to diffrent modes. That is gone, but some of the scaffolding remains */ + +static void check_env_var(void) { + char *mode = getenv("COMMAND_MODE"); + + if (mode) { + if (!strcasecmp(mode, "legacy")) { + unix2003_mode = false; + } else { + if (!strcasecmp(mode, "unix2003")) { + unix2003_mode = true; + } else { + parse_error = true; + unix2003_mode = UNIX2003_DEFAULT_MODE; + } + } + } +} + +/* Function is expected to be something like libc/malloc for a libc call, +or bin/date for command line utilities. Modes are currently: + Legacy - pre-tiger behaviour, presumably UNIX2003 incompatable + UNIX2003 - Unix 2003 spec compliant + Bootstrap - only seen by (parts of) libc. The compat_mode system is + still starting up. This will be seen while compat_mode parses it's + config file, or reads the cache file, and only by libc functions it calls. + Error - the conf file could not be parsed, either due to a severe + syntax error, an I/O error, or an out of memory condition + + mode names are case insensitatave. You can use | ^ & and even ! + but no () yet, and that stuff hasn't been tested much yet, nor + has it been optimised. +*/ + +bool +compat_mode(const char *function, const char *mode) { + if (!parsed && !bootstrapping) { + pthread_once(&threadsafe, check_env_var); + parsed = true; + } + + bool want2003 = !strcasecmp("unix2003", mode); + + if (want2003) { + return unix2003_mode; + } + + bool want_legacy = !strcasecmp("legacy", mode); + + if (want_legacy) { + return !unix2003_mode; + } + + bool want_bootstrap = !strcasecmp("bootstrap", mode); + + if (want_bootstrap) { + return bootstrapping; + } + + bool want_error = !strcasecmp("error", mode); + + if (want_error) { + return parse_error; + } + + char *op = NULL; + + if ((op = strpbrk(mode, "!^&|"))) { + if (*op == '!') { + if (op != mode) goto syn_error; + return !compat_mode(function, mode +1); + } + + /* XXX char tmp[] would be better for left_arg, but + we are not sure what the max size should be... is + alloca(3) frowned on? */ + size_t left_sz = 1 + (op - mode); + char *left_arg = malloc(left_sz); + strlcpy(left_arg, mode, left_sz); + bool left = compat_mode(function, left_arg); + free(left_arg); + bool right = compat_mode(function, op +1); + + /* XXX check leftOPright syntax errors */ + + switch(*op) { + case '^': + return left ^ right; + case '&': + return left && right; + case '|': + return left || right; + default: + goto syn_error; + } + } + +syn_error: + fprintf(stderr, "invalid mode %s (while checking for %s)\n", + mode, function); + + return false; +} + +#ifdef SELF_TEST_COMPAT_MODE + +#include + +#define NEXPECTED 3 + +typedef struct { + char *mode; + /* [0] is unix2003 mode, [1] is legacy, [2] is Invalid_Mode */ + bool expected[NEXPECTED]; +} testcase; + +testcase cases[] = { + { "unix2003", {true, false, true}}, + { "legacy", {false, true, false}}, + { "bootstrap", {false, false, false}}, + { "unix2003|legacy", {true, true, true}}, + { "unix2003&legacy", {false, false, false}}, + { "unix2003|legacy|bootstrap", {true, true, true}}, + { "unix2003&legacy&bootstrap", {false, false, false}}, + { "!unix2003", {false, true, false}}, + { "!legacy", {true, false, true}}, + /* XXX ! with compound statments */ + { "unix2003^bootstrap", {true, false, true}}, + { "unix2003^legacy", {true, true, true}}, + { "&unix2003", {false, false, false}}, + { "unix2003&", {false, false, false}}, + { "unix2003!legacy", {false, false, false}}, + { "unix2003&error", {false, false, true}}, + { "error", {false, false, true}}, + { "error|unix2003", {true, false, true}}, + { "error|legacy", {false, true, true}}, + { "error&legacy", {false, false, false}}, +}; + +int ncases = sizeof(cases)/sizeof(testcase); + +int +main(int argc, char *argv[]) { + int i, j; + int failures = 0; + char *settings[] = { "unix2003", "legacy", "Invalid Mode"}; + + assert(sizeof(settings) / sizeof(char *) == NEXPECTED); + + for(i = 0; i < NEXPECTED; ++i) { + setenv("COMMAND_MODE", settings[i], 1); + char *compat_env = getenv("COMMAND_MODE"); + printf("$COMMAND_MODE = %s\n", compat_env); + if (i != 0) { + /* here we force COMMAND_MODE to be checked again, which + is normally impossiable because check_env_var() is a static + function, but really nothing except the test cases wants to + try it anyway... */ + check_env_var(); + } + for(j = 0; j < ncases; ++j) { + bool ret = compat_mode("bin/compat_mode", cases[j].mode); + bool expect = cases[j].expected[i]; + + if (expect != ret) { + failures++; + } + + printf("Case %s got %d expected %d%s\n", + cases[j].mode, ret, expect, (ret == expect) ? "" : " FAILED"); + } + } + + /* We have ncases entries in cases[], but each is run multiple + times (once per entry in the settings array) thus the multiply */ + printf("Passed %d of %d cases\n", + NEXPECTED*ncases - failures, NEXPECTED*ncases); + + return failures ? 1 : 0; +} + +#endif diff --git a/gen/get_compat.h b/gen/get_compat.h new file mode 100644 index 0000000..b26ae60 --- /dev/null +++ b/gen/get_compat.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include + +extern bool compat_mode(const char *function, const char *mode); + +/* this will eventually cache the result, you need to call it with a + static string otherwise it will cache the wrong result. It ought + to be fast enough to use in things like malloc(2) without extra + tricks */ +#define COMPAT_MODE(func, mode) compat_mode(func, mode) diff --git a/gen/getdomainname.3 b/gen/getdomainname.3 new file mode 100644 index 0000000..19aa714 --- /dev/null +++ b/gen/getdomainname.3 @@ -0,0 +1,98 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)gethostname.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/getdomainname.3,v 1.14 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd May 6, 1994 +.Dt GETDOMAINNAME 3 +.Os +.Sh NAME +.Nm getdomainname , +.Nm setdomainname +.Nd get/set NIS domain name of current host +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn getdomainname "char *name" "int namelen" +.Ft int +.Fn setdomainname "const char *name" "int namelen" +.Sh DESCRIPTION +.Fn Getdomainname +returns the standard NIS domain name for the current host, as +previously set by +.Fn setdomainname . +The parameter +.Fa namelen +specifies the size of the +.Fa name +array. The returned name is null-terminated unless insufficient +space is provided. +.Pp +.Fn Setdomainname +sets the NIS domain name of the host machine to be +.Fa name , +which has length +.Fa namelen . +This call is restricted to the super-user and +is normally used only when the system is bootstrapped. +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +The following errors may be returned by these calls: +.Bl -tag -width Er +.It Bq Er EFAULT +The +.Fa name +or +.Fa namelen +parameter gave an +invalid address. +.It Bq Er EPERM +The caller tried to set the hostname and was not the super-user. +.El +.Sh SEE ALSO +.Xr gethostid 3 , +.Xr gethostname 3 , +.Xr sysctl 3 +.Sh BUGS +Domain names are limited to +.Dv MAXHOSTNAMELEN +(from +.Ao Pa sys/param.h Ac ) +characters, currently 256. +.Sh HISTORY +The +.Fn getdomainname +function call appeared in +.Bx 4.2 . diff --git a/gen/getloadavg.3 b/gen/getloadavg.3 new file mode 100644 index 0000000..24e7cdf --- /dev/null +++ b/gen/getloadavg.3 @@ -0,0 +1,69 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getloadavg.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/getloadavg.3,v 1.8 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd June 4, 1993 +.Dt GETLOADAVG 3 +.Os +.Sh NAME +.Nm getloadavg +.Nd get system load averages +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fn getloadavg "double loadavg[]" "int nelem" +.Sh DESCRIPTION +The +.Fn getloadavg +function returns the number of processes in the system run queue +averaged over various periods of time. +Up to +.Fa nelem +samples are retrieved and assigned to successive elements of +.Fa loadavg Ns Bq . +The system imposes a maximum of 3 samples, representing averages +over the last 1, 5, and 15 minutes, respectively. +.Sh DIAGNOSTICS +If the load average was unobtainable, \-1 is returned; otherwise, +the number of samples actually retrieved is returned. +.Sh SEE ALSO +.Xr uptime 1 , +.Xr kvm_getloadavg 3 , +.Xr sysctl 3 +.Sh HISTORY +The +.Fn getloadavg +function appeared in +.Bx 4.3 Reno . diff --git a/gen/getloadavg.c b/gen/getloadavg.c new file mode 100644 index 0000000..ac263c6 --- /dev/null +++ b/gen/getloadavg.c @@ -0,0 +1,93 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + +#if 0 +#include +#endif /* 0 */ + +#include + +/* + * getloadavg() -- Get system load averages. + * + * Put `nelem' samples into `loadavg' array. + * Return number of samples retrieved, or -1 on error. + */ +int +getloadavg(loadavg, nelem) + double loadavg[]; + int nelem; +{ + struct loadavg loadinfo; + int i, mib[2]; + size_t size; + + mib[0] = CTL_VM; + mib[1] = VM_LOADAVG; + size = sizeof(loadinfo); + if (sysctl(mib, 2, &loadinfo, &size, NULL, 0) < 0) + return (-1); + + nelem = MIN(nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t)); + for (i = 0; i < nelem; i++) + loadavg[i] = (double) loadinfo.ldavg[i] / loadinfo.fscale; + return (nelem); +} diff --git a/gen/getttyent.3 b/gen/getttyent.3 new file mode 100644 index 0000000..98eab3b --- /dev/null +++ b/gen/getttyent.3 @@ -0,0 +1,185 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getttyent.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/getttyent.3,v 1.12 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd November 17, 1996 +.Dt GETTTYENT 3 +.Os +.Sh NAME +.Nm getttyent , +.Nm getttynam , +.Nm setttyent , +.Nm endttyent +.Nd get ttys file entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ttyent.h +.Ft struct ttyent * +.Fn getttyent void +.Ft struct ttyent * +.Fn getttynam "const char *name" +.Ft int +.Fn setttyent void +.Ft int +.Fn endttyent void +.Sh DESCRIPTION +The +.Fn getttyent , +and +.Fn getttynam +functions +each return a pointer to an object, with the following structure, +containing the broken-out fields of a line from the tty description +file. +.Bd -literal +struct ttyent { + char *ty_name; /* terminal device name */ + char *ty_getty; /* command to execute, usually getty */ + char *ty_type; /* terminal type for termcap */ +#define TTY_ON 0x01 /* enable logins (start ty_getty program) */ +#define TTY_SECURE 0x02 /* allow uid of 0 to login */ +#define TTY_DIALUP 0x04 /* is a dialup tty */ +#define TTY_NETWORK 0x08 /* is a network tty */ + int ty_status; /* status flags */ + char *ty_window; /* command to start up window manager */ + char *ty_comment; /* comment field */ + char *ty_group; /* tty group name */ +}; +.Ed +.Pp +The fields are as follows: +.Bl -tag -width ty_comment +.It Fa ty_name +The name of the character-special file. +.It Fa ty_getty +The name of the command invoked +to initialize tty line characteristics. +.It Fa ty_type +The name of the default terminal type connected to this tty line. +.It Fa ty_status +A mask of bit fields which indicate various actions allowed on this +tty line. +The possible flags are as follows: +.Bl -tag -width TTY_NETWORK +.It Dv TTY_ON +Enables logins +.It Dv TTY_SECURE +Allow users with a uid of 0 to login on this terminal. +.It Dv TTY_DIALUP +Identifies a tty as a dialin line. +.It Dv TTY_NETWORK +Identifies a tty used for network connections. +.El +.It Fa ty_window +The command to execute for a window system associated with the line. +.It Fa ty_group +A group name to which the tty belongs. +If no group is specified in the ttys description file, +then the tty is placed in an anonymous group called "none". +.It Fa ty_comment +Any trailing comment field, with any leading hash marks (``#'') or +whitespace removed. +.El +.Pp +If any of the fields pointing to character strings are unspecified, +they are returned as null pointers. +The field +.Fa ty_status +will be zero if no flag values are specified. +.Pp +See +.Xr ttys 5 +for a more complete discussion of the meaning and usage of the +fields. +.Pp +The +.Fn getttyent +function +reads the next line from the ttys file, opening the file if necessary. +The +.Fn setttyent +function +rewinds the file if open, or opens the file if it is unopened. +The +.Fn endttyent +function +closes any open files. +.Pp +The +.Fn getttynam +function +searches from the beginning of the file until a matching +.Fa name +is found +(or until +.Dv EOF +is encountered). +.Sh RETURN VALUES +The routines +.Fn getttyent +and +.Fn getttynam +return a null pointer on +.Dv EOF +or error. +The +.Fn setttyent +function +and +.Fn endttyent +return 0 on failure and 1 on success. +.Sh FILES +.Bl -tag -width /etc/ttys -compact +.It Pa /etc/ttys +.El +.Sh SEE ALSO +.Xr login 1 , +.Xr ttyslot 3 , +.Xr gettytab 5 , +.Xr termcap 5 , +.Xr ttys 5 , +.Xr getty 8 , +.Sh HISTORY +The +.Fn getttyent , +.Fn getttynam , +.Fn setttyent , +and +.Fn endttyent +functions appeared in +.Bx 4.3 . +.Sh BUGS +These functions use static data storage; +if the data is needed for future use, it should be +copied before any subsequent calls overwrite it. diff --git a/gen/getttyent.c b/gen/getttyent.c new file mode 100644 index 0000000..50acdd1 --- /dev/null +++ b/gen/getttyent.c @@ -0,0 +1,392 @@ +/* + * Copyright (c) 1999, 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +static char zapchar; +static FILE *tf; + +struct ttyent * +getttynam(tty) + const char *tty; +{ + register struct ttyent *t; + + setttyent(); + while ((t = getttyent()) != NULL) + if (!strcmp(tty, t->ty_name)) + break; + endttyent(); + return (t); +} + +static char *skip(), *value(); + +/* + * 4372480: Support for sequences in the tty name. Expressions like [000-999] + * for decimal sequences and [0x0-0xf] for hexidecimal sequences causes a + * sequence of all combinations of names to be returned by getttyent(). + * + * There is also a slot=nn option, which will cause getttyent() to return + * non-existent ttyent structs until the slot number nn is reached. Note, slot + * numbers begin at 1. + */ +struct seq { + int first; + int count; + int index; + char fmt[NAME_MAX + 17]; +}; + +static const char *brapat = "\\[(.*)]"; +static regex_t brapreg; +static const char *decpat = "^([0-9]+)-([0-9]+)$"; +static regex_t decpreg; +static const char *hexpat = "^0x([0-9a-f]+)-0x([0-9a-f]+)$"; +static regex_t hexpreg; +static struct seq *seq = NULL; +static int slot; + +struct ttyent * +getttyent(void) +{ + static struct ttyent tty; + static const struct ttyent nonexistent = { + "\01", /* this shouldn't match anything */ + NULL, + NULL, + 0, + NULL, + NULL, + NULL + }; + register int c; + register char *p; +#define MAXLINELENGTH 1024 + static char *line = NULL; + locale_t loc = __current_locale(); + int newslot, hex; + long b, e; + regmatch_t match[3], save, bracket; + + if ( line == NULL ) { + line = malloc(MAXLINELENGTH); + if( line == NULL ) + return NULL; + } + + if (!tf && !setttyent()) + return (NULL); + +restart: + if (slot < seq->first) { + /* + * the slot= option was set, and we are returning non-existent + * entries until we catch up. + */ + slot++; + return (struct ttyent *)&nonexistent; + } + + if (seq->count > 0) { + /* + * generate the next tty name; the rest of the tty entries + * is the same. + */ + sprintf(tty.ty_name, seq->fmt, seq->index++); + slot++; + seq->count--; + return &tty; + } + + if (slot == seq->first) { + /* + * this was a regular entry with slot= + */ + slot++; + return &tty; + } + + for (;;) { + if (!fgets(p = line, MAXLINELENGTH, tf)) + return (NULL); + /* skip lines that are too big */ + if (!index(p, '\n')) { + while ((c = getc(tf)) != '\n' && c != EOF) + ; + continue; + } + while (isspace_l(*p, loc)) + ++p; + if (*p && *p != '#') + break; + } + + zapchar = 0; + tty.ty_name = p; + p = skip(p); + if (!*(tty.ty_getty = p)) + tty.ty_getty = tty.ty_type = NULL; + else { + p = skip(p); + if (!*(tty.ty_type = p)) + tty.ty_type = NULL; + else + p = skip(p); + } + tty.ty_status = 0; + tty.ty_window = NULL; + tty.ty_onerror = NULL; + tty.ty_onoption = NULL; + +#define scmp(e) !strncmp(p, e, sizeof(e) - 1) && isspace_l(p[sizeof(e) - 1], loc) +#define vcmp(e) !strncmp(p, e, sizeof(e) - 1) && p[sizeof(e) - 1] == '=' + newslot = -1; + for (; *p; p = skip(p)) { + if (scmp(_TTYS_OFF)) + tty.ty_status &= ~TTY_ON; + else if (scmp(_TTYS_ON)) + tty.ty_status |= TTY_ON; + else if (scmp(_TTYS_SECURE)) + tty.ty_status |= TTY_SECURE; + else if (vcmp(_TTYS_WINDOW)) + tty.ty_window = value(p); + else if (vcmp(_TTYS_ONERROR)) + tty.ty_onerror = value(p); + else if (vcmp(_TTYS_ONOPTION)) + tty.ty_onoption = value(p); + else if (vcmp(_TTYS_SLOT)) { + char *slotstr = value(p); + if (slotstr) + newslot = atoi(slotstr); + } else + break; + } + + if (zapchar == '#' || *p == '#') + while ((c = *++p) == ' ' || c == '\t') + ; + tty.ty_comment = p; + if (*p == 0) + tty.ty_comment = 0; + if ((p = index(p, '\n')) != NULL) + *p = '\0'; + + /* check if tty.tyname has a sequence */ + if (regexec(&brapreg, tty.ty_name, 3, match, 0) != 0) + goto out; + + /* + * save the range of the bracketed range, so we can find the strings + * before and after + */ + bracket = match[0]; + /* use REG_STARTEND to limit matching with the bracketed range */ + match[0] = save = match[1]; + if (regexec(&decpreg, tty.ty_name, 3, match, REG_STARTEND) == 0) { + /* a decimal range */ + b = strtol(tty.ty_name + match[1].rm_so, NULL, 10); + e = strtol(tty.ty_name + match[2].rm_so, NULL, 10); + hex = 0; + } else { + match[0] = save; + if (regexec(&hexpreg, tty.ty_name, 3, match, REG_STARTEND) == 0) { + /* a hexidecimal range */ + b = strtol(tty.ty_name + match[1].rm_so, NULL, 16); + e = strtol(tty.ty_name + match[2].rm_so, NULL, 16); + hex = 1; + } else + goto out; + } + if (b > e) /* skip */ + goto restart; + + /* seq->first is already less than slot, so just leave it */ + seq->count = (int)(e - b + 1); + seq->index = (int)(b); + /* + * The fmt string contains the characters before the bracket, the + * a format specifier (either decimal or hex) and any characters + * after the bracket. Note that the length of the lower range is + * use as a minimum digit length, with zero fill, so the format + * specifier will look something like %03d. + */ + sprintf(seq->fmt, "%.*s%%0%d%c%s", + (int)bracket.rm_so, tty.ty_name, + (int)(match[1].rm_eo - match[1].rm_so), + hex ? 'x' : 'd', + tty.ty_name + bracket.rm_eo); + +out: + if (newslot > slot) { + /* set up to skip until newslot */ + seq->first = newslot; + goto restart; + } + if (seq->count > 0) /* restart if we are doing a sequence */ + goto restart; + /* regular single value return */ + slot++; + return (&tty); +} + +#define QUOTED 1 + +/* + * Skip over the current field, removing quotes, and return a pointer to + * the next field. + */ +static char * +skip(p) + register char *p; +{ + register char *t; + register int c, q; + + for (q = 0, t = p; (c = *p) != '\0'; p++) { + if (c == '"') { + q ^= QUOTED; /* obscure, but nice */ + continue; + } + if (q == QUOTED && *p == '\\' && *(p+1) == '"') + p++; + *t++ = *p; + if (q == QUOTED) + continue; + if (c == '#') { + zapchar = c; + *p = 0; + break; + } + if (c == '\t' || c == ' ' || c == '\n') { + zapchar = c; + *p++ = 0; + while ((c = *p) == '\t' || c == ' ' || c == '\n') + p++; + break; + } + } + *--t = '\0'; + return (p); +} + +static char * +value(p) + register char *p; +{ + + return ((p = index(p, '=')) ? ++p : NULL); +} + +int +setttyent() +{ + + /* initialize seq and the three regexp patterns */ + if (!seq) { + if (regcomp(&brapreg, brapat, REG_EXTENDED) != 0) + return 0; + if (regcomp(&decpreg, decpat, REG_EXTENDED) != 0) { + regfree(&brapreg); + return 0; + } + if (regcomp(&hexpreg, hexpat, REG_EXTENDED | REG_ICASE) != 0) { + regfree(&decpreg); + regfree(&brapreg); + return 0; + } + if ((seq = malloc(sizeof(struct seq))) == NULL) { + regfree(&hexpreg); + regfree(&decpreg); + regfree(&brapreg); + return 0; + } + } + seq->first = seq->count = 0; + slot = 1; + + if (tf) { + (void)rewind(tf); + return (1); + } else if ((tf = fopen(_PATH_TTYS, "r")) != NULL) + return (1); + return (0); +} + +int +endttyent() +{ + int rval; + + if (tf) { + rval = !(fclose(tf) == EOF); + tf = NULL; + return (rval); + } + return (1); +} +#pragma clang diagnostic pop + diff --git a/gen/getusershell.3 b/gen/getusershell.3 new file mode 100644 index 0000000..2da6103 --- /dev/null +++ b/gen/getusershell.3 @@ -0,0 +1,102 @@ +.\" $NetBSD: getusershell.3,v 1.6 1999/03/22 19:44:42 garbled Exp $ +.\" $FreeBSD: src/lib/libc/gen/getusershell.3,v 1.10 2001/10/01 16:08:51 ru Exp $ +.\" +.\" Copyright (c) 1985, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getusershell.3 8.1 (Berkeley) 6/4/93 +.\" +.Dd January 16, 1999 +.Dt GETUSERSHELL 3 +.Os +.Sh NAME +.Nm getusershell , +.Nm setusershell , +.Nm endusershell +.Nd get valid user shells +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft char * +.Fn getusershell void +.Ft void +.Fn setusershell void +.Ft void +.Fn endusershell void +.Sh DESCRIPTION +The +.Fn getusershell +function +returns a pointer to a valid user shell as defined by the +system manager in the shells database as described in +.Xr shells 5 . +If the shells database is not available, +.Fn getusershell +behaves as if +.Pa /bin/sh +and +.Pa /bin/csh +were listed. +.Pp +The +.Fn getusershell +function +reads the next +line (opening the file if necessary); +.Fn setusershell +rewinds the file; +.Fn endusershell +closes it. +.Sh FILES +.Bl -tag -width /etc/shells -compact +.It Pa /etc/shells +.El +.Sh DIAGNOSTICS +The routine +.Fn getusershell +returns a null pointer (0) on +.Dv EOF . +.Sh SEE ALSO +.Xr shells 5 +.Sh HISTORY +The +.Fn getusershell +function appeared in +.Bx 4.3 . +.Sh BUGS +The +.Fn getusershell +function leaves its result in an internal static object and returns +a pointer to that object. +Subsequent calls to +.Fn getusershell +will modify the same object. diff --git a/gen/getusershell.c b/gen/getusershell.c new file mode 100644 index 0000000..202a51b --- /dev/null +++ b/gen/getusershell.c @@ -0,0 +1,156 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1985, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Local shells should NOT be added here. They should be added in + * /etc/shells. + */ + +static const char * const okshells[] = { _PATH_BSHELL, _PATH_CSHELL, NULL }; +static char **curshell, **shells, *strings; +static char **initshells(void); + +/* + * Get a list of shells from _PATH_SHELLS, if it exists. + */ +char * +getusershell(void) +{ + char *ret; + + if (curshell == NULL) + curshell = initshells(); + ret = *curshell; + if (ret != NULL) + curshell++; + return (ret); +} + +void +endusershell(void) +{ + if (shells != NULL) + free(shells); + shells = NULL; + if (strings != NULL) + free(strings); + strings = NULL; + curshell = NULL; +} + +void +setusershell(void) +{ + curshell = initshells(); +} + +static char ** +initshells(void) +{ + register char **sp, *cp; + register FILE *fp; + struct stat statb; + locale_t loc = __current_locale(); + + if (shells != NULL) + free(shells); + shells = NULL; + if (strings != NULL) + free(strings); + strings = NULL; + if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) + return ((char **)okshells); + if (fstat(fileno(fp), &statb) == -1) { + (void)fclose(fp); + return ((char **)okshells); + } + if ((strings = malloc((u_int)statb.st_size)) == NULL) { + (void)fclose(fp); + return ((char **)okshells); + } + shells = calloc((unsigned)statb.st_size / 3, sizeof (char *)); + if (shells == NULL) { + (void)fclose(fp); + free(strings); + strings = NULL; + return ((char **)okshells); + } + sp = shells; + cp = strings; + while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { + while (*cp != '#' && *cp != '/' && *cp != '\0') + cp++; + if (*cp == '#' || *cp == '\0') + continue; + *sp++ = cp; + while (!isspace_l(*cp, loc) && *cp != '#' && *cp != '\0') + cp++; + *cp++ = '\0'; + } + *sp = NULL; + (void)fclose(fp); + return (shells); +} diff --git a/gen/getvfsbyname.3 b/gen/getvfsbyname.3 new file mode 100644 index 0000000..98582c2 --- /dev/null +++ b/gen/getvfsbyname.3 @@ -0,0 +1,93 @@ +.\" Copyright (c) 1995 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)kvm_getvfsbyname.3 8.3 (Berkeley) 5/4/95 +.\" $FreeBSD: src/lib/libc/gen/getvfsbyname.3,v 1.12 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd May 4, 1995 +.Dt GETVFSBYNAME 3 +.Os +.Sh NAME +.Nm getvfsbyname +.Nd get information about a filesystem +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/param.h +.In sys/mount.h +.Ft int +.Fn getvfsbyname "const char *name" "struct vfsconf *vfc" +.Sh DESCRIPTION +The +.Fn getvfsbyname +function provides access to information about a +filesystem module that is configured in the kernel. +If successful, +the requested filesystem +.Fa vfsconf +is returned in the location pointed to by +.Fa vfc . +The fields in a +.Dq Li struct vfsconf +are defined as follows: +.Pp +.Bl -tag -compact -width vfc_refcount +.It vfc_name +the name of the filesystem +.It vfc_typenum +the filesystem type number assigned by the kernel +.It vfc_refcount +the number of active mount points using the filesystem +.El +.Sh RETURN VALUES +.Rv -std getvfsbyname +.Sh ERRORS +The following errors may be reported: +.Bl -tag -width Er +.It Bq Er EFAULT +The +.Fa vfc +pointer contains an invalid address. +.It Bq Er ENOENT +The +.Fa name +specifies a filesystem that is unknown or not configured in the kernel. +.El +.Sh SEE ALSO +.Xr mount 2 , +.Xr sysctl 3 , +.Xr mount 8 , +.Xr sysctl 8 +.Sh HISTORY +A variant of the +.Fn getvfsbyname +function first appeared in +.Fx 2.0 . diff --git a/gen/getvfsbyname.c b/gen/getvfsbyname.c new file mode 100644 index 0000000..39a296e --- /dev/null +++ b/gen/getvfsbyname.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1995 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +int getvfsbyname(const char *, struct vfsconf *); + +/* + * Given a filesystem name, determine if it is resident in the kernel, + * and if it is resident, return its vfsconf structure. + */ +int +getvfsbyname(fsname, vfcp) + const char *fsname; + struct vfsconf *vfcp; +{ + int name[4], maxtypenum, cnt; + size_t buflen; + + name[0] = CTL_VFS; + name[1] = VFS_GENERIC; + name[2] = VFS_MAXTYPENUM; + buflen = 4; + if (sysctl(name, 3, &maxtypenum, &buflen, (void *)0, (size_t)0) < 0) + return (-1); + name[2] = VFS_CONF; + buflen = sizeof *vfcp; + for (cnt = 0; cnt < maxtypenum; cnt++) { + name[3] = cnt; + if (sysctl(name, 4, vfcp, &buflen, (void *)0, (size_t)0) < 0) { + if (errno != ENOTSUP) + return (-1); + continue; + } + if (!strcmp(fsname, vfcp->vfc_name)) + return (0); + } + errno = ENOENT; + return (-1); +} diff --git a/gen/intro.3 b/gen/intro.3 new file mode 100644 index 0000000..c01d940 --- /dev/null +++ b/gen/intro.3 @@ -0,0 +1,130 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)intro.3 8.1 (Berkeley) 6/5/93 +.\" $FreeBSD: src/share/man/man3/intro.3,v 1.14 2001/08/07 15:48:38 ru Exp $ +.\" +.Dd Aug 17, 2006 +.Dt INTRO 3 +.Os +.Sh NAME +.Nm intro +.Nd introduction to the C libraries +.Sh DESCRIPTION +This section provides an overview of the C +library functions, their error returns and other +common definitions and concepts. +Most of these functions are available from the System library, +.Em libSystem . +Other libraries +must be indicated at compile time with the +.Fl l +option of the compiler. +.Pp +The various libraries (followed by the loader flag): +.Bl -tag -width "libSystem (-lSystem)" +.It Xr libSystem Pq Fl l Ns Ar System +Standard C library functions. +When using the C compiler +.Xr cc 1 , +it is not necessary +to supply the loader flag +.Fl l Ns Ar System +for these functions. +There are several `libraries' or groups of functions included inside of +.Xr libSystem : +the standard +.Tn I/O +routines, +database routines, +bit operators, +string operators, +character tests and character operators, +des encryption routines, +storage allocation, time functions, signal handling and more. +.Pp +For compatibility with other systems, which provide these capabilities in +separate libraries (such as +.Xr libc ) , +symbolic links are provided for +.Fl l Ns Ar c , +.Fl l Ns Ar dbm , +.Fl l Ns Ar dl , +.Fl l Ns Ar info , +.Fl l Ns Ar m , +.Fl l Ns Ar poll , +.Fl l Ns Ar pthread +and +.Fl l Ns Ar rpcsvc ; +they all point to +.Xr libSystem . +.It Xr libcurses Pq Fl l Ns Ar curses Fl l Ns Ar termcap +Terminal independent screen management routines +for two dimensional non-bitmap display terminals. +(See +.Xr ncurses 3 . ) +.It Xr libl Pq Fl l Ns Ar l +The library for +.Xr lex 1 . +.It Xr libtermcap Pq Fl l Ns Ar termcap +The terminal independent operation library package. +(See +.Xr termcap 3 . ) +.\" .It libvt0.a +.It Xr liby Pq Fl l Ns Ar y +The library for +.Xr yacc 1 . +.El +.Sh FILES +.Bl -tag -width /usr/lib/libSystem_profile.dylib -compact +.It Pa /usr/lib/libSystem.dylib +the main System library +.It Pa /usr/lib/libSystem_debug.dylib +the main System library compiled with debug support +.It Pa /usr/lib/libSystem_profile.dylib +the main System library compiled for profiling +.El +.Sh SEE ALSO +.\" .Xr libc 3 , +.Xr cc 1 , +.Xr ld 1 , +.Xr nm 1 , +.Xr intro 2 , +.Xr stdio 3 +.\" .Sh LIST OF FUNCTIONS +.\" .Bl -column "strncasecmpxxx" "system" +.\" .Sy Name Description +.\" .El +.Sh HISTORY +An +.Nm +manual appeared in +.At v7 . diff --git a/gen/nanosleep.c b/gen/nanosleep.c new file mode 100644 index 0000000..934707e --- /dev/null +++ b/gen/nanosleep.c @@ -0,0 +1,311 @@ +/* + * Copyright (c) 1999, 2003, 2006, 2007, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#if __DARWIN_UNIX03 +#include +#include +#include +#include + +#if !defined(BUILDING_VARIANT) +semaphore_t clock_sem = MACH_PORT_NULL; +mach_port_t clock_port = MACH_PORT_NULL; + +void _init_clock_port(void); + +void _init_clock_port(void) { + kern_return_t kr; + mach_port_t host = mach_host_self(); + + /* Get the clock service port for nanosleep */ + kr = host_get_clock_service(host, SYSTEM_CLOCK, &clock_port); + if (kr != KERN_SUCCESS) { + abort(); + } + + kr = semaphore_create(mach_task_self(), &clock_sem, SYNC_POLICY_FIFO, 0); + if (kr != KERN_SUCCESS) { + abort(); + } + mach_port_deallocate(mach_task_self(), host); +} +#else +extern semaphore_t clock_sem; +extern mach_port_t clock_port; +#endif /* !BUILDING_VARIANT */ + +extern int __unix_conforming; +#ifdef VARIANT_CANCELABLE +extern int __semwait_signal(int cond_sem, int mutex_sem, int timeout, int relative, __int64_t tv_sec, __int32_t tv_nsec); +#define SEMWAIT_SIGNAL __semwait_signal +#else /* !VARIANT_CANCELABLE */ +extern int __semwait_signal_nocancel(int cond_sem, int mutex_sem, int timeout, int relative, __int64_t tv_sec, __int32_t tv_nsec); +#define SEMWAIT_SIGNAL __semwait_signal_nocancel +#endif /* VARIANT_CANCELABLE */ + +int +nanosleep(const struct timespec *requested_time, struct timespec *remaining_time) { + kern_return_t kret; + int ret; + mach_timespec_t current; + mach_timespec_t completion; + + if (__unix_conforming == 0) + __unix_conforming = 1; + +#ifdef VARIANT_CANCELABLE + pthread_testcancel(); +#endif /* VARIANT_CANCELABLE */ + + if ((requested_time == NULL) || (requested_time->tv_sec < 0) || (requested_time->tv_nsec >= NSEC_PER_SEC)) { + errno = EINVAL; + return -1; + } + + + if (remaining_time != NULL) { + /* once we add requested_time, this will be the completion time */ + kret = clock_get_time(clock_port, &completion); + if (kret != KERN_SUCCESS) { + fprintf(stderr, "clock_get_time() failed: %s\n", mach_error_string(kret)); + errno = EINVAL; + return -1; + } + } + ret = SEMWAIT_SIGNAL(clock_sem, MACH_PORT_NULL, 1, 1, (int64_t)requested_time->tv_sec, (int32_t)requested_time->tv_nsec); + if (ret < 0) { + if (errno == ETIMEDOUT) { + return 0; + } else if (errno == EINTR) { + if (remaining_time != NULL) { + ret = clock_get_time(clock_port, ¤t); + if (ret != KERN_SUCCESS) { + fprintf(stderr, "clock_get_time() failed: %s\n", mach_error_string(ret)); + return -1; + } + /* This depends on the layout of a mach_timespec_t and timespec_t being equivalent */ + ADD_MACH_TIMESPEC(&completion, requested_time); + /* We have to compare first, since mach_timespect_t contains unsigned integers */ + if(CMP_MACH_TIMESPEC(&completion, ¤t) > 0) { + SUB_MACH_TIMESPEC(&completion, ¤t); + remaining_time->tv_sec = completion.tv_sec; + remaining_time->tv_nsec = completion.tv_nsec; + } else { + bzero(remaining_time, sizeof(*remaining_time)); + } + } + } else { + errno = EINVAL; + } + } + return -1; +} + + +#else /* !__DARWIN_UNIX03 */ + +typedef struct { + uint64_t high; + uint64_t low; +} uint128_t; + +/* 128-bit addition: acc += add */ +static inline void +add128_128(uint128_t *acc, uint128_t *add) +{ + acc->high += add->high; + acc->low += add->low; + if(acc->low < add->low) + acc->high++; // carry +} + +/* 128-bit subtraction: acc -= sub */ +static inline void +sub128_128(uint128_t *acc, uint128_t *sub) +{ + acc->high -= sub->high; + if(acc->low < sub->low) + acc->high--; // borrow + acc->low -= sub->low; +} + +#define TWO64 (((double)(1ULL << 32)) * ((double)(1ULL << 32))) + +static inline double +uint128_double(uint128_t *u) +{ + return TWO64 * u->high + u->low; // may loses precision +} + +/* 64x64 -> 128 bit multiplication */ +static inline void +mul64x64(uint64_t x, uint64_t y, uint128_t *prod) +{ + uint128_t add; + /* + * Split the two 64-bit multiplicands into 32-bit parts: + * x => 2^32 * x1 + x2 + * y => 2^32 * y1 + y2 + */ + uint32_t x1 = (uint32_t)(x >> 32); + uint32_t x2 = (uint32_t)x; + uint32_t y1 = (uint32_t)(y >> 32); + uint32_t y2 = (uint32_t)y; + /* + * direct multiplication: + * x * y => 2^64 * (x1 * y1) + 2^32 (x1 * y2 + x2 * y1) + (x2 * y2) + * The first and last terms are direct assignmenet into the uint128_t + * structure. Then we add the middle two terms separately, to avoid + * 64-bit overflow. (We could use the Karatsuba algorithm to save + * one multiply, but it is harder to deal with 64-bit overflows.) + */ + prod->high = (uint64_t)x1 * (uint64_t)y1; + prod->low = (uint64_t)x2 * (uint64_t)y2; + add.low = (uint64_t)x1 * (uint64_t)y2; + add.high = (add.low >> 32); + add.low <<= 32; + add128_128(prod, &add); + add.low = (uint64_t)x2 * (uint64_t)y1; + add.high = (add.low >> 32); + add.low <<= 32; + add128_128(prod, &add); +} + +/* calculate (x * y / divisor), using 128-bit internal calculations */ +static int +muldiv128(uint64_t x, uint64_t y, uint64_t divisor, uint64_t *res) +{ + uint128_t temp; + uint128_t divisor128 = {0, divisor}; + uint64_t result = 0; + double recip; + + /* calculate (x * y) */ + mul64x64(x, y, &temp); + /* + * Now divide by the divisor. We use floating point to calculate an + * approximate answer and update the results. Then we iterate and + * calculate a correction from the difference. + */ + recip = 1.0 / ((double)divisor); + while(temp.high || temp.low >= divisor) { + uint128_t backmul; + uint64_t uapprox; + double approx = uint128_double(&temp) * recip; + + if(approx > __LONG_LONG_MAX__) + return 0; // answer overflows 64-bits + uapprox = (uint64_t)approx; + mul64x64(uapprox, divisor, &backmul); + /* + * Because we are using unsigned integers, we need to approach the + * answer from the lesser side. So if our estimate is too large + * we need to decrease it until it is smaller. + */ + while(backmul.high > temp.high || (backmul.high == temp.high && backmul.low > temp.low)) { + sub128_128(&backmul, &divisor128); + uapprox--; + } + sub128_128(&temp, &backmul); + result += uapprox; + } + *res = result; + return 1; +} + +int +nanosleep(const struct timespec *requested_time, struct timespec *remaining_time) { + kern_return_t ret; + uint64_t end, units; + static struct mach_timebase_info info = {0, 0}; + static int unity; + + if ((requested_time == NULL) || (requested_time->tv_sec < 0) || (requested_time->tv_nsec > NSEC_PER_SEC)) { + errno = EINVAL; + return -1; + } + + if (info.denom == 0) { + ret = mach_timebase_info(&info); + if (ret != KERN_SUCCESS) { + fprintf(stderr, "mach_timebase_info() failed: %s\n", mach_error_string(ret)); + errno = EAGAIN; + return -1; + } + /* If numer == denom == 1 (as in intel), no conversion needed */ + unity = (info.numer == info.denom); + } + + if(unity) + units = (uint64_t)requested_time->tv_sec * NSEC_PER_SEC; + else if(!muldiv128((uint64_t)info.denom * NSEC_PER_SEC, + (uint64_t)requested_time->tv_sec, + (uint64_t)info.numer, + &units)) + { + errno = EINVAL; + return -1; + } + end = mach_absolute_time() + + units + + (uint64_t)info.denom * requested_time->tv_nsec / info.numer; + ret = mach_wait_until(end); + if (ret != KERN_SUCCESS) { + if (ret == KERN_ABORTED) { + errno = EINTR; + if (remaining_time != NULL) { + uint64_t now = mach_absolute_time(); + if (now >= end) { + remaining_time->tv_sec = 0; + remaining_time->tv_nsec = 0; + } else { + if(unity) + units = (end - now); + else + muldiv128((uint64_t)info.numer, + (end - now), + (uint64_t)info.denom, + &units); // this can't overflow + remaining_time->tv_sec = units / NSEC_PER_SEC; + remaining_time->tv_nsec = units % NSEC_PER_SEC; + } + } + } else { + errno = EINVAL; + } + return -1; + } + return 0; +} + + +#endif /* __DARWIN_UNIX03 */ diff --git a/gen/nftw.c b/gen/nftw.c new file mode 100644 index 0000000..7227030 --- /dev/null +++ b/gen/nftw.c @@ -0,0 +1,275 @@ +/* $OpenBSD: nftw.c,v 1.2 2003/07/21 21:15:32 millert Exp $ */ + +/* + * Copyright (c) 2003 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char rcsid[] = "$OpenBSD: nftw.c,v 1.2 2003/07/21 21:15:32 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int +both_ftw(const char *path, + int (*ofn)(const char *, const struct stat *, int), + int (*nfn)(const char *, const struct stat *, int, struct FTW *), + int nfds, int ftwflags) +{ + const char *paths[2]; + struct FTW ftw; + FTSENT *cur; + FTS *ftsp = NULL; + int ftsflags, fnflag, error, postorder, sverrno; + int cwd_fd = -1; /* cwd_fd != -1 means call chdir a lot */ + +#if __DARWIN_UNIX03 + /* Macro to skip the mount point itself in UNiX03 mode, in legcy + mode the mount point is returned, but we don't decend into it */ +#define SKIP_MOUNT if ((ftwflags & FTW_MOUNT) \ + && cur->fts_statp->st_dev != path_stat.st_dev) { \ + continue; \ + } +#else +#define SKIP_MOUNT +#endif + + /* XXX - nfds is currently unused */ + if (nfds < 1 || nfds > OPEN_MAX) { + errno = EINVAL; + error = -1; + goto done; + } + + ftsflags = FTS_COMFOLLOW; + if (!(ftwflags & FTW_CHDIR)) + ftsflags |= FTS_NOCHDIR; + if (ftwflags & FTW_MOUNT) + ftsflags |= FTS_XDEV; + if (ftwflags & FTW_PHYS) { + ftsflags |= FTS_PHYSICAL; + } else { + ftsflags |= FTS_LOGICAL; + } + postorder = (ftwflags & FTW_DEPTH) != 0; + + /* We have been requested to change directories, and fts doesn't + always do it (never for FTS_LOGICAL, and sometimes not for + FTS_PHYSICAL) */ + if (ftwflags & FTW_CHDIR) { + cwd_fd = open(".", O_RDONLY, 0); + if (cwd_fd < 0) { + error = -1; + goto done; + } + /* Prevent problems if fts ever starts using chdir when passed + FTS_PHYSICAL */ + ftsflags |= FTS_NOCHDIR; + } + +#if __DARWIN_UNIX03 + struct stat path_stat; + + /* UNIX03 requires us to return -1/errno=ELOOP if path + is a looping symlink; fts_open is succesful and fts_read + gives us FTS_NS which isn't very useful, in fact we get + pretty much the same behaviour for ENAMETOOLONG, ENOENT, + ENOTDIR, and EACCES */ + { + int rc = stat(path, &path_stat); + if (rc < 0 + && (errno == ELOOP || errno == ENAMETOOLONG || errno == ENOENT + || errno == ENOTDIR || errno == EACCES)) { + error = -1; + goto done; + } + if (rc >= 0 && nfn) { + if (!S_ISDIR(path_stat.st_mode)) { + errno = ENOTDIR; + error = -1; + goto done; + } + } + } +#endif + paths[0] = path; + paths[1] = NULL; + ftsp = fts_open((char * const *)paths, ftsflags, NULL); + if (ftsp == NULL) { + error = -1; + goto done; + } + error = 0; + while ((cur = fts_read(ftsp)) != NULL) { + switch (cur->fts_info) { + case FTS_D: + if (postorder) + continue; + SKIP_MOUNT; + /* we will get FTS_DNR next (this is not an issue for + FTS_DP, only FTS_D) */ + if (access(cur->fts_path, R_OK) != 0) + continue; + fnflag = FTW_D; + break; + case FTS_DNR: + fnflag = FTW_DNR; + break; + case FTS_DP: + if (!postorder) + continue; + SKIP_MOUNT; + fnflag = FTW_DP; + break; + case FTS_F: + case FTS_DEFAULT: + SKIP_MOUNT; + fnflag = FTW_F; + break; + case FTS_NS: + case FTS_NSOK: + fnflag = FTW_NS; + break; + case FTS_SL: + fnflag = FTW_SL; + break; + case FTS_SLNONE: + fnflag = nfn ? FTW_SLN : FTW_SL; +#if __DARWIN_UNIX03 + { + /* The legacy behaviour did not signal an error + on symlink loops unless they ended up causing + a directory cycle, but the Unix2003 standard + requires ELOOP to end ftw and nftw walks with + an error */ + struct stat sb; + int rc = stat(cur->fts_path, &sb); + if (rc < 0 && errno == ELOOP) { + error = -1; + goto done; + } + } +#endif + break; + case FTS_DC: +#if __DARWIN_UNIX03 + /* Unix03 says nftw should break cycles and not return + errors in non-physical mode (which is definitly what it + says ftw can't do) */ + if (nfn && !(ftwflags & FTW_PHYS)) { + /* 4489297 - when FTW_DEPTH is set, skip + the link also */ + if (postorder) + continue; + fnflag = FTW_D; + break; + } +#endif + errno = ELOOP; + /* FALLTHROUGH */ + default: + error = -1; + goto done; + } + + if (cwd_fd >= 0) { + char *dir, *free_me = NULL; + if (fnflag == FTW_D) { + dir = cur->fts_path; + } else { + /* we could alloc just enough for the directory, + and use memmove -- but that is a little more + error prone, and not noticable in with all the + extra work... */ + dir = free_me = strdup(cur->fts_path); + dir[cur->fts_pathlen - cur->fts_namelen] = '\0'; + } + int rc = chdir(dir); + if (free_me) { + free(free_me); + } + if (rc < 0) { + if(cur->fts_pathlen == cur->fts_namelen && + fnflag == FTW_DNR) { + /* If cwd_fd is our last FD, fts_read will give us FTS_DNR + * and fts_path == fts_name == "." + * This check results in the correct errno being returned. + */ + errno = EMFILE; + } + error = -1; + goto done; + } + } + if (nfn) { + ftw.base = cur->fts_pathlen - cur->fts_namelen; + ftw.level = cur->fts_level; + error = nfn(cur->fts_path, cur->fts_statp, fnflag, &ftw); + } else { + error = ofn(cur->fts_path, cur->fts_statp, fnflag); + } + if (cwd_fd >= 0) { + if (fchdir(cwd_fd) < 0) { + error = -1; + goto done; + } + } + + if (error != 0) + break; + } +done: + sverrno = errno; + if(ftsp != NULL) + (void) fts_close(ftsp); + if(cwd_fd >= 0) + (void) close(cwd_fd); + errno = sverrno; + return (error); +} + +int +ftw(const char *path, int (*fn)(const char *, const struct stat *, int), + int nfds) +{ + /* The legacy implmentation didn't follow symlinks, but Unix03 + does - this was likely a bug in the legacy implemtation; JKH + thinks we ought change the legacy behaviour, and I agree; anyone + who doesn't should replace FTW_PHYS with + __DARWIN_UNIX03 ? 0 : FTW_PHYS */ + return both_ftw(path, fn, NULL, nfds, FTW_PHYS); +} + +int +nftw(const char *path, int (*fn)(const char *, const struct stat *, int, + struct FTW *), int nfds, int ftwflags) +{ + return both_ftw(path, NULL, fn, nfds, ftwflags); +} diff --git a/gen/nlist.3 b/gen/nlist.3 new file mode 100644 index 0000000..09df218 --- /dev/null +++ b/gen/nlist.3 @@ -0,0 +1,77 @@ +.\" $OpenBSD: nlist.3,v 1.2 1996/08/19 08:25:07 tholo Exp $ +.\" +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd April 19, 1994 +.Dt NLIST 3 +.Os Darwin +.Sh NAME +.Nm nlist +.Nd retrieve symbol table name list from an executable file +.Sh SYNOPSIS +.Fd #include +.Ft int +.Fn nlist "const char *filename" "struct nlist *nl" +.Sh DESCRIPTION +The +.Fn nlist +function +retrieves name list entries from the symbol table of an +executable file. (See ) +The argument +.Fa \&nl +is set to reference the +beginning of the list. +The list is preened of binary and invalid data; +if an entry in the +name list is valid, the +.Fa n_type +and +.Fa n_value +for the entry are copied into the list +referenced by +.Fa \&nl . +No other data is copied. +The last entry in the list is always +.Dv NULL . +.Sh RETURN VALUES +The number of invalid entries is returned if successful; otherwise, +if the file +.Fa filename +does not exist or is not executable, the returned value is \-1. +.Sh SEE ALSO +.Xr Mach-O 5 +.Sh HISTORY +A +.Fn nlist +function appeared in +.At v6 . diff --git a/gen/nlist.c b/gen/nlist.c new file mode 100644 index 0000000..817c043 --- /dev/null +++ b/gen/nlist.c @@ -0,0 +1,340 @@ +/* + * Copyright (c) 1999, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* temporarily comment this file out for LP64, until code can be modified */ +#ifndef __LP64__ + +#include +#include +#include +#include +#include +#include +#include + +/* Stuff lifted from and since they are gone */ +/* + * Header prepended to each a.out file. + */ +struct exec { +unsigned short a_machtype; /* machine type */ +unsigned short a_magic; /* magic number */ +unsigned long a_text; /* size of text segment */ +unsigned long a_data; /* size of initialized data */ +unsigned long a_bss; /* size of uninitialized data */ +unsigned long a_syms; /* size of symbol table */ +unsigned long a_entry; /* entry point */ +unsigned long a_trsize; /* size of text relocation */ +unsigned long a_drsize; /* size of data relocation */ +}; + +#define OMAGIC 0407 /* old impure format */ +#define NMAGIC 0410 /* read-only text */ +#define ZMAGIC 0413 /* demand load format */ + +#define N_BADMAG(x) \ + (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC) +#define N_TXTOFF(x) \ + ((x).a_magic==ZMAGIC ? 0 : sizeof (struct exec)) +#define N_SYMOFF(x) \ + (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize) + +#include +#include +#include +#include +#include + +/* + * CPUSUBTYPE_SUPPORT should be changed to non-zero once the + * cpusubtype_* routines are available in libc. + */ +#define CPUSUBTYPE_SUPPORT 0 + +int __fdnlist(int fd, struct nlist *list); + +/* + * nlist - retreive attributes from name list (string table version) + */ + +int +nlist(name, list) + const char *name; + struct nlist *list; +{ + int fd, n; + + fd = open(name, O_RDONLY, 0); + if (fd < 0) + return (-1); + n = __fdnlist(fd, list); + (void)close(fd); + return (n); +} + +/* Note: __fdnlist() is called from kvm_nlist in libkvm's kvm.c */ + +int +__fdnlist(fd, list) + int fd; + struct nlist *list; +{ + register struct nlist *p, *q; + register char *s1, *s2; + register int n, m; + int maxlen, nreq; + off_t sa; /* symbol address */ + off_t ss; /* start of strings */ + struct exec buf; + struct nlist space[BUFSIZ/sizeof (struct nlist)]; + unsigned arch_offset = 0; + + maxlen = 0; + for (q = list, nreq = 0; q->n_un.n_name && q->n_un.n_name[0]; q++, nreq++) { + q->n_type = 0; + q->n_value = 0; + q->n_desc = 0; + q->n_sect = 0; + n = strlen(q->n_un.n_name); + if (n > maxlen) + maxlen = n; + } + if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf) || + (N_BADMAG(buf) && *((uint32_t *)&buf) != MH_MAGIC && + OSSwapBigToHostInt32(*((uint32_t *)&buf)) != FAT_MAGIC)) { + return (-1); + } + + /* Deal with fat file if necessary */ + if (OSSwapBigToHostInt32(*((uint32_t *)&buf)) == FAT_MAGIC) { + struct host_basic_info hbi; + struct fat_header fh; + struct fat_arch *fat_archs, *fap; + unsigned i; + host_t host; + + /* Get our host info */ + host = mach_host_self(); + i = HOST_BASIC_INFO_COUNT; + if (host_info(host, HOST_BASIC_INFO, + (host_info_t)(&hbi), &i) != KERN_SUCCESS) { + return (-1); + } + mach_port_deallocate(mach_task_self(), host); + + /* Read in the fat header */ + lseek(fd, 0, SEEK_SET); + if (read(fd, (char *)&fh, sizeof(fh)) != sizeof(fh)) { + return (-1); + } + + /* Convert fat_narchs to host byte order */ + fh.nfat_arch = OSSwapBigToHostInt32(fh.nfat_arch); + + /* Read in the fat archs */ + fat_archs = (struct fat_arch *)reallocarray(NULL, fh.nfat_arch, + sizeof(struct fat_arch)); + if (fat_archs == NULL) { + return (-1); + } + if (read(fd, (char *)fat_archs, + sizeof(struct fat_arch) * fh.nfat_arch) != + sizeof(struct fat_arch) * fh.nfat_arch) { + free(fat_archs); + return (-1); + } + + /* + * Convert archs to host byte ordering (a constraint of + * cpusubtype_getbestarch() + */ + for (i = 0; i < fh.nfat_arch; i++) { + fat_archs[i].cputype = + OSSwapBigToHostInt32(fat_archs[i].cputype); + fat_archs[i].cpusubtype = + OSSwapBigToHostInt32(fat_archs[i].cpusubtype); + fat_archs[i].offset = + OSSwapBigToHostInt32(fat_archs[i].offset); + fat_archs[i].size = + OSSwapBigToHostInt32(fat_archs[i].size); + fat_archs[i].align = + OSSwapBigToHostInt32(fat_archs[i].align); + } + +#if CPUSUBTYPE_SUPPORT + fap = cpusubtype_getbestarch(hbi.cpu_type, hbi.cpu_subtype, + fat_archs, fh.nfat_arch); +#else + fap = NULL; + for (i = 0; i < fh.nfat_arch; i++) { + if (fat_archs[i].cputype == hbi.cpu_type) { + fap = &fat_archs[i]; + break; + } + } +#endif /* CPUSUBTYPE_SUPPORT */ + if (!fap) { + free(fat_archs); + return (-1); + } + arch_offset = fap->offset; + free(fat_archs); + + /* Read in the beginning of the architecture-specific file */ + lseek(fd, arch_offset, SEEK_SET); + if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf)) { + return (-1); + } + } + + if (*((uint32_t *)&buf) == MH_MAGIC) { + struct mach_header mh; + struct load_command *load_commands, *lcp; + struct symtab_command *stp; + long i; + + lseek(fd, arch_offset, SEEK_SET); + if (read(fd, (char *)&mh, sizeof(mh)) != sizeof(mh)) { + return (-1); + } + load_commands = (struct load_command *)malloc(mh.sizeofcmds); + if (load_commands == NULL) { + return (-1); + } + if (read(fd, (char *)load_commands, mh.sizeofcmds) != + mh.sizeofcmds) { + free(load_commands); + return (-1); + } + stp = NULL; + lcp = load_commands; + for (i = 0; i < mh.ncmds; i++) { + if (lcp->cmdsize % sizeof(uint32_t) != 0 || + lcp->cmdsize <= 0 || + (char *)lcp + lcp->cmdsize > + (char *)load_commands + mh.sizeofcmds) { + free(load_commands); + return (-1); + } + if (lcp->cmd == LC_SYMTAB) { + if (lcp->cmdsize != + sizeof(struct symtab_command)) { + free(load_commands); + return (-1); + } + stp = (struct symtab_command *)lcp; + break; + } + lcp = (struct load_command *) + ((char *)lcp + lcp->cmdsize); + } + if (stp == NULL) { + free(load_commands); + return (-1); + } + sa = stp->symoff + arch_offset; + ss = stp->stroff + arch_offset; + n = stp->nsyms * sizeof(struct nlist); + free(load_commands); + } + else { + sa = N_SYMOFF(buf) + arch_offset; + ss = sa + buf.a_syms + arch_offset; + n = buf.a_syms; + } + + lseek(fd, sa, SEEK_SET); + while (n) { + off_t savpos; + + m = sizeof (space); + if (n < m) + m = n; + if (read(fd, (char *)space, m) != m) + break; + n -= m; + savpos = lseek(fd, 0, SEEK_CUR); + for (q = space; (m -= sizeof(struct nlist)) >= 0; q++) { + char nambuf[BUFSIZ]; + + if (q->n_un.n_strx == 0 || q->n_type & N_STAB) + continue; + lseek(fd, ss+q->n_un.n_strx, SEEK_SET); + read(fd, nambuf, maxlen+1); + for (p = list; p->n_un.n_name && p->n_un.n_name[0]; p++) { + s1 = p->n_un.n_name; + s2 = nambuf; + while (*s1) { + if (*s1++ != *s2++) + goto cont; + } + if (*s2) + goto cont; + p->n_value = q->n_value; + p->n_type = q->n_type; + p->n_desc = q->n_desc; + p->n_sect = q->n_sect; + if (--nreq == 0) + return (nreq); + break; + cont: ; + } + } + lseek(fd, savpos, SEEK_SET); + } + return (nreq); +} + +#endif /* !__LP64__ */ diff --git a/gen/oldsyslog.c b/gen/oldsyslog.c new file mode 100644 index 0000000..687ac84 --- /dev/null +++ b/gen/oldsyslog.c @@ -0,0 +1,321 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef __STDC__ +#include +#else +#include +#endif + +#include + +#ifdef BUILDING_VARIANT +__private_extern__ int _sl_LogFile; /* fd for log */ +__private_extern__ int _sl_connected; /* have done connect */ +__private_extern__ int _sl_LogStat; /* status bits, set by openlog() */ +__private_extern__ const char *_sl_LogTag; /* string to tag the entry with */ +__private_extern__ int _sl_LogFacility; /* default facility code */ +__private_extern__ int _sl_LogMask; /* mask of priorities to be logged */ +#else /* !BUILDING_VARIANT */ +__private_extern__ int _sl_LogFile = -1; /* fd for log */ +__private_extern__ int _sl_connected = 0; /* have done connect */ +__private_extern__ int _sl_LogStat = 0; /* status bits, set by openlog() */ +__private_extern__ const char *_sl_LogTag = NULL; /* string to tag the entry with */ +__private_extern__ int _sl_LogFacility = LOG_USER; /* default facility code */ +__private_extern__ int _sl_LogMask = 0xff; /* mask of priorities to be logged */ +#endif /* BUILDING_VARIANT */ + +/* + * syslog, vsyslog -- + * print message on log file; output is intended for syslogd(8). + */ +void +#ifdef __STDC__ +syslog(int pri, const char *fmt, ...) +#else +syslog(pri, fmt, va_alist) + int pri; + char *fmt; + va_dcl +#endif +{ + va_list ap; + +#ifdef __STDC__ + va_start(ap, fmt); +#else + va_start(ap); +#endif + vsyslog(pri, fmt, ap); + va_end(ap); +} + +void +vsyslog(pri, fmt, ap) + int pri; + register const char *fmt; + va_list ap; +{ + register int cnt; + register char ch, *p, *t; + time_t now; + int fd, saved_errno; +#define TBUF_LEN 2048 +#define FMT_LEN 1024 + char *stdp, tbuf[TBUF_LEN], fmt_cpy[FMT_LEN]; + int tbuf_left, fmt_left, prlen; + +#define INTERNALLOG LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID + /* Check for invalid bits. */ + if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) { + syslog(INTERNALLOG, + "syslog: unknown facility/priority: %x", pri); + pri &= LOG_PRIMASK|LOG_FACMASK; + } + + /* Check priority against setlogmask values. */ + if (!(LOG_MASK(LOG_PRI(pri)) & _sl_LogMask)) + return; + + saved_errno = errno; + + /* Set default facility if none specified. */ + if ((pri & LOG_FACMASK) == 0) + pri |= _sl_LogFacility; + + /* Build the message. */ + + /* + * Although it's tempting, we can't ignore the possibility of + * overflowing the buffer when assembling the "fixed" portion + * of the message. Strftime's "%h" directive expands to the + * locale's abbreviated month name, but if the user has the + * ability to construct to his own locale files, it may be + * arbitrarily long. + */ + (void)time(&now); + + p = tbuf; + tbuf_left = TBUF_LEN; + +#define DEC() \ + do { \ + if (prlen >= tbuf_left) \ + prlen = tbuf_left - 1; \ + p += prlen; \ + tbuf_left -= prlen; \ + } while (0) + + prlen = snprintf(p, tbuf_left, "<%d>", pri); + DEC(); + + prlen = strftime(p, tbuf_left, "%h %e %T ", localtime(&now)); + DEC(); + + if (_sl_LogStat & LOG_PERROR) + stdp = p; + if (_sl_LogTag == NULL) + _sl_LogTag = *(*_NSGetArgv()); + if (_sl_LogTag != NULL) { + prlen = snprintf(p, tbuf_left, "%s", _sl_LogTag); + DEC(); + } + if (_sl_LogStat & LOG_PID) { + prlen = snprintf(p, tbuf_left, "[%d]", getpid()); + DEC(); + } + if (_sl_LogTag != NULL) { + if (tbuf_left > 1) { + *p++ = ':'; + tbuf_left--; + } + if (tbuf_left > 1) { + *p++ = ' '; + tbuf_left--; + } + } + + /* + * We wouldn't need this mess if printf handled %m, or if + * strerror() had been invented before syslog(). + */ + for (t = fmt_cpy, fmt_left = FMT_LEN; (ch = *fmt); ++fmt) { + if (ch == '%' && fmt[1] == 'm') { + ++fmt; + prlen = snprintf(t, fmt_left, "%s", + strerror(saved_errno)); + if (prlen >= fmt_left) + prlen = fmt_left - 1; + t += prlen; + fmt_left -= prlen; + } else { + if (fmt_left > 1) { + *t++ = ch; + fmt_left--; + } + } + } + *t = '\0'; + + prlen = vsnprintf(p, tbuf_left, fmt_cpy, ap); + DEC(); + cnt = p - tbuf; + + /* Output to stderr if requested. */ + if (_sl_LogStat & LOG_PERROR) { + struct iovec iov[2]; + + iov[0].iov_base = stdp; + iov[0].iov_len = cnt - (stdp - tbuf); + iov[1].iov_base = "\n"; + iov[1].iov_len = 1; + (void)writev(STDERR_FILENO, iov, 2); + } + + /* Get connected, output the message to the local logger. */ + if (!_sl_connected) + openlog(_sl_LogTag, _sl_LogStat | LOG_NDELAY, 0); + if (send(_sl_LogFile, tbuf, cnt, 0) >= 0) + return; + + /* + * Output the message to the console; don't worry about blocking, + * if console blocks everything will. Make sure the error reported + * is the one from the syslogd failure. + */ + if (_sl_LogStat & LOG_CONS && + (fd = open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) { + struct iovec iov[2]; + + p = strchr(tbuf, '>') + 1; + iov[0].iov_base = p; + iov[0].iov_len = cnt - (p - tbuf); + iov[1].iov_base = "\r\n"; + iov[1].iov_len = 2; + (void)writev(fd, iov, 2); + (void)close(fd); + } +} + +#ifndef BUILDING_VARIANT + +static struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */ + +void +openlog(ident, logstat, logfac) + const char *ident; + int logstat, logfac; +{ + if (ident != NULL) + _sl_LogTag = ident; + _sl_LogStat = logstat; + if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0) + _sl_LogFacility = logfac; + + if (_sl_LogFile == -1) { + SyslogAddr.sun_family = AF_UNIX; + (void)strncpy(SyslogAddr.sun_path, _PATH_LOG, + sizeof(SyslogAddr.sun_path)); + if (_sl_LogStat & LOG_NDELAY) { + if ((_sl_LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) + return; + (void)fcntl(_sl_LogFile, F_SETFD, 1); + } + } + if (_sl_LogFile != -1 && !_sl_connected) + if (connect(_sl_LogFile, (struct sockaddr *)&SyslogAddr, sizeof(SyslogAddr)) == -1) { + (void)close(_sl_LogFile); + _sl_LogFile = -1; + } else + _sl_connected = 1; +} + +void +closelog() +{ + (void)close(_sl_LogFile); + _sl_LogFile = -1; + _sl_connected = 0; +} + +/* setlogmask -- set the log mask level */ +int +setlogmask(pmask) + int pmask; +{ + int omask; + + omask = _sl_LogMask; + if (pmask != 0) + _sl_LogMask = pmask; + return (omask); +} + +#endif /* !BUILDING_VARIANT */ diff --git a/gen/posix_memalign.3 b/gen/posix_memalign.3 new file mode 100644 index 0000000..212bef9 --- /dev/null +++ b/gen/posix_memalign.3 @@ -0,0 +1,96 @@ +.\" Copyright (c) 2006 Apple Computer, Inc. All rights reserved. +.\" +.\" @APPLE_LICENSE_HEADER_START@ +.\" +.\" The contents of this file constitute Original Code as defined in and +.\" are subject to the Apple Public Source License Version 1.1 (the +.\" "License"). You may not use this file except in compliance with the +.\" License. Please obtain a copy of the License at +.\" http://www.apple.com/publicsource and read it before using this file. +.\" +.\" This Original Code and all software distributed under the License are +.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +.\" License for the specific language governing rights and limitations +.\" under the License. +.\" +.\" @APPLE_LICENSE_HEADER_END@ +.\" +.Dd April 9, 2008 +.Dt POSIX_MEMALIGN 3 +.Os +.Sh NAME +.Nm posix_memalign +.Nd aligned memory allocation +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fo posix_memalign +.Fa "void **memptr" +.Fa "size_t alignment" +.Fa "size_t size" +.Fc +.Sh DESCRIPTION +The +.Fn posix_memalign +function allocates +.Fa size +bytes of memory such that the allocation's base address is an exact multiple of +.Fa alignment , +and returns the allocation in the value pointed to by +.Fa memptr . +.Pp +The requested +.Fa alignment +must be a power of 2 at least as large as +.Fn sizeof "void *" . +.Pp +Memory that is allocated via +.Fn posix_memalign +can be used as an argument in subsequent calls to +.Xr realloc 3 , +.Xr reallocf 3 , +and +.Xr free 3 . +(Note however, that the allocation returned by +.Xr realloc 3 +or +.Xr reallocf 3 +is not guaranteed to preserve the original +.Fa alignment ) . +.Sh NOTES +.Fn posix_memalign +should be used judiciously as the algorithm that realizes the +.Fa alignment +constraint can incur significant memory overhead. +.Sh RETURN VALUES +The +.Fn posix_memalign +function returns the value 0 if successful; otherwise it returns an error value. +.Sh ERRORS +The +.Fn posix_memalign +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa alignment +parameter is not a power of 2 at least as large as +.Fn sizeof "void *" . +.It Bq Er ENOMEM +Memory allocation error. +.El +.Sh SEE ALSO +.Xr free 3 , +.Xr malloc 3 , +.Xr realloc 3 , +.Xr reallocf 3 , +.Xr valloc 3 , +.Xr malloc_zone_memalign 3 +.Sh STANDARDS +The +.Fn posix_memalign +function conforms to +.St -p1003.1-2001 . diff --git a/gen/pwcache.3 b/gen/pwcache.3 new file mode 100644 index 0000000..8a3d3ea --- /dev/null +++ b/gen/pwcache.3 @@ -0,0 +1,97 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)pwcache.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/gen/pwcache.3,v 1.10 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd June 9, 1993 +.Dt PWCACHE 3 +.Os +.Sh NAME +.Nm pwcache +.Nd cache password and group entries +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In pwd.h +.Ft char * +.Fn user_from_uid "uid_t uid" "int nouser" +.In grp.h +.Ft char * +.Fn group_from_gid "gid_t gid" "int nogroup" +.Sh DESCRIPTION +The +.Fn user_from_uid +function returns the user name associated with the argument +.Fa uid . +The user name is cached so that multiple calls with the same +.Fa uid +do not require additional calls to +.Xr getpwuid 3 . +If there is no user associated with the +.Fa uid , +a pointer is returned +to a string representation of the +.Fa uid , +unless the argument +.Fa nouser +is non-zero, in which case a +.Dv NULL +pointer is returned. +.Pp +The +.Fn group_from_gid +function returns the group name associated with the argument +.Fa gid . +The group name is cached so that multiple calls with the same +.Fa gid +do not require additional calls to +.Xr getgrgid 3 . +If there is no group associated with the +.Fa gid , +a pointer is returned +to a string representation of the +.Fa gid , +unless the argument +.Fa nogroup +is non-zero, in which case a +.Dv NULL +pointer is returned. +.Sh SEE ALSO +.Xr getgrgid 3 , +.Xr getpwuid 3 +.Sh HISTORY +The +.Fn user_from_uid +and +.Fn group_from_gid +functions first appeared in +.Bx 4.4 . diff --git a/gen/raise.c b/gen/raise.c new file mode 100644 index 0000000..430e5da --- /dev/null +++ b/gen/raise.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include + +int raise(int sig) { + int error = pthread_kill(pthread_self(), sig); + switch (error) { + case 0: + return 0; + case ENOTSUP: + return kill(getpid(), sig); + default: + errno = error; + return -1; + } +} diff --git a/gen/setlogin.c b/gen/setlogin.c new file mode 100644 index 0000000..b81cb1f --- /dev/null +++ b/gen/setlogin.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + +extern int __setlogin(const char* name); + +extern pthread_mutex_t __logname_mutex; +extern char *__logname; + +int setlogin(const char* name) +{ + pthread_mutex_lock(&__logname_mutex); + + int res = __setlogin(name); + if (res == 0 && __logname != NULL) { + __logname[0] = 0; + } + + pthread_mutex_unlock(&__logname_mutex); + + return res; +} diff --git a/gen/sigsetops.3 b/gen/sigsetops.3 new file mode 100644 index 0000000..76e8a17 --- /dev/null +++ b/gen/sigsetops.3 @@ -0,0 +1,129 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)sigsetops.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/sigsetops.3,v 1.6 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd June 4, 1993 +.Dt SIGSETOPS 3 +.Os +.Sh NAME +.Nm sigaddset , +.Nm sigdelset , +.Nm sigemptyset , +.Nm sigfillset , +.Nm sigismember +.Nd manipulate signal sets +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In signal.h +.Ft int +.Fo sigaddset +.Fa "sigset_t *set" +.Fa "int signo" +.Fc +.Ft int +.Fo sigdelset +.Fa "sigset_t *set" +.Fa "int signo" +.Fc +.Ft int +.Fo sigemptyset +.Fa "sigset_t *set" +.Fc +.Ft int +.Fo sigfillset +.Fa "sigset_t *set" +.Fc +.Ft int +.Fo sigismember +.Fa "const sigset_t *set" +.Fa "int signo" +.Fc +.Sh DESCRIPTION +These functions manipulate signal sets, stored in a +.Fa sigset_t . +Either +.Fn sigemptyset +or +.Fn sigfillset +must be called for every object of type +.Fa sigset_t +before any other use of the object. +.Pp +The +.Fn sigemptyset +function initializes a signal set to be empty. +.Pp +The +.Fn sigfillset +function initializes a signal set to contain all signals. +.Pp +The +.Fn sigaddset +function adds the specified signal +.Fa signo +to the signal set. +.Pp +The +.Fn sigdelset +function deletes the specified signal +.Fa signo +from the signal set. +.Pp +The +.Fn sigismember +function returns whether a specified signal +.Fa signo +is contained in the signal set. +.Pp +These functions +are provided as macros in the include file . +Actual functions are available +if their names are undefined (with #undef +.Em name ) . +.Sh RETURN VALUES +The +.Fn sigismember +function returns 1 +if the signal is a member of the set, +0 otherwise. +The other functions return 0. +.Sh ERRORS +Currently, no errors are detected. +.Sh SEE ALSO +.Xr kill 2 , +.Xr sigaction 2 , +.Xr sigsuspend 2 +.Sh STANDARDS +These functions are defined by +.St -p1003.1-88 . diff --git a/gen/sigsetops.c b/gen/sigsetops.c new file mode 100644 index 0000000..842dc79 --- /dev/null +++ b/gen/sigsetops.c @@ -0,0 +1,124 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include + +#undef sigemptyset +#undef sigfillset +#undef sigaddset +#undef sigdelset +#undef sigismember + +int +sigemptyset(set) + sigset_t *set; +{ + *set = 0; + return (0); +} + +int +sigfillset(set) + sigset_t *set; +{ + *set = ~(sigset_t)0; + return (0); +} + +int +sigaddset(set, signo) + sigset_t *set; + int signo; +{ + if ((signo < 0 ) || (signo > NSIG)) { + errno = EINVAL; + return(-1); + } + if (signo == 0) + return(0); + *set |= sigmask(signo); + return (0); +} + +int +sigdelset(set, signo) + sigset_t *set; + int signo; +{ + if ((signo < 0 ) || (signo > NSIG)) { + errno = EINVAL; + return(-1); + } + if (signo == 0) + return(0); + *set &= ~sigmask(signo); + return (0); +} + +int +sigismember(set, signo) + const sigset_t *set; + int signo; +{ + if ((signo < 0 ) || (signo > NSIG)) { + errno = EINVAL; + return(-1); + } + if (signo == 0) + return(0); + return ((*set & sigmask(signo)) != 0); +} diff --git a/gen/strtofflags.3 b/gen/strtofflags.3 new file mode 100644 index 0000000..ed790c6 --- /dev/null +++ b/gen/strtofflags.3 @@ -0,0 +1,105 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)setmode.3 8.2 (Berkeley) 4/28/95 +.\" $FreeBSD: src/lib/libc/gen/strtofflags.3,v 1.7 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd January 1, 2000 +.Dt STRTOFFLAGS 3 +.Os +.Sh NAME +.Nm fflagstostr , +.Nm strtofflags +.Nd convert between file flag bits and their string names +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft char * +.Fo fflagstostr +.Fa "unsigned long flags" +.Fc +.Ft int +.Fo strtofflags +.Fa "char **stringp" +.Fa "unsigned long *setp" +.Fa "unsigned long *clrp" +.Fc +.Sh DESCRIPTION +The +.Fn fflagstostr +function returns a comma separated string of the file flags represented by +.Fa flags . +If no flags are set a zero length string is returned. +.Pp +If memory cannot be allocated for the return value, +.Fn fflagstostr +returns +.Dv NULL . +.Pp +The value returned from +.Fn fflagstostr +is obtained from +.Fn malloc +and should be returned to the system with +.Fn free +when the program is done with it. +.Pp +The +.Fn strtofflags +function takes a string of file flags, as described in +.Xr chflags 1 , +parses it, and returns the 'set' flags and 'clear' flags +such as would be given as arguments to +.Xr chflags 2 . +On success +.Fn strtofflags +returns 0, otherwise it returns non-zero and +.Fa stringp +is left pointing to the offending token. +.Sh ERRORS +The +.Fn fflagstostr +function +may fail and set errno for any of the errors specified for the library +routine +.Xr malloc 3 . +.Sh SEE ALSO +.Xr chflags 1 , +.Xr chflags 2 , +.Xr malloc 3 +.Sh HISTORY +The +.Fn fflagstostr +and +.Fn strtofflags +functions first appeared in +.Fx 4.0 . diff --git a/gen/strtofflags.c b/gen/strtofflags.c new file mode 100644 index 0000000..1e45bda --- /dev/null +++ b/gen/strtofflags.c @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef lint +#if 0 +static char sccsid[] = "@(#)stat_flags.c 8.1 (Berkeley) 5/31/93"; +static const char rcsid[] = + "$FreeBSD: src/lib/libc/gen/strtofflags.c,v 1.18.2.1 2000/06/28 01:52:24 joe Exp $"; +#endif +#endif /* not lint */ + +#include +#include + +#include +#include +#include +#include + +static struct { + char *name; + u_long flag; + int invert; +} mapping[] = { + /* shorter names per flag first, all prefixed by "no" */ + { "nosappnd", SF_APPEND, 0 }, + { "nosappend", SF_APPEND, 0 }, + { "noarch", SF_ARCHIVED, 0 }, + { "noarchived", SF_ARCHIVED, 0 }, + { "noschg", SF_IMMUTABLE, 0 }, + { "noschange", SF_IMMUTABLE, 0 }, + { "nosimmutable", SF_IMMUTABLE, 0 }, + { "norestricted", SF_RESTRICTED, 0 }, + { "nosunlnk", SF_NOUNLINK, 0 }, + { "nosunlink", SF_NOUNLINK, 0 }, + { "nouappnd", UF_APPEND, 0 }, + { "nouappend", UF_APPEND, 0 }, + { "nouchg", UF_IMMUTABLE, 0 }, + { "nouchange", UF_IMMUTABLE, 0 }, + { "nouimmutable", UF_IMMUTABLE, 0 }, + { "nodump", UF_NODUMP, 1 }, + { "noopaque", UF_OPAQUE, 0 }, + { "nohidden", UF_HIDDEN, 0 }, + { "nocompressed", UF_COMPRESSED, 0 }, + { "nodatavault", UF_DATAVAULT, 0 }, + { "nodataless", SF_DATALESS, 0 }, +}; +#define longestflaglen 12 +#define nmappings (sizeof(mapping) / sizeof(mapping[0])) + +/* + * fflagstostr -- + * Convert file flags to a comma-separated string. If no flags + * are set, return the empty string. + */ +char * +fflagstostr(flags) + u_long flags; +{ + char *string; + char *sp, *dp; + u_long setflags; + int i; + + if ((string = (char *)malloc(nmappings * (longestflaglen + 1))) == NULL) + return (NULL); + + setflags = flags; + dp = string; + for (i = 0; i < nmappings; i++) { + if (setflags & mapping[i].flag) { + if (dp > string) + *dp++ = ','; + for (sp = mapping[i].invert ? mapping[i].name : + mapping[i].name + 2; *sp; *dp++ = *sp++) ; + setflags &= ~mapping[i].flag; + } + } + *dp = '\0'; + return (string); +} + +/* + * strtofflags -- + * Take string of arguments and return file flags. Return 0 on + * success, 1 on failure. On failure, stringp is set to point + * to the offending token. + */ +int +strtofflags(stringp, setp, clrp) + char **stringp; + u_long *setp, *clrp; +{ + char *string, *p; + int i; + + if (setp) + *setp = 0; + if (clrp) + *clrp = 0; + string = *stringp; + while ((p = strsep(&string, "\t ,")) != NULL) { + *stringp = p; + if (*p == '\0') + continue; + for (i = 0; i < nmappings; i++) { + if (strcmp(p, mapping[i].name + 2) == 0) { + if (mapping[i].invert) { + if (clrp) + *clrp |= mapping[i].flag; + } else { + if (setp) + *setp |= mapping[i].flag; + } + break; + } else if (strcmp(p, mapping[i].name) == 0) { + if (mapping[i].invert) { + if (setp) + *setp |= mapping[i].flag; + } else { + if (clrp) + *clrp |= mapping[i].flag; + } + break; + } + } + if (i == nmappings) + return 1; + } + return 0; +} diff --git a/gen/sync_volume_np.3 b/gen/sync_volume_np.3 new file mode 100644 index 0000000..87934af --- /dev/null +++ b/gen/sync_volume_np.3 @@ -0,0 +1,81 @@ +.\" Copyright (c) 2011 Apple Computer, Inc. All rights reserved. +.\" +.\" @APPLE_LICENSE_HEADER_START@ +.\" +.\" The contents of this file constitute Original Code as defined in and +.\" are subject to the Apple Public Source License Version 1.1 (the +.\" "License"). You may not use this file except in compliance with the +.\" License. Please obtain a copy of the License at +.\" http://www.apple.com/publicsource and read it before using this file. +.\" +.\" This Original Code and all software distributed under the License are +.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +.\" License for the specific language governing rights and limitations +.\" under the License. +.\" +.\" @APPLE_LICENSE_HEADER_END@ +.\" +.Dd October +.Dt SYNC_VOLUME_NP 3 +.Os +.Sh NAME +.Nm sync_volume_np +.Nd Sync a mounted filesystem +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn sync_volume_np "const char *path" "int flags" +.Ft int +.Fn fsync_volume_np "int fd" "int flags" +.Sh DESCRIPTION +The +.Fn sync_volume_np +function causes data and metadata on the filesystem containing +.Ar path +to be synced to disk; this may be any file or directory on that filesystem. The +.Fn fsync_volume_np +does the same thing, but using an open file descriptor for that +filesystem. +Both functions take a flags parameter, with the currently-defined +options: +.Bl -tag -width SYNC_VOLUME_FULLSYNC -offset indent +.It SYNC_VOLUME_FULLSYNC +Request that the data and metadata be written to the disk hardware; +if not set, then the hardware may keep it in cache. +.It SYNC_VOLUME_WAIT +Wait for the data and metadata to be written; if not set, then +it will return when the requests have been made. +.El +.Sh RETURN VALUES +Both functions return 0 on success, and a non-zero error code on error. +.Sh ERRORS +The +.Fn fsync_volume_np +function may return +.Er EBADF +if the +.Ar fd +parameter is not a valid, open file descriptor. +The +.Fn sync_volume_np +function may return errors if: +.Bl -tag -width ENAMETOOLONG +.It Bq Er EACCES +Search permission is denied for a component of the path prefix. +.It Bq Er EIO +An I/O error occurs while reading from or writing to the file system. +.It Bq Er ELOOP +Too many symbolic links are encountered in translating the pathname. +This is taken to be indicative of a looping symbolic link. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeds {NAME_MAX} characters, or an entire path name exceeds {PATH_MAX} characters. +.It Bq Er ENOENT +The named file does not exist. +.It Bq Er ENOTDIR +A component of the path prefix is not a directory. +.El diff --git a/gen/sync_volume_np.c b/gen/sync_volume_np.c new file mode 100644 index 0000000..7e2d638 --- /dev/null +++ b/gen/sync_volume_np.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include + +/* + * Sync a mounted filesystem, without syncing others. + * There are currently two flags that can be used: + * + * SYNC_VOLUME_FULLSYNC causes it to try to push the + * data to the platter (otherwise, it just pushes it + * to the disk drive, where it may remain in cache + * for a while). + * + * SYNC_VOLUME_WAIT causes it to wait until the writes + * have completed. Otherwise, it'll return as soon + * as the requests have been made. + * + * The functions are a simple wrapper for fsctl, and + * return what it does. + */ + +int +sync_volume_np(const char *path, int flags) { + int full_sync = 0; + int terrno; + int rv; + + if (flags & SYNC_VOLUME_FULLSYNC) + full_sync |= FSCTL_SYNC_FULLSYNC; + + if (flags & SYNC_VOLUME_WAIT) + full_sync |= FSCTL_SYNC_WAIT; + + terrno = errno; + rv = (fsctl(path, FSIOC_SYNC_VOLUME, &full_sync, 0) == -1) ? errno : 0; + errno = terrno; + return rv; +} + +int +fsync_volume_np(int fd, int flags) { + int full_sync = 0; + int terrno; + int rv; + + if (flags & SYNC_VOLUME_FULLSYNC) + full_sync |= FSCTL_SYNC_FULLSYNC; + + if (flags & SYNC_VOLUME_WAIT) + full_sync |= FSCTL_SYNC_WAIT; + + terrno = errno; + rv = (ffsctl(fd, FSCTL_SYNC_VOLUME, &full_sync, 0) == -1) ? errno : 0; + errno = terrno; + return rv; +} + diff --git a/gen/tcgetpgrp.3 b/gen/tcgetpgrp.3 new file mode 100644 index 0000000..9df905f --- /dev/null +++ b/gen/tcgetpgrp.3 @@ -0,0 +1,91 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)tcgetpgrp.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/tcgetpgrp.3,v 1.8 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd June 4, 1993 +.Dt TCGETPGRP 3 +.Os +.Sh NAME +.Nm tcgetpgrp +.Nd get foreground process group ID +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft pid_t +.Fo tcgetpgrp +.Fa "int fildes" +.Fc +.Sh DESCRIPTION +The +.Fn tcgetpgrp +function returns the value of the process group ID of the foreground +process group associated with the terminal device. +If there is no foreground process group, +.Fn tcgetpgrp +returns an invalid process ID. +.Sh ERRORS +If an error occurs, +.Fn tcgetpgrp +returns -1 and the global variable +.Va errno +is set to indicate the error, as follows: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fildes +argument is not a valid file descriptor. +.It Bq Er ENOTTY +The calling process does not have a controlling terminal or the +underlying terminal device represented by +.Fa fildes +is not the controlling terminal. +.El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/types.h +is necessary. +.Sh SEE ALSO +.Xr setpgid 2 , +.Xr setsid 2 , +.Xr tcsetpgrp 3 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn tcgetpgrp +function is expected to be compliant with the +.St -p1003.1-88 +specification. diff --git a/gen/tcsendbreak.3 b/gen/tcsendbreak.3 new file mode 100644 index 0000000..cb0cc41 --- /dev/null +++ b/gen/tcsendbreak.3 @@ -0,0 +1,169 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)tcsendbreak.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/tcsendbreak.3,v 1.8 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd June 4, 1993 +.Dt TCSENDBREAK 3 +.Os +.Sh NAME +.Nm tcdrain , +.Nm tcflow , +.Nm tcflush , +.Nm tcsendbreak +.Nd line control functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In termios.h +.Ft int +.Fo tcdrain +.Fa "int fildes" +.Fc +.Ft int +.Fo tcflow +.Fa "int fildes" +.Fa "int action" +.Fc +.Ft int +.Fo tcflush +.Fa "int fildes" +.Fa "int action" +.Fc +.Ft int +.Fo tcsendbreak +.Fa "int fildes" +.Fa "int duration" +.Fc +.Sh DESCRIPTION +The +.Fn tcdrain +function waits until all output written to the terminal referenced by +.Fa fildes +has been transmitted to the terminal. +.Pp +The +.Fn tcflow +function suspends transmission of data to, +or the reception of data from, +the terminal referenced by +.Fa fildes , +depending on the value of +.Fa action . +The value of +.Fa action +must be one of the following: +.Bl -tag -width "TCIOFF" +.It Fa TCOOFF +Suspend output. +.It Fa TCOON +Restart suspended output. +.It Fa TCIOFF +Transmit a STOP character, which is intended to cause the terminal to stop +transmitting data to the system. +(See the description of IXOFF in the +.Ql Input Modes +section of +.Xr termios 4 ) . +.It Fa TCION +Transmit a START character, which is intended to cause the terminal to start +transmitting data to the system. +(See the description of IXOFF in the +.Ql Input Modes +section of +.Xr termios 4 ) . +.El +.Pp +The +.Fn tcflush +function discards any data written to the terminal referenced by +.Fa fildes +which has not been transmitted to the terminal, or any data received +from the terminal but not yet read, depending on the value of +.Fa action . +The value of +.Fa action +must be one of the following: +.Bl -tag -width "TCIOFLUSH" +.It Fa TCIFLUSH +Flush data received but not read. +.It Fa TCOFLUSH +Flush data written but not transmitted. +.It Fa TCIOFLUSH +Flush both data received but not read and data written but not transmitted. +.El +.Pp +The +.Fn tcsendbreak +function transmits a continuous stream of zero-valued bits for four-tenths +of a second to the terminal referenced by +.Fa fildes . +The +.Fa duration +parameter is ignored in this implementation. +.Sh RETURN VALUES +Upon successful completion, all of these functions return a value of zero. +.Sh ERRORS +If any error occurs, a value of -1 is returned and the global variable +.Va errno +is set to indicate the error, as follows: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fildes +argument is not a valid file descriptor. +.It Bq Er EINTR +A signal interrupted the +.Fn tcdrain +function. +.It Bq Er EINVAL +The +.Fa action +argument is not a proper value. +.It Bq Er ENOTTY +The file associated with +.Fa fildes +is not a terminal. +.El +.Sh SEE ALSO +.Xr tcsetattr 3 , +.Xr termios 4 +.Sh STANDARDS +The +.Fn tcsendbreak , +.Fn tcdrain , +.Fn tcflush +and +.Fn tcflow +functions are expected to be compliant with the +.St -p1003.1-88 +specification. diff --git a/gen/tcsetattr.3 b/gen/tcsetattr.3 new file mode 100644 index 0000000..0edbad1 --- /dev/null +++ b/gen/tcsetattr.3 @@ -0,0 +1,357 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)tcsetattr.3 8.3 (Berkeley) 1/2/94 +.\" $FreeBSD: src/lib/libc/gen/tcsetattr.3,v 1.9 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd January 2, 1994 +.Dt TCSETATTR 3 +.Os +.Sh NAME +.Nm cfgetispeed , +.Nm cfgetospeed , +.Nm cfmakeraw , +.Nm cfsetispeed , +.Nm cfsetospeed , +.Nm cfsetspeed , +.Nm tcgetattr , +.Nm tcsetattr +.Nd manipulating the termios structure +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In termios.h +.Ft speed_t +.Fo cfgetispeed +.Fa "const struct termios *termios_p" +.Fc +.Ft speed_t +.Fo cfgetospeed +.Fa "const struct termios *termios_p" +.Fc +.Ft void +.Fo cfmakeraw +.Fa "struct termios *termios_p" +.Fc +.Ft int +.Fo cfsetispeed +.Fa "struct termios *termios_p" +.Fa "speed_t speed" +.Fc +.Ft int +.Fo cfsetospeed +.Fa "struct termios *termios_p" +.Fa "speed_t speed" +.Fc +.Ft int +.Fo cfsetspeed +.Fa "struct termios *termios_p" +.Fa "speed_t speed" +.Fc +.Ft int +.Fo tcgetattr +.Fa "int fildes" +.Fa "struct termios *termios_p" +.Fc +.Ft int +.Fo tcsetattr +.Fa "int fildes" +.Fa "int optional_actions" +.Fa "const struct termios *termios_p" +.Fc +.Sh DESCRIPTION +The +.Fn cfmakeraw , +.Fn tcgetattr , +and +.Fn tcsetattr +functions are provided for getting and setting the termios structure. +.Pp +The +.Fn cfgetispeed , +.Fn cfsetispeed , +.Fn cfgetospeed , +.Fn cfsetospeed , +and +.Fn cfsetspeed +functions are provided for getting and setting the baud rate values in +the termios structure. +As described below, +the effects of the functions on the terminal do not become effective, +nor are all errors detected, until the +.Fn tcsetattr +function is called. +Certain values for baud rates, set in the termios structure and passed to +.Fn tcsetattr , +have special meanings. +These are discussed in the portion of the manual page that describes the +.Fn tcsetattr +function. +.Sh GETTING AND SETTING THE BAUD RATE +The input and output baud rates are found in the termios structure. +The unsigned integer +.Li speed_t +is typedef'd in the include file +.Aq Pa termios.h . +The value of the integer corresponds directly to the baud rate being +represented; however, the following symbolic values are defined: +.Bd -literal +#define B0 0 +#define B50 50 +#define B75 75 +#define B110 110 +#define B134 134 +#define B150 150 +#define B200 200 +#define B300 300 +#define B600 600 +#define B1200 1200 +#define B1800 1800 +#define B2400 2400 +#define B4800 4800 +#define B9600 9600 +#define B19200 19200 +#define B38400 38400 +#ifndef _POSIX_C_SOURCE +#define EXTA 19200 +#define EXTB 38400 +#endif /*_POSIX_C_SOURCE */ +.Ed +.Pp +The +.Fn cfgetispeed +function returns the input baud rate in the termios structure referenced by +.Fa termios_p . +.Pp +The +.Fn cfsetispeed +function sets the input baud rate in the termios structure referenced by +.Fa termios_p +to +.Fa speed . +.Pp +The +.Fn cfgetospeed +function returns the output baud rate in the termios structure referenced by +.Fa termios_p . +.Pp +The +.Fn cfsetospeed +function sets the output baud rate in the termios structure referenced by +.Fa termios_p +to +.Fa speed . +.Pp +The +.Fn cfsetspeed +function sets both the input and output baud rate in the termios structure +referenced by +.Fa termios_p +to +.Fa speed . +.Pp +Upon successful completion, the functions +.Fn cfsetispeed , +.Fn cfsetospeed , +and +.Fn cfsetspeed +return a value of 0. +Otherwise, a value of -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh GETTING AND SETTING THE TERMIOS STATE +This section describes the functions that are used to control the general +terminal interface. +Unless otherwise noted for a specific command, these functions are restricted +from use by background processes. +Attempts to perform these operations shall cause the process group to be sent +a SIGTTOU signal. +If the calling process is blocking or ignoring SIGTTOU signals, the process +is allowed to perform the operation and the SIGTTOU signal is not sent. +.Pp +In all of the functions, although +.Fa fildes +is an open file descriptor, the functions affect the underlying terminal +file, not just the open file description that is associated +with the particular file descriptor. +.Pp +The +.Fn cfmakeraw +function modifies the flags stored in the termios structure to a state disabling +all input and output processing, giving a +.Dq raw I/O path . +It should be noted that there is no function to reverse this effect. +Because a variety of processing options could be re-enabled, +the correct method is for an application to snapshot the +current terminal state using the function +.Fn tcgetattr , +setting raw mode with +.Fn cfmakeraw +and the subsequent +.Fn tcsetattr , +and then using another +.Fn tcsetattr +with the saved state to revert to the previous terminal state. +.Pp +The +.Fn tcgetattr +function copies the parameters associated with the terminal referenced +by +.Fa fildes +in the termios structure referenced by +.Fa termios_p . +This function is allowed from a background process; +however, the terminal attributes may be subsequently changed +by a foreground process. +.Pp +The +.Fn tcsetattr +function sets the parameters associated with the terminal from the +termios structure referenced by +.Fa termios_p . +The +.Fa optional_actions +field is created by +.Em or Ns 'ing +the following values, as specified in the include file +.Aq Pa termios.h . +.Bl -tag -width "TCSADRAIN" +.It Fa TCSANOW +The change occurs immediately. +.It Fa TCSADRAIN +The change occurs after all output written to +.Fa fildes +has been transmitted to the terminal. +This value of +.Fa optional_actions +should be used when changing parameters that affect output. +.It Fa TCSAFLUSH +The change occurs after all output written to +.Fa fildes +has been transmitted to the terminal. +Additionally, any input that has been received but not read is discarded. +.It Fa TCSASOFT +If this value is +.Em or Ns 'ed +into the +.Fa optional_actions +value, the values of the +.Em c_cflag , +.Em c_ispeed , +and +.Em c_ospeed +fields are ignored. +.El +.Pp +The 0 baud rate is used to terminate the connection. +If 0 is specified as the output speed to the function +.Fn tcsetattr , +modem control will no longer be asserted on the terminal, disconnecting +the terminal. +.Pp +If zero is specified as the input speed to the function +.Fn tcsetattr , +the input baud rate will be set to the same value as that specified by +the output baud rate. +.Pp +If +.Fn tcsetattr +is unable to make any of the requested changes, it returns -1 and +sets errno. +Otherwise, it makes all of the requested changes it can. +If the specified input and output baud rates differ and are a combination +that is not supported, neither baud rate is changed. +.Pp +Upon successful completion, the functions +.Fn tcgetattr +and +.Fn tcsetattr +return a value of 0. +Otherwise, they +return -1 and the global variable +.Va errno +is set to indicate the error, as follows: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fildes +argument to +.Fn tcgetattr +or +.Fn tcsetattr +was not a valid file descriptor. +.It Bq Er EINTR +The +.Fn tcsetattr +function was interrupted by a signal. +.It Bq Er EINVAL +The +.Fa optional_actions +argument to the +.Fn tcsetattr +function was not valid, or an attempt was made to change an attribute +represented in the termios structure to an unsupported value. +.It Bq Er ENOTTY +The file associated with the +.Fa fildes +argument to +.Fn tcgetattr +or +.Fn tcsetattr +is not a terminal. +.El +.Sh SEE ALSO +.Xr tcsendbreak 3 , +.Xr termios 4 +.Sh STANDARDS +The +.Fn cfgetispeed , +.Fn cfsetispeed , +.Fn cfgetospeed , +.Fn cfsetospeed , +.Fn tcgetattr , +and +.Fn tcsetattr +functions are expected to be compliant with the +.St -p1003.1-88 +specification. +The +.Fn cfmakeraw +and +.Fn cfsetspeed +functions, +as well as the +.Li TCSASOFT +option to the +.Fn tcsetattr +function are extensions to the +.St -p1003.1-88 +specification. diff --git a/gen/tcsetpgrp.3 b/gen/tcsetpgrp.3 new file mode 100644 index 0000000..ef6ff36 --- /dev/null +++ b/gen/tcsetpgrp.3 @@ -0,0 +1,109 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)tcsetpgrp.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/gen/tcsetpgrp.3,v 1.9 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd June 4, 1993 +.Dt TCSETPGRP 3 +.Os +.Sh NAME +.Nm tcsetpgrp +.Nd set foreground process group ID +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fo tcsetpgrp +.Fa "int fildes" +.Fa "pid_t pgid_id" +.Fc +.Sh DESCRIPTION +If the process has a controlling terminal, the +.Fn tcsetpgrp +function sets the foreground process group ID associated with the +terminal device to +.Fa pgid_id . +The terminal device associated with +.Fa fildes +must be the controlling terminal of the calling process and the +controlling terminal must be currently associated with the session +of the calling process. +The value of +.Fa pgid_id +must be the same as the process group ID of a process in the same +session as the calling process. +.Sh RETURN VALUES +.Rv -std tcsetpgrp +.Sh ERRORS +The +.Fn tcsetpgrp +function will fail if: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fildes +argument is not a valid file descriptor. +.It Bq Er EINVAL +An invalid value of +.Fa pgid_id +was specified. +.It Bq Er ENOTTY +The calling process does not have a controlling terminal, or the file +represented by +.Fa fildes +is not the controlling terminal, or the controlling terminal is no +longer associated with the session of the calling process. +.It Bq Er EPERM +The +.Fa pgid_id +argument does not match the process group ID of a process in the same +session as the calling process. +.El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/types.h +is necessary. +.Sh SEE ALSO +.Xr setpgid 2 , +.Xr setsid 2 , +.Xr tcgetpgrp 3 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn tcsetpgrp +function is expected to be compliant with the +.St -p1003.1-88 +specification. diff --git a/gen/thread_stack_pcs.c b/gen/thread_stack_pcs.c new file mode 100644 index 0000000..5066a52 --- /dev/null +++ b/gen/thread_stack_pcs.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 1999-2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* Bertrand from vmutils -> CF -> System */ + +#include +#include +#include +#include +#include +#include "stack_logging.h" + +#define INSTACK(a) ((a) >= stackbot && (a) <= stacktop) +#if defined(__x86_64__) +#define ISALIGNED(a) ((((uintptr_t)(a)) & 0xf) == 0) +#elif defined(__i386__) +#define ISALIGNED(a) ((((uintptr_t)(a)) & 0xf) == 8) +#elif defined(__arm__) || defined(__arm64__) +#define ISALIGNED(a) ((((uintptr_t)(a)) & 0x1) == 0) +#endif + +__attribute__((noinline)) +static void +__thread_stack_pcs(vm_address_t *buffer, unsigned max, unsigned *nb, + unsigned skip, void *startfp) +{ + void *frame, *next; + pthread_t self = pthread_self(); + void *stacktop = pthread_get_stackaddr_np(self); + void *stackbot = stacktop - pthread_get_stacksize_np(self); + + *nb = 0; + + // Rely on the fact that our caller has an empty stackframe (no local vars) + // to determine the minimum size of a stackframe (frame ptr & return addr) + frame = __builtin_frame_address(0); + next = (void*)pthread_stack_frame_decode_np((uintptr_t)frame, NULL); + + /* make sure return address is never out of bounds */ + stacktop -= (next - frame); + + if(!INSTACK(frame) || !ISALIGNED(frame)) + return; + while (startfp || skip--) { + if (startfp && startfp < next) break; + if(!INSTACK(next) || !ISALIGNED(next) || next <= frame) + return; + frame = next; + next = (void*)pthread_stack_frame_decode_np((uintptr_t)frame, NULL); + } + while (max--) { + uintptr_t retaddr; + next = (void*)pthread_stack_frame_decode_np((uintptr_t)frame, &retaddr); + buffer[*nb] = retaddr; + (*nb)++; + if(!INSTACK(next) || !ISALIGNED(next) || next <= frame) + return; + frame = next; + } +} + +// Note that callee relies on this function having a minimal stackframe +// to introspect (i.e. no tailcall and no local variables) +__private_extern__ __attribute__((disable_tail_calls)) +void +_thread_stack_pcs(vm_address_t *buffer, unsigned max, unsigned *nb, + unsigned skip, void *startfp) +{ + // skip this frame + __thread_stack_pcs(buffer, max, nb, skip + 1, startfp); +} + +// Prevent thread_stack_pcs() from getting tail-call-optimized into +// __thread_stack_pcs() on 64-bit environments, thus making the "number of hot +// frames to skip" be more predictable, giving more consistent backtraces. +// +// See "stack logging: frames keep getting truncated" +// for why this is necessary. +// +// Note that callee relies on this function having a minimal stackframe +// to introspect (i.e. no tailcall and no local variables) +__attribute__((disable_tail_calls)) +void +thread_stack_pcs(vm_address_t *buffer, unsigned max, unsigned *nb) +{ + __thread_stack_pcs(buffer, max, nb, 0, NULL); +} diff --git a/gen/thread_stack_pcs.h b/gen/thread_stack_pcs.h new file mode 100644 index 0000000..25d2ddf --- /dev/null +++ b/gen/thread_stack_pcs.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * "Portions Copyright (c) 2004 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.0 (the 'License'). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License." + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _LIBC_THREAD_STACK_PCS_H +#define _LIBC_THREAD_STACK_PCS_H + +#include +#include +#include + +__BEGIN_DECLS + +extern void thread_stack_pcs(vm_address_t *buffer, unsigned max, unsigned *num); + +__END_DECLS + +#endif // _LIBC_THREAD_STACK_PCS_H diff --git a/gen/tzset.3 b/gen/tzset.3 new file mode 100644 index 0000000..18f980b --- /dev/null +++ b/gen/tzset.3 @@ -0,0 +1,340 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Arthur Olson. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)tzset.3 8.2 (Berkeley) 11/17/93 +.\" $FreeBSD: src/lib/libc/gen/tzset.3,v 1.12 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd November 17, 1993 +.Dt TZSET 3 +.Os +.Sh NAME +.Nm tzset , +.Nm tzsetwall +.Nd initialize time conversion information +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft void +.Fo tzset +.Fa void +.Fc +.Ft void +.Fo tzsetwall +.Fa void +.Fc +.Sh DESCRIPTION +The +.Fn tzset +function +initializes time conversion information used by the library routine +.Xr localtime 3 . +The environment variable +.Ev TZ +specifies how this is done. +.Pp +If +.Ev TZ +does not appear in the environment, the best available approximation to +local wall clock time, as specified by the +.Xr tzfile 5 Ns -format +file +#ifdef UNIFDEF_MOVE_LOCALTIME +.Pa /var/db/timezone/localtime , +#else /* !UNIFDEF_MOVE_LOCALTIME */ +.Pa /etc/localtime , +#endif /* UNIFDEF_MOVE_LOCALTIME */ +is used. +.Pp +If +.Ev TZ +appears in the environment but its value is a null string, +Coordinated Universal Time +.Pq Tn UTC +is used (without leap second correction). +.Pp +If +.Ev TZ +appears in the environment and its value begins with a colon +.Pq Ql \&: , +the rest of its value is used as a pathname of a +.Xr tzfile 5 Ns -format +file from which to read the time conversion information. +If the first character of the pathname is a slash +.Pq Ql / , +it is used as +an absolute pathname; otherwise, it is used as a pathname relative to +the system time conversion information directory. +.Pp +If its value does not begin with a colon, it is first used as the pathname +of a file (as described above) from which to read the time conversion +information. +If that file cannot be read, the value is then interpreted as a direct +specification (the format is described below) of the time conversion +information. +.Pp +If the +.Ev TZ +environment variable does not specify a +.Xr tzfile 5 Ns -format +file and cannot be interpreted as a direct specification, +.Tn UTC +is used. +.Pp +The +.Fn tzsetwall +function +sets things up so that +.Xr localtime +returns the best available approximation of local wall clock time. +.Sh SPECIFICATION FORMAT +When +.Ev TZ +is used directly as a specification of the time conversion information, +it must have the following syntax (spaces inserted for clarity): +.Bd -ragged -offset indent +.Em std offset +.Bo +.Em dst +.Bq Em offset +.Bq , Em rule +.Bc +.Ed +.Pp +Where: +.Bl -tag -width std_and_dst -offset indent +.It Em std No and Em dst +Three or more bytes that are the designation for the standard +.Pq Em std +or summer +.Pq Em dst +time zone. Only +.Em std +is required; if +.Em dst +is missing, then summer time does not apply in this locale. +Upper and lowercase letters are explicitly allowed. Any characters +except a leading colon +.Pq Ql \&: , +digits, comma +.Pq Ql \&, , +minus +.Pq Ql \- , +plus +.Pq Ql + , +and +.Tn ASCII +.Dv NUL +are allowed. +.It Em offset +Indicates the value one must add to the local time to arrive at +Coordinated Universal Time. The +.Em offset +has the form: +.Bd -ragged -offset indent +.Sm off +.Em hh Bo +.Em : mm +.Bq Em : ss +.Bc +.Sm on +.Ed +.Pp +The minutes +.Pq Em mm +and seconds +.Pq Em ss +are optional. The hour +.Pq Em hh +is required and may be a single digit. The +.Em offset +following +.Em std +is required. If no +.Em offset +follows +.Em dst , +summer time is assumed to be one hour ahead of standard time. One or +more digits may be used; the value is always interpreted as a decimal +number. The hour must be between zero and 24, and the minutes (and +seconds) \(em if present \(em between zero and 59. If preceded by a +.Pq Ql \- +the time zone shall be east of the Prime Meridian; otherwise it shall be +west (which may be indicated by an optional preceding +.Pq Ql + ) . +.It Em rule +Indicates when to change to and back from summer time. The +.Em rule +has the form: +.Bd -ragged -offset indent +.Em date/time,date/time +.Ed +.Pp +where the first +.Em date +describes when the change from standard to summer time occurs and the +second +.Em date +describes when the change back happens. Each +.Em time +field describes when, in current local time, the change to the other +time is made. +.Pp +The format of +.Em date +is one of the following: +.Bl -tag -width "M.m.n.d" +.It Sy J Em n +The Julian day +.Em n +(1 \*(Le +.Em n +\*(Le 365). +Leap days are not counted; that is, in all years \(em including leap +years \(em February 28 is day 59 and March 1 is day 60. It is +impossible to explicitly refer to the occasional February 29. +.It Em n +The zero-based Julian day +(0 \*(Le +.Em n +\*(Le 365 ) . +Leap days are counted, and it is possible to refer to February 29. +.It Sy M Em m.n.d +The +.Em d Ns 'th +day (0 \*(Le +.Em d +\*(Le 6) +of week +.Em n +of month +.Em m +of the year +(1 \*(Le +.Em n +\*(Le 5), +(1 \*(Le +.Em m +\*(Le 12), +where week 5 means +.Do +the last +.Em d +day in month +.Em m +.Dc +which may occur in either the fourth or the fifth week). Week 1 is the +first week in which the +.Em d Ns 'th +day occurs. Day zero is Sunday. +.Pp +The +.Em time +has the same format as +.Em offset +except that no leading sign +.Pq Ql \- +or +.Pq Ql + +is allowed. The default, if +.Em time +is not given, is +.Sy 02:00:00 . +.El +.Pp +If no +.Em rule +is present in the +.Ev TZ +specification, the rules specified +by the +.Xr tzfile 5 Ns -format +file +.Em posixrules +in the system time conversion information directory are used, with the +standard and summer time offsets from +.Tn UTC +replaced by those specified by +the +.Em offset +values in +.Ev TZ . +.El +.Pp +For compatibility with System V Release 3.1, a semicolon +.Pq Ql \&; +may be used to separate the +.Em rule +from the rest of the specification. +.Sh FILES +#ifdef UNIFDEF_TZDIR_SYMLINK +.ds zi /var/db/timezone/zoneinfo +#else /* !UNIFDEF_TZDIR_SYMLINK */ +.ds zi /usr/share/zoneinfo +#endif /* UNIFDEF_TZDIR_SYMLINK */ +.Bl -tag -width \*(zi/posixrules -compact +.It Pa /etc/localtime +local time zone file +.It Pa \*(zi +time zone directory +.It Pa \*(zi/posixrules +rules for +.Tn POSIX Ns -style +.Tn TZ Ns 's +.It Pa \*(zi/GMT +for +.Tn UTC +leap seconds +.El +.Pp +If the file +.Pa \*(zi/GMT +does not exist, +.Tn UTC +leap seconds are loaded from +.Pa \*(zi/posixrules . +.Sh SEE ALSO +.Xr date 1 , +.Xr gettimeofday 2 , +.Xr ctime 3 , +.Xr getenv 3 , +.Xr time 3 , +.Xr tzfile 5 +.Sh HISTORY +The +.Fn tzset +and +.Fn tzsetwall +functions first appeared in +.Bx 4.4 . diff --git a/gen/uname.3 b/gen/uname.3 new file mode 100644 index 0000000..85b417d --- /dev/null +++ b/gen/uname.3 @@ -0,0 +1,92 @@ +.\" Copyright (c) 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)uname.3 8.1 (Berkeley) 1/4/94 +.\" $FreeBSD: src/lib/libc/gen/uname.3,v 1.10 2001/10/01 16:08:51 ru Exp $ +.\" +.Dd January 4, 1994 +.Dt UNAME 3 +.Os +.Sh NAME +.Nm uname +.Nd get system identification +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/utsname.h +.Ft int +.Fn uname "struct utsname *name" +.Sh DESCRIPTION +The +.Fn uname +function stores nul-terminated strings of information identifying +the current system into the structure referenced by +.Fa name . +.Pp +The +.Vt utsname +structure is defined in the +.Aq Pa sys/utsname.h +header file, and contains the following members: +.Bl -tag -width nodenameXXXX -offset indent +.It sysname +Name of the operating system implementation. +.It nodename +Network name of this machine. +.It release +Release level of the operating system. +.It version +Version level of the operating system. +.It machine +Machine hardware platform. +.El +.Sh RETURN VALUES +.Rv -std uname +.Sh ERRORS +The +.Fn uname +function may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr sysctl 3 . +.Sh SEE ALSO +.Xr uname 1 , +.Xr sysctl 3 +.Sh STANDARDS +The +.Fn uname +function conforms to +.St -p1003.1-88 . +.Sh HISTORY +The +.Fn uname +function first appeared in +.Bx 4.4 . diff --git a/gen/uname.c b/gen/uname.c new file mode 100644 index 0000000..8ed2924 --- /dev/null +++ b/gen/uname.c @@ -0,0 +1,88 @@ +/* + * Copyright (c) 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include + +int +uname(name) + struct utsname *name; +{ + int mib[2], rval; + size_t len; + char *p; + + rval = 0; + + mib[0] = CTL_KERN; + mib[1] = KERN_OSTYPE; + len = sizeof(name->sysname); + if (sysctl(mib, 2, &name->sysname, &len, NULL, 0) == -1) + rval = -1; + + mib[0] = CTL_KERN; + mib[1] = KERN_HOSTNAME; + len = sizeof(name->nodename); + if (sysctl(mib, 2, &name->nodename, &len, NULL, 0) == -1) + rval = -1; + + mib[0] = CTL_KERN; + mib[1] = KERN_OSRELEASE; + len = sizeof(name->release); + if (sysctl(mib, 2, &name->release, &len, NULL, 0) == -1) + rval = -1; + + /* The version may have newlines in it, turn them into spaces. */ + mib[0] = CTL_KERN; + mib[1] = KERN_VERSION; + len = sizeof(name->version); + if (sysctl(mib, 2, &name->version, &len, NULL, 0) == -1) + rval = -1; + else + for (p = name->version; len--; ++p) + if (*p == '\n' || *p == '\t') { + if (len > 1) { + *p = ' '; + } else { + *p = '\0'; + } + } + mib[0] = CTL_HW; + mib[1] = HW_MACHINE; + len = sizeof(name->machine); + if (sysctl(mib, 2, &name->machine, &len, NULL, 0) == -1) + rval = -1; + return (rval); +} diff --git a/gen/utmpx-darwin.c b/gen/utmpx-darwin.c new file mode 100644 index 0000000..d9e555a --- /dev/null +++ b/gen/utmpx-darwin.c @@ -0,0 +1,1193 @@ +/* + * Copyright (c) 2005-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * "Portions Copyright (c) 2004 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.0 (the 'License'). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License." + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#ifdef UTMP_COMPAT +#include +#endif /* UTMP_COMPAT */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef UTMP_COMPAT +#include +#endif /* UTMP_COMPAT */ + +__private_extern__ const char __utx_magic__[UTMPX_MAGIC] = __UTX_MAGIC__; + +extern const char _utmpx_vers[]; /* in utmpx.c */ + +static void msg2lastlogx(asl_object_t, struct lastlogx *); +static void msg2utmpx(asl_object_t, struct utmpx *); +static void utmpx2msg(const struct utmpx *, asl_object_t); + +static size_t pw_size = 0; + +#define FACILITY "Facility" +#define WTMP_COUNT 32 + +/* ASL timeout in microseconds */ +#define ASL_QUERY_TIMEOUT 4000000 + +/* indirection causes argument to be substituted before stringification */ +#define STR(x) __STRING(x) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#ifdef UTMP_COMPAT +static char * +_pwnam_r(const char *user, struct passwd *pw) +{ + struct passwd *p; + char *buf; + + if (pw_size <= 0) { + pw_size = sysconf(_SC_GETPW_R_SIZE_MAX); + if (pw_size <= 0) + return NULL; + } + if ((buf = malloc(pw_size)) == NULL) + return NULL; + + getpwnam_r(user, pw, buf, pw_size, &p); + if (!p) { + free(buf); + return NULL; + } + return buf; +} +#endif + +static char * +_pwuid_r(uid_t uid, struct passwd *pw) +{ + struct passwd *p; + char *buf; + + if (pw_size <= 0) { + pw_size = sysconf(_SC_GETPW_R_SIZE_MAX); + if (pw_size <= 0) + return NULL; + } + if ((buf = malloc(pw_size)) == NULL) + return NULL; + + getpwuid_r(uid, pw, buf, pw_size, &p); + if (!p) { + free(buf); + return NULL; + } + return buf; +} + +struct lastlogx * +getlastlogx(uid_t uid, struct lastlogx *lx) +{ + char *buf; + struct passwd pw; + struct lastlogx *l; + + if ((buf = _pwuid_r(uid, &pw)) == NULL) + return NULL; + + l = getlastlogxbyname(pw.pw_name, lx); + free(buf); + return l; +} + +struct lastlogx * +getlastlogxbyname(const char *user, struct lastlogx *lx) +{ + asl_object_t m, query, res; + size_t cmax; + struct lastlogx *result = NULL; + + if (!user || !*user) return NULL; + + /* + * We search for the last LASTLOG_FACILITY entry that has the + * ut_user entry matching the user's name. + */ + m = asl_new(ASL_TYPE_QUERY); + if (m == NULL) + { + return NULL; + } + + asl_set_query(m, FACILITY, LASTLOG_FACILITY, ASL_QUERY_OP_EQUAL); + asl_set_query(m, "ut_user", user, ASL_QUERY_OP_EQUAL); + + query = asl_new(ASL_TYPE_LIST); + if (query == NULL) + { + asl_release(m); + return NULL; + } + + asl_append(query, m); + asl_release(m); + + res = NULL; + cmax = 0; + + res = asl_match(NULL, query, &cmax, -1, 1, ASL_QUERY_TIMEOUT, ASL_MATCH_DIRECTION_REVERSE); + asl_release(query); + + if (res == NULL) return NULL; + + m = asl_next(res); + + if (m == NULL) + { + asl_release(res); + return NULL; + } + + if (lx == NULL) + { + if ((lx = (struct lastlogx *)malloc(sizeof(*lx))) == NULL) + { + asl_release(res); + return NULL; + } + } + + msg2lastlogx(m, lx); + asl_release(res); + result = lx; + + return result; +} + +#define IGET(e,p) do { if ((cp = asl_get(m, __STRING(ut_##e))) != NULL) \ + u->p##_##e = (int)strtol(cp, NULL, 10); } while (0) +#define LGET(e,p) do { if ((cp = asl_get(m, __STRING(ut_##e))) != NULL) \ + u->p##_##e = strtol(cp, NULL, 10); } while (0) +#define SGET(e,p) do { if ((cp = asl_get(m, __STRING(ut_##e))) != NULL) \ + strncpy(u->p##_##e, cp, sizeof(u->p##_##e)); } while (0) + +/* fill in a struct lastlogx from an ASL message */ +static void +msg2lastlogx(asl_object_t m, struct lastlogx *u) +{ + const char *cp; + + bzero(u, sizeof(*u)); + SGET(line, ll); + LGET(tv.tv_sec, ll); + IGET(tv.tv_usec, ll); + SGET(host, ll); +} + +/* fill in a struct utmpx from an ASL message */ +static void +msg2utmpx(asl_object_t m, struct utmpx *u) +{ + const char *cp; + + bzero(u, sizeof(*u)); + SGET(user, ut); + SGET(id, ut); + SGET(line, ut); + IGET(pid, ut); + IGET(type, ut); + LGET(tv.tv_sec, ut); + IGET(tv.tv_usec, ut); + SGET(host, ut); +} + +/* fill in an ASL message from a struct utmpx */ +static void +utmpx2msg(const struct utmpx *u, asl_object_t m) +{ + char buf[_UTX_HOSTSIZE + 1]; /* the largest string in struct utmpx */ + const char *cp; +#define ISET(e) { snprintf(buf, sizeof(buf), "%d", u->e); \ + asl_set(m, #e, buf); } +#define LSET(e) { snprintf(buf, sizeof(buf), "%ld", u->e); \ + asl_set(m, #e, buf); } +#define SSET(e) if (*(u->e)) { \ + strncpy(buf, u->e, sizeof(u->e)); \ + buf[sizeof(u->e)] = 0; \ + asl_set(m, #e, buf); \ + } + + SSET(ut_user); + cp = (char *)u->ut_id + sizeof(u->ut_id); + while(--cp >= u->ut_id && isprint(*cp)) {} + if(cp < u->ut_id) { + SSET(ut_id); + } else { + snprintf(buf, sizeof(buf), "0x%02x 0x%02x 0x%02x 0x%02x", + (unsigned)u->ut_id[0], (unsigned)u->ut_id[1], + (unsigned)u->ut_id[2], (unsigned)u->ut_id[3]); + asl_set(m, "ut_id", buf); + } + SSET(ut_line); + if (u->ut_pid > 0) + ISET(ut_pid); + ISET(ut_type); + LSET(ut_tv.tv_sec); + ISET(ut_tv.tv_usec); + SSET(ut_host); +} + +static const char *utmpx_types[] = { + "EMPTY", /* 0 */ + "RUN_LVL", /* 1 */ + "BOOT_TIME", /* 2 */ + "OLD_TIME", /* 3 */ + "NEW_TIME", /* 4 */ + "INIT_PROCESS", /* 5 */ + "LOGIN_PROCESS", /* 6 */ + "USER_PROCESS", /* 7 */ + "DEAD_PROCESS", /* 8 */ + "ACCOUNTING", /* 9 */ + "SIGNATURE", /* 10 */ + "SHUTDOWN_TIME", /* 11 */ +}; + +/* send a struct utmpx record using ASL */ +__private_extern__ void +_utmpx_asl(const struct utmpx *u) +{ + asl_object_t asl = asl_open(NULL, NULL, ASL_OPT_NO_REMOTE); + asl_object_t m; + char msg[64]; + + if (u->ut_type == EMPTY) + return; + if ((m = asl_new(ASL_TYPE_MSG)) == NULL) { + asl_release(asl); + return; + } + /* + * If the ut_type is USER_PROCESS, we use the LASTLOG_FACILITY, + * otherwise we use the UTMPX_FACILITY. This makes it easy to + * search for lastlog entries, but for wtmp, we have to search + * for both facilities. + */ + if (u->ut_type == USER_PROCESS) + asl_set(m, FACILITY, LASTLOG_FACILITY); + else + asl_set(m, FACILITY, UTMPX_FACILITY); + asl_set(m, ASL_KEY_LEVEL, STR(ASL_LEVEL_NOTICE)); + utmpx2msg(u, m); + + /* Make a visible message for system.log */ + switch (u->ut_type) { + case BOOT_TIME: + case OLD_TIME: + case NEW_TIME: + case SHUTDOWN_TIME: + sprintf(msg, "%s: %ld %d", utmpx_types[u->ut_type], u->ut_tv.tv_sec, u->ut_tv.tv_usec); + break; + case INIT_PROCESS: + case LOGIN_PROCESS: + sprintf(msg, "%s: %d", utmpx_types[u->ut_type], (int)u->ut_pid); + break; + case USER_PROCESS: + case DEAD_PROCESS: + sprintf(msg, "%s: %d %.*s", utmpx_types[u->ut_type], (int)u->ut_pid, (int)sizeof(u->ut_line), u->ut_line); + break; + default: + if (u->ut_type >= 0 && u->ut_type < (sizeof(utmpx_types) / sizeof(*utmpx_types))) + sprintf(msg, "%s", utmpx_types[u->ut_type]); + else + sprintf(msg, "ut_type=%d", (int)u->ut_type); + break; + } + asl_set(m, ASL_KEY_MSG, msg); + asl_send(asl, m); + asl_release(m); + asl_release(asl); +} + +#define UT_USER (1 << 0) +#define UT_ID (1 << 1) +#define UT_LINE (1 << 2) +#define UT_PID (1 << 3) +#define UT_TV (1 << 4) + +__private_extern__ const struct utmpx * +_utmpx_working_copy(const struct utmpx *utx, struct utmpx *temp, int onlyid) +{ + int which; + static char idzero[_UTX_IDSIZE]; + + if ((utx->ut_type & (UTMPX_AUTOFILL_MASK | UTMPX_DEAD_IF_CORRESPONDING_MASK)) == 0) + return utx; + memcpy(temp, utx, sizeof(*temp)); + temp->ut_type &= ~(UTMPX_AUTOFILL_MASK | UTMPX_DEAD_IF_CORRESPONDING_MASK); + + if ((utx->ut_type & UTMPX_AUTOFILL_MASK) == 0) + return temp; + + which = UT_TV; /* they all need time */ + switch(temp->ut_type) { + case EMPTY: + return temp; + case USER_PROCESS: + which |= (UT_USER | UT_LINE | UT_PID); + /* Set UT_ID if ut_id isn't there */ + if (memcmp(temp->ut_id, idzero, sizeof(temp->ut_id)) == 0) + which |= UT_ID; + break; + case INIT_PROCESS: + which |= UT_PID; + break; + case LOGIN_PROCESS: + which |= (UT_USER | UT_PID); + break; + case DEAD_PROCESS: + which |= UT_PID; + /* Set UT_ID if ut_id isn't there. We will also need UT_LINE */ + if (memcmp(temp->ut_id, idzero, sizeof(temp->ut_id)) == 0) + which |= (UT_ID | UT_LINE); + break; + } + /* + * If onlyid is set: if ut_id isn't set but is needed, then set + * which to (UT_LINE | UT_ID), otherwise zero + */ + if (onlyid) + which = (which & UT_ID) ? (UT_LINE | UT_ID) : 0; + if ((which & UT_LINE) && !*temp->ut_line) { + char buf[256]; + char *cp; +#if __DARWIN_UNIX03 + int err; + + err = ttyname_r(0, buf, sizeof(buf)); + if (err) + err = ttyname_r(1, buf, sizeof(buf)); + if (err) + err = ttyname_r(2, buf, sizeof(buf)); + if (err) + return NULL; +#else /* !__DARWIN_UNIX03 */ + cp = ttyname_r(0, buf, sizeof(buf)); + if (!cp) + cp = ttyname_r(1, buf, sizeof(buf)); + if (!cp) + cp = ttyname_r(2, buf, sizeof(buf)); + if (!cp) + return NULL; +#endif /* __DARWIN_UNIX03 */ + cp = strrchr(buf, '/'); + if (cp) + cp++; + else + cp = buf; + strncpy(temp->ut_line, cp, sizeof(temp->ut_line)); + } + /* UT_ID is set only if we already know we need to add it */ + if ((which & UT_ID)) { + char *cp; + ssize_t i = sizeof(temp->ut_line); + + for(cp = temp->ut_line; i > 0 && *cp; i--) + cp++; + i = cp - temp->ut_line; + if(i >= sizeof(temp->ut_id)) + memcpy(temp->ut_id, cp - sizeof(temp->ut_id), sizeof(temp->ut_id)); + else + memcpy(temp->ut_id, temp->ut_line, i); + } + if ((which & UT_PID) && !temp->ut_pid) + temp->ut_pid = getpid(); + if ((which & UT_USER) && !*temp->ut_user) { + char *buf; + struct passwd pw; + + if ((buf = _pwuid_r(getuid(), &pw)) == NULL) + return NULL; + strncpy(temp->ut_user, pw.pw_name, sizeof(temp->ut_user)); + free(buf); + } + if ((which & UT_TV) && !temp->ut_tv.tv_sec && !temp->ut_tv.tv_usec) + gettimeofday(&temp->ut_tv, NULL); + return temp; +} + +/* + * We can read from either asl or from a file, so we need to switch between + * the two. + */ +static void end_asl(void); +static void end_file(void); +static struct utmpx *get_asl(void); +static struct utmpx *get_file(void); +static void set_asl(int); +static void set_file(int); + +enum {WTMP_ASL, WTMP_FILE}; + +static struct { + int which; + void (*end)(void); + struct utmpx *(*get)(void); + void (*set)(int); +} wtmp_func = { + WTMP_ASL, + end_asl, + get_asl, + set_asl +}; + +static struct { + uint64_t start; + int dir; + asl_object_t res; + char *str; + uint32_t len; + char inited; + char done; +} wtmp_asl = {-1, 1}; +static struct { + int fd; + int dir; + char *file; + off_t off; + size_t count; +#ifdef __LP64__ + struct utmpx32 *buf; + struct utmpx32 *next; +#else /* __LP64__ */ + struct utmpx *buf; + struct utmpx *next; +#endif /* __LP64__ */ + int left; +} wtmp_file = {-1, -1}; + +void +endutxent_wtmp(void) +{ + wtmp_func.end(); +} + +struct utmpx * +getutxent_wtmp(void) +{ + return wtmp_func.get(); +} + +void +setutxent_wtmp(int dir) +{ + wtmp_func.set(dir); +} + +/* use the given file, or if NULL, read from asl */ +int +wtmpxname(const char *fname) +{ + size_t len; + + if (fname == NULL) { + if (wtmp_func.which == WTMP_ASL) { + end_asl(); + return 1; + } + end_file(); + wtmp_func.which = WTMP_ASL; + wtmp_func.end = end_asl; + wtmp_func.get = get_asl; + wtmp_func.set = set_asl; + return 1; + } + + len = strlen(fname); + if (len >= MAXPATHLEN) + return 0; + + /* must end in x! */ + if (fname[len - 1] != 'x') + return 0; + + if (wtmp_func.which == WTMP_ASL) + end_asl(); + else if (wtmp_file.fd >= 0) { + close(wtmp_file.fd); + wtmp_file.fd = -1; + } + + if (wtmp_file.file) + free(wtmp_file.file); + + wtmp_file.file = strdup(fname); + if (wtmp_file.file == NULL) + return 0; + + wtmp_func.which = WTMP_FILE; + wtmp_func.end = end_file; + wtmp_func.get = get_file; + wtmp_func.set = set_file; + return 1; +} + +static void +end_asl(void) +{ + if (wtmp_asl.res != NULL) + { + asl_release(wtmp_asl.res); + wtmp_asl.res = NULL; + } + + wtmp_asl.inited = 0; + wtmp_asl.done = 0; +} + +static void +end_file(void) +{ + if (wtmp_file.fd >= 0) { + close(wtmp_file.fd); + wtmp_file.fd = -1; + } + if (wtmp_file.buf) { + free(wtmp_file.buf); + wtmp_file.buf = NULL; + } +} + +static struct utmpx * +get_asl(void) +{ + asl_object_t m; + static struct utmpx utx; + + if (wtmp_asl.inited == 0) set_asl(-1); + if (wtmp_asl.done != 0) return NULL; + + m = asl_next(wtmp_asl.res); + if (m == NULL) + { + asl_release(wtmp_asl.res); + wtmp_asl.res = NULL; + wtmp_asl.done = 1; + return NULL; + } + + msg2utmpx(m, &utx); + return &utx; +} + + +static struct utmpx * +get_file(void) +{ + int n, r; + char *cp; +#ifdef __LP64__ + static struct utmpx ux; +#endif /* __LP64__ */ + +get_file_repeat: + if (wtmp_file.left > 0) { +#ifdef __LP64__ + struct utmpx32 *u = wtmp_file.next; +#else /* __LP64__ */ + struct utmpx *u = wtmp_file.next; +#endif /* __LP64__ */ + wtmp_file.next += wtmp_file.dir; + wtmp_file.left--; +#ifdef __LP64__ + _utmpx32_64(u, &ux); + return &ux; +#else /* __LP64__ */ + return u; +#endif /* __LP64__ */ + } else if (wtmp_file.fd < 0) { + set_file(-1); /* keep current read direction */ + if (wtmp_file.fd < 0) + return NULL; + goto get_file_repeat; + } + if (wtmp_file.count <= 0) + return NULL; + +#ifdef __LP64__ + n = WTMP_COUNT * sizeof(struct utmpx32); +#else /* __LP64__ */ + n = WTMP_COUNT * sizeof(struct utmpx); +#endif /* __LP64__ */ + if (wtmp_file.dir > 0) + wtmp_file.next = wtmp_file.buf; + else { + wtmp_file.next = wtmp_file.buf + WTMP_COUNT - 1; + wtmp_file.off -= n; + if (lseek(wtmp_file.fd, wtmp_file.off, SEEK_SET) < 0) { +get_file_done: + wtmp_file.count = 0; + return NULL; + } + } + + cp = (char *)wtmp_file.buf; + do { + if((r = read(wtmp_file.fd, cp, n)) <= 0) { + if (r < 0 && (errno == EINTR || errno == EAGAIN)) + continue; + goto get_file_done; + } + cp += r; + } while((n -= r) > 0); + + wtmp_file.left = WTMP_COUNT; + wtmp_file.count -= WTMP_COUNT; + + goto get_file_repeat; +} + +/* + * This sets the directions for both asl and reading from a file. If forward + * is negative, skip. + */ +static void +_set_dir(int forward) +{ + if (forward < 0) return; + + if (forward == 0) + { + /* go backward */ + wtmp_asl.dir = -1; + wtmp_asl.start = -1; + wtmp_file.dir = -1; + } + else + { + /* go forward */ + wtmp_asl.dir = 1; + wtmp_asl.start = 0; + wtmp_file.dir = 1; + } +} + +static void +set_asl(int forward) +{ + asl_object_t q0, q1, query; + size_t cmax; + + _set_dir(forward); + + wtmp_asl.inited = 0; + wtmp_asl.done = 0; + + if (wtmp_asl.res != NULL) + { + asl_release(wtmp_asl.res); + wtmp_asl.res = NULL; + } + + /* + * Create a search query that matches either UTMPX_FACILITY + * or LASTLOG_FACILITY. + */ + q0 = asl_new(ASL_TYPE_QUERY); + if (q0 == NULL) return; + + asl_set_query(q0, FACILITY, UTMPX_FACILITY, ASL_QUERY_OP_EQUAL); + + q1 = asl_new(ASL_TYPE_QUERY); + if (q1 == NULL) + { + asl_release(q0); + return; + } + + asl_set_query(q1, FACILITY, LASTLOG_FACILITY, ASL_QUERY_OP_EQUAL); + + query = asl_new(ASL_TYPE_LIST); + if (query == NULL) + { + asl_release(q0); + asl_release(q1); + return; + } + + asl_append(query, q0); + asl_append(query, q1); + + asl_release(q0); + asl_release(q1); + + cmax = 0; + + wtmp_asl.res = asl_match(NULL, query, &cmax, wtmp_asl.start, 0, ASL_QUERY_TIMEOUT, wtmp_asl.dir); + asl_release(query); + + if (wtmp_asl.res == NULL) return; + + wtmp_asl.inited = 1; + wtmp_asl.done = 0; +} + +static void +set_file(int forward) +{ + struct stat s; + size_t c; + int n, r; + char *cp; + + _set_dir(forward); +#ifdef __LP64__ + if (wtmp_file.buf == NULL && + (wtmp_file.buf = (struct utmpx32 *)malloc(WTMP_COUNT * sizeof(struct utmpx32))) == NULL) +#else /* __LP64__ */ + if (wtmp_file.buf == NULL && + (wtmp_file.buf = (struct utmpx *)malloc(WTMP_COUNT * sizeof(struct utmpx))) == NULL) +#endif /* __LP64__ */ + return; + if (wtmp_file.fd >= 0) + close(wtmp_file.fd); + if ((wtmp_file.fd = open(wtmp_file.file, O_RDONLY, 0)) < 0) + return; + if (fstat(wtmp_file.fd, &s) < 0) + goto set_file_error; + /* + * We must have a file at least 2 sizeof(struct utmpx) in size, + * with the first struct utmpx matching a signature record. + */ +#ifdef __LP64__ + if ((wtmp_file.count = s.st_size / sizeof(struct utmpx32)) <= 1) +#else /* __LP64__ */ + if ((wtmp_file.count = s.st_size / sizeof(struct utmpx)) <= 1) +#endif /* __LP64__ */ + goto set_file_error; +#ifdef __LP64__ + if (read(wtmp_file.fd, wtmp_file.buf, sizeof(struct utmpx32)) != sizeof(struct utmpx32)) +#else /* __LP64__ */ + if (read(wtmp_file.fd, wtmp_file.buf, sizeof(struct utmpx)) != sizeof(struct utmpx)) +#endif /* __LP64__ */ + goto set_file_error; + if (strcmp(wtmp_file.buf->ut_user, _utmpx_vers) != 0 || + wtmp_file.buf->ut_type != SIGNATURE) + goto set_file_error; + wtmp_file.count--; + + /* + * We will first read any records modulo WTMP_COUNT (or WTMP_COUNT), + * either at the beginning or the end, so that all subsequent reads + * must contain WTMP_COUNT records. + */ + c = WTMP_COUNT * ((wtmp_file.count - 1) / WTMP_COUNT); + wtmp_file.left = wtmp_file.count - c; + wtmp_file.count -= wtmp_file.left; + + /* Seek to the end for reverse reading */ + if (wtmp_file.dir < 0) { +#ifdef __LP64__ + wtmp_file.off = (c + 1) * sizeof(struct utmpx32); +#else /* __LP64__ */ + wtmp_file.off = (c + 1) * sizeof(struct utmpx); +#endif /* __LP64__ */ + if (lseek(wtmp_file.fd, wtmp_file.off, SEEK_SET) < 0) + goto set_file_error; + } +#ifdef __LP64__ + n = wtmp_file.left * sizeof(struct utmpx32); +#else /* __LP64__ */ + n = wtmp_file.left * sizeof(struct utmpx); +#endif /* __LP64__ */ + cp = (char *)wtmp_file.buf; + do { + if((r = read(wtmp_file.fd, cp, n)) <= 0) { + if (r < 0 && (errno == EINTR || errno == EAGAIN)) + continue; + goto set_file_error; + } + cp += r; + } while((n -= r) > 0); + + /* Point to either the beginning or end of the buffer */ + if(wtmp_file.dir > 0) + wtmp_file.next = wtmp_file.buf; + else + wtmp_file.next = wtmp_file.buf + wtmp_file.left - 1; + return; + +set_file_error: + wtmp_file.left = 0; + close(wtmp_file.fd); + wtmp_file.fd = -1; + return; +} + +#ifdef __LP64__ +/* + * these routines assume natural alignment so that struct utmpx32 has + * the same size and layout as the 32-bit struct utmpx + */ +__private_extern__ void +_utmpx32_64(const struct utmpx32 *u32, struct utmpx *u) +{ + bzero(u, sizeof(*u)); + memcpy(u, u32, offsetof(struct utmpx, ut_type) + sizeof(u->ut_type)); + u->ut_tv.tv_sec = u32->ut_tv.tv_sec; + u->ut_tv.tv_usec = u32->ut_tv.tv_usec; + memcpy((char *)u + offsetof(struct utmpx, ut_host), + (char *)u32 + offsetof(struct utmpx32, ut_host), + sizeof(struct utmpx) - offsetof(struct utmpx, ut_host)); +} + +__private_extern__ void +_utmpx64_32(const struct utmpx *u, struct utmpx32 *u32) +{ + bzero(u32, sizeof(*u32)); + memcpy(u32, u, offsetof(struct utmpx32, ut_type) + sizeof(u32->ut_type)); + u32->ut_tv.tv_sec = u->ut_tv.tv_sec; + u32->ut_tv.tv_usec = u->ut_tv.tv_usec; + memcpy((char *)u32 + offsetof(struct utmpx32, ut_host), + (char *)u + offsetof(struct utmpx, ut_host), + sizeof(struct utmpx32) - offsetof(struct utmpx32, ut_host)); +} +#endif /* __LP64__ */ + +#ifdef UTMP_COMPAT +#ifdef __LP64__ +__private_extern__ void +_getutmp32(const struct utmpx *ux, struct utmp32 *u) +{ + + bzero(u, sizeof(*u)); + (void)memcpy(u->ut_name, ux->ut_user, sizeof(u->ut_name)); + (void)memcpy(u->ut_line, ux->ut_line, sizeof(u->ut_line)); + (void)memcpy(u->ut_host, ux->ut_host, sizeof(u->ut_host)); + u->ut_time = ux->ut_tv.tv_sec; +} +#endif /* __LP64__ */ + +/* + * _utmp_compat converts a struct utmpx to a struct utmp, using the conventions + * described in utmp(5). It then returns a value that specifies what + * combination of utmp, wtmp and lastlog to write. UTMP_COMPAT_UTMP1 will + * write utmp only if a matching record with the same ut_line value is found; + * UTMP_COMPAT_UTMP0 replaces an existing record or writes a new one. + */ +__private_extern__ int +#ifdef __LP64__ +_utmp_compat(const struct utmpx *ux, struct utmp32 *u) +#else /* __LP64__ */ +_utmp_compat(const struct utmpx *ux, struct utmp *u) +#endif /* __LP64__ */ +{ +#ifdef __LP64__ + _getutmp32(ux, u); +#else /* __LP64__ */ + getutmp(ux, u); +#endif /* __LP64__ */ + + switch (ux->ut_type) { + case BOOT_TIME: + case SHUTDOWN_TIME: + bzero(u->ut_line, sizeof(u->ut_line)); + u->ut_line[0] = '~'; + bzero(u->ut_name, sizeof(u->ut_name)); + strcpy(u->ut_name, (ux->ut_type == BOOT_TIME ? "reboot" : "shutdown")); + return UTMP_COMPAT_WTMP; + case OLD_TIME: + case NEW_TIME: + bzero(u->ut_line, sizeof(u->ut_line)); + u->ut_line[0] = (ux->ut_type == OLD_TIME ? '|' : '{'); + bzero(u->ut_name, sizeof(u->ut_name)); + strcpy(u->ut_name, "date"); + return UTMP_COMPAT_WTMP; + case USER_PROCESS: + return UTMP_COMPAT_UTMP0 | UTMP_COMPAT_WTMP | UTMP_COMPAT_LASTLOG; + case DEAD_PROCESS: + bzero(u->ut_name, sizeof(u->ut_name)); + bzero(u->ut_host, sizeof(u->ut_host)); + return UTMP_COMPAT_UTMP1 | UTMP_COMPAT_WTMP; + } + return 0; /* skip */; +} + +/* + * Write _PATH_LASTLOG given a struct utmp record. We use + * advisory record locking. + */ +__private_extern__ void +#ifdef __LP64__ +_write_lastlog(const struct utmp32 *u, const struct utmpx *ux) +#else /* __LP64__ */ +_write_lastlog(const struct utmp *u, const struct utmpx *ux) +#endif /* __LP64__ */ +{ + int fd; +#ifdef __LP64__ + struct lastlog32 l; +#else /* __LP64__ */ + struct lastlog l; +#endif /* __LP64__ */ + struct flock lock; + struct passwd pw; + // sizeof(ux->ut_user) > sizeof(u->ut_name) + char name[sizeof(ux->ut_user) + 1]; + char *buf; + off_t off; + int retry = 10; + + if (ux) { + if(!*ux->ut_user) + return; + strncpy(name, ux->ut_user, sizeof(ux->ut_user)); + name[sizeof(ux->ut_user)] = 0; + } else { + if (!*u->ut_name) + return; + strncpy(name, u->ut_name, sizeof(u->ut_name)); + name[sizeof(u->ut_name)] = 0; + } + if ((buf = _pwnam_r(name, &pw)) == NULL) + return; +#ifdef __LP64__ + off = (off_t)pw.pw_uid * sizeof(struct lastlog32); +#else /* __LP64__ */ + off = (off_t)pw.pw_uid * sizeof(struct lastlog); +#endif /* __LP64__ */ + free(buf); + + if ((fd = open(_PATH_LASTLOG, O_WRONLY, 0)) < 0) + return; + (void)lseek(fd, off, SEEK_SET); + bzero(&lock, sizeof(lock)); + lock.l_type = F_WRLCK; + lock.l_whence = SEEK_SET; + lock.l_start = off; +#ifdef __LP64__ + lock.l_len = sizeof(struct lastlog32); +#else /* __LP64__ */ + lock.l_len = sizeof(struct lastlog); +#endif /* __LP64__ */ + /* try to lock, but give up after retry times, and write anyways */ + while(retry-- > 0) { + if (fcntl(fd, F_SETLK, &lock) == 0) + break; + usleep(10000); + } + l.ll_time = u->ut_time; + strncpy(l.ll_line, u->ut_line, sizeof(l.ll_line)); + strncpy(l.ll_host, u->ut_host, sizeof(l.ll_host)); + (void) write(fd, &l, sizeof(l)); + lock.l_type = F_UNLCK; + (void) fcntl(fd, F_SETLK, &lock); + (void) close(fd); +} + +/* + * Write _PATH_UTMP, given a struct utmp, depending on the value of + * "mustexist". + */ +__private_extern__ void +#ifdef __LP64__ +_write_utmp(const struct utmp32 *u, int mustexist) +#else /* __LP64__ */ +_write_utmp(const struct utmp *u, int mustexist) +#endif /* __LP64__ */ +{ + int fd, slot; + struct ttyent *ttyp; +#ifdef __LP64__ + struct utmp32 tmp; +#else /* __LP64__ */ + struct utmp tmp; +#endif /* __LP64__ */ + int found = 0; + static struct { + char line[sizeof(u->ut_line)]; + int slot; + } cache; + + if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0) + return; + + if (!strncmp(cache.line, u->ut_line, sizeof(u->ut_line))) { + slot = cache.slot; + found++; + } + /* do equivalent of ttyslot(), but using u->ut_line */ + if (!found) { + setttyent(); + slot = 1; + for(;;) { + if ((ttyp = getttyent()) == NULL) + break; + if (!strncmp(ttyp->ty_name, u->ut_line, sizeof(u->ut_line))) { + strncpy(cache.line, u->ut_line, sizeof(u->ut_line)); + cache.slot = slot; + found++; + break; + } + slot++; + } + endttyent(); + } + + if (!found) { /* no assigned slot */ +#ifdef __LP64__ + (void)lseek(fd, (off_t)slot * sizeof(struct utmp32), SEEK_SET); +#else /* __LP64__ */ + (void)lseek(fd, (off_t)slot * sizeof(struct utmp), SEEK_SET); +#endif /* __LP64__ */ + for(;;) { + if (read(fd, &tmp, sizeof(tmp)) != sizeof(tmp)) + break; + if (!strncmp(tmp.ut_line, u->ut_line, sizeof(u->ut_line))) { + strncpy(cache.line, u->ut_line, sizeof(u->ut_line)); + cache.slot = slot; + found++; + break; + } + slot++; + } + } + + if (!found && mustexist) { + (void)close(fd); + return; + } +#ifdef __LP64__ + (void)lseek(fd, (off_t)slot * sizeof(struct utmp32), SEEK_SET); + (void)write(fd, u, sizeof(struct utmp32)); +#else /* __LP64__ */ + (void)lseek(fd, (off_t)slot * sizeof(struct utmp), SEEK_SET); + (void)write(fd, u, sizeof(struct utmp)); +#endif /* __LP64__ */ + (void)close(fd); +} + +/* + * Write all the necessary files (utmp, wtmp, lastlog), depending on the + * given struct utmpx. + */ +__private_extern__ void +_write_utmp_compat(const struct utmpx *ux) +{ +#ifdef __LP64__ + struct utmp32 u; +#else /* __LP64__ */ + struct utmp u; +#endif /* __LP64__ */ + int which; + + which = _utmp_compat(ux, &u); + if (which & UTMP_COMPAT_UTMP0) + _write_utmp(&u, 0); + else if (which & UTMP_COMPAT_UTMP1) + _write_utmp(&u, 1); + if (which & UTMP_COMPAT_WTMP) + _write_wtmp(&u); + if (which & UTMP_COMPAT_LASTLOG) + _write_lastlog(&u, ux); +} + +/* Append a struct wtmp to _PATH_WTMP */ +__private_extern__ void +#ifdef __LP64__ +_write_wtmp(const struct utmp32 *u) +#else /* __LP64__ */ +_write_wtmp(const struct utmp *u) +#endif /* __LP64__ */ +{ + int fd; + struct stat buf; + + if ((fd = open(_PATH_WTMP, O_WRONLY | O_APPEND, 0)) < 0) + return; + if (fstat(fd, &buf) == 0) { + if (write(fd, u, sizeof(*u)) != sizeof(*u)) + (void) ftruncate(fd, buf.st_size); + } + (void) close(fd); +} +#endif /* UTMP_COMPAT */ + +/* + * thread aware SPI + */ +utmpx_t +_openutx(const char *name) +{ + struct _utmpx *U; + + if ((U = calloc(1, sizeof(struct _utmpx))) == NULL) + return NULL; + memcpy(U->magic, __utx_magic__, UTMPX_MAGIC); + U->utmpx_mutex = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER; + if (__utmpxname(U, name) == 0) { + if (!U->utfile_system) + free(U->utfile); + free(U); + errno = EINVAL; + return NULL; + } + return (utmpx_t)U; +} + +int +_closeutx(utmpx_t u) +{ + struct _utmpx *U = (struct _utmpx *)u; + + if (!U || memcmp(U->magic, __utx_magic__, UTMPX_MAGIC) != 0) { + errno = EINVAL; + return -1; + } + UTMPX_LOCK(U); + __endutxent(U); + if (!U->utfile_system) + free(U->utfile); + UTMPX_UNLOCK(U); + free(U); + return 0; +} + +#pragma clang diagnostic pop diff --git a/gen/utmpx-darwin.h b/gen/utmpx-darwin.h new file mode 100644 index 0000000..ae4733c --- /dev/null +++ b/gen/utmpx-darwin.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2005, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * "Portions Copyright (c) 2004 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.0 (the 'License'). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License." + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include +#include +#include + +#ifdef UTMP_COMPAT +#define UTMP_COMPAT_UTMP0 0x01 +#define UTMP_COMPAT_UTMP1 0x02 +#define UTMP_COMPAT_WTMP 0x04 +#define UTMP_COMPAT_LASTLOG 0x08 +#endif /* UTMP_COMPAT */ + +#define LASTLOG_FACILITY "com.apple.system.lastlog" +#define UTMPX_FACILITY "com.apple.system.utmpx" + +#define UTMPX_LOCK(x) pthread_mutex_lock(&(x)->utmpx_mutex) +#define UTMPX_UNLOCK(x) pthread_mutex_unlock(&(x)->utmpx_mutex) +#define UTMPX_MAGIC 8 +#define __UTX_MAGIC__ { 'u', 't', 'x', 0, 'v', 1, 0, 0 } + +#define TEST_UTMPX_T(x,y) { \ + if (!(y)) \ + LIBC_ABORT("%s: NULL utmpx_t", (x)); \ + if (memcmp((y)->magic, __utx_magic__, UTMPX_MAGIC) != 0) \ + LIBC_ABORT("%s: magic mismatch", (x)); \ + } + +struct _utmpx { + char magic[UTMPX_MAGIC]; + struct utmpx ut; + pthread_mutex_t utmpx_mutex; + char *utfile; + FILE *fp; + unsigned int utfile_system :1; /* are we using _PATH_UTMPX? */ + unsigned int readonly :1; +}; +extern const char __utx_magic__[]; /* size of UTMPX_MAGIC */ + +#ifdef __LP64__ +#include +#include + +/* + * these structures assume natural alignment so they are the same size + * and layout as their 32-bit counterpart + */ +#ifdef UTMP_COMPAT +struct lastlog32 { + __int32_t ll_time; + char ll_line[UT_LINESIZE]; + char ll_host[UT_HOSTSIZE]; +}; + +struct utmp32 { + char ut_line[UT_LINESIZE]; + char ut_name[UT_NAMESIZE]; + char ut_host[UT_HOSTSIZE]; + __int32_t ut_time; +}; +#endif /* UTMP_COMPAT */ + +struct utmpx32 { + char ut_user[_UTX_USERSIZE]; /* login name */ + char ut_id[_UTX_IDSIZE]; /* id */ + char ut_line[_UTX_LINESIZE]; /* tty name */ + pid_t ut_pid; /* process id creating the entry */ + short ut_type; /* type of this entry */ + struct timeval32 ut_tv; /* time entry was created */ + char ut_host[_UTX_HOSTSIZE]; /* host name */ + __uint32_t ut_pad[16]; /* reserved for future use */ +}; +#endif /* __LP64__ */ + +struct _utmpx *__default_utx(void); + +void __endutxent(struct _utmpx *); +struct utmpx *__getutxent(struct _utmpx *); +void __setutxent(struct _utmpx *); +struct utmpx *__pututxline(struct _utmpx *, const struct utmpx *); +int __utmpxname(struct _utmpx *, const char *); +#ifdef __LP64__ +void _utmpx32_64(const struct utmpx32 *, struct utmpx *); +void _utmpx64_32(const struct utmpx *, struct utmpx32 *); +#endif /* __LP64__ */ +void _utmpx_asl(const struct utmpx *); +const struct utmpx *_utmpx_working_copy(const struct utmpx *, struct utmpx *, int); + +#ifdef UTMP_COMPAT +#ifdef __LP64__ +void _getutmp32(const struct utmpx *, struct utmp32 *); +int _utmp_compat(const struct utmpx *, struct utmp32 *); +void _write_lastlog(const struct utmp32 *, const struct utmpx *); +void _write_utmp(const struct utmp32 *, int); +#else /* __LP64__ */ +int _utmp_compat(const struct utmpx *, struct utmp *); +void _write_lastlog(const struct utmp *, const struct utmpx *); +void _write_utmp(const struct utmp *, int); +#endif /* __LP64__ */ +void _write_utmp_compat(const struct utmpx *); +#ifdef __LP64__ +void _write_wtmp(const struct utmp32 *); +#else /* __LP64__ */ +void _write_wtmp(const struct utmp *); +#endif /* __LP64__ */ +#endif /* UTMP_COMPAT */ diff --git a/gen/utmpx_thread.h b/gen/utmpx_thread.h new file mode 100644 index 0000000..3534c0f --- /dev/null +++ b/gen/utmpx_thread.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * "Portions Copyright (c) 2004 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.0 (the 'License'). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License." + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Thread-aware utmpx SPI + */ +#ifndef _UTMPX_THREAD_H_ +#define _UTMPX_THREAD_H_ + +#include + +struct _utmpx; /* forward reference */ +typedef struct _utmpx *utmpx_t; + +__BEGIN_DECLS +int _closeutx(utmpx_t); +void _endutxent(utmpx_t); +struct utmpx *_getutxent(utmpx_t); +struct utmpx *_getutxid(utmpx_t, const struct utmpx *); +struct utmpx *_getutxline(utmpx_t, const struct utmpx *); +utmpx_t _openutx(const char *); +struct utmpx *_pututxline(utmpx_t, const struct utmpx *); +void _setutxent(utmpx_t); +int _utmpxname(utmpx_t, const char *); +__END_DECLS + +#endif /* !_UTMPX_THREAD_H_ */ diff --git a/gmon/CMakeLists.txt b/gmon/CMakeLists.txt new file mode 100644 index 0000000..10267b3 --- /dev/null +++ b/gmon/CMakeLists.txt @@ -0,0 +1,9 @@ +project(libc-gmon) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89") + +set(gmon_sources gmon.c) + +add_darling_object_library(libc-gmon ${gmon_sources}) diff --git a/gmon/gmon.c b/gmon/gmon.c new file mode 100644 index 0000000..1ba4171 --- /dev/null +++ b/gmon/gmon.c @@ -0,0 +1,210 @@ +/* + * Copyright (c) 1999, 2003, 2004, 2007, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#if defined(PROFILE) +#error This module cannot be compiled with profiling +#endif + +/*- + * Copyright (c) 1983, 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * History + * 2-Mar-90 Gregg Kellogg (gk) at NeXT + * Changed include of kern/mach.h to kern/mach_interface.h + * + * 1-May-90 Matthew Self (mself) at NeXT + * Added prototypes, and added casts to remove all warnings. + * Made all private data static. + * vm_deallocate old data defore vm_allocate'ing new data. + * Added new functions monoutput and monreset. + * + * 18-Dec-92 Development Environment Group at NeXT + * Added multiple profile areas, the ability to profile shlibs and the + * ability to profile rld loaded code. Moved the machine dependent mcount + * routine out of this source file. + * + * 13-Dec-92 Development Environment Group at NeXT + * Added support for dynamic shared libraries. Also removed the code that + * had been ifdef'ed out for profiling fixed shared libraries and + * objective-C. + * + * 29-Aug-11 Vishal Patel (vishal_patel) at Apple + * Removed code that made calls to deprecated syscalls profil() and + * add_profil(). The syscalls are not supported since 2008 and planned + * to be completely removed soon. Similarly the monitor apis are also + * deprecated. + * + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gmon.c 5.2 (Berkeley) 6/21/85"; +#endif + +/* + * see profil(2) where this (SCALE_1_TO_1) is describe (incorrectly). + * + * The correct description: scale is a fixed point value with + * the binary point in the middle of the 32 bit value. (Bit 16 is + * 1, bit 15 is .5, etc.) + * + * Setting the scale to "1" (i.e. 0x10000), results in the kernel + * choosing the profile bucket address 1 to 1 with the pc sampled. + * Since buckets are shorts, if the profiling base were 0, then a pc + * of 0 increments bucket 0, a pc of 2 increments bucket 1, and a pc + * of 4 increments bucket 2.) (Actually, this seems a little bogus, + * 1 to 1 should map pc's to buckets -- that's probably what was + * intended from the man page, but historically.... + */ +#define SCALE_1_TO_1 0x10000L + +#define MSG "No space for monitor buffer(s)\n" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * These are defined in here and these declarations need to be moved to libc.h + * where the other declarations for the monitor(3) routines are declared. + */ +extern void moninit( + void); +extern void monaddition( + char *lowpc, + char *highpc); +extern void moncount( + char *frompc, + char *selfpc); +extern void monreset( + void); +extern void monoutput( + const char *filename); + +void +moninit( +void) +{ + return; // Deprecated api. do nothing +} + +void +monstartup( +char *lowpc, +char *highpc) +{ + return; // Deprecated api. do nothing +} + +/* + * monaddtion() is used for adding additional pc ranges to profile. This is + * used for profiling dyld loaded code. + */ +void +monaddition( +char *lowpc, +char *highpc) +{ + return; // Deprecated api. do nothing +} + +void +monreset( +void) +{ + return; // Deprecated api. do nothing +} + +void +monoutput( +const char *filename) +{ + return; // Deprecated api. do nothing +} + +void +monitor( +char *lowpc, +char *highpc, +char *buf, +int bufsiz, +int nfunc) /* nfunc is not used; available for compatability only. */ +{ + return; // Deprecated api. do nothing +} + +/* + * Control profiling + * profiling is what mcount checks to see if + * all the data structures are ready. + */ +void +moncontrol( +int mode) +{ + return; // Deprecated api. do nothing +} + +void +moncount( +char *frompc, +char *selfpc) +{ + return; //Deprecated api. do nothing +} diff --git a/gmon/moncontrol.3 b/gmon/moncontrol.3 new file mode 100644 index 0000000..4b87df6 --- /dev/null +++ b/gmon/moncontrol.3 @@ -0,0 +1,101 @@ +.\" $OpenBSD: moncontrol.3,v 1.2 1996/08/19 08:28:06 tholo Exp $ +.\" +.\" Copyright (c) 1980, 1991, 1992, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd June 4, 1993 +.Dt MONCONTROL 3 +.Os BSD 4 +.Sh NAME +.Nm moncontrol , +.Nm monstartup +.Nd control execution profile +.Sh SYNOPSIS +.Fn moncontrol "int mode" +.Fn monstartup "u_long *lowpc" "u_long *highpc" +.Sh DESCRIPTION +An executable program compiled using the +.Fl pg +option to +.Xr cc 1 +automatically includes calls to collect statistics for the +.Xr gprof 1 +call-graph execution profiler. +In typical operation, profiling begins at program startup +and ends when the program calls exit. +When the program exits, the profiling data are written to the file +.Em gmon.out , +then +.Xr gprof 1 +can be used to examine the results. +.Pp +.Fn moncontrol +selectively controls profiling within a program. +When the program starts, profiling begins. +To stop the collection of histogram ticks and call counts use +.Fn moncontrol 0 ; +to resume the collection of histogram ticks and call counts use +.Fn moncontrol 1 . +This feature allows the cost of particular operations to be measured. +Note that an output file will be produced on program exit +regardless of the state of +.Fn moncontrol . +.Pp +Programs that are not loaded with +.Fl pg +may selectively collect profiling statistics by calling +.Fn monstartup +with the range of addresses to be profiled. +.Fa lowpc +and +.Fa highpc +specify the address range that is to be sampled; +the lowest address sampled is that of +.Fa lowpc +and the highest is just below +.Fa highpc . +Only functions in that range that have been compiled with the +.Fl pg +option to +.Xr cc 1 +will appear in the call graph part of the output; +however, all functions in that address range will +have their execution time measured. +Profiling begins on return from +.Fn monstartup . +.Sh FILES +.Bl -tag -width Pa -compact +.It Pa gmon.out execution data file +.El +.Sh SEE ALSO +.Xr cc 1 , +.Xr gprof 1 , +.Xr profil 2 diff --git a/i386/CMakeLists.txt b/i386/CMakeLists.txt new file mode 100644 index 0000000..9f52229 --- /dev/null +++ b/i386/CMakeLists.txt @@ -0,0 +1,16 @@ +project(libc-i386) + +cmake_minimum_required(VERSION 3.10) +enable_language(C ASM) + +#set(CMAKE_C_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../../duct/include/commpage.h -include ${DARLING_TOP_DIRECTORY}/platform-include/sys/time.h") + +add_definitions(-DPRIVATE) + +set(i386_sources + gen/mcount.S +) + +add_library(libc-i386 OBJECT ${i386_sources}) + + diff --git a/i386/gen/mcount.S b/i386/gen/mcount.S new file mode 100644 index 0000000..bb0e7d3 --- /dev/null +++ b/i386/gen/mcount.S @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#import + +.text + .globl mcount +mcount: + pushl %ebp // setup mcount's frame + movl %esp,%ebp + + movl (%ebp),%eax // load the frame pointer of mcount's caller + movl 4(%eax),%eax // load mcount's caller's return address + pushl 4(%ebp) // push the selfpc parameter for moncount() + pushl %eax // push the frompc parameter for moncount() + CALL_EXTERN(_moncount) // call moncount() + + movl %ebp,%esp // tear down mcount's frame + popl %ebp + ret diff --git a/include/FreeBSD/nl_types.h b/include/FreeBSD/nl_types.h new file mode 100644 index 0000000..72d0da2 --- /dev/null +++ b/include/FreeBSD/nl_types.h @@ -0,0 +1,103 @@ +/* $NetBSD: nl_types.h,v 1.9 2000/10/03 19:53:32 sommerfeld Exp $ */ + +/*- + * Copyright (c) 1996 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by J.T. Conklin. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD: src/include/nl_types.h,v 1.11 2005/02/27 16:20:53 phantom Exp $ + */ + +#ifndef _NL_TYPES_H_ +#define _NL_TYPES_H_ + +#include +#include +#include <_types.h> + +#ifdef _NLS_PRIVATE +/* + * MESSAGE CATALOG FILE FORMAT. + * + * The NetBSD/FreeBSD message catalog format is similar to the format used by + * Svr4 systems. The differences are: + * * fixed byte order (big endian) + * * fixed data field sizes + * + * A message catalog contains four data types: a catalog header, one + * or more set headers, one or more message headers, and one or more + * text strings. + */ + +#define _NLS_MAGIC 0xff88ff89 + +struct _nls_cat_hdr { + int32_t __magic; + int32_t __nsets; + int32_t __mem; + int32_t __msg_hdr_offset; + int32_t __msg_txt_offset; +} ; + +struct _nls_set_hdr { + int32_t __setno; /* set number: 0 < x <= NL_SETMAX */ + int32_t __nmsgs; /* number of messages in the set */ + int32_t __index; /* index of first msg_hdr in msg_hdr table */ +} ; + +struct _nls_msg_hdr { + int32_t __msgno; /* msg number: 0 < x <= NL_MSGMAX */ + int32_t __msglen; + int32_t __offset; +} ; + +#endif /* _NLS_PRIVATE */ + +#define NL_SETD 1 +#define NL_CAT_LOCALE 1 + +typedef struct __nl_cat_d { + void *__data; + int __size; +} *nl_catd; + +#include <_types/_nl_item.h> + +__BEGIN_DECLS +nl_catd catopen(const char *, int); +char *catgets(nl_catd, int, int, const char *) + __attribute__((__format_arg__(4))); +int catclose(nl_catd); +__END_DECLS + +#endif /* _NL_TYPES_H_ */ diff --git a/include/NetBSD/utmpx.h b/include/NetBSD/utmpx.h new file mode 100644 index 0000000..d14f17c --- /dev/null +++ b/include/NetBSD/utmpx.h @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: utmpx.h,v 1.11 2003/08/26 16:48:32 wiz Exp $ */ + +/*- + * Copyright (c) 2002 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _UTMPX_H_ +#define _UTMPX_H_ + +#include <_types.h> +#include +#include +#include +#include + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#include +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + +#define _PATH_UTMPX "/var/run/utmpx" + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define UTMPX_FILE _PATH_UTMPX +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + +#define _UTX_USERSIZE 256 /* matches MAXLOGNAME */ +#define _UTX_LINESIZE 32 +#define _UTX_IDSIZE 4 +#define _UTX_HOSTSIZE 256 + +#define EMPTY 0 +#define RUN_LVL 1 +#define BOOT_TIME 2 +#define OLD_TIME 3 +#define NEW_TIME 4 +#define INIT_PROCESS 5 +#define LOGIN_PROCESS 6 +#define USER_PROCESS 7 +#define DEAD_PROCESS 8 + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define ACCOUNTING 9 +#define SIGNATURE 10 +#define SHUTDOWN_TIME 11 + +#define UTMPX_AUTOFILL_MASK 0x8000 +#define UTMPX_DEAD_IF_CORRESPONDING_MASK 0x4000 + +/* notify(3) change notification name */ +#define UTMPX_CHANGE_NOTIFICATION "com.apple.system.utmpx" +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + +/* + * The following structure describes the fields of the utmpx entries + * stored in _PATH_UTMPX. This is not the format the + * entries are stored in the files, and application should only access + * entries using routines described in getutxent(3). + */ + +#ifdef _UTMPX_COMPAT +#define ut_user ut_name +#define ut_xtime ut_tv.tv_sec +#endif /* _UTMPX_COMPAT */ + +struct utmpx { + char ut_user[_UTX_USERSIZE]; /* login name */ + char ut_id[_UTX_IDSIZE]; /* id */ + char ut_line[_UTX_LINESIZE]; /* tty name */ + pid_t ut_pid; /* process id creating the entry */ + short ut_type; /* type of this entry */ + struct timeval ut_tv; /* time entry was created */ + char ut_host[_UTX_HOSTSIZE]; /* host name */ + __uint32_t ut_pad[16]; /* reserved for future use */ +}; + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +struct lastlogx { + struct timeval ll_tv; /* time entry was created */ + char ll_line[_UTX_LINESIZE]; /* tty name */ + char ll_host[_UTX_HOSTSIZE]; /* host name */ +}; +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + +__BEGIN_DECLS + +void endutxent(void); + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +void endutxent_wtmp(void) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +struct lastlogx * + getlastlogx(uid_t, struct lastlogx *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +struct lastlogx * + getlastlogxbyname(const char*, struct lastlogx *)__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +#ifdef UNIFDEF_LEGACY_UTMP_APIS +struct utmp; /* forward reference */ +void getutmp(const struct utmpx *, struct utmp *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_9, __IPHONE_2_0, __IPHONE_7_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +void getutmpx(const struct utmp *, struct utmpx *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_9, __IPHONE_2_0, __IPHONE_7_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +#endif /* UNIFDEF_LEGACY_UTMP_APIS */ +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + +struct utmpx * + getutxent(void); + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +struct utmpx * + getutxent_wtmp(void) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + +struct utmpx * + getutxid(const struct utmpx *); +struct utmpx * + getutxline(const struct utmpx *); +struct utmpx * + pututxline(const struct utmpx *); +void setutxent(void); + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +void setutxent_wtmp(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +int utmpxname(const char *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +int wtmpxname(const char *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + +__END_DECLS + +#endif /* !_UTMPX_H_ */ diff --git a/include/__wctype.h b/include/__wctype.h new file mode 100644 index 0000000..3b4eb2c --- /dev/null +++ b/include/__wctype.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2017 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* + * Common header for _wctype.h and xlocale/__wctype.h + */ + +#ifndef ___WCTYPE_H_ +#define ___WCTYPE_H_ + +#include +#include <_types.h> + +#include +#include +#include <_types/_wctype_t.h> + +#ifndef WEOF +#define WEOF __DARWIN_WEOF +#endif + +#ifndef __DARWIN_WCTYPE_TOP_inline +#define __DARWIN_WCTYPE_TOP_inline __header_inline +#endif + +#include + +#endif /* ___WCTYPE_H_ */ diff --git a/include/_ctermid.h b/include/_ctermid.h new file mode 100644 index 0000000..540b117 --- /dev/null +++ b/include/_ctermid.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _CTERMID_H_ +#define _CTERMID_H_ +char *ctermid(char *); +#endif diff --git a/include/_ctype.h b/include/_ctype.h new file mode 100644 index 0000000..86e8b22 --- /dev/null +++ b/include/_ctype.h @@ -0,0 +1,387 @@ +/* + * Copyright (c) 2000, 2005, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ctype.h 8.4 (Berkeley) 1/21/94 + */ + +#ifndef __CTYPE_H_ +#define __CTYPE_H_ + +#include +#include + +#define _CTYPE_A 0x00000100L /* Alpha */ +#define _CTYPE_C 0x00000200L /* Control */ +#define _CTYPE_D 0x00000400L /* Digit */ +#define _CTYPE_G 0x00000800L /* Graph */ +#define _CTYPE_L 0x00001000L /* Lower */ +#define _CTYPE_P 0x00002000L /* Punct */ +#define _CTYPE_S 0x00004000L /* Space */ +#define _CTYPE_U 0x00008000L /* Upper */ +#define _CTYPE_X 0x00010000L /* X digit */ +#define _CTYPE_B 0x00020000L /* Blank */ +#define _CTYPE_R 0x00040000L /* Print */ +#define _CTYPE_I 0x00080000L /* Ideogram */ +#define _CTYPE_T 0x00100000L /* Special */ +#define _CTYPE_Q 0x00200000L /* Phonogram */ +#define _CTYPE_SW0 0x20000000L /* 0 width character */ +#define _CTYPE_SW1 0x40000000L /* 1 width character */ +#define _CTYPE_SW2 0x80000000L /* 2 width character */ +#define _CTYPE_SW3 0xc0000000L /* 3 width character */ +#define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */ +#define _CTYPE_SWS 30 /* Bits to shift to get width */ + +#ifdef _NONSTD_SOURCE +/* + * Backward compatibility + */ +#define _A _CTYPE_A /* Alpha */ +#define _C _CTYPE_C /* Control */ +#define _D _CTYPE_D /* Digit */ +#define _G _CTYPE_G /* Graph */ +#define _L _CTYPE_L /* Lower */ +#define _P _CTYPE_P /* Punct */ +#define _S _CTYPE_S /* Space */ +#define _U _CTYPE_U /* Upper */ +#define _X _CTYPE_X /* X digit */ +#define _B _CTYPE_B /* Blank */ +#define _R _CTYPE_R /* Print */ +#define _I _CTYPE_I /* Ideogram */ +#define _T _CTYPE_T /* Special */ +#define _Q _CTYPE_Q /* Phonogram */ +#define _SW0 _CTYPE_SW0 /* 0 width character */ +#define _SW1 _CTYPE_SW1 /* 1 width character */ +#define _SW2 _CTYPE_SW2 /* 2 width character */ +#define _SW3 _CTYPE_SW3 /* 3 width character */ +#endif /* _NONSTD_SOURCE */ + +#define __DARWIN_CTYPE_inline __header_inline + +#define __DARWIN_CTYPE_TOP_inline __header_inline + +/* + * Use inline functions if we are allowed to and the compiler supports them. + */ +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +/* See comments in about __darwin_ct_rune_t. */ +__BEGIN_DECLS +unsigned long ___runetype(__darwin_ct_rune_t); +__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t); +__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t); +__END_DECLS + +__DARWIN_CTYPE_TOP_inline int +isascii(int _c) +{ + return ((_c & ~0x7F) == 0); +} + +#ifdef USE_ASCII +__DARWIN_CTYPE_inline int +__maskrune(__darwin_ct_rune_t _c, unsigned long _f) +{ + return (int)_DefaultRuneLocale.__runetype[_c & 0xff] & (__uint32_t)_f; +} +#else /* !USE_ASCII */ +__BEGIN_DECLS +int __maskrune(__darwin_ct_rune_t, unsigned long); +__END_DECLS +#endif /* USE_ASCII */ + +__DARWIN_CTYPE_inline int +__istype(__darwin_ct_rune_t _c, unsigned long _f) +{ +#ifdef USE_ASCII + return !!(__maskrune(_c, _f)); +#else /* USE_ASCII */ + return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f) + : !!__maskrune(_c, _f)); +#endif /* USE_ASCII */ +} + +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__isctype(__darwin_ct_rune_t _c, unsigned long _f) +{ +#ifdef USE_ASCII + return !!(__maskrune(_c, _f)); +#else /* USE_ASCII */ + return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : + !!(_DefaultRuneLocale.__runetype[_c] & _f); +#endif /* USE_ASCII */ +} + +#ifdef USE_ASCII +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__toupper(__darwin_ct_rune_t _c) +{ + return _DefaultRuneLocale.__mapupper[_c & 0xff]; +} + +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__tolower(__darwin_ct_rune_t _c) +{ + return _DefaultRuneLocale.__maplower[_c & 0xff]; +} +#else /* !USE_ASCII */ +__BEGIN_DECLS +__darwin_ct_rune_t __toupper(__darwin_ct_rune_t); +__darwin_ct_rune_t __tolower(__darwin_ct_rune_t); +__END_DECLS +#endif /* USE_ASCII */ + +__DARWIN_CTYPE_inline int +__wcwidth(__darwin_ct_rune_t _c) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R); + if ((_x & _CTYPE_SWM) != 0) + return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); + return ((_x & _CTYPE_R) != 0 ? 1 : -1); +} + +#ifndef _EXTERNALIZE_CTYPE_INLINES_ + +#define _tolower(c) __tolower(c) +#define _toupper(c) __toupper(c) + +__DARWIN_CTYPE_TOP_inline int +isalnum(int _c) +{ + return (__istype(_c, _CTYPE_A|_CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_inline int +isalpha(int _c) +{ + return (__istype(_c, _CTYPE_A)); +} + +__DARWIN_CTYPE_TOP_inline int +isblank(int _c) +{ + return (__istype(_c, _CTYPE_B)); +} + +__DARWIN_CTYPE_TOP_inline int +iscntrl(int _c) +{ + return (__istype(_c, _CTYPE_C)); +} + +/* ANSI -- locale independent */ +__DARWIN_CTYPE_TOP_inline int +isdigit(int _c) +{ + return (__isctype(_c, _CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_inline int +isgraph(int _c) +{ + return (__istype(_c, _CTYPE_G)); +} + +__DARWIN_CTYPE_TOP_inline int +islower(int _c) +{ + return (__istype(_c, _CTYPE_L)); +} + +__DARWIN_CTYPE_TOP_inline int +isprint(int _c) +{ + return (__istype(_c, _CTYPE_R)); +} + +__DARWIN_CTYPE_TOP_inline int +ispunct(int _c) +{ + return (__istype(_c, _CTYPE_P)); +} + +__DARWIN_CTYPE_TOP_inline int +isspace(int _c) +{ + return (__istype(_c, _CTYPE_S)); +} + +__DARWIN_CTYPE_TOP_inline int +isupper(int _c) +{ + return (__istype(_c, _CTYPE_U)); +} + +/* ANSI -- locale independent */ +__DARWIN_CTYPE_TOP_inline int +isxdigit(int _c) +{ + return (__isctype(_c, _CTYPE_X)); +} + +__DARWIN_CTYPE_TOP_inline int +toascii(int _c) +{ + return (_c & 0x7F); +} + +__DARWIN_CTYPE_TOP_inline int +tolower(int _c) +{ + return (__tolower(_c)); +} + +__DARWIN_CTYPE_TOP_inline int +toupper(int _c) +{ + return (__toupper(_c)); +} + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +__DARWIN_CTYPE_TOP_inline int +digittoint(int _c) +{ + return (__maskrune(_c, 0x0F)); +} + +__DARWIN_CTYPE_TOP_inline int +ishexnumber(int _c) +{ + return (__istype(_c, _CTYPE_X)); +} + +__DARWIN_CTYPE_TOP_inline int +isideogram(int _c) +{ + return (__istype(_c, _CTYPE_I)); +} + +__DARWIN_CTYPE_TOP_inline int +isnumber(int _c) +{ + return (__istype(_c, _CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_inline int +isphonogram(int _c) +{ + return (__istype(_c, _CTYPE_Q)); +} + +__DARWIN_CTYPE_TOP_inline int +isrune(int _c) +{ + return (__istype(_c, 0xFFFFFFF0L)); +} + +__DARWIN_CTYPE_TOP_inline int +isspecial(int _c) +{ + return (__istype(_c, _CTYPE_T)); +} +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* _EXTERNALIZE_CTYPE_INLINES_ */ + +#else /* not using inlines */ + +__BEGIN_DECLS +int isalnum(int); +int isalpha(int); +int isblank(int); +int iscntrl(int); +int isdigit(int); +int isgraph(int); +int islower(int); +int isprint(int); +int ispunct(int); +int isspace(int); +int isupper(int); +int isxdigit(int); +int tolower(int); +int toupper(int); +int isascii(int); +int toascii(int); + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int _tolower(int); +int _toupper(int); +int digittoint(int); +int ishexnumber(int); +int isideogram(int); +int isnumber(int); +int isphonogram(int); +int isrune(int); +int isspecial(int); +#endif +__END_DECLS + +#endif /* using inlines */ + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_CTYPE_H_ */ diff --git a/include/_locale.h b/include/_locale.h new file mode 100644 index 0000000..b87458d --- /dev/null +++ b/include/_locale.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)locale.h 8.1 (Berkeley) 6/2/93 + * $FreeBSD: /repoman/r/ncvs/src/include/locale.h,v 1.7 2002/10/09 09:19:27 tjr Exp $ + */ + +#ifndef __LOCALE_H_ +#define __LOCALE_H_ + +#include +#include <_types.h> + +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; + char int_p_cs_precedes; + char int_n_cs_precedes; + char int_p_sep_by_space; + char int_n_sep_by_space; + char int_p_sign_posn; + char int_n_sign_posn; +}; + +#include + +__BEGIN_DECLS +struct lconv *localeconv(void); +__END_DECLS + +#endif /* __LOCALE_H_ */ diff --git a/include/_regex.h b/include/_regex.h new file mode 100644 index 0000000..1fb98e3 --- /dev/null +++ b/include/_regex.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2000, 2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 2001-2009 Ville Laurikari + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/*- + * Copyright (c) 1992 Henry Spencer. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer of the University of Toronto. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)regex.h 8.2 (Berkeley) 1/3/94 + */ + +/* + * Common header for regex.h and xlocale/_regex.h + */ + +#ifndef __REGEX_H_ +#define __REGEX_H_ + +#include <_types.h> +#include +#include + +/*********/ +/* types */ +/*********/ +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#include +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +typedef __darwin_off_t regoff_t; + +typedef struct { + int re_magic; + size_t re_nsub; /* number of parenthesized subexpressions */ + const char *re_endp; /* end pointer for REG_PEND */ + struct re_guts *re_g; /* none of your business :-) */ +} regex_t; + +typedef struct { + regoff_t rm_so; /* start of match */ + regoff_t rm_eo; /* end of match */ +} regmatch_t; + +#endif /* !__REGEX_H_ */ diff --git a/include/_stdio.h b/include/_stdio.h new file mode 100644 index 0000000..af0664c --- /dev/null +++ b/include/_stdio.h @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2000, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdio.h 8.5 (Berkeley) 4/29/95 + */ + +/* + * Common header for stdio.h and xlocale/_stdio.h + */ + +#ifndef __STDIO_H_ +#define __STDIO_H_ + +#include +#include + +#include <_types.h> + +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * __gnuc_va_list and include */ +#include +#include +#include + +#ifndef UNIFDEF_DRIVERKIT +#include + +typedef __darwin_off_t fpos_t; + +#define _FSTDIO /* Define for new stdio with functions. */ + +/* + * NB: to fit things in six character monocase externals, the stdio + * code uses the prefix `__s' for stdio objects, typically followed + * by a three-character attempt at a mnemonic. + */ + +/* stdio buffers */ +struct __sbuf { + unsigned char *_base; + int _size; +}; + +/* hold a buncha junk that would grow the ABI */ +struct __sFILEX; + +/* + * stdio state variables. + * + * The following always hold: + * + * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), + * _lbfsize is -_bf._size, else _lbfsize is 0 + * if _flags&__SRD, _w is 0 + * if _flags&__SWR, _r is 0 + * + * This ensures that the getc and putc macros (or inline functions) never + * try to write or read from a file that is in `read' or `write' mode. + * (Moreover, they can, and do, automatically switch from read mode to + * write mode, and back, on "r+" and "w+" files.) + * + * _lbfsize is used only to make the inline line-buffered output stream + * code as compact as possible. + * + * _ub, _up, and _ur are used when ungetc() pushes back more characters + * than fit in the current _bf, or when ungetc() pushes back a character + * that does not match the previous one in _bf. When this happens, + * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff + * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * NB: see WARNING above before changing the layout of this structure! + */ +typedef struct __sFILE { + unsigned char *_p; /* current position in (some) buffer */ + int _r; /* read space left for getc() */ + int _w; /* write space left for putc() */ + short _flags; /* flags, below; this FILE is free if 0 */ + short _file; /* fileno, if Unix descriptor, else -1 */ + struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ + int _lbfsize; /* 0 or -_bf._size, for inline putc */ + + /* operations */ + void *_cookie; /* cookie passed to io functions */ + int (* _Nullable _close)(void *); + int (* _Nullable _read) (void *, char *, int); + fpos_t (* _Nullable _seek) (void *, fpos_t, int); + int (* _Nullable _write)(void *, const char *, int); + + /* separate buffer for long sequences of ungetc() */ + struct __sbuf _ub; /* ungetc buffer */ + struct __sFILEX *_extra; /* additions to FILE to not break ABI */ + int _ur; /* saved _r when _r is counting ungetc data */ + + /* tricks to meet minimum requirements even when malloc() fails */ + unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ + unsigned char _nbuf[1]; /* guarantee a getc() buffer */ + + /* separate buffer for fgetln() when line crosses buffer boundary */ + struct __sbuf _lb; /* buffer for fgetln() */ + + /* Unix stdio files get aligned to block boundaries on fseek() */ + int _blksize; /* stat.st_blksize (may be != _bf._size) */ + fpos_t _offset; /* current lseek offset (see WARNING) */ +} FILE; +#endif /* UNIFDEF_DRIVERKIT */ + +#endif /* __STDIO_H_ */ diff --git a/include/_types.h b/include/_types.h new file mode 100644 index 0000000..12db190 --- /dev/null +++ b/include/_types.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2004, 2008, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __TYPES_H_ +#define __TYPES_H_ + +#include +#include /* __uint32_t */ + +#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 +#define __strfmonlike(fmtarg, firstvararg) \ + __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) +#define __strftimelike(fmtarg) \ + __attribute__((__format__ (__strftime__, fmtarg, 0))) +#else +#define __strfmonlike(fmtarg, firstvararg) +#define __strftimelike(fmtarg) +#endif + +#ifndef UNIFDEF_DRIVERKIT +typedef int __darwin_nl_item; +#endif /* UNIFDEF_DRIVERKIT */ +typedef int __darwin_wctrans_t; +#ifdef __LP64__ +typedef __uint32_t __darwin_wctype_t; +#else /* !__LP64__ */ +typedef unsigned long __darwin_wctype_t; +#endif /* __LP64__ */ + +#ifdef __WCHAR_MAX__ +#define __DARWIN_WCHAR_MAX __WCHAR_MAX__ +#else /* ! __WCHAR_MAX__ */ +#define __DARWIN_WCHAR_MAX 0x7fffffff +#endif /* __WCHAR_MAX__ */ + +#if __DARWIN_WCHAR_MAX > 0xffffU +#define __DARWIN_WCHAR_MIN (-0x7fffffff - 1) +#else +#define __DARWIN_WCHAR_MIN 0 +#endif +#define __DARWIN_WEOF ((__darwin_wint_t)-1) + +#ifndef _FORTIFY_SOURCE +# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050) +# define _FORTIFY_SOURCE 0 +# else +# define _FORTIFY_SOURCE 2 /* on by default */ +# endif +#endif + +#endif /* __TYPES_H_ */ diff --git a/include/_types/_intmax_t.h b/include/_types/_intmax_t.h new file mode 100644 index 0000000..abb585e --- /dev/null +++ b/include/_types/_intmax_t.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _INTMAX_T +#define _INTMAX_T +#ifdef __INTMAX_TYPE__ +typedef __INTMAX_TYPE__ intmax_t; +#else +#ifdef __LP64__ +typedef long int intmax_t; +#else +typedef long long int intmax_t; +#endif /* __LP64__ */ +#endif /* __INTMAX_TYPE__ */ +#endif /* _INTMAX_T */ diff --git a/include/_types/_nl_item.h b/include/_types/_nl_item.h new file mode 100644 index 0000000..4339653 --- /dev/null +++ b/include/_types/_nl_item.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _NL_ITEM +#define _NL_ITEM +#include <_types.h> +typedef __darwin_nl_item nl_item; +#endif /* _NL_ITEM */ \ No newline at end of file diff --git a/include/_types/_uint16_t.h b/include/_types/_uint16_t.h new file mode 100644 index 0000000..9ce9976 --- /dev/null +++ b/include/_types/_uint16_t.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _UINT16_T +#define _UINT16_T +typedef unsigned short uint16_t; +#endif /* _UINT16_T */ diff --git a/include/_types/_uint32_t.h b/include/_types/_uint32_t.h new file mode 100644 index 0000000..8c9c92e --- /dev/null +++ b/include/_types/_uint32_t.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _UINT32_T +#define _UINT32_T +typedef unsigned int uint32_t; +#endif /* _UINT32_T */ diff --git a/include/_types/_uint64_t.h b/include/_types/_uint64_t.h new file mode 100644 index 0000000..37866cf --- /dev/null +++ b/include/_types/_uint64_t.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _UINT64_T +#define _UINT64_T +typedef unsigned long long uint64_t; +#endif /* _UINT64_T */ diff --git a/include/_types/_uint8_t.h b/include/_types/_uint8_t.h new file mode 100644 index 0000000..9fb2a8e --- /dev/null +++ b/include/_types/_uint8_t.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _UINT8_T +#define _UINT8_T +typedef unsigned char uint8_t; +#endif /* _UINT8_T */ diff --git a/include/_types/_uintmax_t.h b/include/_types/_uintmax_t.h new file mode 100644 index 0000000..ee52755 --- /dev/null +++ b/include/_types/_uintmax_t.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _UINTMAX_T +#define _UINTMAX_T +#ifdef __UINTMAX_TYPE__ +typedef __UINTMAX_TYPE__ uintmax_t; +#else +#ifdef __LP64__ +typedef long unsigned int uintmax_t; +#else +typedef long long unsigned int uintmax_t; +#endif /* __LP64__ */ +#endif /* __UINTMAX_TYPE__ */ +#endif /* _UINTMAX_T */ diff --git a/include/_types/_wctrans_t.h b/include/_types/_wctrans_t.h new file mode 100644 index 0000000..2b66435 --- /dev/null +++ b/include/_types/_wctrans_t.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _WCTRANS_T +#define _WCTRANS_T +#include <_types.h> +typedef __darwin_wctrans_t wctrans_t; +#endif /* _WCTRANS_T */ \ No newline at end of file diff --git a/include/_types/_wctype_t.h b/include/_types/_wctype_t.h new file mode 100644 index 0000000..8d76a5d --- /dev/null +++ b/include/_types/_wctype_t.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _WCTYPE_T +#define _WCTYPE_T +#include <_types.h> +typedef __darwin_wctype_t wctype_t; +#endif /* _WCTYPE_T */ \ No newline at end of file diff --git a/include/_wctype.h b/include/_wctype.h new file mode 100644 index 0000000..04da796 --- /dev/null +++ b/include/_wctype.h @@ -0,0 +1,164 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* + * Common header for wctype.h and wchar.h + * + * Contains everything required by wctype.h except: + * + * #include <_types/_wctrans_t.h> + * int iswblank(wint_t); + * wint_t towctrans(wint_t, wctrans_t); + * wctrans_t wctrans(const char *); + */ + +#ifndef __WCTYPE_H_ +#define __WCTYPE_H_ + +#include <__wctype.h> + +/* + * Use inline functions if we are allowed to and the compiler supports them. + */ +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +__DARWIN_WCTYPE_TOP_inline int +iswalnum(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_A|_CTYPE_D)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswalpha(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_A)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswcntrl(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_C)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswctype(wint_t _wc, wctype_t _charclass) +{ + return (__istype(_wc, _charclass)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswdigit(wint_t _wc) +{ + return (__isctype(_wc, _CTYPE_D)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswgraph(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_G)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswlower(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_L)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswprint(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_R)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswpunct(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_P)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswspace(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_S)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswupper(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_U)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswxdigit(wint_t _wc) +{ + return (__isctype(_wc, _CTYPE_X)); +} + +__DARWIN_WCTYPE_TOP_inline wint_t +towlower(wint_t _wc) +{ + return (__tolower(_wc)); +} + +__DARWIN_WCTYPE_TOP_inline wint_t +towupper(wint_t _wc) +{ + return (__toupper(_wc)); +} + +#else /* not using inlines */ + +__BEGIN_DECLS +int iswalnum(wint_t); +int iswalpha(wint_t); +int iswcntrl(wint_t); +int iswctype(wint_t, wctype_t); +int iswdigit(wint_t); +int iswgraph(wint_t); +int iswlower(wint_t); +int iswprint(wint_t); +int iswpunct(wint_t); +int iswspace(wint_t); +int iswupper(wint_t); +int iswxdigit(wint_t); +wint_t towlower(wint_t); +wint_t towupper(wint_t); +__END_DECLS + +#endif /* using inlines */ + +__BEGIN_DECLS +wctype_t + wctype(const char *); +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* __WCTYPE_H_ */ diff --git a/include/_xlocale.h b/include/_xlocale.h new file mode 100644 index 0000000..0ba412c --- /dev/null +++ b/include/_xlocale.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __XLOCALE_H_ +#define __XLOCALE_H_ + +#include + +struct _xlocale; /* forward reference */ +typedef struct _xlocale * locale_t; + +__BEGIN_DECLS +int ___mb_cur_max(void); +int ___mb_cur_max_l(locale_t); +__END_DECLS + +#endif /* __XLOCALE_H_ */ diff --git a/include/aio.h b/include/aio.h new file mode 100644 index 0000000..b031764 --- /dev/null +++ b/include/aio.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * File: aio.h + * Author: Umesh Vaishampayan [umeshv@apple.com] + * 05-Feb-2003 umeshv Created. + * + * Header file for POSIX Asynchronous IO APIs + * + */ + +#ifndef _AIO_H_ +#define _AIO_H_ + +#include + +#endif /* _AIO_H_ */ diff --git a/include/alloca.h b/include/alloca.h new file mode 100644 index 0000000..6f41a4d --- /dev/null +++ b/include/alloca.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _ALLOCA_H_ +#define _ALLOCA_H_ + +#include +#include <_types.h> +#include + +#ifndef UNIFDEF_DRIVERKIT +__BEGIN_DECLS +void *alloca(size_t); /* built-in for gcc */ +__END_DECLS +#endif /* UNIFDEF_DRIVERKIT */ + +#if defined(__GNUC__) && __GNUC__ >= 3 +/* built-in for gcc 3 */ +#undef alloca +#undef __alloca +#define alloca(size) __alloca(size) +#define __alloca(size) __builtin_alloca(size) +#endif + +#endif /* _ALLOCA_H_ */ diff --git a/include/ar.h b/include/ar.h new file mode 100644 index 0000000..e04874f --- /dev/null +++ b/include/ar.h @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ar.h 8.2 (Berkeley) 1/21/94 + */ + +#ifndef _AR_H_ +#define _AR_H_ + +/* Pre-4BSD archives had these magic numbers in them. */ +#define OARMAG1 0177555 +#define OARMAG2 0177545 + +#define ARMAG "!\n" /* ar "magic number" */ +#define SARMAG 8 /* strlen(ARMAG); */ + +#define AR_EFMT1 "#1/" /* extended format #1 */ + +struct ar_hdr { + char ar_name[16]; /* name */ + char ar_date[12]; /* modification time */ + char ar_uid[6]; /* user id */ + char ar_gid[6]; /* group id */ + char ar_mode[8]; /* octal file permissions */ + char ar_size[10]; /* size in bytes */ +#define ARFMAG "`\n" + char ar_fmag[2]; /* consistency check */ +}; + +#endif /* !_AR_H_ */ diff --git a/include/arpa/ftp.h b/include/arpa/ftp.h new file mode 100644 index 0000000..64532b9 --- /dev/null +++ b/include/arpa/ftp.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 1983, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ftp.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _FTP_H_ +#define _FTP_H_ + +/* Definitions for FTP; see RFC-765. */ + +/* + * Reply codes. + */ +#define PRELIM 1 /* positive preliminary */ +#define COMPLETE 2 /* positive completion */ +#define CONTINUE 3 /* positive intermediate */ +#define TRANSIENT 4 /* transient negative completion */ +#define ERROR 5 /* permanent negative completion */ + +/* + * Type codes + */ +#define TYPE_A 1 /* ASCII */ +#define TYPE_E 2 /* EBCDIC */ +#define TYPE_I 3 /* image */ +#define TYPE_L 4 /* local byte size */ + +#ifdef FTP_NAMES +char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" }; +#endif + +/* + * Form codes + */ +#define FORM_N 1 /* non-print */ +#define FORM_T 2 /* telnet format effectors */ +#define FORM_C 3 /* carriage control (ASA) */ +#ifdef FTP_NAMES +char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" }; +#endif + +/* + * Structure codes + */ +#define STRU_F 1 /* file (no record structure) */ +#define STRU_R 2 /* record structure */ +#define STRU_P 3 /* page structure */ +#ifdef FTP_NAMES +char *strunames[] = {"0", "File", "Record", "Page" }; +#endif + +/* + * Mode types + */ +#define MODE_S 1 /* stream */ +#define MODE_B 2 /* block */ +#define MODE_C 3 /* compressed */ +#ifdef FTP_NAMES +char *modenames[] = {"0", "Stream", "Block", "Compressed" }; +#endif + +/* + * Record Tokens + */ +#define REC_ESC '\377' /* Record-mode Escape */ +#define REC_EOR '\001' /* Record-mode End-of-Record */ +#define REC_EOF '\002' /* Record-mode End-of-File */ + +/* + * Block Header + */ +#define BLK_EOR 0x80 /* Block is End-of-Record */ +#define BLK_EOF 0x40 /* Block is End-of-File */ +#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */ +#define BLK_RESTART 0x10 /* Block is Restart Marker */ + +#define BLK_BYTECOUNT 2 /* Bytes in this block */ + +#endif /* !_FTP_H_ */ diff --git a/include/arpa/inet.h b/include/arpa/inet.h new file mode 100644 index 0000000..46f44e1 --- /dev/null +++ b/include/arpa/inet.h @@ -0,0 +1,97 @@ +/* + * ++Copyright++ 1983, 1993 + * - + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * - + * Portions Copyright (c) 1993 by Digital Equipment Corporation. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies, and that + * the name of Digital Equipment Corporation not be used in advertising or + * publicity pertaining to distribution of the document or software without + * specific, written prior permission. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * - + * --Copyright-- + */ + +/* + * @(#)inet.h 8.1 (Berkeley) 6/2/93 + * $Id: inet.h,v 1.10 2006/02/01 18:09:47 majka Exp $ + */ + +#ifndef _ARPA_INET_H_ +#define _ARPA_INET_H_ + +/* External definitions for functions in inet(3), addr2ascii(3) */ + +#include +#include +#include /* uint32_t uint16_t */ +#include /* htonl() and family if (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#include /* htonl() and family if (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#include /* in_addr */ + +__BEGIN_DECLS + +in_addr_t inet_addr(const char *); +char *inet_ntoa(struct in_addr); +const char *inet_ntop(int, const void *, char *, socklen_t); +int inet_pton(int, const char *, void *); + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +int ascii2addr(int, const char *, void *); +char *addr2ascii(int, const void *, int, char *); +int inet_aton(const char *, struct in_addr *); +in_addr_t inet_lnaof(struct in_addr); +struct in_addr inet_makeaddr(in_addr_t, in_addr_t); +in_addr_t inet_netof(struct in_addr); +in_addr_t inet_network(const char *); +char *inet_net_ntop(int, const void *, int, char *, __darwin_size_t); +int inet_net_pton(int, const char *, void *, __darwin_size_t); +char *inet_neta(in_addr_t, char *, __darwin_size_t); +unsigned int inet_nsap_addr(const char *, unsigned char *, int); +char *inet_nsap_ntoa(int, const unsigned char *, char *); +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +__END_DECLS + +#endif /* !_ARPA_INET_H_ */ diff --git a/include/arpa/nameser_compat.h b/include/arpa/nameser_compat.h new file mode 100644 index 0000000..493b2c8 --- /dev/null +++ b/include/arpa/nameser_compat.h @@ -0,0 +1,195 @@ +/* Copyright (c) 1983, 1989 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * from nameser.h 8.1 (Berkeley) 6/2/93 + * From: Id: nameser_compat.h,v 8.9 1998/03/20 23:25:10 halley Exp + * $FreeBSD: src/include/arpa/nameser_compat.h,v 1.4 2002/05/28 04:32:25 mike Exp $ + */ + +#ifndef _ARPA_NAMESER_COMPAT_ +#define _ARPA_NAMESER_COMPAT_ + +#define __BIND 19950621 /* (DEAD) interface version stamp. */ + +#include + +#if !defined(BYTE_ORDER) || \ + (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \ + BYTE_ORDER != PDP_ENDIAN) + /* you must determine what the correct bit order is for + * your compiler - the next line is an intentional error + * which will force your compiles to bomb until you fix + * the above macros. + */ +#error "Undefined or invalid BYTE_ORDER"; +#endif + +/* + * Structure for query header. The order of the fields is machine- and + * compiler-dependent, depending on the byte/bit order and the layout + * of bit fields. We use bit fields only in int variables, as this + * is all ANSI requires. This requires a somewhat confusing rearrangement. + */ + +typedef struct { + unsigned id :16; /* query identification number */ +#if BYTE_ORDER == BIG_ENDIAN + /* fields in third byte */ + unsigned qr: 1; /* response flag */ + unsigned opcode: 4; /* purpose of message */ + unsigned aa: 1; /* authoritive answer */ + unsigned tc: 1; /* truncated message */ + unsigned rd: 1; /* recursion desired */ + /* fields in fourth byte */ + unsigned ra: 1; /* recursion available */ + unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */ + unsigned ad: 1; /* authentic data from named */ + unsigned cd: 1; /* checking disabled by resolver */ + unsigned rcode :4; /* response code */ +#endif +#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN + /* fields in third byte */ + unsigned rd :1; /* recursion desired */ + unsigned tc :1; /* truncated message */ + unsigned aa :1; /* authoritive answer */ + unsigned opcode :4; /* purpose of message */ + unsigned qr :1; /* response flag */ + /* fields in fourth byte */ + unsigned rcode :4; /* response code */ + unsigned cd: 1; /* checking disabled by resolver */ + unsigned ad: 1; /* authentic data from named */ + unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */ + unsigned ra :1; /* recursion available */ +#endif + /* remaining bytes */ + unsigned qdcount :16; /* number of question entries */ + unsigned ancount :16; /* number of answer entries */ + unsigned nscount :16; /* number of authority entries */ + unsigned arcount :16; /* number of resource entries */ +} HEADER; + +#define PACKETSZ NS_PACKETSZ +#define MAXDNAME NS_MAXDNAME +#define MAXCDNAME NS_MAXCDNAME +#define MAXLABEL NS_MAXLABEL +#define HFIXEDSZ NS_HFIXEDSZ +#define QFIXEDSZ NS_QFIXEDSZ +#define RRFIXEDSZ NS_RRFIXEDSZ +#define INT32SZ NS_INT32SZ +#define INT16SZ NS_INT16SZ +#define INADDRSZ NS_INADDRSZ +#define IN6ADDRSZ NS_IN6ADDRSZ +#define INDIR_MASK NS_CMPRSFLGS +#define NAMESERVER_PORT NS_DEFAULTPORT + +#define S_ZONE ns_s_zn +#define S_PREREQ ns_s_pr +#define S_UPDATE ns_s_ud +#define S_ADDT ns_s_ar + +#define QUERY ns_o_query +#define IQUERY ns_o_iquery +#define STATUS ns_o_status +#define NS_NOTIFY_OP ns_o_notify +#define NS_UPDATE_OP ns_o_update + +#define NOERROR ns_r_noerror +#define FORMERR ns_r_formerr +#define SERVFAIL ns_r_servfail +#define NXDOMAIN ns_r_nxdomain +#define NOTIMP ns_r_notimpl +#define REFUSED ns_r_refused +#define YXDOMAIN ns_r_yxdomain +#define YXRRSET ns_r_yxrrset +#define NXRRSET ns_r_nxrrset +#define NOTAUTH ns_r_notauth +#define NOTZONE ns_r_notzone + +#define DELETE ns_uop_delete +#define ADD ns_uop_add + +#define T_A ns_t_a +#define T_NS ns_t_ns +#define T_MD ns_t_md +#define T_MF ns_t_mf +#define T_CNAME ns_t_cname +#define T_SOA ns_t_soa +#define T_MB ns_t_mb +#define T_MG ns_t_mg +#define T_MR ns_t_mr +#define T_NULL ns_t_null +#define T_WKS ns_t_wks +#define T_PTR ns_t_ptr +#define T_HINFO ns_t_hinfo +#define T_MINFO ns_t_minfo +#define T_MX ns_t_mx +#define T_TXT ns_t_txt +#define T_RP ns_t_rp +#define T_AFSDB ns_t_afsdb +#define T_X25 ns_t_x25 +#define T_ISDN ns_t_isdn +#define T_RT ns_t_rt +#define T_NSAP ns_t_nsap +#define T_NSAP_PTR ns_t_nsap_ptr +#define T_SIG ns_t_sig +#define T_KEY ns_t_key +#define T_PX ns_t_px +#define T_GPOS ns_t_gpos +#define T_AAAA ns_t_aaaa +#define T_LOC ns_t_loc +#define T_NXT ns_t_nxt +#define T_EID ns_t_eid +#define T_NIMLOC ns_t_nimloc +#define T_SRV ns_t_srv +#define T_ATMA ns_t_atma +#define T_NAPTR ns_t_naptr +#define T_OPT ns_t_opt +#define T_IXFR ns_t_ixfr +#define T_AXFR ns_t_axfr +#define T_MAILB ns_t_mailb +#define T_MAILA ns_t_maila +#define T_ANY ns_t_any + +#define C_IN ns_c_in +#define C_CHAOS ns_c_chaos +#define C_HS ns_c_hs +/* BIND_UPDATE */ +#define C_NONE ns_c_none +#define C_ANY ns_c_any + +#define GETSHORT NS_GET16 +#define GETLONG NS_GET32 +#define PUTSHORT NS_PUT16 +#define PUTLONG NS_PUT32 + +#endif /* _ARPA_NAMESER_COMPAT_ */ diff --git a/include/arpa/telnet.h b/include/arpa/telnet.h new file mode 100644 index 0000000..10155a8 --- /dev/null +++ b/include/arpa/telnet.h @@ -0,0 +1,320 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)telnet.h 8.2 (Berkeley) 12/15/93 + */ + +#ifndef _TELNET_H_ +#define _TELNET_H_ + +/* + * Definitions for the TELNET protocol. + */ +#define IAC 255 /* interpret as command: */ +#define DONT 254 /* you are not to use option */ +#define DO 253 /* please, you use option */ +#define WONT 252 /* I won't use option */ +#define WILL 251 /* I will use option */ +#define SB 250 /* interpret as subnegotiation */ +#define GA 249 /* you may reverse the line */ +#define EL 248 /* erase the current line */ +#define EC 247 /* erase the current character */ +#define AYT 246 /* are you there */ +#define AO 245 /* abort output--but let prog finish */ +#define IP 244 /* interrupt process--permanently */ +#define BREAK 243 /* break */ +#define DM 242 /* data mark--for connect. cleaning */ +#define NOP 241 /* nop */ +#define SE 240 /* end sub negotiation */ +#define EOR 239 /* end of record (transparent mode) */ +#define ABORT 238 /* Abort process */ +#define SUSP 237 /* Suspend process */ +#define xEOF 236 /* End of file: EOF is already used... */ + +#define SYNCH 242 /* for telfunc calls */ + +#ifdef TELCMDS +char *telcmds[] = { + "EOF", "SUSP", "ABORT", "EOR", + "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC", + "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0, +}; +#else +extern char *telcmds[]; +#endif + +#define TELCMD_FIRST xEOF +#define TELCMD_LAST IAC +#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \ + (unsigned int)(x) >= TELCMD_FIRST) +#define TELCMD(x) telcmds[(x)-TELCMD_FIRST] + +/* telnet options */ +#define TELOPT_BINARY 0 /* 8-bit data path */ +#define TELOPT_ECHO 1 /* echo */ +#define TELOPT_RCP 2 /* prepare to reconnect */ +#define TELOPT_SGA 3 /* suppress go ahead */ +#define TELOPT_NAMS 4 /* approximate message size */ +#define TELOPT_STATUS 5 /* give status */ +#define TELOPT_TM 6 /* timing mark */ +#define TELOPT_RCTE 7 /* remote controlled transmission and echo */ +#define TELOPT_NAOL 8 /* negotiate about output line width */ +#define TELOPT_NAOP 9 /* negotiate about output page size */ +#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */ +#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */ +#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */ +#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */ +#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */ +#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */ +#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */ +#define TELOPT_XASCII 17 /* extended ascic character set */ +#define TELOPT_LOGOUT 18 /* force logout */ +#define TELOPT_BM 19 /* byte macro */ +#define TELOPT_DET 20 /* data entry terminal */ +#define TELOPT_SUPDUP 21 /* supdup protocol */ +#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */ +#define TELOPT_SNDLOC 23 /* send location */ +#define TELOPT_TTYPE 24 /* terminal type */ +#define TELOPT_EOR 25 /* end or record */ +#define TELOPT_TUID 26 /* TACACS user identification */ +#define TELOPT_OUTMRK 27 /* output marking */ +#define TELOPT_TTYLOC 28 /* terminal location number */ +#define TELOPT_3270REGIME 29 /* 3270 regime */ +#define TELOPT_X3PAD 30 /* X.3 PAD */ +#define TELOPT_NAWS 31 /* window size */ +#define TELOPT_TSPEED 32 /* terminal speed */ +#define TELOPT_LFLOW 33 /* remote flow control */ +#define TELOPT_LINEMODE 34 /* Linemode option */ +#define TELOPT_XDISPLOC 35 /* X Display Location */ +#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */ +#define TELOPT_AUTHENTICATION 37/* Authenticate */ +#define TELOPT_ENCRYPT 38 /* Encryption option */ +#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */ +#define TELOPT_EXOPL 255 /* extended-options-list */ + + +#define NTELOPTS (1+TELOPT_NEW_ENVIRON) +#ifdef TELOPTS +char *telopts[NTELOPTS+1] = { + "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", + "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP", + "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS", + "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO", + "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT", + "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD", + "TACACS UID", "OUTPUT MARKING", "TTYLOC", + "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW", + "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION", + "ENCRYPT", "NEW-ENVIRON", + 0, +}; +#define TELOPT_FIRST TELOPT_BINARY +#define TELOPT_LAST TELOPT_NEW_ENVIRON +#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST) +#define TELOPT(x) telopts[(x)-TELOPT_FIRST] +#endif + +/* sub-option qualifiers */ +#define TELQUAL_IS 0 /* option is... */ +#define TELQUAL_SEND 1 /* send option */ +#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */ +#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */ +#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */ + +#define LFLOW_OFF 0 /* Disable remote flow control */ +#define LFLOW_ON 1 /* Enable remote flow control */ +#define LFLOW_RESTART_ANY 2 /* Restart output on any char */ +#define LFLOW_RESTART_XON 3 /* Restart output only on XON */ + +/* + * LINEMODE suboptions + */ + +#define LM_MODE 1 +#define LM_FORWARDMASK 2 +#define LM_SLC 3 + +#define MODE_EDIT 0x01 +#define MODE_TRAPSIG 0x02 +#define MODE_ACK 0x04 +#define MODE_SOFT_TAB 0x08 +#define MODE_LIT_ECHO 0x10 + +#define MODE_MASK 0x1f + +/* Not part of protocol, but needed to simplify things... */ +#define MODE_FLOW 0x0100 +#define MODE_ECHO 0x0200 +#define MODE_INBIN 0x0400 +#define MODE_OUTBIN 0x0800 +#define MODE_FORCE 0x1000 + +#define SLC_SYNCH 1 +#define SLC_BRK 2 +#define SLC_IP 3 +#define SLC_AO 4 +#define SLC_AYT 5 +#define SLC_EOR 6 +#define SLC_ABORT 7 +#define SLC_EOF 8 +#define SLC_SUSP 9 +#define SLC_EC 10 +#define SLC_EL 11 +#define SLC_EW 12 +#define SLC_RP 13 +#define SLC_LNEXT 14 +#define SLC_XON 15 +#define SLC_XOFF 16 +#define SLC_FORW1 17 +#define SLC_FORW2 18 + +#define NSLC 18 + +/* + * For backwards compatability, we define SLC_NAMES to be the + * list of names if SLC_NAMES is not defined. + */ +#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \ + "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \ + "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0, +#ifdef SLC_NAMES +char *slc_names[] = { + SLC_NAMELIST +}; +#else +extern char *slc_names[]; +#define SLC_NAMES SLC_NAMELIST +#endif + +#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC) +#define SLC_NAME(x) slc_names[x] + +#define SLC_NOSUPPORT 0 +#define SLC_CANTCHANGE 1 +#define SLC_VARIABLE 2 +#define SLC_DEFAULT 3 +#define SLC_LEVELBITS 0x03 + +#define SLC_FUNC 0 +#define SLC_FLAGS 1 +#define SLC_VALUE 2 + +#define SLC_ACK 0x80 +#define SLC_FLUSHIN 0x40 +#define SLC_FLUSHOUT 0x20 + +#define OLD_ENV_VAR 1 +#define OLD_ENV_VALUE 0 +#define NEW_ENV_VAR 0 +#define NEW_ENV_VALUE 1 +#define ENV_ESC 2 +#define ENV_USERVAR 3 + +/* + * AUTHENTICATION suboptions + */ + +/* + * Who is authenticating who ... + */ +#define AUTH_WHO_CLIENT 0 /* Client authenticating server */ +#define AUTH_WHO_SERVER 1 /* Server authenticating client */ +#define AUTH_WHO_MASK 1 + +/* + * amount of authentication done + */ +#define AUTH_HOW_ONE_WAY 0 +#define AUTH_HOW_MUTUAL 2 +#define AUTH_HOW_MASK 2 + +#define AUTHTYPE_NULL 0 +#define AUTHTYPE_KERBEROS_V4 1 +#define AUTHTYPE_KERBEROS_V5 2 +#define AUTHTYPE_SPX 3 +#define AUTHTYPE_MINK 4 +#define AUTHTYPE_CNT 5 + +#define AUTHTYPE_TEST 99 + +#ifdef AUTH_NAMES +char *authtype_names[] = { + "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0, +}; +#else +extern char *authtype_names[]; +#endif + +#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT) +#define AUTHTYPE_NAME(x) authtype_names[x] + +/* + * ENCRYPTion suboptions + */ +#define ENCRYPT_IS 0 /* I pick encryption type ... */ +#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */ +#define ENCRYPT_REPLY 2 /* Initial setup response */ +#define ENCRYPT_START 3 /* Am starting to send encrypted */ +#define ENCRYPT_END 4 /* Am ending encrypted */ +#define ENCRYPT_REQSTART 5 /* Request you start encrypting */ +#define ENCRYPT_REQEND 6 /* Request you send encrypting */ +#define ENCRYPT_ENC_KEYID 7 +#define ENCRYPT_DEC_KEYID 8 +#define ENCRYPT_CNT 9 + +#define ENCTYPE_ANY 0 +#define ENCTYPE_DES_CFB64 1 +#define ENCTYPE_DES_OFB64 2 +#define ENCTYPE_CNT 3 + +#ifdef ENCRYPT_NAMES +char *encrypt_names[] = { + "IS", "SUPPORT", "REPLY", "START", "END", + "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID", + 0, +}; +char *enctype_names[] = { + "ANY", "DES_CFB64", "DES_OFB64", 0, +}; +#else +extern char *encrypt_names[]; +extern char *enctype_names[]; +#endif + + +#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT) +#define ENCRYPT_NAME(x) encrypt_names[x] + +#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT) +#define ENCTYPE_NAME(x) enctype_names[x] + +#endif /* !_TELNET_H_ */ diff --git a/include/arpa/tftp.h b/include/arpa/tftp.h new file mode 100644 index 0000000..70c3356 --- /dev/null +++ b/include/arpa/tftp.h @@ -0,0 +1,84 @@ +/* $NetBSD: tftp.h,v 1.8 2003/08/07 09:44:12 agc Exp $ */ + +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tftp.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _ARPA_TFTP_H_ +#define _ARPA_TFTP_H_ + +/* + * Trivial File Transfer Protocol (IEN-133) + */ +#define SEGSIZE 512 /* data segment size */ +#define MAXSEGSIZE 65464 /* maximum negotiated data segment size */ + +#define PKTSIZE SEGSIZE + 4 +#define MAXPKTSIZE MAXSEGSIZE + 4 + +/* + * Packet types. + */ +#define RRQ 01 /* read request */ +#define WRQ 02 /* write request */ +#define DATA 03 /* data packet */ +#define ACK 04 /* acknowledgement */ +#define ERROR 05 /* error code */ +#define OACK 06 /* option acknowledgement */ + +struct tftphdr { + short th_opcode; /* packet type */ + union { + unsigned short tu_block; /* block # */ + short tu_code; /* error code */ + char tu_stuff[1]; /* request packet stuff */ + } th_u; + char th_data[1]; /* data or error string */ +}; + +#define th_block th_u.tu_block +#define th_code th_u.tu_code +#define th_stuff th_u.tu_stuff +#define th_msg th_data + +/* + * Error codes. + */ +#define EUNDEF 0 /* not defined */ +#define ENOTFOUND 1 /* file not found */ +#define EACCESS 2 /* access violation */ +#define ENOSPACE 3 /* disk full or allocation exceeded */ +#define EBADOP 4 /* illegal TFTP operation */ +#define EBADID 5 /* unknown transfer ID */ +#define EEXISTS 6 /* file already exists */ +#define ENOUSER 7 /* no such user */ +#define EOPTNEG 8 /* option negotiation failed */ + +#endif /* _ARPA_TFTP_H_ */ diff --git a/include/asm.h b/include/asm.h new file mode 100644 index 0000000..d21a6b5 --- /dev/null +++ b/include/asm.h @@ -0,0 +1,415 @@ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _PPC_ASM_H_ +#define _PPC_ASM_H_ + +#ifdef __ELF__ +#define __NO_UNDERSCORES__ 1 +#define __ASMNL__ ; +#else +#define __ASMNL__ @ +#endif + +#ifdef ASSEMBLER + +#ifdef __ELF__ +#define r0 0 +#define r1 1 +#define r2 2 +#define r3 3 +#define r4 4 +#define r5 5 +#define r6 6 +#define r7 7 +#define r8 8 +#define r9 9 +#define r10 10 +#define r11 11 +#define r12 12 +#define r13 13 +#define r14 14 +#define r15 15 +#define r16 16 +#define r17 17 +#define r18 18 +#define r19 19 +#define r20 20 +#define r21 21 +#define r22 22 +#define r23 23 +#define r24 24 +#define r25 25 +#define r26 26 +#define r27 27 +#define r28 28 +#define r29 29 +#define r30 30 +#define r31 31 + +#define f0 0 +#define f1 1 +#define f2 2 +#define f3 3 +#define f4 4 +#define f5 5 +#define f6 6 +#define f7 7 +#define f8 8 +#define f9 9 +#define f10 10 +#define f11 11 +#define f12 12 +#define f13 13 +#define f14 14 +#define f15 15 +#define f16 16 +#define f17 17 +#define f18 18 +#define f19 19 +#define f20 20 +#define f21 21 +#define f22 22 +#define f23 23 +#define f24 24 +#define f25 25 +#define f26 26 +#define f27 27 +#define f28 28 +#define f29 29 +#define f30 30 +#define f31 31 + +#define sr0 0 +#define sr1 1 +#define sr2 2 +#define sr3 3 +#define sr4 4 +#define sr5 5 +#define sr6 6 +#define sr7 7 +#define sr8 8 +#define sr9 9 +#define sr10 10 +#define sr11 11 +#define sr12 12 +#define sr13 13 +#define sr14 14 +#define sr15 15 +#define sr16 16 +#define sr17 17 +#define sr18 18 +#define sr19 19 +#define sr20 20 +#define sr21 21 +#define sr22 22 +#define sr23 23 +#define sr24 24 +#define sr25 25 +#define sr26 26 +#define sr27 27 +#define sr28 28 +#define sr29 29 +#define sr30 30 +#define sr31 31 +#endif + +#define ARG0 r3 +#define ARG1 r4 +#define ARG2 r5 +#define ARG3 r6 +#define ARG4 r7 +#define ARG5 r8 +#define ARG6 r9 +#define ARG7 r10 + +#define tmp0 r0 /* Temporary GPR remapping (603e specific) */ +#define tmp1 r1 +#define tmp2 r2 +#define tmp3 r3 + +/* SPR registers */ + +#define dmiss 976 /* ea that missed */ +#define dcmp 977 /* compare value for the va that missed */ +#define hash1 978 /* pointer to first hash pteg */ +#define hash2 979 /* pointer to second hash pteg */ +#define imiss 980 /* ea that missed */ +#define icmp 981 /* compare value for the va that missed */ +#define rpa 982 /* required physical address register */ + +#define iabr 1010 /* instruction address breakpoint register */ +#define pir 1023 /* Processor ID Register */ + +/* MQ register on the 601 */ +#define mq 0 /* spr number for mq register on 601 */ + +#define IBAT0U 528 +#define IBAT0L 529 +#define IBAT1U 530 +#define IBAT1L 531 +#define IBAT2U 532 +#define IBAT2L 533 +#define IBAT3U 534 +#define IBAT3L 535 +#define ibat0u 528 +#define ibat0l 529 +#define ibat1u 530 +#define ibat1l 531 +#define ibat2u 532 +#define ibat2l 533 +#define ibat3u 534 +#define ibat3l 535 + +#define DBAT0U 536 +#define DBAT0L 537 +#define DBAT1U 538 +#define DBAT1L 539 +#define DBAT2U 540 +#define DBAT2L 541 +#define DBAT3U 542 +#define DBAT3L 543 +#define dbat0u 536 +#define dbat0l 537 +#define dbat1u 538 +#define dbat1l 539 +#define dbat2u 540 +#define dbat2l 541 +#define dbat3u 542 +#define dbat3l 543 + +#define HID0 1008 +#define hid0 1008 +#define HID1 1009 +#define hid1 1009 +#define SDR1 25 +#define sprg0 272 +#define sprg1 273 +#define sprg2 274 +#define sprg3 275 +#define ppcDAR 19 +#define ppcdar 19 +#define srr0 26 +#define srr1 27 + +#define CR0 0 +#define CR1 1 +#define CR2 2 +#define CR3 3 +#define CR4 4 +#define CR5 5 +#define CR6 6 +#define CR7 7 + +#ifdef __ELF__ +#define cr0 0 +#define cr1 1 +#define cr2 2 +#define cr3 3 +#define cr4 4 +#define cr5 5 +#define cr6 6 +#define cr7 7 +#endif + +#define cr0_lt 0 +#define cr0_gt 1 +#define cr0_eq 2 +#define cr0_so 3 +#define cr0_un 3 + +/* + * Macros to access high and low word values of an address + */ + +#ifndef __ELF__ +#define HIGH_CADDR(x) ha16(x) +#define HIGH_ADDR(x) hi16(x) +#define LOW_ADDR(x) lo16(x) +#else +#define HIGH_CADDR(x) x@ha +#define HIGH_ADDR(x) x@h +#define LOW_ADDR(x) x@l +#endif /* __ELF__ */ + +#endif /* ASSEMBLER */ + +/* Tags are placed before Immediately Following Code (IFC) for the debugger + * to be able to deduce where to find various registers when backtracing + * + * We only define the values as we use them, see SVR4 ABI PowerPc Supplement + * for more details (defined in ELF spec). + */ + +#define TAG_NO_FRAME_USED 0x00000000 + +/* (should use genassym to get these offsets) */ + +#define FM_BACKPTR 0 +/* TODO NMGS FM_SIZE 8 is ok according to EABI specs, but gcc uses 16 */ +#ifdef __ELF__ +#define FM_LR_SAVE 4 /* gcc 2.7.1 is now following eabi spec correctly */ +#define FM_SIZE 16 /* minimum frame contents, backptr and LR save */ +#define FM_ARG0 8 +#else +#define FM_CR_SAVE 4 +#define FM_LR_SAVE 8 /* Rhapsody iS NOT following the ABI at the moment.. */ +#define FM_SIZE 72 /* minimum frame contents, backptr and LR save */ +#define FM_ARG0 56 +#endif + +#define FM_ELF_ARG0 8 +#define FM_MACHO_ARG0 56 +#define MACHO_SYSCALL_BEGIN 0x2000 +#define PK_SYSCALL_BEGIN 0x7000 + + +/* redzone is the area under the stack pointer which must be preserved + * when taking a trap, interrupt etc. This is no longer needed as gcc + * (2.7.2 and above) now follows ELF spec correctly and never loads/stores + * below the frame pointer + */ +#ifdef __ELF__ +#define FM_REDZONE 0 /* was ((32-14+1)*4) */ +#else +#define FM_REDZONE 224 /* is ((32-14+1)*4) */ +#endif + +#define COPYIN_ARG0_OFFSET FM_ARG0 + +#ifdef MACH_KERNEL_BUILD +#include +#else /* MACH_KERNEL */ +#define MACH_KDB 0 +#endif /* MACH_KERNEL */ + +#define BREAKPOINT_TRAP twge r2,r2 + +/* There is another definition of ALIGN for .c sources */ +#ifndef __LANGUAGE_ASSEMBLY +#define ALIGN 2 +#endif /* __LANGUAGE_ASSEMBLY */ + +#ifndef FALIGN +#define FALIGN 2 /* Align functions on words for now. Cachelines is better */ +#endif + +#define LB(x,n) n +#if __STDC__ +#ifndef __NO_UNDERSCORES__ +#define LCL(x) L ## x +#define EXT(x) _ ## x +#define LEXT(x) _ ## x ## : +#else +#define LCL(x) .L ## x +#define EXT(x) x +#define LEXT(x) x ## : +#endif +#define LBc(x,n) n ## : +#define LBb(x,n) n ## b +#define LBf(x,n) n ## f +#else /* __STDC__ */ +#ifndef __NO_UNDERSCORES__ +#define LCL(x) L/**/x +#define EXT(x) _/**/x +#define LEXT(x) _/**/x/**/: +#else /* __NO_UNDERSCORES__ */ +#define LCL(x) .L/**/x +#define EXT(x) x +#define LEXT(x) x/**/: +#endif /* __NO_UNDERSCORES__ */ +#define LBc(x,n) n/**/: +#define LBb(x,n) n/**/b +#define LBf(x,n) n/**/f +#endif /* __STDC__ */ + +#define String .asciz +#define Value .word +#define Times(a,b) (a*b) +#define Divide(a,b) (a/b) + +#define data16 .byte 0x66 +#define addr16 .byte 0x67 + +#if !GPROF +#define MCOUNT + +#elif defined(__SHARED__) +#define MCOUNT ; .data;\ + .align ALIGN;\ + LBc(x, 8) .long 0;\ + .text;\ + Gpush;\ + Gload;\ + leal Gotoff(LBb(x,8)),%edx;\ + Egaddr(%eax,_mcount_ptr);\ + Gpop;\ + call *(%eax); + +#else /* !GPROF, !__SHARED__ */ +#define MCOUNT ; .data;\ + .align ALIGN;\ + LBc(x, 8) .long 0;\ + .text;\ + movl $LBb(x,8),%edx;\ + call *EXT(_mcount_ptr); + +#endif /* GPROF */ + +#ifdef __ELF__ +#define ELF_FUNC(x) .type x,@function +#define ELF_DATA(x) .type x,@object +#define ELF_SIZE(x,s) .size x,s +#else +#define ELF_FUNC(x) +#define ELF_DATA(x) +#define ELF_SIZE(x,s) +#endif + +#ifdef __ELF__ +#define Entry(x,tag) .globl EXT(x); ELF_FUNC(EXT(x)); .long tag;.align FALIGN; LEXT(x) +#define ENTRY(x,tag) Entry(x,tag) MCOUNT +#define ENTRY2(x,y,tag) .globl EXT(x); .globl EXT(y); \ + ELF_FUNC(EXT(x)); ELF_FUNC(EXT(y)); \ + .align FALIGN; LEXT(x); LEXT(y) \ + MCOUNT +#if __STDC__ +#define ASENTRY(x) .globl x; .align FALIGN; x ## : ELF_FUNC(x) MCOUNT +#else +#define ASENTRY(x) .globl x; .align FALIGN; x: ELF_FUNC(x) MCOUNT +#endif /* __STDC__ */ +#define DATA(x) .globl EXT(x); ELF_DATA(EXT(x)); .align ALIGN; LEXT(x) + +#else /* __ELF__ */ + +#define Entry(x,tag) .text@.align FALIGN@ .globl EXT(x)@ LEXT(x) +#define ENTRY(x,tag) Entry(x,tag)@MCOUNT +#define ENTRY2(x,y,tag) .text@ .align FALIGN@ .globl EXT(x)@ .globl EXT(y)@ \ + LEXT(x)@ LEXT(y) @\ + MCOUNT +#if __STDC__ +#define ASENTRY(x) .globl x @ .align FALIGN; x ## @ MCOUNT +#else +#define ASENTRY(x) .globl x @ .align FALIGN; x @ MCOUNT +#endif /* __STDC__ */ +#define DATA(x) .globl EXT(x) @ .align ALIGN @ LEXT(x) +#endif + + + +#define End(x) ELF_SIZE(x,.-x) +#define END(x) End(EXT(x)) +#define ENDDATA(x) END(x) +#define Enddata(x) End(x) + +/* These defines are here for .c files that wish to reference global symbols + * within __asm__ statements. + */ +#ifndef __NO_UNDERSCORES__ +#define CC_SYM_PREFIX "_" +#else +#define CC_SYM_PREFIX "" +#endif /* __NO_UNDERSCORES__ */ + +#endif /* _PPC_ASM_H_ */ diff --git a/include/assert.h b/include/assert.h new file mode 100644 index 0000000..1697026 --- /dev/null +++ b/include/assert.h @@ -0,0 +1,119 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)assert.h 8.2 (Berkeley) 1/21/94 + * $FreeBSD: src/include/assert.h,v 1.4 2002/03/23 17:24:53 imp Exp $ + */ + +#include +#ifdef __cplusplus +#include +#endif /* __cplusplus */ + +/* + * Unlike other ANSI header files, may usefully be included + * multiple times, with and without NDEBUG defined. + */ + +#undef assert +#undef __assert + +#ifdef NDEBUG +#define assert(e) ((void)0) +#else + +#ifndef UNIFDEF_DRIVERKIT +#ifndef __GNUC__ + +__BEGIN_DECLS +#ifndef __cplusplus +void abort(void) __dead2 __cold; +#endif /* !__cplusplus */ +int printf(const char * __restrict, ...); +__END_DECLS + +#define assert(e) \ + ((void) ((e) ? ((void)0) : __assert (#e, __FILE__, __LINE__))) +#define __assert(e, file, line) \ + ((void)printf ("%s:%d: failed assertion `%s'\n", file, line, e), abort()) + +#else /* __GNUC__ */ + +__BEGIN_DECLS +void __assert_rtn(const char *, const char *, int, const char *) __dead2 __cold __disable_tail_calls; +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070) +void __eprintf(const char *, const char *, unsigned, const char *) __dead2 __cold; +#endif +__END_DECLS + +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070) +#define __assert(e, file, line) \ + __eprintf ("%s:%d: failed assertion `%s'\n", file, line, e) +#else +/* 8462256: modified __assert_rtn() replaces deprecated __eprintf() */ +#define __assert(e, file, line) \ + __assert_rtn ((const char *)-1L, file, line, e) +#endif + +#if __DARWIN_UNIX03 +#define assert(e) \ + (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0) +#else /* !__DARWIN_UNIX03 */ +#define assert(e) \ + (__builtin_expect(!(e), 0) ? __assert (#e, __FILE__, __LINE__) : (void)0) +#endif /* __DARWIN_UNIX03 */ + +#endif /* __GNUC__ */ +#else /* UNIFDEF_DRIVERKIT */ +__BEGIN_DECLS +void __assert_rtn(const char *, const char *, int, const char *) __dead2 __cold __disable_tail_calls; +__END_DECLS +#define assert(e) \ + (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0) +#endif /* UNIFDEF_DRIVERKIT */ +#endif /* NDEBUG */ + +#ifndef _ASSERT_H_ +#define _ASSERT_H_ + +#ifndef __cplusplus +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#define static_assert _Static_assert +#endif /* __STDC_VERSION__ */ +#endif /* !__cplusplus */ + +#endif /* _ASSERT_H_ */ diff --git a/include/authentication.h b/include/authentication.h new file mode 100644 index 0000000..9870e33 --- /dev/null +++ b/include/authentication.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __AUTHENTICATION_H__ +#define __AUTHENTICATION_H__ + +#include + +__BEGIN_DECLS +extern char *groupNameForTask(int taskNum); +extern int isAuthenticatedAsAdministrator(void); +extern int isAuthenticatedAsAdministratorForTask(int taskNum); +extern int isAuthenticatedAsRoot(void); +__END_DECLS + +#endif /* __AUTHENTICATION_H__ */ diff --git a/include/bitstring.h b/include/bitstring.h new file mode 100644 index 0000000..660ccdf --- /dev/null +++ b/include/bitstring.h @@ -0,0 +1,150 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Vixie. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _BITSTRING_H_ +#define _BITSTRING_H_ + +typedef unsigned char bitstr_t; + +/* internal macros */ + /* byte of the bitstring bit is in */ +#define _bit_byte(bit) \ + ((bit) >> 3) + + /* mask for the bit within its byte */ +#define _bit_mask(bit) \ + (1 << ((bit)&0x7)) + +/* external macros */ + /* bytes in a bitstring of nbits bits */ +#define bitstr_size(nbits) \ + (((nbits) + 7) >> 3) + + /* allocate a bitstring */ +#define bit_alloc(nbits) \ + (bitstr_t *)calloc((size_t)bitstr_size(nbits), sizeof(bitstr_t)) + + /* allocate a bitstring on the stack */ +#define bit_decl(name, nbits) \ + ((name)[bitstr_size(nbits)]) + + /* is bit N of bitstring name set? */ +#define bit_test(name, bit) \ + ((name)[_bit_byte(bit)] & _bit_mask(bit)) + + /* set bit N of bitstring name */ +#define bit_set(name, bit) \ + ((name)[_bit_byte(bit)] |= _bit_mask(bit)) + + /* clear bit N of bitstring name */ +#define bit_clear(name, bit) \ + ((name)[_bit_byte(bit)] &= ~_bit_mask(bit)) + + /* clear bits start ... stop in bitstring */ +#define bit_nclear(name, start, stop) do { \ + bitstr_t *_name = (name); \ + int _start = (start), _stop = (stop); \ + int _startbyte = _bit_byte(_start); \ + int _stopbyte = _bit_byte(_stop); \ + if (_startbyte == _stopbyte) { \ + _name[_startbyte] &= ((0xff >> (8 - (_start&0x7))) | \ + (0xff << ((_stop&0x7) + 1))); \ + } else { \ + _name[_startbyte] &= 0xff >> (8 - (_start&0x7)); \ + while (++_startbyte < _stopbyte) \ + _name[_startbyte] = 0; \ + _name[_stopbyte] &= 0xff << ((_stop&0x7) + 1); \ + } \ +} while (0) + + /* set bits start ... stop in bitstring */ +#define bit_nset(name, start, stop) do { \ + bitstr_t *_name = (name); \ + int _start = (start), _stop = (stop); \ + int _startbyte = _bit_byte(_start); \ + int _stopbyte = _bit_byte(_stop); \ + if (_startbyte == _stopbyte) { \ + _name[_startbyte] |= ((0xff << (_start&0x7)) & \ + (0xff >> (7 - (_stop&0x7)))); \ + } else { \ + _name[_startbyte] |= 0xff << ((_start)&0x7); \ + while (++_startbyte < _stopbyte) \ + _name[_startbyte] = 0xff; \ + _name[_stopbyte] |= 0xff >> (7 - (_stop&0x7)); \ + } \ +} while (0) + + /* find first bit clear in name */ +#define bit_ffc(name, nbits, value) do { \ + bitstr_t *_name = (name); \ + int _byte, _nbits = (nbits); \ + int _stopbyte = _bit_byte(_nbits - 1), _value = -1; \ + if (_nbits > 0) \ + for (_byte = 0; _byte <= _stopbyte; ++_byte) \ + if (_name[_byte] != 0xff) { \ + bitstr_t _lb; \ + _value = _byte << 3; \ + for (_lb = _name[_byte]; (_lb&0x1); \ + ++_value, _lb >>= 1); \ + break; \ + } \ + if (_value >= nbits) \ + _value = -1; \ + *(value) = _value; \ +} while (0) + + /* find first bit set in name */ +#define bit_ffs(name, nbits, value) do { \ + bitstr_t *_name = (name); \ + int _byte, _nbits = (nbits); \ + int _stopbyte = _bit_byte(_nbits - 1), _value = -1; \ + if (_nbits > 0) \ + for (_byte = 0; _byte <= _stopbyte; ++_byte) \ + if (_name[_byte]) { \ + bitstr_t _lb; \ + _value = _byte << 3; \ + for (_lb = _name[_byte]; !(_lb&0x1); \ + ++_value, _lb >>= 1); \ + break; \ + } \ + if (_value >= nbits) \ + _value = -1; \ + *(value) = _value; \ +} while (0) + +#endif /* !_BITSTRING_H_ */ diff --git a/include/cpio.h b/include/cpio.h new file mode 100644 index 0000000..d287af6 --- /dev/null +++ b/include/cpio.h @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2002 Mike Barcroft + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/include/cpio.h,v 1.1 2002/08/01 07:18:38 mike Exp $ + */ + +#ifndef _CPIO_H_ +#define _CPIO_H_ + +#define C_ISSOCK 0140000 /* Socket. */ +#define C_ISLNK 0120000 /* Symbolic link. */ +#define C_ISCTG 0110000 /* Reserved. */ +#define C_ISREG 0100000 /* Regular file. */ +#define C_ISBLK 0060000 /* Block special. */ +#define C_ISDIR 0040000 /* Directory. */ +#define C_ISCHR 0020000 /* Character special. */ +#define C_ISFIFO 0010000 /* FIFO. */ +#define C_ISUID 0004000 /* Set user ID. */ +#define C_ISGID 0002000 /* Set group ID. */ +#define C_ISVTX 0001000 /* On directories, restricted deletion flag. */ +#define C_IRUSR 0000400 /* Read by owner. */ +#define C_IWUSR 0000200 /* Write by owner. */ +#define C_IXUSR 0000100 /* Execute by owner. */ +#define C_IRGRP 0000040 /* Read by group. */ +#define C_IWGRP 0000020 /* Write by group. */ +#define C_IXGRP 0000010 /* Execute by group. */ +#define C_IROTH 0000004 /* Read by others. */ +#define C_IWOTH 0000002 /* Write by others. */ +#define C_IXOTH 0000001 /* Execute by others. */ + +#define MAGIC "070707" + +#endif /* _CPIO_H_ */ diff --git a/include/crt_externs.h b/include/crt_externs.h new file mode 100644 index 0000000..eb3729a --- /dev/null +++ b/include/crt_externs.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved + */ + +/* +** Prototypes for the functions to get environment information in +** the world of dynamic libraries. Lifted from .c file of same name. +** Fri Jun 23 12:56:47 PDT 1995 +** AOF (afreier@next.com) +*/ + +#include + +__BEGIN_DECLS +extern char ***_NSGetArgv(void); +extern int *_NSGetArgc(void); +extern char ***_NSGetEnviron(void); +extern char **_NSGetProgname(void); +#ifdef __LP64__ +extern struct mach_header_64 * +#else /* !__LP64__ */ +extern struct mach_header * +#endif /* __LP64__ */ + _NSGetMachExecuteHeader(void); +__END_DECLS diff --git a/include/ctype.h b/include/ctype.h new file mode 100644 index 0000000..b893369 --- /dev/null +++ b/include/ctype.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2000, 2005, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ctype.h 8.4 (Berkeley) 1/21/94 + */ + +#ifndef _CTYPE_H_ +#define _CTYPE_H_ + +#include <_ctype.h> + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_CTYPE_H_ */ diff --git a/include/db.h b/include/db.h new file mode 100644 index 0000000..7af97b8 --- /dev/null +++ b/include/db.h @@ -0,0 +1,219 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)db.h 8.7 (Berkeley) 6/16/94 + * $FreeBSD: src/include/db.h,v 1.5 2002/03/26 01:35:05 bde Exp $ + */ + +#ifndef _DB_H_ +#define _DB_H_ + +#include +#include + +#include + +#define RET_ERROR -1 /* Return values. */ +#define RET_SUCCESS 0 +#define RET_SPECIAL 1 + +#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */ +typedef u_int32_t pgno_t; +#define MAX_PAGE_OFFSET 65535 /* >= # of bytes in a page */ +typedef u_int16_t indx_t; +#define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */ +typedef u_int32_t recno_t; + +/* Key/data structure -- a Data-Base Thang. */ +typedef struct { + void *data; /* data */ + size_t size; /* data length */ +} DBT; + +/* Routine flags. */ +#define R_CURSOR 1 /* del, put, seq */ +#define __R_UNUSED 2 /* UNUSED */ +#define R_FIRST 3 /* seq */ +#define R_IAFTER 4 /* put (RECNO) */ +#define R_IBEFORE 5 /* put (RECNO) */ +#define R_LAST 6 /* seq (BTREE, RECNO) */ +#define R_NEXT 7 /* seq */ +#define R_NOOVERWRITE 8 /* put */ +#define R_PREV 9 /* seq (BTREE, RECNO) */ +#define R_SETCURSOR 10 /* put (RECNO) */ +#define R_RECNOSYNC 11 /* sync (RECNO) */ + +typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE; + +/* + * !!! + * The following flags are included in the dbopen(3) call as part of the + * open(2) flags. In order to avoid conflicts with the open flags, start + * at the top of the 16 or 32-bit number space and work our way down. If + * the open flags were significantly expanded in the future, it could be + * a problem. Wish I'd left another flags word in the dbopen call. + * + * !!! + * None of this stuff is implemented yet. The only reason that it's here + * is so that the access methods can skip copying the key/data pair when + * the DB_LOCK flag isn't set. + */ +#if UINT_MAX > 65535 +#define DB_LOCK 0x20000000 /* Do locking. */ +#define DB_SHMEM 0x40000000 /* Use shared memory. */ +#define DB_TXN 0x80000000 /* Do transactions. */ +#else +#define DB_LOCK 0x2000 /* Do locking. */ +#define DB_SHMEM 0x4000 /* Use shared memory. */ +#define DB_TXN 0x8000 /* Do transactions. */ +#endif + +/* Access method description structure. */ +typedef struct __db { + DBTYPE type; /* Underlying db type. */ + int (*close)(struct __db *); + int (*del)(const struct __db *, const DBT *, unsigned int); + int (*get)(const struct __db *, const DBT *, DBT *, unsigned int); + int (*put)(const struct __db *, DBT *, const DBT *, unsigned int); + int (*seq)(const struct __db *, DBT *, DBT *, unsigned int); + int (*sync)(const struct __db *, unsigned int); + void *internal; /* Access method private. */ + int (*fd)(const struct __db *); +} DB; + +#define BTREEMAGIC 0x053162 +#define BTREEVERSION 3 + +/* Structure used to pass parameters to the btree routines. */ +typedef struct { +#define R_DUP 0x01 /* duplicate keys */ + unsigned long flags; + unsigned int cachesize; /* bytes to cache */ + int maxkeypage; /* maximum keys per page */ + int minkeypage; /* minimum keys per page */ + unsigned int psize; /* page size */ + int (*compare) /* comparison function */ + (const DBT *, const DBT *); + size_t (*prefix) /* prefix function */ + (const DBT *, const DBT *); + int lorder; /* byte order */ +} BTREEINFO; + +#define HASHMAGIC 0x061561 +#define HASHVERSION 2 + +/* Structure used to pass parameters to the hashing routines. */ +typedef struct { + unsigned int bsize; /* bucket size */ + unsigned int ffactor; /* fill factor */ + unsigned int nelem; /* number of elements */ + unsigned int cachesize; /* bytes to cache */ + u_int32_t /* hash function */ + (*hash)(const void *, size_t); + int lorder; /* byte order */ +} HASHINFO; + +/* Structure used to pass parameters to the record routines. */ +typedef struct { +#define R_FIXEDLEN 0x01 /* fixed-length records */ +#define R_NOKEY 0x02 /* key not required */ +#define R_SNAPSHOT 0x04 /* snapshot the input */ + unsigned long flags; + unsigned int cachesize; /* bytes to cache */ + unsigned int psize; /* page size */ + int lorder; /* byte order */ + size_t reclen; /* record length (fixed-length records) */ + unsigned char bval; /* delimiting byte (variable-length records */ + char *bfname; /* btree file name */ +} RECNOINFO; + +#ifdef __DBINTERFACE_PRIVATE +/* + * Little endian <==> big endian 32-bit swap macros. + * M_32_SWAP swap a memory location + * P_32_SWAP swap a referenced memory location + * P_32_COPY swap from one location to another + */ +#define M_32_SWAP(a) { \ + u_int32_t _tmp = a; \ + ((char *)&a)[0] = ((char *)&_tmp)[3]; \ + ((char *)&a)[1] = ((char *)&_tmp)[2]; \ + ((char *)&a)[2] = ((char *)&_tmp)[1]; \ + ((char *)&a)[3] = ((char *)&_tmp)[0]; \ +} +#define P_32_SWAP(a) { \ + u_int32_t _tmp = *(u_int32_t *)a; \ + ((char *)a)[0] = ((char *)&_tmp)[3]; \ + ((char *)a)[1] = ((char *)&_tmp)[2]; \ + ((char *)a)[2] = ((char *)&_tmp)[1]; \ + ((char *)a)[3] = ((char *)&_tmp)[0]; \ +} +#define P_32_COPY(a, b) { \ + ((char *)&(b))[0] = ((char *)&(a))[3]; \ + ((char *)&(b))[1] = ((char *)&(a))[2]; \ + ((char *)&(b))[2] = ((char *)&(a))[1]; \ + ((char *)&(b))[3] = ((char *)&(a))[0]; \ +} + +/* + * Little endian <==> big endian 16-bit swap macros. + * M_16_SWAP swap a memory location + * P_16_SWAP swap a referenced memory location + * P_16_COPY swap from one location to another + */ +#define M_16_SWAP(a) { \ + u_int16_t _tmp = a; \ + ((char *)&a)[0] = ((char *)&_tmp)[1]; \ + ((char *)&a)[1] = ((char *)&_tmp)[0]; \ +} +#define P_16_SWAP(a) { \ + u_int16_t _tmp = *(u_int16_t *)a; \ + ((char *)a)[0] = ((char *)&_tmp)[1]; \ + ((char *)a)[1] = ((char *)&_tmp)[0]; \ +} +#define P_16_COPY(a, b) { \ + ((char *)&(b))[0] = ((char *)&(a))[1]; \ + ((char *)&(b))[1] = ((char *)&(a))[0]; \ +} +#endif + +__BEGIN_DECLS +DB *dbopen(const char *, int, int, DBTYPE, const void *); + +#ifdef __DBINTERFACE_PRIVATE +DB *__bt_open(const char *, int, int, const BTREEINFO *, int); +DB *__hash_open(const char *, int, int, const HASHINFO *, int); +DB *__rec_open(const char *, int, int, const RECNOINFO *, int); +void __dbpanic(DB *dbp); +#endif +__END_DECLS +#endif /* !_DB_H_ */ diff --git a/include/dirent.h b/include/dirent.h new file mode 100644 index 0000000..0791063 --- /dev/null +++ b/include/dirent.h @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2000, 2002-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)dirent.h 8.2 (Berkeley) 7/28/94 + */ + +#ifndef _DIRENT_H_ +#define _DIRENT_H_ + +/* + * The kernel defines the format of directory entries + */ +#include <_types.h> +#include +#include +#include +#include /* __darwin_pthread_mutex_t */ + +struct _telldir; /* forward reference */ + +/* structure describing an open directory. */ +typedef struct { + int __dd_fd; /* file descriptor associated with directory */ + long __dd_loc; /* offset in current buffer */ + long __dd_size; /* amount of data returned */ + char *__dd_buf; /* data buffer */ + int __dd_len; /* size of data buffer */ + long __dd_seek; /* magic cookie returned */ + __unused long __padding; /* (__dd_rewind space left for bincompat) */ + int __dd_flags; /* flags for readdir */ + __darwin_pthread_mutex_t __dd_lock; /* for thread locking */ + struct _telldir *__dd_td; /* telldir position recording */ +} DIR; + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL + +/* definitions for library routines operating on directories. */ +#define DIRBLKSIZ 1024 + +/* flags for opendir2 */ +#define DTF_HIDEW 0x0001 /* hide whiteout entries */ +#define DTF_NODUP 0x0002 /* don't return duplicate names */ +#define DTF_REWIND 0x0004 /* rewind after reading union stack */ +#define __DTF_READALL 0x0008 /* everything has been read */ +#define __DTF_SKIPREAD 0x0010 /* assume internal buffer is populated */ +#define __DTF_ATEND 0x0020 /* there's nothing more to read in the kernel */ + +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#ifndef KERNEL + +__BEGIN_DECLS + +int closedir(DIR *) __DARWIN_ALIAS(closedir); + +DIR *opendir(const char *) __DARWIN_ALIAS_I(opendir); + +struct dirent *readdir(DIR *) __DARWIN_INODE64(readdir); +int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r); + +void rewinddir(DIR *) __DARWIN_ALIAS_I(rewinddir); + +void seekdir(DIR *, long) __DARWIN_ALIAS_I(seekdir); + +long telldir(DIR *) __DARWIN_ALIAS_I(telldir); + +__END_DECLS + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +__BEGIN_DECLS + +__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) +DIR *fdopendir(int) __DARWIN_ALIAS_I(fdopendir); + +int alphasort(const struct dirent **, const struct dirent **) __DARWIN_INODE64(alphasort); + +#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0) +#include +#include +#define dirfd(dirp) ({ \ + DIR *_dirp = (dirp); \ + int ret = -1; \ + if (_dirp == NULL || _dirp->__dd_fd < 0) \ + errno = EINVAL; \ + else \ + ret = _dirp->__dd_fd; \ + ret; \ +}) +#else +int dirfd(DIR *dirp) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +#endif + +int scandir(const char *, struct dirent ***, + int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)) __DARWIN_INODE64(scandir); +#ifdef __BLOCKS__ +#if __has_attribute(noescape) +#define __scandir_noescape __attribute__((__noescape__)) +#else +#define __scandir_noescape +#endif + +int scandir_b(const char *, struct dirent ***, + int (^)(const struct dirent *) __scandir_noescape, + int (^)(const struct dirent **, const struct dirent **) __scandir_noescape) + __DARWIN_INODE64(scandir_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ + +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +__BEGIN_DECLS + +int getdirentries(int, char *, int, long *) + +#if __DARWIN_64_BIT_INO_T +/* + * getdirentries() doesn't work when 64-bit inodes is in effect, so we + * generate a link error. + */ + __asm("_getdirentries_is_not_available_when_64_bit_inodes_are_in_effect") +#else /* !__DARWIN_64_BIT_INO_T */ + __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_6, __IPHONE_2_0,__IPHONE_2_0) +#endif /* __DARWIN_64_BIT_INO_T */ +; + +DIR *__opendir2(const char *, int) __DARWIN_ALIAS_I(__opendir2); + +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#endif /* !KERNEL */ + +#endif /* !_DIRENT_H_ */ diff --git a/include/disktab.h b/include/disktab.h new file mode 100644 index 0000000..55f0f46 --- /dev/null +++ b/include/disktab.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)disktab.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _DISKTAB_H_ +#define _DISKTAB_H_ + +/* + * Disk description table, see disktab(5) + */ +#define DISKTAB "/etc/disktab" + +struct disktab { + char *d_name; /* drive name */ + char *d_type; /* drive type */ + int d_secsize; /* sector size in bytes */ + int d_ntracks; /* # tracks/cylinder */ + int d_nsectors; /* # sectors/track */ + int d_ncylinders; /* # cylinders */ + int d_rpm; /* revolutions/minute */ + int d_badsectforw; /* supports DEC bad144 std */ + int d_sectoffset; /* use sect rather than cyl offsets */ + struct partition { + int p_size; /* #sectors in partition */ + short p_bsize; /* block size in bytes */ + short p_fsize; /* frag size in bytes */ + } d_partitions[8]; +}; + +#endif /* !_DISKTAB_H_ */ diff --git a/include/err.h b/include/err.h new file mode 100644 index 0000000..0d005d0 --- /dev/null +++ b/include/err.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2000, 2003, 2004, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)err.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _ERR_H_ +#define _ERR_H_ + +/* + * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two + * places ( and ), so if we include one + * of them here we may collide with the utility's includes. It's unreasonable + * for utilities to have to include one of them to include err.h, so we get + * __darwin_va_list from and use it. + */ +#include +#include <_types.h> +#include + +__BEGIN_DECLS +void err(int, const char *, ...) __cold __dead2 __printflike(2, 3); +void verr(int, const char *, __darwin_va_list) __cold __dead2 __printflike(2, 0); +void errc(int, int, const char *, ...) __cold __dead2 __printflike(3, 4); +void verrc(int, int, const char *, __darwin_va_list) __cold __dead2 __printflike(3, 0); +void errx(int, const char *, ...) __cold __dead2 __printflike(2, 3); +void verrx(int, const char *, __darwin_va_list) __cold __dead2 __printflike(2, 0); +void warn(const char *, ...) __cold __printflike(1, 2); +void vwarn(const char *, __darwin_va_list) __cold __printflike(1, 0); +void warnc(int, const char *, ...) __cold __printflike(2, 3); +void vwarnc(int, const char *, __darwin_va_list) __cold __printflike(2, 0); +void warnx(const char *, ...) __cold __printflike(1, 2); +void vwarnx(const char *, __darwin_va_list) __cold __printflike(1, 0); +void err_set_file(void *); +void err_set_exit(void (* _Nullable)(int)); +#ifdef __BLOCKS__ +void err_set_exit_b(void (^ _Nullable)(int)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ + +__END_DECLS + +#endif /* !_ERR_H_ */ diff --git a/include/errno.h b/include/errno.h new file mode 100644 index 0000000..9879cc4 --- /dev/null +++ b/include/errno.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include + diff --git a/include/execinfo.h b/include/execinfo.h new file mode 120000 index 0000000..03a98d8 --- /dev/null +++ b/include/execinfo.h @@ -0,0 +1 @@ +../gen/execinfo.h \ No newline at end of file diff --git a/include/fcntl.h b/include/fcntl.h new file mode 100644 index 0000000..d4b1ae2 --- /dev/null +++ b/include/fcntl.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include diff --git a/include/fmtmsg.h b/include/fmtmsg.h new file mode 100644 index 0000000..256cf33 --- /dev/null +++ b/include/fmtmsg.h @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2002 Mike Barcroft + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/include/fmtmsg.h,v 1.2 2002/08/05 16:37:05 mike Exp $ + */ + +#ifndef _FMTMSG_H_ +#define _FMTMSG_H_ + +/* Source of condition is... */ +#define MM_HARD 0x0001 /* ...hardware. */ +#define MM_SOFT 0x0002 /* ...software. */ +#define MM_FIRM 0x0004 /* ...fireware. */ + +/* Condition detected by... */ +#define MM_APPL 0x0010 /* ...application. */ +#define MM_UTIL 0x0020 /* ...utility. */ +#define MM_OPSYS 0x0040 /* ...operating system. */ + +/* Display on... */ +#define MM_PRINT 0x0100 /* ...standard error. */ +#define MM_CONSOLE 0x0200 /* ...system console. */ + +#define MM_RECOVER 0x1000 /* Recoverable error. */ +#define MM_NRECOV 0x2000 /* Non-recoverable error. */ + +/* Severity levels. */ +#define MM_NOSEV 0 /* No severity level provided. */ +#define MM_HALT 1 /* Error causing application to halt. */ +#define MM_ERROR 2 /* Non-fault fault. */ +#define MM_WARNING 3 /* Unusual non-error condition. */ +#define MM_INFO 4 /* Informative message. */ + +/* Null options. */ +#define MM_NULLLBL (char *)0 +#define MM_NULLSEV 0 +#define MM_NULLMC 0L +#define MM_NULLTXT (char *)0 +#define MM_NULLACT (char *)0 +#define MM_NULLTAG (char *)0 + +/* Return values. */ +#define MM_OK 0 /* Success. */ +#define MM_NOMSG 1 /* Failed to output to stderr. */ +#define MM_NOCON 2 /* Failed to output to console. */ +#define MM_NOTOK 3 /* Failed to output anything. */ + +int fmtmsg(long, const char *, int, const char *, const char *, + const char *); + +#endif /* !_FMTMSG_H_ */ diff --git a/include/fnmatch.h b/include/fnmatch.h new file mode 100644 index 0000000..e1ffaea --- /dev/null +++ b/include/fnmatch.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _FNMATCH_H_ +#define _FNMATCH_H_ + +#include + +#define FNM_NOMATCH 1 /* Match failed. */ + +#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ +#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ +#define FNM_PERIOD 0x04 /* Period must be matched by period. */ + +#define FNM_NOSYS (-1) /* Reserved. */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define FNM_LEADING_DIR 0x08 /* Ignore / after Imatch. */ +#define FNM_CASEFOLD 0x10 /* Case insensitive search. */ +#define FNM_IGNORECASE FNM_CASEFOLD +#define FNM_FILE_NAME FNM_PATHNAME +#endif + +__BEGIN_DECLS +int fnmatch(const char *, const char *, int) __DARWIN_ALIAS(fnmatch); +__END_DECLS + +#endif /* !_FNMATCH_H_ */ diff --git a/include/fsproperties.h b/include/fsproperties.h new file mode 100644 index 0000000..d0ccc27 --- /dev/null +++ b/include/fsproperties.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _FSPROPERTIES_H_ +#define _FSPROPERTIES_H_ + +/* Info plist keys */ +#define kFSMediaTypesKey "FSMediaTypes" +#define kFSPersonalitiesKey "FSPersonalities" + +/* Sub-keys for FSMediaTypes dictionaries */ +#define kFSMediaPropertiesKey "FSMediaProperties" +#define kFSProbeArgumentsKey "FSProbeArguments" +#define kFSProbeExecutableKey "FSProbeExecutable" +#define kFSProbeOrderKey "FSProbeOrder" + +/* Sub-keys for FSPersonalities dictionaries */ +#define kFSFormatArgumentsKey "FSFormatArguments" +#define kFSFormatContentMaskKey "FSFormatContentMask" +#define kFSFormatExecutableKey "FSFormatExecutable" +#define kFSFormatInteractiveKey "FSFormatInteractive" +#define kFSFormatMinimumSizeKey "FSFormatMinimumSize" +#define kFSFormatMaximumSizeKey "FSFormatMaximumSize" +#define kFSMountArgumentsKey "FSMountArguments" +#define kFSMountExecutableKey "FSMountExecutable" +#define kFSNameKey "FSName" +#define kFSRepairArgumentsKey "FSRepairArguments" +#define kFSRepairExecutableKey "FSRepairExecutable" +#define kFSVerificationArgumentsKey "FSVerificationArguments" +#define kFSVerificationExecutableKey "FSVerificationExecutable" +#define kFSSubTypeKey "FSSubType" +#define kFSXMLOutputArgumentKey "FSXMLOutputArgument" + +#define kFSEncryptNameKey "FSEncryptionName" + /* Deprecated - use kFSEncryptNameKey for HFS/APFS */ +#define kFSCoreStorageEncryptNameKey "FSCoreStorageEncryptionName" + +#endif /* _FSPROPERTIES_H_ */ diff --git a/include/fstab.h b/include/fstab.h new file mode 100644 index 0000000..c3ae066 --- /dev/null +++ b/include/fstab.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)fstab.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _FSTAB_H_ +#define _FSTAB_H_ + +/* + * File system table, see fstab(5). + * + * Used by dump, mount, umount, swapon, fsck, df, ... + * + * For ufs fs_spec field is the block special name. Programs that want to + * use the character special name must create that name by prepending a 'r' + * after the right most slash. Quota files are always named "quotas", so + * if type is "rq", then use concatenation of fs_file and "quotas" to locate + * quota file. + */ +#define _PATH_FSTAB "/etc/fstab" +#define FSTAB "/etc/fstab" /* deprecated */ + +#define FSTAB_RW "rw" /* read/write device */ +#define FSTAB_RQ "rq" /* read/write with quotas */ +#define FSTAB_RO "ro" /* read-only device */ +#define FSTAB_SW "sw" /* swap device */ +#define FSTAB_XX "xx" /* ignore totally */ + +struct fstab { + char *fs_spec; /* block special device name */ + char *fs_file; /* file system path prefix */ + char *fs_vfstype; /* File system type, ufs, nfs */ + char *fs_mntops; /* Mount options ala -o */ + char *fs_type; /* FSTAB_* from fs_mntops */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ +}; + +#include + +__BEGIN_DECLS +struct fstab *getfsent(void); +struct fstab *getfsspec(const char *); +struct fstab *getfsfile(const char *); +int setfsent(void); +void endfsent(void); +__END_DECLS + +#endif /* !_FSTAB_H_ */ diff --git a/include/fts.h b/include/fts.h new file mode 100644 index 0000000..dd2cd74 --- /dev/null +++ b/include/fts.h @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2000, 2003-2006, 2008, 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)fts.h 8.3 (Berkeley) 8/14/94 + */ + +#ifndef _FTS_H_ +#define _FTS_H_ + +#include +#include +#include +#include + +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +typedef struct { + struct _ftsent *fts_cur; /* current node */ + struct _ftsent *fts_child; /* linked list of children */ + struct _ftsent **fts_array; /* sort array */ + dev_t fts_dev; /* starting device # */ + char *fts_path; /* path for this descent */ + int fts_rfd; /* fd for root */ + int fts_pathlen; /* sizeof(path) */ + int fts_nitems; /* elements in the sort array */ +#ifdef __BLOCKS__ + union { +#endif /* __BLOCKS__ */ + int (*fts_compar)(); /* compare function */ +#ifdef __BLOCKS__ + int (^fts_compar_b)(); /* compare block */ + }; +#endif /* __BLOCKS__ */ + +#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */ +#define FTS_LOGICAL 0x002 /* logical walk */ +#define FTS_NOCHDIR 0x004 /* don't change directories */ +#define FTS_NOSTAT 0x008 /* don't get stat info */ +#define FTS_PHYSICAL 0x010 /* physical walk */ +#define FTS_SEEDOT 0x020 /* return dot and dot-dot */ +#define FTS_XDEV 0x040 /* don't cross devices */ +#define FTS_WHITEOUT 0x080 /* (no longer supported) return whiteout information */ +#define FTS_COMFOLLOWDIR 0x400 /* (non-std) follow command line symlinks for directories only */ +#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000) +#define FTS_OPTIONMASK 0x4ff /* valid user option mask */ +#else +#define FTS_NOSTAT_TYPE 0x800 /* (non-std) no stat, but use d_type in struct dirent when available */ +#define FTS_OPTIONMASK 0xcff /* valid user option mask */ +#endif + +#define FTS_NAMEONLY 0x100 /* (private) child names only */ +#define FTS_STOP 0x200 /* (private) unrecoverable error */ +#ifdef __BLOCKS__ +#define FTS_BLOCK_COMPAR 0x80000000 /* fts_compar is a block */ +#endif /* __BLOCKS__ */ + int fts_options; /* fts_open options, global flags */ +} FTS; + +typedef struct _ftsent { + struct _ftsent *fts_cycle; /* cycle node */ + struct _ftsent *fts_parent; /* parent directory */ + struct _ftsent *fts_link; /* next file in directory */ + long fts_number; /* local numeric value */ + void *fts_pointer; /* local address value */ + char *fts_accpath; /* access path */ + char *fts_path; /* root path */ + int fts_errno; /* errno for this node */ + int fts_symfd; /* fd for symlink */ + unsigned short fts_pathlen; /* strlen(fts_path) */ + unsigned short fts_namelen; /* strlen(fts_name) */ + + ino_t fts_ino; /* inode */ + dev_t fts_dev; /* device */ + nlink_t fts_nlink; /* link count */ + +#define FTS_ROOTPARENTLEVEL -1 +#define FTS_ROOTLEVEL 0 +#define FTS_MAXLEVEL 0x7fffffff + short fts_level; /* depth (-1 to N) */ + +#define FTS_D 1 /* preorder directory */ +#define FTS_DC 2 /* directory that causes cycles */ +#define FTS_DEFAULT 3 /* none of the above */ +#define FTS_DNR 4 /* unreadable directory */ +#define FTS_DOT 5 /* dot or dot-dot */ +#define FTS_DP 6 /* postorder directory */ +#define FTS_ERR 7 /* error; errno is set */ +#define FTS_F 8 /* regular file */ +#define FTS_INIT 9 /* initialized only */ +#define FTS_NS 10 /* stat(2) failed */ +#define FTS_NSOK 11 /* no stat(2) requested */ +#define FTS_SL 12 /* symbolic link */ +#define FTS_SLNONE 13 /* symbolic link without target */ +#define FTS_W 14 /* whiteout object */ + unsigned short fts_info; /* user flags for FTSENT structure */ + +#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */ +#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */ +#define FTS_ISW 0x04 /* this is a whiteout object */ + unsigned short fts_flags; /* private flags for FTSENT structure */ + +#define FTS_AGAIN 1 /* read node again */ +#define FTS_FOLLOW 2 /* follow symbolic link */ +#define FTS_NOINSTR 3 /* no instructions */ +#define FTS_SKIP 4 /* discard node */ + unsigned short fts_instr; /* fts_set() instructions */ + + struct stat *fts_statp; /* stat(2) information */ + char fts_name[1]; /* file name */ +} FTSENT; + +#include +#include + +__BEGIN_DECLS +FTSENT *fts_children(FTS *, int) __DARWIN_INODE64(fts_children); +int fts_close(FTS *) __DARWIN_INODE64(fts_close); +FTS *fts_open(char * const *, int, + int (*)(const FTSENT **, const FTSENT **)) __DARWIN_INODE64(fts_open); +#ifdef __BLOCKS__ +#if __has_attribute(noescape) +#define __fts_noescape __attribute__((__noescape__)) +#else +#define __fts_noescape +#endif +FTS *fts_open_b(char * const *, int, + int (^)(const FTSENT **, const FTSENT **) __fts_noescape) + __DARWIN_INODE64(fts_open_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +FTSENT *fts_read(FTS *) __DARWIN_INODE64(fts_read); +int fts_set(FTS *, FTSENT *, int) __DARWIN_INODE64(fts_set); +__END_DECLS + +#pragma clang diagnostic pop +#endif /* !_FTS_H_ */ + diff --git a/include/ftw.h b/include/ftw.h new file mode 100644 index 0000000..acf0bc5 --- /dev/null +++ b/include/ftw.h @@ -0,0 +1,60 @@ +/* $OpenBSD: ftw.h,v 1.1 2003/07/21 21:13:18 millert Exp $ */ + +/* + * Copyright (c) 2003 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ + +#ifndef _FTW_H +#define _FTW_H + +#include + +/* + * Valid flags for the 3rd argument to the function that is passed as the + * second argument to ftw(3) and nftw(3). Say it three times fast! + */ +#define FTW_F 0 /* File. */ +#define FTW_D 1 /* Directory. */ +#define FTW_DNR 2 /* Directory without read permission. */ +#define FTW_DP 3 /* Directory with subdirectories visited. */ +#define FTW_NS 4 /* Unknown type; stat() failed. */ +#define FTW_SL 5 /* Symbolic link. */ +#define FTW_SLN 6 /* Sym link that names a nonexistent file. */ + +/* + * Flags for use as the 4th argument to nftw(3). These may be ORed together. + */ +#define FTW_PHYS 0x01 /* Physical walk, don't follow sym links. */ +#define FTW_MOUNT 0x02 /* The walk does not cross a mount point. */ +#define FTW_DEPTH 0x04 /* Subdirs visited before the dir itself. */ +#define FTW_CHDIR 0x08 /* Change to a directory before reading it. */ + +struct FTW { + int base; + int level; +}; + +__BEGIN_DECLS +int ftw(const char *, int (*)(const char *, const struct stat *, int), int) + __DARWIN_ALIAS_I(ftw); +int nftw(const char *, int (*)(const char *, const struct stat *, int, + struct FTW *), int, int) __DARWIN_ALIAS_I(nftw); +__END_DECLS + +#endif /* !_FTW_H */ diff --git a/include/get_compat.h b/include/get_compat.h new file mode 120000 index 0000000..1bfa2e8 --- /dev/null +++ b/include/get_compat.h @@ -0,0 +1 @@ +../gen/get_compat.h \ No newline at end of file diff --git a/include/getopt.h b/include/getopt.h new file mode 100644 index 0000000..3247fe0 --- /dev/null +++ b/include/getopt.h @@ -0,0 +1,86 @@ +/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */ +/* $FreeBSD: src/include/getopt.h,v 1.6 2004/02/24 08:09:20 ache Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dieter Baron and Thomas Klausner. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _GETOPT_H_ +#define _GETOPT_H_ + +#include +#include + +/* + * GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension. + * getopt() is declared here too for GNU programs. + */ +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +struct option { + /* name of long option */ + const char *name; + /* + * one of no_argument, required_argument, and optional_argument: + * whether option takes an argument + */ + int has_arg; + /* if not NULL, set *flag to val when option found */ + int *flag; + /* if flag not NULL, value to set *flag to; else return value */ + int val; +}; + +__BEGIN_DECLS +int getopt_long(int, char * const *, const char *, + const struct option *, int *); +int getopt_long_only(int, char * const *, const char *, + const struct option *, int *); +#ifndef _GETOPT +#define _GETOPT +int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); + +extern char *optarg; /* getopt(3) external variables */ +extern int optind, opterr, optopt; +#endif +#ifndef _OPTRESET +#define _OPTRESET +extern int optreset; /* getopt(3) external variable */ +#endif +__END_DECLS + +#endif /* !_GETOPT_H_ */ diff --git a/include/glob.h b/include/glob.h new file mode 100644 index 0000000..50881d7 --- /dev/null +++ b/include/glob.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Guido van Rossum. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)glob.h 8.1 (Berkeley) 6/2/93 + * $FreeBSD: /repoman/r/ncvs/src/include/glob.h,v 1.7 2002/07/17 04:58:09 mikeh Exp $ + */ + +#ifndef _GLOB_H_ +#define _GLOB_H_ + +#include <_types.h> +#include +#include +#include + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +struct dirent; +struct stat; +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +typedef struct { + size_t gl_pathc; /* Count of total paths so far. */ + int gl_matchc; /* Count of paths matching pattern. */ + size_t gl_offs; /* Reserved at beginning of gl_pathv. */ + int gl_flags; /* Copy of flags parameter to glob. */ + char **gl_pathv; /* List of paths matching pattern. */ + /* Copy of errfunc parameter to glob. */ +#ifdef __BLOCKS__ + union { +#endif /* __BLOCKS__ */ + int (*gl_errfunc)(const char *, int); +#ifdef __BLOCKS__ + int (^gl_errblk)(const char *, int); + }; +#endif /* __BLOCKS__ */ + + /* + * Alternate filesystem access methods for glob; replacement + * versions of closedir(3), readdir(3), opendir(3), stat(2) + * and lstat(2). + */ + void (*gl_closedir)(void *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + struct dirent *(*gl_readdir)(void *); +#else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + void *(*gl_readdir)(void *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + void *(*gl_opendir)(const char *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + int (*gl_lstat)(const char *, struct stat *); + int (*gl_stat)(const char *, struct stat *); +#else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + int (*gl_lstat)(const char *, void *); + int (*gl_stat)(const char *, void *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +} glob_t; + +/* Believed to have been introduced in 1003.2-1992 */ +#define GLOB_APPEND 0x0001 /* Append to output from previous call. */ +#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */ +#define GLOB_ERR 0x0004 /* Return on error. */ +#define GLOB_MARK 0x0008 /* Append / to matching directories. */ +#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */ +#define GLOB_NOSORT 0x0020 /* Don't sort. */ +#define GLOB_NOESCAPE 0x2000 /* Disable backslash escaping. */ + +/* Error values returned by glob(3) */ +#define GLOB_NOSPACE (-1) /* Malloc call failed. */ +#define GLOB_ABORTED (-2) /* Unignored error. */ +#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */ +#define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */ + +#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ +#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ +#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ +#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ +#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ +#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ +#define GLOB_LIMIT 0x1000 /* limit number of returned paths */ +#ifdef __BLOCKS__ +#define _GLOB_ERR_BLOCK 0x80000000 /* (internal) error callback is a block */ +#endif /* __BLOCKS__ */ + +/* source compatibility, these are the old names */ +#define GLOB_MAXPATH GLOB_LIMIT +#define GLOB_ABEND GLOB_ABORTED + +__BEGIN_DECLS +int glob(const char * __restrict, int, int (*)(const char *, int), + glob_t * __restrict) __DARWIN_INODE64(glob); +#ifdef __BLOCKS__ +#if __has_attribute(noescape) +#define __glob_noescape __attribute__((__noescape__)) +#else +#define __glob_noescape +#endif +int glob_b(const char * __restrict, int, int (^)(const char *, int) __glob_noescape, + glob_t * __restrict) __DARWIN_INODE64(glob_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +void globfree(glob_t *); +__END_DECLS + +#endif /* !_GLOB_H_ */ diff --git a/include/inttypes.h b/include/inttypes.h new file mode 100644 index 0000000..c29873d --- /dev/null +++ b/include/inttypes.h @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2000-2004, 2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * -- Standard C header, defined in ISO/IEC 9899:1999 + * (aka "C99"), section 7.8. This defines format string conversion + * specifiers suitable for use within arguments to fprintf and fscanf + * and their ilk. + */ + +#if !defined(_INTTYPES_H_) +#define _INTTYPES_H_ + +# define __PRI_8_LENGTH_MODIFIER__ "hh" +# define __PRI_64_LENGTH_MODIFIER__ "ll" +# define __SCN_64_LENGTH_MODIFIER__ "ll" +# define __PRI_MAX_LENGTH_MODIFIER__ "j" +# define __SCN_MAX_LENGTH_MODIFIER__ "j" + +# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d" +# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i" +# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o" +# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u" +# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x" +# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X" + +# define PRId16 "hd" +# define PRIi16 "hi" +# define PRIo16 "ho" +# define PRIu16 "hu" +# define PRIx16 "hx" +# define PRIX16 "hX" + +# define PRId32 "d" +# define PRIi32 "i" +# define PRIo32 "o" +# define PRIu32 "u" +# define PRIx32 "x" +# define PRIX32 "X" + +# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d" +# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i" +# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o" +# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u" +# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x" +# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X" + +# define PRIdLEAST8 PRId8 +# define PRIiLEAST8 PRIi8 +# define PRIoLEAST8 PRIo8 +# define PRIuLEAST8 PRIu8 +# define PRIxLEAST8 PRIx8 +# define PRIXLEAST8 PRIX8 + +# define PRIdLEAST16 PRId16 +# define PRIiLEAST16 PRIi16 +# define PRIoLEAST16 PRIo16 +# define PRIuLEAST16 PRIu16 +# define PRIxLEAST16 PRIx16 +# define PRIXLEAST16 PRIX16 + +# define PRIdLEAST32 PRId32 +# define PRIiLEAST32 PRIi32 +# define PRIoLEAST32 PRIo32 +# define PRIuLEAST32 PRIu32 +# define PRIxLEAST32 PRIx32 +# define PRIXLEAST32 PRIX32 + +# define PRIdLEAST64 PRId64 +# define PRIiLEAST64 PRIi64 +# define PRIoLEAST64 PRIo64 +# define PRIuLEAST64 PRIu64 +# define PRIxLEAST64 PRIx64 +# define PRIXLEAST64 PRIX64 + +# define PRIdFAST8 PRId8 +# define PRIiFAST8 PRIi8 +# define PRIoFAST8 PRIo8 +# define PRIuFAST8 PRIu8 +# define PRIxFAST8 PRIx8 +# define PRIXFAST8 PRIX8 + +# define PRIdFAST16 PRId16 +# define PRIiFAST16 PRIi16 +# define PRIoFAST16 PRIo16 +# define PRIuFAST16 PRIu16 +# define PRIxFAST16 PRIx16 +# define PRIXFAST16 PRIX16 + +# define PRIdFAST32 PRId32 +# define PRIiFAST32 PRIi32 +# define PRIoFAST32 PRIo32 +# define PRIuFAST32 PRIu32 +# define PRIxFAST32 PRIx32 +# define PRIXFAST32 PRIX32 + +# define PRIdFAST64 PRId64 +# define PRIiFAST64 PRIi64 +# define PRIoFAST64 PRIo64 +# define PRIuFAST64 PRIu64 +# define PRIxFAST64 PRIx64 +# define PRIXFAST64 PRIX64 + +/* int32_t is 'int', but intptr_t is 'long'. */ +# define PRIdPTR "ld" +# define PRIiPTR "li" +# define PRIoPTR "lo" +# define PRIuPTR "lu" +# define PRIxPTR "lx" +# define PRIXPTR "lX" + +# define PRIdMAX __PRI_MAX_LENGTH_MODIFIER__ "d" +# define PRIiMAX __PRI_MAX_LENGTH_MODIFIER__ "i" +# define PRIoMAX __PRI_MAX_LENGTH_MODIFIER__ "o" +# define PRIuMAX __PRI_MAX_LENGTH_MODIFIER__ "u" +# define PRIxMAX __PRI_MAX_LENGTH_MODIFIER__ "x" +# define PRIXMAX __PRI_MAX_LENGTH_MODIFIER__ "X" + +# define SCNd8 __PRI_8_LENGTH_MODIFIER__ "d" +# define SCNi8 __PRI_8_LENGTH_MODIFIER__ "i" +# define SCNo8 __PRI_8_LENGTH_MODIFIER__ "o" +# define SCNu8 __PRI_8_LENGTH_MODIFIER__ "u" +# define SCNx8 __PRI_8_LENGTH_MODIFIER__ "x" + +# define SCNd16 "hd" +# define SCNi16 "hi" +# define SCNo16 "ho" +# define SCNu16 "hu" +# define SCNx16 "hx" + +# define SCNd32 "d" +# define SCNi32 "i" +# define SCNo32 "o" +# define SCNu32 "u" +# define SCNx32 "x" + +# define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d" +# define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i" +# define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o" +# define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u" +# define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x" + +# define SCNdLEAST8 SCNd8 +# define SCNiLEAST8 SCNi8 +# define SCNoLEAST8 SCNo8 +# define SCNuLEAST8 SCNu8 +# define SCNxLEAST8 SCNx8 + +# define SCNdLEAST16 SCNd16 +# define SCNiLEAST16 SCNi16 +# define SCNoLEAST16 SCNo16 +# define SCNuLEAST16 SCNu16 +# define SCNxLEAST16 SCNx16 + +# define SCNdLEAST32 SCNd32 +# define SCNiLEAST32 SCNi32 +# define SCNoLEAST32 SCNo32 +# define SCNuLEAST32 SCNu32 +# define SCNxLEAST32 SCNx32 + +# define SCNdLEAST64 SCNd64 +# define SCNiLEAST64 SCNi64 +# define SCNoLEAST64 SCNo64 +# define SCNuLEAST64 SCNu64 +# define SCNxLEAST64 SCNx64 + +# define SCNdFAST8 SCNd8 +# define SCNiFAST8 SCNi8 +# define SCNoFAST8 SCNo8 +# define SCNuFAST8 SCNu8 +# define SCNxFAST8 SCNx8 + +# define SCNdFAST16 SCNd16 +# define SCNiFAST16 SCNi16 +# define SCNoFAST16 SCNo16 +# define SCNuFAST16 SCNu16 +# define SCNxFAST16 SCNx16 + +# define SCNdFAST32 SCNd32 +# define SCNiFAST32 SCNi32 +# define SCNoFAST32 SCNo32 +# define SCNuFAST32 SCNu32 +# define SCNxFAST32 SCNx32 + +# define SCNdFAST64 SCNd64 +# define SCNiFAST64 SCNi64 +# define SCNoFAST64 SCNo64 +# define SCNuFAST64 SCNu64 +# define SCNxFAST64 SCNx64 + +# define SCNdPTR "ld" +# define SCNiPTR "li" +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" + +# define SCNdMAX __SCN_MAX_LENGTH_MODIFIER__ "d" +# define SCNiMAX __SCN_MAX_LENGTH_MODIFIER__ "i" +# define SCNoMAX __SCN_MAX_LENGTH_MODIFIER__ "o" +# define SCNuMAX __SCN_MAX_LENGTH_MODIFIER__ "u" +# define SCNxMAX __SCN_MAX_LENGTH_MODIFIER__ "x" + +#include +#include + +#include <_types.h> +#include + +#include + +__BEGIN_DECLS + +/* 7.8.2.1 */ +__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) +extern intmax_t +imaxabs(intmax_t j); + +/* 7.8.2.2 */ +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; + +__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) +extern imaxdiv_t +imaxdiv(intmax_t __numer, intmax_t __denom); + +/* 7.8.2.3 */ +__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) +extern intmax_t +strtoimax(const char * __restrict __nptr, + char ** __restrict __endptr, + int __base); + +__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) +extern uintmax_t +strtoumax(const char * __restrict __nptr, + char ** __restrict __endptr, + int __base); + +/* 7.8.2.4 */ +__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) +extern intmax_t +wcstoimax(const wchar_t * __restrict __nptr, + wchar_t ** __restrict __endptr, + int __base); + +__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) +extern uintmax_t +wcstoumax(const wchar_t * __restrict __nptr, + wchar_t ** __restrict __endptr, + int __base); + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison wcstoimax wcstoumax +#endif + +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +/* + No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros; + in fact, you can't #undef them, because later uses of any of + their dependents will *not* then do the intended substitution. + Expansion of a #define like this one: + + #define x IDENT y + + uses the cpp value of IDENT at the location where x is *expanded*, + not where it is #defined. +*/ + +#endif /* !_INTTYPES_H_ */ diff --git a/include/iso646.h b/include/iso646.h new file mode 100644 index 0000000..71cf9b5 --- /dev/null +++ b/include/iso646.h @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 1998 Alex Nash + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/include/iso646.h,v 1.4 2002/09/18 22:23:59 mike Exp $ + */ + +#ifndef _ISO646_H_ +#define _ISO646_H_ + +#include + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#ifndef __cplusplus +#define and && +#define and_eq &= +#define bitand & +#define bitor | +#define compl ~ +#define not ! +#define not_eq != +#define or || +#define or_eq |= +#define xor ^ +#define xor_eq ^= +#endif /* ! __cplusplus */ + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#endif /* !_ISO646_H_ */ diff --git a/include/kvm.h b/include/kvm.h new file mode 100644 index 0000000..fa9fce0 --- /dev/null +++ b/include/kvm.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)kvm.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _KVM_H_ +#define _KVM_H_ + +/* Default version symbol. */ +#define VRS_SYM "_version" +#define VRS_KEY "VERSION" + +#include +#include + +__BEGIN_DECLS + +typedef struct __kvm kvm_t; + +struct kinfo_proc; +int kvm_close(kvm_t *); +char **kvm_getargv(kvm_t *, const struct kinfo_proc *, int); +char **kvm_getenvv(kvm_t *, const struct kinfo_proc *, int); +char *kvm_geterr(kvm_t *); +int kvm_getloadavg(kvm_t *, double [], int); +char *kvm_getfiles(kvm_t *, int, int, int *); +struct kinfo_proc * + kvm_getprocs(kvm_t *, int, int, int *); +int kvm_nlist(kvm_t *, struct nlist *); +kvm_t *kvm_open + (const char *, const char *, const char *, int, const char *); +kvm_t *kvm_openfiles + (const char *, const char *, const char *, int, char *); +int kvm_read(kvm_t *, unsigned long, void *, unsigned int); +int kvm_write(kvm_t *, unsigned long, const void *, unsigned int); + +__END_DECLS + +#endif /* !_KVM_H_ */ diff --git a/include/langinfo.h b/include/langinfo.h new file mode 100644 index 0000000..a7a3b2b --- /dev/null +++ b/include/langinfo.h @@ -0,0 +1,120 @@ +/*- + * Copyright (c) 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: /repoman/r/ncvs/src/include/langinfo.h,v 1.6 2002/09/18 05:54:25 mike Exp $ + */ + +#ifndef _LANGINFO_H_ +#define _LANGINFO_H_ + +#include <_types.h> +#include <_types/_nl_item.h> + +#define CODESET 0 /* codeset name */ +#define D_T_FMT 1 /* string for formatting date and time */ +#define D_FMT 2 /* date format string */ +#define T_FMT 3 /* time format string */ +#define T_FMT_AMPM 4 /* a.m. or p.m. time formatting string */ +#define AM_STR 5 /* Ante Meridian affix */ +#define PM_STR 6 /* Post Meridian affix */ + +/* week day names */ +#define DAY_1 7 +#define DAY_2 8 +#define DAY_3 9 +#define DAY_4 10 +#define DAY_5 11 +#define DAY_6 12 +#define DAY_7 13 + +/* abbreviated week day names */ +#define ABDAY_1 14 +#define ABDAY_2 15 +#define ABDAY_3 16 +#define ABDAY_4 17 +#define ABDAY_5 18 +#define ABDAY_6 19 +#define ABDAY_7 20 + +/* month names */ +#define MON_1 21 +#define MON_2 22 +#define MON_3 23 +#define MON_4 24 +#define MON_5 25 +#define MON_6 26 +#define MON_7 27 +#define MON_8 28 +#define MON_9 29 +#define MON_10 30 +#define MON_11 31 +#define MON_12 32 + +/* abbreviated month names */ +#define ABMON_1 33 +#define ABMON_2 34 +#define ABMON_3 35 +#define ABMON_4 36 +#define ABMON_5 37 +#define ABMON_6 38 +#define ABMON_7 39 +#define ABMON_8 40 +#define ABMON_9 41 +#define ABMON_10 42 +#define ABMON_11 43 +#define ABMON_12 44 + +#define ERA 45 /* era description segments */ +#define ERA_D_FMT 46 /* era date format string */ +#define ERA_D_T_FMT 47 /* era date and time format string */ +#define ERA_T_FMT 48 /* era time format string */ +#define ALT_DIGITS 49 /* alternative symbols for digits */ + +#define RADIXCHAR 50 /* radix char */ +#define THOUSEP 51 /* separator for thousands */ + +#define YESEXPR 52 /* affirmative response expression */ +#define NOEXPR 53 /* negative response expression */ + +#if (__DARWIN_C_LEVEL > __DARWIN_C_ANSI && __DARWIN_C_LEVEL < 200112L) || __DARWIN_C_LEVEL == __DARWIN_C_FULL +#define YESSTR 54 /* affirmative response for yes/no queries */ +#define NOSTR 55 /* negative response for yes/no queries */ +#endif + +#define CRNCYSTR 56 /* currency symbol */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define D_MD_ORDER 57 /* month/day order (local extension) */ +#endif + +__BEGIN_DECLS +char *nl_langinfo(nl_item); +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_LANGINFO_H_ */ diff --git a/include/libc.h b/include/libc.h new file mode 100644 index 0000000..7880986 --- /dev/null +++ b/include/libc.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved + */ + +#ifndef _LIBC_H +#define _LIBC_H + +#include +#include + +#ifdef __STRICT_BSD__ +#include +#include +#else +#include +#include +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct qelem { + struct qelem *q_forw; + struct qelem *q_back; + char *q_data; +}; + +#include + +__BEGIN_DECLS +extern kern_return_t map_fd(int fd, vm_offset_t offset, + vm_offset_t *addr, boolean_t find_space, vm_size_t numbytes); +__END_DECLS + +#endif /* _LIBC_H */ diff --git a/include/libgen.h b/include/libgen.h new file mode 100644 index 0000000..4200fc6 --- /dev/null +++ b/include/libgen.h @@ -0,0 +1,63 @@ +/* $OpenBSD: libgen.h,v 1.4 1999/05/28 22:00:22 espie Exp $ */ +/* $FreeBSD: src/include/libgen.h,v 1.1.2.1 2000/11/12 18:01:51 adrian Exp $ */ + +/* + * Copyright (c) 1997 Todd C. Miller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _LIBGEN_H_ +#define _LIBGEN_H_ + +#include + +__BEGIN_DECLS + +#if __DARWIN_UNIX03 + +char *basename(char *); +char *dirname(char *); + +#else /* !__DARWIN_UNIX03 */ + +char *basename(const char *); +char *dirname(const char *); + +#endif /* __DARWIN_UNIX_03 */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#include +char *basename_r(const char *, char *) + __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); + +char *dirname_r(const char *, char *) + __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +__END_DECLS + +#endif /* _LIBGEN_H_ */ diff --git a/include/libkern/OSThermalNotification.h b/include/libkern/OSThermalNotification.h new file mode 100644 index 0000000..e8581cc --- /dev/null +++ b/include/libkern/OSThermalNotification.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _OSTHERMALNOTIFICATION_H_ +#define _OSTHERMALNOTIFICATION_H_ + +#include +#include + +/* +** OSThermalNotification.h +** +** Notification mechanism to alert registered tasks when device thermal conditions +** reach certain thresholds. Notifications are triggered in both directions +** so clients can manage their memory usage more and less aggressively. +** +*/ + +__BEGIN_DECLS + +/* Define pressure levels usable by OSThermalPressureLevel */ +typedef enum { +#if TARGET_OS_OSX || TARGET_OS_IOSMAC + kOSThermalPressureLevelNominal = 0, + kOSThermalPressureLevelModerate, + kOSThermalPressureLevelHeavy, + kOSThermalPressureLevelTrapping, + kOSThermalPressureLevelSleeping +#else + kOSThermalPressureLevelNominal = 0, + kOSThermalPressureLevelLight = 10, + kOSThermalPressureLevelModerate = 20, + kOSThermalPressureLevelHeavy = 30, + kOSThermalPressureLevelTrapping = 40, + kOSThermalPressureLevelSleeping = 50 +#endif +} OSThermalPressureLevel; + +/* + ** External notify(3) string for thermal pressure level notification + */ +__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0) +extern const char * const kOSThermalNotificationPressureLevelName; + + +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && \ + __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_2_0 + +typedef enum { + OSThermalNotificationLevelAny = -1, + OSThermalNotificationLevelNormal = 0, +} OSThermalNotificationLevel; + +extern OSThermalNotificationLevel _OSThermalNotificationLevelForBehavior(int) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_2); +extern void _OSThermalNotificationSetLevelForBehavior(int, int) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_2); + +enum { + kOSThermalMitigationNone, + kOSThermalMitigation70PercentTorch, + kOSThermalMitigation70PercentBacklight, + kOSThermalMitigation50PercentTorch, + kOSThermalMitigation50PercentBacklight, + kOSThermalMitigationDisableTorch, + kOSThermalMitigation25PercentBacklight, + kOSThermalMitigationDisableMapsHalo, + kOSThermalMitigationAppTerminate, + kOSThermalMitigationDeviceRestart, + kOSThermalMitigationThermalTableReady, + kOSThermalMitigationCount +}; + +#define OSThermalNotificationLevel70PercentTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigation70PercentTorch) +#define OSThermalNotificationLevel70PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation70PercentBacklight) +#define OSThermalNotificationLevel50PercentTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigation50PercentTorch) +#define OSThermalNotificationLevel50PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation50PercentBacklight) +#define OSThermalNotificationLevelDisableTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDisableTorch) +#define OSThermalNotificationLevel25PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation25PercentBacklight) +#define OSThermalNotificationLevelDisableMapsHalo _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDisableMapsHalo) +#define OSThermalNotificationLevelAppTerminate _OSThermalNotificationLevelForBehavior(kOSThermalMitigationAppTerminate) +#define OSThermalNotificationLevelDeviceRestart _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDeviceRestart) + +/* Backwards compatibility */ +#define OSThermalNotificationLevelWarning OSThermalNotificationLevel70PercentBacklight +#define OSThermalNotificationLevelUrgent OSThermalNotificationLevelAppTerminate +#define OSThermalNotificationLevelCritical OSThermalNotificationLevelDeviceRestart + +/* +** Simple polling interface to detect current thermal level +*/ +__OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_2_0) +extern OSThermalNotificationLevel OSThermalNotificationCurrentLevel(void); + +/* +** External notify(3) string for manual notification setup +*/ +__OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_2_0) +extern const char * const kOSThermalNotificationName; + +/* +** External notify(3) string for alerting user of a thermal condition +*/ +__OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_6_0) +extern const char * const kOSThermalNotificationAlert; + +/* +** External notify(3) string for notifying system the options taken to resolve thermal condition +*/ +__OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_6_0) +extern const char * const kOSThermalNotificationDecision; + +#endif // __IPHONE_OS_VERSION_MIN_REQUIRED + +__END_DECLS + +#endif /* _OSTHERMALNOTIFICATION_H_ */ diff --git a/include/limits.h b/include/limits.h new file mode 100644 index 0000000..5917cca --- /dev/null +++ b/include/limits.h @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2000, 2004-2007, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: limits.h,v 1.8 1996/10/21 05:10:50 jtc Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)limits.h 8.2 (Berkeley) 1/4/94 + */ + +#ifndef _LIMITS_H_ +#define _LIMITS_H_ + +#include +#include +#ifndef UNIFDEF_DRIVERKIT +#include + +#if __DARWIN_C_LEVEL > __DARWIN_C_ANSI +#define _POSIX_ARG_MAX 4096 +#define _POSIX_CHILD_MAX 25 +#define _POSIX_LINK_MAX 8 +#define _POSIX_MAX_CANON 255 +#define _POSIX_MAX_INPUT 255 +#define _POSIX_NAME_MAX 14 +#define _POSIX_NGROUPS_MAX 8 +#define _POSIX_OPEN_MAX 20 +#define _POSIX_PATH_MAX 256 +#define _POSIX_PIPE_BUF 512 +#define _POSIX_SSIZE_MAX 32767 +#define _POSIX_STREAM_MAX 8 +#define _POSIX_TZNAME_MAX 6 + +#define _POSIX2_BC_BASE_MAX 99 +#define _POSIX2_BC_DIM_MAX 2048 +#define _POSIX2_BC_SCALE_MAX 99 +#define _POSIX2_BC_STRING_MAX 1000 +#define _POSIX2_EQUIV_CLASS_MAX 2 +#define _POSIX2_EXPR_NEST_MAX 32 +#define _POSIX2_LINE_MAX 2048 +#define _POSIX2_RE_DUP_MAX 255 +#endif /* __DARWIN_C_LEVEL > __DARWIN_C_ANSI */ + +#if __DARWIN_C_LEVEL >= 199309L +#define _POSIX_AIO_LISTIO_MAX 2 +#define _POSIX_AIO_MAX 1 +#define _POSIX_DELAYTIMER_MAX 32 +#define _POSIX_MQ_OPEN_MAX 8 +#define _POSIX_MQ_PRIO_MAX 32 +#define _POSIX_RTSIG_MAX 8 +#define _POSIX_SEM_NSEMS_MAX 256 +#define _POSIX_SEM_VALUE_MAX 32767 +#define _POSIX_SIGQUEUE_MAX 32 +#define _POSIX_TIMER_MAX 32 + +#define _POSIX_CLOCKRES_MIN 20000000 +#endif /* __DARWIN_C_LEVEL >= 199309L */ + +#if __DARWIN_C_LEVEL >= 199506L +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 +#define _POSIX_THREAD_KEYS_MAX 128 +#define _POSIX_THREAD_THREADS_MAX 64 + +#define PTHREAD_DESTRUCTOR_ITERATIONS 4 +#define PTHREAD_KEYS_MAX 512 +#if defined(__arm__) || defined(__arm64__) +#define PTHREAD_STACK_MIN 16384 +#else +#define PTHREAD_STACK_MIN 8192 +#endif +#endif /* __DARWIN_C_LEVEL >= 199506L */ + +#if __DARWIN_C_LEVEL >= 200112 +#define _POSIX_HOST_NAME_MAX 255 +#define _POSIX_LOGIN_NAME_MAX 9 +#define _POSIX_SS_REPL_MAX 4 +#define _POSIX_SYMLINK_MAX 255 +#define _POSIX_SYMLOOP_MAX 8 +#define _POSIX_TRACE_EVENT_NAME_MAX 30 +#define _POSIX_TRACE_NAME_MAX 8 +#define _POSIX_TRACE_SYS_MAX 8 +#define _POSIX_TRACE_USER_EVENT_MAX 32 +#define _POSIX_TTY_NAME_MAX 9 +#define _POSIX2_CHARCLASS_NAME_MAX 14 +#define _POSIX2_COLL_WEIGHTS_MAX 2 + +#define _POSIX_RE_DUP_MAX _POSIX2_RE_DUP_MAX +#endif /* __DARWIN_C_LEVEL >= 200112 */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define OFF_MIN LLONG_MIN /* min value for an off_t */ +#define OFF_MAX LLONG_MAX /* max value for an off_t */ +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +/* Actually for XSI Visible */ +#if __DARWIN_C_LEVEL > __DARWIN_C_ANSI + +/* Removed in Issue 6 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L +#define PASS_MAX 128 +#endif + +#define NL_ARGMAX 9 +#define NL_LANGMAX 14 +#define NL_MSGMAX 32767 +#define NL_NMAX 1 +#define NL_SETMAX 255 +#define NL_TEXTMAX 2048 + +#define _XOPEN_IOV_MAX 16 +#define IOV_MAX 1024 +#define _XOPEN_NAME_MAX 255 +#define _XOPEN_PATH_MAX 1024 + +#endif /* __DARWIN_C_LEVEL > __DARWIN_C_ANSI */ + +/* NZERO to be defined here. TBD. See also sys/param.h */ +#endif /* UNIFDEF_DRIVERKIT */ + +#endif /* !_LIMITS_H_ */ diff --git a/include/locale.h b/include/locale.h new file mode 100644 index 0000000..ab28ceb --- /dev/null +++ b/include/locale.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)locale.h 8.1 (Berkeley) 6/2/93 + * $FreeBSD: /repoman/r/ncvs/src/include/locale.h,v 1.7 2002/10/09 09:19:27 tjr Exp $ + */ + +#ifndef _LOCALE_H_ +#define _LOCALE_H_ + +#include <_locale.h> + +#define LC_ALL 0 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_MONETARY 3 +#define LC_NUMERIC 4 +#define LC_TIME 5 +#define LC_MESSAGES 6 + +#define _LC_LAST 7 /* marks end */ + +__BEGIN_DECLS +char *setlocale(int, const char *); +__END_DECLS + +#endif /* _LOCALE_H_ */ diff --git a/include/memory.h b/include/memory.h new file mode 100644 index 0000000..cb9c8b5 --- /dev/null +++ b/include/memory.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)memory.h 8.1 (Berkeley) 6/2/93 + */ + +#include diff --git a/include/monetary.h b/include/monetary.h new file mode 100644 index 0000000..a32f404 --- /dev/null +++ b/include/monetary.h @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: /repoman/r/ncvs/src/include/monetary.h,v 1.7 2002/09/20 08:22:48 mike Exp $ + */ + +#ifndef _MONETARY_H_ +#define _MONETARY_H_ + +#include +#include <_types.h> +#include +#include + +__BEGIN_DECLS +ssize_t strfmon(char *, size_t, const char *, ...); +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_MONETARY_H_ */ diff --git a/include/monitor.h b/include/monitor.h new file mode 100644 index 0000000..c4d0a2d --- /dev/null +++ b/include/monitor.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988 NeXT, Inc. + * + * HISTORY + * 04-May-90 Created + */ + +#ifndef __MONITOR_HEADER__ +#define __MONITOR_HEADER__ + +#include +#include + +__BEGIN_DECLS + +__OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0,__MAC_10_11,__IPHONE_2_0,__IPHONE_9_0, "Monitor is no longer supported.") +__WATCHOS_PROHIBITED +extern void monstartup (char *lowpc, char *highpc); + +__OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0,__MAC_10_11,__IPHONE_2_0,__IPHONE_9_0, "Monitor is no longer supported.") +__WATCHOS_PROHIBITED +extern void monitor (char *lowpc, char *highpc, char *buf, int bufsiz, int cntsiz); + +__OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0,__MAC_10_11,__IPHONE_2_0,__IPHONE_9_0, "Monitor is no longer supported.") +__WATCHOS_PROHIBITED +extern void moncontrol (int mode); + +__OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0,__MAC_10_11,__IPHONE_2_0,__IPHONE_9_0, "Monitor is no longer supported.") +__WATCHOS_PROHIBITED +extern void monoutput (const char *filename); + +__OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0,__MAC_10_11,__IPHONE_2_0,__IPHONE_9_0, "Monitor is no longer supported.") +__WATCHOS_PROHIBITED +extern void moninit (void); + +__OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0,__MAC_10_11,__IPHONE_2_0,__IPHONE_9_0, "Monitor is no longer supported.") +__WATCHOS_PROHIBITED +extern void monreset (void); + +__END_DECLS + +#endif /* __MONITOR_HEADER__ */ diff --git a/include/mpool.h b/include/mpool.h new file mode 100644 index 0000000..eee1634 --- /dev/null +++ b/include/mpool.h @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)mpool.h 8.2 (Berkeley) 7/14/94 + * $FreeBSD: src/include/mpool.h,v 1.9 2002/03/23 17:24:53 imp Exp $ + */ + +#ifndef _MPOOL_H_ +#define _MPOOL_H_ + +#include + +/* + * The memory pool scheme is a simple one. Each in-memory page is referenced + * by a bucket which is threaded in up to two of three ways. All active pages + * are threaded on a hash chain (hashed by page number) and an lru chain. + * Inactive pages are threaded on a free chain. Each reference to a memory + * pool is handed an opaque MPOOL cookie which stores all of this information. + */ +#define HASHSIZE 128 +#define HASHKEY(pgno) ((pgno - 1) % HASHSIZE) + +/* The BKT structures are the elements of the queues. */ +typedef struct _bkt { + TAILQ_ENTRY(_bkt) hq; /* hash queue */ + TAILQ_ENTRY(_bkt) q; /* lru queue */ + void *page; /* page */ + pgno_t pgno; /* page number */ + +#define MPOOL_DIRTY 0x01 /* page needs to be written */ +#define MPOOL_PINNED 0x02 /* page is pinned into memory */ + u_int8_t flags; /* flags */ +} BKT; + +typedef struct MPOOL { + TAILQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */ + /* hash queue array */ + TAILQ_HEAD(_hqh, _bkt) hqh[HASHSIZE]; + pgno_t curcache; /* current number of cached pages */ + pgno_t maxcache; /* max number of cached pages */ + pgno_t npages; /* number of pages in the file */ + unsigned long pagesize; /* file page size */ + int fd; /* file descriptor */ + /* page in conversion routine */ + void (*pgin)(void *, pgno_t, void *); + /* page out conversion routine */ + void (*pgout)(void *, pgno_t, void *); + void *pgcookie; /* cookie for page in/out routines */ +#ifdef STATISTICS + unsigned long cachehit; + unsigned long cachemiss; + unsigned long pagealloc; + unsigned long pageflush; + unsigned long pageget; + unsigned long pagenew; + unsigned long pageput; + unsigned long pageread; + unsigned long pagewrite; +#endif +} MPOOL; + +__BEGIN_DECLS +MPOOL *mpool_open(void *, int, pgno_t, pgno_t); +void mpool_filter(MPOOL *, void (*)(void *, pgno_t, void *), + void (*)(void *, pgno_t, void *), void *); +void *mpool_new(MPOOL *, pgno_t *); +void *mpool_get(MPOOL *, pgno_t, unsigned int); +int mpool_put(MPOOL *, void *, unsigned int); +int mpool_sync(MPOOL *); +int mpool_close(MPOOL *); +#ifdef STATISTICS +void mpool_stat(MPOOL *); +#endif +__END_DECLS + +#endif diff --git a/include/ndbm.h b/include/ndbm.h new file mode 100644 index 0000000..b400c62 --- /dev/null +++ b/include/ndbm.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Margo Seltzer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ndbm.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _NDBM_H_ +#define _NDBM_H_ + +#include <_types.h> +#include +#include + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +/* Map dbm interface onto db(3). */ +#include +#define DBM_RDONLY O_RDONLY +#endif + +/* Flags to dbm_store(). */ +#define DBM_INSERT 0 +#define DBM_REPLACE 1 + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +/* + * The db(3) support for ndbm(3) always appends this suffix to the + * file name to avoid overwriting the user's original database. + */ +#define DBM_SUFFIX ".db" +#endif + +typedef struct { + void *dptr; + size_t dsize; +} datum; + +#ifndef _DBM +#define _DBM +typedef struct { + char __opaque[sizeof(int) + 8 * sizeof(void *)]; +} DBM; +#endif /* _DBM */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE +#endif + +__BEGIN_DECLS +int dbm_clearerr( DBM *); +void dbm_close(DBM *); +int dbm_delete(DBM *, datum); +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int dbm_dirfno(DBM *); +#endif +int dbm_error( DBM *); +datum dbm_fetch(DBM *, datum); +datum dbm_firstkey(DBM *); +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +long dbm_forder(DBM *, datum); +#endif +datum dbm_nextkey(DBM *); +DBM *dbm_open(const char *, int, mode_t); +int dbm_store(DBM *, datum, datum, int); +__END_DECLS + +#endif /* !_NDBM_H_ */ diff --git a/include/nlist.h b/include/nlist.h new file mode 100644 index 0000000..f337fa9 --- /dev/null +++ b/include/nlist.h @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)nlist.h 8.2 (Berkeley) 1/21/94 + */ + +#ifndef _NLIST_H_ +#define _NLIST_H_ + +/* + * Symbol table entry format. The #ifdef's are so that programs including + * nlist.h can initialize nlist structures statically. + */ +struct nlist { +#ifdef _AOUT_INCLUDE_ + union { + char *n_name; /* symbol name (in memory) */ + long n_strx; /* file string table offset (on disk) */ + } n_un; +#else + char *n_name; /* symbol name (in memory) */ +#endif + +#define N_UNDF 0x00 /* undefined */ +#define N_ABS 0x02 /* absolute address */ +#define N_TEXT 0x04 /* text segment */ +#define N_DATA 0x06 /* data segment */ +#define N_BSS 0x08 /* bss segment */ +#define N_COMM 0x12 /* common reference */ +#define N_FN 0x1e /* file name */ + +#define N_EXT 0x01 /* external (global) bit, OR'ed in */ +#define N_TYPE 0x1e /* mask for all the type bits */ + unsigned char n_type; /* type defines */ + + char n_other; /* spare */ +#define n_hash n_desc /* used internally by ld(1); XXX */ + short n_desc; /* used by stab entries */ + unsigned long n_value; /* address/value of the symbol */ +}; + +#define N_FORMAT "%08x" /* namelist value format; XXX */ +#define N_STAB 0x0e0 /* mask for debugger symbols -- stab(5) */ + +#include + +__BEGIN_DECLS +int nlist(const char *, struct nlist *); +__END_DECLS + +#endif /* !_NLIST_H_ */ diff --git a/include/os/activity.h b/include/os/activity.h new file mode 120000 index 0000000..156ae66 --- /dev/null +++ b/include/os/activity.h @@ -0,0 +1 @@ +../../os/activity.h \ No newline at end of file diff --git a/include/os/alloc_once_private.h b/include/os/alloc_once_private.h new file mode 120000 index 0000000..5625471 --- /dev/null +++ b/include/os/alloc_once_private.h @@ -0,0 +1 @@ +../../os/alloc_once_private.h \ No newline at end of file diff --git a/include/os/assumes.h b/include/os/assumes.h new file mode 120000 index 0000000..18508d4 --- /dev/null +++ b/include/os/assumes.h @@ -0,0 +1 @@ +../../os/assumes.h \ No newline at end of file diff --git a/include/os/debug_private.h b/include/os/debug_private.h new file mode 120000 index 0000000..4d4393d --- /dev/null +++ b/include/os/debug_private.h @@ -0,0 +1 @@ +../../os/debug_private.h \ No newline at end of file diff --git a/include/os/log.h b/include/os/log.h new file mode 120000 index 0000000..dab5e31 --- /dev/null +++ b/include/os/log.h @@ -0,0 +1 @@ +../../os/log.h \ No newline at end of file diff --git a/include/os/object.h b/include/os/object.h new file mode 120000 index 0000000..1216d1b --- /dev/null +++ b/include/os/object.h @@ -0,0 +1 @@ +../../os/object.h \ No newline at end of file diff --git a/include/os/overflow.h b/include/os/overflow.h new file mode 120000 index 0000000..acc25c6 --- /dev/null +++ b/include/os/overflow.h @@ -0,0 +1 @@ +../../os/overflow.h \ No newline at end of file diff --git a/include/paths.h b/include/paths.h new file mode 100644 index 0000000..3edd2b8 --- /dev/null +++ b/include/paths.h @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $OpenBSD: paths.h,v 1.10 1997/11/09 00:29:02 bri Exp $ */ +/* $NetBSD: paths.h,v 1.10 1997/04/23 09:41:38 lukem Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)paths.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _PATHS_H_ +#define _PATHS_H_ + +/* Default search path. */ +#define _PATH_DEFPATH "/usr/bin:/bin" +/* All standard utilities path. */ +#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" + +#define _PATH_BSHELL "/bin/sh" +#define _PATH_CONSOLE "/dev/console" +#define _PATH_CSHELL "/bin/csh" +#define _PATH_DEFTAPE "/dev/nrst0" +#define _PATH_DEVDB "/var/run/dev.db" +#define _PATH_DEVNULL "/dev/null" +#define _PATH_DRUM "/dev/drum" +#define _PATH_FSIRAND "/sbin/fsirand" +#define _PATH_KMEM "/dev/kmem" +#define _PATH_KVMDB "/var/db/kvm.db" +#define _PATH_LOCALE "/usr/share/locale" +#define _PATH_MAILDIR "/var/mail" +#define _PATH_MAN "/usr/share/man" +#define _PATH_MEM "/dev/mem" +#define _PATH_NOLOGIN "/etc/nologin" +#define _PATH_RSH "/usr/bin/rsh" +#define _PATH_SENDMAIL "/usr/sbin/sendmail" +#define _PATH_SHELLS "/etc/shells" +#define _PATH_TTY "/dev/tty" +#define _PATH_UNIX "/mach" +#define _PATH_VI "/usr/bin/vi" + +/* Provide trailing slash, since mostly used for building pathnames. */ +#define _PATH_DEV "/dev/" +#define _PATH_TMP "/tmp/" +#define _PATH_UUCPLOCK "/var/spool/lock/" +#define _PATH_VARDB "/var/db/" +#define _PATH_VARRUN "/var/run/" +#define _PATH_VARTMP "/var/tmp/" + +#include + +#endif /* !_PATHS_H_ */ diff --git a/include/poll.h b/include/poll.h new file mode 100644 index 0000000..75f90fe --- /dev/null +++ b/include/poll.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include + + + diff --git a/include/printf.h b/include/printf.h new file mode 100644 index 0000000..22eb9b7 --- /dev/null +++ b/include/printf.h @@ -0,0 +1,284 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/include/printf.h,v 1.5 2011/03/06 17:45:37 pjd Exp $ + */ + +#ifndef _PRINTF_H_ +#define _PRINTF_H_ + +/**************************************************************************** + * This is the header file for extensible printf, a set of APIs that allow + * adding/modifying conversion specifier(s) for stdio formatted printing. + * It is based on the GLIBC API documented in: + * + * http://www.gnu.org/software/libc/manual/html_node/Customizing-Printf.html + * + * Because that API affects printf behavior process-wide and so is unsafe, + * we adapt a modified form, based on the concept of printf domains in which + * changes to conversion specifiers can be made independent of one another + * and which don't affect the normal printf behavior. In addition, there + * is now a set of printf variants that take a printf domain as an argument. + * + * See xprintf(5) for more details. + ****************************************************************************/ + +#include +#include +#include +#include + +#ifdef __GNUC__ +#define __XPRINTF_ATTR(x) __attribute__(x) +#else /* !__GNUC__ */ +#define __XPRINTF_ATTR(x) /* nothing */ +#endif /* !__GNUC__ */ + +/* + * The API defined by GLIBC allows a renderer to take multiple arguments + * This is obviously usable for things like (ptr+len) pairs etc. + * The current limit is to deal with up to __PRINTFMAXARG arguments (any + * above this limit are ignored). + */ +#define __PRINTFMAXARG 2 + +struct printf_info { + /* Mac OS X extensions */ + void *context; /* User context pointer */ + locale_t loc; /* Extended locale */ + wchar_t vsep; /* Vector separator char */ + /* one of ,:;_ flag or X by default */ + + /* GLIBC compatible */ + int prec; /* precision */ + int width; /* Width */ + wchar_t spec; /* Format letter */ + wchar_t pad; /* Padding char */ + /* 0 if 0 flag set, otherwise space */ + + /* FreeBSD extensions */ + wchar_t signchar; /* Sign char */ + + /* GLIBC compatible flags */ + unsigned is_long_double :1; /* L or ll flag */ + unsigned is_char :1; /* hh flag */ + unsigned is_short :1; /* h flag */ + unsigned is_long :1; /* l flag */ + unsigned alt :1; /* # flag */ + unsigned space :1; /* Space flag */ + unsigned left :1; /* - flag */ + unsigned showsign :1; /* + flag */ + unsigned group :1; /* ' flag */ + unsigned extra :1; /* For special use (currently unused) */ + unsigned wide :1; /* Nonzero for wide character streams (currently unused) */ + + /* FreeBSD flags */ + unsigned is_quad :1; /* q flag */ + unsigned is_intmax :1; /* j flag */ + unsigned is_ptrdiff :1; /* t flag */ + unsigned is_size :1; /* z flag */ + + /* Mac OS X flags */ + unsigned is_vec :1; /* v flag */ + + /* private */ + int sofar; + unsigned get_width; + unsigned get_prec; + const char *begin; + const char *end; + void *arg[__PRINTFMAXARG]; +}; + +enum { + PA_INT = (1 << 0), /* int */ + PA_CHAR = (1 << 1), /* int, cast to char */ + PA_WCHAR = (1 << 2), /* wide char */ + PA_STRING = (1 << 3), /* const char * (with '\0') */ + PA_WSTRING = (1 << 4), /* const wchar_t * */ + PA_POINTER = (1 << 5), /* void * */ + PA_FLOAT = (1 << 6), /* float (Defined but unused; best to avoid.) */ + PA_DOUBLE = (1 << 7), /* double */ + PA_VECTOR = (1 << 8), /* vector */ +}; + +#define PA_FLAG_MASK 0xff0000 +#define PA_FLAG_LONG_LONG (1 << 16) +#define PA_FLAG_LONG (1 << 17) +#define PA_FLAG_SHORT (1 << 18) +#define PA_FLAG_PTR (1 << 19) +#define PA_FLAG_QUAD (1 << 20) +#define PA_FLAG_INTMAX (1 << 21) +#define PA_FLAG_SIZE (1 << 22) +#define PA_FLAG_PTRDIFF (1 << 23) +#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG + +/************************ Basic Extensible Printf APIs ************************/ + +typedef int printf_arginfo_function(const struct printf_info *__info, + size_t __n, int *__argtypes); +typedef int printf_function(FILE *__stream, + const struct printf_info *__info, const void *const *__args); + +/* + * We don't support the GLIBC register_printf_function() or FreeBSD + * register_printf_render_std(), because they affect printf globally + * and are unsafe. + */ + +/*************** Extensible Printf Domains APIs ****************/ + +struct _printf_domain; /* forward reference */ +typedef struct _printf_domain *printf_domain_t; + +__BEGIN_DECLS + +printf_domain_t copy_printf_domain(printf_domain_t __domain) + __XPRINTF_ATTR((__nonnull__(1))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +void free_printf_domain(printf_domain_t __domain) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +printf_domain_t new_printf_domain(void) + __XPRINTF_ATTR((__malloc__)) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int register_printf_domain_function(printf_domain_t __domain, + int __spec, printf_function *__render, + printf_arginfo_function *__arginfo, void *__context) + __XPRINTF_ATTR((__nonnull__(1))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int register_printf_domain_render_std(printf_domain_t __domain, + const char *__specs) + __XPRINTF_ATTR((__nonnull__(1))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); + +/**** All-in-one extensible printf variants ****/ +int asxprintf(char ** __restrict __ret, + printf_domain_t __restrict __domain, locale_t __restrict __loc, + const char * __restrict __format, ...) + __XPRINTF_ATTR((__nonnull__(1, 2, 4))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int dxprintf(int __fd, printf_domain_t __restrict __domain, + locale_t __restrict __loc, const char * __restrict __format, ...) + __XPRINTF_ATTR((__nonnull__(2, 4))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int fxprintf(FILE * __restrict __stream, + printf_domain_t __restrict __domain, locale_t __restrict __loc, + const char * __restrict __format, ...) + __XPRINTF_ATTR((__nonnull__(1, 2, 4))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int sxprintf(char * __restrict __str, size_t __size, + printf_domain_t __restrict __domain, locale_t __restrict __loc, + const char * __restrict __format, ...) + __XPRINTF_ATTR((__nonnull__(1, 3, 5))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int xprintf(printf_domain_t __restrict __domain, + locale_t __restrict __loc, const char * __restrict __format, ...) + __XPRINTF_ATTR((__nonnull__(1, 3))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); + +int vasxprintf(char ** __restrict __ret, + printf_domain_t __restrict __domain, locale_t __restrict __loc, + const char * __restrict __format, va_list __ap) + __XPRINTF_ATTR((__nonnull__(1, 2, 4))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int vdxprintf(int __fd, printf_domain_t __restrict __domain, + locale_t __restrict __loc, const char * __restrict __format, + va_list __ap) + __XPRINTF_ATTR((__nonnull__(2, 4))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int vfxprintf(FILE * __restrict __stream, + printf_domain_t __restrict __domain, locale_t __restrict __loc, + const char * __restrict __format, va_list __ap) + __XPRINTF_ATTR((__nonnull__(1, 2, 4))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int vsxprintf(char * __restrict __str, size_t __size, + printf_domain_t __restrict __domain, locale_t __restrict __loc, + const char * __restrict __format, va_list __ap) + __XPRINTF_ATTR((__nonnull__(1, 3, 5))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int vxprintf(printf_domain_t __restrict __domain, + locale_t __restrict __loc, const char * __restrict __format, + va_list __ap) + __XPRINTF_ATTR((__nonnull__(1, 3))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); + +__END_DECLS + +/******** Extensible Printf Compilation/Execution APIs *********/ +struct _printf_compiled; /* forward reference */ +typedef struct _printf_compiled *printf_comp_t; + +__BEGIN_DECLS + +void free_printf_comp(printf_comp_t __pc) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +printf_comp_t new_printf_comp(printf_domain_t __restrict __domain, + locale_t __restrict __loc, const char * __restrict __fmt) + __XPRINTF_ATTR((__nonnull__(1, 3))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); + +/**** Extensible printf execution ****/ +int asxprintf_exec(char ** __restrict __ret, + printf_comp_t __restrict __pc, ...) + __XPRINTF_ATTR((__nonnull__(1, 2))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int dxprintf_exec(int __fd, printf_comp_t __restrict __pc, ...) + __XPRINTF_ATTR((__nonnull__(2))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int fxprintf_exec(FILE * __restrict __stream, + printf_comp_t __restrict __pc, ...) + __XPRINTF_ATTR((__nonnull__(1, 2))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int sxprintf_exec(char * __restrict __str, size_t __size, + printf_comp_t __restrict __pc, ...) + __XPRINTF_ATTR((__nonnull__(1, 3))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int xprintf_exec(printf_comp_t __restrict __pc, ...) + __XPRINTF_ATTR((__nonnull__(1))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); + +int vasxprintf_exec(char ** __restrict __ret, + printf_comp_t __restrict __pc, va_list __ap) + __XPRINTF_ATTR((__nonnull__(1, 2))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int vdxprintf_exec(int __fd, printf_comp_t __restrict __pc, + va_list __ap) + __XPRINTF_ATTR((__nonnull__(2))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int vfxprintf_exec(FILE * __restrict __stream, + printf_comp_t __restrict __pc, va_list __ap) + __XPRINTF_ATTR((__nonnull__(1, 2))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int vsxprintf_exec(char * __restrict __str, size_t __size, + printf_comp_t __restrict __pc, va_list __ap) + __XPRINTF_ATTR((__nonnull__(1, 3))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +int vxprintf_exec(printf_comp_t __restrict __pc, va_list __ap) + __XPRINTF_ATTR((__nonnull__(1))) + __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); + +__END_DECLS + +#endif /* !_PRINTF_H */ diff --git a/include/protocols/routed.h b/include/protocols/routed.h new file mode 100644 index 0000000..885375b --- /dev/null +++ b/include/protocols/routed.h @@ -0,0 +1,104 @@ +/*- + * Copyright (c) 1983, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)routed.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _ROUTED_H_ +#define _ROUTED_H_ + +/* + * Routing Information Protocol + * + * Derived from Xerox NS Routing Information Protocol + * by changing 32-bit net numbers to sockaddr's and + * padding stuff to 32-bit boundaries. + */ +#define RIPVERSION 1 + +struct netinfo { + struct sockaddr rip_dst; /* destination net/host */ + int rip_metric; /* cost of route */ +}; + +struct rip { + unsigned char rip_cmd; /* request/response */ + unsigned char rip_vers; /* protocol version # */ + unsigned char rip_res1[2]; /* pad to 32-bit boundary */ + union { + struct netinfo ru_nets[1]; /* variable length... */ + char ru_tracefile[1]; /* ditto ... */ + } ripun; +#define rip_nets ripun.ru_nets +#define rip_tracefile ripun.ru_tracefile +}; + +/* + * Packet types. + */ +#define RIPCMD_REQUEST 1 /* want info */ +#define RIPCMD_RESPONSE 2 /* responding to request */ +#define RIPCMD_TRACEON 3 /* turn tracing on */ +#define RIPCMD_TRACEOFF 4 /* turn it off */ + +#define RIPCMD_MAX 5 +#ifdef RIPCMDS +char *ripcmds[RIPCMD_MAX] = + { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" }; +#endif + +#define HOPCNT_INFINITY 16 /* per Xerox NS */ +#define MAXPACKETSIZE 512 /* max broadcast size */ + +/* + * Timer values used in managing the routing table. + * Complete tables are broadcast every SUPPLY_INTERVAL seconds. + * If changes occur between updates, dynamic updates containing only changes + * may be sent. When these are sent, a timer is set for a random value + * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates + * are sent until the timer expires. + * + * Every update of a routing entry forces an entry's timer to be reset. + * After EXPIRE_TIME without updates, the entry is marked invalid, + * but held onto until GARBAGE_TIME so that others may + * see it "be deleted". + */ +#define TIMER_RATE 30 /* alarm clocks every 30 seconds */ + +#define SUPPLY_INTERVAL 30 /* time to supply tables */ +#define MIN_WAITTIME 2 /* min. interval to broadcast changes */ +#define MAX_WAITTIME 5 /* max. time to delay changes */ + +#define EXPIRE_TIME 180 /* time to mark entry invalid */ +#define GARBAGE_TIME 240 /* time to garbage collect */ + +#endif /* !_ROUTED_H_ */ diff --git a/include/protocols/rwhod.h b/include/protocols/rwhod.h new file mode 100644 index 0000000..e9e9c32 --- /dev/null +++ b/include/protocols/rwhod.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2000, 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)rwhod.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _RWHOD_H_ +#define _RWHOD_H_ + +/* + * rwho protocol packet format. + */ +struct outmp { + char out_line[8]; /* tty name */ + char out_name[8]; /* user id */ +#ifdef __LP64__ + int out_time; /* time on */ +#else /* !__LP64__ */ + long out_time; /* time on */ +#endif /* __LP64__ */ +}; + +struct whod { + char wd_vers; /* protocol version # */ + char wd_type; /* packet type, see below */ + char wd_pad[2]; + int wd_sendtime; /* time stamp by sender */ + int wd_recvtime; /* time stamp applied by receiver */ + char wd_hostname[32]; /* hosts's name */ + int wd_loadav[3]; /* load average as in uptime */ + int wd_boottime; /* time system booted */ + struct whoent { + struct outmp we_utmp; /* active tty info */ + int we_idle; /* tty idle time */ + } wd_we[1024 / sizeof (struct whoent)]; +}; + +#define WHODVERSION 1 +#define WHODTYPE_STATUS 1 /* host status */ + +#define _PATH_RWHODIR "/var/rwho" + +#endif /* !_RWHOD_H_ */ diff --git a/include/protocols/talkd.h b/include/protocols/talkd.h new file mode 100644 index 0000000..bd375ab --- /dev/null +++ b/include/protocols/talkd.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2000, 2006, 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)talkd.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _TALKD_H_ +#define _TALKD_H_ + +/* + * This describes the protocol used by the talk server and clients. + * + * The talk server acts a repository of invitations, responding to + * requests by clients wishing to rendezvous for the purpose of + * holding a conversation. In normal operation, a client, the caller, + * initiates a rendezvous by sending a CTL_MSG to the server of + * type LOOK_UP. This causes the server to search its invitation + * tables to check if an invitation currently exists for the caller + * (to speak to the callee specified in the message). If the lookup + * fails, the caller then sends an ANNOUNCE message causing the server + * to broadcast an announcement on the callee's login ports requesting + * contact. When the callee responds, the local server uses the + * recorded invitation to respond with the appropriate rendezvous + * address and the caller and callee client programs establish a + * stream connection through which the conversation takes place. + */ + +/* + * 4.3 compat sockaddr + */ +#include <_types.h> +struct osockaddr { + __uint16_t sa_family; /* address family */ + char sa_data[14]; /* up to 14 bytes of direct address */ +}; + +/* + * Client->server request message format. + */ +typedef struct { + unsigned char vers; /* protocol version */ + unsigned char type; /* request type, see below */ + unsigned char answer; /* not used */ + unsigned char pad; +#ifdef __LP64__ + unsigned int id_num; /* message id */ +#else /* !__LP64__ */ + unsigned long id_num; /* message id */ +#endif /* __LP64__ */ + struct osockaddr addr; /* old (4.3) style */ + struct osockaddr ctl_addr; /* old (4.3) style */ +#ifdef __LP64__ + int pid; /* caller's process id */ +#else /* !__LP64__ */ + long pid; /* caller's process id */ +#endif /* __LP64__ */ +#define NAME_SIZE 12 + char l_name[NAME_SIZE];/* caller's name */ + char r_name[NAME_SIZE];/* callee's name */ +#define TTY_SIZE 16 + char r_tty[TTY_SIZE];/* callee's tty name */ +} CTL_MSG; + +/* + * Server->client response message format. + */ +typedef struct { + unsigned char vers; /* protocol version */ + unsigned char type; /* type of request message, see below */ + unsigned char answer; /* respose to request message, see below */ + unsigned char pad; +#ifdef __LP64__ + unsigned int id_num; /* message id */ +#else /* !__LP64__ */ + unsigned long id_num; /* message id */ +#endif /* __LP64__ */ + struct osockaddr addr; /* address for establishing conversation */ +} CTL_RESPONSE; + +#define TALK_VERSION 1 /* protocol version */ + +/* message type values */ +#define LEAVE_INVITE 0 /* leave invitation with server */ +#define LOOK_UP 1 /* check for invitation by callee */ +#define DELETE 2 /* delete invitation by caller */ +#define ANNOUNCE 3 /* announce invitation by caller */ + +/* answer values */ +#define SUCCESS 0 /* operation completed properly */ +#define NOT_HERE 1 /* callee not logged in */ +#define FAILED 2 /* operation failed for unexplained reason */ +#define MACHINE_UNKNOWN 3 /* caller's machine name unknown */ +#define PERMISSION_DENIED 4 /* callee's tty doesn't permit announce */ +#define UNKNOWN_REQUEST 5 /* request has invalid type value */ +#define BADVERSION 6 /* request has invalid protocol version */ +#define BADADDR 7 /* request has invalid addr value */ +#define BADCTLADDR 8 /* request has invalid ctl_addr value */ + +/* + * Operational parameters. + */ +#define MAX_LIFE 60 /* max time daemon saves invitations */ +/* RING_WAIT should be 10's of seconds less than MAX_LIFE */ +#define RING_WAIT 30 /* time to wait before resending invitation */ + +#endif /* !_TALKD_H_ */ diff --git a/include/protocols/timed.h b/include/protocols/timed.h new file mode 100644 index 0000000..6999dff --- /dev/null +++ b/include/protocols/timed.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2000, 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)timed.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _TIMED_H_ +#define _TIMED_H_ + +/* + * Time Synchronization Protocol + */ + +#define TSPVERSION 1 +#define ANYADDR NULL + +#ifdef __LP64__ +#include +#include +#endif /* __LP64__ */ + +struct tsp { + unsigned char tsp_type; + unsigned char tsp_vers; + unsigned short tsp_seq; + union { +#ifdef __LP64__ + struct timeval32 tspu_time; +#else /* !__LP64__ */ + struct timeval tspu_time; +#endif /* __LP64__ */ + char tspu_hopcnt; + } tsp_u; + char tsp_name[MAXHOSTNAMELEN]; +}; + +#define tsp_time tsp_u.tspu_time +#define tsp_hopcnt tsp_u.tspu_hopcnt + +/* + * Command types. + */ +#define TSP_ANY 0 /* match any types */ +#define TSP_ADJTIME 1 /* send adjtime */ +#define TSP_ACK 2 /* generic acknowledgement */ +#define TSP_MASTERREQ 3 /* ask for master's name */ +#define TSP_MASTERACK 4 /* acknowledge master request */ +#define TSP_SETTIME 5 /* send network time */ +#define TSP_MASTERUP 6 /* inform slaves that master is up */ +#define TSP_SLAVEUP 7 /* slave is up but not polled */ +#define TSP_ELECTION 8 /* advance candidature for master */ +#define TSP_ACCEPT 9 /* support candidature of master */ +#define TSP_REFUSE 10 /* reject candidature of master */ +#define TSP_CONFLICT 11 /* two or more masters present */ +#define TSP_RESOLVE 12 /* masters' conflict resolution */ +#define TSP_QUIT 13 /* reject candidature if master is up */ +#define TSP_DATE 14 /* reset the time (date command) */ +#define TSP_DATEREQ 15 /* remote request to reset the time */ +#define TSP_DATEACK 16 /* acknowledge time setting */ +#define TSP_TRACEON 17 /* turn tracing on */ +#define TSP_TRACEOFF 18 /* turn tracing off */ +#define TSP_MSITE 19 /* find out master's site */ +#define TSP_MSITEREQ 20 /* remote master's site request */ +#define TSP_TEST 21 /* for testing election algo */ +#define TSP_SETDATE 22 /* New from date command */ +#define TSP_SETDATEREQ 23 /* New remote for above */ +#define TSP_LOOP 24 /* loop detection packet */ + +#define TSPTYPENUMBER 25 + +#ifdef TSPTYPES +char *tsptype[TSPTYPENUMBER] = + { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP", + "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT", + "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ", + "TEST", "SETDATE", "SETDATEREQ", "LOOP" }; +#endif + +#endif /* !_TIMED_H_ */ diff --git a/include/pthread_spinlock.h b/include/pthread_spinlock.h new file mode 120000 index 0000000..3439167 --- /dev/null +++ b/include/pthread_spinlock.h @@ -0,0 +1 @@ +../../external/libpthread/private/spinlock_private.h \ No newline at end of file diff --git a/include/ranlib.h b/include/ranlib.h new file mode 100644 index 0000000..001eaad --- /dev/null +++ b/include/ranlib.h @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1990, 1982, 1985, 1986, 1988, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ranlib.h 8.1 (Berkeley) 6/2/93 + */ +#ifndef _RANLIB_H_ +#define _RANLIB_H_ + +#include /* off_t */ + +/* + * There are two known orders of table of contents for archives. The first is + * the order ranlib(1) originally produced and still produces without any + * options. This table of contents has the archive member name "__.SYMDEF" + * This order has the ranlib structures in the order the objects appear in the + * archive and the symbol names of those objects in the order of symbol table. + * The second know order is sorted by symbol name and is produced with the -s + * option to ranlib(1). This table of contents has the archive member name + * "__.SYMDEF SORTED" and many programs (notably the 1.0 version of ld(1) can't + * tell the difference between names because of the imbedded blank in the name + * and works with either table of contents). This second order is used by the + * post 1.0 link editor to produce faster linking. The original 1.0 version of + * ranlib(1) gets confused when it is run on a archive with the second type of + * table of contents because it and ar(1) which it uses use different ways to + * determined the member name (ar(1) treats all blanks in the name as + * significant and ranlib(1) only checks for the first one). + */ +#define SYMDEF "__.SYMDEF" +#define SYMDEF_SORTED "__.SYMDEF SORTED" + +#define RANLIBMAG "__.SYMDEF" /* archive file name */ +#define RANLIBSKEW 3 /* creation time offset */ + +/* + * Structure of the __.SYMDEF table of contents for an archive. + * __.SYMDEF begins with a long giving the size in bytes of the ranlib + * structures which immediately follow, and then continues with a string + * table consisting of a long giving the number of bytes of strings which + * follow and then the strings themselves. The ran_strx fields index the + * string table whose first byte is numbered 0. + */ +struct ranlib { + union { + off_t ran_strx; /* string table index of */ + char *ran_name; /* symbol defined by */ + } ran_un; + off_t ran_off; /* library member at this offset */ +}; +#endif /* ! _RANLIB_H_ */ diff --git a/include/readpassphrase.h b/include/readpassphrase.h new file mode 100644 index 0000000..76316cc --- /dev/null +++ b/include/readpassphrase.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2000, 2002 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ + +#ifndef _READPASSPHRASE_H_ +#define _READPASSPHRASE_H_ + +#define RPP_ECHO_OFF 0x00 /* Turn off echo (default). */ +#define RPP_ECHO_ON 0x01 /* Leave echo on. */ +#define RPP_REQUIRE_TTY 0x02 /* Fail if there is no tty. */ +#define RPP_FORCELOWER 0x04 /* Force input to lower case. */ +#define RPP_FORCEUPPER 0x08 /* Force input to upper case. */ +#define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */ +#define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */ + +#include <_types.h> +#include + +__BEGIN_DECLS +char * readpassphrase(const char *, char *, size_t, int); +__END_DECLS + +#endif /* !_READPASSPHRASE_H_ */ diff --git a/include/regex.h b/include/regex.h new file mode 100644 index 0000000..11f592b --- /dev/null +++ b/include/regex.h @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2000, 2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 2001-2009 Ville Laurikari + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/*- + * Copyright (c) 1992 Henry Spencer. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer of the University of Toronto. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)regex.h 8.2 (Berkeley) 1/3/94 + */ + +#ifndef _REGEX_H_ +#define _REGEX_H_ + +#include <_regex.h> + +/*******************/ +/* regcomp() flags */ +/*******************/ +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define REG_BASIC 0000 /* Basic regular expressions (synonym for 0) */ +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#define REG_EXTENDED 0001 /* Extended regular expressions */ +#define REG_ICASE 0002 /* Compile ignoring upper/lower case */ +#define REG_NOSUB 0004 /* Compile only reporting success/failure */ +#define REG_NEWLINE 0010 /* Compile for newline-sensitive matching */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define REG_NOSPEC 0020 /* Compile turning off all special characters */ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ + || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ + || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#define REG_LITERAL REG_NOSPEC +#endif + +#define REG_PEND 0040 /* Use re_endp as end pointer */ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ + || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ + || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#define REG_MINIMAL 0100 /* Compile using minimal repetition */ +#define REG_UNGREEDY REG_MINIMAL +#endif + +#define REG_DUMP 0200 /* Unused */ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ + || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ + || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#define REG_ENHANCED 0400 /* Additional (non-POSIX) features */ +#endif +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +/********************/ +/* regerror() flags */ +/********************/ +#define REG_ENOSYS (-1) /* Reserved */ +#define REG_NOMATCH 1 /* regexec() function failed to match */ +#define REG_BADPAT 2 /* invalid regular expression */ +#define REG_ECOLLATE 3 /* invalid collating element */ +#define REG_ECTYPE 4 /* invalid character class */ +#define REG_EESCAPE 5 /* trailing backslash (\) */ +#define REG_ESUBREG 6 /* invalid backreference number */ +#define REG_EBRACK 7 /* brackets ([ ]) not balanced */ +#define REG_EPAREN 8 /* parentheses not balanced */ +#define REG_EBRACE 9 /* braces not balanced */ +#define REG_BADBR 10 /* invalid repetition count(s) */ +#define REG_ERANGE 11 /* invalid character range */ +#define REG_ESPACE 12 /* out of memory */ +#define REG_BADRPT 13 /* repetition-operator operand invalid */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define REG_EMPTY 14 /* Unused */ +#define REG_ASSERT 15 /* Unused */ +#define REG_INVARG 16 /* invalid argument to regex routine */ +#define REG_ILLSEQ 17 /* illegal byte sequence */ + +#define REG_ATOI 255 /* convert name to number (!) */ +#define REG_ITOA 0400 /* convert number to name (!) */ +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +/*******************/ +/* regexec() flags */ +/*******************/ +#define REG_NOTBOL 00001 /* First character not at beginning of line */ +#define REG_NOTEOL 00002 /* Last character not at end of line */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define REG_STARTEND 00004 /* String start/end in pmatch[0] */ +#define REG_TRACE 00400 /* Unused */ +#define REG_LARGE 01000 /* Unused */ +#define REG_BACKR 02000 /* force use of backref code */ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ + || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ + || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#define REG_BACKTRACKING_MATCHER REG_BACKR +#endif +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +__BEGIN_DECLS +int regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(regcomp); +size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t) __cold; +/* + * gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround, + * a dummy argument name is added. + */ +int regexec(const regex_t * __restrict, const char * __restrict, size_t, + regmatch_t __pmatch[ __restrict], int); +void regfree(regex_t *); + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL + +/* Darwin extensions */ +int regncomp(regex_t * __restrict, const char * __restrict, size_t, int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regnexec(const regex_t * __restrict, const char * __restrict, size_t, + size_t, regmatch_t __pmatch[ __restrict], int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regwcomp(regex_t * __restrict, const wchar_t * __restrict, int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regwexec(const regex_t * __restrict, const wchar_t * __restrict, size_t, + regmatch_t __pmatch[ __restrict], int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regwncomp(regex_t * __restrict, const wchar_t * __restrict, size_t, int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regwnexec(const regex_t * __restrict, const wchar_t * __restrict, + size_t, size_t, regmatch_t __pmatch[ __restrict], int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); + +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_REGEX_H_ */ diff --git a/include/rune.h b/include/rune.h new file mode 100644 index 0000000..4ecb003 --- /dev/null +++ b/include/rune.h @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)rune.h 8.1 (Berkeley) 6/27/93 + */ + +#ifndef _RUNE_H_ +#define _RUNE_H_ + +#include +#include +#include + +/*--------------------------- DEPRECIATED ------------------------------- + * This interface is depreciated and will eventually be removed. The ISO C99 + * extended multibyte and wide character facilities should be used instead. + * See multibyte(3) and related man pages for further details. + *--------------------------- DEPRECIATED -------------------------------*/ + +#define _PATH_LOCALE "/usr/share/locale" + +#define _INVALID_RUNE _CurrentRuneLocale->__invalid_rune + +#define __sgetrune _CurrentRuneLocale->__sgetrune +#define __sputrune _CurrentRuneLocale->__sputrune + +#define sgetrune(s, n, r) (*__sgetrune)((s), (n), (r)) +#define sputrune(c, s, n, r) (*__sputrune)((c), (s), (n), (r)) + +__BEGIN_DECLS +char *mbrune(const char *, rune_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA); +char *mbrrune(const char *, rune_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA); +char *mbmb(const char *, char *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA); +long fgetrune(FILE *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA); +int fputrune(rune_t, FILE *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA); +int fungetrune(rune_t, FILE *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA); +int setrunelocale(char *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA); +void setinvalidrune(rune_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA); +__END_DECLS + +#endif /*! _RUNE_H_ */ diff --git a/include/runetype.h b/include/runetype.h new file mode 100644 index 0000000..b3dcce2 --- /dev/null +++ b/include/runetype.h @@ -0,0 +1,115 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)runetype.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _RUNETYPE_H_ +#define _RUNETYPE_H_ + +#include <_types.h> + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#include +#include +#include +#include +#include + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */ +#define _CRMASK (~(_CACHED_RUNES - 1)) + +/* + * The lower 8 bits of runetype[] contain the digit value of the rune. + */ +typedef struct { + __darwin_rune_t __min; /* First rune of the range */ + __darwin_rune_t __max; /* Last rune (inclusive) of the range */ + __darwin_rune_t __map; /* What first maps to in maps */ + __uint32_t *__types; /* Array of types in range */ +} _RuneEntry; + +typedef struct { + int __nranges; /* Number of ranges stored */ + _RuneEntry *__ranges; /* Pointer to the ranges */ +} _RuneRange; + +typedef struct { + char __name[14]; /* CHARCLASS_NAME_MAX = 14 */ + __uint32_t __mask; /* charclass mask */ +} _RuneCharClass; + +typedef struct { + char __magic[8]; /* Magic saying what version we are */ + char __encoding[32]; /* ASCII name of this encoding */ + + __darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **); + int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **); + __darwin_rune_t __invalid_rune; + + __uint32_t __runetype[_CACHED_RUNES]; + __darwin_rune_t __maplower[_CACHED_RUNES]; + __darwin_rune_t __mapupper[_CACHED_RUNES]; + + /* + * The following are to deal with Runes larger than _CACHED_RUNES - 1. + * Their data is actually contiguous with this structure so as to make + * it easier to read/write from/to disk. + */ + _RuneRange __runetype_ext; + _RuneRange __maplower_ext; + _RuneRange __mapupper_ext; + + void *__variable; /* Data which depends on the encoding */ + int __variable_len; /* how long that data is */ + + /* + * extra fields to deal with arbitrary character classes + */ + int __ncharclasses; + _RuneCharClass *__charclasses; +} _RuneLocale; + +#define _RUNE_MAGIC_A "RuneMagA" /* Indicates version A of RuneLocale */ + +__BEGIN_DECLS +extern _RuneLocale _DefaultRuneLocale; +extern _RuneLocale *_CurrentRuneLocale; +__END_DECLS + +#endif /* !_RUNETYPE_H_ */ diff --git a/include/search.h b/include/search.h new file mode 100644 index 0000000..58d69e7 --- /dev/null +++ b/include/search.h @@ -0,0 +1,62 @@ +/*- + * Written by J.T. Conklin + * Public domain. + * + * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ + * $FreeBSD: src/include/search.h,v 1.10 2002/10/16 14:29:23 robert Exp $ + */ + +#ifndef _SEARCH_H_ +#define _SEARCH_H_ + +#include +#include <_types.h> +#include + +typedef struct entry { + char *key; + void *data; +} ENTRY; + +typedef enum { + FIND, ENTER +} ACTION; + +typedef enum { + preorder, + postorder, + endorder, + leaf +} VISIT; + +#ifdef _SEARCH_PRIVATE +typedef struct node { + char *key; + struct node *llink, *rlink; +} node_t; + +struct que_elem { + struct que_elem *next; + struct que_elem *prev; +}; +#endif + +__BEGIN_DECLS +int hcreate(size_t); +void hdestroy(void); +ENTRY *hsearch(ENTRY, ACTION); +void insque(void *, void *); +void *lfind(const void *, const void *, size_t *, size_t, + int (*)(const void *, const void *)); +void *lsearch(const void *, void *, size_t *, size_t, + int (*)(const void *, const void *)); +void remque(void *); +void *tdelete(const void * __restrict, void ** __restrict, + int (*)(const void *, const void *)); +void *tfind(const void *, void * const *, + int (*)(const void *, const void *)); +void *tsearch(const void *, void **, int (*)(const void *, const void *)); +void twalk(const void *, void (*)(const void *, VISIT, int)); +__END_DECLS + +#endif /* !_SEARCH_H_ */ diff --git a/include/secure/_common.h b/include/secure/_common.h new file mode 100644 index 0000000..a7acfaa --- /dev/null +++ b/include/secure/_common.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2007, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _SECURE__COMMON_H_ +#define _SECURE__COMMON_H_ + +#undef _USE_FORTIFY_LEVEL +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +# if _FORTIFY_SOURCE > 1 +# define _USE_FORTIFY_LEVEL 2 +# else +# define _USE_FORTIFY_LEVEL 1 +# endif +#else +# define _USE_FORTIFY_LEVEL 0 +#endif + +#define __darwin_obsz0(object) __builtin_object_size (object, 0) +#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) + +#endif diff --git a/include/secure/_stdio.h b/include/secure/_stdio.h new file mode 100644 index 0000000..76bdaaa --- /dev/null +++ b/include/secure/_stdio.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2007, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _STDIO_H_ + #error error "Never use directly; include instead." +#endif + +#ifndef _SECURE__STDIO_H_ +#define _SECURE__STDIO_H_ + +#include + +#if _USE_FORTIFY_LEVEL > 0 + +#ifndef __has_builtin +#define _undef__has_builtin +#define __has_builtin(x) 0 +#endif + +#ifndef UNIFDEF_DRIVERKIT +/* sprintf, vsprintf, snprintf, vsnprintf */ +#if __has_builtin(__builtin___sprintf_chk) || defined(__GNUC__) +extern int __sprintf_chk (char * __restrict, int, size_t, + const char * __restrict, ...); + +#undef sprintf +#define sprintf(str, ...) \ + __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) +#endif +#endif /* UNIFDEF_DRIVERKIT */ + +#if __DARWIN_C_LEVEL >= 200112L +#if __has_builtin(__builtin___snprintf_chk) || defined(__GNUC__) +extern int __snprintf_chk (char * __restrict, size_t, int, size_t, + const char * __restrict, ...); + +#undef snprintf +#define snprintf(str, len, ...) \ + __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) +#endif + +#ifndef UNIFDEF_DRIVERKIT +#if __has_builtin(__builtin___vsprintf_chk) || defined(__GNUC__) +extern int __vsprintf_chk (char * __restrict, int, size_t, + const char * __restrict, va_list); + +#undef vsprintf +#define vsprintf(str, format, ap) \ + __builtin___vsprintf_chk (str, 0, __darwin_obsz(str), format, ap) +#endif +#endif /* UNIFDEF_DRIVERKIT */ + +#if __has_builtin(__builtin___vsnprintf_chk) || defined(__GNUC__) +extern int __vsnprintf_chk (char * __restrict, size_t, int, size_t, + const char * __restrict, va_list); + +#undef vsnprintf +#define vsnprintf(str, len, format, ap) \ + __builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap) +#endif + +#endif /* __DARWIN_C_LEVEL >= 200112L */ + +#ifdef _undef__has_builtin +#undef _undef__has_builtin +#undef __has_builtin +#endif + +#endif /* _USE_FORTIFY_LEVEL > 0 */ +#endif /* _SECURE__STDIO_H_ */ diff --git a/include/secure/_string.h b/include/secure/_string.h new file mode 100644 index 0000000..595b85d --- /dev/null +++ b/include/secure/_string.h @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2007,2017 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _STRING_H_ +# error "Never use directly; include instead." +#endif + +#ifndef _SECURE__STRING_H_ +#define _SECURE__STRING_H_ + +#include +#include +#include + +#if _USE_FORTIFY_LEVEL > 0 + +/* */ +#if defined(__clang__) && \ + ((defined(__apple_build_version__) && __apple_build_version__ >= 4260006) || \ + (!defined(__apple_build_version__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 3)))) +#define __HAS_FIXED_CHK_PROTOTYPES 1 +#else +#define __HAS_FIXED_CHK_PROTOTYPES 0 +#endif + +/* memccpy, memcpy, mempcpy, memmove, memset, strcpy, strlcpy, stpcpy, + strncpy, stpncpy, strcat, strlcat, and strncat */ + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 || \ + defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#if __has_builtin(__builtin___memccpy_chk) && __HAS_FIXED_CHK_PROTOTYPES +#undef memccpy +/* void *memccpy(void *dst, const void *src, int c, size_t n) */ +#define memccpy(dest, ...) \ + __builtin___memccpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest)) +#endif +#endif + +#if __has_builtin(__builtin___memcpy_chk) || defined(__GNUC__) +#undef memcpy +/* void *memcpy(void *dst, const void *src, size_t n) */ +#define memcpy(dest, ...) \ + __builtin___memcpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest)) +#endif + +#if __has_builtin(__builtin___memmove_chk) || defined(__GNUC__) +#undef memmove +/* void *memmove(void *dst, const void *src, size_t len) */ +#define memmove(dest, ...) \ + __builtin___memmove_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest)) +#endif + +#if __has_builtin(__builtin___memset_chk) || defined(__GNUC__) +#undef memset +/* void *memset(void *b, int c, size_t len) */ +#define memset(dest, ...) \ + __builtin___memset_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest)) +#endif + +#ifndef UNIFDEF_DRIVERKIT +#if __has_builtin(__builtin___strcpy_chk) || defined(__GNUC__) +#undef strcpy +/* char *strcpy(char *dst, const char *src) */ +#define strcpy(dest, ...) \ + __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest)) +#endif + +#if __DARWIN_C_LEVEL >= 200809L +#if __has_builtin(__builtin___stpcpy_chk) || defined(__GNUC__) +#undef stpcpy +/* char *stpcpy(char *dst, const char *src) */ +#define stpcpy(dest, ...) \ + __builtin___stpcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest)) +#endif +#endif /* __DARWIN_C_LEVEL >= 200809L */ +#endif /* UNIFDEF_DRIVERKIT */ + +#if __DARWIN_C_LEVEL >= 200809L +#if __has_builtin(__builtin___stpncpy_chk) || __APPLE_CC__ >= 5666 || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) +#undef stpncpy +/* char *stpncpy(char *dst, const char *src, size_t n) */ +#define stpncpy(dest, ...) \ + __builtin___stpncpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest)) +#endif +#endif /* _DARWIN_C_LEVEL >= 200809L */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 || \ + defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#if __has_builtin(__builtin___strlcpy_chk) && __HAS_FIXED_CHK_PROTOTYPES +#undef strlcpy +/* size_t strlcpy(char *dst, const char *source, size_t size) */ +#define strlcpy(dest, ...) \ + __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest)) +#endif + +#if __has_builtin(__builtin___strlcat_chk) && __HAS_FIXED_CHK_PROTOTYPES +#undef strlcat +/* size_t strlcat(char *dst, const char *source, size_t size) */ +#define strlcat(dest, ...) \ + __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest)) +#endif +#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 */ +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#if __has_builtin(__builtin___strncpy_chk) || defined(__GNUC__) +#undef strncpy +/* char *strncpy(char *dst, const char *src, size_t n) */ +#define strncpy(dest, ...) \ + __builtin___strncpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest)) +#endif + +#ifndef UNIFDEF_DRIVERKIT +#if __has_builtin(__builtin___strcat_chk) || defined(__GNUC__) +#undef strcat +/* char *strcat(char *s1, const char *s2) */ +#define strcat(dest, ...) \ + __builtin___strcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest)) +#endif +#endif /* UNIFDEF_DRIVERKIT */ + +#if ! (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 32000) +#if __has_builtin(__builtin___strncat_chk) || defined(__GNUC__) +#undef strncat +/* char *strncat(char *s1, const char *s2, size_t n) */ +#define strncat(dest, ...) \ + __builtin___strncat_chk (dest, __VA_ARGS__, __darwin_obsz (dest)) +#endif +#endif + +#undef __HAS_FIXED_CHK_PROTOTYPES + +#endif /* _USE_FORTIFY_LEVEL > 0 */ +#endif /* _SECURE__STRING_H_ */ diff --git a/include/secure/_strings.h b/include/secure/_strings.h new file mode 100644 index 0000000..9069e59 --- /dev/null +++ b/include/secure/_strings.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2017 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _STRINGS_H_ +# error "Never use directly; include instead." +#endif + +#ifndef _SECURE__STRINGS_H_ +#define _SECURE__STRINGS_H_ + +#include +#include +#include + +#if _USE_FORTIFY_LEVEL > 0 + +/* bcopy and bzero */ + +/* Removed in Issue 7 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L + +#if __has_builtin(__builtin___memmove_chk) || defined(__GNUC__) +#undef bcopy +/* void bcopy(const void *src, void *dst, size_t len) */ +#define bcopy(src, dest, ...) \ + __builtin___memmove_chk (dest, src, __VA_ARGS__, __darwin_obsz0 (dest)) +#endif + +#if __has_builtin(__builtin___memset_chk) || defined(__GNUC__) +#undef bzero +/* void bzero(void *s, size_t n) */ +#define bzero(dest, ...) \ + __builtin___memset_chk (dest, 0, __VA_ARGS__, __darwin_obsz0 (dest)) +#endif + +#endif + +#endif /* _USE_FORTIFY_LEVEL > 0 */ +#endif /* _SECURE__STRINGS_H_ */ diff --git a/include/semaphore.h b/include/semaphore.h new file mode 100644 index 0000000..638aa61 --- /dev/null +++ b/include/semaphore.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_SEMAPHORE_H +#define _BSD_SEMAPHORE_H + +#include +#include + +#include + +#endif /* _BSD_SEMAPHORE_H */ diff --git a/include/sgtty.h b/include/sgtty.h new file mode 100644 index 0000000..5409d3e --- /dev/null +++ b/include/sgtty.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1985, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)sgtty.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _SGTTY_H_ +#define _SGTTY_H_ + +#include + +#ifndef USE_OLD_TTY +#define USE_OLD_TTY +#endif +#include + +__BEGIN_DECLS +int gtty(int, struct sgttyb *); +int stty(int, struct sgttyb *); +__END_DECLS + +#define gtty(fd, buf) ioctl(fd, TIOCGETP, buf) +#define stty(fd, buf) ioctl(fd, TIOCSETP, buf) + +#endif /* _SGTTY_H_ */ diff --git a/include/signal.h b/include/signal.h new file mode 100644 index 0000000..94c4c1b --- /dev/null +++ b/include/signal.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)signal.h 8.3 (Berkeley) 3/30/94 + */ + +#ifndef _USER_SIGNAL_H +#define _USER_SIGNAL_H + +#include +#include <_types.h> +#include + +#include +#include + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +extern __const char *__const sys_signame[NSIG]; +extern __const char *__const sys_siglist[NSIG]; +#endif + +__BEGIN_DECLS +int raise(int); +__END_DECLS + +#ifndef _ANSI_SOURCE +__BEGIN_DECLS +void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int); +int kill(pid_t, int) __DARWIN_ALIAS(kill); +int killpg(pid_t, int) __DARWIN_ALIAS(killpg); +int pthread_kill(pthread_t, int); +int pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask); +int sigaction(int, const struct sigaction * __restrict, + struct sigaction * __restrict); +int sigaddset(sigset_t *, int); +int sigaltstack(const stack_t * __restrict, stack_t * __restrict) __DARWIN_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int sigdelset(sigset_t *, int); +int sigemptyset(sigset_t *); +int sigfillset(sigset_t *); +int sighold(int); +int sigignore(int); +int siginterrupt(int, int); +int sigismember(const sigset_t *, int); +int sigpause(int) __DARWIN_ALIAS_C(sigpause); +int sigpending(sigset_t *); +int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); +int sigrelse(int); +void (* _Nullable sigset(int, void (* _Nullable)(int)))(int); +int sigsuspend(const sigset_t *) __DARWIN_ALIAS_C(sigsuspend); +int sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +void psignal(unsigned int, const char *); +int sigblock(int); +int sigsetmask(int); +int sigvec(int, struct sigvec *, struct sigvec *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +__END_DECLS + +/* List definitions after function declarations, or Reiser cpp gets upset. */ +#if defined(__i386__) || defined(__x86_64__) +/* The left shift operator on intel is modulo 32 */ +__header_always_inline int +__sigbits(int __signo) +{ + return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1)); +} +#else /* !__i386__ && !__x86_64__ */ +#define __sigbits(signo) (1 << ((signo) - 1)) +#endif /* __i386__ || __x86_64__ */ + +#define sigaddset(set, signo) (*(set) |= __sigbits(signo), 0) +#define sigdelset(set, signo) (*(set) &= ~__sigbits(signo), 0) +#define sigismember(set, signo) ((*(set) & __sigbits(signo)) != 0) +#define sigemptyset(set) (*(set) = 0, 0) +#define sigfillset(set) (*(set) = ~(sigset_t)0, 0) +#endif /* !_ANSI_SOURCE */ + +#endif /* !_USER_SIGNAL_H */ diff --git a/include/stab.h b/include/stab.h new file mode 100644 index 0000000..0eae579 --- /dev/null +++ b/include/stab.h @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stab.h 8.1 (Berkeley) 6/2/93 + */ + +/* + * The following are symbols used by various debuggers and by the Pascal + * compiler. Each of them must have one (or more) of the bits defined by + * the N_STAB mask set. + */ + +#define N_GSYM 0x20 /* global symbol */ +#define N_FNAME 0x22 /* F77 function name */ +#define N_FUN 0x24 /* procedure name */ +#define N_STSYM 0x26 /* data segment variable */ +#define N_LCSYM 0x28 /* bss segment variable */ +#define N_MAIN 0x2a /* main function name */ +#define N_PC 0x30 /* global Pascal symbol */ +#define N_RSYM 0x40 /* register variable */ +#define N_SLINE 0x44 /* text segment line number */ +#define N_DSLINE 0x46 /* data segment line number */ +#define N_BSLINE 0x48 /* bss segment line number */ +#define N_SSYM 0x60 /* structure/union element */ +#define N_SO 0x64 /* main source file name */ +#define N_LSYM 0x80 /* stack variable */ +#define N_BINCL 0x82 /* include file beginning */ +#define N_SOL 0x84 /* included source file name */ +#define N_PSYM 0xa0 /* parameter variable */ +#define N_EINCL 0xa2 /* include file end */ +#define N_ENTRY 0xa4 /* alternate entry point */ +#define N_LBRAC 0xc0 /* left bracket */ +#define N_EXCL 0xc2 /* deleted include file */ +#define N_RBRAC 0xe0 /* right bracket */ +#define N_BCOMM 0xe2 /* begin common */ +#define N_ECOMM 0xe4 /* end common */ +#define N_ECOML 0xe8 /* end common (local name) */ +#define N_LENG 0xfe /* length of preceding entry */ diff --git a/include/standards.h b/include/standards.h new file mode 100644 index 0000000..6693238 --- /dev/null +++ b/include/standards.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1999, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved + */ + +#ifndef _STANDARDS_H +#define _STANDARDS_H + +#include + +#warning "The use of is deprecated, and it will be removed in a future release." + +#endif /* _STANDARDS_H */ diff --git a/include/stdbool.h b/include/stdbool.h new file mode 100644 index 0000000..5f01433 --- /dev/null +++ b/include/stdbool.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2000 Jeroen Ruigrok van der Werven + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/include/stdbool.h,v 1.6 2002/08/16 07:33:14 alfred Exp $ + */ + +#ifndef _STDBOOL_H_ +#define _STDBOOL_H_ + +#define __bool_true_false_are_defined 1 + +#ifndef __cplusplus + +#define bool _Bool +#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 +typedef int _Bool; +#endif + +#define false 0 +#define true 1 + +#endif /* !__cplusplus */ + +#endif /* !_STDBOOL_H_ */ diff --git a/include/stddef.h b/include/stddef.h new file mode 100644 index 0000000..6832cf7 --- /dev/null +++ b/include/stddef.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2000-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $OpenBSD: stddef.h,v 1.2 1997/09/21 10:45:52 niklas Exp $ */ +/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stddef.h 5.5 (Berkeley) 4/3/91 + */ + +#ifndef __STDDEF_H__ +#define __STDDEF_H__ + +#include <_types.h> + +#include +#include +#include +#include + +#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 +#include +#endif /* __STDC_WANT_LIB_EXT1__ >= 1 */ + +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +#include + +#include + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#include +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \ + || (defined(__cplusplus) && __cplusplus >= 201103L) +typedef long double max_align_t; +#endif + +#endif /* __STDDEF_H__ */ diff --git a/include/stdint.h b/include/stdint.h new file mode 100644 index 0000000..f4bb4cd --- /dev/null +++ b/include/stdint.h @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2000-2010 Apple Inc. + * All rights reserved. + */ + +#ifndef _STDINT_H_ +#define _STDINT_H_ + +#if __LP64__ +#define __WORDSIZE 64 +#else +#define __WORDSIZE 32 +#endif + +/* from ISO/IEC 988:1999 spec */ + +/* 7.18.1.1 Exact-width integer types */ +#include +#include +#include +#include + +#include <_types/_uint8_t.h> +#include <_types/_uint16_t.h> +#include <_types/_uint32_t.h> +#include <_types/_uint64_t.h> + +/* 7.18.1.2 Minimum-width integer types */ +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + + +/* 7.18.1.3 Fastest-width integer types */ +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + + +/* 7.18.1.4 Integer types capable of holding object pointers */ + +#include +#include +#include + + +/* 7.18.1.5 Greatest-width integer types */ +#include <_types/_intmax_t.h> +#include <_types/_uintmax_t.h> + +/* 7.18.4 Macros for integer constants */ +#define INT8_C(v) (v) +#define INT16_C(v) (v) +#define INT32_C(v) (v) +#define INT64_C(v) (v ## LL) + +#define UINT8_C(v) (v) +#define UINT16_C(v) (v) +#define UINT32_C(v) (v ## U) +#define UINT64_C(v) (v ## ULL) + +#ifdef __LP64__ +#define INTMAX_C(v) (v ## L) +#define UINTMAX_C(v) (v ## UL) +#else +#define INTMAX_C(v) (v ## LL) +#define UINTMAX_C(v) (v ## ULL) +#endif + +/* 7.18.2 Limits of specified-width integer types: + * These #defines specify the minimum and maximum limits + * of each of the types declared above. + * + * They must have "the same type as would an expression that is an + * object of the corresponding type converted according to the integer + * promotion". + */ + + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define INT8_MIN -128 +#define INT16_MIN -32768 + /* + Note: the literal "most negative int" cannot be written in C -- + the rules in the standard (section 6.4.4.1 in C99) will give it + an unsigned type, so INT32_MIN (and the most negative member of + any larger signed type) must be written via a constant expression. + */ +#define INT32_MIN (-INT32_MAX-1) +#define INT64_MIN (-INT64_MAX-1) + +#define UINT8_MAX 255 +#define UINT16_MAX 65535 +#define UINT32_MAX 4294967295U +#define UINT64_MAX 18446744073709551615ULL + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding object pointers */ + +#if __WORDSIZE == 64 +#define INTPTR_MAX 9223372036854775807L +#else +#define INTPTR_MAX 2147483647L +#endif +#define INTPTR_MIN (-INTPTR_MAX-1) + +#if __WORDSIZE == 64 +#define UINTPTR_MAX 18446744073709551615UL +#else +#define UINTPTR_MAX 4294967295UL +#endif + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MAX INTMAX_C(9223372036854775807) +#define UINTMAX_MAX UINTMAX_C(18446744073709551615) +#define INTMAX_MIN (-INTMAX_MAX-1) + +/* 7.18.3 "Other" */ +#if __WORDSIZE == 64 +#define PTRDIFF_MIN INTMAX_MIN +#define PTRDIFF_MAX INTMAX_MAX +#else +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#endif + +#define SIZE_MAX UINTPTR_MAX + +#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 +#define RSIZE_MAX (SIZE_MAX >> 1) +#endif + +#ifndef WCHAR_MAX +# ifdef __WCHAR_MAX__ +# define WCHAR_MAX __WCHAR_MAX__ +# else +# define WCHAR_MAX 0x7fffffff +# endif +#endif + +/* WCHAR_MIN should be 0 if wchar_t is an unsigned type and + (-WCHAR_MAX-1) if wchar_t is a signed type. Unfortunately, + it turns out that -fshort-wchar changes the signedness of + the type. */ +#ifndef WCHAR_MIN +# if WCHAR_MAX == 0xffff +# define WCHAR_MIN 0 +# else +# define WCHAR_MIN (-WCHAR_MAX-1) +# endif +#endif + +#define WINT_MIN INT32_MIN +#define WINT_MAX INT32_MAX + +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +#endif /* _STDINT_H_ */ diff --git a/include/stdio.h b/include/stdio.h new file mode 100644 index 0000000..6c43368 --- /dev/null +++ b/include/stdio.h @@ -0,0 +1,427 @@ +/* + * Copyright (c) 2000, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdio.h 8.5 (Berkeley) 4/29/95 + */ + +#ifndef _STDIO_H_ +#define _STDIO_H_ + +#include <_stdio.h> + +#ifndef UNIFDEF_DRIVERKIT +__BEGIN_DECLS +extern FILE *__stdinp; +extern FILE *__stdoutp; +extern FILE *__stderrp; +__END_DECLS + +#define __SLBF 0x0001 /* line buffered */ +#define __SNBF 0x0002 /* unbuffered */ +#define __SRD 0x0004 /* OK to read */ +#define __SWR 0x0008 /* OK to write */ + /* RD and WR are never simultaneously asserted */ +#define __SRW 0x0010 /* open for reading & writing */ +#define __SEOF 0x0020 /* found EOF */ +#define __SERR 0x0040 /* found error */ +#define __SMBF 0x0080 /* _buf is from malloc */ +#define __SAPP 0x0100 /* fdopen()ed in append mode */ +#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ +#define __SOPT 0x0400 /* do fseek() optimisation */ +#define __SNPT 0x0800 /* do not do fseek() optimisation */ +#define __SOFF 0x1000 /* set iff _offset is in fact correct */ +#define __SMOD 0x2000 /* true => fgetln modified _p text */ +#define __SALC 0x4000 /* allocate string space dynamically */ +#define __SIGN 0x8000 /* ignore this file in _fwalk */ + +/* + * The following three definitions are for ANSI C, which took them + * from System V, which brilliantly took internal interface macros and + * made them official arguments to setvbuf(), without renaming them. + * Hence, these ugly _IOxxx names are *supposed* to appear in user code. + * + * Although numbered as their counterparts above, the implementation + * does not rely on this. + */ +#define _IOFBF 0 /* setvbuf should set fully buffered */ +#define _IOLBF 1 /* setvbuf should set line buffered */ +#define _IONBF 2 /* setvbuf should set unbuffered */ + +#define BUFSIZ 1024 /* size of buffer used by setbuf */ +#define EOF (-1) + + /* must be == _POSIX_STREAM_MAX */ +#define FOPEN_MAX 20 /* must be <= OPEN_MAX */ +#define FILENAME_MAX 1024 /* must be <= PATH_MAX */ + +/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ +#ifndef _ANSI_SOURCE +#define P_tmpdir "/var/tmp/" +#endif +#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ +#define TMP_MAX 308915776 + +#ifndef SEEK_SET +#define SEEK_SET 0 /* set file offset to offset */ +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#endif +#ifndef SEEK_END +#define SEEK_END 2 /* set file offset to EOF plus offset */ +#endif + +#define stdin __stdinp +#define stdout __stdoutp +#define stderr __stderrp + +#ifdef _DARWIN_UNLIMITED_STREAMS +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 +#error "_DARWIN_UNLIMITED_STREAMS specified, but -miphoneos-version-min version does not support it." +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6 +#error "_DARWIN_UNLIMITED_STREAMS specified, but -mmacosx-version-min version does not support it." +#endif +#endif + +/* ANSI-C */ + +__BEGIN_DECLS +void clearerr(FILE *); +int fclose(FILE *); +int feof(FILE *); +int ferror(FILE *); +int fflush(FILE *); +int fgetc(FILE *); +int fgetpos(FILE * __restrict, fpos_t *); +char *fgets(char * __restrict, int, FILE *); +#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE) +FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fopen)); +#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fopen)); +#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3); +int fputc(int, FILE *); +int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs); +size_t fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream); +FILE *freopen(const char * __restrict, const char * __restrict, + FILE * __restrict) __DARWIN_ALIAS(freopen); +int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3); +int fseek(FILE *, long, int); +int fsetpos(FILE *, const fpos_t *); +long ftell(FILE *); +size_t fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite); +int getc(FILE *); +int getchar(void); +char *gets(char *); +void perror(const char *) __cold; +int printf(const char * __restrict, ...) __printflike(1, 2); +int putc(int, FILE *); +int putchar(int); +int puts(const char *); +int remove(const char *); +int rename (const char *__old, const char *__new); +void rewind(FILE *); +int scanf(const char * __restrict, ...) __scanflike(1, 2); +void setbuf(FILE * __restrict, char * __restrict); +int setvbuf(FILE * __restrict, char * __restrict, int, size_t); +int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3) __swift_unavailable("Use snprintf instead."); +int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3); +FILE *tmpfile(void); + +__swift_unavailable("Use mkstemp(3) instead.") +#if !defined(_POSIX_C_SOURCE) +__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.") +#endif +char *tmpnam(char *); +int ungetc(int, FILE *); +int vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0); +int vprintf(const char * __restrict, va_list) __printflike(1, 0); +int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0) __swift_unavailable("Use vsnprintf instead."); +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.1-1988 + */ + +#if __DARWIN_C_LEVEL >= 198808L +#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */ + +__BEGIN_DECLS +#include <_ctermid.h> + +#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE) +FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen)); +#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen)); +#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +int fileno(FILE *); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 198808L */ + + +/* Additional functionality provided by: + * POSIX.2-1992 C Language Binding Option + */ +#if TARGET_OS_EMBEDDED +#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) +#else +#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) +#endif + +#if __DARWIN_C_LEVEL >= 199209L +__BEGIN_DECLS +int pclose(FILE *) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable."); +#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE) +FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable."); +#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable."); +#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 199209L */ + +#undef __swift_unavailable_on + +/* Additional functionality provided by: + * POSIX.1c-1995, + * POSIX.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + */ + +#if __DARWIN_C_LEVEL >= 199506L + +/* Functions internal to the implementation. */ +__BEGIN_DECLS +int __srget(FILE *); +int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0); +int __swbuf(int, FILE *); +__END_DECLS + +/* + * The __sfoo macros are here so that we can + * define function versions in the C library. + */ +#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) +#if defined(__GNUC__) && defined(__STDC__) +__header_always_inline int __sputc(int _c, FILE *_p) { + if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) + return (*_p->_p++ = _c); + else + return (__swbuf(_c, _p)); +} +#else +/* + * This has been tuned to generate reasonable code on the vax using pcc. + */ +#define __sputc(c, p) \ + (--(p)->_w < 0 ? \ + (p)->_w >= (p)->_lbfsize ? \ + (*(p)->_p = (c)), *(p)->_p != '\n' ? \ + (int)*(p)->_p++ : \ + __swbuf('\n', p) : \ + __swbuf((int)(c), p) : \ + (*(p)->_p = (c), (int)*(p)->_p++)) +#endif + +#define __sfeof(p) (((p)->_flags & __SEOF) != 0) +#define __sferror(p) (((p)->_flags & __SERR) != 0) +#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) +#define __sfileno(p) ((p)->_file) + +__BEGIN_DECLS +void flockfile(FILE *); +int ftrylockfile(FILE *); +void funlockfile(FILE *); +int getc_unlocked(FILE *); +int getchar_unlocked(void); +int putc_unlocked(int, FILE *); +int putchar_unlocked(int); + +/* Removed in Issue 6 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L +int getw(FILE *); +int putw(int, FILE *); +#endif + +__swift_unavailable("Use mkstemp(3) instead.") +#if !defined(_POSIX_C_SOURCE) +__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.") +#endif +char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam); +__END_DECLS + +#ifndef lint +#define getc_unlocked(fp) __sgetc(fp) +#define putc_unlocked(x, fp) __sputc(x, fp) +#endif /* lint */ + +#define getchar_unlocked() getc_unlocked(stdin) +#define putchar_unlocked(x) putc_unlocked(x, stdout) +#endif /* __DARWIN_C_LEVEL >= 199506L */ + + + +/* Additional functionality provided by: + * POSIX.1-2001 + * ISO C99 + */ + +#if __DARWIN_C_LEVEL >= 200112L +#include + +__BEGIN_DECLS +int fseeko(FILE * __stream, off_t __offset, int __whence); +off_t ftello(FILE * __stream); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L */ + +#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) +__BEGIN_DECLS +int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4); +int vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0); +int vscanf(const char * __restrict __format, va_list) __scanflike(1, 0); +int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0); +int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */ + + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +#include + +__BEGIN_DECLS +int dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +int vdprintf(int, const char * __restrict, va_list) __printflike(2, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +ssize_t getdelim(char ** __restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +ssize_t getline(char ** __restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); +FILE *open_memstream(char **__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + + + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +__BEGIN_DECLS +extern __const int sys_nerr; /* perror(3) external variables */ +extern __const char *__const sys_errlist[]; + +int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3); +char *ctermid_r(char *); +char *fgetln(FILE *, size_t *); +__const char *fmtcheck(const char *, const char *); +int fpurge(FILE *); +void setbuffer(FILE *, char *, int); +int setlinebuf(FILE *); +int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0); +FILE *zopen(const char *, const char *, int); + + +/* + * Stdio function-access interface. + */ +FILE *funopen(const void *, + int (* _Nullable)(void *, char *, int), + int (* _Nullable)(void *, const char *, int), + fpos_t (* _Nullable)(void *, fpos_t, int), + int (* _Nullable)(void *)); +__END_DECLS +#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) +#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) + +#define feof_unlocked(p) __sfeof(p) +#define ferror_unlocked(p) __sferror(p) +#define clearerr_unlocked(p) __sclearerr(p) +#define fileno_unlocked(p) __sfileno(p) + +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#else /* UNIFDEF_DRIVERKIT */ +#define EOF (-1) + +__BEGIN_DECLS +int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3); +#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) +int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4); +int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0); +int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0); +#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */ +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3); +int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0); +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ +__END_DECLS +#endif /* UNIFDEF_DRIVERKIT */ + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus) +/* Security checking functions. */ +#include +#endif + +#endif /* _STDIO_H_ */ diff --git a/include/stdlib.h b/include/stdlib.h new file mode 100644 index 0000000..dcefad0 --- /dev/null +++ b/include/stdlib.h @@ -0,0 +1,406 @@ +/* + * Copyright (c) 2000, 2002 - 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdlib.h 8.5 (Berkeley) 5/19/95 + */ + +#ifndef _STDLIB_H_ +#define _STDLIB_H_ + +#include +#include + +#include <_types.h> +#if !defined(_ANSI_SOURCE) +#ifndef UNIFDEF_DRIVERKIT +#include +#endif /* UNIFDEF_DRIVERKIT */ +#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#include +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE */ + +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +#include + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#include +#include +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#include + +typedef struct { + int quot; /* quotient */ + int rem; /* remainder */ +} div_t; + +typedef struct { + long quot; /* quotient */ + long rem; /* remainder */ +} ldiv_t; + +#if !__DARWIN_NO_LONG_LONG +typedef struct { + long long quot; + long long rem; +} lldiv_t; +#endif /* !__DARWIN_NO_LONG_LONG */ + +#include + +#ifndef UNIFDEF_DRIVERKIT +#define EXIT_FAILURE 1 +#define EXIT_SUCCESS 0 +#endif /* UNIFDEF_DRIVERKIT */ + +#define RAND_MAX 0x7fffffff + +#ifdef _USE_EXTENDED_LOCALES_ +#include <_xlocale.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +#ifndef MB_CUR_MAX +#ifdef _USE_EXTENDED_LOCALES_ +#define MB_CUR_MAX (___mb_cur_max()) +#ifndef MB_CUR_MAX_L +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif /* !MB_CUR_MAX_L */ +#else /* !_USE_EXTENDED_LOCALES_ */ +extern int __mb_cur_max; +#define MB_CUR_MAX __mb_cur_max +#endif /* _USE_EXTENDED_LOCALES_ */ +#endif /* MB_CUR_MAX */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) \ + && defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L) +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif + +#ifndef UNIFDEF_DRIVERKIT +#include +#endif /* UNIFDEF_DRIVERKIT */ + +__BEGIN_DECLS +void abort(void) __cold __dead2; +int abs(int) __pure2; +#ifndef UNIFDEF_DRIVERKIT +int atexit(void (* _Nonnull)(void)); +#endif /* UNIFDEF_DRIVERKIT */ +double atof(const char *); +int atoi(const char *); +long atol(const char *); +#if !__DARWIN_NO_LONG_LONG +long long + atoll(const char *); +#endif /* !__DARWIN_NO_LONG_LONG */ +void *bsearch(const void *__key, const void *__base, size_t __nel, + size_t __width, int (* _Nonnull __compar)(const void *, const void *)); +#ifndef UNIFDEF_DRIVERKIT +/* calloc is now declared in _malloc.h */ +#endif /* UNIFDEF_DRIVERKIT */ +div_t div(int, int) __pure2; +#ifndef UNIFDEF_DRIVERKIT +void exit(int) __dead2; +/* free is now declared in _malloc.h */ +char *getenv(const char *); +#endif /* UNIFDEF_DRIVERKIT */ +long labs(long) __pure2; +ldiv_t ldiv(long, long) __pure2; +#if !__DARWIN_NO_LONG_LONG +long long + llabs(long long); +lldiv_t lldiv(long long, long long); +#endif /* !__DARWIN_NO_LONG_LONG */ +#ifndef UNIFDEF_DRIVERKIT +/* malloc is now declared in _malloc.h */ +#endif /* UNIFDEF_DRIVERKIT */ +int mblen(const char *__s, size_t __n); +size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t); +int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); +#ifndef UNIFDEF_DRIVERKIT +/* posix_memalign is now declared in _malloc.h */ +#endif /* UNIFDEF_DRIVERKIT */ +void qsort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)); +#ifndef UNIFDEF_DRIVERKIT +int rand(void) __swift_unavailable("Use arc4random instead."); +/* realloc is now declared in _malloc.h */ +void srand(unsigned) __swift_unavailable("Use arc4random instead."); +#endif /* UNIFDEF_DRIVERKIT */ +double strtod(const char *, char **) __DARWIN_ALIAS(strtod); +float strtof(const char *, char **) __DARWIN_ALIAS(strtof); +long strtol(const char *__str, char **__endptr, int __base); +long double + strtold(const char *, char **); +#if !__DARWIN_NO_LONG_LONG +long long + strtoll(const char *__str, char **__endptr, int __base); +#endif /* !__DARWIN_NO_LONG_LONG */ +unsigned long + strtoul(const char *__str, char **__endptr, int __base); +#if !__DARWIN_NO_LONG_LONG +unsigned long long + strtoull(const char *__str, char **__endptr, int __base); +#endif /* !__DARWIN_NO_LONG_LONG */ +#ifndef UNIFDEF_DRIVERKIT + +#if TARGET_OS_EMBEDDED +#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) +#else +#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) +#endif + +__swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable") +__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED +__WATCHOS_PROHIBITED __TVOS_PROHIBITED +int system(const char *) __DARWIN_ALIAS_C(system); + +#undef __swift_unavailable_on +#endif /* UNIFDEF_DRIVERKIT */ + +size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t); +int wctomb(char *, wchar_t); + +#ifndef UNIFDEF_DRIVERKIT +#ifndef _ANSI_SOURCE +void _Exit(int) __dead2; +long a64l(const char *); +double drand48(void); +char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */ +double erand48(unsigned short[3]); +char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */ +char *gcvt(double, int, char *); /* LEGACY */ +int getsubopt(char **, char * const *, char **); +int grantpt(int); +#if __DARWIN_UNIX03 +char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */ +#else /* !__DARWIN_UNIX03 */ +char *initstate(unsigned long, char *, long); +#endif /* __DARWIN_UNIX03 */ +long jrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead."); +char *l64a(long); +void lcong48(unsigned short[7]); +long lrand48(void) __swift_unavailable("Use arc4random instead."); +char *mktemp(char *); +int mkstemp(char *); +long mrand48(void) __swift_unavailable("Use arc4random instead."); +long nrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead."); +int posix_openpt(int); +char *ptsname(int); + +#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3)); +#endif + +int putenv(char *) __DARWIN_ALIAS(putenv); +long random(void) __swift_unavailable("Use arc4random instead."); +int rand_r(unsigned *) __swift_unavailable("Use arc4random instead."); +#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH) +char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath); +#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */ +char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath); +#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */ +unsigned short + *seed48(unsigned short[3]); +int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv); +#if __DARWIN_UNIX03 +void setkey(const char *) __DARWIN_ALIAS(setkey); +#else /* !__DARWIN_UNIX03 */ +int setkey(const char *); +#endif /* __DARWIN_UNIX03 */ +char *setstate(const char *); +void srand48(long); +#if __DARWIN_UNIX03 +void srandom(unsigned); +#else /* !__DARWIN_UNIX03 */ +void srandom(unsigned long); +#endif /* __DARWIN_UNIX03 */ +int unlockpt(int); +#if __DARWIN_UNIX03 +int unsetenv(const char *) __DARWIN_ALIAS(unsetenv); +#else /* !__DARWIN_UNIX03 */ +void unsetenv(const char *); +#endif /* __DARWIN_UNIX03 */ +#endif /* !_ANSI_SOURCE */ +#endif /* UNIFDEF_DRIVERKIT */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#include +#ifndef UNIFDEF_DRIVERKIT +#include +#include +#endif /* UNIFDEF_DRIVERKIT */ +#include <_types/_uint32_t.h> + +uint32_t arc4random(void); +#ifndef UNIFDEF_DRIVERKIT +void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/) + __OSX_DEPRECATED(10.0, 10.12, "use arc4random_stir") + __IOS_DEPRECATED(2.0, 10.0, "use arc4random_stir") + __TVOS_DEPRECATED(2.0, 10.0, "use arc4random_stir") + __WATCHOS_DEPRECATED(1.0, 3.0, "use arc4random_stir"); +#endif /* UNIFDEF_DRIVERKIT */ +void arc4random_buf(void * __buf, size_t __nbytes) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +void arc4random_stir(void); +uint32_t + arc4random_uniform(uint32_t __upper_bound) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +#ifdef __BLOCKS__ +#ifndef UNIFDEF_DRIVERKIT +int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* UNIFDEF_DRIVERKIT */ +void *bsearch_b(const void *__key, const void *__base, size_t __nel, + size_t __width, int (^ _Nonnull __compar)(const void *, const void *)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ + +#ifndef UNIFDEF_DRIVERKIT + /* getcap(3) functions */ +char *cgetcap(char *, const char *, int); +int cgetclose(void); +int cgetent(char **, char **, const char *); +int cgetfirst(char **, char **); +int cgetmatch(const char *, const char *); +int cgetnext(char **, char **); +int cgetnum(char *, const char *, long *); +int cgetset(const char *); +int cgetstr(char *, const char *, char **); +int cgetustr(char *, const char *, char **); + +int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +char *devname(dev_t, mode_t); +char *devname_r(dev_t, mode_t, char *buf, int len); +char *getbsize(int *, long *); +int getloadavg(double [], int); +const char + *getprogname(void); +void setprogname(const char *); +#endif /* UNIFDEF_DRIVERKIT */ + +#ifdef __BLOCKS__ +#if __has_attribute(noescape) +#define __sort_noescape __attribute__((__noescape__)) +#else +#define __sort_noescape +#endif +#endif /* __BLOCKS__ */ + +int heapsort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)); +#ifdef __BLOCKS__ +int heapsort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +int mergesort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)); +#ifdef __BLOCKS__ +int mergesort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +#ifndef UNIFDEF_DRIVERKIT +void psort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#ifdef __BLOCKS__ +void psort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +void psort_r(void *__base, size_t __nel, size_t __width, void *, + int (* _Nonnull __compar)(void *, const void *, const void *)) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* UNIFDEF_DRIVERKIT */ +#ifdef __BLOCKS__ +void qsort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +void qsort_r(void *__base, size_t __nel, size_t __width, void *, + int (* _Nonnull __compar)(void *, const void *, const void *)); +int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table, + unsigned __endbyte); +int rpmatch(const char *) + __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0)); +int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table, + unsigned __endbyte); +#ifndef UNIFDEF_DRIVERKIT +void sranddev(void); +void srandomdev(void); +void *reallocf(void *__ptr, size_t __size) __alloc_size(2); +#endif /* UNIFDEF_DRIVERKIT */ +#if !__DARWIN_NO_LONG_LONG +long long + strtoq(const char *__str, char **__endptr, int __base); +unsigned long long + strtouq(const char *__str, char **__endptr, int __base); +#endif /* !__DARWIN_NO_LONG_LONG */ +#ifndef UNIFDEF_DRIVERKIT +extern char *suboptarg; /* getsubopt(3) external variable */ +/* valloc is now declared in _malloc.h */ +#endif /* UNIFDEF_DRIVERKIT */ +#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison mbstowcs mbtowc wcstombs wctomb +#endif +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* _STDLIB_H_ */ diff --git a/include/strhash.h b/include/strhash.h new file mode 100644 index 0000000..f8fa55a --- /dev/null +++ b/include/strhash.h @@ -0,0 +1,68 @@ +#ifndef _STRHASH_H_INCLUDE +#define _STRHASH_H_INCLUDE + +/* $FreeBSD: /repoman/r/ncvs/src/include/strhash.h,v 1.3 1999/08/28 04:59:30 peter Exp $ */ + +/* + * + * Copyright 1990 + * Terry Jones & Jordan Hubbard + * + * PCS Computer Systeme, GmbH. + * Munich, West Germany + * + * + * All rights reserved. + * + * This is unsupported software and is subject to change without notice. + * the author makes no representations about the suitability of this software + * for any purpose. It is supplied "as is" without express or implied + * warranty. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of the author not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. + * + */ + +/* + * This is the definition file for hash.c. The plunderer from down-under + * did the code, I just helped define the spec. That's why his name gets + * to go first. + */ + +#define HASH_SZ 97 + +typedef struct _node { + char *key; + void *data; + struct _node *next; +} hash_node; + +typedef struct { + int size; + hash_node **buckets; +} hash_table; + +#include + +__BEGIN_DECLS +hash_table *hash_create(int size); +void hash_destroy(hash_table *table, char *key, + void (*nukefunc)(char *k, void *d)); +void *hash_search(hash_table *table, char *key, void *datum, + void (*replace_func)(void *d)); +void hash_traverse(hash_table *table, + int (*func)(char *k, void *d, void *arg), void *arg); +void hash_purge(hash_table *table, void (*purge_func)(char *k, void *d)); + +#ifdef HASH_STATS +extern void hash_stats(); +#endif +__END_DECLS + +#endif /* _STRHASH_H_INCLUDE */ diff --git a/include/string.h b/include/string.h new file mode 100644 index 0000000..cee20b1 --- /dev/null +++ b/include/string.h @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)string.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _STRING_H_ +#define _STRING_H_ + +#include <_types.h> +#include +#include +#include +#include + +/* ANSI-C */ + +__BEGIN_DECLS +void *memchr(const void *__s, int __c, size_t __n); +int memcmp(const void *__s1, const void *__s2, size_t __n); +void *memcpy(void *__dst, const void *__src, size_t __n); +void *memmove(void *__dst, const void *__src, size_t __len); +void *memset(void *__b, int __c, size_t __len); +#ifndef UNIFDEF_DRIVERKIT +char *strcat(char *__s1, const char *__s2); +#endif /* UNIFDEF_DRIVERKIT */ +char *strchr(const char *__s, int __c); +int strcmp(const char *__s1, const char *__s2); +int strcoll(const char *__s1, const char *__s2); +#ifndef UNIFDEF_DRIVERKIT +char *strcpy(char *__dst, const char *__src); +#endif /* UNIFDEF_DRIVERKIT */ +size_t strcspn(const char *__s, const char *__charset); +char *strerror(int __errnum) __DARWIN_ALIAS(strerror); +size_t strlen(const char *__s); +char *strncat(char *__s1, const char *__s2, size_t __n); +int strncmp(const char *__s1, const char *__s2, size_t __n); +char *strncpy(char *__dst, const char *__src, size_t __n); +char *strpbrk(const char *__s, const char *__charset); +char *strrchr(const char *__s, int __c); +size_t strspn(const char *__s, const char *__charset); +char *strstr(const char *__big, const char *__little); +char *strtok(char *__str, const char *__sep); +size_t strxfrm(char *__s1, const char *__s2, size_t __n); +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.1c-1995, + * POSIX.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + */ + +#if __DARWIN_C_LEVEL >= 199506L +__BEGIN_DECLS +char *strtok_r(char *__str, const char *__sep, char **__lasts); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 199506L */ + + + +/* Additional functionality provided by: + * POSIX.1-2001 + */ + +#if __DARWIN_C_LEVEL >= 200112L +__BEGIN_DECLS +int strerror_r(int __errnum, char *__strerrbuf, size_t __buflen); +char *strdup(const char *__s1); +void *memccpy(void *__dst, const void *__src, int __c, size_t __n); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L */ + + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +__BEGIN_DECLS +#ifndef UNIFDEF_DRIVERKIT +char *stpcpy(char *__dst, const char *__src); +#endif /* UNIFDEF_DRIVERKIT */ +char *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +char *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +size_t strnlen(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +char *strsignal(int __sig); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + +/* C11 Annex K */ + +#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 +#include +#include + +__BEGIN_DECLS +errno_t memset_s(void *__s, rsize_t __smax, int __c, rsize_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); +__END_DECLS +#endif + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#include + +__BEGIN_DECLS +void *memmem(const void *__big, size_t __big_len, const void *__little, size_t __little_len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +void memset_pattern4(void *__b, const void *__pattern4, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0); +void memset_pattern8(void *__b, const void *__pattern8, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0); +void memset_pattern16(void *__b, const void *__pattern16, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0); + +char *strcasestr(const char *__big, const char *__little); +char *strnstr(const char *__big, const char *__little, size_t __len); +size_t strlcat(char *__dst, const char *__source, size_t __size); +size_t strlcpy(char *__dst, const char *__source, size_t __size); +void strmode(int __mode, char *__bp); +char *strsep(char **__stringp, const char *__delim); + +/* SUS places swab() in unistd.h. It is listed here for source compatibility */ +void swab(const void * __restrict, void * __restrict, ssize_t); + +__OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) +__TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1) +int timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len); +__END_DECLS + +/* Some functions historically defined in string.h were placed in strings.h + * by SUS. We are using "strings.h" instead of to avoid an issue + * where /Developer/Headers/FlatCarbon/Strings.h could be included instead on + * case-insensitive file systems. + */ +#include "strings.h" +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus) +/* Security checking functions. */ +#include +#endif + +#endif /* _STRING_H_ */ diff --git a/include/stringlist.h b/include/stringlist.h new file mode 100644 index 0000000..7f2925a --- /dev/null +++ b/include/stringlist.h @@ -0,0 +1,57 @@ +/* $NetBSD: stringlist.h,v 1.2 1997/01/17 06:11:36 lukem Exp $ */ + +/* + * Copyright (c) 1994 Christos Zoulas + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christos Zoulas. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: /repoman/r/ncvs/src/include/stringlist.h,v 1.3 2003/01/19 01:16:00 obrien Exp $ + */ + +#ifndef _STRINGLIST_H +#define _STRINGLIST_H +#include +#include + +/* + * Simple string list + */ +typedef struct _stringlist { + char **sl_str; + size_t sl_max; + size_t sl_cur; +} StringList; + +__BEGIN_DECLS +StringList *sl_init(void); +int sl_add(StringList *, char *); +void sl_free(StringList *, int); +char *sl_find(StringList *, char *); +__END_DECLS + +#endif /* _STRINGLIST_H */ diff --git a/include/strings.h b/include/strings.h new file mode 100644 index 0000000..c0e915f --- /dev/null +++ b/include/strings.h @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)strings.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _STRINGS_H_ +#define _STRINGS_H_ + +#include <_types.h> + +#include +#include +#include + +__BEGIN_DECLS +/* Removed in Issue 7 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L +int bcmp(const void *, const void *, size_t) __POSIX_C_DEPRECATED(200112L); +void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L); +void bzero(void *, size_t) __POSIX_C_DEPRECATED(200112L); +char *index(const char *, int) __POSIX_C_DEPRECATED(200112L); +char *rindex(const char *, int) __POSIX_C_DEPRECATED(200112L); +#endif + +int ffs(int); +int strcasecmp(const char *, const char *); +int strncasecmp(const char *, const char *, size_t); +__END_DECLS + +/* Darwin extensions */ +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +__BEGIN_DECLS +int ffsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +int ffsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); +int fls(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +int flsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +int flsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); +__END_DECLS + +#include +#endif + +#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus) +/* Security checking functions. */ +#include +#endif + +#endif /* _STRINGS_H_ */ + diff --git a/include/struct.h b/include/struct.h new file mode 100644 index 0000000..c26849e --- /dev/null +++ b/include/struct.h @@ -0,0 +1,79 @@ +/*- + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)struct.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _STRUCT_H_ +#define _STRUCT_H_ + +/* Offset of the field in the structure. */ +#define fldoff(name, field) \ + ((int)&(((struct name *)0)->field)) + +/* Size of the field in the structure. */ +#define fldsiz(name, field) \ + (sizeof(((struct name *)0)->field)) + +/* Address of the structure from a field. */ +#define strbase(name, addr, field) \ + ((struct name *)((char *)(addr) - fldoff(name, field))) + +/* + * countof() cannot be safely used in a _Static_assert statement, so we provide + * an unsafe variant that does not verify the input array is statically-defined. + */ +#define countof_unsafe(arr) \ + (sizeof(arr) / sizeof(arr[0])) + +/* Number of elements in a statically-defined array */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && __GNUC__ +#define countof(arr) ({ \ + _Static_assert( \ + !__builtin_types_compatible_p(typeof(arr), typeof(&(arr)[0])), \ + "array must be statically defined"); \ + (sizeof(arr) / sizeof(arr[0])); \ +}) +#else +#define countof(arr) \ + countof_unsafe(arr) +#endif + +/* Length of a statically-defined string (does not include null terminator) */ +#define lenof(str) \ + (sizeof(str) - 1) + +/* Last index of a statically-defined array */ +#define lastof(arr) \ + (countof(arr) - 1) + +#endif /* !_STRUCT_H_ */ diff --git a/include/sys/acl.h b/include/sys/acl.h new file mode 100644 index 0000000..62240bf --- /dev/null +++ b/include/sys/acl.h @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2004, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _SYS_ACL_H +#define _SYS_ACL_H + +#include +#include + +#define __DARWIN_ACL_READ_DATA (1<<1) +#define __DARWIN_ACL_LIST_DIRECTORY __DARWIN_ACL_READ_DATA +#define __DARWIN_ACL_WRITE_DATA (1<<2) +#define __DARWIN_ACL_ADD_FILE __DARWIN_ACL_WRITE_DATA +#define __DARWIN_ACL_EXECUTE (1<<3) +#define __DARWIN_ACL_SEARCH __DARWIN_ACL_EXECUTE +#define __DARWIN_ACL_DELETE (1<<4) +#define __DARWIN_ACL_APPEND_DATA (1<<5) +#define __DARWIN_ACL_ADD_SUBDIRECTORY __DARWIN_ACL_APPEND_DATA +#define __DARWIN_ACL_DELETE_CHILD (1<<6) +#define __DARWIN_ACL_READ_ATTRIBUTES (1<<7) +#define __DARWIN_ACL_WRITE_ATTRIBUTES (1<<8) +#define __DARWIN_ACL_READ_EXTATTRIBUTES (1<<9) +#define __DARWIN_ACL_WRITE_EXTATTRIBUTES (1<<10) +#define __DARWIN_ACL_READ_SECURITY (1<<11) +#define __DARWIN_ACL_WRITE_SECURITY (1<<12) +#define __DARWIN_ACL_CHANGE_OWNER (1<<13) +#define __DARWIN_ACL_SYNCHRONIZE (1<<20) + +#define __DARWIN_ACL_EXTENDED_ALLOW 1 +#define __DARWIN_ACL_EXTENDED_DENY 2 + +#define __DARWIN_ACL_ENTRY_INHERITED (1<<4) +#define __DARWIN_ACL_ENTRY_FILE_INHERIT (1<<5) +#define __DARWIN_ACL_ENTRY_DIRECTORY_INHERIT (1<<6) +#define __DARWIN_ACL_ENTRY_LIMIT_INHERIT (1<<7) +#define __DARWIN_ACL_ENTRY_ONLY_INHERIT (1<<8) +#define __DARWIN_ACL_FLAG_NO_INHERIT (1<<17) + +/* + * Implementation constants. + * + * The ACL_TYPE_EXTENDED binary format permits 169 entries plus + * the ACL header in a page. Give ourselves some room to grow; + * this limit is arbitrary. + */ +#define ACL_MAX_ENTRIES 128 + +/* 23.2.2 Individual object access permissions - nonstandard */ +typedef enum { + ACL_READ_DATA = __DARWIN_ACL_READ_DATA, + ACL_LIST_DIRECTORY = __DARWIN_ACL_LIST_DIRECTORY, + ACL_WRITE_DATA = __DARWIN_ACL_WRITE_DATA, + ACL_ADD_FILE = __DARWIN_ACL_ADD_FILE, + ACL_EXECUTE = __DARWIN_ACL_EXECUTE, + ACL_SEARCH = __DARWIN_ACL_SEARCH, + ACL_DELETE = __DARWIN_ACL_DELETE, + ACL_APPEND_DATA = __DARWIN_ACL_APPEND_DATA, + ACL_ADD_SUBDIRECTORY = __DARWIN_ACL_ADD_SUBDIRECTORY, + ACL_DELETE_CHILD = __DARWIN_ACL_DELETE_CHILD, + ACL_READ_ATTRIBUTES = __DARWIN_ACL_READ_ATTRIBUTES, + ACL_WRITE_ATTRIBUTES = __DARWIN_ACL_WRITE_ATTRIBUTES, + ACL_READ_EXTATTRIBUTES = __DARWIN_ACL_READ_EXTATTRIBUTES, + ACL_WRITE_EXTATTRIBUTES = __DARWIN_ACL_WRITE_EXTATTRIBUTES, + ACL_READ_SECURITY = __DARWIN_ACL_READ_SECURITY, + ACL_WRITE_SECURITY = __DARWIN_ACL_WRITE_SECURITY, + ACL_CHANGE_OWNER = __DARWIN_ACL_CHANGE_OWNER, + ACL_SYNCHRONIZE = __DARWIN_ACL_SYNCHRONIZE, +} acl_perm_t; + +/* 23.2.5 ACL entry tag type bits - nonstandard */ +typedef enum { + ACL_UNDEFINED_TAG = 0, + ACL_EXTENDED_ALLOW = __DARWIN_ACL_EXTENDED_ALLOW, + ACL_EXTENDED_DENY = __DARWIN_ACL_EXTENDED_DENY +} acl_tag_t; + +/* 23.2.6 Individual ACL types */ +typedef enum { + ACL_TYPE_EXTENDED = 0x00000100, +/* Posix 1003.1e types - not supported */ + ACL_TYPE_ACCESS = 0x00000000, + ACL_TYPE_DEFAULT = 0x00000001, +/* The following types are defined on FreeBSD/Linux - not supported */ + ACL_TYPE_AFS = 0x00000002, + ACL_TYPE_CODA = 0x00000003, + ACL_TYPE_NTFS = 0x00000004, + ACL_TYPE_NWFS = 0x00000005 +} acl_type_t; + +/* 23.2.7 ACL qualifier constants */ + +#define ACL_UNDEFINED_ID NULL /* XXX ? */ + +/* 23.2.8 ACL Entry Constants */ +typedef enum { + ACL_FIRST_ENTRY = 0, + ACL_NEXT_ENTRY = -1, + ACL_LAST_ENTRY = -2 +} acl_entry_id_t; + +/* nonstandard ACL / entry flags */ +typedef enum { + ACL_FLAG_DEFER_INHERIT = (1 << 0), /* tentative */ + ACL_FLAG_NO_INHERIT = __DARWIN_ACL_FLAG_NO_INHERIT, + ACL_ENTRY_INHERITED = __DARWIN_ACL_ENTRY_INHERITED, + ACL_ENTRY_FILE_INHERIT = __DARWIN_ACL_ENTRY_FILE_INHERIT, + ACL_ENTRY_DIRECTORY_INHERIT = __DARWIN_ACL_ENTRY_DIRECTORY_INHERIT, + ACL_ENTRY_LIMIT_INHERIT = __DARWIN_ACL_ENTRY_LIMIT_INHERIT, + ACL_ENTRY_ONLY_INHERIT = __DARWIN_ACL_ENTRY_ONLY_INHERIT +} acl_flag_t; + +/* "External" ACL types */ + +struct _acl; +struct _acl_entry; +struct _acl_permset; +struct _acl_flagset; + +typedef struct _acl *acl_t; +typedef struct _acl_entry *acl_entry_t; +typedef struct _acl_permset *acl_permset_t; +typedef struct _acl_flagset *acl_flagset_t; + +typedef u_int64_t acl_permset_mask_t; + +__BEGIN_DECLS +/* 23.1.6.1 ACL Storage Management */ +extern acl_t acl_dup(acl_t acl); +extern int acl_free(void *obj_p); +extern acl_t acl_init(int count); + +/* 23.1.6.2 (1) ACL Entry manipulation */ +extern int acl_copy_entry(acl_entry_t dest_d, acl_entry_t src_d); +extern int acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p); +extern int acl_create_entry_np(acl_t *acl_p, acl_entry_t *entry_p, int entry_index); +extern int acl_delete_entry(acl_t acl, acl_entry_t entry_d); +extern int acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p); +extern int acl_valid(acl_t acl); +extern int acl_valid_fd_np(int fd, acl_type_t type, acl_t acl); +extern int acl_valid_file_np(const char *path, acl_type_t type, acl_t acl); +extern int acl_valid_link_np(const char *path, acl_type_t type, acl_t acl); + +/* 23.1.6.2 (2) Manipulate permissions within an ACL entry */ +extern int acl_add_perm(acl_permset_t permset_d, acl_perm_t perm); +extern int acl_calc_mask(acl_t *acl_p); /* not supported */ +extern int acl_clear_perms(acl_permset_t permset_d); +extern int acl_delete_perm(acl_permset_t permset_d, acl_perm_t perm); +extern int acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm); +extern int acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p); +extern int acl_set_permset(acl_entry_t entry_d, acl_permset_t permset_d); + +/* nonstandard - manipulate permissions within an ACL entry using bitmasks */ +extern int acl_maximal_permset_mask_np(acl_permset_mask_t * mask_p) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +extern int acl_get_permset_mask_np(acl_entry_t entry_d, acl_permset_mask_t * mask_p) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +extern int acl_set_permset_mask_np(acl_entry_t entry_d, acl_permset_mask_t mask) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); + +/* nonstandard - manipulate flags on ACLs and entries */ +extern int acl_add_flag_np(acl_flagset_t flagset_d, acl_flag_t flag); +extern int acl_clear_flags_np(acl_flagset_t flagset_d); +extern int acl_delete_flag_np(acl_flagset_t flagset_d, acl_flag_t flag); +extern int acl_get_flag_np(acl_flagset_t flagset_d, acl_flag_t flag); +extern int acl_get_flagset_np(void *obj_p, acl_flagset_t *flagset_p); +extern int acl_set_flagset_np(void *obj_p, acl_flagset_t flagset_d); + +/* 23.1.6.2 (3) Manipulate ACL entry tag type and qualifier */ +extern void *acl_get_qualifier(acl_entry_t entry_d); +extern int acl_get_tag_type(acl_entry_t entry_d, acl_tag_t *tag_type_p); +extern int acl_set_qualifier(acl_entry_t entry_d, const void *tag_qualifier_p); +extern int acl_set_tag_type(acl_entry_t entry_d, acl_tag_t tag_type); + +/* 23.1.6.3 ACL manipulation on an Object */ +extern int acl_delete_def_file(const char *path_p); /* not supported */ +extern acl_t acl_get_fd(int fd); +extern acl_t acl_get_fd_np(int fd, acl_type_t type); +extern acl_t acl_get_file(const char *path_p, acl_type_t type); +extern acl_t acl_get_link_np(const char *path_p, acl_type_t type); +extern int acl_set_fd(int fd, acl_t acl); +extern int acl_set_fd_np(int fd, acl_t acl, acl_type_t acl_type); +extern int acl_set_file(const char *path_p, acl_type_t type, acl_t acl); +extern int acl_set_link_np(const char *path_p, acl_type_t type, acl_t acl); + +/* 23.1.6.4 ACL Format translation */ +extern ssize_t acl_copy_ext(void *buf_p, acl_t acl, ssize_t size); +extern ssize_t acl_copy_ext_native(void *buf_p, acl_t acl, ssize_t size); +extern acl_t acl_copy_int(const void *buf_p); +extern acl_t acl_copy_int_native(const void *buf_p); +extern acl_t acl_from_text(const char *buf_p); +extern ssize_t acl_size(acl_t acl); +extern char *acl_to_text(acl_t acl, ssize_t *len_p); +__END_DECLS + +#endif /* _SYS_ACL_H */ diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h new file mode 100644 index 0000000..451bb22 --- /dev/null +++ b/include/sys/cdefs.h @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2006 - 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*********************************************************************** + * Not to be installed in /usr/include + ***********************************************************************/ + +#ifndef _LIBC_SYS_CDEFS_H_ +#define _LIBC_SYS_CDEFS_H_ + +/* + * Now include the real sys/cdefs.h. The checks in libc-features.h will assure + * that those macros are consistent with the current build environment. + */ +#include_next +#ifndef _LIBC_NO_FEATURE_VERIFICATION +#if defined(__arm64__) || defined(__arm__) || defined(__i386__) || defined(__x86_64__) +# include "libc-features.h" +#else +# error "Unknown architecture." +#endif +#endif /* _LIBC_NO_FEATURE_VERIFICATION */ + +/* + * symbol suffixes used for symbol versioning + */ +#if defined(VARIANT_LEGACY) +# define LIBC_SUF_UNIX03 /* nothing */ +# define LIBC_SUF_64_BIT_INO_T /* nothing */ +# define LIBC_SUF_NON_CANCELABLE /* nothing */ +# define LIBC_SUF_1050 /* nothing */ +#else /* !VARIANT_LEGACY */ +# if __DARWIN_ONLY_UNIX_CONFORMANCE +# define LIBC_SUF_UNIX03 /* nothing */ +# else /* !__DARWIN_ONLY_UNIX_CONFORMANCE */ +# define LIBC_SUF_UNIX03 "$UNIX2003" +# endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */ + +# if defined(VARIANT_INODE32) +# define LIBC_SUF_64_BIT_INO_T /* nothing */ +# else /* !VARIANT_INODE32 */ +# if __DARWIN_ONLY_64_BIT_INO_T +# define LIBC_SUF_64_BIT_INO_T /* nothing */ +# else /* !__DARWIN_ONLY_64_BIT_INO_T */ +# define LIBC_SUF_64_BIT_INO_T "$INODE64" +# endif /* __DARWIN_ONLY_64_BIT_INO_T */ +# endif /* VARIANT_INODE32 */ + +# if defined(VARIANT_CANCELABLE) +# define LIBC_SUF_NON_CANCELABLE /* nothing */ +# else /* !LIBC_NON_CANCELABLE */ +# define LIBC_SUF_NON_CANCELABLE "$NOCANCEL" +# endif /* LIBC_NON_CANCELABLE */ + +# if defined(VARIANT_PRE1050) +# define LIBC_SUF_1050 /* nothing */ +# else /* !VARIANT_PRE1050 */ +# if __DARWIN_ONLY_VERS_1050 +# define LIBC_SUF_1050 /* nothing */ +# else /* !__DARWIN_ONLY_VERS_1050 */ +# define LIBC_SUF_1050 "$1050" +# endif /* __DARWIN_ONLY_VERS_1050 */ +# endif /* VARIANT_PRE1050 */ + +#endif /* LIBC_UNIX03 */ + +#define LIBC_SUF_EXTSN "$DARWIN_EXTSN" + +/* + * symbol versioning macros + */ +#define LIBC_ALIAS(sym) __asm("_" __STRING(sym) LIBC_SUF_UNIX03) +#define LIBC_ALIAS_C(sym) __asm("_" __STRING(sym) LIBC_SUF_NON_CANCELABLE LIBC_SUF_UNIX03) +#define LIBC_ALIAS_I(sym) __asm("_" __STRING(sym) LIBC_SUF_64_BIT_INO_T LIBC_SUF_UNIX03) +#define LIBC_INODE64(sym) __asm("_" __STRING(sym) LIBC_SUF_64_BIT_INO_T) + +#define LIBC_1050(sym) __asm("_" __STRING(sym) LIBC_SUF_1050) +#define LIBC_1050ALIAS(sym) __asm("_" __STRING(sym) LIBC_SUF_1050 LIBC_SUF_UNIX03) +#define LIBC_1050ALIAS_C(sym) __asm("_" __STRING(sym) LIBC_SUF_1050 LIBC_SUF_NON_CANCELABLE LIBC_SUF_UNIX03) +#define LIBC_1050ALIAS_I(sym) __asm("_" __STRING(sym) LIBC_SUF_1050 LIBC_SUF_64_BIT_INO_T LIBC_SUF_UNIX03) +#define LIBC_1050INODE64(sym) __asm("_" __STRING(sym) LIBC_SUF_1050 LIBC_SUF_64_BIT_INO_T) + +#define LIBC_EXTSN(sym) __asm("_" __STRING(sym) LIBC_SUF_EXTSN) +#define LIBC_EXTSN_C(sym) __asm("_" __STRING(sym) LIBC_SUF_EXTSN LIBC_SUF_NON_CANCELABLE) + +extern int pthread_key_init_np(int, void (*)(void *)); + +#include +#if TARGET_IPHONE_SIMULATOR +/* Simulator keys are offset by 200 */ +#define __LIBC_PTHREAD_KEY(x) (210 + (x)) +#else +#define __LIBC_PTHREAD_KEY(x) (10 + (x)) +#endif + +/* + * Libc pthread key assignments + */ +#define __LIBC_PTHREAD_KEY_XLOCALE __LIBC_PTHREAD_KEY(0) +//#define __LIBC_PTHREAD_KEY_RESERVED_WIN64 __LIBC_PTHREAD_KEY(1) +#define __LIBC_PTHREAD_KEY_LOCALTIME __LIBC_PTHREAD_KEY(2) +#define __LIBC_PTHREAD_KEY_GMTIME __LIBC_PTHREAD_KEY(3) +#define __LIBC_PTHREAD_KEY_GDTOA_BIGINT __LIBC_PTHREAD_KEY(4) +#define __LIBC_PTHREAD_KEY_PARSEFLOAT __LIBC_PTHREAD_KEY(5) +#define __LIBC_PTHREAD_KEY_TTYNAME __LIBC_PTHREAD_KEY(6) + +#endif /* _LIBC_SYS_CDEFS_H_ */ diff --git a/include/sys/rbtree.h b/include/sys/rbtree.h new file mode 100644 index 0000000..63832d4 --- /dev/null +++ b/include/sys/rbtree.h @@ -0,0 +1,104 @@ +/* $NetBSD: rbtree.h,v 1.2 2012/02/17 08:20:55 yamt Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Portions Copyright (c) 2012 Apple Inc. All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYS_RBTREE_H_ +#define _SYS_RBTREE_H_ + +#include + +#include +#include +#include +#include + +__BEGIN_DECLS + + +#define RB_DIR_LEFT 0 +#define RB_DIR_RIGHT 1 + +#define RB_TREE_MIN(T) rb_tree_iterate((T), NULL, RB_DIR_RIGHT) +#define RB_TREE_MAX(T) rb_tree_iterate((T), NULL, RB_DIR_LEFT) +#define RB_TREE_FOREACH(N, T) \ + for ((N) = RB_TREE_MIN(T); (N); \ + (N) = rb_tree_iterate((T), (N), RB_DIR_RIGHT)) +#define RB_TREE_FOREACH_SAFE(N, T, TVAR) \ + for ((N) = RB_TREE_MIN(T); (N) && ((TVAR) = rb_tree_iterate((T), (N), RB_DIR_RIGHT), 1); \ + (N) = (TVAR)) +#define RB_TREE_FOREACH_REVERSE(N, T) \ + for ((N) = RB_TREE_MAX(T); (N); \ + (N) = rb_tree_iterate((T), (N), RB_DIR_LEFT)) +#define RB_TREE_FOREACH_REVERSE_SAFE(N, T, TVAR) \ + for ((N) = RB_TREE_MAX(T); (N) && ((TVAR) = rb_tree_iterate((T), (N), RB_DIR_LEFT), 1); \ + (N) = (TVAR)) + + +/* + * rbto_compare_nodes_fn: + * return a positive value if the first node > the second node. + * return a negative value if the first node < the second node. + * return 0 if they are considered same. + * + * rbto_compare_key_fn: + * return a positive value if the node > the key. + * return a negative value if the node < the key. + * return 0 if they are considered same. + */ + +typedef signed int (*rbto_compare_nodes_fn)(void *, const void *, const void *); +typedef signed int (*rbto_compare_key_fn)(void *, const void *, const void *); + +typedef struct { + rbto_compare_nodes_fn rbto_compare_nodes; + rbto_compare_key_fn rbto_compare_key; + size_t rbto_node_offset; + void *rbto_context; +} rb_tree_ops_t; + +typedef struct rb_node { void * opaque[3]; } rb_node_t; +typedef struct rb_tree { void *opaque[8]; } rb_tree_t; + +#define _rb_availability __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +void rb_tree_init(rb_tree_t *, const rb_tree_ops_t *) _rb_availability; +void * rb_tree_insert_node(rb_tree_t *, void *) _rb_availability; +void * rb_tree_find_node(rb_tree_t *, const void *) _rb_availability; +void * rb_tree_find_node_geq(rb_tree_t *, const void *) _rb_availability; +void * rb_tree_find_node_leq(rb_tree_t *, const void *) _rb_availability; +void rb_tree_remove_node(rb_tree_t *, void *) _rb_availability; +void * rb_tree_iterate(rb_tree_t *, void *, const unsigned int) _rb_availability; +size_t rb_tree_count(rb_tree_t *) _rb_availability; +#undef _rb_availability + +__END_DECLS + +#endif /* _SYS_RBTREE_H_*/ diff --git a/include/sys/statvfs.h b/include/sys/statvfs.h new file mode 100644 index 0000000..a8d661a --- /dev/null +++ b/include/sys/statvfs.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * sys/statvfs.h + */ +#ifndef _SYS_STATVFS_H_ +#define _SYS_STATVFS_H_ + +#include +#include + +#include +#include + +/* Following structure is used as a statvfs/fstatvfs function parameter */ +struct statvfs { + unsigned long f_bsize; /* File system block size */ + unsigned long f_frsize; /* Fundamental file system block size */ + fsblkcnt_t f_blocks; /* Blocks on FS in units of f_frsize */ + fsblkcnt_t f_bfree; /* Free blocks */ + fsblkcnt_t f_bavail; /* Blocks available to non-root */ + fsfilcnt_t f_files; /* Total inodes */ + fsfilcnt_t f_ffree; /* Free inodes */ + fsfilcnt_t f_favail; /* Free inodes for non-root */ + unsigned long f_fsid; /* Filesystem ID */ + unsigned long f_flag; /* Bit mask of values */ + unsigned long f_namemax; /* Max file name length */ +}; + +/* Defined bits for f_flag field value */ +#define ST_RDONLY 0x00000001 /* Read-only file system */ +#define ST_NOSUID 0x00000002 /* Does not honor setuid/setgid */ + +__BEGIN_DECLS +int fstatvfs(int, struct statvfs *); +int statvfs(const char * __restrict, struct statvfs * __restrict); +__END_DECLS + +#endif /* _SYS_STATVFS_H_ */ diff --git a/include/sysexits.3 b/include/sysexits.3 new file mode 100644 index 0000000..9a97140 --- /dev/null +++ b/include/sysexits.3 @@ -0,0 +1,132 @@ +.\" +.\" Copyright (c) 1996 Joerg Wunsch +.\" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: /repoman/r/ncvs/src/share/man/man3/sysexits.3,v 1.12 2003/09/10 19:24:34 ru Exp $ +.\" +.\" " +.Dd March 31, 1996 +.Os +.Dt SYSEXITS 3 +.Sh NAME +.Nm sysexits +.Nd preferable exit codes for programs +.Sh SYNOPSIS +.In sysexits.h +.Sh DESCRIPTION +According to +.Xr style 9 , +it is not a good practice to call +.Xr exit 3 +with arbitrary values to indicate a failure condition when ending +a program. Instead, the pre-defined exit codes from +.Nm +should be used, so the caller of the process can get a rough +estimation about the failure class without looking up the source code. +.Pp +The successful exit is always indicated by a status of 0, or +.Sy EX_OK . +Error numbers begin at +.Sy EX__BASE +to reduce the possibility of clashing with other exit statuses that +random programs may already return. The meaning of the codes is +approximately as follows: +.Bl -tag -width "EX_UNAVAILABLEXX(XX)" +.It Sy EX_USAGE Pq 64 +The command was used incorrectly, e.g., with the wrong number of +arguments, a bad flag, a bad syntax in a parameter, or whatever. +.It Sy EX_DATAERR Pq 65 +The input data was incorrect in some way. This should only be used +for user's data and not system files. +.It Sy EX_NOINPUT Pq 66 +An input file (not a system file) did not exist or was not readable. +This could also include errors like +.Dq \&No message +to a mailer (if it cared to catch it). +.It Sy EX_NOUSER Pq 67 +The user specified did not exist. This might be used for mail +addresses or remote logins. +.It Sy EX_NOHOST Pq 68 +The host specified did not exist. This is used in mail addresses or +network requests. +.It Sy EX_UNAVAILABLE Pq 69 +A service is unavailable. This can occur if a support program or file +does not exist. This can also be used as a catchall message when +something you wanted to do doesn't work, but you don't know why. +.It Sy EX_SOFTWARE Pq 70 +An internal software error has been detected. This should be limited +to non-operating system related errors as possible. +.It Sy EX_OSERR Pq 71 +An operating system error has been detected. This is intended to be +used for such things as +.Dq cannot fork , +.Dq cannot create pipe , +or the like. It includes things like getuid returning a user that +does not exist in the passwd file. +.It Sy EX_OSFILE Pq 72 +Some system file (e.g., +.Pa /etc/passwd , +.Pa /var/run/utmp , +etc.) does not exist, cannot be opened, or has some sort of error +(e.g., syntax error). +.It Sy EX_CANTCREAT Pq 73 +A (user specified) output file cannot be created. +.It Sy EX_IOERR Pq 74 +An error occurred while doing I/O on some file. +.It Sy EX_TEMPFAIL Pq 75 +Temporary failure, indicating something that is not really an error. +In sendmail, this means that a mailer (e.g.) could not create a +connection, and the request should be reattempted later. +.It Sy EX_PROTOCOL Pq 76 +The remote system returned something that was +.Dq not possible +during a protocol exchange. +.It Sy EX_NOPERM Pq 77 +You did not have sufficient permission to perform the operation. This +is not intended for file system problems, which should use +.Sy EX_NOINPUT +or +.Sy EX_CANTCREAT , +but rather for higher level permissions. +.It Sy EX_CONFIG Pq 78 +Something was found in an unconfigured or misconfigured state. +.El +.Pp +The numerical values corresponding to the symbolical ones are given in +parenthesis for easy reference. +.Sh SEE ALSO +.Xr exit 3 , +.Xr style 9 +.Sh HISTORY +The +.Nm +file appeared somewhere after +.Bx 4.3 . +.Sh AUTHORS +This man page has been written by +.An J\(:org Wunsch +after the comments in +.In sysexits.h . +.Sh BUGS +The choice of an appropriate exit value is often ambiguous. diff --git a/include/sysexits.h b/include/sysexits.h new file mode 100644 index 0000000..464cb11 --- /dev/null +++ b/include/sysexits.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)sysexits.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _SYSEXITS_H_ +#define _SYSEXITS_H_ + +/* + * SYSEXITS.H -- Exit status codes for system programs. + * + * This include file attempts to categorize possible error + * exit statuses for system programs, notably delivermail + * and the Berkeley network. + * + * Error numbers begin at EX__BASE to reduce the possibility of + * clashing with other exit statuses that random programs may + * already return. The meaning of the codes is approximately + * as follows: + * + * EX_USAGE -- The command was used incorrectly, e.g., with + * the wrong number of arguments, a bad flag, a bad + * syntax in a parameter, or whatever. + * EX_DATAERR -- The input data was incorrect in some way. + * This should only be used for user's data & not + * system files. + * EX_NOINPUT -- An input file (not a system file) did not + * exist or was not readable. This could also include + * errors like "No message" to a mailer (if it cared + * to catch it). + * EX_NOUSER -- The user specified did not exist. This might + * be used for mail addresses or remote logins. + * EX_NOHOST -- The host specified did not exist. This is used + * in mail addresses or network requests. + * EX_UNAVAILABLE -- A service is unavailable. This can occur + * if a support program or file does not exist. This + * can also be used as a catchall message when something + * you wanted to do doesn't work, but you don't know + * why. + * EX_SOFTWARE -- An internal software error has been detected. + * This should be limited to non-operating system related + * errors as possible. + * EX_OSERR -- An operating system error has been detected. + * This is intended to be used for such things as "cannot + * fork", "cannot create pipe", or the like. It includes + * things like getuid returning a user that does not + * exist in the passwd file. + * EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp, + * etc.) does not exist, cannot be opened, or has some + * sort of error (e.g., syntax error). + * EX_CANTCREAT -- A (user specified) output file cannot be + * created. + * EX_IOERR -- An error occurred while doing I/O on some file. + * EX_TEMPFAIL -- temporary failure, indicating something that + * is not really an error. In sendmail, this means + * that a mailer (e.g.) could not create a connection, + * and the request should be reattempted later. + * EX_PROTOCOL -- the remote system returned something that + * was "not possible" during a protocol exchange. + * EX_NOPERM -- You did not have sufficient permission to + * perform the operation. This is not intended for + * file system problems, which should use NOINPUT or + * CANTCREAT, but rather for higher level permissions. + */ + +#define EX_OK 0 /* successful termination */ + +#define EX__BASE 64 /* base value for error messages */ + +#define EX_USAGE 64 /* command line usage error */ +#define EX_DATAERR 65 /* data format error */ +#define EX_NOINPUT 66 /* cannot open input */ +#define EX_NOUSER 67 /* addressee unknown */ +#define EX_NOHOST 68 /* host name unknown */ +#define EX_UNAVAILABLE 69 /* service unavailable */ +#define EX_SOFTWARE 70 /* internal software error */ +#define EX_OSERR 71 /* system error (e.g., can't fork) */ +#define EX_OSFILE 72 /* critical OS file missing */ +#define EX_CANTCREAT 73 /* can't create (user) output file */ +#define EX_IOERR 74 /* input/output error */ +#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ +#define EX_PROTOCOL 76 /* remote error in protocol */ +#define EX_NOPERM 77 /* permission denied */ +#define EX_CONFIG 78 /* configuration error */ + +#define EX__MAX 78 /* maximum listed value */ + +#endif /* !_SYSEXITS_H_ */ diff --git a/include/syslog.h b/include/syslog.h new file mode 100644 index 0000000..d3f4192 --- /dev/null +++ b/include/syslog.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include + diff --git a/include/tar.h b/include/tar.h new file mode 100644 index 0000000..764ca01 --- /dev/null +++ b/include/tar.h @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chuck Karish of Mindcraft, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tar.h 8.2 (Berkeley) 1/4/94 + */ + +#ifndef _TAR_H +#define _TAR_H + +#define TMAGIC "ustar" /* ustar and a null */ +#define TMAGLEN 6 +#define TVERSION "00" /* 00 and no null */ +#define TVERSLEN 2 + +/* Values used in typeflag field */ +#define REGTYPE '0' /* Regular file */ +#define AREGTYPE '\0' /* Regular file */ +#define LNKTYPE '1' /* Link */ +#define SYMTYPE '2' /* Reserved */ +#define CHRTYPE '3' /* Character special */ +#define BLKTYPE '4' /* Block special */ +#define DIRTYPE '5' /* Directory */ +#define FIFOTYPE '6' /* FIFO special */ +#define CONTTYPE '7' /* Reserved */ + +/* Bits used in the mode field - values in octal */ +#define TSUID 04000 /* Set UID on execution */ +#define TSGID 02000 /* Set GID on execution */ +#define TSVTX 01000 /* Reserved */ + /* File permissions */ +#define TUREAD 00400 /* Read by owner */ +#define TUWRITE 00200 /* Write by owner */ +#define TUEXEC 00100 /* Execute/Search by owner */ +#define TGREAD 00040 /* Read by group */ +#define TGWRITE 00020 /* Write by group */ +#define TGEXEC 00010 /* Execute/Search by group */ +#define TOREAD 00004 /* Read by other */ +#define TOWRITE 00002 /* Write by other */ +#define TOEXEC 00001 /* Execute/Search by other */ + +#endif diff --git a/include/termios.h b/include/termios.h new file mode 100644 index 0000000..94f315b --- /dev/null +++ b/include/termios.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __TERMIOS_H__ +#define __TERMIOS_H__ + +#include +#include +#include <_types.h> +#include + +__BEGIN_DECLS +pid_t tcgetsid(int); +__END_DECLS + +#endif /* __TERMIOS_H__ */ diff --git a/include/time.h b/include/time.h new file mode 100644 index 0000000..e253c8d --- /dev/null +++ b/include/time.h @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)time.h 8.3 (Berkeley) 1/21/94 + */ + +#ifndef _TIME_H_ +#define _TIME_H_ + +#include <_types.h> +#include +#include +#ifndef UNIFDEF_DRIVERKIT +#include +#include +#include +#include +#include + +struct tm { + int tm_sec; /* seconds after the minute [0-60] */ + int tm_min; /* minutes after the hour [0-59] */ + int tm_hour; /* hours since midnight [0-23] */ + int tm_mday; /* day of the month [1-31] */ + int tm_mon; /* months since January [0-11] */ + int tm_year; /* years since 1900 */ + int tm_wday; /* days since Sunday [0-6] */ + int tm_yday; /* days since January 1 [0-365] */ + int tm_isdst; /* Daylight Savings Time flag */ + long tm_gmtoff; /* offset from UTC in seconds */ + char *tm_zone; /* timezone abbreviation */ +}; + +#if __DARWIN_UNIX03 +#define CLOCKS_PER_SEC 1000000 /* [XSI] */ +#else /* !__DARWIN_UNIX03 */ +#include /* Include file containing CLK_TCK. */ + +#define CLOCKS_PER_SEC (__DARWIN_CLK_TCK) +#endif /* __DARWIN_UNIX03 */ + +#ifndef _ANSI_SOURCE +extern char *tzname[]; +#endif + +extern int getdate_err; +#if __DARWIN_UNIX03 +extern long timezone __DARWIN_ALIAS(timezone); +#endif /* __DARWIN_UNIX03 */ +extern int daylight; +#endif /* UNIFDEF_DRIVERKIT */ + +__BEGIN_DECLS +#ifndef UNIFDEF_DRIVERKIT +char *asctime(const struct tm *); +clock_t clock(void) __DARWIN_ALIAS(clock); +char *ctime(const time_t *); +double difftime(time_t, time_t); +struct tm *getdate(const char *); +struct tm *gmtime(const time_t *); +struct tm *localtime(const time_t *); +time_t mktime(struct tm *) __DARWIN_ALIAS(mktime); +size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime); +char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime); +time_t time(time_t *); + +#ifndef _ANSI_SOURCE +void tzset(void); +#endif /* not ANSI */ + +/* [TSF] Thread safe functions */ +char *asctime_r(const struct tm * __restrict, char * __restrict); +char *ctime_r(const time_t *, char *); +struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict); +struct tm *localtime_r(const time_t * __restrict, struct tm * __restrict); + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +time_t posix2time(time_t); +#if !__DARWIN_UNIX03 +char *timezone(int, int); +#endif /* !__DARWIN_UNIX03 */ +void tzsetwall(void); +time_t time2posix(time_t); +time_t timelocal(struct tm * const); +time_t timegm(struct tm * const); +#endif /* neither ANSI nor POSIX */ + +#if !defined(_ANSI_SOURCE) +int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __DARWIN_ALIAS_C(nanosleep); +#endif +#endif /* UNIFDEF_DRIVERKIT */ + +#if !defined(_DARWIN_FEATURE_CLOCK_GETTIME) || _DARWIN_FEATURE_CLOCK_GETTIME != 0 +#if __DARWIN_C_LEVEL >= 199309L +#if __has_feature(enumerator_attributes) +#define __CLOCK_AVAILABILITY __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) +#else +#define __CLOCK_AVAILABILITY +#endif + +typedef enum { +_CLOCK_REALTIME __CLOCK_AVAILABILITY = 0, +#define CLOCK_REALTIME _CLOCK_REALTIME +_CLOCK_MONOTONIC __CLOCK_AVAILABILITY = 6, +#define CLOCK_MONOTONIC _CLOCK_MONOTONIC +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +_CLOCK_MONOTONIC_RAW __CLOCK_AVAILABILITY = 4, +#define CLOCK_MONOTONIC_RAW _CLOCK_MONOTONIC_RAW +_CLOCK_MONOTONIC_RAW_APPROX __CLOCK_AVAILABILITY = 5, +#define CLOCK_MONOTONIC_RAW_APPROX _CLOCK_MONOTONIC_RAW_APPROX +_CLOCK_UPTIME_RAW __CLOCK_AVAILABILITY = 8, +#define CLOCK_UPTIME_RAW _CLOCK_UPTIME_RAW +_CLOCK_UPTIME_RAW_APPROX __CLOCK_AVAILABILITY = 9, +#define CLOCK_UPTIME_RAW_APPROX _CLOCK_UPTIME_RAW_APPROX +#endif +_CLOCK_PROCESS_CPUTIME_ID __CLOCK_AVAILABILITY = 12, +#define CLOCK_PROCESS_CPUTIME_ID _CLOCK_PROCESS_CPUTIME_ID +_CLOCK_THREAD_CPUTIME_ID __CLOCK_AVAILABILITY = 16 +#define CLOCK_THREAD_CPUTIME_ID _CLOCK_THREAD_CPUTIME_ID +} clockid_t; + +#ifndef UNIFDEF_DRIVERKIT +__CLOCK_AVAILABILITY +int clock_getres(clockid_t __clock_id, struct timespec *__res); + +__CLOCK_AVAILABILITY +int clock_gettime(clockid_t __clock_id, struct timespec *__tp); + +#endif /* UNIFDEF_DRIVERKIT */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +__CLOCK_AVAILABILITY +__uint64_t clock_gettime_nsec_np(clockid_t __clock_id); +#endif + +#ifndef UNIFDEF_DRIVERKIT +__OSX_AVAILABLE(10.12) __IOS_PROHIBITED +__TVOS_PROHIBITED __WATCHOS_PROHIBITED +int clock_settime(clockid_t __clock_id, const struct timespec *__tp); + +#endif /* UNIFDEF_DRIVERKIT */ +#undef __CLOCK_AVAILABILITY +#endif /* __DARWIN_C_LEVEL */ +#endif /* _DARWIN_FEATURE_CLOCK_GETTIME */ + +#ifndef UNIFDEF_DRIVERKIT +#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) && \ + ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ + (defined(__cplusplus) && __cplusplus >= 201703L)) +/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ +#define TIME_UTC 1 /* time elapsed since epoch */ +__API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0)) +int timespec_get(struct timespec *ts, int base); +#endif + +#endif /* UNIFDEF_DRIVERKIT */ +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_TIME_H_ */ diff --git a/include/timeconv.h b/include/timeconv.h new file mode 100644 index 0000000..2310e33 --- /dev/null +++ b/include/timeconv.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)time.h 8.3 (Berkeley) 1/21/94 + */ + +/* + * $FreeBSD: /repoman/r/ncvs/src/include/timeconv.h,v 1.2 2002/08/21 16:19:55 mike Exp $ + */ + +#ifndef _TIMECONV_H_ +#define _TIMECONV_H_ + +#include +#include + +__BEGIN_DECLS +time_t _time32_to_time(int32_t t32); +int32_t _time_to_time32(time_t t); +time_t _time64_to_time(int64_t t64); +int64_t _time_to_time64(time_t t); +long _time_to_long(time_t t); +time_t _long_to_time(long tlong); +int _time_to_int(time_t t); +time_t _int_to_time(int tint); +__END_DECLS + +#endif /* _TIMECONV_H_ */ diff --git a/include/ttyent.h b/include/ttyent.h new file mode 100644 index 0000000..89855cd --- /dev/null +++ b/include/ttyent.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ttyent.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _TTYENT_H_ +#define _TTYENT_H_ + +#define _PATH_TTYS "/etc/ttys" + +#define _TTYS_OFF "off" +#define _TTYS_ON "on" +#define _TTYS_SECURE "secure" +#define _TTYS_WINDOW "window" +#define _TTYS_ONERROR "onerror" +#define _TTYS_ONOPTION "onoption" +#define _TTYS_SLOT "slot" + +struct ttyent { + char *ty_name; /* terminal device name */ + char *ty_getty; /* command to execute, usually getty */ + char *ty_type; /* terminal type for termcap */ +#define TTY_ON 0x01 /* enable logins (start ty_getty program) */ +#define TTY_SECURE 0x02 /* allow uid of 0 to login */ + int ty_status; /* status flags */ + char *ty_window; /* command to start up window manager */ + char *ty_onerror; /* command to execute after getty failure */ + char *ty_onoption; /* command to execute after console login */ + char *ty_comment; /* comment field */ +}; + +#include + +__BEGIN_DECLS +struct ttyent *getttyent(void); +struct ttyent *getttynam(const char *); +int setttyent(void); +int endttyent(void); +__END_DECLS + +#endif /* !_TTYENT_H_ */ diff --git a/include/tzfile.h b/include/tzfile.h new file mode 120000 index 0000000..d16c7d1 --- /dev/null +++ b/include/tzfile.h @@ -0,0 +1 @@ +../stdtime/FreeBSD/tzfile.h \ No newline at end of file diff --git a/include/ulimit.h b/include/ulimit.h new file mode 100644 index 0000000..c6a451c --- /dev/null +++ b/include/ulimit.h @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2002 Kyle Martin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/include/ulimit.h,v 1.4 2003/01/08 01:18:13 tjr Exp $ + */ + +#ifndef _ULIMIT_H_ +#define _ULIMIT_H_ + +#include + +#define UL_GETFSIZE 1 +#define UL_SETFSIZE 2 + +__BEGIN_DECLS +long ulimit(int, ...); +__END_DECLS + +#endif /* !_ULIMIT_H_ */ diff --git a/include/unistd.h b/include/unistd.h new file mode 100644 index 0000000..5fcece2 --- /dev/null +++ b/include/unistd.h @@ -0,0 +1,791 @@ +/* + * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)unistd.h 8.12 (Berkeley) 4/27/95 + * + * Copyright (c) 1998 Apple Compter, Inc. + * All Rights Reserved + */ + +/* History: + 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr + 3/26/98 CHW at Apple added real interface to searchfs call + 3/5/98 CHW at Apple added hfs semantic system calls headers +*/ + +#ifndef _UNISTD_H_ +#define _UNISTD_H_ + +#include <_types.h> +#include +#include +#include +#include +#include +#include +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +#include +#include +#include +#include +#include + +#define STDIN_FILENO 0 /* standard input file descriptor */ +#define STDOUT_FILENO 1 /* standard output file descriptor */ +#define STDERR_FILENO 2 /* standard error file descriptor */ + + +/* Version test macros */ +/* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */ +#define _XOPEN_VERSION 600 /* [XSI] */ +#define _XOPEN_XCU_VERSION 4 /* Older standard */ + + +/* Please keep this list in the same order as the applicable standard */ +#define _POSIX_ADVISORY_INFO (-1) /* [ADV] */ +#define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */ +#define _POSIX_BARRIERS (-1) /* [BAR] */ +#define _POSIX_CHOWN_RESTRICTED 200112L +#define _POSIX_CLOCK_SELECTION (-1) /* [CS] */ +#define _POSIX_CPUTIME (-1) /* [CPT] */ +#define _POSIX_FSYNC 200112L /* [FSC] */ +#define _POSIX_IPV6 200112L +#define _POSIX_JOB_CONTROL 200112L +#define _POSIX_MAPPED_FILES 200112L /* [MF] */ +#define _POSIX_MEMLOCK (-1) /* [ML] */ +#define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */ +#define _POSIX_MEMORY_PROTECTION 200112L /* [MPR] */ +#define _POSIX_MESSAGE_PASSING (-1) /* [MSG] */ +#define _POSIX_MONOTONIC_CLOCK (-1) /* [MON] */ +#define _POSIX_NO_TRUNC 200112L +#define _POSIX_PRIORITIZED_IO (-1) /* [PIO] */ +#define _POSIX_PRIORITY_SCHEDULING (-1) /* [PS] */ +#define _POSIX_RAW_SOCKETS (-1) /* [RS] */ +#define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */ +#define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */ +#define _POSIX_REGEXP 200112L +#define _POSIX_SAVED_IDS 200112L /* XXX required */ +#define _POSIX_SEMAPHORES (-1) /* [SEM] */ +#define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */ +#define _POSIX_SHELL 200112L +#define _POSIX_SPAWN (-1) /* [SPN] */ +#define _POSIX_SPIN_LOCKS (-1) /* [SPI] */ +#define _POSIX_SPORADIC_SERVER (-1) /* [SS] */ +#define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */ +#define _POSIX_THREAD_ATTR_STACKADDR 200112L /* [TSA] */ +#define _POSIX_THREAD_ATTR_STACKSIZE 200112L /* [TSS] */ +#define _POSIX_THREAD_CPUTIME (-1) /* [TCT] */ +#define _POSIX_THREAD_PRIO_INHERIT (-1) /* [TPI] */ +#define _POSIX_THREAD_PRIO_PROTECT (-1) /* [TPP] */ +#define _POSIX_THREAD_PRIORITY_SCHEDULING (-1) /* [TPS] */ +#define _POSIX_THREAD_PROCESS_SHARED 200112L /* [TSH] */ +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L /* [TSF] */ +#define _POSIX_THREAD_SPORADIC_SERVER (-1) /* [TSP] */ +#define _POSIX_THREADS 200112L /* [THR] */ +#define _POSIX_TIMEOUTS (-1) /* [TMO] */ +#define _POSIX_TIMERS (-1) /* [TMR] */ +#define _POSIX_TRACE (-1) /* [TRC] */ +#define _POSIX_TRACE_EVENT_FILTER (-1) /* [TEF] */ +#define _POSIX_TRACE_INHERIT (-1) /* [TRI] */ +#define _POSIX_TRACE_LOG (-1) /* [TRL] */ +#define _POSIX_TYPED_MEMORY_OBJECTS (-1) /* [TYM] */ +#ifndef _POSIX_VDISABLE +#define _POSIX_VDISABLE 0xff /* same as sys/termios.h */ +#endif /* _POSIX_VDISABLE */ + +#if __DARWIN_C_LEVEL >= 199209L +#define _POSIX2_C_BIND 200112L +#define _POSIX2_C_DEV 200112L /* c99 command */ +#define _POSIX2_CHAR_TERM 200112L +#define _POSIX2_FORT_DEV (-1) /* fort77 command */ +#define _POSIX2_FORT_RUN 200112L +#define _POSIX2_LOCALEDEF 200112L /* localedef command */ +#define _POSIX2_PBS (-1) +#define _POSIX2_PBS_ACCOUNTING (-1) +#define _POSIX2_PBS_CHECKPOINT (-1) +#define _POSIX2_PBS_LOCATE (-1) +#define _POSIX2_PBS_MESSAGE (-1) +#define _POSIX2_PBS_TRACK (-1) +#define _POSIX2_SW_DEV 200112L +#define _POSIX2_UPE 200112L /* XXXX no fc, newgrp, tabs */ +#endif /* __DARWIN_C_LEVEL */ + +#define __ILP32_OFF32 (-1) +#ifdef UNIFDEF_POSIX_ILP32_ALLOW +#define __ILP32_OFFBIG (1) +#else // UNIFDEF_POSIX_ILP32_ALLOW +#define __ILP32_OFFBIG (-1) +#endif // UNIFDEF_POSIX_ILP32_ALLOW + +#define __LP64_OFF64 (1) +#define __LPBIG_OFFBIG (1) + +#if __DARWIN_C_LEVEL >= 200112L +#define _POSIX_V6_ILP32_OFF32 __ILP32_OFF32 +#define _POSIX_V6_ILP32_OFFBIG __ILP32_OFFBIG +#define _POSIX_V6_LP64_OFF64 __LP64_OFF64 +#define _POSIX_V6_LPBIG_OFFBIG __LPBIG_OFFBIG +#endif /* __DARWIN_C_LEVEL >= 200112L */ + +#if __DARWIN_C_LEVEL >= 200809L +#define _POSIX_V7_ILP32_OFF32 __ILP32_OFF32 +#define _POSIX_V7_ILP32_OFFBIG __ILP32_OFFBIG +#define _POSIX_V7_LP64_OFF64 __LP64_OFF64 +#define _POSIX_V7_LPBIG_OFFBIG __LPBIG_OFFBIG +#endif /* __DARWIN_C_LEVEL >= 200809L */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define _V6_ILP32_OFF32 __ILP32_OFF32 +#define _V6_ILP32_OFFBIG __ILP32_OFFBIG +#define _V6_LP64_OFF64 __LP64_OFF64 +#define _V6_LPBIG_OFFBIG __LPBIG_OFFBIG +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL +/* Removed in Issue 7 */ +#define _XBS5_ILP32_OFF32 __ILP32_OFF32 +#define _XBS5_ILP32_OFFBIG __ILP32_OFFBIG +#define _XBS5_LP64_OFF64 __LP64_OFF64 +#define _XBS5_LPBIG_OFFBIG __LPBIG_OFFBIG +#endif /* __DARWIN_C_LEVEL < 200809L */ + +#if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */ +#define _XOPEN_CRYPT (1) +#define _XOPEN_ENH_I18N (1) /* XXX required */ +#define _XOPEN_LEGACY (-1) /* no ftime gcvt, wcswcs */ +#define _XOPEN_REALTIME (-1) /* no q'ed signals, mq_* */ +#define _XOPEN_REALTIME_THREADS (-1) /* no posix_spawn, et. al. */ +#define _XOPEN_SHM (1) +#define _XOPEN_STREAMS (-1) /* Issue 6 */ +#define _XOPEN_UNIX (1) +#endif /* XSI */ + +/* configurable system variables */ +#define _SC_ARG_MAX 1 +#define _SC_CHILD_MAX 2 +#define _SC_CLK_TCK 3 +#define _SC_NGROUPS_MAX 4 +#define _SC_OPEN_MAX 5 +#define _SC_JOB_CONTROL 6 +#define _SC_SAVED_IDS 7 +#define _SC_VERSION 8 +#define _SC_BC_BASE_MAX 9 +#define _SC_BC_DIM_MAX 10 +#define _SC_BC_SCALE_MAX 11 +#define _SC_BC_STRING_MAX 12 +#define _SC_COLL_WEIGHTS_MAX 13 +#define _SC_EXPR_NEST_MAX 14 +#define _SC_LINE_MAX 15 +#define _SC_RE_DUP_MAX 16 +#define _SC_2_VERSION 17 +#define _SC_2_C_BIND 18 +#define _SC_2_C_DEV 19 +#define _SC_2_CHAR_TERM 20 +#define _SC_2_FORT_DEV 21 +#define _SC_2_FORT_RUN 22 +#define _SC_2_LOCALEDEF 23 +#define _SC_2_SW_DEV 24 +#define _SC_2_UPE 25 +#define _SC_STREAM_MAX 26 +#define _SC_TZNAME_MAX 27 + +#if __DARWIN_C_LEVEL >= 199309L +#define _SC_ASYNCHRONOUS_IO 28 +#define _SC_PAGESIZE 29 +#define _SC_MEMLOCK 30 +#define _SC_MEMLOCK_RANGE 31 +#define _SC_MEMORY_PROTECTION 32 +#define _SC_MESSAGE_PASSING 33 +#define _SC_PRIORITIZED_IO 34 +#define _SC_PRIORITY_SCHEDULING 35 +#define _SC_REALTIME_SIGNALS 36 +#define _SC_SEMAPHORES 37 +#define _SC_FSYNC 38 +#define _SC_SHARED_MEMORY_OBJECTS 39 +#define _SC_SYNCHRONIZED_IO 40 +#define _SC_TIMERS 41 +#define _SC_AIO_LISTIO_MAX 42 +#define _SC_AIO_MAX 43 +#define _SC_AIO_PRIO_DELTA_MAX 44 +#define _SC_DELAYTIMER_MAX 45 +#define _SC_MQ_OPEN_MAX 46 +#define _SC_MAPPED_FILES 47 /* swap _SC_PAGESIZE vs. BSD */ +#define _SC_RTSIG_MAX 48 +#define _SC_SEM_NSEMS_MAX 49 +#define _SC_SEM_VALUE_MAX 50 +#define _SC_SIGQUEUE_MAX 51 +#define _SC_TIMER_MAX 52 +#endif /* __DARWIN_C_LEVEL >= 199309L */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define _SC_NPROCESSORS_CONF 57 +#define _SC_NPROCESSORS_ONLN 58 +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#if __DARWIN_C_LEVEL >= 200112L +#define _SC_2_PBS 59 +#define _SC_2_PBS_ACCOUNTING 60 +#define _SC_2_PBS_CHECKPOINT 61 +#define _SC_2_PBS_LOCATE 62 +#define _SC_2_PBS_MESSAGE 63 +#define _SC_2_PBS_TRACK 64 +#define _SC_ADVISORY_INFO 65 +#define _SC_BARRIERS 66 +#define _SC_CLOCK_SELECTION 67 +#define _SC_CPUTIME 68 +#define _SC_FILE_LOCKING 69 +#define _SC_GETGR_R_SIZE_MAX 70 +#define _SC_GETPW_R_SIZE_MAX 71 +#define _SC_HOST_NAME_MAX 72 +#define _SC_LOGIN_NAME_MAX 73 +#define _SC_MONOTONIC_CLOCK 74 +#define _SC_MQ_PRIO_MAX 75 +#define _SC_READER_WRITER_LOCKS 76 +#define _SC_REGEXP 77 +#define _SC_SHELL 78 +#define _SC_SPAWN 79 +#define _SC_SPIN_LOCKS 80 +#define _SC_SPORADIC_SERVER 81 +#define _SC_THREAD_ATTR_STACKADDR 82 +#define _SC_THREAD_ATTR_STACKSIZE 83 +#define _SC_THREAD_CPUTIME 84 +#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 +#define _SC_THREAD_KEYS_MAX 86 +#define _SC_THREAD_PRIO_INHERIT 87 +#define _SC_THREAD_PRIO_PROTECT 88 +#define _SC_THREAD_PRIORITY_SCHEDULING 89 +#define _SC_THREAD_PROCESS_SHARED 90 +#define _SC_THREAD_SAFE_FUNCTIONS 91 +#define _SC_THREAD_SPORADIC_SERVER 92 +#define _SC_THREAD_STACK_MIN 93 +#define _SC_THREAD_THREADS_MAX 94 +#define _SC_TIMEOUTS 95 +#define _SC_THREADS 96 +#define _SC_TRACE 97 +#define _SC_TRACE_EVENT_FILTER 98 +#define _SC_TRACE_INHERIT 99 +#define _SC_TRACE_LOG 100 +#define _SC_TTY_NAME_MAX 101 +#define _SC_TYPED_MEMORY_OBJECTS 102 +#define _SC_V6_ILP32_OFF32 103 +#define _SC_V6_ILP32_OFFBIG 104 +#define _SC_V6_LP64_OFF64 105 +#define _SC_V6_LPBIG_OFFBIG 106 +#define _SC_IPV6 118 +#define _SC_RAW_SOCKETS 119 +#define _SC_SYMLOOP_MAX 120 +#endif /* __DARWIN_C_LEVEL >= 200112L */ + +#if __DARWIN_C_LEVEL >= 199506L /* Really XSI */ +#define _SC_ATEXIT_MAX 107 +#define _SC_IOV_MAX 56 +#define _SC_PAGE_SIZE _SC_PAGESIZE +#define _SC_XOPEN_CRYPT 108 +#define _SC_XOPEN_ENH_I18N 109 +#define _SC_XOPEN_LEGACY 110 /* Issue 6 */ +#define _SC_XOPEN_REALTIME 111 /* Issue 6 */ +#define _SC_XOPEN_REALTIME_THREADS 112 /* Issue 6 */ +#define _SC_XOPEN_SHM 113 +#define _SC_XOPEN_STREAMS 114 /* Issue 6 */ +#define _SC_XOPEN_UNIX 115 +#define _SC_XOPEN_VERSION 116 +#define _SC_XOPEN_XCU_VERSION 121 +#endif /* XSI */ + +#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL +/* Removed in Issue 7 */ +#define _SC_XBS5_ILP32_OFF32 122 +#define _SC_XBS5_ILP32_OFFBIG 123 +#define _SC_XBS5_LP64_OFF64 124 +#define _SC_XBS5_LPBIG_OFFBIG 125 +#endif /* __DARWIN_C_LEVEL <= 200809L */ + +#if __DARWIN_C_LEVEL >= 200112L +#define _SC_SS_REPL_MAX 126 +#define _SC_TRACE_EVENT_NAME_MAX 127 +#define _SC_TRACE_NAME_MAX 128 +#define _SC_TRACE_SYS_MAX 129 +#define _SC_TRACE_USER_EVENT_MAX 130 +#endif + +#if __DARWIN_C_LEVEL < 200112L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL +/* Removed in Issue 6 */ +#define _SC_PASS_MAX 131 +#endif + +/* 132-199 available for future use */ +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define _SC_PHYS_PAGES 200 +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#if __DARWIN_C_LEVEL >= 199209L +#ifndef _CS_PATH /* Defined in */ +#define _CS_PATH 1 +#endif +#endif + +#if __DARWIN_C_LEVEL >= 200112 +#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2 +#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3 +#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4 +#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5 +#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6 +#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7 +#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8 +#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9 +#define _CS_POSIX_V6_LP64_OFF64_LIBS 10 +#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13 +#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14 +#endif + +#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL +/* Removed in Issue 7 */ +#define _CS_XBS5_ILP32_OFF32_CFLAGS 20 +#define _CS_XBS5_ILP32_OFF32_LDFLAGS 21 +#define _CS_XBS5_ILP32_OFF32_LIBS 22 +#define _CS_XBS5_ILP32_OFF32_LINTFLAGS 23 +#define _CS_XBS5_ILP32_OFFBIG_CFLAGS 24 +#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 25 +#define _CS_XBS5_ILP32_OFFBIG_LIBS 26 +#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 27 +#define _CS_XBS5_LP64_OFF64_CFLAGS 28 +#define _CS_XBS5_LP64_OFF64_LDFLAGS 29 +#define _CS_XBS5_LP64_OFF64_LIBS 30 +#define _CS_XBS5_LP64_OFF64_LINTFLAGS 31 +#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 32 +#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 33 +#define _CS_XBS5_LPBIG_OFFBIG_LIBS 34 +#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 35 +#endif + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define _CS_DARWIN_USER_DIR 65536 +#define _CS_DARWIN_USER_TEMP_DIR 65537 +#define _CS_DARWIN_USER_CACHE_DIR 65538 +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + + +#ifdef _DARWIN_UNLIMITED_GETGROUPS +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 +#error "_DARWIN_UNLIMITED_GETGROUPS specified, but -miphoneos-version-min version does not support it." +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6 +#error "_DARWIN_UNLIMITED_GETGROUPS specified, but -mmacosx-version-min version does not support it." +#endif +#endif + +/* POSIX.1-1990 */ + +__BEGIN_DECLS +void _exit(int) __dead2; +int access(const char *, int); +unsigned int + alarm(unsigned int); +int chdir(const char *); +int chown(const char *, uid_t, gid_t); + +int close(int) __DARWIN_ALIAS_C(close); + +int dup(int); +int dup2(int, int); +int execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execle(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execlp(const char * __file, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execv(const char * __path, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execve(const char * __file, char * const * __argv, char * const * __envp) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +pid_t fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +long fpathconf(int, int); +char *getcwd(char *, size_t); +gid_t getegid(void); +uid_t geteuid(void); +gid_t getgid(void); +#if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE) +int getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups)); +#else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */ +int getgroups(int, gid_t []); +#endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */ +char *getlogin(void); +pid_t getpgrp(void); +pid_t getpid(void); +pid_t getppid(void); +uid_t getuid(void); +int isatty(int); +int link(const char *, const char *); +off_t lseek(int, off_t, int); +long pathconf(const char *, int); + +int pause(void) __DARWIN_ALIAS_C(pause); + +int pipe(int [2]); + +ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read); + +int rmdir(const char *); +int setgid(gid_t); +int setpgid(pid_t, pid_t); +pid_t setsid(void); +int setuid(uid_t); + +unsigned int + sleep(unsigned int) __DARWIN_ALIAS_C(sleep); + +long sysconf(int); +pid_t tcgetpgrp(int); +int tcsetpgrp(int, pid_t); +char *ttyname(int); + +#if __DARWIN_UNIX03 +int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r); +#else /* !__DARWIN_UNIX03 */ +char *ttyname_r(int, char *, size_t); +#endif /* __DARWIN_UNIX03 */ + +int unlink(const char *); + +ssize_t write(int __fd, const void * __buf, size_t __nbyte) __DARWIN_ALIAS_C(write); +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.2-1992 C Language Binding Option + */ + +#if __DARWIN_C_LEVEL >= 199209L +__BEGIN_DECLS +size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr); + +int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); + +extern char *optarg; /* getopt(3) external variables */ +extern int optind, opterr, optopt; +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 199209L */ + + + +/* Additional functionality provided by: + * POSIX.1c-1995, + * POSIX.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + */ + +#if __DARWIN_C_LEVEL >= 199506L +#include <_ctermid.h> + /* These F_* are really XSI or Issue 6 */ +#define F_ULOCK 0 /* unlock locked section */ +#define F_LOCK 1 /* lock a section for exclusive use */ +#define F_TLOCK 2 /* test and lock a section for exclusive use */ +#define F_TEST 3 /* test a section for locks by other procs */ + + __BEGIN_DECLS + +/* Begin XSI */ +/* Removed in Issue 6 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L +#if !defined(_POSIX_C_SOURCE) +__deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED +#endif +void *brk(const void *); +int chroot(const char *) __POSIX_C_DEPRECATED(199506L); +#endif + +char *crypt(const char *, const char *); +#if __DARWIN_UNIX03 +void encrypt(char *, int) __DARWIN_ALIAS(encrypt); +#else /* !__DARWIN_UNIX03 */ +int encrypt(char *, int); +#endif /* __DARWIN_UNIX03 */ +int fchdir(int); +long gethostid(void); +pid_t getpgid(pid_t); +pid_t getsid(pid_t); + +/* Removed in Issue 6 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L +int getdtablesize(void) __POSIX_C_DEPRECATED(199506L); +int getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L); +char *getpass(const char *) __POSIX_C_DEPRECATED(199506L); +#endif + +/* Removed in Issue 7 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L +char *getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */ +#endif + +int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown); + +int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); + +int nice(int) __DARWIN_ALIAS(nice); + +ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread); + +ssize_t pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pwrite); + +/* Removed in Issue 6 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L +/* Note that Issue 5 changed the argument as intprt_t, + * but we keep it as int for binary compatability. */ +#if !defined(_POSIX_C_SOURCE) +__deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED +#endif +void *sbrk(int); +#endif + +#if __DARWIN_UNIX03 +pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp); +#else /* !__DARWIN_UNIX03 */ +int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */ +#endif /* __DARWIN_UNIX03 */ + +int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); + +int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid); + +void swab(const void * __restrict, void * __restrict, ssize_t); +void sync(void); +int truncate(const char *, off_t); +useconds_t ualarm(useconds_t, useconds_t); +int usleep(useconds_t) __DARWIN_ALIAS_C(usleep); +pid_t vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +/* End XSI */ + +int fsync(int) __DARWIN_ALIAS_C(fsync); + +int ftruncate(int, off_t); +int getlogin_r(char *, size_t); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 199506L */ + + + +/* Additional functionality provided by: + * POSIX.1-2001 + * ISO C99 + */ + +#if __DARWIN_C_LEVEL >= 200112L +__BEGIN_DECLS +int fchown(int, uid_t, gid_t); +int gethostname(char *, size_t); +ssize_t readlink(const char * __restrict, char * __restrict, size_t); +int setegid(gid_t); +int seteuid(uid_t); +int symlink(const char *, const char *); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L */ + + + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#include + +#include +#include +#include + +__BEGIN_DECLS +void _Exit(int) __dead2; +int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); +int acct(const char *); +int add_profil(char *, size_t, unsigned long, unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +void endusershell(void); +int execvP(const char * __file, const char * __searchpath, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +char *fflagstostr(unsigned long); +int getdomainname(char *, int); +int getgrouplist(const char *, int, int *, int *); +#if defined(__has_include) +#if __has_include() +#include +#else +#include +#endif +#else +#include +#endif +mode_t getmode(const void *, mode_t); +int getpeereid(int, uid_t *, gid_t *); +int getsgroups_np(int *, uuid_t); +char *getusershell(void); +int getwgroups_np(int *, uuid_t); +int initgroups(const char *, int); +int issetugid(void); +char *mkdtemp(char *); +int mknod(const char *, mode_t, dev_t); +int mkpath_np(const char *path, mode_t omode) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_0); /* returns errno */ +int mkpathat_np(int dfd, const char *path, mode_t omode) /* returns errno */ + __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); +int mkstemp(char *); +int mkstemps(char *, int); +char *mktemp(char *); +int mkostemp(char *path, int oflags) + __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); +int mkostemps(char *path, int slen, int oflags) + __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); +/* Non-portable mkstemp that uses open_dprotected_np */ +int mkstemp_dprotected_np(char *path, int dpclass, int dpflags) + __OSX_UNAVAILABLE __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); +char *mkdtempat_np(int dfd, char *path) + __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) + __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); +int mkstempsat_np(int dfd, char *path, int slen) + __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) + __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); +int mkostempsat_np(int dfd, char *path, int slen, int oflags) + __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) + __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); +int nfssvc(int, void *); +int profil(char *, size_t, unsigned long, unsigned int); + +__deprecated_msg("Use of per-thread security contexts is error-prone and discouraged.") +int pthread_setugid_np(uid_t, gid_t); +int pthread_getugid_np( uid_t *, gid_t *); + +int reboot(int); +int revoke(const char *); + +__deprecated int rcmd(char **, int, const char *, const char *, const char *, int *); +__deprecated int rcmd_af(char **, int, const char *, const char *, const char *, int *, + int); +__deprecated int rresvport(int *); +__deprecated int rresvport_af(int *, int); +__deprecated int iruserok(unsigned long, int, const char *, const char *); +__deprecated int iruserok_sa(const void *, int, int, const char *, const char *); +__deprecated int ruserok(const char *, int, const char *, const char *); + +int setdomainname(const char *, int); +int setgroups(int, const gid_t *); +void sethostid(long); +int sethostname(const char *, int); +#if __DARWIN_UNIX03 +void setkey(const char *) __DARWIN_ALIAS(setkey); +#else /* !__DARWIN_UNIX03 */ +int setkey(const char *); +#endif /* __DARWIN_UNIX03 */ +int setlogin(const char *); +void *setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode)); +int setrgid(gid_t); +int setruid(uid_t); +int setsgroups_np(int, const uuid_t); +void setusershell(void); +int setwgroups_np(int, const uuid_t); +int strtofflags(char **, unsigned long *, unsigned long *); +int swapon(const char *); +int ttyslot(void); +int undelete(const char *); +int unwhiteout(const char *); +void *valloc(size_t); + +__WATCHOS_PROHIBITED __TVOS_PROHIBITED +__OS_AVAILABILITY_MSG(ios,deprecated=10.0,"syscall(2) is unsupported; " + "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") +__OS_AVAILABILITY_MSG(macosx,deprecated=10.12,"syscall(2) is unsupported; " + "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") +int syscall(int, ...); + +extern char *suboptarg; /* getsubopt(3) external variable */ +int getsubopt(char **, char * const *, char **); + +/* HFS & HFS Plus semantics system calls go here */ +#ifdef __LP64__ +int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); +int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); +int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist); +int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist); +int exchangedata(const char*,const char*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; + +#else /* __LP64__ */ +int fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); +int fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); +int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist); +int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist); +int exchangedata(const char*,const char*,unsigned long) + __OSX_DEPRECATED(10.0, 10.13, "use renamex_np with the RENAME_SWAP flag") + __IOS_DEPRECATED(2.0, 11.0, "use renamex_np with the RENAME_SWAP flag") + __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; + +#endif /* __LP64__ */ + +struct fssearchblock; +struct searchstate; + +int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int fsctl(const char *,unsigned long,void*,unsigned int); +int ffsctl(int,unsigned long,void*,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); + +#define SYNC_VOLUME_FULLSYNC 0x01 /* Flush data and metadata to platter, not just to disk cache */ +#define SYNC_VOLUME_WAIT 0x02 /* Wait for sync to complete */ + +int fsync_volume_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int sync_volume_np(const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); + +extern int optreset; + +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#endif /* _UNISTD_H_ */ diff --git a/include/util.h b/include/util.h new file mode 100644 index 0000000..bbfad2b --- /dev/null +++ b/include/util.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2000, 2007, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: util.h,v 1.10 1997/12/01 02:25:46 lukem Exp $ */ + +/*- + * Copyright (c) 1995 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _UTIL_H_ +#define _UTIL_H_ + +#include +#include +#include +#include +#include +#include +#include + +#define PIDLOCK_NONBLOCK 1 +#define PIDLOCK_USEHOSTNAME 2 + +/* + * fparseln() specific operation flags. + */ +#define FPARSELN_UNESCESC 0x01 +#define FPARSELN_UNESCCONT 0x02 +#define FPARSELN_UNESCCOMM 0x04 +#define FPARSELN_UNESCREST 0x08 +#define FPARSELN_UNESCALL 0x0f + +/* + * opendev() specific operation flags. + */ +#define OPENDEV_PART 0x01 /* Try to open the raw partition. */ +#define OPENDEV_BLCK 0x04 /* Open block, not character device. */ + +__BEGIN_DECLS +#ifdef UNIFDEF_LEGACY_UTMP_APIS +struct utmp; /* forward reference to /usr/include/utmp.h */ +void login(struct utmp *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#endif /* UNIFDEF_LEGACY_UTMP_APIS */ +int login_tty(int); +#ifdef UNIFDEF_LEGACY_UTMP_APIS +int logout(const char *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#endif /* UNIFDEF_LEGACY_UTMP_APIS */ +void logwtmp(const char *, const char *, const char *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5,__IPHONE_2_0,__IPHONE_2_0); +int opendev(char *, int, int, char **); +int openpty(int *, int *, char *, struct termios *, + struct winsize *); +char *fparseln(FILE *, size_t *, size_t *, const char[3], int); +pid_t forkpty(int *, char *, struct termios *, struct winsize *); +int pidlock(const char *, int, pid_t *, const char *); +int ttylock(const char *, int, pid_t *); +int ttyunlock(const char *); +int ttyaction(char *tty, char *act, char *user); +struct iovec; +char *ttymsg(struct iovec *, int, const char *, int); +__END_DECLS +#ifdef UNIFDEF_LEGACY_UTMP_APIS + +/* Include utmp.h last to avoid deprecation warning above */ +#include +#endif /* UNIFDEF_LEGACY_UTMP_APIS */ + +#endif /* !_UTIL_H_ */ diff --git a/include/utime.h b/include/utime.h new file mode 100644 index 0000000..106e494 --- /dev/null +++ b/include/utime.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)utime.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _UTIME_H_ +#define _UTIME_H_ + +#include <_types.h> +#include + +struct utimbuf { + time_t actime; /* Access time */ + time_t modtime; /* Modification time */ +}; + +#include + +__BEGIN_DECLS +int utime(const char *, const struct utimbuf *); +__END_DECLS + +#endif /* !_UTIME_H_ */ diff --git a/include/utmp.h b/include/utmp.h new file mode 100644 index 0000000..01eb531 --- /dev/null +++ b/include/utmp.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2000, 2005, 2007, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)utmp.h 8.2 (Berkeley) 1/21/94 + */ + +#ifndef _UTMP_H_ +#define _UTMP_H_ + +/* + * This header file is DEPRECATED and only provided for compatibility + * with previous releases of Mac OS X. Use of these structures, especially + * in 64-bit computing, may corrupt the utmp, wtmp and lastlog files. + * + * Use the utmpx APIs instead. + */ + +#include <_types.h> +#include + +/* These files no longer exist in 10.5 and later */ +#define _PATH_UTMP "/var/run/utmp" +#define _PATH_WTMP "/var/log/wtmp" +#define _PATH_LASTLOG "/var/log/lastlog" + +#define UT_NAMESIZE 8 +#define UT_LINESIZE 8 +#define UT_HOSTSIZE 16 + +struct lastlog { + time_t ll_time; + char ll_line[UT_LINESIZE]; + char ll_host[UT_HOSTSIZE]; +} __deprecated; + +struct utmp { + char ut_line[UT_LINESIZE]; + char ut_name[UT_NAMESIZE]; + char ut_host[UT_HOSTSIZE]; + long ut_time; +} __deprecated; + +#endif /* !_UTMP_H_ */ diff --git a/include/vis.h b/include/vis.h new file mode 100644 index 0000000..d0001cc --- /dev/null +++ b/include/vis.h @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: vis.h,v 1.21 2013/02/20 17:01:15 christos Exp $ */ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)vis.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _VIS_H_ +#define _VIS_H_ + +#include <_types.h> +#include + +/* + * to select alternate encoding format + */ +#define VIS_OCTAL 0x0001 /* use octal \ddd format */ +#define VIS_CSTYLE 0x0002 /* use \[nrft0..] where appropiate */ + +/* + * to alter set of characters encoded (default is to encode all + * non-graphic except space, tab, and newline). + */ +#define VIS_SP 0x0004 /* also encode space */ +#define VIS_TAB 0x0008 /* also encode tab */ +#define VIS_NL 0x0010 /* also encode newline */ +#define VIS_WHITE (VIS_SP | VIS_TAB | VIS_NL) +#define VIS_SAFE 0x0020 /* only encode "unsafe" characters */ + +/* + * other + */ +#define VIS_NOSLASH 0x0040 /* inhibit printing '\' */ +#define VIS_HTTP1808 0x0080 /* http-style escape % hex hex */ +#define VIS_HTTPSTYLE 0x0080 /* http-style escape % hex hex */ +#define VIS_GLOB 0x0100 /* encode glob(3) magic characters */ +#define VIS_MIMESTYLE 0x0200 /* mime-style escape = HEX HEX */ +#define VIS_HTTP1866 0x0400 /* http-style &#num; or &string; */ +#define VIS_NOESCAPE 0x0800 /* don't decode `\' */ +#define _VIS_END 0x1000 /* for unvis */ + +/* + * unvis return codes + */ +#define UNVIS_VALID 1 /* character valid */ +#define UNVIS_VALIDPUSH 2 /* character valid, push back passed char */ +#define UNVIS_NOCHAR 3 /* valid sequence, no character produced */ +#define UNVIS_SYNBAD -1 /* unrecognized escape sequence */ +#define UNVIS_ERROR -2 /* decoder in unknown state (unrecoverable) */ + +/* + * unvis flags + */ +#define UNVIS_END _VIS_END /* no more characters */ + +#include + +__BEGIN_DECLS +char *vis(char *, int, int, int); +char *nvis(char *, size_t, int, int, int); + +char *svis(char *, int, int, int, const char *); +char *snvis(char *, size_t, int, int, int, const char *); + +int strvis(char *, const char *, int); +int strnvis(char *, size_t, const char *, int); + +int strsvis(char *, const char *, int, const char *); +int strsnvis(char *, size_t, const char *, int, const char *); + +int strvisx(char *, const char *, size_t, int); +int strnvisx(char *, size_t, const char *, size_t, int); +int strenvisx(char *, size_t, const char *, size_t, int, int *); + +int strsvisx(char *, const char *, size_t, int, const char *); +int strsnvisx(char *, size_t, const char *, size_t, int, const char *); +int strsenvisx(char *, size_t, const char *, size_t , int, const char *, + int *); + +int strunvis(char *, const char *); +int strnunvis(char *, size_t, const char *); + +int strunvisx(char *, const char *, int); +int strnunvisx(char *, size_t, const char *, int); + +int unvis(char *, int, int *, int); +__END_DECLS + +#endif /* !_VIS_H_ */ diff --git a/include/wchar.h b/include/wchar.h new file mode 100644 index 0000000..e512127 --- /dev/null +++ b/include/wchar.h @@ -0,0 +1,253 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: /repoman/r/ncvs/src/include/wchar.h,v 1.34 2003/03/13 06:29:53 tjr Exp $ + */ + +/*- + * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Julian Coleman. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $ + */ + +#ifndef _WCHAR_H_ +#define _WCHAR_H_ + +#include <_types.h> +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifndef WCHAR_MIN +#define WCHAR_MIN __DARWIN_WCHAR_MIN +#endif + +#ifndef WCHAR_MAX +#define WCHAR_MAX __DARWIN_WCHAR_MAX +#endif + +#include +#include +#ifndef UNIFDEF_DRIVERKIT +#include +#endif /* UNIFDEF_DRIVERKIT */ +#include <_wctype.h> + + +/* Initially added in Issue 4 */ +__BEGIN_DECLS +wint_t btowc(int); +#ifndef UNIFDEF_DRIVERKIT +wint_t fgetwc(FILE *); +wchar_t *fgetws(wchar_t * __restrict, int, FILE * __restrict); +wint_t fputwc(wchar_t, FILE *); +int fputws(const wchar_t * __restrict, FILE * __restrict); +int fwide(FILE *, int); +int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...); +int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...); +wint_t getwc(FILE *); +wint_t getwchar(void); +#endif /* UNIFDEF_DRIVERKIT */ +size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict); +size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict); +int mbsinit(const mbstate_t *); +size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, + mbstate_t * __restrict); +#ifndef UNIFDEF_DRIVERKIT +wint_t putwc(wchar_t, FILE *); +wint_t putwchar(wchar_t); +#endif /* UNIFDEF_DRIVERKIT */ +int swprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict, ...); +int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...); +#ifndef UNIFDEF_DRIVERKIT +wint_t ungetwc(wint_t, FILE *); +int vfwprintf(FILE * __restrict, const wchar_t * __restrict, + __darwin_va_list); +#endif /* UNIFDEF_DRIVERKIT */ +int vswprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict, + __darwin_va_list); +#ifndef UNIFDEF_DRIVERKIT +int vwprintf(const wchar_t * __restrict, __darwin_va_list); +#endif /* UNIFDEF_DRIVERKIT */ +size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); +wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict); +wchar_t *wcschr(const wchar_t *, wchar_t); +int wcscmp(const wchar_t *, const wchar_t *); +int wcscoll(const wchar_t *, const wchar_t *); +wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict); +size_t wcscspn(const wchar_t *, const wchar_t *); +#ifndef UNIFDEF_DRIVERKIT +size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict, + const struct tm * __restrict) __DARWIN_ALIAS(wcsftime); +#endif /* UNIFDEF_DRIVERKIT */ +size_t wcslen(const wchar_t *); +wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t); +int wcsncmp(const wchar_t *, const wchar_t *, size_t); +wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t); +wchar_t *wcspbrk(const wchar_t *, const wchar_t *); +wchar_t *wcsrchr(const wchar_t *, wchar_t); +size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t, + mbstate_t * __restrict); +size_t wcsspn(const wchar_t *, const wchar_t *); +wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict); +size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t); +int wctob(wint_t); +double wcstod(const wchar_t * __restrict, wchar_t ** __restrict); +wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict, + wchar_t ** __restrict); +long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int); +unsigned long + wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int); +wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); +int wmemcmp(const wchar_t *, const wchar_t *, size_t); +wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t); +wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); +wchar_t *wmemset(wchar_t *, wchar_t, size_t); +#ifndef UNIFDEF_DRIVERKIT +int wprintf(const wchar_t * __restrict, ...); +int wscanf(const wchar_t * __restrict, ...); +#endif /* UNIFDEF_DRIVERKIT */ +int wcswidth(const wchar_t *, size_t); +int wcwidth(wchar_t); +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.1-2001 + * ISO C99 + */ + +#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) +__BEGIN_DECLS +#ifndef UNIFDEF_DRIVERKIT +int vfwscanf(FILE * __restrict, const wchar_t * __restrict, + __darwin_va_list); +#endif /* UNIFDEF_DRIVERKIT */ +int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict, + __darwin_va_list); +#ifndef UNIFDEF_DRIVERKIT +int vwscanf(const wchar_t * __restrict, __darwin_va_list); +#endif /* UNIFDEF_DRIVERKIT */ +float wcstof(const wchar_t * __restrict, wchar_t ** __restrict); +long double + wcstold(const wchar_t * __restrict, wchar_t ** __restrict); +#if !__DARWIN_NO_LONG_LONG +long long + wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int); +unsigned long long + wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int); +#endif /* !__DARWIN_NO_LONG_LONG */ +__END_DECLS +#endif + + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +__BEGIN_DECLS +size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, + size_t, mbstate_t * __restrict); +wchar_t *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +wchar_t *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +wchar_t *wcsdup(const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +int wcscasecmp(const wchar_t *, const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +size_t wcsnlen(const wchar_t *, size_t) __pure __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t, + size_t, mbstate_t * __restrict); +#ifndef UNIFDEF_DRIVERKIT +FILE *open_wmemstream(wchar_t ** __bufp, size_t * __sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); +#endif /* UNIFDEF_DRIVERKIT */ +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + + + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +__BEGIN_DECLS +#ifndef UNIFDEF_DRIVERKIT +wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +#endif /* UNIFDEF_DRIVERKIT */ +size_t wcslcat(wchar_t *, const wchar_t *, size_t); +size_t wcslcpy(wchar_t *, const wchar_t *, size_t); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison fgetwln fgetws fputwc fputws fwprintf fwscanf mbrtowc mbsnrtowcs mbsrtowcs putwc putwchar swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf vwprintf vwscanf wcrtomb wcscat wcschr wcscmp wcscoll wcscpy wcscspn wcsftime wcsftime wcslcat wcslcpy wcslen wcsncat wcsncmp wcsncpy wcsnrtombs wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcswidth wcsxfrm wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf +#endif + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_WCHAR_H_ */ diff --git a/include/wctype.h b/include/wctype.h new file mode 100644 index 0000000..c270cc6 --- /dev/null +++ b/include/wctype.h @@ -0,0 +1,130 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp + * $NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $ + * $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $ + */ + +#ifndef _WCTYPE_H_ +#define _WCTYPE_H_ + +#include +#include <_types.h> +#include <_types/_wctrans_t.h> + +#define __DARWIN_WCTYPE_TOP_inline __header_inline + +#include <_wctype.h> +#include + +/* + * Use inline functions if we are allowed to and the compiler supports them. + */ +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +__DARWIN_WCTYPE_TOP_inline int +iswblank(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_B)); +} + +#if !defined(_ANSI_SOURCE) +__DARWIN_WCTYPE_TOP_inline int +iswascii(wint_t _wc) +{ + return ((_wc & ~0x7F) == 0); +} + +__DARWIN_WCTYPE_TOP_inline int +iswhexnumber(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_X)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswideogram(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_I)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswnumber(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_D)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswphonogram(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_Q)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswrune(wint_t _wc) +{ + return (__istype(_wc, 0xFFFFFFF0L)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswspecial(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_T)); +} +#endif /* !_ANSI_SOURCE */ + +#else /* not using inlines */ + +__BEGIN_DECLS +int iswblank(wint_t); + +#if !defined(_ANSI_SOURCE) +wint_t iswascii(wint_t); +wint_t iswhexnumber(wint_t); +wint_t iswideogram(wint_t); +wint_t iswnumber(wint_t); +wint_t iswphonogram(wint_t); +wint_t iswrune(wint_t); +wint_t iswspecial(wint_t); +#endif +__END_DECLS + +#endif /* using inlines */ + +__BEGIN_DECLS +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +wint_t nextwctype(wint_t, wctype_t); +#endif +wint_t towctrans(wint_t, wctrans_t); +wctrans_t + wctrans(const char *); +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* _WCTYPE_H_ */ diff --git a/include/wordexp.h b/include/wordexp.h new file mode 100644 index 0000000..705b15c --- /dev/null +++ b/include/wordexp.h @@ -0,0 +1,85 @@ +/* + * Copyright 1994, University Corporation for Atmospheric Research + * See ../COPYRIGHT file for copying and redistribution conditions. + */ +/* + * Reproduction of ../COPYRIGHT file: + * + ********************************************************************* + +Copyright 1995-2002 University Corporation for Atmospheric Research/Unidata + +Portions of this software were developed by the Unidata Program at the +University Corporation for Atmospheric Research. + +Access and use of this software shall impose the following obligations +and understandings on the user. The user is granted the right, without +any fee or cost, to use, copy, modify, alter, enhance and distribute +this software, and any derivative works thereof, and its supporting +documentation for any purpose whatsoever, provided that this entire +notice appears in all copies of the software, derivative works and +supporting documentation. Further, UCAR requests that the user credit +UCAR/Unidata in any publications that result from the use of this +software or in any product that includes this software. The names UCAR +and/or Unidata, however, may not be used in any advertising or publicity +to endorse or promote any products or commercial entity unless specific +written permission is obtained from UCAR/Unidata. The user also +understands that UCAR/Unidata is not obligated to provide the user with +any support, consulting, training or assistance of any kind with regard +to the use, operation and performance of this software nor to provide +the user with any updates, revisions, new versions or "bug fixes." + +THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL, +INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING +FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION +WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. + + ********************************************************************* + * + */ + +/* $Id: wordexp.h,v 1.5 1994/05/12 20:46:40 davis Exp $ */ +#ifndef _WORDEXP_H +#define _WORDEXP_H + +#include +#include <_types.h> +#include +#include + +typedef struct { + size_t we_wordc; + char **we_wordv; + size_t we_offs; +} wordexp_t; + +/* wordexp() flags Argument */ +#define WRDE_APPEND 0x01 +#define WRDE_DOOFFS 0x02 +#define WRDE_NOCMD 0x04 +#define WRDE_REUSE 0x08 +#define WRDE_SHOWERR 0x10 +#define WRDE_UNDEF 0x20 + +/* + * wordexp() Return Values + */ +/* required */ +#define WRDE_BADCHAR 1 +#define WRDE_BADVAL 2 +#define WRDE_CMDSUB 3 +#define WRDE_NOSPACE 4 +#define WRDE_NOSYS 5 +#define WRDE_SYNTAX 6 + + +__BEGIN_DECLS +int wordexp(const char * __restrict, wordexp_t * __restrict, int) __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA); +void wordfree(wordexp_t *) __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA); +__END_DECLS + +#endif /* _WORDEXP_H */ diff --git a/include/xlocale.h b/include/xlocale.h new file mode 100644 index 0000000..f5824b3 --- /dev/null +++ b/include/xlocale.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE_H_ +#define _XLOCALE_H_ + +#include + +#ifndef _USE_EXTENDED_LOCALES_ +#define _USE_EXTENDED_LOCALES_ +#endif /* _USE_EXTENDED_LOCALES_ */ + +#include <_locale.h> +#include <_xlocale.h> + +#define LC_ALL_MASK ( LC_COLLATE_MASK \ + | LC_CTYPE_MASK \ + | LC_MESSAGES_MASK \ + | LC_MONETARY_MASK \ + | LC_NUMERIC_MASK \ + | LC_TIME_MASK ) +#define LC_COLLATE_MASK (1 << 0) +#define LC_CTYPE_MASK (1 << 1) +#define LC_MESSAGES_MASK (1 << 2) +#define LC_MONETARY_MASK (1 << 3) +#define LC_NUMERIC_MASK (1 << 4) +#define LC_TIME_MASK (1 << 5) + +#define _LC_NUM_MASK 6 +#define _LC_LAST_MASK (1 << (_LC_NUM_MASK - 1)) + +#define LC_GLOBAL_LOCALE ((locale_t)-1) +#define LC_C_LOCALE ((locale_t)NULL) + +#ifdef MB_CUR_MAX +#undef MB_CUR_MAX +#define MB_CUR_MAX (___mb_cur_max()) +#ifndef MB_CUR_MAX_L +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif /* !MB_CUR_MAX_L */ +#endif /* MB_CUR_MAX */ + +__BEGIN_DECLS +extern const locale_t _c_locale; + +locale_t duplocale(locale_t); +int freelocale(locale_t); +struct lconv * localeconv_l(locale_t); +locale_t newlocale(int, __const char *, locale_t); +__const char * querylocale(int, locale_t); +locale_t uselocale(locale_t); +__END_DECLS + +#ifdef _CTYPE_H_ +#include +#endif /* _CTYPE_H_ */ +#ifdef __WCTYPE_H_ +#include +#endif /* __WCTYPE_H_ */ +#ifdef _INTTYPES_H_ +#include +#endif /* _INTTYPES_H_ */ +#ifdef _LANGINFO_H_ +#include +#endif /* _LANGINFO_H_ */ +#ifdef _MONETARY_H_ +#include +#endif /* _MONETARY_H_ */ +#ifdef _REGEX_H_ +#include +#endif /* _REGEX_H_ */ +#ifdef _STDIO_H_ +#include +#endif /* _STDIO_H_ */ +#ifdef _STDLIB_H_ +#include +#endif /* _STDLIB_H_ */ +#ifdef _STRING_H_ +#include +#endif /*STRING_CTYPE_H_ */ +#ifdef _TIME_H_ +#include +#endif /* _TIME_H_ */ +#ifdef _WCHAR_H_ +#include +#endif /*WCHAR_CTYPE_H_ */ +#ifdef _WCTYPE_H_ +#include +#endif /* _WCTYPE_H_ */ + +#endif /* _XLOCALE_H_ */ diff --git a/include/xlocale/__wctype.h b/include/xlocale/__wctype.h new file mode 100644 index 0000000..2246382 --- /dev/null +++ b/include/xlocale/__wctype.h @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE___WCTYPE_H_ +#define _XLOCALE___WCTYPE_H_ + +#include <__wctype.h> +#include + +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +__DARWIN_WCTYPE_TOP_inline int +iswalnum_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_A|_CTYPE_D, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswalpha_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_A, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswcntrl_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_C, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswctype_l(wint_t _wc, wctype_t _charclass, locale_t _l) +{ + return (__istype_l(_wc, _charclass, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswdigit_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_D, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswgraph_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_G, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswlower_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_L, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswprint_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_R, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswpunct_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_P, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswspace_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_S, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswupper_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_U, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswxdigit_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_X, _l)); +} + +__DARWIN_WCTYPE_TOP_inline wint_t +towlower_l(wint_t _wc, locale_t _l) +{ + return (__tolower_l(_wc, _l)); +} + +__DARWIN_WCTYPE_TOP_inline wint_t +towupper_l(wint_t _wc, locale_t _l) +{ + return (__toupper_l(_wc, _l)); +} + +#else /* not using inlines */ + +__BEGIN_DECLS +int iswalnum_l(wint_t, locale_t); +int iswalpha_l(wint_t, locale_t); +int iswcntrl_l(wint_t, locale_t); +int iswctype_l(wint_t, wctype_t, locale_t); +int iswdigit_l(wint_t, locale_t); +int iswgraph_l(wint_t, locale_t); +int iswlower_l(wint_t, locale_t); +int iswprint_l(wint_t, locale_t); +int iswpunct_l(wint_t, locale_t); +int iswspace_l(wint_t, locale_t); +int iswupper_l(wint_t, locale_t); +int iswxdigit_l(wint_t, locale_t); +wint_t towlower_l(wint_t, locale_t); +wint_t towupper_l(wint_t, locale_t); +__END_DECLS + +#endif /* using inlines */ + +__BEGIN_DECLS +wctype_t + wctype_l(const char *, locale_t); +__END_DECLS + +#endif /* _XLOCALE___WCTYPE_H_ */ diff --git a/include/xlocale/_ctype.h b/include/xlocale/_ctype.h new file mode 100644 index 0000000..99fe94d --- /dev/null +++ b/include/xlocale/_ctype.h @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__CTYPE_H_ +#define _XLOCALE__CTYPE_H_ + +#include <_ctype.h> +#include <_xlocale.h> + +/* + * Use inline functions if we are allowed to and the compiler supports them. + */ +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +/* See comments in about __darwin_ct_rune_t. */ +__BEGIN_DECLS +unsigned long ___runetype_l(__darwin_ct_rune_t, locale_t); +__darwin_ct_rune_t ___tolower_l(__darwin_ct_rune_t, locale_t); +__darwin_ct_rune_t ___toupper_l(__darwin_ct_rune_t, locale_t); +__END_DECLS + +__BEGIN_DECLS +int __maskrune_l(__darwin_ct_rune_t, unsigned long, locale_t); +__END_DECLS + +__DARWIN_CTYPE_inline int +__istype_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l) +{ + return !!(isascii(_c) ? (_DefaultRuneLocale.__runetype[_c] & _f) + : __maskrune_l(_c, _f, _l)); +} + +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__toupper_l(__darwin_ct_rune_t _c, locale_t _l) +{ + return isascii(_c) ? _DefaultRuneLocale.__mapupper[_c] + : ___toupper_l(_c, _l); +} + +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__tolower_l(__darwin_ct_rune_t _c, locale_t _l) +{ + return isascii(_c) ? _DefaultRuneLocale.__maplower[_c] + : ___tolower_l(_c, _l); +} + +__DARWIN_CTYPE_inline int +__wcwidth_l(__darwin_ct_rune_t _c, locale_t _l) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, _l); + if ((_x & _CTYPE_SWM) != 0) + return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); + return ((_x & _CTYPE_R) != 0 ? 1 : -1); +} + +#ifndef _EXTERNALIZE_CTYPE_INLINES_ + +__DARWIN_CTYPE_TOP_inline int +digittoint_l(int c, locale_t l) +{ + return (__maskrune_l(c, 0x0F, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isalnum_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_A|_CTYPE_D, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isalpha_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_A, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isblank_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_B, l)); +} + +__DARWIN_CTYPE_TOP_inline int +iscntrl_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_C, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isdigit_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_D, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isgraph_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_G, l)); +} + +__DARWIN_CTYPE_TOP_inline int +ishexnumber_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_X, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isideogram_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_I, l)); +} + +__DARWIN_CTYPE_TOP_inline int +islower_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_L, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isnumber_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_D, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isphonogram_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_Q, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isprint_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_R, l)); +} + +__DARWIN_CTYPE_TOP_inline int +ispunct_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_P, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isrune_l(int c, locale_t l) +{ + return (__istype_l(c, 0xFFFFFFF0L, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isspace_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_S, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isspecial_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_T, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isupper_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_U, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isxdigit_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_X, l)); +} + +__DARWIN_CTYPE_TOP_inline int +tolower_l(int c, locale_t l) +{ + return (__tolower_l(c, l)); +} + +__DARWIN_CTYPE_TOP_inline int +toupper_l(int c, locale_t l) +{ + return (__toupper_l(c, l)); +} +#endif /* _EXTERNALIZE_CTYPE_INLINES_ */ + +#else /* not using inlines */ + +__BEGIN_DECLS +int digittoint_l(int, locale_t); +int isalnum_l(int, locale_t); +int isalpha_l(int, locale_t); +int isblank_l(int, locale_t); +int iscntrl_l(int, locale_t); +int isdigit_l(int, locale_t); +int isgraph_l(int, locale_t); +int ishexnumber_l(int, locale_t); +int isideogram_l(int, locale_t); +int islower_l(int, locale_t); +int isnumber_l(int, locale_t); +int isphonogram_l(int, locale_t); +int isprint_l(int, locale_t); +int ispunct_l(int, locale_t); +int isrune_l(int, locale_t); +int isspace_l(int, locale_t); +int isspecial_l(int, locale_t); +int isupper_l(int, locale_t); +int isxdigit_l(int, locale_t); +int tolower_l(int, locale_t); +int toupper_l(int, locale_t); +__END_DECLS +#endif /* using inlines */ + +#endif /* _XLOCALE__CTYPE_H_ */ diff --git a/include/xlocale/_inttypes.h b/include/xlocale/_inttypes.h new file mode 100644 index 0000000..db72853 --- /dev/null +++ b/include/xlocale/_inttypes.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__INTTYPES_H_ +#define _XLOCALE__INTTYPES_H_ + +#include +#include +#include <_xlocale.h> + +__BEGIN_DECLS +intmax_t strtoimax_l(const char * __restrict nptr, char ** __restrict endptr, + int base, locale_t); +uintmax_t strtoumax_l(const char * __restrict nptr, char ** __restrict endptr, + int base, locale_t); +intmax_t wcstoimax_l(const wchar_t * __restrict nptr, + wchar_t ** __restrict endptr, int base, locale_t); +uintmax_t wcstoumax_l(const wchar_t * __restrict nptr, + wchar_t ** __restrict endptr, int base, locale_t); + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison wcstoimax_l wcstoumax_l +#endif +__END_DECLS + +#endif /* _XLOCALE__INTTYPES_H_ */ diff --git a/include/xlocale/_langinfo.h b/include/xlocale/_langinfo.h new file mode 100644 index 0000000..0190cf6 --- /dev/null +++ b/include/xlocale/_langinfo.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__LANGINFO_H_ +#define _XLOCALE__LANGINFO_H_ + +#include +#include <_types/_nl_item.h> +#include <_xlocale.h> + +__BEGIN_DECLS +char *nl_langinfo_l(nl_item, locale_t); +__END_DECLS + +#endif /* _XLOCALE__LANGINFO_H_ */ diff --git a/include/xlocale/_monetary.h b/include/xlocale/_monetary.h new file mode 100644 index 0000000..cf10468 --- /dev/null +++ b/include/xlocale/_monetary.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2005, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__MONETARY_H_ +#define _XLOCALE__MONETARY_H_ + +#include +#include <_types.h> +#include +#include +#include <_xlocale.h> + +__BEGIN_DECLS +ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...) + __strfmonlike(4, 5); +__END_DECLS + +#endif /* _XLOCALE__MONETARY_H_ */ diff --git a/include/xlocale/_regex.h b/include/xlocale/_regex.h new file mode 100644 index 0000000..8f4fcf3 --- /dev/null +++ b/include/xlocale/_regex.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__REGEX_H_ +#define _XLOCALE__REGEX_H_ + +#ifndef _REGEX_H_ +#include <_regex.h> +#endif // _REGEX_H_ +#include <_xlocale.h> + +__BEGIN_DECLS + +int regcomp_l(regex_t * __restrict, const char * __restrict, int, + locale_t __restrict) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA); + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL + +int regncomp_l(regex_t * __restrict, const char * __restrict, size_t, + int, locale_t __restrict) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA); +int regwcomp_l(regex_t * __restrict, const wchar_t * __restrict, + int, locale_t __restrict) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA); +int regwnexec_l(const regex_t * __restrict, const wchar_t * __restrict, + size_t, size_t, regmatch_t __pmatch[ __restrict], int, + locale_t __restrict) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA); + +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +__END_DECLS + +#endif /* _XLOCALE__REGEX_H_ */ diff --git a/include/xlocale/_stdio.h b/include/xlocale/_stdio.h new file mode 100644 index 0000000..f9272ff --- /dev/null +++ b/include/xlocale/_stdio.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2005, 2009, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__STDIO_H_ +#define _XLOCALE__STDIO_H_ + +#include <_stdio.h> +#include <_xlocale.h> + +__BEGIN_DECLS + +int fprintf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, ...) + __printflike(3, 4); +int fscanf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, ...) + __scanflike(3, 4); +int printf_l(locale_t __restrict, const char * __restrict, ...) + __printflike(2, 3); +int scanf_l(locale_t __restrict, const char * __restrict, ...) + __scanflike(2, 3); +int sprintf_l(char * __restrict, locale_t __restrict, const char * __restrict, ...) + __printflike(3, 4) __swift_unavailable("Use snprintf_l instead."); +int sscanf_l(const char * __restrict, locale_t __restrict, const char * __restrict, ...) + __scanflike(3, 4); +int vfprintf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, va_list) + __printflike(3, 0); +int vprintf_l(locale_t __restrict, const char * __restrict, va_list) + __printflike(2, 0); +int vsprintf_l(char * __restrict, locale_t __restrict, const char * __restrict, va_list) + __printflike(3, 0) __swift_unavailable("Use vsnprintf_l instead."); + +#if __DARWIN_C_LEVEL >= 200112L || defined(__cplusplus) +int snprintf_l(char * __restrict, size_t, locale_t __restrict, const char * __restrict, ...) + __printflike(4, 5); +int vfscanf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, va_list) + __scanflike(3, 0); +int vscanf_l(locale_t __restrict, const char * __restrict, va_list) + __scanflike(2, 0); +int vsnprintf_l(char * __restrict, size_t, locale_t __restrict, const char * __restrict, va_list) + __printflike(4, 0); +int vsscanf_l(const char * __restrict, locale_t __restrict, const char * __restrict, va_list) + __scanflike(3, 0); +#endif + +#if __DARWIN_C_LEVEL >= 200809L || defined(__cplusplus) +int dprintf_l(int, locale_t __restrict, const char * __restrict, ...) + __printflike(3, 4) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +int vdprintf_l(int, locale_t __restrict, const char * __restrict, va_list) + __printflike(3, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +#endif + + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL || defined(__cplusplus) +int asprintf_l(char ** __restrict, locale_t __restrict, const char * __restrict, ...) + __printflike(3, 4); +int vasprintf_l(char ** __restrict, locale_t __restrict, const char * __restrict, va_list) + __printflike(3, 0); +#endif + +__END_DECLS + + +#endif /* _XLOCALE__STDIO_H_ */ diff --git a/include/xlocale/_stdlib.h b/include/xlocale/_stdlib.h new file mode 100644 index 0000000..add77d6 --- /dev/null +++ b/include/xlocale/_stdlib.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__STDLIB_H_ +#define _XLOCALE__STDLIB_H_ + +#include +#include +#include +#include <_xlocale.h> + +__BEGIN_DECLS +double atof_l(const char *, locale_t); +int atoi_l(const char *, locale_t); +long atol_l(const char *, locale_t); +#if !__DARWIN_NO_LONG_LONG +long long + atoll_l(const char *, locale_t); +#endif /* !__DARWIN_NO_LONG_LONG */ +int mblen_l(const char *, size_t, locale_t); +size_t mbstowcs_l(wchar_t * __restrict , const char * __restrict, size_t, + locale_t); +int mbtowc_l(wchar_t * __restrict, const char * __restrict, size_t, + locale_t); +double strtod_l(const char *, char **, locale_t) __DARWIN_ALIAS(strtod_l); +float strtof_l(const char *, char **, locale_t) __DARWIN_ALIAS(strtof_l); +long strtol_l(const char *, char **, int, locale_t); +long double + strtold_l(const char *, char **, locale_t); +long long + strtoll_l(const char *, char **, int, locale_t); +#if !__DARWIN_NO_LONG_LONG +long long + strtoq_l(const char *, char **, int, locale_t); +#endif /* !__DARWIN_NO_LONG_LONG */ +unsigned long + strtoul_l(const char *, char **, int, locale_t); +unsigned long long + strtoull_l(const char *, char **, int, locale_t); +#if !__DARWIN_NO_LONG_LONG +unsigned long long + strtouq_l(const char *, char **, int, locale_t); +#endif /* !__DARWIN_NO_LONG_LONG */ +size_t wcstombs_l(char * __restrict, const wchar_t * __restrict, size_t, + locale_t); +int wctomb_l(char *, wchar_t, locale_t); + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison mbstowcs_l mbtowc_l wcstombs_l wctomb_l +#endif +__END_DECLS + +#endif /* _XLOCALE__STDLIB_H_ */ diff --git a/include/xlocale/_string.h b/include/xlocale/_string.h new file mode 100644 index 0000000..8aa73fa --- /dev/null +++ b/include/xlocale/_string.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__STRING_H_ +#define _XLOCALE__STRING_H_ + +#include +#include +#include <_xlocale.h> + +__BEGIN_DECLS +int strcoll_l(const char *, const char *, locale_t); +size_t strxfrm_l(char *, const char *, size_t, locale_t); +int strcasecmp_l(const char *, const char *, locale_t); +char *strcasestr_l(const char *, const char *, locale_t); +int strncasecmp_l(const char *, const char *, size_t, locale_t); +__END_DECLS + +#endif /* _XLOCALE__STRING_H_ */ diff --git a/include/xlocale/_time.h b/include/xlocale/_time.h new file mode 100644 index 0000000..c2c0965 --- /dev/null +++ b/include/xlocale/_time.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2005, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__TIME_H_ +#define _XLOCALE__TIME_H_ + +#include +#include +#include <_types.h> +#include <_xlocale.h> + +__BEGIN_DECLS +size_t strftime_l(char * __restrict, size_t, const char * __restrict, + const struct tm * __restrict, locale_t) + __DARWIN_ALIAS(strftime_l) __strftimelike(3); +char *strptime_l(const char * __restrict, const char * __restrict, + struct tm * __restrict, locale_t) + __DARWIN_ALIAS(strptime_l) __strftimelike(2); +__END_DECLS + +#endif /* _XLOCALE__TIME_H_ */ diff --git a/include/xlocale/_wchar.h b/include/xlocale/_wchar.h new file mode 100644 index 0000000..260f540 --- /dev/null +++ b/include/xlocale/_wchar.h @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__WCHAR_H_ +#define _XLOCALE__WCHAR_H_ + +#include <_stdio.h> +#include <_xlocale.h> +#include + +/* Initially added in Issue 4 */ +__BEGIN_DECLS +wint_t btowc_l(int, locale_t); +wint_t fgetwc_l(FILE *, locale_t); +wchar_t *fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t); +wint_t fputwc_l(wchar_t, FILE *, locale_t); +int fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t); +int fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); +int fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); +wint_t getwc_l(FILE *, locale_t); +wint_t getwchar_l(locale_t); +size_t mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict, + locale_t); +size_t mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict, locale_t); +int mbsinit_l(const mbstate_t *, locale_t); +size_t mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, + mbstate_t * __restrict, locale_t); +wint_t putwc_l(wchar_t, FILE *, locale_t); +wint_t putwchar_l(wchar_t, locale_t); +int swprintf_l(wchar_t * __restrict, size_t n, locale_t, + const wchar_t * __restrict, ...); +int swscanf_l(const wchar_t * __restrict, locale_t, + const wchar_t * __restrict, ...); +wint_t ungetwc_l(wint_t, FILE *, locale_t); +int vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + __darwin_va_list); +int vswprintf_l(wchar_t * __restrict, size_t n, locale_t, + const wchar_t * __restrict, __darwin_va_list); +int vwprintf_l(locale_t, const wchar_t * __restrict, __darwin_va_list); +size_t wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict, + locale_t); +int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); +size_t wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict, + const struct tm * __restrict, locale_t) + __DARWIN_ALIAS(wcsftime_l); +size_t wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, + mbstate_t * __restrict, locale_t); +double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int, + locale_t); +unsigned long + wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int, + locale_t); +int wcswidth_l(const wchar_t *, size_t, locale_t); +size_t wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t, + locale_t); +int wctob_l(wint_t, locale_t); +int wcwidth_l(wchar_t, locale_t); +int wprintf_l(locale_t, const wchar_t * __restrict, ...); +int wscanf_l(locale_t, const wchar_t * __restrict, ...); +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.1-2001 + */ + +#if __DARWIN_C_LEVEL >= 200112L +__BEGIN_DECLS +int vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + __darwin_va_list); +int vswscanf_l(const wchar_t * __restrict, locale_t, + const wchar_t * __restrict, __darwin_va_list); +int vwscanf_l(locale_t, const wchar_t * __restrict, __darwin_va_list); +float wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long double + wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +#if !__DARWIN_NO_LONG_LONG +long long + wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int, + locale_t); +unsigned long long + wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int, + locale_t); +#endif /* !__DARWIN_NO_LONG_LONG */ +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L */ + + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +__BEGIN_DECLS +size_t mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, + size_t, mbstate_t * __restrict, locale_t); +int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t n, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +size_t wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, + size_t, mbstate_t * __restrict, locale_t); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + + + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +__BEGIN_DECLS +wchar_t *fgetwln_l(FILE * __restrict, size_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + + + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison fgetwln_l fgetws_l fputwc_l fputws_l fwprintf_l fwscanf_l mbrtowc_l mbsnrtowcs_l mbsrtowcs_l putwc_l putwchar_l swprintf_l swscanf_l vfwprintf_l vfwscanf_l vswprintf_l vswscanf_l vwprintf_l vwscanf_l wcrtomb_l wcscoll_l wcsftime_l wcsftime_l wcsnrtombs_l wcsrtombs_l wcstod_l wcstof_l wcstol_l wcstold_l wcstoll_l wcstoul_l wcstoull_l wcswidth_l wcsxfrm_l wcwidth_l wprintf_l wscanf_l +#endif + +#endif /* _XLOCALE__WCHAR_H_ */ diff --git a/include/xlocale/_wctype.h b/include/xlocale/_wctype.h new file mode 100644 index 0000000..2b0c684 --- /dev/null +++ b/include/xlocale/_wctype.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__WCTYPE_H_ +#define _XLOCALE__WCTYPE_H_ + +#include <__wctype.h> +#include <_types/_wctrans_t.h> +#include + +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +__DARWIN_WCTYPE_TOP_inline int +iswblank_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_B, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswhexnumber_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_X, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswideogram_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_I, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswnumber_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_D, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswphonogram_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_Q, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswrune_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, 0xFFFFFFF0L, _l)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswspecial_l(wint_t _wc, locale_t _l) +{ + return (__istype_l(_wc, _CTYPE_T, _l)); +} + +#else /* not using inlines */ + +__BEGIN_DECLS +int iswblank_l(wint_t, locale_t); +wint_t iswhexnumber_l(wint_t, locale_t); +wint_t iswideogram_l(wint_t, locale_t); +wint_t iswnumber_l(wint_t, locale_t); +wint_t iswphonogram_l(wint_t, locale_t); +wint_t iswrune_l(wint_t, locale_t); +wint_t iswspecial_l(wint_t, locale_t); +__END_DECLS + +#endif /* using inlines */ + +__BEGIN_DECLS +wint_t nextwctype_l(wint_t, wctype_t, locale_t); +wint_t towctrans_l(wint_t, wctrans_t, locale_t); +wctrans_t + wctrans_l(const char *, locale_t); +__END_DECLS + +#endif /* _XLOCALE__WCTYPE_H_ */ diff --git a/libdarwin/AppleFactoryVariant.plist b/libdarwin/AppleFactoryVariant.plist new file mode 100644 index 0000000..dcf7008 --- /dev/null +++ b/libdarwin/AppleFactoryVariant.plist @@ -0,0 +1,8 @@ + + + + + AppleInternal-Factory + + + diff --git a/libdarwin/AppleInternalVariant.plist b/libdarwin/AppleInternalVariant.plist new file mode 100644 index 0000000..554c06f --- /dev/null +++ b/libdarwin/AppleInternalVariant.plist @@ -0,0 +1,8 @@ + + + + + AppleInternal + + + diff --git a/libdarwin/CMakeLists.txt b/libdarwin/CMakeLists.txt new file mode 100644 index 0000000..e1b3917 --- /dev/null +++ b/libdarwin/CMakeLists.txt @@ -0,0 +1,47 @@ +project(libc-libdarwin) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") + +add_compile_definitions( + _LIBC_NO_FEATURE_VERIFICATION=1 + DARWIN_BUILDING_LIBSYSTEM_DARWIN=1 + OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE +) + +include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/h") + +set(DYLIB_INSTALL_NAME "/usr/lib/system/libsystem_darwin.dylib") +add_circular(system_darwin FAT + SOURCES + bsd.c + ctl.c + dirstat_collection.c + dirstat.c + err.c + exception.c + init.c + mach.c + stdio.c + stdlib.c + string.c + variant.c + SIBLINGS + macho + system_dyld + compiler_rt + system_dyld + system_kernel + system_m + system_malloc + platform + system_pthread + system_c + libdispatch_shared + xpc + system_trace + + # not listed in the Xcode files, but apparently required for `mach.c` (for `bootstrap_strerror`) + launch +) + +install(TARGETS system_darwin DESTINATION libexec/darling/usr/lib/system) diff --git a/libdarwin/bsd.c b/libdarwin/bsd.c new file mode 100644 index 0000000..35cbafd --- /dev/null +++ b/libdarwin/bsd.c @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include "internal.h" + +#pragma mark Utilities + +/* + * Factored out from _get_parse_boot_arg_value for unit testing purposes + */ +static bool +_parse_boot_arg_value(char *argsbuff, const char *which, char *where, size_t max) +{ + bool found = false; + + char *token = NULL; + char *argsstr = argsbuff; + static const char seps[] = { ' ', '\t', }; + while ((token = strsep(&argsstr, seps)) != NULL) { + bool is_boolean = false; + + char *value = NULL; + char *equals = strchr(token, '='); + if (token[0] == '-') { + /* + * Arguments whose names begins with "-" are booleans, so don't get + * key=value splitting. Though I'd still discourage you from + * naming your option "-edge=case". + */ + is_boolean = true; + } else if (equals) { + equals[0] = '\0'; + value = &equals[1]; + } else { + is_boolean = true; + } + + if (strcmp(which, token) == 0) { + /* + * Found it! Copy out the value as required. + */ + found = true; + + if (!where) { + // Caller just wants to know whether the boot-arg exists. + } else if (is_boolean || value == NULL) { + strlcpy(where, "", max); + } else { + strlcpy(where, value, max); + } + + break; + } + } + + return found; +} + +/* + * This is (very) loosely based on the implementation of + * PE_parse_boot_argn() (or at least the parts where I was able to easily + * decipher the policy). + */ +static bool +_get_boot_arg_value(const char *which, char *where, size_t max) +{ + bool found = false; + __os_free char *argsbuff = NULL; + size_t argsbuff_len = 0; + errno_t error = sysctlbyname_get_data_np("kern.bootargs", + (void **)&argsbuff, &argsbuff_len); + + if (!error) { + found = _parse_boot_arg_value(argsbuff, which, where, max); + } + + return found; +} + +#pragma mark API +errno_t +sysctl_get_data_np(int mib[4], size_t mib_cnt, void **buff, size_t *buff_len) +{ + errno_t error = 0; + int ret = 0; + size_t needed = 0; + void *mybuff = NULL; + + // We need to get the length of the parameter so we can allocate a buffer + // that's large enough. + ret = sysctl(mib, (unsigned int)mib_cnt, NULL, &needed, NULL, 0); + if (ret) { + error = errno; + goto __out; + } + + mybuff = malloc(needed); + if (!mybuff) { + error = errno; + goto __out; + } + + ret = sysctl(mib, (unsigned int)mib_cnt, mybuff, &needed, NULL, 0); + if (ret) { + // It's conceivable that some other process came along within this + // window and modified the variable to be even larger than we'd + // previously been told, but if that's the case, just give up. + error = errno; + goto __out; + } + + *buff = mybuff; + *buff_len = needed; + +__out: + if (error) { + free(mybuff); + } + return error; +} + +errno_t +sysctlbyname_get_data_np(const char *mibdesc, void **buff, size_t *buff_len) +{ + int ret = -1; + int error = -1; + int mib[4]; + size_t mib_cnt = countof(mib); + + ret = sysctlnametomib(mibdesc, mib, &mib_cnt); + if (ret) { + error = errno; + goto __out; + } + + error = sysctl_get_data_np(mib, mib_cnt, buff, buff_len); + +__out: + return error; +} + +bool +os_parse_boot_arg_int(const char *which, int64_t *where) +{ + bool found = false; + char buff[24] = {0}; + char *endptr = NULL; + int64_t val = 0; + + found = _get_boot_arg_value(which, buff, sizeof(buff)); + if (!found || !where) { + goto __out; + } + + // A base of zero handles bases 8, 10, and 16. + val = strtoll(buff, &endptr, 0); + if (*endptr == 0) { + *where = val; + } else { + // The boot-arg value was invalid, so say we didn't find it. + found = false; + } + +__out: + return found; +} + +bool +os_parse_boot_arg_string(const char *which, char *where, size_t maxlen) +{ + return _get_boot_arg_value(which, where, maxlen); +} diff --git a/libdarwin/ctl.c b/libdarwin/ctl.c new file mode 100644 index 0000000..adcef27 --- /dev/null +++ b/libdarwin/ctl.c @@ -0,0 +1,612 @@ +#include "internal.h" + +#pragma mark Definitions +#define CTL_OUTPUT_WIDTH (80) +#define CTL_OUTPUT_OPTARG_PAD (28) +#define CTL_OUTPUT_LIST_PAD (4) +#define SUBCOMMAND_LINKER_SET "__subcommands" + +#define OS_SUBCOMMAND_OPTIONS_FOREACH(_osco_i, _osc, _which, _i) \ + while (((_osco_i) = &osc->osc_ ## _which[(_i)]) && \ + ((_i) += 1, 1) && \ + !((_osco_i)->osco_flags & OS_SUBCOMMAND_OPTION_FLAG_TERMINATOR)) + +#pragma mark Types +OS_ENUM(os_subcommand_option_spec_fmt, uint64_t, + OS_SUBCOMMAND_OPTION_SPEC_SHORT, + OS_SUBCOMMAND_OPTION_SPEC_LONG, + OS_SUBCOMMAND_OPTION_SPEC_COMBINED, +); + +#pragma mark Forward Declarations +static void _print_header( + FILE *f, + const char *hdr, + bool *already_done); +static const os_subcommand_t *_os_subcommand_find( + const char *name); +static void _os_subcommand_print_usage( + const os_subcommand_t *osc, + FILE *f); +static void _os_subcommand_print_help_line( + const os_subcommand_t *osc, + FILE *f); + +#pragma mark Module Globals +static const os_subcommand_t __help_cmd; +static const os_subcommand_t *_help_cmd = &__help_cmd; + +static const os_subcommand_t __main_cmd; +static const os_subcommand_t *_main_cmd = &__main_cmd; +static const os_subcommand_t *_internal_main_cmd = &__main_cmd; + +#pragma mark Main Subcommand +static int _main_invoke(const os_subcommand_t *osc, + int argc, + const char *argv[]); + +static const os_subcommand_option_t _main_positional[] = { + [0] = { + .osco_version = OS_SUBCOMMAND_OPTION_VERSION, + .osco_flags = 0, + .osco_option = NULL, + .osco_argument_usage = "subcommand", + .osco_argument_human = "The subcommand to invoke", + }, + OS_SUBCOMMAND_OPTION_TERMINATOR, +}; + +static const os_subcommand_t __main_cmd = { + .osc_version = OS_SUBCOMMAND_VERSION, + .osc_flags = OS_SUBCOMMAND_FLAG_MAIN, + .osc_name = "_main", + .osc_desc = "main command", + .osc_optstring = NULL, + .osc_options = NULL, + .osc_required = NULL, + .osc_optional = NULL, + .osc_positional = _main_positional, + .osc_invoke = &_main_invoke, +}; + +static int +_main_invoke(const os_subcommand_t *osc, int argc, const char *argv[]) +{ + return 0; +} + +#pragma mark Help Subcommand +static int _help_invoke(const os_subcommand_t *osc, + int argc, + const char *argv[]); + +static const os_subcommand_option_t _help_positional[] = { + [0] = { + .osco_version = OS_SUBCOMMAND_OPTION_VERSION, + .osco_flags = 0, + .osco_option = NULL, + .osco_argument_usage = "subcommand", + .osco_argument_human = "The subcommand to query for help", + }, + OS_SUBCOMMAND_OPTION_TERMINATOR, +}; + +static const os_subcommand_t __help_cmd = { + .osc_version = OS_SUBCOMMAND_VERSION, + .osc_flags = 0, + .osc_name = "help", + .osc_desc = "prints helpful information", + .osc_optstring = NULL, + .osc_options = NULL, + .osc_required = NULL, + .osc_optional = NULL, + .osc_positional = _help_positional, + .osc_invoke = &_help_invoke, +}; + +static int +_help_invoke(const os_subcommand_t *osc, int argc, const char *argv[]) +{ + int xit = -1; + const char *cmdname = NULL; + const os_subcommand_t *target = NULL; + FILE *f = stdout; + + if (argc > 1) { + cmdname = argv[1]; + } + + if (cmdname) { + // Print usage information for the requested subcommand. + target = _os_subcommand_find(argv[1]); + if (!target) { + os_subcommand_fprintf(osc, stderr, "unrecognized subcommand: %s", + argv[1]); + xit = EX_USAGE; + } else { + xit = 0; + } + } else { + // Print general, top-level usage followed by a list of subcommands. + target = _main_cmd; + xit = 0; + } + + if (xit) { + f = stderr; + } + + _os_subcommand_print_usage(target, f); + + if (target == _main_cmd) { + const os_subcommand_t **oscip = NULL; + const os_subcommand_t *osci = NULL; + bool header_printed = false; + + LINKER_SET_FOREACH(oscip, const os_subcommand_t **, + SUBCOMMAND_LINKER_SET) { + osci = *oscip; + + _print_header(f, "subcommands", &header_printed); + _os_subcommand_print_help_line(osci, f); + } + + // Print the help subcommand last. + _os_subcommand_print_help_line(osc, f); + } + + return xit; +} + +#pragma mark Utilities +static void +_print_header(FILE *f, const char *hdr, bool *already_done) +{ + if (*already_done) { + return; + } + + crfprintf_np(f, ""); + crfprintf_np(f, "%s:", hdr); + *already_done = true; +} + +#pragma mark Module Routines +static char * +_os_subcommand_copy_option_spec_short(const os_subcommand_t *osc, + const os_subcommand_option_t *osco) +{ + const struct option *opt = osco->osco_option; + char optbuff[64] = ""; + char argbuff[64] = ""; + char *final = NULL; + int ret = -1; + + if (opt) { + snprintf(optbuff, sizeof(optbuff), "-%c", opt->val); + + switch (opt->has_arg) { + case no_argument: + break; + case optional_argument: + snprintf(argbuff, sizeof(argbuff), "[%s]", + osco->osco_argument_usage); + break; + case required_argument: + snprintf(argbuff, sizeof(argbuff), "<%s>", + osco->osco_argument_usage); + break; + default: + __builtin_unreachable(); + } + } else { + snprintf(optbuff, sizeof(optbuff), "%s", osco->osco_argument_usage); + } + + ret = asprintf(&final, "%s%s", optbuff, argbuff); + if (ret < 0) { + os_assert_zero(ret); + } + + return final; +} + +static char * +_os_subcommand_copy_option_spec_long(const os_subcommand_t *osc, + const os_subcommand_option_t *osco) +{ + const struct option *opt = osco->osco_option; + char optbuff[64] = ""; + char argbuff[64] = ""; + char *final = NULL; + int ret = -1; + + if (opt) { + snprintf(optbuff, sizeof(optbuff), "--%s", opt->name); + + switch (opt->has_arg) { + case no_argument: + break; + case optional_argument: + snprintf(argbuff, sizeof(argbuff), "[=%s]", + osco->osco_argument_usage); + break; + case required_argument: + snprintf(argbuff, sizeof(argbuff), "=<%s>", + osco->osco_argument_usage); + break; + default: + __builtin_unreachable(); + } + } else { + snprintf(optbuff, sizeof(optbuff), "%s", osco->osco_argument_usage); + } + + ret = asprintf(&final, "%s%s", optbuff, argbuff); + if (ret < 0) { + os_assert_zero(ret); + } + + return final; +} + +static char * +_os_subcommand_copy_option_spec(const os_subcommand_t *osc, + const os_subcommand_option_t *osco, os_subcommand_option_spec_fmt_t fmt) +{ + int ret = -1; + char *spec = NULL; + char *__os_free spec_old = NULL; + + switch (fmt) { + case OS_SUBCOMMAND_OPTION_SPEC_SHORT: + _os_subcommand_copy_option_spec_short(osc, osco); + break; + case OS_SUBCOMMAND_OPTION_SPEC_LONG: + _os_subcommand_copy_option_spec_long(osc, osco); + break; + case OS_SUBCOMMAND_OPTION_SPEC_COMBINED: + spec = _os_subcommand_copy_option_spec_long(osc, osco); + if (osco->osco_option) { + spec_old = spec; + + ret = asprintf(&spec, "%s | -%c", spec, osco->osco_option->val); + if (ret < 0) { + os_assert_zero(ret); + } + } + + break; + default: + __builtin_unreachable(); + } + + return spec; +} + +static char * +_os_subcommand_copy_usage_line(const os_subcommand_t *osc) +{ + char *usage_line = NULL; + size_t i = 0; + const os_subcommand_option_t *osco_i = NULL; + const char *optional_spec = ""; + char subcmd_name[64]; + int ret = -1; + + // The usage line does not enumerate all possible optional options, just the + // required options. If there are optional options, then display that but + // otherwise leave them to be described by more extensive usage information. + if (osc->osc_optional) { + optional_spec = " [options]"; + } + + if (osc == _main_cmd) { + strlcpy(subcmd_name, "", sizeof(subcmd_name)); + } else { + snprintf(subcmd_name, sizeof(subcmd_name), " %s", osc->osc_name); + } + + ret = asprintf(&usage_line, "%s%s%s", + getprogname(), subcmd_name, optional_spec); + if (ret < 0) { + os_assert_zero(ret); + } + + i = 0; + OS_SUBCOMMAND_OPTIONS_FOREACH(osco_i, osc, required, i) { + char *__os_free usage_line_old = NULL; + char *__os_free osco_spec = NULL; + + usage_line_old = usage_line; + + osco_spec = _os_subcommand_copy_option_spec_long(osc, osco_i); + ret = asprintf(&usage_line, "%s %s", usage_line, osco_spec); + if (ret < 0) { + os_assert_zero(ret); + } + } + + i = 0; + OS_SUBCOMMAND_OPTIONS_FOREACH(osco_i, osc, positional, i) { + char *__os_free usage_line_old = NULL; + char *__os_free osco_spec = NULL; + const char *braces[] = { + "<", + ">", + }; + + if (osco_i->osco_flags & OS_SUBCOMMAND_OPTION_FLAG_OPTIONAL_POS) { + braces[0] = "["; + braces[1] = "]"; + } + + usage_line_old = usage_line; + + osco_spec = _os_subcommand_copy_option_spec_long(osc, osco_i); + ret = asprintf(&usage_line, "%s %s%s%s", + usage_line, braces[0], osco_spec, braces[1]); + if (ret < 0) { + os_assert_zero(ret); + } + } + + if (osc == _main_cmd && osc != _internal_main_cmd) { + // Always include the positional subcommand when printing usage for the + // main subcommand. We do not expect it to be specified in a user- + // provided main subcommand. + char *__os_free usage_line_old = NULL; + char *__os_free osco_spec = NULL; + + usage_line_old = usage_line; + + osco_spec = _os_subcommand_copy_option_spec_long(osc, + &_main_positional[0]); + ret = asprintf(&usage_line, "%s <%s>", usage_line, osco_spec); + if (ret < 0) { + os_assert_zero(ret); + } + } + + return usage_line; +} + +static void +_os_subcommand_print_option_usage(const os_subcommand_t *osc, + const os_subcommand_option_t *osco, FILE *f) +{ + char *__os_free opt_spec = NULL; + ssize_t initpad = -CTL_OUTPUT_OPTARG_PAD; + + opt_spec = _os_subcommand_copy_option_spec(osc, osco, + OS_SUBCOMMAND_OPTION_SPEC_COMBINED); + fprintf(f, " %-24s", opt_spec); + + // If the usage specifier is long, start the description on the next line. + if (strlen(opt_spec) >= CTL_OUTPUT_OPTARG_PAD) { + initpad = CTL_OUTPUT_OPTARG_PAD; + crfprintf_np(f, ""); + } + + wfprintf_np(f, initpad, CTL_OUTPUT_OPTARG_PAD, + CTL_OUTPUT_WIDTH, "%s", + osco->osco_argument_human); +} + +static void +_os_subcommand_print_help_line(const os_subcommand_t *osc, FILE *f) +{ + ssize_t initpad = -CTL_OUTPUT_OPTARG_PAD; + + fprintf(f, " %-24s", osc->osc_name); + + // If the usage specifier is long, start the description on the next line. + if (strlen(osc->osc_name) >= CTL_OUTPUT_OPTARG_PAD) { + initpad = CTL_OUTPUT_OPTARG_PAD; + crfprintf_np(f, ""); + } + + wfprintf_np(f, initpad, CTL_OUTPUT_OPTARG_PAD, + CTL_OUTPUT_WIDTH, "%s", + osc->osc_desc); +} + +static void +_os_subcommand_print_usage(const os_subcommand_t *osc, FILE *f) +{ + size_t i = 0; + const os_subcommand_option_t *osco_i = NULL; + char *__os_free usage_line = NULL; + bool header_printed = false; + + usage_line = _os_subcommand_copy_usage_line(osc); + wfprintf_np(f, 0, 0, CTL_OUTPUT_WIDTH, "usage: %s", usage_line); + + if (osc->osc_required || osc->osc_positional || osc == _main_cmd) { + i = 0; + OS_SUBCOMMAND_OPTIONS_FOREACH(osco_i, osc, required, i) { + _print_header(f, "required", &header_printed); + + crfprintf_np(f, ""); + _os_subcommand_print_option_usage(osc, osco_i, f); + } + + i = 0; + OS_SUBCOMMAND_OPTIONS_FOREACH(osco_i, osc, positional, i) { + _print_header(f, "required", &header_printed); + + if (osco_i->osco_flags & OS_SUBCOMMAND_OPTION_FLAG_OPTIONAL_POS) { + continue; + } + + crfprintf_np(f, ""); + _os_subcommand_print_option_usage(osc, osco_i, f); + } + + if (osc == _main_cmd && osc != _internal_main_cmd) { + // We do not expect the user's main command to specify that a + // subcommand must follow, so always defer to ours. + _print_header(f, "required", &header_printed); + + crfprintf_np(f, ""); + _os_subcommand_print_option_usage(osc, &_main_positional[0], f); + } + } + + header_printed = false; + + if (osc->osc_optional || osc->osc_positional) { + i = 0; + OS_SUBCOMMAND_OPTIONS_FOREACH(osco_i, osc, optional, i) { + _print_header(f, "optional", &header_printed); + + crfprintf_np(f, ""); + _os_subcommand_print_option_usage(osc, osco_i, f); + } + + i = 0; + OS_SUBCOMMAND_OPTIONS_FOREACH(osco_i, osc, positional, i) { + if (osco_i->osco_flags & OS_SUBCOMMAND_OPTION_FLAG_OPTIONAL_POS) { + _print_header(f, "optional", &header_printed); + + crfprintf_np(f, ""); + _os_subcommand_print_option_usage(osc, osco_i, f); + } + } + } +} + +static const os_subcommand_t * +_os_subcommand_find(const char *name) +{ + const os_subcommand_t **oscip = NULL; + + if (strcmp(_help_cmd->osc_name, name) == 0) { + return &__help_cmd; + } + + LINKER_SET_FOREACH(oscip, const os_subcommand_t **, SUBCOMMAND_LINKER_SET) { + const os_subcommand_t *osci = *oscip; + + if (osci->osc_flags & OS_SUBCOMMAND_FLAG_MAIN) { + // The main subcommand cannot be invoked directly. + continue; + } + + if (strcmp(osci->osc_name, name) == 0) { + return osci; + } + } + + return NULL; +} + +#pragma mark API +int +os_subcommand_main(int argc, const char *argv[], + os_subcommand_main_flags_t flags) +{ + int xit = -1; + const char *cmdname = NULL; + const os_subcommand_t *osc = NULL; + const os_subcommand_t **oscip = NULL; + + if (argc < 2) { + os_subcommand_fprintf(NULL, stderr, "please provide a subcommand"); + xit = EX_USAGE; + goto __out; + } + + // Find the main subcommand if any exists. Otherwise we'll just use our pre- + // canned main subcommand. + LINKER_SET_FOREACH(oscip, const os_subcommand_t **, SUBCOMMAND_LINKER_SET) { + osc = *oscip; + if (osc->osc_flags & OS_SUBCOMMAND_FLAG_MAIN) { + _main_cmd = osc; + break; + } + } + + osc = NULL; + + // Invoke the main subcommand to snarf any global options. Our default + // implementation does nothing and just returns 0. + xit = _main_cmd->osc_invoke(_main_cmd, argc, argv); + if (xit) { + goto __out; + } + + // Advance argument pointer and make the subcommand argv[0]. + argc -= optind; + argv += optind; + cmdname = argv[0]; + + if (argc < 1) { + os_subcommand_fprintf(NULL, stderr, "please provide a subcommand"); + xit = EX_USAGE; + goto __out; + } + + osc = _os_subcommand_find(cmdname); + if (osc) { + if (osc->osc_flags & OS_SUBCOMMAND_FLAG_REQUIRE_ROOT) { + if (geteuid()) { + os_subcommand_fprintf(osc, stderr, + "subcommand requires root: %s", + cmdname); + xit = EX_NOPERM; + goto __out; + } + } + + if (osc->osc_flags & OS_SUBCOMMAND_FLAG_TTYONLY) { + if (!isatty(STDOUT_FILENO) || !isatty(STDIN_FILENO)) { + os_subcommand_fprintf(osc, stderr, + "subcommand requires a tty: %s", + cmdname); + xit = EX_UNAVAILABLE; + goto __out; + } + } + + xit = osc->osc_invoke(osc, argc, argv); + } else { + os_subcommand_fprintf(NULL, stderr, "unknonwn subcommand: %s", cmdname); + xit = EX_USAGE; + } + +__out: + if (xit == EX_USAGE) { + if (!osc) { + osc = _main_cmd; + } + + _os_subcommand_print_usage(osc, stderr); + } + + return xit; +} + +void +os_subcommand_fprintf(const os_subcommand_t *osc, FILE *f, + const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vcrfprintf_np(f, fmt, ap); + va_end(ap); +} + +void +os_subcommand_vfprintf(const os_subcommand_t *osc, FILE *f, + const char *fmt, va_list ap) +{ + if (!osc || (osc->osc_flags & OS_SUBCOMMAND_FLAG_MAIN)) { + fprintf(f, "%s: ", getprogname()); + } else { + fprintf(f, "%s::%s: ", getprogname(), osc->osc_name); + } + + vcrfprintf_np(f, fmt, ap); +} diff --git a/libdarwin/dirstat.c b/libdarwin/dirstat.c new file mode 100644 index 0000000..6d4ad15 --- /dev/null +++ b/libdarwin/dirstat.c @@ -0,0 +1,365 @@ +/* + * Copyright (c) 2017 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "dirstat.h" +#include "dirstat_collection.h" + +#if !TARGET_OS_SIMULATOR && !defined(DARLING) +#define HAS_APFS +#endif + +#ifdef HAS_APFS +#include +#endif + +#if DEBUG +#define DEBUGPRINT(...) fprintf(stderr, __VA_ARGS__) +#else +#define DEBUGPRINT(...) do { } while(0) +#endif + +static int +fdirstat_fallback(int fd, int flags, struct dirstat *ds); + +#ifdef HAS_APFS +static int +fdirstat(int fd, int flags, struct dirstat *ds) +{ + struct apfs_dir_stats_ext dstats = {0}; + if (flags & DIRSTAT_FAST_ONLY) { + dstats.flags |= APFS_DIR_STATS_FAST_PATH; + } + + int err = ffsctl(fd, APFSIOC_GET_DIR_STATS_EXT, &dstats, 0); + if (err == -1) { + if (errno == ENOENT) { + // + errno = ENOTSUP; + } + return -1; + } + + ds->total_size = dstats.total_size; + ds->descendants = dstats.num_children; + + return 0; +} +#endif + +int +dirstatat_np(int dfd, const char *path, int flags, struct dirstat *ds_out, size_t ds_size) +{ +#ifdef HAS_APFS + // + // Until APFS directory sizing is fixed, only the fallback path is + // available. + flags |= DIRSTAT_FORCE_FALLBACK; + + // FORCE_FALLBACK trumps FAST_ONLY. Make sure to set errno accordingly in + // the case that a confused caller asks for both. + if ((flags & (DIRSTAT_FAST_ONLY)) && (flags & DIRSTAT_FORCE_FALLBACK)) { + errno = ENOTSUP; + return -1; + } +#endif + + int fd = openat(dfd, path, O_RDONLY | O_DIRECTORY); + DEBUGPRINT("Opened %d:%s as %d\n", dfd, path, fd); + if (fd == -1) return -1; + + struct dirstat ds = {}; + int ret = -1; + +#ifdef HAS_APFS + if (!(flags & DIRSTAT_FORCE_FALLBACK)) { + ret = fdirstat(fd, flags, &ds); + } + + if (ret == -1 && ((flags & DIRSTAT_FORCE_FALLBACK) || ((errno == ENOTTY) && !(flags & DIRSTAT_FAST_ONLY)))) { + ret = fdirstat_fallback(fd, flags, &ds); + } +#else + ret = fdirstat_fallback(fd, flags, &ds); +#endif + int saved_errno = errno; + + if (ds_size >= sizeof(ds)) { + memcpy(ds_out, &ds, sizeof(ds)); + } else { + memcpy(ds_out, &ds, ds_size); + } + + close(fd); + + errno = saved_errno; + return ret; +} + +int +dirstat_np(const char *path, int flags, struct dirstat *ds, size_t ds_size) +{ + return dirstatat_np(AT_FDCWD, path, flags, ds, ds_size); +} + +#pragma mark Fallback + +struct dirqueue_entry { + STAILQ_ENTRY(dirqueue_entry) entries; + char *path; +}; + +static int +fdirstat_fallback(int parent_fd, int flags, struct dirstat *ds) +{ + int reterror = 0; + + /* + * This method of gathering disk usage is the fastest by far over other + * methods using fts or opendir/readdir + getattrlist or stat to gather + * information about filesystem usage. That's because this method avoids + * creating vnodes for each item in a directory. We implement a recursive + * filesystem search by appending each directory child found to a + * processing queue, and then process each child directory in that queue on + * a FIFO basis resulting in a breadth-first traversal of the filesystem. + * This keeps our actual implementation iterative to avoid deep filesystem + * hierarchies overflowing our stack. + */ + + dirstat_fileid_set_t fileid_seen = _dirstat_fileid_set_create(); + STAILQ_HEAD(, dirqueue_entry) dirqueue_head = STAILQ_HEAD_INITIALIZER(dirqueue_head); + + struct attrlist attrlist = { + .bitmapcount = ATTR_BIT_MAP_COUNT, + .commonattr = ATTR_CMN_RETURNED_ATTRS | ATTR_CMN_ERROR | + ATTR_CMN_NAME | ATTR_CMN_OBJTYPE | ATTR_CMN_FILEID, + .dirattr = ATTR_DIR_ENTRYCOUNT, + .fileattr = ATTR_FILE_LINKCOUNT | ATTR_FILE_ALLOCSIZE | + ATTR_FILE_DATAALLOCSIZE, + }; + + typedef struct { + /* + * fields are in order of possible return in buffer (but note that data + * is packed in the actual buffer, and only relevant fields are + * returned) + */ + uint32_t length; + attribute_set_t returned; //ATTR_CMN_RETURNED_ATTRS + uint32_t error; //ATTR_CMN_ERROR + attrreference_t item_name_info; //ATTR_CMN_NAME + fsobj_type_t type; //ATTR_CMN_OBJTYPE + uint64_t fileid; //ATTR_CMN_FILEID + union { + struct { + u_int32_t entry_count; //ATTR_DIR_ENTRYCOUNT + }; + struct { + u_int32_t link_count; //ATTR_FILE_LINKCOUNT + off_t alloc_size; //ATTR_FILE_ALLOCSIZE + off_t data_alloc_size; //ATTR_FILE_DATAALLOCSIZE + }; + }; + } max_attr_entry_t; + + size_t attrbuf_len = (32 * 1024); + char *attrbuf = alloca(attrbuf_len); + +#ifdef HAS_APFS + os_assert(!(flags & DIRSTAT_FAST_ONLY)); +#endif + + do { + int fd = -1; + char *path; + + if (STAILQ_EMPTY(&dirqueue_head)) { + fd = parent_fd; + path = NULL; + } else { + struct dirqueue_entry *dqe = STAILQ_FIRST(&dirqueue_head); + STAILQ_REMOVE_HEAD(&dirqueue_head, entries); + path = dqe->path; + free(dqe); + + fd = openat(parent_fd, path, O_RDONLY | O_DIRECTORY); + + if (fd < 0) { + DEBUGPRINT( "Unable to open directory %d:%s => %s\n", parent_fd, path, strerror(errno)); + continue; + } + } + + while (1) { + int ret_entry_count = getattrlistbulk(fd, &attrlist, attrbuf, attrbuf_len, 0); + if (-1 == ret_entry_count) { + if (fd == parent_fd) { + reterror = errno; + } + DEBUGPRINT( "getattrlistbulk on in %s returned error %s\n", path, strerror(errno)); + break; + } else if (0 == ret_entry_count) { + break; + } else { + char *cursor = NULL; //pointer into attrbuf + char *entry_start = attrbuf; + + for (int index = 0; index < ret_entry_count; index++) { + max_attr_entry_t attrs = {0}; + char *name = NULL; + + cursor = entry_start; + + memcpy(&attrs.length, cursor, sizeof(attrs.length)); + cursor += sizeof(attrs.length); + + /* set starting point for next entry */ + entry_start += attrs.length; + + memcpy(&attrs.returned, cursor, sizeof(attrs.returned)); + cursor += sizeof(attrs.returned); + + if (attrs.returned.commonattr & ATTR_CMN_ERROR) { + memcpy(&attrs.error, cursor, sizeof(attrs.error)); + cursor += sizeof(attrs.error); + } + + if (attrs.error) { + DEBUGPRINT( "Got error %s while processing in %s\n", strerror(errno), path); + continue; + } + + if (attrs.returned.commonattr & ATTR_CMN_NAME) { + memcpy(&attrs.item_name_info, cursor, sizeof(attrs.item_name_info)); + name = cursor + attrs.item_name_info.attr_dataoffset; + if (name + attrs.item_name_info.attr_length > entry_start) { + name = NULL; + } + cursor += sizeof(attrs.item_name_info); + } + + if (attrs.returned.commonattr & ATTR_CMN_OBJTYPE) { + memcpy(&attrs.type, cursor, sizeof(attrs.type)); + cursor += sizeof(attrs.type); + } + + if (attrs.returned.commonattr & ATTR_CMN_FILEID) { + memcpy(&attrs.fileid, cursor, sizeof(attrs.fileid)); + cursor += sizeof(attrs.fileid); + } + + if (VDIR == attrs.type) { + if (attrs.returned.dirattr & ATTR_DIR_ENTRYCOUNT) { + memcpy(&attrs.entry_count, cursor, sizeof(attrs.entry_count)); + cursor += sizeof(attrs.entry_count); + } else { + // Fake it so we go down the right path below + attrs.entry_count = -1; + } + + // avoid descending into empty directories + if (attrs.entry_count && name) { + struct dirqueue_entry *dqe = malloc(sizeof(struct dirqueue_entry)); + if (path == NULL) { + dqe->path = strdup(name); + } else { + asprintf(&dqe->path, "%s/%s", path, name); + } + + if (dqe->path != NULL) { + STAILQ_INSERT_TAIL(&dirqueue_head, dqe, entries); + } else { + DEBUGPRINT( "Unable to create dqe\n"); + free(dqe); + } + } else if (attrs.entry_count != 0) { + DEBUGPRINT( "Failed to get name for item in %s\n", path); + } else if (attrs.entry_count == 0) { + // Empty directory, nothing to do + } + } else { + off_t object_size = 0; + + if (attrs.returned.fileattr & ATTR_FILE_LINKCOUNT) { + memcpy(&attrs.link_count, cursor, sizeof(attrs.link_count)); + cursor += sizeof(attrs.link_count); + } + + if (attrs.returned.fileattr & ATTR_FILE_ALLOCSIZE) { + memcpy(&attrs.alloc_size, cursor, sizeof(attrs.alloc_size)); + cursor += sizeof(attrs.alloc_size); + object_size = attrs.alloc_size; + } + + if (attrs.returned.fileattr & ATTR_FILE_DATAALLOCSIZE) { + memcpy(&attrs.data_alloc_size, cursor, sizeof(attrs.data_alloc_size)); + cursor += sizeof(attrs.data_alloc_size); + if (0 == object_size) { + object_size = attrs.data_alloc_size; + } + } + + if (1 == attrs.link_count) { + ds->total_size += object_size; + } else { + bool seen_fileid = _dirstat_fileid_set_add(fileid_seen, attrs.fileid); + if (!seen_fileid) { + ds->total_size += object_size; + } else { + DEBUGPRINT( "Skipping hardlinked file at %s/%s\n", path, name); + } + } + } + ds->descendants++; + } + } + } + + if (path) { + close(fd); + free(path); + } + } while (!STAILQ_EMPTY(&dirqueue_head)); + + _dirstat_fileid_set_destroy(fileid_seen); + + if (reterror) { + errno = reterror; + return -1; + } else { + return 0; + } +} diff --git a/libdarwin/dirstat_collection.c b/libdarwin/dirstat_collection.c new file mode 100644 index 0000000..c91a2fe --- /dev/null +++ b/libdarwin/dirstat_collection.c @@ -0,0 +1,216 @@ +/* + * Copyright (c) 1989, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Newcomb. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * Copyright (c) 2017 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Taken from file_cmds:du.c + */ + +#include +#include +#include +#include "dirstat_collection.h" + +struct fileid_entry { + struct fileid_entry *next; + struct fileid_entry *previous; + //int links; + uint64_t fileid; +}; + + +struct dirstat_fileid_set_s { + struct fileid_entry **buckets; + struct fileid_entry *free_list; + size_t number_buckets; + unsigned long number_entries; + bool stop_allocating; +}; + +static const size_t links_hash_initial_size = 8192; + +dirstat_fileid_set_t +_dirstat_fileid_set_create(void) +{ + dirstat_fileid_set_t ds = calloc(1, sizeof(dirstat_fileid_set_s)); + ds->number_buckets = links_hash_initial_size; + ds->buckets = calloc(ds->number_buckets, sizeof(ds->buckets[0])); + if (ds->buckets == NULL) { + free(ds); + return NULL; + } + return ds; +} + +void +_dirstat_fileid_set_destroy(dirstat_fileid_set_t ds) +{ + struct fileid_entry *le; + for (size_t i = 0; i < ds->number_buckets; i++) { + while (ds->buckets[i] != NULL) { + le = ds->buckets[i]; + ds->buckets[i] = le->next; + free(le); + } + } + free(ds->buckets); + free(ds); +} + +bool +_dirstat_fileid_set_add(dirstat_fileid_set_t ds, uint64_t fileid) +{ + struct fileid_entry *le, **new_buckets; + size_t i, new_size; + int hash; + + /* If the hash table is getting too full, enlarge it. */ + if (ds->number_entries > ds->number_buckets * 10 && !ds->stop_allocating) { + new_size = ds->number_buckets * 2; + new_buckets = calloc(new_size, sizeof(struct fileid_entry *)); + + /* Try releasing the free list to see if that helps. */ + if (new_buckets == NULL && ds->free_list != NULL) { + while (ds->free_list != NULL) { + le = ds->free_list; + ds->free_list = le->next; + free(le); + } + new_buckets = calloc(new_size, sizeof(new_buckets[0])); + } + + if (new_buckets == NULL) { + ds->stop_allocating = 1; + } else { + for (i = 0; i < ds->number_buckets; i++) { + while (ds->buckets[i] != NULL) { + /* Remove entry from old bucket. */ + le = ds->buckets[i]; + ds->buckets[i] = le->next; + + /* Add entry to new bucket. */ + hash = (int)(fileid % new_size); + + if (new_buckets[hash] != NULL) + new_buckets[hash]->previous = + le; + le->next = new_buckets[hash]; + le->previous = NULL; + new_buckets[hash] = le; + } + } + free(ds->buckets); + ds->buckets = new_buckets; + ds->number_buckets = new_size; + } + } + + /* Try to locate this entry in the hash table. */ + hash = (int)(fileid % ds->number_buckets); + for (le = ds->buckets[hash]; le != NULL; le = le->next) { + if (le->fileid == fileid) { +#if 0 // TODO + /* + * Save memory by releasing an entry when we've seen + * all of its links. + */ + if (--le->links <= 0) { + if (le->previous != NULL) + le->previous->next = le->next; + if (le->next != NULL) + le->next->previous = le->previous; + if (buckets[hash] == le) + buckets[hash] = le->next; + number_entries--; + /* Recycle this node through the free list */ + if (stop_allocating) { + free(le); + } else { + le->next = free_list; + free_list = le; + } + } +#endif + return true; + } + } + + if (ds->stop_allocating) + return false; + + /* Add this entry to the links cache. */ + if (ds->free_list != NULL) { + /* Pull a node from the free list if we can. */ + le = ds->free_list; + ds->free_list = le->next; + } else { + /* Malloc one if we have to. */ + le = malloc(sizeof(struct fileid_entry)); + } + if (le == NULL) { + ds->stop_allocating = 1; + return false; + } + le->fileid = fileid; + ds->number_entries++; + le->next = ds->buckets[hash]; + le->previous = NULL; + if (ds->buckets[hash] != NULL) + ds->buckets[hash]->previous = le; + ds->buckets[hash] = le; + return false; +} diff --git a/libdarwin/err.c b/libdarwin/err.c new file mode 100644 index 0000000..85849b5 --- /dev/null +++ b/libdarwin/err.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include "internal.h" + +#pragma mark Utilities +static void +_print_preamble(FILE *fp, const char *fmt, va_list ap) +{ + fprintf(fp, "%s: ", getprogname()); + vfprintf(fp, fmt, ap); +} + +#pragma mark API +void +err_np(errno_t code, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + verr_np(code, fmt, ap); + va_end(ap); +} + +void +errc_np(int eval, errno_t code, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + verrc_np(eval, code, fmt, ap); + va_end(ap); +} + +void +warn_np(errno_t code, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vwarn_np(code, fmt, ap); + va_end(ap); +} + +void +verr_np(errno_t code, const char *fmt, va_list ap) +{ + _print_preamble(stderr, fmt, ap); + fprintf(stderr, ": %s\n", strerror_np(code)); + exit(sysexit_np(code)); +} + +void +verrc_np(int eval, errno_t code, const char *fmt, va_list ap) +{ + _print_preamble(stderr, fmt, ap); + fprintf(stderr, ": %s\n", strerror_np(code)); + exit(eval); +} + +void +vwarn_np(errno_t code, const char *fmt, va_list ap) +{ + _print_preamble(stderr, fmt, ap); + fprintf(stderr, ": %s\n", strerror_np(code)); +} diff --git a/libdarwin/exception.c b/libdarwin/exception.c new file mode 100644 index 0000000..7875000 --- /dev/null +++ b/libdarwin/exception.c @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include "internal.h" + +#pragma mark Assertions +static_assert(_OS_CRASH_LAST < OS_CRASH_PORT_ARRAY_COUNT, + "array not large enough"); + +#pragma mark Private Utilities +static thread_state_flavor_t +_exception_thread_state_flavor(void) +{ + thread_state_flavor_t flavor = 0; +#if defined(__i386__) || defined(__x86_64__) + flavor = x86_THREAD_STATE; +#elif defined(__arm__) || defined(__arm64__) + flavor = ARM_THREAD_STATE; +#else // defined(__i386__) || defined(__x86_64__) +#error "unsupported architecture" +#endif // defined(__i386__) || defined(__x86_64__) + return flavor; +} + +static exception_mask_t +_exception_mask(os_crash_flags_t flags) +{ + exception_mask_t mask = 0; + if (flags & OS_CRASH_FLAG_CRASH) { + mask |= EXC_MASK_CRASH; + } + if (flags & OS_CRASH_FLAG_GUARD) { + mask |= EXC_MASK_GUARD; + } + if (flags & OS_CRASH_FLAG_RESOURCE) { + mask |= EXC_MASK_RESOURCE; + } + if (flags & OS_CRASH_FLAG_CORPSE) { + mask |= EXC_MASK_CORPSE_NOTIFY; + mask &= (exception_mask_t)(~EXC_MASK_CRASH); + } + return mask; +} + +static exception_behavior_t +_exception_behavior(void) +{ + return (EXCEPTION_STATE_IDENTITY|MACH_EXCEPTION_CODES); +} + +static void +_os_exception_port_set(os_crash_port_t *ep, + os_crash_type_t type, mach_port_t p) +{ + kern_return_t kr = KERN_FAILURE; + + ep->oep_type = type; + ep->oep_port = p; + + kr = mach_port_mod_refs(mach_task_self(), p, MACH_PORT_RIGHT_SEND, 1); + if (kr == KERN_SUCCESS) { + ep->oep_port = p; + } else { + ep->oep_port = MACH_PORT_DEAD; + } +} + +#pragma mark API +kern_return_t +os_crash_set_reporter_port(mach_port_t where, + os_crash_flags_t flags, mach_port_t p) +{ + kern_return_t kr = KERN_FAILURE; + exception_mask_t mask = _exception_mask(flags); + exception_behavior_t bhvr = _exception_behavior(); + thread_state_flavor_t flvr = _exception_thread_state_flavor(); + mach_port_t host_priv = MACH_PORT_NULL; + + // If we're not privleged to get the host-privileged port, no big deal, then + // the comparison below will fail. + (void)host_get_host_priv_port(mach_host_self(), &host_priv); + + if (flags == OS_CRASH_FLAG_INIT) { + return KERN_SUCCESS; + } + + if (where == mach_host_self() || where == host_priv) { + kr = host_set_exception_ports(where, mask, p, bhvr, flvr); + } else { + kr = task_set_exception_ports(where, mask, p, bhvr, flvr); + } + + return kr; +} + +kern_return_t +os_crash_get_reporter_port_array(mach_port_t where, os_crash_port_array_t array) +{ + kern_return_t kr = KERN_FAILURE; + exception_mask_t masks[EXC_TYPES_COUNT]; + mach_msg_type_number_t nmasks = 0; + exception_port_t ports[EXC_TYPES_COUNT]; + exception_behavior_t behaviors[EXC_TYPES_COUNT]; + thread_state_flavor_t flavors[EXC_TYPES_COUNT]; + exception_mask_t mask = EXC_MASK_CRASH + | EXC_MASK_GUARD + | EXC_MASK_RESOURCE + | EXC_MASK_CORPSE_NOTIFY; + size_t i = 0; + size_t j = 0; + mach_port_t host_priv = MACH_PORT_NULL; + + (void)host_get_host_priv_port(mach_host_self(), &host_priv); + + if (where == mach_host_self() || where == host_priv) { + kr = host_get_exception_ports(mach_host_self(), mask, + masks, &nmasks, ports, behaviors, flavors); + } else { + kr = task_get_exception_ports(where, mask, + masks, &nmasks, ports, behaviors, flavors); + } + + if (kr) { + goto __out; + } + + bzero(array, sizeof(array[0]) * OS_CRASH_PORT_ARRAY_COUNT); + for (i = 0; i < nmasks; i++) { + if (masks[i] & EXC_MASK_CRASH) { + _os_exception_port_set(&array[j], OS_CRASH_CRASH, ports[i]); + j++; + } + if (masks[i] & EXC_MASK_GUARD) { + _os_exception_port_set(&array[j], OS_CRASH_GUARD, ports[i]); + j++; + } + if (masks[i] & EXC_MASK_RESOURCE) { + _os_exception_port_set(&array[j], OS_CRASH_RESOURCE, ports[i]); + j++; + } + if (masks[i] & EXC_MASK_CORPSE_NOTIFY) { + _os_exception_port_set(&array[j], OS_CRASH_CORPSE, ports[i]); + j++; + } + kr = mach_port_deallocate(mach_task_self(), ports[i]); + os_assert_mach("deallocate port", kr); + } + +__out: + return kr; +} + +void +os_crash_port_array_deallocate(os_crash_port_array_t array) +{ + size_t i = 0; + + for (i = 0; i < 16; i++) { + if (MACH_PORT_VALID(array[i].oep_port)) { + kern_return_t kr = KERN_FAILURE; + kr = mach_port_deallocate(mach_task_self(), array[i].oep_port); + os_assert_mach("deallocate port", kr); + } + } +} + +kern_return_t +os_crash_spawnattr_set_reporter_port(posix_spawnattr_t *psattr, + os_crash_flags_t flags, mach_port_t p) +{ + int error = -1; + exception_mask_t mask = _exception_mask(flags); + exception_behavior_t bhvr = _exception_behavior(); + thread_state_flavor_t flvr = _exception_thread_state_flavor(); + + if (!MACH_PORT_VALID(p)) { + return KERN_INVALID_NAME; + } + + if (flags == OS_CRASH_FLAG_INIT) { + return KERN_SUCCESS; + } + + error = posix_spawnattr_setexceptionports_np(psattr, mask, p, bhvr, flvr); + os_assert_zero(error); + + return KERN_SUCCESS; +} diff --git a/libdarwin/h/bsd.h b/libdarwin/h/bsd.h new file mode 100644 index 0000000..a33a9e0 --- /dev/null +++ b/libdarwin/h/bsd.h @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * Darwin-specific additions for FreeBSD APIs. + */ +#ifndef __DARWIN_BSD_H +#define __DARWIN_BSD_H + +#include +#include +#include +#include +#include +#include +#include + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +__BEGIN_DECLS; + +/*! + * @function sysctl_get_data_np + * A convenience routine for getting a sysctl(3) property whose size is not + * known at compile-time. + * + * @param mib + * An array describing the property to manipulate. This is a "management + * information base"-style descriptor, as described in sysctl(3). + * + * @param mib_cnt + * The number of items in the MIB array. + * + * @param buff + * On successful return, a pointer to a newly-allocated buffer. The caller is + * responsible for free(3)ing this buffer when it is no longer needed. + * + * @param buff_len + * On successful return, the length of the returned buffer. + * + * @result + * See the sysctl(3) man page for possible return codes. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 OS_NONNULL3 OS_NONNULL4 +errno_t +sysctl_get_data_np(int *mib, size_t mib_cnt, void **buff, size_t *buff_len); + +/*! + * @function sysctlbyname_get_data_np + * A convenience routine for getting a sysctl(3) property whose size is not + * known at compile-time. + * + * @param mibdesc + * An ASCII representation of the MIB vector describing the property to + * manipulate. Each element of the vector described is separated by a '.' + * character (e.g. "kern.ostype"). + * + * @param buff + * On successful return, a pointer to a newly-allocated buffer. The caller is + * responsible for free(3)ing this buffer when it is no longer needed. + * + * @param buff_len + * On successful return, the length of the returned buffer. + * + * @result + * See the sysctl(3) man page for possible return codes. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 OS_NONNULL2 OS_NONNULL3 +errno_t +sysctlbyname_get_data_np(const char *mibdesc, void **buff, size_t *buff_len); + +/*! + * @function os_parse_boot_arg_int + * A routine for extracting a boot-arg as an integer value that is semantically + * similar to the PE_parse_boot_argn() kernel routine. + * + * @param which + * The name of the boot-arg whose value is to be obtained. The caller may pass + * NULL to simply check for the existence of a boot-arg. + * + * @param where + * On successful return, the integer value of the given boot-arg. + * + * @result + * A Boolean indicating whether the named argument was found. If the discovered + * argument value was not convertible to an integer according to the contract + * in strtoll(3), the implementation will return false. + * + * @discussion + * Boot-args are expressed with an '=' sign as a separator between the name and + * value of an argument, e.g. "cs_enforcement_disable=1". + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 +bool +os_parse_boot_arg_int(const char *which, int64_t *where); + +/*! + * @function os_parse_boot_arg_string + * A routine for extracting a boot-arg's string value that is semantically + * similar to the PE_parse_boot_argn() kernel routine. + * + * @param which + * The name of the boot-arg whose value is to be obtained. + * + * @param where + * The buffer in which to place the extracted value on successful return. The + * caller may pass NULL to simply check for the existence of a boot-arg. + * + * @param maxlen + * The length of the {@link where} buffer. May be zero if the caller only wishes + * to check for the existence of a boot-arg. + * + * @result + * A Boolean indicating whether the named argument was found. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 +bool +os_parse_boot_arg_string(const char *which, char *where, size_t maxlen); + +__END_DECLS; + +#endif // __DARWIN_BSD_H diff --git a/libdarwin/h/cleanup.h b/libdarwin/h/cleanup.h new file mode 100644 index 0000000..cbbd045 --- /dev/null +++ b/libdarwin/h/cleanup.h @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * Attributes to handle automatic clean-up of certain types of variables when + * they go out of scope. + * + * IMPORTANT: These attributes will NOT cause a variable to be cleaned up when + * its value changes. For example, this pattern would leak: + * + * void *__os_free ptr = malloc(10); + * ptr = somewhere_else; + * return; + * + * You should only use these attributes for very well-scoped, temporary + * allocations. + */ +#ifndef __DARWIN_CLEANUP_H +#define __DARWIN_CLEANUP_H + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +__BEGIN_DECLS; + +#if __has_attribute(cleanup) +/*! + * @define __os_free + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be passed to free(3) when it goes out of scope. Applying this + * attribute to variables that do not reference heap allocations will result in + * undefined behavior. + */ +#define __os_free __attribute__((cleanup(__os_cleanup_free))) +static inline void +__os_cleanup_free(void *__p) +{ + void **tp = (void **)__p; + void *p = *tp; + free(p); +} + +/*! + * @define __os_close + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be passed to close(2) when it goes out of scope. Applying + * this attribute to variables that do not reference a valid file descriptor + * will result in undefined behavior. If the variable's value is -1 upon going + * out-of-scope, no cleanup is performed. + */ +#define __os_close __attribute__((cleanup(__os_cleanup_close))) +static inline void +__os_cleanup_close(int *__fd) +{ + int fd = *__fd; + if (fd == -1) { + return; + } + posix_assert_zero(close(fd)); +} + +/*! + * @define __os_fclose + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be passed to fclose(3) when it goes out of scope. Applying + * this attribute to variables that do not reference a valid FILE * will result + * in undefined behavior. If the variable's value is NULL upon going out-of- + * scope, no cleanup is performed. + */ +#define __os_fclose __attribute__((cleanup(__os_cleanup_fclose))) +static inline void +__os_cleanup_fclose(FILE **__fp) +{ + FILE *f = *__fp; + int ret = -1; + + if (!f) { + return; + } + + ret = fclose(f); + if (ret == EOF) { + os_assert_zero(errno); + } +} + +/*! + * @define __os_closedir + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be passed to closedir(3) when it goes out of scope. Applying + * this attribute to variables that do not reference a valid DIR * will result + * in undefined behavior. If the variable's value is NULL upon going out-of- + * scope, no cleanup is performed. + */ +#define __os_closedir __attribute__((cleanup(__os_cleanup_closedir))) +static inline void +__os_cleanup_closedir(DIR **__dp) +{ + DIR *dp = *__dp; + + if (!dp) { + return; + } + posix_assert_zero(closedir(dp)); +} + +/*! + * @define __os_close_mach_recv + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be wrapped in a mach receive right object and passed to + * {@link mach_right_recv_destruct} when it goes out of scope. Applying this + * attribute to variables that do not reference a valid Mach port receive right + * will result in undefined behavior. If the variable's value is MACH_PORT_NULL + * or MACH_PORT_DEAD upon going out-of-scope, no cleanup is performed. + */ +#define __os_close_mach_recv \ + __attribute__((cleanup(__os_cleanup_close_mach_recv))) +static inline void +__os_cleanup_close_mach_recv(mach_port_t *__p) +{ + mach_port_t p = *__p; + mach_right_recv_t mr = mach_right_recv(p); + + if (!MACH_PORT_VALID(p)) { + return; + } + + mach_right_recv_destruct(mr, NULL, 0); +} + +/*! + * @define __os_release_mach_send + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be wrapped in a mach send right object and passed to + * {@link mach_right_send_release} when it goes out of scope. Applying this + * attribute to variables that do not reference a valid Mach port send right or + * MACH_PORT_NULL or MACH_PORT_DEAD will result in undefined behavior. If the + * variable's value is MACH_PORT_NULL or MACH_PORT_DEAD upon going out-of-scope, + * no cleanup is performed. + */ +#define __os_release_mach_send \ + __attribute__((cleanup(__os_cleanup_release_mach_send))) +static inline void +__os_cleanup_release_mach_send(mach_port_t *__p) +{ + mach_port_t p = *__p; + mach_right_send_t ms = mach_right_send(p); + + if (!MACH_PORT_VALID(p)) { + return; + } + + mach_right_send_release(ms); +} + +/*! + * @define __os_preserve_errno + * An attribute that may be applied to a variable's type. This attribute sets + * the global errno to the value of the variable when the variable goes out of + * scope. This attribute is useful for preserving the value of errno upon entry + * to a function and guaranteeing that it is restored upon exit. + */ +#define __os_preserve_errno \ + __unused __attribute__((cleanup(__os_cleanup_errno))) +static inline void +__os_cleanup_errno(int *__e) +{ + errno = *__e; +} + +/*! + * @define __os_release + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be passed to os_release() when it goes out of scope. Applying + * this attribute to a variable which does not reference a valid os_object_t + * object will result in undefined behavior. If the variable's value is NULL + * upon going out-of-scope, no cleanup is performed. + * + * This attribute may be applied to dispatch and XPC objects. + * + * When compiling with ARC, this attribute does nothing. + */ +#if __has_feature(objc_arc) +#define __os_release +#else +#define __os_release __attribute__((cleanup(__os_cleanup_os_release))) +static inline void +__os_cleanup_os_release(void *__p) +{ + _os_object_t *tp = (_os_object_t *)__p; + _os_object_t o = *tp; + if (!o) { + return; + } + os_release(o); +} +#endif + +#if DARWIN_CLEANUP_CF +/*! + * @define __os_cfrelease + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be passed to CFRelease() when it goes out of scope. Applying + * this attribute to a variable which does not reference a valid CoreFoundation + * object will result in undefined behavior. If the variable's value is NULL + * upon going out-of-scope, no cleanup is performed. + * + * In order to use, you must define the DARWIN_CLEANUP_CF macro to 1 prior to + * including this header. + */ +#define __os_cfrelease __attribute__((cleanup(__os_cleanup_cfrelease))) +static inline void +__os_cleanup_cfrelease(void *__p) +{ + CFTypeRef *tp = (CFTypeRef *)__p; + CFTypeRef cf = *tp; + if (!cf) { + return; + } + CFRelease(cf); +} +#endif // DARWIN_CLEANUP_CF + +#if DARWIN_CLEANUP_IOKIT +/*! + * @define __os_iorelease + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be passed to IOObjectRelease() when it goes out of scope. + * Applying this attribute to a variable which does not reference a valid IOKit + * object will result in undefined behavior. If the variable's value is + * IO_OBJECT_NULL upon going out-of-scope, no cleanup is performed. + * + * + * In order to use, you must define the DARWIN_CLEANUP_IOKIT macro to 1 prior to + * including this header. + */ +#define __os_iorelease __attribute__((cleanup(__os_cleanup_iorelease))) +static inline void +__os_cleanup_iorelease(void *__p) +{ + kern_return_t kr = KERN_FAILURE; + io_object_t *iop = (io_object_t *)__p; + io_object_t io = *iop; + + if (io == IO_OBJECT_NULL) { + return; + } + + kr = IOObjectRelease(io); + if (kr) { + os_crash("IOObjectRetain: %{mach.errno}d", kr); + } +} + +/*! + * @define __os_ioclose + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be passed to IOServiceClose() when it goes out of scope. + * Applying this attribute to a variable which does not reference a valid IOKit + * connection will result in undefined behavior. If the variable's value is + * IO_OBJECT_NULL upon going out-of-scope, no cleanup is performed. + * + * In order to use, you must define the DARWIN_CLEANUP_IOKIT macro to 1 prior to + * including this header. + */ +#define __os_ioclose __attribute__((cleanup(__os_cleanup_ioclose))) +static inline void +__os_cleanup_ioclose(void *__p) +{ + kern_return_t kr = KERN_FAILURE; + io_connect_t *iop = (io_object_t *)__p; + io_connect_t io = *iop; + + if (io == IO_OBJECT_NULL) { + return; + } + + kr = IOServiceClose(io); + if (kr) { + os_crash("IOObjectRelease: %{mach.errno}d", kr); + } +} +#endif // DARWIN_CLEANUP_IOKIT + +/*! + * @define __os_unfair_unlock + * An attribute that may be applied to a variable's type. This attribute causes + * the variable to be passed to os_unfair_lock_unlock() when it goes out of + * scope. Applying this attribute to a variable which does not reference a valid + * os_unfair_lock_t object will result in undefined behavior. If the variable's + * value is NULL upon going out-of-scope, no cleanup is performed. + * + * This attribute is useful even when the target lock is taken conditionally via + * the following pattern: + * + * os_unfair_lock lock = OS_UNFAIR_LOCK_INIT; + * os_unfair_lock_t __os_unfair_unlock l2un = NULL; + * + * if (take_the_lock) { + * os_unfair_lock_lock(&lock); + * + * // Guarantee that 'lock' will be unconditionally released when the + * // scope containing 'l2un' ends. + * l2un = &lock; + * } + */ +#define __os_unfair_unlock __attribute__((cleanup(__os_cleanup_unfair_unlock))) +static inline void +__os_cleanup_unfair_unlock(void *__p) +{ + os_unfair_lock_t *tp = (os_unfair_lock_t *)__p; + os_unfair_lock_t ufl = *tp; + if (!ufl) { + return; + } + os_unfair_lock_assert_owner(ufl); + os_unfair_lock_unlock(ufl); +} + +#else // __has_attribute(cleanup) +#define __os_cleanup_unsupported \ + _Pragma("GCC error \"automatic cleanup not supported\"") +#define __os_free __os_cleanup_unsupported +#define __os_close __os_cleanup_unsupported +#define __os_fclose __os_cleanup_unsupported +#define __os_closedir __os_cleanup_unsupported +#define __os_close_mach_recv __os_cleanup_unsupported +#define __os_release_mach_send __os_cleanup_unsupported +#define __os_preserve_errno __os_cleanup_unsupported +#define __os_release __os_cleanup_unsupported +#define __os_cfrelease __os_cleanup_unsupported +#define __os_iorelease __os_cleanup_unsupported +#define __os_ioclose __os_cleanup_unsupported +#define __os_unfair_unlock __os_cleanup_unsupported +#endif // __has_attribute(cleanup) + +__END_DECLS; + +#endif // __DARWIN_CLEANUP_H diff --git a/libdarwin/h/ctl.h b/libdarwin/h/ctl.h new file mode 100644 index 0000000..2968b5a --- /dev/null +++ b/libdarwin/h/ctl.h @@ -0,0 +1,543 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * Interfaces to implement subcommand-style command line utilities (e.g. + * launchctl(1)) and automatically generate usage output. The usage generated by + * these interfaces assumes a long option convention (cf. getopt_long(3)) and is + * loosely based on the docopt convention described at + * + * http://docopt.org + * + * The user may define each subcommand taken by the utility as: + * + * static const struct option _template_opts[] = { + * [0] = { + * .name = "bar", + * .has_arg = required_argument, + * .flag = NULL, + * .val = 'f', + * }, { + * .name = "baz", + * .has_arg = optional_argument, + * .flag = NULL, + * .val = 'b', + * }, { + * .name = NULL, + * .has_arg = 0, + * .flag = NULL, + * .val = 0, + * }, + * }; + * + * static const os_subcommand_option_t _template_required[] = { + * [0] = { + * .osco_template = OS_SUBCOMMAND_OPTION_VERSION, + * .osco_flags = 0, + * .osco_option = &_template_opts[0], + * .osco_argument_usage = "thing-to-bar", + * .osco_argument_human = "The thing to bar. May be specified as a " + * "bar that has a baz. This baz should have a shnaz.", + * }, + * OS_SUBCOMMAND_OPTION_TERMINATOR, + * }; + * + * static const os_subcommand_option_t _template_optional[] = { + * [0] = { + * .osco_template = OS_SUBCOMMAND_OPTION_VERSION, + * .osco_flags = 0, + * .osco_option = &_template_opts[1], + * .osco_argument_usage = "thing-to-baz", + * .osco_argument_human = "The baz of which to propagate a foo.", + * }, + * OS_SUBCOMMAND_OPTION_TERMINATOR, + * }; + * + * static const os_subcommand_option_t _template_positional[] = { + * [0] = { + * .osco_template = OS_SUBCOMMAND_OPTION_VERSION, + * .osco_flags = 0, + * .osco_option = NULL, + * .osco_argument_usage = "positional-baz", + * .osco_argument_human = "A baz specified by position.", + * }, + * OS_SUBCOMMAND_OPTION_TERMINATOR, + * }; + * + * static const os_subcommand_t _template_cmd = { + * .osc_template = OS_SUBCOMMAND_VERSION, + * .osc_flags = 0, + * .osc_name = "foo", + * .osc_desc = "foo a bar or maybe baz", + * .osc_optstring = "f:b:", + * .osc_options = _foo_opts, + * .osc_required = _foo_required, + * .osc_optional = _foo_optional, + * .osc_positional = _template_positional, + * .osc_invoke = &_foo_invoke, + * } + * OS_SUBCOMMAND_REGISTER(_foo_cmd); + * }; + * + * When {@link os_subcommand_main} is called, the tool's "help" subcommand will + * display approximately the following: + * + * $ tool help + * usage: tool + * + * subcommands: + * foo foo a bar or maybe baz + * help Prints helpful information + * + * $ tool help foo + * usage: tool foo [options] --bar= + * + * required options: + * --bar= The thing to bar. May be specified as a bar that + * has a baz. This baz should have a shnaz. + * + * positional-baz A baz specified by position. + * + * optional options: + * --baz[=thing-to-baz] The baz of which to propagate a foo. + */ +#ifndef __DARWIN_CTL_H +#define __DARWIN_CTL_H + +#include +#include +#include +#include +#include +#include + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +__BEGIN_DECLS; + +/*! + * @define OS_SUBCOMMAND_REGISTER + * Registers a {@link os_subcommand_t} with the runtime. Subcommands may only be + * declared as part of the main executable image -- subcommands declared in + * dynamic libraries or bundles will not be recognized. + */ +#define OS_SUBCOMMAND_REGISTER(_subcommand) \ + LINKER_SET_ENTRY(__subcommands, _subcommand) + +/*! + * @typedef os_subcommand_t + * The formal type name for the _os_subcommand structure. + */ +DARWIN_API_AVAILABLE_20181020 +typedef struct _os_subcommand os_subcommand_t; + +/*! + * @const OS_SUBCOMMAND_OPTION_VERSION + * The maximum version of the {@link os_subcommand_option_t} structure supported + * by the implementation. + */ +#define OS_SUBCOMMAND_OPTION_VERSION ((os_struct_version_t)0) + +/*! + * @typedef os_subcommand_option_flags_t + * Flags describing an option for a subcommand. + * + * @const OS_SUBCOMMAND_OPTION_FLAG_INIT + * No flags set. This value is suitable for initialization purposes. + * + * @const OS_SUBCOMMAND_OPTION_FLAG_TERMINATOR + * The option terminates an array of {@link os_subcommand_option_t} structures + * and does not contain any useful information. + * + * @const OS_SUBCOMMAND_OPTION_FLAG_OPTIONAL_POS + * The option is a positional option (that is, not identified by a long or short + * flag) and is not required for the subcommand to execute successfully. + */ +DARWIN_API_AVAILABLE_20181020 +OS_CLOSED_ENUM(os_subcommand_option_flags, uint64_t, + OS_SUBCOMMAND_OPTION_FLAG_INIT = 0, + OS_SUBCOMMAND_OPTION_FLAG_TERMINATOR = (1 << 0), + OS_SUBCOMMAND_OPTION_FLAG_OPTIONAL_POS = (1 << 1), +); + +/*! + * @typedef os_subcommand_option_t + * A structure describing human-readable information about a particular option + * taken by a subcommand. This structure is to be returned when the + * implementation invokes a {@link os_subcommand_option_info_t} function to + * query about a command's options individually. This is done when the + * implementation is synthesizing a usage string. + * + * @field osco_version + * The version of the structure. Initialize to + * {@link OS_SUBCOMMAND_OPTION_VERSION}. + * + * @field osco_flags + * A set of flags describing information about the option. + * + * @field osco_option + * A pointer to the option structure ingested by getopt_long(3) which + * corresponds to this option. + * + * @field osco_argument_usage + * The short-form name of the argument given to the option, appropriate for + * display in a usage specifier. For example, if the subcommand takes a "--file" + * option with a required argument, this might be the string "FILE-PATH", and + * the resulting usage specifier would be + * + * --file= + * + * @field osco_argument_human + * The long-form description of the argument given to the option. Extending the + * above example, this might be the string "The path to a file to take as input. + * This path must be absolute; relative paths are not supported." and the + * resulting usage specifier would be + * + * --file= The path to a file to take as input. This path must be + * absolute; relative paths are not supported. + */ +DARWIN_API_AVAILABLE_20191015 +typedef struct _os_subcommand_option { + const os_struct_version_t osco_version; + os_subcommand_option_flags_t osco_flags; + const struct option *osco_option; + const char *osco_argument_usage; + const char *osco_argument_human; +} os_subcommand_option_t; + +/*! + * @const OS_SUBCOMMAND_OPTION_TERMINATOR + * A convenience terminator for an array of {@link os_subcommand_option_t} + * structures. + */ +#define OS_SUBCOMMAND_OPTION_TERMINATOR (os_subcommand_option_t){ \ + .osco_version = OS_SUBCOMMAND_OPTION_VERSION, \ + .osco_flags = OS_SUBCOMMAND_OPTION_FLAG_TERMINATOR, \ + .osco_option = NULL, \ + .osco_argument_usage = NULL, \ + .osco_argument_human = NULL, \ +} + +/*! +* @const OS_SUBCOMMAND_GETOPT_TERMINATOR +* A convenience terminator for an array of getopt(3) option structures. +*/ +#define OS_SUBCOMMAND_GETOPT_TERMINATOR (struct option){ \ + .name = NULL, \ + .has_arg = 0, \ + .flag = NULL, \ + .val = 0, \ +} + +/*! + * @const OS_SUBCOMMAND_VERSION + * The maximum version of the {@link os_subcommand_t} structure supported by the + * implementation. + */ +#define OS_SUBCOMMAND_VERSION ((os_struct_version_t)0) + +/*! + * @enum os_subcommand_flags_t + * A type describing flags associated with a subcommand for a command line + * utility. + * + * @const OS_SUBCOMMAND_FLAG_INIT + * No flags set. This value is suitable for initialization purposes. + * + * @const OS_SUBCOMMAND_FLAG_REQUIRE_ROOT + * This subcommand requires the user to be root. If the user is not root, the + * {@link os_subcommand_dispatch} routine will return {@EX_PERM}. + * + * @const OS_SUBCOMMAND_FLAG_TTYONLY + * This subcommand may only be invoked via a terminal interface, i.e. it should + * not be invoked by scripts. Use this option to emphasize that a command's + * output is human-readably only and should not be parsed. + * + * @const OS_SUBCOMMAND_FLAG_HIDDEN + * This subcommand should not be displayed in the list of subcommands. + * + * @const OS_SUBCOMMAND_FLAG_MAIN + * This subcommand is the "main" subcommand. Designating a main subcommand + * allows the program to specify and parse global options using an + * {@link os_subcommand_t} object and {@link os_subcommand_main}. + * + * This flag implies the behavior of {@link OS_SUBCOMMAND_FLAG_HIDDEN}. + * + * If the program specifies a main subcommand, that subcommand's invocation + * routine is unconditionally called before calling the subcommand invocation, + * if the user provided a subcommand. The invocation function for the main + * subcommand should not exit on success and should instead return 0. + * + * If multiple subcommands in the same program set + * {@link OS_SUBCOMMAND_FLAG_MAIN}, the implementation's behavior is undefined. + */ +DARWIN_API_AVAILABLE_20181020 +OS_CLOSED_OPTIONS(os_subcommand_flags, uint64_t, + OS_SUBCOMMAND_FLAG_INIT, + OS_SUBCOMMAND_FLAG_REQUIRE_ROOT = (1 << 0), + OS_SUBCOMMAND_FLAG_TTYONLY = (1 << 1), + OS_SUBCOMMAND_FLAG_HIDDEN = (1 << 2), + OS_SUBCOMMAND_FLAG_MAIN = (1 << 3), +); + +/*! + * @typedef os_subcommand_invoke_t + * An type describing the invocation function for a subcommand. + * + * @param osc + * The descriptor for the command being invoked. + * + * @param argc + * The argument vector count. + * + * @param argv + * The argument vector. The first element of this array is the name of the + * subcommand. + * + * @result + * An exit code, preferably from sysexits(3). Do not return a POSIX error code + * directly from this routine. + * + * @discussion + * You may exit directly on success or failure from this routine if desired. If + * the routine is the invocation for a main subcommand, then on success, the + * routine should return zero to the caller rather than exiting so that the + * implementation may continue parsing the command line arguments. + */ +DARWIN_API_AVAILABLE_20181020 +typedef int (*os_subcommand_invoke_t)( + const os_subcommand_t *osc, + int argc, + const char *argv[] +); + +/*! + * @struct os_subcommand_t + * A type describing a subcommand for a command line tool. + * + * @field osc_version + * The version of the structure. Initialize to {@link OS_SUBCOMMAND_VERSION}. + * + * @field osc_flags + * The flags for the subcommand. + * + * @field osc_name + * The name of the subcommand. The second argument of user input will be matched + * against this name. + * + * @field osc_desc + * A brief description of the subcommand. This description will be displayed + * next to the subcommand when the user lists all subcommands. + * + * @field osc_optstring + * The option string associated with the subcommand. The implementation does not + * recognize this string directly; the intent of storing it here is to provide a + * convenient place to access the string for the implementation function. + * Combined with the {@link osc_options} field, this enables the following + * pattern: + * + * int ch = 0; + * while ((ch = getopt_long(argc, argv, cmd->osc_optstring, + * cmd->osc_options, NULL)) != -1) { + * switch (ch) { + * // process option + * } + * } + * + * This pattern keeps the option string and option structs co-located in code. + * + * @field osc_options + * A pointer to an array of option structures describing the long options + * recognized by the subcommand. This array must be terminated by a NULL entry + * as expected by getopt_long(3). + * + * @field osc_required + * A pointer to an array of subcommand option descriptors. The options described + * in this array are required for the subcommand to execute successfully. This + * array should be terminated with {@link OS_SUBCOMMAND_OPTION_TERMINATOR}. + * + * This array is consulted when printing usage information. + * + * @field osc_optional + * A pointer to an array of subcommand option descriptors. The options described + * in this array are parsed by the subcommand but not required for it to execute + * successfully. This array should be terminated with + * {@link OS_SUBCOMMAND_OPTION_TERMINATOR}. + * + * This array is consulted when printing usage information. + * + * @field osc_positional + * A pointer to an array of subcommand option descriptors. The options described + * in this array are expected to follow the required and optional arguments in + * the command line invocation, in the order given in this array. This array + * should be terminated with {@link OS_SUBCOMMAND_OPTION_TERMINATOR}. + * + * These options are expected to have their {@link osco_option} fields set to + * NULL. + * + * This array is consulted when printing usage information. + * + * @field osc_info + * A pointer to a function which returns information about the subcommand's + * individual options. + * + * @field osc_invoke + * The implementation for the subcommand. + */ +DARWIN_API_AVAILABLE_20191015 +struct _os_subcommand { + const os_struct_version_t osc_version; + const os_subcommand_flags_t osc_flags; + const char *const osc_name; + const char *const osc_desc; + const char *osc_optstring; + const struct option *osc_options; + const os_subcommand_option_t *osc_required; + const os_subcommand_option_t *osc_optional; + const os_subcommand_option_t *osc_positional; + const os_subcommand_invoke_t osc_invoke; +}; + +/*! + * @typedef os_subcommand_main_flags_t + * Flags modifying the behavior of {@link os_subcommand_main}. + * + * @const OS_SUBCOMMAND_MAIN_FLAG_INIT + * No flags set. This value is suitable for initialization purposes. + */ +OS_CLOSED_OPTIONS(os_subcommand_main_flags, uint64_t, + OS_SUBCOMMAND_MAIN_FLAG_INIT, +); + +/*! + * @function os_subcommand_main + * Dispatches the subcommand appropriate for the given arguments. All + * subcommands will be implicitly discovered by virtue of their delcarations + * with the OS_SUBCOMMAND_REGISTER attribute. + * + * @param argc + * The argument count supplied to main(). + * + * @param argv + * The argument vector supplied to main(). + * + * @param flags + * Flags modifying the behavior of the implementation. + * + * @result + * The exit status from the subcommand's invocation function or an exit status + * from the implementation indicating that the subcommand could not be + * dispatched. Exit codes that can be returned by the implementation are: + * + * [EX_USAGE] The subcommand was invoked with improper syntax. Usage + * has been printed to stderr. + * [EX_USAGE] The subcommand specified is not recognized. + * [EX_PERM] The command required root privileges, and the caller is + * not running as root. + * [EX_UNAVAILABLE] The command specified that it may only run within + * the context of a tty(3), and either stdin or stdout are + * not a tty(3). + * + * @discussion + * In general, the code returned by this routine should immediately be passed to + * exit(3). The reason this routine does not implicitly exit is to allow for the + * caller to process multiple subcommand invocations as a batch. + * + * The caller should not print anything after this routine has returned -- the + * expectation is that all relevant information has already been conveyed to the + * user either by the implementation or from one of the subcommand invocation + * routines. + * + * This routine implicitly implements a "help" subcommand. + */ +DARWIN_API_AVAILABLE_20191015 +OS_EXPORT OS_WARN_RESULT OS_NONNULL2 +int +os_subcommand_main(int argc, const char *argv[], + os_subcommand_main_flags_t flags); + +/*! + * @function os_subcommand_fprintf + * Prints a message in the context of a subcommand to the given output stream. + * + * @param osc + * The subcommand which represents the context of the message. + * + * @param f + * The stream to which the message shall be printed. If NULL, will be printed to + * stderr(4). + * + * @param fmt + * A printf(3)-style format string. + * + * @param ... + * The arguments corresponding to {@link fmt}. + * + * @discussion + * This routine provides a uniform method for printing messages in the context + * of a subcommand. It will ensure that the message is prefixed appropriately + * (e.g. with the program name and/or subcommand name). + * + * This routine should be used for printing messages intended for humans to + * read; the implementation makes no guarantees about the output format's + * stability. If any output is intended to be machine-parseable, it should be + * written with fprintf(3) et al. + */ +DARWIN_API_AVAILABLE_20191015 +OS_EXPORT OS_NONNULL3 OS_FORMAT_PRINTF(3, 4) +void +os_subcommand_fprintf(const os_subcommand_t *osc, FILE *f, + const char *fmt, ...); + +/*! + * @function os_subcommand_vfprintf + * Prints a message in the context of a subcommand to the given output stream. + * + * @param osc + * The subcommand which represents the context of the message. + * + * @param f + * The stream to which the message shall be printed. If NULL, will be printed to + * stderr(4). + * + * @param fmt + * A printf(3)-style format string. + * + * @param ap + * The argument list corresponding to {@link fmt}. + * + * @discussion + * See discussion for {@link os_subcommand_fprintf}. + */ +DARWIN_API_AVAILABLE_20191015 +OS_EXPORT OS_NONNULL3 +void +os_subcommand_vfprintf(const os_subcommand_t *osc, FILE *f, + const char *fmt, va_list ap); + +__END_DECLS; + +#endif // __DARWIN_CTL_H diff --git a/libdarwin/h/dirstat.h b/libdarwin/h/dirstat.h new file mode 100644 index 0000000..6fa53c2 --- /dev/null +++ b/libdarwin/h/dirstat.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017 Apple Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ + +#ifndef __DIRSTAT_H__ +#define __DIRSTAT_H__ + +#include +#include +#include + +__BEGIN_DECLS + +/* Fail if the file system does not support fast directory sizing on the provided directory */ +#define DIRSTAT_FAST_ONLY 0x1 + +/* Do not use filesystem support for directory sizing. */ +#define DIRSTAT_FORCE_FALLBACK 0x2 + +/* + * NOT ABI: the size of this structure may grow. You must pass the current + * size of this structure in as the dirstat_size argument to the functions + * below. + */ +struct dirstat { + off_t total_size; + uint64_t descendants; +}; + +/* Returns -1 on error and sets errno. Does not cross file-system boundaries. */ +__API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)) +int dirstat_np(const char *path, int flags, struct dirstat *ds, size_t dirstat_size); + +__API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)) +int dirstatat_np(int dfd, const char *path, int flags, struct dirstat *ds, size_t dirstat_size); + +__END_DECLS + +#endif // __DIRSTAT_H__ diff --git a/libdarwin/h/dirstat_collection.h b/libdarwin/h/dirstat_collection.h new file mode 100644 index 0000000..554cd06 --- /dev/null +++ b/libdarwin/h/dirstat_collection.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include + +__BEGIN_DECLS + +#pragma GCC visibility push(hidden) + +typedef struct dirstat_fileid_set_s dirstat_fileid_set_s; +typedef dirstat_fileid_set_s *dirstat_fileid_set_t; + +dirstat_fileid_set_t _dirstat_fileid_set_create(void); +void _dirstat_fileid_set_destroy(dirstat_fileid_set_t set); +bool _dirstat_fileid_set_add(dirstat_fileid_set_t set, uint64_t fileid); + +#pragma GCC visibility pop + +__END_DECLS diff --git a/libdarwin/h/err.h b/libdarwin/h/err.h new file mode 100644 index 0000000..c912c53 --- /dev/null +++ b/libdarwin/h/err.h @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * Non-standard, Darwin-specific additions to the err(3) family of APIs. The + * following additions are provided: + * + * - support for the error code additions in os/errno.h + * - automatic conversion of an error code into a sysexits(3) code + * - a debug_*() family of routines + * + * There are no direct equivalents for err(3), warn(3), verr(3), or vwarn(3) + * because those routines query errno for error information, and it is not valid + * to store error codes from os/error.h in errno. Therefore when evaluating the + * output of normal POSIX routines, use the err(1) family of routines. When + * evaluating the output of routines that can return the error codes in + * os/error.h, you may use these routines and always explicitly pass the error + * code. + * + * There are no equivalents for errx(3), warnx(3), verrx(3), or vwarnx(3) + * because those routines do not query error information. + */ +#ifndef __DARWIN_ERR_H +#define __DARWIN_ERR_H + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +__BEGIN_DECLS; + +/*! + * @function err_np + * Writes a formatted error message to stderr(4) and exits the program. + * + * @param code + * The error code to query in the output. + * + * @param fmt + * The printf(3)-like format string representing the message to print. + * + * @param ... + * The arguments corresponding to the format string. + * + * @discussion + * This routine will look up an appropriate sysexits(3) code using the given + * error code using {@link darwin_sysexit} and pass it to exit(3). + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_NORETURN OS_COLD OS_NONNULL2 OS_FORMAT_PRINTF(2, 3) +void +err_np(errno_t code, const char *fmt, ...); + +/*! + * @function errc_np + * Writes a formatted error message to stderr(4) and exits the program. + * + * @param eval + * The code to pass to exit(3). This should be a code defined in sysexits(3). + * + * @param code + * The error code to query in the output. + * + * @param fmt + * The printf(3)-like format string representing the message to print. + * + * @param ... + * The arguments corresponding to the format string. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_NORETURN OS_COLD OS_NONNULL3 OS_FORMAT_PRINTF(3, 4) +void +errc_np(int eval, errno_t code, const char *fmt, ...); + +/*! + * @function warn_np + * Writes a formatted warning message to stderr(4). + * + * @param code + * The error code to query in the output. + * + * @param fmt + * The printf(3)-like format string representing the message to print. + * + * @param ... + * The arguments corresponding to the format string. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_COLD OS_NONNULL2 OS_FORMAT_PRINTF(2, 3) +void +warn_np(errno_t code, const char *fmt, ...); + +/*! + * @function verr_np + * Writes a formatted error message to stderr(4) and exits the program. + * + * @param code + * The error code to query in the output. + * + * @param fmt + * The printf(3)-like format string representing the message to print. + * + * @param ap + * The argument pointer corresponding to the format string. + * + * @discussion + * This routine will look up an appropriate sysexits(3) code using the given + * error code using {@link darwin_sysexit} and pass it to exit(3). + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_NORETURN OS_COLD OS_NONNULL2 OS_NONNULL3 +void +verr_np(errno_t code, const char *fmt, va_list ap); + +/*! + * @function verrc_np + * Writes a formatted error message to stderr(4) and exits the program. + * + * @param eval + * The code to pass to exit(3). This should be a code defined in sysexits(3). + * + * @param code + * The error code to query in the output. + * + * @param fmt + * The printf(3)-like format string representing the message to print. + * + * @param ap + * The argument pointer corresponding to the format string. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_NORETURN OS_COLD OS_NONNULL3 OS_NONNULL4 +void +verrc_np(int eval, errno_t code, const char *fmt, va_list ap); + +/*! + * @function vwarn_np + * Writes a formatted warning message to stderr(4). + * + * @param code + * The error code to query in the output. + * + * @param fmt + * The printf(3)-like format string representing the message to print. + * + * @param ap + * The arguments corresponding to the format string. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_COLD OS_NONNULL2 OS_NONNULL3 +void +vwarn_np(errno_t code, const char *fmt, va_list ap); + +__END_DECLS; + +#endif // __DARWIN_ERR_H diff --git a/libdarwin/h/errno.h b/libdarwin/h/errno.h new file mode 100644 index 0000000..1f21f85 --- /dev/null +++ b/libdarwin/h/errno.h @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * @header + * Non-standard, Darwin-specific additions to the error codes enumerated in + * intro(2) and sys/errno.h. + */ +#ifndef __DARWIN_ERRNO_H +#define __DARWIN_ERRNO_H + +#include +#include +#include +#include +#include + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +/*! + * @enum + * Additional POSIX-flavor error codes that are meaningful to Darwin. These + * definitions all have a "_NP" suffix to distinguish them from POSIX error + * codes (meaning "not POSIX"). + */ +#define EBASE_NP 200 +#define _ENPERR(__c) (EBASE_NP + __c) + +/*! + * @const ENOTENTITLED_NP + * The remote process lacked a required entitlement to perform the operation. + */ +#define ENOTENTITLED_NP _ENPERR(0) + +/*! + * @const ENOTPLATFORM_NP + * The operation may only be invoked by platform binaries. + */ +#define ENOTPLATFORM_NP _ENPERR(1) + +/*! + * @const EROOTLESS_NP + * The operation was denied by System Integrity Protection. + */ +#define EROOTLESS_NP _ENPERR(2) + +/*! + * @const ETAINTED_NP + * The operation may only be invoked by processes which are not tainted by + * debugging and introspection functionality (e.g. dyld(1) environment + * variables, debugger attachment, etc.). + */ +#define ETAINTED_NP _ENPERR(3) + +/*! + * @const EQUARANTINE_NP + * The operation is not permitted on quarantined file. + */ +#define EQUARANTINE_NP _ENPERR(4) + +/*! + * @const EBADUSER_NP + * The operation referenced a user name or identifier that was invalid. + */ +#define EBADUSER_NP _ENPERR(5) + +/*! + * @const EBADGROUP_NP + * The operation referenced a group name or identifier that was invalid. + */ +#define EBADGROUP_NP _ENPERR(6) + +/*! + * @const EOWNERSHIP_NP + * Ownership or access permissions on a file were too permissive. + */ +#define EOWNERSHIP_NP _ENPERR(7) + +/*! + * @const ENOOOO_NP + * A series of operations was executed in the improper order (no out-of-order + * operations allowed). + */ +#define ENOOOO_NP _ENPERR(8) + +/*! + * @const ENOTBUNDLE_NP + * The path given to the operation did not refer to a bundle. + */ +#define ENOTBUNDLE_NP _ENPERR(9) + +/*! + * @const EBADBUNDLE_NP + * The path given to the operation did not refer to a valid bundle. + */ +#define EBADBUNDLE_NP _ENPERR(10) + +/*! + * @const EBADPATH_NP + * The path given to the operation was not valid. + */ +#define EBADPATH_NP _ENPERR(11) + +/*! + * @const EBADPLIST_NP + * The plist given to the operation was invalid. + */ +#define EBADPLIST_NP _ENPERR(12) + +/*! + * @const EBADKEY_NP + * A key in the given plist was unrecognized. + */ +#define EBADKEY_NP _ENPERR(13) + +/*! + * @const EBADVAL_NP + * The value for a key in the given plist was either not present (and was + * required to be) or was present but not of the appropriate type. + */ +#define EBADVAL_NP _ENPERR(14) + +/*! + @const EBADSUBSYS_NP + * The request referenced a subsystem that did not exist. + */ +#define EBADSUBSYS_NP _ENPERR(15) + +/*! + * @const E2BIMPL_NP + * The operation has not yet been implemented. + */ +#define E2BIMPL_NP _ENPERR(16) + +/*! + * @const EDEPRECATED_NP + * The operation has been deprecated. + */ +#define EDEPRECATED_NP _ENPERR(17) + +/*! + * @const EREMOVED_NP + * The operation has been removed from the implementation. + */ +#define EREMOVED_NP _ENPERR(18) + +/*! + * @const EDROPPED_NP + * The request referenced a data structure that will never achieve the state + * required to perform the operation. + */ +#define EDROPPED_NP _ENPERR(19) + +/*! + * @const EDEFERRED_NP + * The request referenced a data structure that was not in the state required + * to perform the operation, and the request has been pended until the object + * reaches the required state. This code is meant to be used for control flow + * purposes in the server and should not be returned to the caller. + */ +#define EDEFERRED_NP _ENPERR(20) + +/*! + * @const EUSAGE_NP + * Improper command line usage. This code is meant to be used for control flow + * purposes in a command line tool so that routines may return an error code + * indicating improper usage without having to use EX_USAGE, which collides with + * the POSIX error space. It should not be passed to exit(3), _exit(2), et al. + * and should instead be translated into EX_USAGE either directly or with + * {@link darwin_sysexit}. + */ +#define EUSAGE_NP _ENPERR(21) + +/*! + * @const EUNKNOWN_NP + * An error occurred in a subsystem, and insufficient detail as to the nature of + * the failure was available to translate it into a more descriptive error code. + */ +#define EUNKNOWN_NP _ENPERR(22) +#define __ELAST_NP _ENPERR(22) + +/*! + * @const EX_BADRECEIPT_NP + * An exit code indicating that the program could not verify its purchase + * receipt from the Mac App Store. This exit code is inspected by the system to + * trigger a re-validation of the purchase receipt. It must be passed to the + * exit(3) Libc API and not to _exit(2) system call. This exit code is only + * relevant to the macOS variant of Darwin. + */ +#define EX_BADRECEIPT_NP (173) + +__BEGIN_DECLS; + +/*! + * @function sysexit_np + * Translates a {@link errno_t} or POSIX error code into an exit code + * defined in sysexits(3). + * + * @param code + * The error code to translate. + * + * @result + * The sysexits(3) exit code most appropriate for the given error. If no + * appropriate exit code could be determined, the designated ¯\_(ツ)_/¯ exit + * code, EX_UNAVAILABLE, is returned (cf. sysexits(3)). + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_CONST +int +sysexit_np(int code); + +__END_DECLS; + +#endif // __DARWIN_ERRNO_H diff --git a/libdarwin/h/libdarwin_init.h b/libdarwin/h/libdarwin_init.h new file mode 100644 index 0000000..d01f300 --- /dev/null +++ b/libdarwin/h/libdarwin_init.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * libdarwin initialization header. + */ +#ifndef __DARWIN_INIT_H +#define __DARWIN_INIT_H + +#include +#include + +__BEGIN_DECLS; + +OS_EXPORT +void +__libdarwin_init(void); + +__END_DECLS; + +#endif // __DARWIN_INIT_H diff --git a/libdarwin/h/mach_exception.h b/libdarwin/h/mach_exception.h new file mode 100644 index 0000000..76d1f7a --- /dev/null +++ b/libdarwin/h/mach_exception.h @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * Darwin-specific interfaces for manipulating Mach exception handling + * properties of a task. + */ +#ifndef __DARWIN_EXCEPTION_H +#define __DARWIN_EXCEPTION_H + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +__BEGIN_DECLS; + +/*! + * @typedef os_crash_flags_t + * A flagset describing crash handling behaviors. + * + * @param OS_CRASH_FLAG_INIT + * Handle no exceptions. + * + * @param OS_CRASH_FLAG_CRASH + * Handle exceptions due to crashing conditions (e.g. segmentation violations, + * signals raise(3)ed manually, etc.). These exceptions will suspend the subject + * task until the exception handler has returned. + * + * @param OS_CRASH_FLAG_GUARD + * Handle exceptions due to the subject task violating guarded kernel handles + * (e.g. guarded mach port rights and file descriptors). + * + * @param OS_CRASH_FLAG_RESOURCE + * Handle exceptions due to the subject task exceeding resource usage limits + * (e.g. CPU spins, memory growth, etc.). + * + * @param OS_CRASH_FLAG_CORPSE + * Handle exceptions which create corpses. The subject task of these exceptions + * is a corpse of the original task, which is torn down asynchronously. Corpses + * are a limited representation of the original task that is suitable for most + * introspection needs. + * + * This flag is mutually exclusive with {@link OS_CRASH_FLAG_CRASH}, and if both + * are present, this flag will be preferred. + * + * @discussion + * There are other Mach exception types than the ones enumerated by these flags, + * but they are almost exclusively handled internally by the kernel, and + * therefore are of little interest to userspace. Those that are not handled by + * the kernel are only relevant to debuggers. + */ +OS_ENUM(os_crash_flags, uint32_t, + OS_CRASH_FLAG_INIT = 0, + OS_CRASH_FLAG_CRASH = (1 << 0), + OS_CRASH_FLAG_GUARD = (1 << 1), + OS_CRASH_FLAG_RESOURCE = (1 << 2), + OS_CRASH_FLAG_CORPSE = (1 << 3), +); + +/*! + * @enum os_crash_type_t + * A type describing exception types relevant to userspace crash reporters. + * These values serve as indexes into a {@link os_crash_port_array_t}. + * + * @const OS_CRASH_NONE + * No exception type. + * + * @const OS_CRASH_CRASH + * A crashing exception with the behavior described in {@link OS_CRASH_FLAG_CRASH}. + * + * @const OS_CRASH_GUARD + * A guard exception with the behavior described in {@link OS_CRASH_FLAG_GUARD}. + * + * @const OS_CRASH_RESOURCE + * A resource exception with the behavior described in {@link OS_CRASH_FLAG_RESOURCE}. + * + * @const OS_CRASH_CORPSE + * A corpse exception with the behavior described in {@link OS_CRASH_FLAG_CORPSE}. + */ +OS_ENUM(os_crash_type, uint32_t, + OS_CRASH_NONE, + OS_CRASH_CRASH, + OS_CRASH_GUARD, + OS_CRASH_RESOURCE, + OS_CRASH_CORPSE, + _OS_CRASH_LAST, +); + +/*! + * struct os_crash_port_t + * A type describing an exception port and the exception it handles. + * + * @property oep_type + * The type of exception handled by the port. + * + * @property oep_port + * A handle representing a send right to the exception port. + */ +DARWIN_API_AVAILABLE_20170407 +typedef struct _os_crash_port { + os_crash_type_t oep_type; + mach_port_t oep_port; +} os_crash_port_t; + +/*! + * @define DARWIN_EXCEPTION_PORT_ARRAY_COUNT + * The maximum number of exception ports that an exception port array can + * accommodate. + */ +#define OS_CRASH_PORT_ARRAY_COUNT (16lu) + +/*! + * @typedef os_crash_port_array_t + * An array of exception ports. This array can accommodate all exception types + * described in the {@link os_crash_type_t} type and is sized to + * accommodate future exception types. + */ +DARWIN_API_AVAILABLE_20170407 +typedef os_crash_port_t os_crash_port_array_t[OS_CRASH_PORT_ARRAY_COUNT]; + +/*! + * @function os_crash_set_reporter_port + * Routine to set the exception handler port for the exceptions given. + * + * @param where + * The task port or host port for which to set the exception handler. This + * routine will internally choose the proper method of setting the exception + * port based on whether this parameter represents the host or not. + * + * @param flags + * Flags describing which exceptions are to be handled by the port. + * + * @param p + * A send right to the desired exception handler port. + * + * @result + * A kernel return code. + * + * @discussion + * This routine automatically chooses the most expressive thread state to + * deliver in the exception message based on the current architecture. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT +kern_return_t +os_crash_set_reporter_port(mach_port_t where, + os_crash_flags_t flags, mach_port_t p); + +/*! + * @function os_crash_get_reporter_port_array + * Routine to get the ports which handle exceptions for all enumerated exception + * types in {@link os_crash_flags_t}. + * + * @param where + * The task port or host port for which to retrieve exception handler ports. + * This routine will internally choose the proper method of obtaining the + * exception ports based on whether this parameter represents the host or not. + * + * @param array + * An array describing the exception ports for the target host or task. This + * array must be disposed of with {@link os_crash_port_array_deallocate} + * when it is no longer needed. + * + * @result + * A kernel return code. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL2 +kern_return_t +os_crash_get_reporter_port_array(mach_port_t where, + os_crash_port_array_t array); + +/*! + * @function os_crash_port_array_deallocate + * Routine to deallocate an array of exception port descriptors. + * + * @param array + * The array which is to be disposed of. + * + * @discussion + * This routine disposes of the resources represented by the kernel handles in + * the array. It does not manipulate the array's memory. The expectation is that + * the caller allocates {@link os_crash_port_array_t} from the stack. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_NONNULL1 +void +os_crash_port_array_deallocate(os_crash_port_array_t array); + +/*! + * @function os_crash_spawnattr_set_reporter_port + * Routine to set the exception handler port for the exceptions given in a + * posix_spawn(2) attributes structure. + * + * @param psattr + * The spawn attributes for which the exception port should be set. + * + * @param flags + * Flags describing which exceptions are to be handled by the port. + * + * @param p + * A send right to the desired exception handler port. + * + * @result + * A kernel return code. This routine will only fail if the port name given was + * invalid. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 +kern_return_t +os_crash_spawnattr_set_reporter_port(posix_spawnattr_t *psattr, + os_crash_flags_t flags, mach_port_t p); + +__END_DECLS; + +#endif // __DARWIN_EXCEPTION_H diff --git a/libdarwin/h/mach_utils.h b/libdarwin/h/mach_utils.h new file mode 100644 index 0000000..8b95751 --- /dev/null +++ b/libdarwin/h/mach_utils.h @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * Defines additions to the Mach family of APIs. + */ +#ifndef __DARWIN_MACH_UTILS_H +#define __DARWIN_MACH_UTILS_H + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +/*! + * @define OS_MIG_SUBSYSTEM_MAXSIZE + * A macro that evaluates to the maximum size of a request or reply message in + * the given MIG subsystem. + * + * @param __subsystem + * The name of the MIG subsystem, defined by the "subsystem" keyword. + * + * @param __serverprefix + * The serverprefix of the MIG subsystem, defined by the "serverprefix" keyword. + */ +#define OS_MIG_SUBSYSTEM_MAXSIZE(__subsystem, __serverprefix) __extension__({ \ + union __subsystem ## _RequestReplyUnion { \ + union __RequestUnion__ ## __serverprefix ## __subsystem ## \ + _subsystem requests; \ + union __ReplyUnion__ ## __serverprefix ## __subsystem ## \ + _subsystem replies; \ + }; \ + (sizeof(union __subsystem ## _RequestReplyUnion)); \ +}) + +__BEGIN_DECLS; + +/*! + * @function os_vm_address_from_ptr + * Converts the given pointer to a vm_address_t. + * + * @param p + * The pointer to convert. + * + * @result + * The pointer as a vm_address_t. + */ +DARWIN_API_AVAILABLE_20190830 +OS_ALWAYS_INLINE OS_WARN_RESULT +static inline vm_address_t +os_vm_address_from_ptr(const void *p) +{ + return (vm_address_t)(uintptr_t)p; +} + +/*! + * @function os_mach_vm_address_from_ptr + * Converts the given pointer to a mach_vm_address_t. + * + * @param p + * The pointer to convert. + * + * @result + * The pointer as a mach_vm_address_t. + */ +DARWIN_API_AVAILABLE_20190830 +OS_ALWAYS_INLINE OS_WARN_RESULT +static inline mach_vm_address_t +os_mach_vm_address_from_ptr(const void *p) +{ + return (mach_vm_address_t)(uintptr_t)p; +} + +/*! + * @function os_mach_msg_get_trailer + * Obtains the trailer for the received Mach message. + * + * @param hdr + * The message header of the received Mach message. + * + * @result + * A pointer to the trailer that was received with the message. + * + * @discussion + * Every received Mach message has a minimal trailer which identifies its format + * and size (cf. mach_msg_trailer_t). Currently, there is one format, + * MACH_MSG_TRAILER_FORMAT_0. The caller is responsible for validating the + * returned trailer's format against this known value as well as the trailer's + * size before using any additional trailer fields. + * + * The result of passing a header to a message that was not received from a port + * is undefined. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 +const mach_msg_trailer_t * +os_mach_msg_get_trailer(const mach_msg_header_t *hdr); + +/*! + * @function os_mach_msg_get_audit_trailer + * Obtains the audit trailer for the received Mach message. + * + * @param hdr + * The message header of the received Mach message. + * + * @result + * A pointer to the audit trailer that was received with the message. If the + * message was not received with an audit trailer (by passing + * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT) in the mach_msg() options), + * NULL is returned. + * + * @discussion + * The result of passing a header to a message that was not received from a port + * is undefined. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 +const mach_msg_audit_trailer_t * +os_mach_msg_get_audit_trailer(const mach_msg_header_t *hdr); + +/*! + * @function os_mach_msg_get_context_trailer + * Obtains the context trailer for the received Mach message. + * + * @param hdr + * The message header of the received Mach message. + * + * @result + * A pointer to the context trailer that was received with the message. If the + * message was not received with an context trailer (by passing + * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_CTX) in the mach_msg() options), + * NULL is returned. + * + * @discussion + * The result of passing a header to a message that was not received from a port + * is undefined. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 +const mach_msg_context_trailer_t * +os_mach_msg_get_context_trailer(const mach_msg_header_t *hdr); + +/*! + * @const os_mach_msg_copy_description + * A routine for obtaining a human-readable description of a Mach message. + * + * @param msg + * The message for which to obtain the description. + * + * @result + * A human-readable string describing the given message header. This string is + * not intended to be machine-parseable, and the exact output format is not + * stable. + * + * The implementation does not attempt to introspect the contents of the + * message. If the implementation detects that the message is complex, it will + * examine the first 4 bytes past the header to obtain the descriptor count, as + * is specified by the Mach APIs. Therefore, you should not pass a complex + * header that is not part of a valid message buffer, or the output may contain + * garbage information. + * + * The caller is responsible for free(3)ing this string when it is no longer + * required. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_COLD OS_WARN_RESULT OS_MALLOC OS_NONNULL1 +char * +os_mach_msg_copy_description(const mach_msg_header_t *msg); + +/*! + * @function os_mach_msg_trailer_copy_description + * A routine for obtaining a human-readable description of the trailer of a Mach + * message. + * + * @param tlr + * The trailer for which to obtain the description. + * + * @result + * A human-readable string describing the given message trailer. This string is + * not intended to be machine-parseable, and the exact output format is not + * stable. + * + * The caller is responsible for free(3)ing this string when it is no longer + * required. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_COLD OS_WARN_RESULT OS_MALLOC OS_NONNULL1 +char * +os_mach_msg_trailer_copy_description(const mach_msg_trailer_t *tlr); + +/*! + * @function os_mach_port_copy_description + * A routine for obtaining a human-readable description string of a port right + * handle. + * + * @param port + * The port right for which to obtain the description. + * + * @result + * A human-readable string describing the given port right. This string is not + * intended to be machine-parseable, and the exact output format is not stable. + * + * The caller is responsible for free(3)ing this string when it is no longer + * required. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_COLD OS_WARN_RESULT OS_MALLOC +char * +os_mach_port_copy_description(mach_port_t port); + +__END_DECLS; + +#endif // __DARWIN_MACH_UTILS_H diff --git a/libdarwin/h/stdio.h b/libdarwin/h/stdio.h new file mode 100644 index 0000000..dd7f271 --- /dev/null +++ b/libdarwin/h/stdio.h @@ -0,0 +1,394 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * Non-standard, Darwin-specific additions for the stdio(3) family of APIs. + */ +#ifndef __DARWIN_STDIO_H +#define __DARWIN_STDIO_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#if __has_include() +#include +#else +typedef uint64_t guardid_t; +#endif + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +__BEGIN_DECLS; + +/*! + * @typedef os_fd_t + * A type alias for a file descriptor. + */ +typedef int os_fd_t; + +/*! + * @function os_fd_valid + * Returns whether the given integer is a valid file descriptor number. + * + * @param fd + * The integer to check. + * + * @result + * A Boolean indicating whether the integer is a valid file descriptor number, + * that is, greater than or equal to zero. + */ +DARWIN_API_AVAILABLE_20180727 +OS_ALWAYS_INLINE OS_WARN_RESULT +static inline bool +os_fd_valid(os_fd_t fd) +{ + return (fd >= STDIN_FILENO); +} + +/*! + * @function os_guardid_from_ptr + * Converts the given pointer to a guardid_t. + * + * @param p + * The pointer to convert. + * + * @result + * The pointer as a guardid_t. + */ +DARWIN_API_AVAILABLE_20190830 +OS_ALWAYS_INLINE OS_WARN_RESULT +static inline guardid_t +os_guardid_from_ptr(const void *p) +{ + return (guardid_t)(uintptr_t)p; +} + +/*! + * @function fcheck_np + * Checks the status of an fread(3) or fwrite(3) operation to a FILE. + * + * @param f + * The file on which the operation was performed. + * + * @param n + * The return value of the operation. + * + * @param expected + * The expected return value of the operation. + * + * @result + * One of the following integers: + * + * 0 The operation succeeded + * EOF The operation encountered the end of the FILE stream before it + * could complete + * 1 There was an error + */ +DARWIN_API_AVAILABLE_20180727 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 +int +fcheck_np(FILE *f, size_t n, size_t expected); + +/*! + * @function dup_np + * Variant of dup(2) that guarantees the dup(2) operation will either succeed or + * not return. + * + * @param fd + * The descriptor to dup(2). + * + * @result + * A new file descriptor number that is functionally equivalent to what the + * caller passed. + * + * @discussion + * The implementation will retry if the operation was interrupted by a signal. + * If the operation failed for any other reason, the implementation will + * terminate the caller. + */ +DARWIN_API_AVAILABLE_20180727 +OS_EXPORT OS_WARN_RESULT +os_fd_t +dup_np(os_fd_t fd); + +/*! + * @function claimfd_np + * Claims the given file descriptor for the caller's exclusive use by applying a + * guard and invalidating the given storage. + * + * @param fdp + * A pointer to the storage for the descriptor to claim. Upon return, a known- + * invalid value is written into this memory. + * + * @param gdid + * The optional guard value to enforce the caller's claim on the descriptor. + * + * @param gdflags + * The guard flags to enforce the caller's claim on the descriptor. + * + * @result + * The given descriptor with the guard applied. + */ +DARWIN_API_AVAILABLE_20190830 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 +os_fd_t +claimfd_np(os_fd_t *fdp, const guardid_t *gdid, u_int gdflags); + +/*! + * @function xferfd_np + * Transfers ownership from the given file descriptor back to the general public + * by clearing the guard associated with it. + * + * @param fdp + * A pointer to the storage for the descriptor to claim. Upon return, a known- + * invalid value is written into this memory. + * + * @param gdid + * The optional guard value to reliquish ownership on the descriptor. + * + * @param gdflags + * The guard flags to relinquish. + * + * @result + * The given descriptor with the guard cleared. This descriptor is suitable for + * claiming with {@link claimfd_np}. + */ +DARWIN_API_AVAILABLE_20190830 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 +os_fd_t +xferfd_np(os_fd_t *fdp, const guardid_t *gdid, u_int gdflags); + +/*! + * @function close_drop_np + * Variant of close(2) which transfers ownership from the caller and performs + * the close(2) operation. These semantics are useful for ensuring that a + * descriptor is not erroneously re-used after it has been closed. To achieve + * these semantics, this variant will clear the memory in which the descriptor + * resides and replace it with a known-invalid value before returning. + * + * @param fdp + * A pointer to the storage for the descriptor to close. Upon return, a known- + * invalid value is written into this memory. + * + * @param gdid + * The optional guard. If the descriptor is not guarded, pass NULL. + * + * @discussion + * If the implementation encounters a failure to close a valid descriptor + * number, the caller will be terminated. + */ +OS_EXPORT OS_NONNULL1 +void +close_drop_np(os_fd_t *fdp, const guardid_t *gdid); + +/*! + * @function close_drop_optional_np + * Variant of {@link close_drop} which will not attempt to close an invalid + * descriptor. Otherwise all semantics are the same. + * + * @param fdp + * A pointer to the storage for the descriptor to close. Upon return, a known- + * invalid value is written into this memory. + * + * @param gdid + * The optional guard. If the descriptor is not guarded, pass NULL. + * + * @discussion + * If the implementation encounters a failure to close a valid descriptor + * number, the caller will be terminated. The implementation will not attempt to + * close the descriptor if its value is -1. + */ +OS_EXPORT OS_NONNULL1 +void +close_drop_optional_np(os_fd_t *fdp, const guardid_t *gdid); + +/*! + * @function zsnprintf_np + * snprintf(3) variant which returns the numnber of bytes written less the null + * terminator. + * + * @param buff + * The buffer in which to write the string. + * + * @param len + * The length of the buffer. + * + * @param fmt + * The printf(3)-like format string. + * + * @param ... + * The arguments corresponding to the format string. + * + * @result + * The number of bytes written into the buffer, less the null terminator. This + * routine is useful for successive string printing that may be lossy, as it + * will simply return zero when there is no space left in the destination + * buffer, i.e. enables the following pattern: + * + * char *cur = buff; + * size_t left = sizeof(buff); + * for (i = 0; i < n_strings; i++) { + * size_t n_written = zsnprintf_np(buff, left, "%s", strings[i]); + * cur += n_written; + * left -= n_written; + * } + * + * This loop will safely terminate without any special care since, as soon as + * the buffer's space is exhausted, all further calls to zsnprintf_np() will + * write nothing and return zero. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 OS_NONNULL3 OS_FORMAT_PRINTF(3, 4) +size_t +zsnprintf_np(char *buff, size_t len, const char *fmt, ...); + +/*! + * @function crfprintf_np + * fprintf(3) variant that appends a new line character to the output. + * + * @param f + * The file to which the output should be written. + * + * @param fmt + * The printf(3)-like format string. + * + * @param ... + * The arguments corresponding to the format string. + */ +DARWIN_API_AVAILABLE_20181020 +OS_EXPORT OS_NONNULL1 OS_NONNULL2 OS_FORMAT_PRINTF(2, 3) +void +crfprintf_np(FILE *f, const char *fmt, ...); + +/*! + * @function vcrfprintf_np + * vfprintf(3) variant that appends a new line character to the output. + * + * @param f + * The file to which the output should be written. + * + * @param fmt + * The printf(3)-like format string. + * + * @param ap + * The argument list corresponding to the format string. + */ +DARWIN_API_AVAILABLE_20181020 +OS_EXPORT OS_NONNULL1 OS_NONNULL2 OS_NONNULL3 +void +vcrfprintf_np(FILE *f, const char *fmt, va_list ap); + +/*! + * @function wfprintf_np + * fprintf(3) variant which wraps the output to the specified column width, + * inserting new lines as necessary. Output will be word-wrapped with a trivial + * algorithm. + * + * @param f + * The file to which the output should be written. + * + * @param initpad + * The number of spaces that should be inserted prior to the first line of + * output. If a negative value is given, the implementation will assume that an + * amount of spaces equal to the absolute value of the parameter has already + * been written, and therefore it will only use the parameter to compute line- + * wrapping information and not insert any additional spaces on the first line + * of output. + * + * @param pad + * The number of spaces that should be inserted prior to every line of output + * except the first line. + * + * @param width + * The maximum number of columns of each line of output. Pass zero to indicate + * that there is no maximum. + * + * @param fmt + * The printf(3)-like format string. + * + * @param ... + * The arguments corresponding to the format string. + * + * @discussion + * This routine will silently fail to print to the desired output stream if + * there was a failure to allocate heap memory. + */ +DARWIN_API_AVAILABLE_20181020 +OS_EXPORT OS_NONNULL1 OS_NONNULL5 OS_NONNULL6 +void +wfprintf_np(FILE *f, ssize_t initpad, size_t pad, size_t width, + const char *fmt, ...); + +/*! + * @function vwfprintf_np + * vfprintf(3) variant which wraps the output to the specified column width, + * inserting new lines as necessary. Output will be word-wrapped with a trivial + * algorithm. + * + * @param f + * The file to which the output should be written. + * + * @param initpad + * The number of spaces that should be inserted prior to the first line of + * output. If a negative value is given, the implementation will assume that an + * amount of spaces equal to the absolute value of the parameter has already + * been written, and therefore it will only use the parameter to compute line- + * wrapping information and not insert any additional spaces on the first line + * of output. + * + * @param pad + * The number of spaces that should be inserted prior to every line of output + * except the first line. + * + * @param width + * The maximum number of columns of each line of output. Pass zero to indicate + * that there is no maximum. + * + * @param fmt + * The printf(3)-like format string. + * + * @param ap + * The argument list corresponding to the format string. + * + * @discussion + * This routine will silently fail to print to the desired output stream if + * there was a failure to allocate heap memory. + */ +DARWIN_API_AVAILABLE_20181020 +OS_EXPORT OS_NONNULL1 OS_NONNULL5 OS_NONNULL6 +void +vwfprintf_np(FILE *f, ssize_t initpad, size_t pad, size_t width, + const char *fmt, va_list ap); + +__END_DECLS; + +#endif // __DARWIN_STDIO_H diff --git a/libdarwin/h/stdlib.h b/libdarwin/h/stdlib.h new file mode 100644 index 0000000..2d59ba3 --- /dev/null +++ b/libdarwin/h/stdlib.h @@ -0,0 +1,543 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * Non-standard, Darwin-specific additions to the stdlib(3) family of APIs. + * + * The os_malloc() and os_strdup() routines are wrappers to be used for small, + * fixed-size allocations, the assumption being that such allocation should + * always succeed absent other critical problems. Thus, if the requested size is + * is a compile-time constant, the return value is asserted to be non-NULL. + * Otherwise, for sizes that are not known at compile-time, the implementations + * loop until the allocation succeeds, assuming the failure to be due to + * transient resource shortages. The implementation will not loop if the program + * has not become multi-threaded, under the assertion that there would be no + * point since no other thread could possibly free up resources for the calling + * thread to use. Thus, in a single-threaded program, all allocations will + * be treated like small, fixed-size allocations and be expected to succeed. + * + * These wrappers should not be used for large allocations whose bounds cannot + * be determined at compile-time. For such allocations, malloc(3), calloc(3), et + * al. (with appropriate error handling) are the appropriate interfaces. + */ +#ifndef __DARWIN_STDLIB_H +#define __DARWIN_STDLIB_H + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +__BEGIN_DECLS; + +/*! + * @function __os_temporary_resource_shortage + * A function whose purpose is to appear in stack traces to indicate transient + * resource shortage conditions. Do not call. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_NOT_TAIL_CALLED +void +__os_temporary_resource_shortage(void); + +/*! + * @functiongroup + * Internal inline definitions. + */ +DARWIN_API_AVAILABLE_20170407 +OS_ALWAYS_INLINE OS_WARN_RESULT OS_MALLOC __alloc_size(1) +static inline void * +_os_malloc_loop(size_t size) +{ + void *ptr = NULL; + while (!(ptr = malloc(size))) { + __os_temporary_resource_shortage(); + } + return ptr; +} + +DARWIN_API_AVAILABLE_20170407 +OS_ALWAYS_INLINE OS_WARN_RESULT OS_MALLOC __alloc_size(1) +static inline void * +_os_malloc_known(size_t size) +{ + return malloc(size); +} + +DARWIN_API_AVAILABLE_20170407 +OS_ALWAYS_INLINE OS_WARN_RESULT OS_MALLOC __alloc_size(1, 2) +static inline void * +_os_calloc_loop(size_t cnt, size_t size) +{ + void *ptr = NULL; + while (!(ptr = calloc(cnt, size))) { + __os_temporary_resource_shortage(); + } + return ptr; +} + +DARWIN_API_AVAILABLE_20170407 +OS_ALWAYS_INLINE OS_WARN_RESULT OS_MALLOC __alloc_size(1, 2) +static inline void * +_os_calloc_known(size_t cnt, size_t size) +{ + return calloc(cnt, size); +} + +DARWIN_API_AVAILABLE_20170407 +OS_ALWAYS_INLINE OS_WARN_RESULT OS_MALLOC +static inline char * +_os_strdup_loop(const char *str) +{ + char *ptr = NULL; + while (!(ptr = strdup(str))) { + __os_temporary_resource_shortage(); + } + return ptr; +} + +DARWIN_API_AVAILABLE_20170407 +OS_ALWAYS_INLINE OS_WARN_RESULT OS_MALLOC +static inline char * +_os_strdup_known(const char *str) +{ + return strdup(str); +} + +#define __os_requires_experimental_libtrace \ + _Pragma("GCC error \"requires OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE\"") + +/*! + * @function os_malloc + * Wrapper around malloc(3) which guarantees that the allocation succeeds. + * + * @param __size + * The size of the allocation. + * + * @result + * A new object that the caller is responsible for free(3)ing. + * + * This routine will never return NULL. If the size of the allocation is known + * at compile-time, a failure to allocate the object will abort the caller. If + * the size is not known at compile-time, the routine will retry until it is + * successful. + */ +#if defined(OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE) +#define os_malloc(__size) ({ \ + void *ptr = NULL; \ + size_t _size = (__size); \ + if (__builtin_constant_p(__size) || !_dispatch_is_multithreaded()) { \ + ptr = _os_malloc_known(_size); \ + os_assert_malloc("known-constant allocation", ptr, _size); \ + } else { \ + ptr = _os_malloc_loop(_size); \ + } \ + (ptr); \ +}) +#else +#define os_malloc(__size) __os_requires_experimental_libtrace +#endif + +/*! + * @function os_calloc + * Wrapper around calloc(3) which guarantees that the allocation succeeds. + * + * @param __cnt + * The number of elements to allocate. + * + * @param __size + * The size of each element to allocate. + * + * @result + * A new object that the caller is responsible for free(3)ing. + * + * This routine will never return NULL. If the size of the allocation is known + * at compile-time, a failure to allocate the object will abort the caller. If + * the size is not known at compile-time, the routine will retry until it is + * successful. + */ +#if defined(OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE) +#define os_calloc(__cnt, __size) ({ \ + void *ptr = NULL; \ + size_t _size = (__size); \ + size_t _cnt = (__size); \ + if ((__builtin_constant_p(__cnt) && __builtin_constant_p(__size)) || \ + !_dispatch_is_multithreaded()) { \ + ptr = _os_calloc_known(_cnt, _size); \ + os_assert_malloc("known-constant allocation", ptr, _size); \ + } else { \ + ptr = _os_calloc_loop(_cnt, _size); \ + } \ + (ptr); \ +}) +#else +#define os_calloc(__size) __os_requires_experimental_libtrace +#endif + +/*! + * @function os_strdup + * A wrapper around strdup(3) which guarantees that the string duplication + * succeeds. + * + * @param __str + * The string to duplicate. + * + * @result + * A new string that the caller is responsible for free(3)ing. + * + * This routine will never return NULL. If the given string is a compile-time + * constant, a failure to duplicate it will abort the caller. If the string is + * not a compile-time constant, the routine will retry until it is successful. + * + * @discussion + * strdup(3) is found in the string(3) API family, but this interface is in the + * stdlib.h header because its semantic changes are solely related to the manner + * in which memory is allocated. + */ +#if defined(OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE) +#define os_strdup(__str) ({ \ + char *ptr = NULL; \ + const char *_str = (__str); \ + if (__builtin_constant_p(__str) || !_dispatch_is_multithreaded()) { \ + ptr = _os_strdup_known(_str); \ + os_assert_malloc("known-constant allocation", ptr, strlen(_str)); \ + } else { \ + ptr = _os_strdup_loop(_str); \ + } \ + (ptr); \ +}) +#else +#define os_strdup(__size) __os_requires_experimental_libtrace +#endif + +/*! + * @function os_setflag + * Sets the given flag in a manner which is compatible with strongly-typed + * enumerations. + * + * @param _bf + * The bitfield in which to set the flag. + * + * @param _f + * The flag to set. + * + * @result + * The result of setting {@link _f} in {@link _bf}. + */ +#define os_setflag(_bf, _f) (typeof(_bf))((_bf) & (_f)) + +/*! + * @function os_clrflag + * Clears the given flag in a manner which is compatible with strongly-typed + * enumerations. + * + * @param _bf + * The bitfield in which to clear the flag. + * + * @param _f + * The flag to clear. + * + * @result + * The result of clearing {@link _f} from {@link _bf}. + * + * @discussion + * clrbit() will produce errors when given types smaller than a pointer such as + * int because it casts to char *; thus this implementation is required to deal + * properly with flags defined via {@link OS_OPTIONS} or similar. + */ +#define os_clrflag(_bf, _f) (typeof(_bf))((_bf) & (typeof(_bf))(~(_f))) + +/*! + * @function switch_posix + * Macro which expands to a switch() statement for handling both the success + * case as well as errno values set by POSIX and POSIX-y APIs that return -1 and + * set errno. + * + * @example + * + * int ret = dup(fd); + * switch_posix (ret) { + * case 0: + * // success + * break; + * case EINTR: + * // interrupted system call + * break; + * case EBADF: + * // bad file descriptor + * break; + * } + * + * @discussion + * This statement cannot be used with APIs that return positive values on + * failure. + */ +#define switch_posix(_ret) if ((_ret) < 0 || (errno = 0, 1)) switch (errno) + +/*! + * @function size_unsigned + * Converts a signed size quantity into an unsigned size quantity after + * verifying the former can be represented as the latter. + * + * @param ss + * The signed size quantity. + * + * @result + * The unsigned representation of {@link ss}. + * + * @discussion + * This routine is useful for passing a signed value (such as the size of a file + * from a stat(2) structure) into a routine which accepts unsigned input + * (e.g. write(2)). + */ +OS_ALWAYS_INLINE OS_WARN_RESULT +static inline size_t +size_unsigned(ssize_t ss) +{ + if (ss < 0) { + os_crash("value not representable as size_t"); + } + return (size_t)ss; +} + +/*! + * @function size_signed + * Converts an unsigned size quantity into a signed size quantity after + * verifying the former can be represented as the latter. + * + * @param un + * The unsigned size quantity. + * + * @result + * The signed representation of {@link un}. + * + * @discussion + * This routine is useful for comparing an unsigned value (such as a number of + * bytes) to the result of a routine which returns a signed type but only ever + * returns a negative number in the event of an error (e.g. read(2)). + */ +OS_ALWAYS_INLINE OS_WARN_RESULT +static inline ssize_t +size_signed(size_t un) +{ + if (un > SSIZE_MAX) { + os_crash("value not representable as ssize_t"); + } + return (ssize_t)un; +} + +/*! + * @function os_localtime_file + * A routine to generate a time stamp that is suitable for embedding in a file + * name. + * + * @param buff + * A pointer to a buffer where the resulting time stamp will be stored. + * + * @discussion + * The resulting time stamp will not include characters which require escaping + * in shells, such as spaces. The current implementation format is + * + * YYYY-MM-DD_HH.MM.SS.us + * + * e.g. + * + * 2017-04-24_12.45.15.045609 + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT +void +os_localtime_file(char buff[static 32]); + +/*! + * @function os_simple_hash + * An implementation of a simple non-cryptographic hashing algorithm. + * + * @param buff + * A pointer to the buffer to hash. + * + * @param len + * The length of the buffer. + * + * @result + * The hashed value of the input. + * + * @discussion + * This routine is meant to be used as a simple way to obtain a value that can + * be used to choose a bucket in a simple hash table. Do not attach security + * assumptions to the output of this routine. Do not assume that the computed + * hash is stable between hosts, OS versions, or boot sessions. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_NONNULL1 +uint64_t +os_simple_hash(const void *buff, size_t len); + +/*! + * @function os_simple_hash_with_seed + * A seeded variant of os_simple_hash. + * + * @param buff + * A pointer to the buffer to hash. + * + * @param len + * The length of the buffer. + * + * @param seed + * The seed value for the hash. + * + * @result + * The hashed value of the input. + * + * @discussion + * Usually, hashing the same buffer with different seeds will produce + * different hash values. + * All the same considerations of {@link os_simple_hash} apply. + */ +DARWIN_API_AVAILABLE_20181020 +OS_EXPORT OS_NONNULL1 +uint64_t +os_simple_hash_with_seed(const void *buff, size_t len, uint64_t seed); + +/*! + * @function os_simple_hash_string + * An implementation of a simple non-cryptographic hashing algorithm. + * + * @param string + * A pointer to the null-terminated string to hash. + * + * @result + * The hashed value of the input. + * + * @discussion + * This routine is the moral equivalent of a call to + * + * os_simple_hash(buff, strlen(buff)); + * + * All the same considerations of {@link os_simple_hash} apply. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_NONNULL1 +uint64_t +os_simple_hash_string(const char *string); + +/*! + * @function os_simple_hash_string_with_seed + * A seeded variant of os_simple_hash_string. + * + * @param string + * A pointer to the null-terminated string to hash. + * + * @result + * The hashed value of the input. + * + * @discussion + * Usually, hashing the same string with different seeds will produce + * different hash values. + * All the same considerations of {@link os_simple_hash_string} apply. + */ +DARWIN_API_AVAILABLE_20181020 +OS_EXPORT OS_NONNULL1 +uint64_t +os_simple_hash_string_with_seed(const char *string, uint64_t seed); + +/*! + * @function realpath_np + * Obtains a fully-resolved representation of the path to the file represented + * by the given descriptor. + * + * @param fd + * The file descriptor whose path is to be obtained. + * + * @param buff + * The buffer in which to write the path. + * + * @result + * On success, zero is returned. Otherwise, the implementation may return any + * error that can be returned by fcntl(2). + */ +DARWIN_API_AVAILABLE_20180727 +OS_EXPORT OS_WARN_RESULT +errno_t +realpath_np(os_fd_t fd, char buff[static PATH_MAX]); + +/*! + * @function memdup_np + * Copies the given range of bytes into a new allocation. + * + * @param _new + * Upon successful return, a pointer to a new allocation which has had the given + * source bytes copied into it. The caller is responsible for calling free(3) on + * this object when it is no longer needed. + * + * @param src + * The bytes to copy. + * + * @param len + * The number of bytes to copy. + * + * @result + * On success, zero is returned. Otherwise, the implementation may return any + * error that can be returned by malloc(3). + */ +DARWIN_API_AVAILABLE_20190830 +OS_EXPORT OS_WARN_RESULT OS_NONNULL1 OS_NONNULL2 +errno_t +memdup_np(void **_new, const void *src, size_t len); + +/*! + * @function memdup2_np + * Variant of {@link memdup_np} which guarantees that memory duplication will + * either succeed or not return (terminating the caller). + * + * @param src + * The bytes to copy. + * + * @param len + * The number of bytes to copy. + * + * @result + * On success, a pointer to the new allocation which has had the given source + * bytes copied into it. The caller is responsible for calling free(3) on this + * object when it is no longer needed. + */ +DARWIN_API_AVAILABLE_20190830 +OS_EXPORT OS_WARN_RESULT OS_MALLOC OS_NONNULL1 +void * +memdup2_np(const void *src, size_t len); + +__END_DECLS; + +#endif // __DARWIN_STDLIB_H diff --git a/libdarwin/h/string.h b/libdarwin/h/string.h new file mode 100644 index 0000000..b4db82e --- /dev/null +++ b/libdarwin/h/string.h @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * Non-standard, Darwin-specific additions to the string(3) family of APIs. + */ +#ifndef __DARWIN_STRING_H +#define __DARWIN_STRING_H + +#include +#include +#include + +#if DARWIN_TAPI +#include "tapi.h" +#endif + +__BEGIN_DECLS; + +/*! + * @typedef os_flag_t + * A type describing a flag's human-readable name. + * + * @property ohf_flag + * The flag value. + * + * @property ohf_human + * The human-readable, string representation of the flag value. + */ +DARWIN_API_AVAILABLE_20170407 +typedef struct _os_flag { + const uint64_t ohf_flag; + const char *const ohf_human_flag; +} os_flag_t; + +/*! + * @define OS_FLAGSET_COUNT + * The maximum number of flags that a flagset can represent. + */ +#define OS_FLAGSET_COUNT (sizeof(uint64_t) * BYTE_SIZE) + +/*! + * @typedef os_flagset_t + * A type describing an array of human flags. Can accommodate up to 64 flags. + */ +DARWIN_API_AVAILABLE_20170407 +typedef os_flag_t os_flagset_t[OS_FLAGSET_COUNT]; + +/*! + * @macro os_flag_init + * Initializer for a {@link os_flag_t} structure which stringifies the + * flag value. + * + * @param __flag + * The name of the flag to initialize. + */ +#define os_flag_init(__flag) { \ + .ohf_flag = __flag, \ + .ohf_human_flag = #__flag, \ +} + +/*! + * @function strerror_np + * Returns a human-readable string for the given {@link errno_t} or + * POSIX error code. + * + * @param code + * The error code for which to obtain the string. + * + * @result + * A human-readable string describing the error condition. If a POSIX error code + * is given, this is equivalent to a call to strerror(3). + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_COLD OS_WARN_RESULT OS_PURE +const char * +strerror_np(int code); + +/*! + * @function strexit_np + * Returns a human-readable string for the given sysexits(3) code. + * + * @param code + * The exit code for which to obtain the string. + * + * @result + * A human-readable string describing the exit condition. + */ +DARWIN_API_AVAILABLE_20190830 +OS_EXPORT OS_COLD OS_WARN_RESULT OS_PURE +const char * +strexit_np(int code); + +/*! + * @function symerror_np + * Returns the token name of the given {@link errno_t} or POSIX error + * code. + * + * @param code + * The error code for which to obtain the token string. + * + * @result + * The string describing the error token. For example, if code 2 is passed, the + * string "EPERM" is returned. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_COLD OS_WARN_RESULT OS_PURE +const char * +symerror_np(int code); + +/*! + * @function symexit_np + * Returns the token name of the given sysexits(3) code. + * + * @param code + * The sysexits(3) code for which to obtain the token string. + * + * @result + * The string describing the exit code. For example, if 64 is passed, the string + * "EX_USAGE" is returned. If the code is unrecognized, "EX_UNAVAILABLE" is + * returned, which is more or less documented in sysexits(3) as the ¯\_(ツ)_/¯ + * exit code. + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_COLD OS_WARN_RESULT OS_PURE +const char * +symexit_np(int code); + +/*! + * @function os_flagset_copy_string + * Returns a human-readable representation of the flags set for a given word. + * + * @param flagset + * The human flagset which describes how to interpret the {@link flags} + * parameter. + * + * @param flags + * The flags to interpret. + * + * @result + * The human-readable representation of all flags set in the {@link flags} + * parameter, separated by the pipe character. The caller is responsible for + * calling free(3) on this object when it is no longer needed. + * + * @discussion + * This API is to be used in combination with {@link os_flag_init} to make + * printing the contents of flags fields simple. For example, this code can + * easily print a human-readable representation of the bits set in a Mach + * message header: + * + * static const os_flagset_t _mach_msgh_bits = { + * os_flag_init(MACH_MSGH_BITS_COMPLEX), + * os_flag_init(MACH_MSGH_BITS_RAISEIMP), + * os_flag_init(MACH_MSGH_BITS_IMPHOLDASRT), + * }; + * + * char *flags_string = os_flagset_copy_string(&_mach_msgh_bits, + * hdr->msgh_bits); + * + * For a message header with the MACH_MSGH_BITS_COMPLEX and + * MACH_MSGH_BITS_RAISEIMP bits set, this will return the string + * + * MACH_MSGH_BITS_COMPLEX|MACH_MSGH_BITS_RAISEIMP + */ +DARWIN_API_AVAILABLE_20170407 +OS_EXPORT OS_WARN_RESULT OS_MALLOC +char * +os_flagset_copy_string(const os_flagset_t flagset, uint64_t flags); + +__END_DECLS; + +#endif // __DARWIN_STRING_H diff --git a/libdarwin/init.c b/libdarwin/init.c new file mode 100644 index 0000000..33cb448 --- /dev/null +++ b/libdarwin/init.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include "internal.h" + +#pragma mark API +void +__os_temporary_resource_shortage(void) +{ + (void)sleep(1); + _os_avoid_tail_call(); +} + +void +__libdarwin_init(void) +{ + +} diff --git a/libdarwin/internal.h b/libdarwin/internal.h new file mode 100644 index 0000000..0941faf --- /dev/null +++ b/libdarwin/internal.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2017 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * libdarwin internal header. + */ +#ifndef __DARWIN_INTERNAL_H +#define __DARWIN_INTERNAL_H + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE 1 +#include +#ifndef DARLING +#include +#endif // DARLING +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "h/bsd.h" +#include "h/cleanup.h" +#include "h/ctl.h" +#include "h/err.h" +#include "h/errno.h" +#include "h/mach_exception.h" +#include "h/mach_utils.h" +#include "h/stdio.h" +#include "h/stdlib.h" +#include "h/string.h" + +#endif //__DARWIN_INTERNAL_H diff --git a/libdarwin/mach.c b/libdarwin/mach.c new file mode 100644 index 0000000..8a07d04 --- /dev/null +++ b/libdarwin/mach.c @@ -0,0 +1,485 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include "internal.h" + +#pragma mark Types +typedef struct _os_mach_port_disposition { + mach_msg_bits_t ompd_bits; + const char *const ompd_human; +} os_mach_port_disposition_t; + +#define os_mach_port_disposition_init(d) [d] = { \ + .ompd_bits = (d), \ + .ompd_human = #d, \ +} + +#pragma mark Top-Level Statics +static const os_flagset_t _mach_msgh_bits = { + os_flag_init(MACH_MSGH_BITS_COMPLEX), + os_flag_init(MACH_MSGH_BITS_RAISEIMP), + // MACH_MSGH_BITS_DENAP is deprecated + os_flag_init(MACH_MSGH_BITS_IMPHOLDASRT), + // MACH_MSGH_BITS_DENAPHOLDASRT is deprecated + // MACH_MSGH_BITS_CIRCULAR is kernel-internal +}; + +static const os_mach_port_disposition_t _mach_port_dispositions[] = { + os_mach_port_disposition_init(MACH_MSG_TYPE_MOVE_RECEIVE), + os_mach_port_disposition_init(MACH_MSG_TYPE_MOVE_SEND), + os_mach_port_disposition_init(MACH_MSG_TYPE_MOVE_SEND_ONCE), + os_mach_port_disposition_init(MACH_MSG_TYPE_COPY_SEND), + os_mach_port_disposition_init(MACH_MSG_TYPE_MAKE_SEND), + os_mach_port_disposition_init(MACH_MSG_TYPE_MAKE_SEND_ONCE), + // MACH_MSG_TYPE_COPY_RECEIVE is not a valid operation, so unclear why it's + // even defined + os_mach_port_disposition_init(MACH_MSG_TYPE_DISPOSE_RECEIVE), + os_mach_port_disposition_init(MACH_MSG_TYPE_DISPOSE_SEND), + os_mach_port_disposition_init(MACH_MSG_TYPE_DISPOSE_SEND_ONCE), +}; + +static inline const char * +_mach_port_disposition_string(mach_msg_bits_t d) +{ + if (d < MACH_MSG_TYPE_MOVE_RECEIVE) { + return "[invalid]"; + } + if (d > MACH_MSG_TYPE_DISPOSE_SEND_ONCE) { + return "[invalid]"; + } + return _mach_port_dispositions[d].ompd_human; +} + +static const os_flagset_t _mach_port_rights = { + os_flag_init(MACH_PORT_TYPE_SEND), + os_flag_init(MACH_PORT_TYPE_RECEIVE), + os_flag_init(MACH_PORT_TYPE_SEND_ONCE), + os_flag_init(MACH_PORT_TYPE_PORT_SET), + os_flag_init(MACH_PORT_TYPE_DEAD_NAME), + // MACH_PORT_TYPE_LABELH is obsolete + // MACH_PORT_TYPE_DNREQUEST->_mach_port_requests + // MACH_PORT_TYPE_SPREQUEST->_mach_port_requests + // MACH_PORT_TYPE_SPREQUEST_DELAYED->_mach_port_requests + // MACH_PORT_RIGHT_NUMBER is obsolete +}; + +static const os_flagset_t _mach_port_requests = { + os_flag_init(MACH_PORT_TYPE_DNREQUEST), + os_flag_init(MACH_PORT_TYPE_SPREQUEST), + os_flag_init(MACH_PORT_TYPE_SPREQUEST_DELAYED), +}; + +static const os_flagset_t _mach_port_status = { + os_flag_init(MACH_PORT_STATUS_FLAG_TEMPOWNER), + os_flag_init(MACH_PORT_STATUS_FLAG_GUARDED), + os_flag_init(MACH_PORT_STATUS_FLAG_STRICT_GUARD), + os_flag_init(MACH_PORT_STATUS_FLAG_IMP_DONATION), + // MACH_PORT_STATUS_FLAG_REVIVE is obsolete + os_flag_init(MACH_PORT_STATUS_FLAG_TASKPTR), +}; + +static const os_flagset_t _mach_special_bits = { + os_flag_init(MACH_MSG_IPC_SPACE), + os_flag_init(MACH_MSG_VM_SPACE), + os_flag_init(MACH_MSG_IPC_KERNEL), + os_flag_init(MACH_MSG_VM_KERNEL), +}; + +#pragma mark API +const mach_msg_trailer_t * +os_mach_msg_get_trailer(const mach_msg_header_t *hdr) +{ + // The mach_msg() documentation states that the trailer will follow the + // message body on the next natural boundary. But when we moved to 64-bit, + // we kept the trailer alignment on a 4-byte boundary for compatibility + // reasons. Specifically, natural_t is still 32 bits on both 32- and 64-bit + // platforms. + return (mach_msg_trailer_t *)((uint8_t *)hdr + round_msg(hdr->msgh_size)); +} + +const mach_msg_audit_trailer_t * +os_mach_msg_get_audit_trailer(const mach_msg_header_t *hdr) +{ + const mach_msg_trailer_t *tlr = NULL; + const mach_msg_audit_trailer_t *audit_tlr = NULL; + + tlr = os_mach_msg_get_trailer(hdr); + if (tlr->msgh_trailer_type == MACH_MSG_TRAILER_FORMAT_0) { + if (tlr->msgh_trailer_size >= sizeof(mach_msg_audit_trailer_t)) { + audit_tlr = (mach_msg_audit_trailer_t *)tlr; + } + } + + return audit_tlr; +} + +const mach_msg_context_trailer_t * +os_mach_msg_get_context_trailer(const mach_msg_header_t *hdr) +{ + const mach_msg_trailer_t *tlr = NULL; + const mach_msg_context_trailer_t *ctx_tlr = NULL; + + tlr = os_mach_msg_get_trailer(hdr); + if (tlr->msgh_trailer_type == MACH_MSG_TRAILER_FORMAT_0) { + if (tlr->msgh_trailer_size >= sizeof(mach_msg_context_trailer_t)) { + ctx_tlr = (mach_msg_context_trailer_t *)tlr; + } + } + + return ctx_tlr; +} + +char * +os_mach_msg_copy_description(const mach_msg_header_t *msg) +{ + int ret = -1; + mach_msg_bits_t local = MACH_MSGH_BITS_LOCAL(msg->msgh_bits); + mach_msg_bits_t remote = MACH_MSGH_BITS_REMOTE(msg->msgh_bits); + mach_msg_bits_t voucher = MACH_MSGH_BITS_VOUCHER(msg->msgh_bits); + char *__os_free bits_desc = NULL; + const char *local_desc = _mach_port_disposition_string(local); + const char *remote_desc = _mach_port_disposition_string(remote); + const char *voucher_desc = _mach_port_disposition_string(voucher); + char *desc = NULL; + mach_msg_size_t ool_cnt = 0; + + if (msg->msgh_bits & MACH_MSGH_BITS_COMPLEX) { + ool_cnt = ((mach_msg_base_t *)msg)->body.msgh_descriptor_count; + } + + bits_desc = os_flagset_copy_string(_mach_msgh_bits, msg->msgh_bits); + ret = asprintf(&desc, "id = %#x, size = %u, bits = %s, " + "local disp = %s, local port = %#x, " + "remote disp = %s, remote port = %#x, " + "voucher disp = %s, voucher port = %#x, " + "out-of-line descriptor cnt = %u", + msg->msgh_id, msg->msgh_size, bits_desc, + local_desc, msg->msgh_local_port, + remote_desc, msg->msgh_remote_port, + voucher_desc, msg->msgh_voucher_port, + ool_cnt); + posix_assert_zero(ret); + + return desc; +} + +char * +os_mach_msg_trailer_copy_description(const mach_msg_trailer_t *tlr) +{ + union { + int r; + size_t n; + } ret = { + .r = -1, + }; + char *desc = NULL; + char buff[512]; + char *cursor = buff; + size_t left = sizeof(buff); + // Yes we do not know the actual size of the trailer yet, so this is + // technically unsafe, but we only dereference members after determining + // that they are safe to dereference. Just us chickens and all that. + const mach_msg_mac_trailer_t *max = (const mach_msg_mac_trailer_t *)tlr; + + if (tlr->msgh_trailer_type != MACH_MSG_TRAILER_FORMAT_0) { + ret.r = asprintf(&desc, "type = %u, size = %u", + tlr->msgh_trailer_type, tlr->msgh_trailer_size); + os_assert_zero(ret.r); + goto __out; + } + + if (tlr->msgh_trailer_size >= sizeof(mach_msg_trailer_t)) { + ret.r = snprintf(cursor, left, "format = %u, size = %u", + tlr->msgh_trailer_type, tlr->msgh_trailer_size); + os_assert_sprintf(ret.r, left); + + // Safe since the above assert has verified that ret is both positive + // and less than or equal to the size of the buffer. + cursor += ret.n; + left -= ret.n; + } + + if (tlr->msgh_trailer_size >= sizeof(mach_msg_seqno_trailer_t)) { + ret.r = snprintf(cursor, left, ", seqno = %u", max->msgh_seqno); + os_assert_sprintf(ret.r, left); + cursor += ret.n; + left -= ret.n; + } + + if (tlr->msgh_trailer_size >= sizeof(mach_msg_security_trailer_t)) { + ret.r = snprintf(cursor, left, ", security.uid = %u, security.gid = %u", + max->msgh_sender.val[0], max->msgh_sender.val[1]); + os_assert_sprintf(ret.r, left); + cursor += ret.n; + left -= ret.n; + } + + if (tlr->msgh_trailer_size >= sizeof(mach_msg_audit_trailer_t)) { + ret.r = snprintf(cursor, left, ", audit.auid = %u, " + "audit.euid = %u, audit.egid = %u, " + "audit.ruid = %u, audit.rgid = %u, " + "audit.pid = %u, audit.asid = %u, audit.pidvers = %u", + max->msgh_audit.val[0], max->msgh_audit.val[1], + max->msgh_audit.val[2], max->msgh_audit.val[3], + max->msgh_audit.val[4], max->msgh_audit.val[5], + max->msgh_audit.val[6], max->msgh_audit.val[7]); + os_assert_sprintf(ret.r, left); + cursor += ret.n; + left -= ret.n; + } + + if (tlr->msgh_trailer_size >= sizeof(mach_msg_context_trailer_t)) { + uint64_t ctx = max->msgh_context; + ret.r = snprintf(cursor, left, ", context = %#llx", ctx); + os_assert_sprintf(ret.r, left); + cursor += ret.n; + left -= ret.n; + } + + if (tlr->msgh_trailer_size >= sizeof(mach_msg_mac_trailer_t)) { + ret.r = snprintf(cursor, left, ", labels.sender = %#x", + max->msgh_labels.sender); + os_assert_sprintf(ret.r, left); + cursor += ret.n; + left -= ret.n; + } + + desc = os_strdup(buff); + +__out: + return desc; +} + +char * +os_mach_port_copy_description(mach_port_t p) +{ + kern_return_t kr = KERN_FAILURE; + mach_port_right_t right = 0; + mach_port_type_t type = 0; + mach_port_urefs_t urefs = 0; + mach_port_status_t status; + mach_msg_type_number_t status_size = MACH_PORT_RECEIVE_STATUS_COUNT; + char *desc = NULL; + char *__os_free rightdesc = NULL; + char *__os_free requestdesc = NULL; + char *__os_free statusdesc = NULL; + char *__os_free urefsdesc = NULL; + char *which_urefs = ""; + int ret = -1; + + if (p == MACH_PORT_NULL) { + return os_strdup("null"); + } + if (p == MACH_PORT_DEAD) { + return os_strdup("dead-name"); + } + + kr = mach_port_type(mach_task_self(), p, &type); + switch (kr) { + case KERN_SUCCESS: + rightdesc = os_flagset_copy_string(_mach_port_rights, type); + requestdesc = os_flagset_copy_string(_mach_port_requests, type); + break; + default: + ret = asprintf(&rightdesc, "[%#x]", kr); + posix_assert_zero(ret); + } + + kr = mach_port_get_attributes(mach_task_self(), p, + MACH_PORT_RECEIVE_STATUS, (mach_port_info_t)&status, &status_size); + switch (kr) { + case KERN_SUCCESS: + if (status.mps_flags) { + statusdesc = os_flagset_copy_string(_mach_port_status, + status.mps_flags); + } else { + statusdesc = os_strdup("[none]"); + } + + break; + case KERN_INVALID_RIGHT: + if (!(type & MACH_PORT_TYPE_RECEIVE)) { + statusdesc = os_strdup("[none]"); + break; + } + default: + ret = asprintf(&statusdesc, "[%#x]", kr); + posix_assert_zero(ret); + } + + if (type & MACH_PORT_TYPE_SEND) { + right = MACH_PORT_RIGHT_SEND; + which_urefs = "send"; + } else if (type & MACH_PORT_TYPE_DEAD_NAME) { + right = MACH_PORT_RIGHT_DEAD_NAME; + which_urefs = "dead name"; + } + + if (which_urefs) { + kr = mach_port_get_refs(mach_task_self(), p, right, &urefs); + switch (kr) { + case KERN_SUCCESS: + ret = asprintf(&urefsdesc, ", %s urefs = %u", which_urefs, urefs); + break; + default: + ret = asprintf(&urefsdesc, ", %s urefs = [%#x]", + which_urefs, kr); + break; + } + } + + ret = asprintf(&desc, "name = %#x, rights = %s, requests = %s, " + "status = %s%s", + p, rightdesc, requestdesc, statusdesc, urefsdesc); + posix_assert_zero(ret); + + return desc; +} + +#pragma mark API from +// These live here because the implementations uses functionality from +// libdarwin, and we don't want to have a circular dependency between Libc and +// libsystem_darwin. The long-term plan is to move assumes() and assert() +// functionality into libdarwin anyway. +void +(os_assert_mach)(const char *op, kern_return_t kr) +{ + kern_return_t real_kr = (kern_return_t)(kr & (~MACH_MSG_MASK)); + kern_return_t extra = (kern_return_t)(kr & MACH_MSG_MASK); + const char *err_string = NULL; + const char *err_type_string = NULL; + char err_buff[64]; + char code_buff[16]; + const char *special_desc = NULL; + int sys = err_get_system(real_kr); + int sub = err_get_sub(real_kr); + int code = err_get_code(real_kr); + + if (kr == KERN_SUCCESS) { + return; + } + + if (kr >= BOOTSTRAP_NOT_PRIVILEGED && kr <= BOOTSTRAP_NO_CHILDREN) { + err_string = bootstrap_strerror(kr); + snprintf(code_buff, sizeof(code_buff), "%d", kr); + err_type_string = "bootstrap"; + } else { + err_string = mach_error_string(real_kr); + if (strcmp(err_string, "unknown error code") == 0) { + snprintf(err_buff, sizeof(err_buff), "[%#x|%#x|%#x]", + sys, sub, code); + err_string = err_buff; + err_type_string = "unrecognized"; + } else { + err_type_string = "mach"; + } + + if (kr <= MIG_TYPE_ERROR && kr >= MIG_TRAILER_ERROR) { + snprintf(code_buff, sizeof(code_buff), "%d", kr); + } else { + snprintf(code_buff, sizeof(code_buff), "%#x", kr); + special_desc = os_flagset_copy_string(_mach_special_bits, extra); + } + } + + if (special_desc) { + os_crash("%s failed: %s error = %s [%s], special bits = %s", + op, err_type_string, err_string, code_buff, special_desc); + } else { + os_crash("%s failed: %s error = %s [%s]", + op, err_type_string, err_string, code_buff); + } +} + +void +os_assert_mach_port_status(const char *desc, mach_port_t p, + mach_port_status_t *expected) +{ + kern_return_t kr = KERN_FAILURE; + mach_port_status_t status; + mach_msg_type_number_t status_cnt = MACH_PORT_RECEIVE_STATUS_COUNT; + + kr = mach_port_get_attributes(mach_task_self(), p, MACH_PORT_RECEIVE_STATUS, + (mach_port_info_t)&status, &status_cnt); + os_assert_mach("get status", kr); + + if (expected->mps_pset != UINT32_MAX) { + if (expected->mps_pset != status.mps_pset) { + os_crash("port set mismatch: actual = %u, expected = %u", + status.mps_pset, expected->mps_pset); + } + } + if (expected->mps_seqno != UINT32_MAX) { + if (expected->mps_seqno != status.mps_seqno) { + os_crash("sequence number mismatch: actual = %u, expected = %u", + status.mps_seqno, expected->mps_seqno); + } + } + if (expected->mps_mscount != UINT32_MAX) { + if (expected->mps_mscount != status.mps_mscount) { + os_crash("make-send count mismatch: actual = %u, expected = %u", + status.mps_mscount, expected->mps_mscount); + } + } + if (expected->mps_qlimit != UINT32_MAX) { + if (expected->mps_qlimit != status.mps_qlimit) { + os_crash("queue limit mismatch: actual = %u, expected = %u", + status.mps_qlimit, expected->mps_qlimit); + } + } + if (expected->mps_msgcount != UINT32_MAX) { + if (expected->mps_msgcount != status.mps_msgcount) { + os_crash("message count mismatch: actual = %u, expected = %u", + status.mps_msgcount, expected->mps_msgcount); + } + } + if (expected->mps_sorights != UINT32_MAX) { + if (expected->mps_sorights != status.mps_sorights) { + os_crash("send-once rights mismatch: actual = %u, expected = %u", + status.mps_sorights, expected->mps_sorights); + } + } + if (expected->mps_srights != INT32_MAX) { + if (expected->mps_srights != status.mps_srights) { + os_crash("send rights mismatch: actual = %d, expected = %d", + status.mps_srights, expected->mps_srights); + } + } + if (expected->mps_pdrequest != INT32_MAX) { + if (expected->mps_pdrequest != status.mps_pdrequest) { + os_crash("port-destroyed mismatch: actual = %d, expected = %d", + status.mps_pdrequest, expected->mps_pdrequest); + } + } + if (expected->mps_nsrequest != INT32_MAX) { + if (expected->mps_nsrequest != status.mps_nsrequest) { + os_crash("no-senders mismatch: actual = %d, expected = %d", + status.mps_nsrequest, expected->mps_nsrequest); + } + } + if (expected->mps_flags) { + if (expected->mps_flags != status.mps_flags) { + os_crash("flags mismatch: actual = %#x, expected = %#x", + status.mps_flags, expected->mps_flags); + } + } +} diff --git a/libdarwin/stdio.c b/libdarwin/stdio.c new file mode 100644 index 0000000..d7c4407 --- /dev/null +++ b/libdarwin/stdio.c @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include "internal.h" + +#pragma mark API +int +fcheck_np(FILE *f, size_t n, size_t expected) +{ + if (n == expected) { + return 0; + } + if (feof(f)) { + return EOF; + } + if (ferror(f)) { + return 1; + } + __builtin_unreachable(); +} + +os_fd_t +dup_np(os_fd_t fd) +{ + os_fd_t dfd = -1; + + while (true) { + dfd = dup(fd); + + if (os_fd_valid(dfd)) { + break; + } + + switch (errno) { + case EINTR: + break; + case EBADF: + os_crash("bad fd"); + case EMFILE: + case ENFILE: + os_crash("failed to dup fd"); + default: + os_crash("unhandled error: %s", symerror_np(errno)); + } + } + + return dfd; +} + +os_fd_t +claimfd_np(os_fd_t *fdp, const guardid_t *gdid, u_int gdflags) +{ + int ret = -1; + int fd = *fdp; + + if (gdid) { + ret = change_fdguard_np(fd, NULL, 0, gdid, gdflags, NULL); + if (ret) { + os_crash("change_fdguard_np: %{darwin.errno}d", errno); + } + } + + *fdp = -1; + return fd; +} + +os_fd_t +xferfd_np(os_fd_t *fdp, const guardid_t *gdid, u_int gdflags) +{ + int ret = -1; + int fd = *fdp; + + ret = change_fdguard_np(fd, gdid, gdflags, NULL, 0, NULL); + if (ret) { + os_crash("change_fdguard_np: %{darwin.errno}d", errno); + } + + *fdp = -1; + return fd; +} + +void +close_drop_np(os_fd_t *fdp, const guardid_t *gdid) +{ + int ret = -1; + int fd = *fdp; + + if (gdid) { + ret = guarded_close_np(fd, gdid); + } else { + ret = close(fd); + } + + posix_assert_zero(ret); + *fdp = -1; +} + +void +close_drop_optional_np(os_fd_t *fdp, const guardid_t *gdid) +{ + if (!os_fd_valid(*fdp)) { + return; + } + close_drop_np(fdp, gdid); +} + +size_t +zsnprintf_np(char *buff, size_t len, const char *fmt, ...) +{ + int np = 0; + va_list ap; + + va_start(ap, fmt); + np = vsnprintf(buff, len, fmt, ap); + va_end(ap); + + if (np < 0) { + np = 0; + } else if ((size_t)np >= len) { + np = (int)len - 1; + } + + return (size_t)np; +} + +void +crfprintf_np(FILE *f, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vcrfprintf_np(f, fmt, ap); + va_end(ap); +} + +void +vcrfprintf_np(FILE *f, const char *fmt, va_list ap) +{ + vfprintf(f, fmt, ap); + fprintf(f, "\n"); +} + +void +wfprintf_np(FILE *f, ssize_t initpad, size_t pad, size_t width, + const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vwfprintf_np(f, initpad, pad, width, fmt, ap); + va_end(ap); +} + +void +vwfprintf_np(FILE *f, ssize_t initpad, size_t pad, size_t width, + const char *fmt, va_list ap) +{ + char *__os_free string = NULL; + char *__os_free working = NULL; + char *__os_free init_padding = NULL; + char *__os_free padding = NULL; + const char *curline = NULL;; + size_t left = 0; + size_t initpad_labs = (size_t)labs(initpad); + int ret = -1; + + if (width && width <= pad) { + os_crash("width cannot be smaller than pad"); + } + if (width && (initpad > 0) && width <= initpad_labs) { + os_crash("width cannot be smaller than initpad"); + } + if (width && (initpad < 0) && width <= initpad_labs) { + os_crash("width cannot be smaller than negative initpad"); + } + + ret = vasprintf(&string, fmt, ap); + if (ret < 0 || !string) { + return; + } + + left = (size_t)ret; + curline = string; + + // The working buffer will always be large enough to handle any individual + // line. vasprintf(3) returns the number of characters printed not including + // the null terminator, so add space for that. + working = malloc(left + 1); + if (!working) { + return; + } + + init_padding = malloc(initpad_labs + 1); + if (!init_padding) { + return; + } + + if (initpad >= 0) { + memset(init_padding, ' ', initpad); + init_padding[initpad] = 0; + } else { + init_padding[0] = 0; + } + + padding = malloc(pad + 1); + if (!padding) { + return; + } + + memset(padding, ' ', pad); + padding[pad] = 0; + + do { + size_t which_pad = pad; + char *which_padding = padding; + bool findspace = true; + size_t n2consume = 0; + char *breakchar = NULL; + + if (curline == string) { + which_padding = init_padding; + which_pad = initpad_labs; + } + + if (width == 0) { + // Width is unconstrained so just consume the entire string and + // indent any new lines within. + n2consume = left; + findspace = false; + } else { + n2consume = width - which_pad; + if (n2consume >= left) { + n2consume = left; + findspace = false; + } + } + + strlcpy(working, curline, n2consume + 1); + breakchar = strchr(working, '\n'); + if (!breakchar && findspace) { + // No new line within our maximally-constrained width of characters, + // so search for a space instead. + breakchar = strrchr(working, ' '); + } + + if (breakchar) { + // Found something to break on, so nerf it and only consume the + // characters up until that break character. + *breakchar = 0; + n2consume = (size_t)(breakchar - working); + curline += n2consume + 1; + } + + fprintf(f, "%s%s\n", which_padding, working); + left -= n2consume; + } while (left); +} diff --git a/libdarwin/stdlib.c b/libdarwin/stdlib.c new file mode 100644 index 0000000..1c22fb3 --- /dev/null +++ b/libdarwin/stdlib.c @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include "internal.h" + +#pragma mark API +void +os_localtime_file(char buff[static 32]) +{ + struct timeval tv; + struct tm curtime; + + posix_assert_zero(gettimeofday(&tv, NULL)); + (void)localtime_r(&tv.tv_sec, &curtime); + + // Return a time representation that is ideal for use in filenames, so no + // spaces or things that need to be escaped. + snprintf(buff, 32, "%d-%02d-%02d_%02d.%02d.%02d.%06d", + curtime.tm_year + 1900, curtime.tm_mon + 1, curtime.tm_mday, + curtime.tm_hour, curtime.tm_min, curtime.tm_sec, tv.tv_usec); +} + +// MurmurHash2 was written by Austin Appleby, and is placed in the public +// domain. The author hereby disclaims copyright to this source code. +uint64_t +os_simple_hash_with_seed(const void *buff, size_t len, uint64_t seed) +{ +#ifdef __LP64__ + // MurmurHash64A + const uint64_t m = 0xc6a4a7935bd1e995; + const int r = 47; + uint64_t h = seed ^ (len * m); + const uint64_t * data = (const uint64_t *)buff; + const uint64_t * end = data + (len / 8); + while(data != end) { + uint64_t k = *data++; + k *= m; + k ^= k >> r; + k *= m; + h ^= k; + h *= m; + } + const unsigned char * data2 = (const unsigned char *)data; + switch(len & 7) { + case 7: h ^= ((uint64_t)data2[6]) << 48; + case 6: h ^= ((uint64_t)data2[5]) << 40; + case 5: h ^= ((uint64_t)data2[4]) << 32; + case 4: h ^= ((uint64_t)data2[3]) << 24; + case 3: h ^= ((uint64_t)data2[2]) << 16; + case 2: h ^= ((uint64_t)data2[1]) << 8; + case 1: h ^= ((uint64_t)data2[0]); + h *= m; + }; + h ^= h >> r; + h *= m; + h ^= h >> r; +#else // __LP64__ + // MurmurHash64B + const uint32_t m = 0x5bd1e995; + const int r = 24; + + uint32_t h1 = (uint32_t)(seed) ^ len; + uint32_t h2 = (uint32_t)(seed >> 32); + + const uint32_t * data = (const uint32_t *)buff; + +#define MIX(k, h) \ + (k) *= m; (k) ^= (k) >> r; (k) *= m; (h) *= m; (h) ^= (k); len -= 4; + + while(len >= 8) { + uint32_t k[2]; + memcpy(k, (const char*)data, sizeof(k)); + data += sizeof(k)/sizeof(k[0]); + + MIX(k[0], h1) + MIX(k[1], h2) + } + + if(len >= 4) { + uint32_t k[1]; + memcpy(k, (const char *)data, sizeof(k)); + data += sizeof(k)/sizeof(k[0]); + + MIX(k[0], h1); + } + +#undef MIX + + switch(len) { + case 3: h2 ^= ((unsigned char*)data)[2] << 16; + case 2: h2 ^= ((unsigned char*)data)[1] << 8; + case 1: h2 ^= ((unsigned char*)data)[0]; + h2 *= m; + }; + + h1 ^= h2 >> 18; h1 *= m; + h2 ^= h1 >> 22; h2 *= m; + h1 ^= h2 >> 17; h1 *= m; + h2 ^= h1 >> 19; h2 *= m; + + uint64_t h = h1; + + h = (h << 32) | h2; +#endif // __LP64__ + return h; +} + +uint64_t +os_simple_hash(const void *buff, size_t len) +{ + return os_simple_hash_with_seed(buff, len, 0); +} + +uint64_t +os_simple_hash_string_with_seed(const char *string, uint64_t seed) +{ + size_t len = strlen(string); + return os_simple_hash_with_seed(string, len, seed); +} + +uint64_t +os_simple_hash_string(const char *string) +{ + return os_simple_hash_string_with_seed(string, 0); +} + +errno_t +realpath_np(os_fd_t fd, char buff[static PATH_MAX]) +{ + errno_t error = -1; + int ret = -1; + + ret = fcntl(fd, F_GETPATH, buff); + if (ret) { + error = errno; + } else { + error = 0; + } + + return error; +} + +errno_t +memdup_np(void **_new, const void *src, size_t len) +{ + void *mynew = NULL; + + mynew = malloc(len); + if (!mynew) { + return errno; + } + + memcpy(mynew, src, len); + *_new = mynew; + return 0; +} + +void * +memdup2_np(const void *src, size_t len) +{ + void *_new = os_malloc(len); + memcpy(_new, src, len); + return _new; +} diff --git a/libdarwin/string.c b/libdarwin/string.c new file mode 100644 index 0000000..79208e4 --- /dev/null +++ b/libdarwin/string.c @@ -0,0 +1,407 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include "internal.h" + +#pragma mark Definitions +#define __ENEG_ONE (-1) +#define __ENONE 0 +#define __EBOGUS (ELAST + 1) + +#pragma mark Types +OS_ENUM(errno_flags, uint32_t, + EDF_INIT = 0, + EDF_NONPOSIX = (1 << 0), + EDF_SYSEXIT = (1 << 1), +); + +typedef struct _errno_desc { + int ed_error; + int ed_sysexit; + errno_flags_t ed_flags; + const char *ed_sym; + const char *ed_str; +} errno_desc_t; + +#pragma mark Initializers +#define errno_init(__err, __sysexit, __str) \ + [__err] = { \ + .ed_error = (__err), \ + .ed_sysexit = (__sysexit), \ + .ed_flags = 0, \ + .ed_sym = #__err, \ + .ed_str = (__str), \ + } + +#define errno_init_np(__err, __sysexit, __str) \ + [__err - EBASE_NP] = { \ + .ed_error = (__err), \ + .ed_sysexit = (__sysexit), \ + .ed_flags = EDF_NONPOSIX, \ + .ed_sym = #__err, \ + .ed_str = (__str), \ + } + +#define sysexit_init(__code, __str) \ + [__code - EX__BASE] = { \ + .ed_error = (__code), \ + .ed_sysexit = (__code), \ + .ed_flags = EDF_SYSEXIT, \ + .ed_sym = #__code, \ + .ed_str = (__str), \ + } + +#pragma mark Top-Level Statics +static const errno_desc_t _zero = { + .ed_error = 0, + .ed_sysexit = 0, + .ed_flags = 0, + .ed_sym = "0", + .ed_str = "successful termination", +}; + +static const errno_desc_t _negative_one = { + .ed_error = __ENEG_ONE, + .ed_sysexit = EXIT_FAILURE, + .ed_flags = 0, + .ed_sym = "-1", + .ed_str = "[return code instead of error]", +}; + +static const errno_desc_t _badreceipt = { + .ed_error = EX_BADRECEIPT_NP, + .ed_sysexit = EX_BADRECEIPT_NP, + .ed_flags = EDF_SYSEXIT, + .ed_sym = "EX_BADRECEIPT_NP", + .ed_str = "bad purchase receipt", +}; + +static const errno_desc_t _posix_errors[] = { + errno_init(__ENONE, EX_OK, "[no error]"), + errno_init(EPERM, EX_NOPERM, "Operation not permitted"), + errno_init(ENOENT, EX_NOINPUT, "No such file or directory"), + errno_init(ESRCH, EX_IOERR, "No such process"), + errno_init(EINTR, EX_OSERR, "Interrupted system call"), + errno_init(EIO, EX_IOERR, "Input/output error"), + errno_init(ENXIO, EX_NOINPUT, "Device not configured"), + errno_init(E2BIG, EX_IOERR, "Argument list too long"), + errno_init(ENOEXEC, EX_DATAERR, "Exec format error"), + errno_init(EBADF, EX_OSERR, "Bad file descriptor"), + errno_init(ECHILD, EX_IOERR, "No child processes"), + errno_init(EDEADLK, EX_UNAVAILABLE, "Resource deadlock avoided"), + errno_init(ENOMEM, EX_TEMPFAIL, "Cannot allocate memory"), + errno_init(EACCES, EX_NOINPUT, "Permission denied"), + errno_init(EFAULT, EX_OSERR, "Bad address"), +#if defined(ENOTBLK) + errno_init(ENOTBLK, EX_IOERR, "Block device required"), +#endif + errno_init(EBUSY, EX_TEMPFAIL, "Device / Resource busy"), + errno_init(EEXIST, EX_CANTCREAT, "File exists"), + errno_init(EXDEV, EX_UNAVAILABLE, "Cross-device link"), + errno_init(ENODEV, EX_IOERR, "Operation not supported by device"), + errno_init(ENOTDIR, EX_DATAERR, "Not a directory"), + errno_init(EISDIR, EX_DATAERR, "Is a directory"), + errno_init(EINVAL, EX_NOINPUT, "Invalid argument"), + errno_init(ENFILE, EX_OSERR, "Too many open files in system"), + errno_init(EMFILE, EX_OSERR, "Too many open files"), + errno_init(ENOTTY, EX_PROTOCOL, "Inappropriate ioctl for device"), + errno_init(ETXTBSY, EX_TEMPFAIL, "Text file busy"), + errno_init(EFBIG, EX_NOINPUT, "File too large"), + errno_init(ENOSPC, EX_CANTCREAT, "No space left on device"), + errno_init(ESPIPE, EX_IOERR, "Illegal seek"), + errno_init(EROFS, EX_NOPERM, "Read-only file system"), + errno_init(EMLINK, EX_OSERR, "Too many links"), + errno_init(EPIPE, EX_IOERR, "Broken pipe"), + errno_init(EDOM, EX_DATAERR, "Numerical argument out of domain"), + errno_init(ERANGE, EX_DATAERR, "Result too large"), + errno_init(EAGAIN, EX_TEMPFAIL, "Resource temporarily unavailable"), + errno_init(EINPROGRESS, EX_TEMPFAIL, "Operation now in progress"), + errno_init(EALREADY, EX_TEMPFAIL, "Operation already in progress"), + errno_init(ENOTSOCK, EX_PROTOCOL, "Socket operation on non-socket"), + errno_init(EDESTADDRREQ, EX_PROTOCOL, "Destination address required"), + errno_init(EMSGSIZE, EX_PROTOCOL, "Message too long"), + errno_init(EPROTOTYPE, EX_PROTOCOL, "Protocol wrong type for socket"), + errno_init(ENOPROTOOPT, EX_PROTOCOL, "Protocol not available"), + errno_init(EPROTONOSUPPORT, EX_PROTOCOL, "Protocol not supported"), +#if defined(ESOCKTNOSUPPORT) + errno_init(ESOCKTNOSUPPORT, EX_PROTOCOL, "Socket type not supported"), +#endif + errno_init(ENOTSUP, EX_UNAVAILABLE, "Operation not supported"), +#if defined(EPFNOSUPPORT) + errno_init(EPFNOSUPPORT, EX_PROTOCOL, "Protocol family not supported"), +#endif + errno_init(EAFNOSUPPORT, EX_PROTOCOL, + "Address family not supported by protocol family" + ), + errno_init(EADDRINUSE, EX_PROTOCOL, "Address already in use"), + errno_init(EADDRNOTAVAIL, EX_OSERR, "Can't assign requested address"), + errno_init(ENETDOWN, EX_NOHOST, "Network is down"), + errno_init(ENETUNREACH, EX_NOHOST, "Network is unreachable"), + errno_init(ENETRESET, EX_NOHOST, "Network dropped connection on reset"), + errno_init(ECONNABORTED, EX_OSERR, "Software caused connection abort"), + errno_init(ECONNRESET, EX_PROTOCOL, "Connection reset by peer"), + errno_init(ENOBUFS, EX_TEMPFAIL, "No buffer space available"), + errno_init(EISCONN, EX_PROTOCOL, "Socket is already connected"), + errno_init(ENOTCONN, EX_PROTOCOL, "Socket is not connected"), +#if defined(ESHUTDOWN) + errno_init(ESHUTDOWN, EX_PROTOCOL, "Can't send after socket shutdown"), + errno_init(ETOOMANYREFS, EX_PROTOCOL, "Too many references: can't splice"), +#endif + errno_init(ETIMEDOUT, EX_TEMPFAIL, "Operation timed out"), + errno_init(ECONNREFUSED, EX_PROTOCOL, "Connection refused"), + errno_init(ELOOP, EX_DATAERR, "Too many levels of symbolic links"), + errno_init(ENAMETOOLONG, EX_DATAERR, "File name too long"), +#if defined(EHOSTDOWN) + errno_init(EHOSTDOWN, EX_NOHOST, "Host is down"), +#endif + errno_init(EHOSTUNREACH, EX_NOHOST, "No route to host"), + errno_init(ENOTEMPTY, EX_DATAERR, "Directory not empty"), +#if defined(EPROCLIM) + errno_init(EPROCLIM, EX_TEMPFAIL, "Too many processes"), + errno_init(EUSERS, EX_NOUSER, "Too many users"), +#endif + errno_init(EDQUOT, EX_CANTCREAT, "Disc quota exceeded"), + errno_init(ESTALE, EX_NOINPUT, "Stale NFS file handle"), +#if defined(EREMOTE) + errno_init(EREMOTE, EX_DATAERR, "Too many levels of remote in path"), + errno_init(EBADRPC, EX_PROTOCOL, "RPC struct is bad"), + errno_init(ERPCMISMATCH, EX_PROTOCOL, "RPC version wrong"), + errno_init(EPROGUNAVAIL, EX_PROTOCOL, "RPC prog. not avail"), + errno_init(EPROGMISMATCH, EX_PROTOCOL, "Program version wrong"), + errno_init(EPROCUNAVAIL, EX_PROTOCOL, "Bad procedure for program"), +#endif + errno_init(ENOLCK, EX_OSERR, "No locks available"), + errno_init(ENOSYS, EX_UNAVAILABLE, "Function not implemented"), +#if defined(EFTYPE) + errno_init(EFTYPE, EX_DATAERR, "Inappropriate file type or format"), + errno_init(EAUTH, EX_NOPERM, "Authentication error"), + errno_init(ENEEDAUTH, EX_NOPERM, "Need authenticator"), + errno_init(EPWROFF, EX_UNAVAILABLE, "Device power is off"), + errno_init(EDEVERR, EX_UNAVAILABLE, "Device error, e.g. paper out"), +#endif + errno_init(EOVERFLOW, EX_DATAERR, + "Value too large to be stored in data type" + ), +#if defined(EBADEXEC) + errno_init(EBADEXEC, EX_DATAERR, "Bad executable"), + errno_init(EBADARCH, EX_DATAERR, "Bad CPU type in executable"), + errno_init(ESHLIBVERS, EX_DATAERR, "Shared library version mismatch"), + errno_init(EBADMACHO, EX_DATAERR, "Malformed Macho file"), +#endif + errno_init(ECANCELED, EX_UNAVAILABLE, "Operation canceled"), + errno_init(EIDRM, EX_UNAVAILABLE, "Identifier removed"), + errno_init(ENOMSG, EX_UNAVAILABLE, "No message of desired type"), + errno_init(EILSEQ, EX_DATAERR, "Illegal byte sequence"), +#if defined(ENOATTR) + errno_init(ENOATTR, EX_UNAVAILABLE, "Attribute not found"), +#endif + errno_init(EBADMSG, EX_PROTOCOL, "Bad message"), + errno_init(EMULTIHOP, EX_UNAVAILABLE, "Reserved"), + errno_init(ENODATA, EX_NOINPUT, "No message available on STREAM"), + errno_init(ENOLINK, EX_UNAVAILABLE, "Reserved"), + errno_init(ENOSR, EX_TEMPFAIL, "No STREAM resources"), + errno_init(ENOSTR, EX_PROTOCOL, "Not a STREAM"), + errno_init(EPROTO, EX_PROTOCOL, "Protocol error"), + errno_init(ETIME, EX_TEMPFAIL, "STREAM ioctl timeout"), +#if defined(EOPNOTSUPP) + errno_init(EOPNOTSUPP, EX_PROTOCOL, "Operation not supported on socket"), +#endif + errno_init(ENOPOLICY, EX_UNAVAILABLE, "No such policy registered"), +#if defined(ENOTRECOVERABLE) + errno_init(ENOTRECOVERABLE, EX_CONFIG, "State not recoverable"), + errno_init(EOWNERDEAD, EX_NOHOST, "Previous owner died"), +#endif +#if defined(EQFULL) + errno_init(EQFULL, EX_CANTCREAT, "Interface output queue is full"), +#endif + errno_init(__EBOGUS, EX_UNAVAILABLE, "[invalid]"), +}; + +static const errno_desc_t _darwin_errors[] = { + errno_init_np(ENOTENTITLED_NP, EX_NOPERM, "Requestor not entitled"), + errno_init_np(ENOTPLATFORM_NP, EX_NOPERM, "Requestor not platform binary"), + errno_init_np(EROOTLESS_NP, EX_NOPERM, + "Operation disallowed by System Integrity Protection" + ), + errno_init_np(ETAINTED_NP, EX_NOPERM, + "Requestor is tainted and untrusthworthy" + ), + errno_init_np(EQUARANTINE_NP, EX_NOPERM, + "Operation not permitted on quarantined file" + ), + errno_init_np(EBADUSER_NP, EX_NOINPUT, "Invalid username or identifier"), + errno_init_np(EBADGROUP_NP, EX_NOINPUT, "Invalid group name or identifier"), + errno_init_np(EOWNERSHIP_NP, EX_NOINPUT, + "Ownership and/or permissions insufficiently restrictive" + ), + errno_init_np(ENOOOO_NP, EX_PROTOCOL, "Out-of-order operation rejected"), + errno_init_np(ENOTBUNDLE_NP, EX_NOINPUT, "Entity not a bundle"), + errno_init_np(EBADBUNDLE_NP, EX_DATAERR, "Malformed bundle"), + errno_init_np(EBADPATH_NP, EX_DATAERR, "Malformed path"), + errno_init_np(EBADPLIST_NP, EX_DATAERR, "Malformed property list"), + errno_init_np(EBADKEY_NP, EX_DATAERR, "Unrecognized key"), + errno_init_np(EBADVAL_NP, EX_DATAERR, "Invalid or missing value for key"), + errno_init_np(EBADSUBSYS_NP, EX_DATAERR, + "Routine referenced an invalid subsystem" + ), + errno_init_np(E2BIMPL_NP, EX_UNAVAILABLE, "Routine not yet implemented"), + errno_init_np(EDEPRECATED_NP, EX_UNAVAILABLE, "Routine deprecated"), + errno_init_np(EREMOVED_NP, EX_UNAVAILABLE, "Routine removed"), + errno_init_np(EDROPPED_NP, EX_PROTOCOL, "Routine invocation dropped"), + errno_init_np(EDEFERRED_NP, EX_TEMPFAIL, "Routine invocation deferred"), + errno_init_np(EUSAGE_NP, EX_USAGE, "Bad command line usage"), + errno_init_np(EUNKNOWN_NP, EX_UNAVAILABLE, + "Unknown error from another subsystem" + ), +}; + +static const errno_desc_t _sysexits[] = { + sysexit_init(EX_USAGE, "command line usage error"), + sysexit_init(EX_DATAERR, "data format error"), + sysexit_init(EX_NOINPUT, "cannot open input"), + sysexit_init(EX_NOUSER, "addressee unknown"), + sysexit_init(EX_NOHOST, "host name unknown"), + sysexit_init(EX_UNAVAILABLE, "service unavailable"), + sysexit_init(EX_SOFTWARE, "internal software error"), + sysexit_init(EX_OSERR, "system error (e.g., can't fork)"), + sysexit_init(EX_OSFILE, "critical OS file missing"), + sysexit_init(EX_CANTCREAT, "can't create (user) output file"), + sysexit_init(EX_IOERR, "input/output error"), + sysexit_init(EX_TEMPFAIL, "temp failure"), + sysexit_init(EX_PROTOCOL, "remote error in protocol"), + sysexit_init(EX_NOPERM, "permission denied"), + sysexit_init(EX_CONFIG, "configuration error"), +}; + +#pragma mark Utilities +static const errno_desc_t * +_find_error(int code) +{ + if (code < 0) { + return &_negative_one; + } + + if (code >= EBASE_NP && code <= __ELAST_NP) { + return &_darwin_errors[code - EBASE_NP]; + } + + if (code >= 0 && code <= ELAST) { + return &_posix_errors[code]; + } + + return &_posix_errors[__EBOGUS]; +} + +static const errno_desc_t * +_find_sysexit(int code) +{ + if (code == 0) { + return &_zero; + } + + if (code == EX_BADRECEIPT_NP) { + return &_badreceipt; + } + + if (code < EX__BASE || code > EX__MAX) { + return &_sysexits[EX_UNAVAILABLE - EX__BASE]; + } + + return &_sysexits[code - EX__BASE]; +} + +static void +_writeflag(const char *humanflag, const char *sep, char *buff, size_t len, + char **track_buff, size_t *track_sz) +{ + size_t offs = 0; + + if (*track_buff != buff) { + offs = zsnprintf_np(*track_buff, *track_sz, "%s", sep); + *track_buff += offs; + *track_sz -= offs; + } + + offs = zsnprintf_np(*track_buff, *track_sz, "%s", humanflag); + *track_buff += offs; + *track_sz -= offs; +} + +#pragma mark API +int +sysexit_np(int code) +{ + const errno_desc_t *de = _find_error(code); + return de->ed_sysexit; +} + +const char * +strerror_np(int code) +{ + if (code >= 0 && code <= ELAST) { + return strerror(code); + } + + return _find_error(code)->ed_str; +} + +const char * +strexit_np(int code) +{ + const errno_desc_t *de = _find_sysexit(code); + return de->ed_str; +} + +const char * +symerror_np(int code) +{ + const errno_desc_t *de = _find_error(code); + return de->ed_sym; +} + +const char * +symexit_np(int code) +{ + const errno_desc_t *de = _find_sysexit(code); + return de->ed_sym; +} + +char * +os_flagset_copy_string(const os_flagset_t flagset, uint64_t flags) +{ + size_t i = 0; + const os_flag_t *fi = NULL; + char buff[1024] = "[none]"; + char *cursor = buff; + size_t left = sizeof(buff); + + while (i < OS_FLAGSET_COUNT && (fi = &flagset[i]) && fi->ohf_flag) { + if (flags & fi->ohf_flag) { + _writeflag(fi->ohf_human_flag, "|", buff, sizeof(buff), + &cursor, &left); + } + i++; + } + + return os_strdup(buff); +} + diff --git a/libdarwin/tapi.h b/libdarwin/tapi.h new file mode 100644 index 0000000..1779311 --- /dev/null +++ b/libdarwin/tapi.h @@ -0,0 +1,59 @@ +/*! + * @header + * TAPI-specific header to ensure project builds properly in installapi. + */ +#ifndef __DARWIN_TAPI_H +#define __DARWIN_TAPI_H + +#if !DARWIN_TAPI +#error "This header is for the installapi action only" +#endif + +#include +#include +#include +#include +#include + +#undef os_assert_mach +#undef os_assert_mach_port_status + +// Duplicate declarations to make TAPI happy. +API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +OS_EXPORT OS_NONNULL1 +void +os_assert_mach(const char *op, kern_return_t kr); + +API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +OS_EXPORT +void +os_assert_mach_port_status(const char *desc, mach_port_t p, + mach_port_status_t *expected); + +// TAPI and the compiler don't agree about header search paths, so if TAPI found +// our header in the SDK, and we've increased the API version, help it out. +#if DARWIN_API_VERSION < 20170407 +#define DARWIN_API_AVAILABLE_20170407 +#endif + +#if DARWIN_API_VERSION < 20180727 +#define DARWIN_API_AVAILABLE_20180727 +#endif + +#if DARWIN_API_VERSION < 20181020 +#define DARWIN_API_AVAILABLE_20181020 +#endif + +#if DARWIN_API_VERSION < 20190830 +#define DARWIN_API_AVAILABLE_20190830 +#endif + +#if DARWIN_API_VERSION < 20191015 +#define DARWIN_API_AVAILABLE_20191015 +#endif + +#if !defined(LINKER_SET_ENTRY) +#define LINKER_SET_ENTRY(_x, _y) +#endif + +#endif // __DARWIN_TAPI_H diff --git a/libdarwin/variant.c b/libdarwin/variant.c new file mode 100644 index 0000000..6e02d63 --- /dev/null +++ b/libdarwin/variant.c @@ -0,0 +1,756 @@ +/* + * Copyright (c) 2016 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* + * Lists all properties overridden by an empty file + */ +#define ALL_OVERRIDES_STR "content,diagnostics,ui,security" + +enum variant_property { + VP_CONTENT, + VP_DIAGNOSTICS, + VP_UI, + VP_SECURITY, + VP_MAX +}; + +enum check_status { + S_UNKNOWN = 0, + S_NO = 2, + S_YES = 3 +}; + +typedef struct { + const char *variant; + bool (*function)(const char*); +} variant_check_mapping; + +static bool +status2bool(enum check_status status) { + switch (status) { + case S_NO: + return false; + case S_YES: + return true; + case S_UNKNOWN: + default: + os_crash("os_variant had unexpected status"); + } +} + +#define VAR_FILE_LEGACY "/var/db/disableAppleInternal" + +#if TARGET_OS_OSX +#define VAR_FILE_OVERRIDE "/var/db/os_variant_override" +#else +#define VAR_FILE_OVERRIDE "/usr/share/misc/os_variant_override" +#endif + +#if !TARGET_OS_SIMULATOR +#define INTERNAL_CONTENT_PATH "/System/Library/CoreServices/AppleInternalVariant.plist" +#else +#define INTERNAL_CONTENT_PATH "/AppleInternal" +#endif + +#define SYSTEM_VERSION_PLIST_PATH "/System/Library/CoreServices/SystemVersion.plist" +#define SYSTEM_VERSION_PLIST_KEY "ReleaseType" + +#if TARGET_OS_IPHONE +#define INTERNAL_SETTINGS_PATH "/AppleInternal/Library/PreferenceBundles/Internal Settings.bundle" +#else +#define INTERNAL_DIAGS_PROFILE_PATH "/var/db/ConfigurationProfiles/Settings/com.apple.InternalDiagnostics.plist" +#define FACTORY_CONTENT_PATH "/System/Library/CoreServices/AppleFactoryVariant.plist" +#define BASE_SYSTEM_CONTENT_PATH "/System/Library/BaseSystem" +#endif + +#if !TARGET_OS_SIMULATOR +#define CACHE_SYSCTL_NAME "kern.osvariant_status" + +static void _restore_cached_check_status(uint64_t status); +static uint64_t _get_cached_check_status(void); + +static char * _read_file(const char *path, size_t *size_out) +{ + char *buf = NULL; + + int fd = open(path, O_RDONLY); + if (fd == -1) return NULL; + + struct stat sb; + int rc = fstat(fd, &sb); + if (rc != 0 || sb.st_size == 0) { + goto error; + } + + size_t size_limit = (size_out && *size_out != 0) ? *size_out : 1024; + size_t size = (size_t)sb.st_size; + if (size_out) *size_out = (size_t)sb.st_size; + if (size > size_limit) { + goto error; + } + + buf = malloc(size + 1); + if (!buf) { + goto error; + } + + ssize_t bytes_read = read(fd, buf, size); + buf[size] = '\0'; + + + if (bytes_read == (ssize_t)size) { + close(fd); + return buf; + } + +error: + close(fd); + free(buf); + return NULL; +} + +static xpc_object_t read_plist(const char *path) +{ + size_t size = 16 * 1024; + uint8_t *buf = (uint8_t*)_read_file(path, &size); + if (!buf) return NULL; + + xpc_object_t plist = xpc_create_from_plist(buf, size); + if (plist && xpc_get_type(plist) != XPC_TYPE_DICTIONARY) { + xpc_release(plist); + plist = NULL; + } + + free(buf); + + return plist; +} +#endif + +#if !TARGET_OS_IPHONE || TARGET_OS_SIMULATOR +static enum check_status internal_content = S_UNKNOWN; +#endif +#if !TARGET_OS_SIMULATOR +static enum check_status can_has_debugger = S_UNKNOWN; +#if TARGET_OS_IPHONE +static enum check_status internal_release_type = S_UNKNOWN; +static enum check_status factory_release_type = S_UNKNOWN; +static enum check_status darwin_release_type = S_UNKNOWN; +static enum check_status recovery_release_type = S_UNKNOWN; +static enum check_status development_kernel = S_UNKNOWN; +#else // TARGET_OS_IPHONE +static enum check_status internal_diags_profile = S_UNKNOWN; +static enum check_status factory_content = S_UNKNOWN; +static enum check_status base_system_content = S_UNKNOWN; +#endif // TARGET_OS_IPHONE +#endif // !TARGET_OS_SIMULATOR +static enum check_status is_ephemeral = S_UNKNOWN; + +static bool disabled_status[VP_MAX] = {}; + +static void _parse_disabled_status(char *test_string) +{ +#if TARGET_OS_SIMULATOR +#pragma unused(test_string) +#else // TARGET_OS_SIMULATOR + char *override_str = NULL; + + bzero(disabled_status, sizeof(disabled_status)); + + if (test_string != NULL) { + /* used for unit tests */ + override_str = os_strdup(test_string); + } else { + if (access(VAR_FILE_LEGACY, F_OK) == 0) { + override_str = os_strdup(ALL_OVERRIDES_STR); + } else if (access(VAR_FILE_OVERRIDE, F_OK) != 0) { + return; + } + + override_str = _read_file(VAR_FILE_OVERRIDE, NULL); + } + + if (override_str == NULL) { + override_str = os_strdup(ALL_OVERRIDES_STR); + } + + char *token, *string = override_str; + while ((token = strsep(&string, ",\n")) != NULL) { + if (strcmp(token, "content") == 0) { + disabled_status[VP_CONTENT] = true; + } else if (strcmp(token, "diagnostics") == 0) { + disabled_status[VP_DIAGNOSTICS] = true; + } else if (strcmp(token, "ui") == 0) { + disabled_status[VP_UI] = true; + } else if (strcmp(token, "security") == 0) { + disabled_status[VP_SECURITY] = true; + } + } + + free(override_str); + return; +#endif //!TARGET_OS_SIMULATOR +} + +#if !TARGET_OS_SIMULATOR +static bool _load_cached_status(void) +{ + uint64_t status = 0; + size_t status_size = sizeof(status); + int ret = sysctlbyname(CACHE_SYSCTL_NAME, &status, &status_size, NULL, 0); + if (ret != 0) { + return false; + } + + if (status) { + _restore_cached_check_status(status); + return true; + } + + if (status == 0 && getpid() == 1) { + /* + * Looks like we are in launchd; try to set the status. + * + * We don't actually care if this works because we'll have warmed our state. + */ + status = _get_cached_check_status(); + sysctlbyname(CACHE_SYSCTL_NAME, NULL, 0, &status, status_size); + return true; + } + + return false; +} +#endif + +static void _initialize_status(void * __unused ctx) +{ +#if !TARGET_OS_SIMULATOR + if (!_load_cached_status()) { + _parse_disabled_status(NULL); + } +#else + _parse_disabled_status(NULL); +#endif +} + +static bool _check_disabled(enum variant_property variant_property) +{ + static dispatch_once_t disabled_status_pred; + dispatch_once_f(&disabled_status_pred, NULL, _initialize_status); + + return disabled_status[variant_property]; +} + +#if !TARGET_OS_IPHONE || TARGET_OS_SIMULATOR +static bool _check_internal_content(void) +{ + if (internal_content == S_UNKNOWN) { +#if !TARGET_OS_SIMULATOR + const char * path = INTERNAL_CONTENT_PATH; +#else + char *simulator_root = getenv("IPHONE_SIMULATOR_ROOT"); + char *to_free = NULL, *path = NULL; + if (simulator_root) { + asprintf(&path, "%s/%s", simulator_root, INTERNAL_CONTENT_PATH); + if (path == NULL) { + return false; + } + to_free = path; + } +#endif + internal_content = (access(path, F_OK) == 0) ? S_YES : S_NO; +#if TARGET_OS_SIMULATOR + free(to_free); +#endif + } + return status2bool(internal_content); +} +#endif // !TARGET_OS_IPHONE || TARGET_OS_SIMULATOR + +#if TARGET_OS_OSX +static bool _check_factory_content(void) +{ + if (factory_content == S_UNKNOWN) { + const char * path = FACTORY_CONTENT_PATH; + factory_content = (access(path, F_OK) == 0) ? S_YES : S_NO; + } + return status2bool(factory_content); +} +#endif // TARGET_OS_OSX + +#if TARGET_OS_IPHONE + +#if !TARGET_OS_SIMULATOR +static bool _parse_system_version_plist(void) +{ + xpc_object_t system_version_plist = read_plist(SYSTEM_VERSION_PLIST_PATH); + if (!system_version_plist) { + return false; + } + + const char *release_type = + xpc_dictionary_get_string(system_version_plist, + SYSTEM_VERSION_PLIST_KEY); + + if (release_type == NULL) { + /* + * Confusingly, customer images are just completely missing this key. + */ + internal_release_type = S_NO; + factory_release_type = S_NO; + darwin_release_type = S_NO; + recovery_release_type = S_NO; + } else if (strcmp(release_type, "NonUI") == 0) { + factory_release_type = S_YES; + internal_release_type = S_YES; + darwin_release_type = S_NO; + recovery_release_type = S_NO; + } else { + factory_release_type = S_NO; + internal_release_type = (strstr(release_type, "Internal") != NULL) ? S_YES : S_NO; + darwin_release_type = (strstr(release_type, "Darwin") != NULL) ? S_YES : S_NO; + recovery_release_type = (strstr(release_type, "Recovery") != NULL) ? S_YES : S_NO; + } + + xpc_release(system_version_plist); + + return true; +} +#endif //!TARGET_OS_SIMULATOR + +/* + * This set of criteria was taken from copyInternalBuild in MobileGestalt.c + */ +static bool _check_internal_release_type(void) +{ +#if TARGET_OS_SIMULATOR + return _check_internal_content(); +#else // TARGET_OS_SIMULATOR + if (internal_release_type == S_UNKNOWN) { + if (!_parse_system_version_plist()) { + internal_release_type = (access(INTERNAL_SETTINGS_PATH, F_OK) == 0) ? S_YES : S_NO; + } + } + + return status2bool(internal_release_type); +#endif // TARGET_OS_SIMULATOR +} + +static bool _check_factory_release_type(void) +{ +#if TARGET_OS_SIMULATOR + return false; +#else // TARGET_OS_SIMULATOR + if (factory_release_type == S_UNKNOWN) { + if (!_parse_system_version_plist()) { + factory_release_type = S_NO; + } + } + + return status2bool(factory_release_type); +#endif // TARGET_OS_SIMULATOR +} + +static bool _check_darwin_release_type(void) +{ +#if TARGET_OS_SIMULATOR + return false; +#else // TARGET_OS_SIMULATOR + if (darwin_release_type == S_UNKNOWN) { + if (!_parse_system_version_plist()) { + darwin_release_type = S_NO; + } + } + + return status2bool(darwin_release_type); +#endif // TARGET_OS_SIMULATOR +} + +static bool _check_recovery_release_type(void) +{ +#if TARGET_OS_SIMULATOR + return false; +#else // TARGET_OS_SIMULATOR + if (recovery_release_type == S_UNKNOWN) { + if (!_parse_system_version_plist()) { + recovery_release_type = S_NO; + } + } + + return status2bool(recovery_release_type); +#endif // TARGET_OS_SIMULATOR +} + +#else // TARGET_OS_IPHONE + +static bool _check_internal_diags_profile(void) +{ + if (internal_diags_profile == S_UNKNOWN) { + xpc_object_t profile_settings = read_plist(INTERNAL_DIAGS_PROFILE_PATH); + if (profile_settings) { + internal_diags_profile = xpc_dictionary_get_bool(profile_settings, "AppleInternal") ? S_YES : S_NO; + xpc_release(profile_settings); + } else { + internal_diags_profile = S_NO; + } + } + + return status2bool(internal_diags_profile); +} + +static bool _check_base_system_content(void) +{ + if (base_system_content == S_UNKNOWN) { + const char * path = BASE_SYSTEM_CONTENT_PATH; + base_system_content = (access(path, F_OK) == 0) ? S_YES : S_NO; + } + return status2bool(base_system_content); +} + +#endif + +#if !TARGET_OS_SIMULATOR +static bool _check_can_has_debugger(void) +{ + if (can_has_debugger == S_UNKNOWN) { +#if TARGET_OS_IPHONE + can_has_debugger = *((uint32_t *)_COMM_PAGE_DEV_FIRM) ? S_YES : S_NO; +#else + /* + * The comm page bit does exist on macOS, but also requires kernel + * debugging in the CSR configuration. We don't need to be that strict + * here. + */ + can_has_debugger = (csr_check(CSR_ALLOW_APPLE_INTERNAL) == 0) ? S_YES : S_NO; +#endif + } + return status2bool(can_has_debugger); +} +#endif // !TARGET_OS_SIMULATOR + +#if TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR +static bool _check_development_kernel(void) +{ + if (development_kernel == S_UNKNOWN) { + /* + * Whitelist values from SUPPORTED_KERNEL_CONFIGS. + */ + char *osbuildconfig = NULL; + size_t osbuildconfig_sz = 0; + errno_t err = sysctlbyname_get_data_np("kern.osbuildconfig", (void **)&osbuildconfig, &osbuildconfig_sz); + if (err == 0) { + if (strcmp(osbuildconfig, "development") == 0 || + strcmp(osbuildconfig, "debug") == 0 || + strcmp(osbuildconfig, "profile") == 0 || + strcmp(osbuildconfig, "kasan") == 0) { + development_kernel = S_YES; + } + } + free(osbuildconfig); + + if (development_kernel == S_UNKNOWN) { + development_kernel = S_NO; + } + } + return status2bool(development_kernel); +} +#endif // TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR + +// For unit tests +#ifndef VARIANT_SKIP_EXPORTED + +bool +os_variant_has_internal_content(const char * __unused subsystem) +{ + if (_check_disabled(VP_CONTENT)) { + return false; + } + +#if TARGET_OS_IPHONE + return _check_internal_release_type(); +#else + return _check_internal_content(); +#endif +} + + +bool +os_variant_has_internal_diagnostics(const char * __unused subsystem) +{ + if (_check_disabled(VP_DIAGNOSTICS)) { + return false; + } + +#if TARGET_OS_IPHONE + return _check_internal_release_type(); +#else + return _check_internal_content() || _check_internal_diags_profile(); +#endif +} + +bool +os_variant_has_internal_ui(const char * __unused subsystem) +{ + if (_check_disabled(VP_UI)) { + return false; + } + +#if TARGET_OS_IPHONE + return _check_internal_release_type(); +#else + return _check_internal_content(); +#endif +} + +bool +os_variant_allows_internal_security_policies(const char * __unused subsystem) +{ + if (_check_disabled(VP_SECURITY)) { + return false; + } + +#if TARGET_OS_SIMULATOR + return _check_internal_content(); +#elif TARGET_OS_IPHONE + return _check_can_has_debugger() || _check_development_kernel(); +#else + return _check_can_has_debugger(); +#endif +} + +bool +os_variant_has_factory_content(const char * __unused subsystem) +{ +#if TARGET_OS_IPHONE + return _check_factory_release_type(); +#else + return _check_factory_content(); +#endif +} + +bool +os_variant_is_darwinos(const char * __unused subsystem) +{ + +#if TARGET_OS_IPHONE + return _check_darwin_release_type(); +#else + return false; +#endif +} + +bool +os_variant_is_recovery(const char * __unused subsystem) +{ +#if TARGET_OS_IPHONE + return _check_recovery_release_type(); +#else + return _check_base_system_content(); +#endif +} + +bool +os_variant_uses_ephemeral_storage(const char * __unused subsystem) +{ + if (is_ephemeral == S_UNKNOWN) { + uint32_t buffer = 0; + size_t buffer_size = sizeof(buffer); + + sysctlbyname("hw.ephemeral_storage", (void *)&buffer, &buffer_size, NULL, 0); + + is_ephemeral = (buffer != 0) ? S_YES : S_NO; + } + + return status2bool(is_ephemeral); +} + +bool +os_variant_check(const char * __unused subsystem, const char *variant) +{ + static const variant_check_mapping map[] = { + {.variant = "HasInternalContent", .function = os_variant_has_internal_content}, + {.variant = "HasInternalDiagnostics", .function = os_variant_has_internal_diagnostics}, + {.variant = "HasInternalUI", .function = os_variant_has_internal_ui}, + {.variant = "AllowsInternalSecurityPolicies", .function = os_variant_allows_internal_security_policies}, + {.variant = "HasFactoryContent", .function = os_variant_has_factory_content}, + {.variant = "IsDarwinOS", .function = os_variant_is_darwinos}, + {.variant = "UsesEphemeralStorage", .function = os_variant_uses_ephemeral_storage}, + {.variant = "IsRecovery", .function = os_variant_is_recovery}, + {.variant = NULL, .function = NULL} + }; + variant_check_mapping *current = (variant_check_mapping *)map; + + while (current->variant) { + if (0 == strncasecmp(current->variant, variant, strlen(current->variant))) { + return current->function(""); + } + current ++; + } + + return false; +} + +#endif // VARIANT_SKIP_EXPORTED + +#define STATUS_INITIAL_BITS 0x70000000F0000000ULL +#define STATUS_BIT_WIDTH 2 +#define STATUS_SET 0x2 +#define STATUS_MASK 0x3 + +enum status_flags_positions { + SFP_INTERNAL_CONTENT = 0, + SFP_CAN_HAS_DEBUGGER = 1, + SFP_INTERNAL_RELEASE_TYPE = 2, + SFP_INTERNAL_DIAGS_PROFILE = 3, + SFP_FACTORY_CONTENT = 4, + SFP_FACTORY_RELEASE_TYPE = 5, + SFP_DARWINOS_RELEASE_TYPE = 6, + SFP_EPHEMERAL_VOLUME = 7, + SFP_RECOVERY_RELEASE_TYPE = 8, + SFP_BASE_SYSTEM_CONTENT = 9, + SFP_DEVELOPMENT_KERNEL = 10, +}; + +#if !TARGET_OS_SIMULATOR +static uint64_t _get_cached_check_status(void) +{ + uint64_t res = STATUS_INITIAL_BITS; + +#if !TARGET_OS_IPHONE || TARGET_OS_SIMULATOR + _check_internal_content(); + if (internal_content != S_UNKNOWN) + res |= internal_content << SFP_INTERNAL_CONTENT * STATUS_BIT_WIDTH; +#endif + + _check_can_has_debugger(); + if (can_has_debugger != S_UNKNOWN) + res |= can_has_debugger << SFP_CAN_HAS_DEBUGGER * STATUS_BIT_WIDTH; + + (void)os_variant_uses_ephemeral_storage(""); + if (is_ephemeral != S_UNKNOWN) + res |= is_ephemeral << SFP_EPHEMERAL_VOLUME * STATUS_BIT_WIDTH; + +#if TARGET_OS_IPHONE + _check_internal_release_type(); + if (internal_release_type != S_UNKNOWN) + res |= internal_release_type << SFP_INTERNAL_RELEASE_TYPE * STATUS_BIT_WIDTH; + + _check_factory_release_type(); + if (factory_release_type != S_UNKNOWN) + res |= factory_release_type << SFP_FACTORY_RELEASE_TYPE * STATUS_BIT_WIDTH; + + _check_darwin_release_type(); + if (darwin_release_type != S_UNKNOWN) + res |= darwin_release_type << SFP_DARWINOS_RELEASE_TYPE * STATUS_BIT_WIDTH; + + _check_recovery_release_type(); + if (recovery_release_type != S_UNKNOWN) + res |= recovery_release_type << SFP_RECOVERY_RELEASE_TYPE * STATUS_BIT_WIDTH; + + _check_development_kernel(); + if (development_kernel != S_UNKNOWN) + res |= development_kernel << SFP_DEVELOPMENT_KERNEL * STATUS_BIT_WIDTH; +#else + _check_internal_diags_profile(); + if (internal_diags_profile != S_UNKNOWN) + res |= internal_diags_profile << SFP_INTERNAL_DIAGS_PROFILE * STATUS_BIT_WIDTH; + + _check_factory_content(); + if (factory_content != S_UNKNOWN) + res |= factory_content << SFP_FACTORY_CONTENT * STATUS_BIT_WIDTH; + + _check_base_system_content(); + if (base_system_content != S_UNKNOWN) + res |= base_system_content << SFP_BASE_SYSTEM_CONTENT * STATUS_BIT_WIDTH; +#endif + + _parse_disabled_status(NULL); + for (int i = 0; i < VP_MAX; i++) { + if (disabled_status[i]) { + res |= 0x1ULL << (i + 32); + } + } + + return res; +} + +static void _restore_cached_check_status(uint64_t status) +{ +#if !TARGET_OS_IPHONE || TARGET_OS_SIMULATOR + if ((status >> (SFP_INTERNAL_CONTENT * STATUS_BIT_WIDTH)) & STATUS_SET) + internal_content = (status >> (SFP_INTERNAL_CONTENT * STATUS_BIT_WIDTH)) & STATUS_MASK; +#endif + + if ((status >> (SFP_CAN_HAS_DEBUGGER * STATUS_BIT_WIDTH)) & STATUS_SET) + can_has_debugger = (status >> (SFP_CAN_HAS_DEBUGGER * STATUS_BIT_WIDTH)) & STATUS_MASK; + + if ((status >> (SFP_EPHEMERAL_VOLUME * STATUS_BIT_WIDTH)) & STATUS_SET) + is_ephemeral = (status >> (SFP_EPHEMERAL_VOLUME * STATUS_BIT_WIDTH)) & STATUS_MASK; + +#if TARGET_OS_IPHONE + if ((status >> (SFP_INTERNAL_RELEASE_TYPE * STATUS_BIT_WIDTH)) & STATUS_SET) + internal_release_type = (status >> (SFP_INTERNAL_RELEASE_TYPE * STATUS_BIT_WIDTH)) & STATUS_MASK; + + if ((status >> (SFP_FACTORY_RELEASE_TYPE * STATUS_BIT_WIDTH)) & STATUS_SET) + factory_release_type = (status >> (SFP_FACTORY_RELEASE_TYPE * STATUS_BIT_WIDTH)) & STATUS_MASK; + + if ((status >> (SFP_DARWINOS_RELEASE_TYPE * STATUS_BIT_WIDTH)) & STATUS_SET) + darwin_release_type = (status >> (SFP_DARWINOS_RELEASE_TYPE * STATUS_BIT_WIDTH)) & STATUS_MASK; + + if ((status >> (SFP_RECOVERY_RELEASE_TYPE * STATUS_BIT_WIDTH)) & STATUS_SET) + recovery_release_type = (status >> (SFP_RECOVERY_RELEASE_TYPE * STATUS_BIT_WIDTH)) & STATUS_MASK; + + if ((status >> (SFP_DEVELOPMENT_KERNEL * STATUS_BIT_WIDTH)) & STATUS_SET) + development_kernel = (status >> (SFP_DEVELOPMENT_KERNEL * STATUS_BIT_WIDTH)) & STATUS_MASK; +#else + if ((status >> (SFP_INTERNAL_DIAGS_PROFILE * STATUS_BIT_WIDTH)) & STATUS_SET) + internal_diags_profile = (status >> (SFP_INTERNAL_DIAGS_PROFILE * STATUS_BIT_WIDTH)) & STATUS_MASK; + + if ((status >> (SFP_FACTORY_CONTENT * STATUS_BIT_WIDTH)) & STATUS_SET) + factory_content = (status >> (SFP_FACTORY_CONTENT * STATUS_BIT_WIDTH)) & STATUS_MASK; + + if ((status >> (SFP_BASE_SYSTEM_CONTENT * STATUS_BIT_WIDTH)) & STATUS_SET) + base_system_content = (status >> (SFP_BASE_SYSTEM_CONTENT * STATUS_BIT_WIDTH)) & STATUS_MASK; +#endif + + for (int i = 0; i < VP_MAX; i++) { + disabled_status[i] = (status >> (32 + i)) & 0x1; + } +} +#endif // !TARGET_OS_SIMULATOR diff --git a/locale/CMakeLists.txt b/locale/CMakeLists.txt new file mode 100644 index 0000000..2d62f01 --- /dev/null +++ b/locale/CMakeLists.txt @@ -0,0 +1,93 @@ +project(libc-locale) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") + +set(locale_sources + frune.c + isctype.c + iswctype.c + lconv.c + mbrune.c + runedepreciated.c + setinvalidrune.c + xlocale.c +) + +set(locale_sources ${locale_sources} + FreeBSD/ascii.c + FreeBSD/big5.c + FreeBSD/btowc.c + FreeBSD/collate.c + FreeBSD/collcmp.c + FreeBSD/euc.c + FreeBSD/fix_grouping.c + FreeBSD/gb18030.c + FreeBSD/gb2312.c + FreeBSD/gbk.c + FreeBSD/ldpart.c + FreeBSD/lmessages.c + FreeBSD/lmonetary.c + FreeBSD/lnumeric.c + FreeBSD/localeconv.c + FreeBSD/mblen.c + FreeBSD/mbrlen.c + FreeBSD/mbrtowc.c + FreeBSD/mbsinit.c + FreeBSD/mbsnrtowcs.c + FreeBSD/mbsrtowcs.c + FreeBSD/mbstowcs.c + FreeBSD/mbtowc.c + FreeBSD/mskanji.c + FreeBSD/nextwctype.c + FreeBSD/nl_langinfo.c + FreeBSD/nomacros.c + FreeBSD/none.c + FreeBSD/rune.c + FreeBSD/runetype.c + FreeBSD/setlocale.c + FreeBSD/setrunelocale.c + FreeBSD/table.c + FreeBSD/tolower.c + FreeBSD/toupper.c + FreeBSD/utf2.c + FreeBSD/utf8.c + FreeBSD/wcrtomb.c + FreeBSD/wcsftime.c + FreeBSD/wcsnrtombs.c + FreeBSD/wcsrtombs.c + FreeBSD/wcstod.c + FreeBSD/wcstof.c + FreeBSD/wcstoimax.c + FreeBSD/wcstol.c + FreeBSD/wcstold.c + FreeBSD/wcstoll.c + FreeBSD/wcstombs.c + FreeBSD/wcstoul.c + FreeBSD/wcstoull.c + FreeBSD/wcstoumax.c + FreeBSD/wctob.c + FreeBSD/wctomb.c + FreeBSD/wctrans.c + FreeBSD/wctype.c + FreeBSD/wcwidth.c +) +SET_SOURCE_FILES_PROPERTIES(FreeBSD/wcsftime.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_WCSFTIME -DLIBC_ALIAS_WCSFTIME_L") + +add_darling_object_library(libc-locale ${locale_sources}) + +# Legacy variant +if (TARGET_i386) + set(locale-legacy_sources + FreeBSD/wcsftime.c) + add_library(libc-locale_legacy OBJECT ${locale-legacy_sources}) + SET_TARGET_PROPERTIES(libc-locale_legacy PROPERTIES COMPILE_FLAGS + "-DBUILDING_VARIANT -DVARIANT_LEGACY -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0") +endif (TARGET_i386) + +if (NOT DARLING_NO_EXECUTABLES) + install(DIRECTORY locale DESTINATION libexec/darling/usr/share) +endif (NOT DARLING_NO_EXECUTABLES) + + diff --git a/locale/FreeBSD/ascii.c b/locale/FreeBSD/ascii.c new file mode 100644 index 0000000..4c910ea --- /dev/null +++ b/locale/FreeBSD/ascii.c @@ -0,0 +1,193 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +static size_t _ascii_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +static int _ascii_mbsinit(const mbstate_t *, locale_t); +static size_t _ascii_mbsnrtowcs(wchar_t * __restrict dst, + const char ** __restrict src, size_t nms, size_t len, + mbstate_t * __restrict ps __unused, locale_t); +static size_t _ascii_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); +static size_t _ascii_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict, locale_t); + +int +_ascii_init(struct __xlocale_st_runelocale *xrl) +{ + + xrl->__mbrtowc = _ascii_mbrtowc; + xrl->__mbsinit = _ascii_mbsinit; + xrl->__mbsnrtowcs = _ascii_mbsnrtowcs; + xrl->__wcrtomb = _ascii_wcrtomb; + xrl->__wcsnrtombs = _ascii_wcsnrtombs; + xrl->__mb_cur_max = 1; + xrl->__mb_sb_limit = 128; + return(0); +} + +static int +_ascii_mbsinit(const mbstate_t *ps __unused, locale_t loc __unused) +{ + + /* + * Encoding is not state dependent - we are always in the + * initial state. + */ + return (1); +} + +static size_t +_ascii_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps __unused, locale_t loc __unused) +{ + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (0); + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } + if (pwc != NULL) + *pwc = (unsigned char)*s; + return (*s == '\0' ? 0 : 1); +} + +static size_t +_ascii_wcrtomb(char * __restrict s, wchar_t wc, + mbstate_t * __restrict ps __unused, locale_t loc __unused) +{ + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + if (wc < 0 || wc > 127) { + errno = EILSEQ; + return ((size_t)-1); + } + *s = (unsigned char)wc; + return (1); +} + +static size_t +_ascii_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, + size_t nms, size_t len, mbstate_t * __restrict ps __unused, locale_t loc __unused) +{ + const char *s; + size_t nchr; + + if (dst == NULL) { + for (s = *src; nms > 0 && *s != '\0'; s++, nms--) { + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } + } + return (s - *src); + } + + s = *src; + nchr = 0; + while (len-- > 0 && nms-- > 0) { + if (*s & 0x80) { + *src = s; + errno = EILSEQ; + return ((size_t)-1); + } + if ((*dst++ = (unsigned char)*s++) == L'\0') { + *src = NULL; + return (nchr); + } + nchr++; + } + *src = s; + return (nchr); +} + +static size_t +_ascii_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, + size_t nwc, size_t len, mbstate_t * __restrict ps __unused, locale_t loc __unused) +{ + const wchar_t *s; + size_t nchr; + + if (dst == NULL) { + for (s = *src; nwc > 0 && *s != L'\0'; s++, nwc--) { + if (*s < 0 || *s > 127) { + errno = EILSEQ; + return ((size_t)-1); + } + } + return (s - *src); + } + + s = *src; + nchr = 0; + while (len-- > 0 && nwc-- > 0) { + if (*s < 0 || *s > 127) { + *src = s; + errno = EILSEQ; + return ((size_t)-1); + } + if ((*dst++ = *s++) == '\0') { + *src = NULL; + return (nchr); + } + nchr++; + } + *src = s; + return (nchr); +} + diff --git a/locale/FreeBSD/big5.5 b/locale/FreeBSD/big5.5 new file mode 100644 index 0000000..8319d9f --- /dev/null +++ b/locale/FreeBSD/big5.5 @@ -0,0 +1,51 @@ +.\" Copyright (c) 2002, 2003 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/big5.5,v 1.3 2004/07/05 06:36:36 ru Exp $ +.\" +.Dd August 7, 2003 +.Dt BIG5 5 +.Os +.Sh NAME +.Nm big5 +.Nd +.Dq "Big Five" +encoding for Traditional Chinese text +.Sh SYNOPSIS +.Nm ENCODING +.Qq BIG5 +.Sh DESCRIPTION +.Dq Big Five +is the de facto standard for encoding Traditional Chinese text. +Each character is represented by either one or two bytes. +Characters from the +.Tn ASCII +character set are represented as single bytes in the range 0x00 - 0x7F. +Traditional Chinese characters are represented by two bytes: +the first in the range 0xA1 - 0xFE, the second in the range +0x40 - 0xFE. +.Sh SEE ALSO +.Xr euc 5 , +.Xr gb18030 5 , +.Xr utf8 5 diff --git a/locale/FreeBSD/big5.c b/locale/FreeBSD/big5.c new file mode 100644 index 0000000..bb3daf0 --- /dev/null +++ b/locale/FreeBSD/big5.c @@ -0,0 +1,174 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)big5.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/big5.c,v 1.18 2007/10/13 16:28:21 ache Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +static size_t _BIG5_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +static int _BIG5_mbsinit(const mbstate_t *, locale_t); +static size_t _BIG5_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); + +typedef struct { + wchar_t ch; +} _BIG5State; + +int +_BIG5_init(struct __xlocale_st_runelocale *xrl) +{ + + xrl->__mbrtowc = _BIG5_mbrtowc; + xrl->__wcrtomb = _BIG5_wcrtomb; + xrl->__mbsinit = _BIG5_mbsinit; + xrl->__mb_cur_max = 2; + xrl->__mb_sb_limit = 128; + return (0); +} + +static int +_BIG5_mbsinit(const mbstate_t *ps, locale_t loc __unused) +{ + + return (ps == NULL || ((const _BIG5State *)ps)->ch == 0); +} + +static __inline int +_big5_check(u_int c) +{ + + c &= 0xff; + return ((c >= 0xa1 && c <= 0xfe) ? 2 : 1); +} + +static size_t +_BIG5_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps, locale_t loc __unused) +{ + _BIG5State *bs; + wchar_t wc; + size_t len; + + bs = (_BIG5State *)ps; + + if ((bs->ch & ~0xFF) != 0) { + /* Bad conversion state. */ + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) { + s = ""; + n = 1; + pwc = NULL; + } + + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + + if (bs->ch != 0) { + if (*s == '\0') { + errno = EILSEQ; + return ((size_t)-1); + } + wc = (bs->ch << 8) | (*s & 0xFF); + if (pwc != NULL) + *pwc = wc; + bs->ch = 0; + return (1); + } + + len = (size_t)_big5_check(*s); + wc = *s++ & 0xff; + if (len == 2) { + if (n < 2) { + /* Incomplete multibyte sequence */ + bs->ch = wc; + return ((size_t)-2); + } + if (*s == '\0') { + errno = EILSEQ; + return ((size_t)-1); + } + wc = (wc << 8) | (*s++ & 0xff); + if (pwc != NULL) + *pwc = wc; + return (2); + } else { + if (pwc != NULL) + *pwc = wc; + return (wc == L'\0' ? 0 : 1); + } +} + +static size_t +_BIG5_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc __unused) +{ + _BIG5State *bs; + + bs = (_BIG5State *)ps; + + if (bs->ch != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + if (wc & 0x8000) { + *s++ = (wc >> 8) & 0xff; + *s = wc & 0xff; + return (2); + } + *s = wc & 0xff; + return (1); +} diff --git a/locale/FreeBSD/btowc.3 b/locale/FreeBSD/btowc.3 new file mode 100644 index 0000000..39447a2 --- /dev/null +++ b/locale/FreeBSD/btowc.3 @@ -0,0 +1,117 @@ +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/btowc.3,v 1.2 2002/11/10 11:14:58 tjr Exp $ +.\" +.Dd August 3, 2002 +.Dt BTOWC 3 +.Os +.Sh NAME +.Nm btowc , +.Nm btowc_l , +.Nm wctob , +.Nm wctob_l +.Nd "convert between wide and single-byte characters" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft wint_t +.Fo btowc +.Fa "int c" +.Fc +.Ft int +.Fo wctob +.Fa "wint_t c" +.Fc +.In wchar.h +.In xlocale.h +.Ft wint_t +.Fo btowc_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo wctob_l +.Fa "wint_t c" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn btowc +function converts a single-byte character into a corresponding wide character. +If the character is +.Dv EOF +or not valid in the initial shift state, +.Fn btowc +returns +.Dv WEOF . +.Pp +The +.Fn wctob +function converts a wide character into a corresponding single-byte character. +If the wide character is +.Dv WEOF +or not able to be represented as a single byte in the initial shift state, +.Fn wctob +returns +.Dv WEOF . +.Pp +While the +.Fn btowc +and +.Fn wctob +functions use the current locale, the +.Fn btowc_l +and +.Fn wctob_l +functions may be passed locales directly. See +.Xr xlocale 3 +for more information. +.Sh LEGACY SYNOPSIS +.Pp +The include file +.In stdio.h +is not necessary for these functions. +.Sh SEE ALSO +.Xr mbrtowc 3 , +.Xr multibyte 3 , +.Xr wcrtomb 3 , +.Xr xlocale 3 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn btowc +and +.Fn wctob +functions conform to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn btowc +and +.Fn wctob +functions first appeared in +.Fx 5.0 . diff --git a/locale/FreeBSD/btowc.c b/locale/FreeBSD/btowc.c new file mode 100644 index 0000000..38122e7 --- /dev/null +++ b/locale/FreeBSD/btowc.c @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2002, 2003 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/btowc.c,v 1.4 2004/05/12 14:26:54 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include "mblocal.h" + +wint_t +btowc_l(int c, locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs = initial; + char cc; + wchar_t wc; + + NORMALIZE_LOCALE(loc); + if (c == EOF) + return (WEOF); + /* + * We expect mbrtowc() to return 0 or 1, hence the check for n > 1 + * which detects error return values as well as "impossible" byte + * counts. + */ + cc = (char)c; + if (loc->__lc_ctype->__mbrtowc(&wc, &cc, 1, &mbs, loc) > 1) + return (WEOF); + return (wc); +} + +wint_t +btowc(int c) +{ + return btowc_l(c, __current_locale()); +} diff --git a/locale/FreeBSD/collate.c b/locale/FreeBSD/collate.c new file mode 100644 index 0000000..028c182 --- /dev/null +++ b/locale/FreeBSD/collate.c @@ -0,0 +1,1008 @@ +/*- + * Copyright (c) 1995 Alex Tatmanjants + * at Electronni Visti IA, Kiev, Ukraine. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/collate.c,v 1.35 2005/02/27 20:31:13 ru Exp $"); + +#include "xlocale_private.h" +/* assumes the locale_t variable is named loc */ +#define __collate_chain_equiv_table (loc->__lc_collate->__chain_equiv_table) +#define __collate_chain_pri_table (loc->__lc_collate->__chain_pri_table) +#define __collate_char_pri_table (loc->__lc_collate->__char_pri_table) +#define __collate_info (&loc->__lc_collate->__info) +#define __collate_large_char_pri_table (loc->__lc_collate->__large_char_pri_table) +#define __collate_substitute_table (loc->__lc_collate->__substitute_table) + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "collate.h" +#include "setlocale.h" +#include "ldpart.h" + +#include "libc_private.h" + +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN +static void wntohl(wchar_t *, int); +#endif /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ +void __collate_err(int ex, const char *f) __dead2; + +/* + * Normally, the __collate_* routines should all be __private_extern__, + * but grep is using them (3715846). Until we can provide an alternative, + * we leave them public, and provide a read-only __collate_load_error variable + */ +#undef __collate_load_error +int __collate_load_error = 1; + +__private_extern__ int +__collate_load_tables(const char *encoding, locale_t loc) +{ + int fd; + FILE *fp; + int i, saverr, chains, z; + char strbuf[STR_LEN], buf[PATH_MAX]; + struct __xlocale_st_collate *TMP; + static struct __xlocale_st_collate *cache = NULL; + struct __collate_st_info info; + void *vp; + + /* 'encoding' must be already checked. */ + if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) { + loc->__collate_load_error = 1; + if (loc == &__global_locale) + __collate_load_error = 1; + XL_RELEASE(loc->__lc_collate); + loc->__lc_collate = NULL; + return (_LDP_CACHE); + } + + /* + * If the locale name is the same as our cache, use the cache. + */ + if (cache && strcmp(encoding, cache->__encoding) == 0) { + loc->__collate_load_error = 0; + if (loc == &__global_locale) + __collate_load_error = 0; + XL_RELEASE(loc->__lc_collate); + loc->__lc_collate = cache; + XL_RETAIN(loc->__lc_collate); + return (_LDP_CACHE); + } + + /* + * Slurp the locale file into the cache. + */ + + /* 'PathLocale' must be already set & checked. */ + /* Range checking not needed, encoding has fixed size */ + (void)strcpy(buf, encoding); + (void)strcat(buf, "/LC_COLLATE"); + fd = __open_path_locale(buf); + if (fd == -1) { + return (_LDP_ERROR); + } + if ((fp = fdopen(fd, "r")) == NULL) { + close(fd); + return (_LDP_ERROR); + } + + if (fread(strbuf, sizeof(strbuf), 1, fp) != 1) { + saverr = errno; + (void)fclose(fp); + errno = saverr; + return (_LDP_ERROR); + } + chains = -1; + if (strcmp(strbuf, COLLATE_VERSION1_1A) == 0) + chains = 1; + if (chains < 0) { + (void)fclose(fp); + errno = EFTYPE; + return (_LDP_ERROR); + } + if (chains) { + if (fread(&info, sizeof(info), 1, fp) != 1) { + saverr = errno; + (void)fclose(fp); + errno = saverr; + return (_LDP_ERROR); + } +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + for(z = 0; z < info.directive_count; z++) { + info.undef_pri[z] = ntohl(info.undef_pri[z]); + info.subst_count[z] = ntohl(info.subst_count[z]); + } + info.chain_count = ntohl(info.chain_count); + info.large_pri_count = ntohl(info.large_pri_count); +#endif /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + if ((chains = info.chain_count) < 0) { + (void)fclose(fp); + errno = EFTYPE; + return (_LDP_ERROR); + } + } else + chains = TABLE_SIZE; + + i = sizeof(struct __xlocale_st_collate) + + sizeof(struct __collate_st_chain_pri) * chains + + sizeof(struct __collate_st_large_char_pri) * info.large_pri_count; + for(z = 0; z < info.directive_count; z++) + i += sizeof(struct __collate_st_subst) * info.subst_count[z]; + if ((TMP = (struct __xlocale_st_collate *)malloc(i)) == NULL) { + saverr = errno; + (void)fclose(fp); + errno = saverr; + return (_LDP_ERROR); + } + TMP->__refcount = 2; /* one for the locale, one for the cache */ + TMP->__free_extra = NULL; + +#define FREAD(a, b, c, d) \ +{ \ + if (fread(a, b, c, d) != c) { \ + saverr = errno; \ + free(TMP); \ + (void)fclose(d); \ + errno = saverr; \ + return (_LDP_ERROR); \ + } \ +} + + /* adjust size to read the remaining in one chunk */ + i -= offsetof(struct __xlocale_st_collate, __char_pri_table); + FREAD(TMP->__char_pri_table, i, 1, fp); + (void)fclose(fp); + + vp = (void *)(TMP + 1); + + /* the COLLATE_SUBST_DUP optimization relies on COLL_WEIGHTS_MAX == 2 */ + if (info.subst_count[0] > 0) { + TMP->__substitute_table[0] = (struct __collate_st_subst *)vp; + vp += info.subst_count[0] * sizeof(struct __collate_st_subst); + } else + TMP->__substitute_table[0] = NULL; + if (info.flags & COLLATE_SUBST_DUP) + TMP->__substitute_table[1] = TMP->__substitute_table[0]; + else if (info.subst_count[1] > 0) { + TMP->__substitute_table[1] = (struct __collate_st_subst *)vp; + vp += info.subst_count[1] * sizeof(struct __collate_st_subst); + } else + TMP->__substitute_table[1] = NULL; + + if (chains > 0) { + TMP->__chain_pri_table = (struct __collate_st_chain_pri *)vp; + vp += chains * sizeof(struct __collate_st_chain_pri); + } else + TMP->__chain_pri_table = NULL; + if (info.large_pri_count > 0) + TMP->__large_char_pri_table = (struct __collate_st_large_char_pri *)vp; + else + TMP->__large_char_pri_table = NULL; + +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + { + struct __collate_st_char_pri *p = TMP->__char_pri_table; + for(i = UCHAR_MAX + 1; i-- > 0; p++) { + for(z = 0; z < info.directive_count; z++) + p->pri[z] = ntohl(p->pri[z]); + } + } + for(z = 0; z < info.directive_count; z++) + if (info.subst_count[z] > 0) { + struct __collate_st_subst *p = TMP->__substitute_table[z]; + for(i = info.subst_count[z]; i-- > 0; p++) { + p->val = ntohl(p->val); + wntohl(p->str, STR_LEN); + } + } + { + struct __collate_st_chain_pri *p = TMP->__chain_pri_table; + for(i = chains; i-- > 0; p++) { + wntohl(p->str, STR_LEN); + for(z = 0; z < info.directive_count; z++) + p->pri[z] = ntohl(p->pri[z]); + } + } + if (info.large_pri_count > 0) { + struct __collate_st_large_char_pri *p = TMP->__large_char_pri_table; + for(i = info.large_pri_count; i-- > 0; p++) { + p->val = ntohl(p->val); + for(z = 0; z < info.directive_count; z++) + p->pri.pri[z] = ntohl(p->pri.pri[z]); + } + } +#endif /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + (void)strcpy(TMP->__encoding, encoding); + (void)memcpy(&TMP->__info, &info, sizeof(info)); + XL_RELEASE(cache); + cache = TMP; + XL_RELEASE(loc->__lc_collate); + loc->__lc_collate = cache; + /* no need to retain, since we set __refcount to 2 above */ + + loc->__collate_substitute_nontrivial = (info.subst_count[0] > 0 || info.subst_count[1] > 0); + loc->__collate_load_error = 0; + if (loc == &__global_locale) + __collate_load_error = 0; + + return (_LDP_LOADED); +} + +static int +__collate_wcsnlen(const wchar_t *s, int len) +{ + int n = 0; + while (*s && n < len) { + s++; + n++; + } + return n; +} + +static struct __collate_st_subst * +substsearch(const wchar_t key, struct __collate_st_subst *tab, int n) +{ + int low = 0; + int high = n - 1; + int next, compar; + struct __collate_st_subst *p; + + while (low <= high) { + next = (low + high) / 2; + p = tab + next; + compar = key - p->val; + if (compar == 0) + return p; + if (compar > 0) + low = next + 1; + else + high = next - 1; + } + return NULL; +} + +__private_extern__ wchar_t * +__collate_substitute(const wchar_t *s, int which, locale_t loc) +{ + int dest_len, len, nlen; + int n, delta, nsubst; + wchar_t *dest_str = NULL; + const wchar_t *fp; + struct __collate_st_subst *subst, *match; + + if (s == NULL || *s == '\0') + return (__collate_wcsdup(L"")); + dest_len = wcslen(s); + nsubst = __collate_info->subst_count[which]; + if (nsubst <= 0) + return __collate_wcsdup(s); + subst = __collate_substitute_table[which]; + delta = dest_len / 4; + if (delta < 2) + delta = 2; + dest_str = (wchar_t *)malloc((dest_len += delta) * sizeof(wchar_t)); + if (dest_str == NULL) + __collate_err(EX_OSERR, __func__); + len = 0; + while (*s) { + if ((match = substsearch(*s, subst, nsubst)) != NULL) { + fp = match->str; + n = __collate_wcsnlen(fp, STR_LEN); + } else { + fp = s; + n = 1; + } + nlen = len + n; + if (dest_len <= nlen) { + dest_str = reallocf(dest_str, (dest_len = nlen + delta) * sizeof(wchar_t)); + if (dest_str == NULL) + __collate_err(EX_OSERR, __func__); + } + wcsncpy(dest_str + len, fp, n); + len += n; + s++; + } + dest_str[len] = 0; + return (dest_str); +} + +static struct __collate_st_chain_pri * +chainsearch(const wchar_t *key, int *len, locale_t loc) +{ + int low = 0; + int high = __collate_info->chain_count - 1; + int next, compar, l; + struct __collate_st_chain_pri *p; + struct __collate_st_chain_pri *tab = __collate_chain_pri_table; + + while (low <= high) { + next = (low + high) / 2; + p = tab + next; + compar = *key - *p->str; + if (compar == 0) { + l = __collate_wcsnlen(p->str, STR_LEN); + compar = wcsncmp(key, p->str, l); + if (compar == 0) { + *len = l; + return p; + } + } + if (compar > 0) + low = next + 1; + else + high = next - 1; + } + return NULL; +} + +static struct __collate_st_large_char_pri * +largesearch(const wchar_t key, locale_t loc) +{ + int low = 0; + int high = __collate_info->large_pri_count - 1; + int next, compar; + struct __collate_st_large_char_pri *p; + struct __collate_st_large_char_pri *tab = __collate_large_char_pri_table; + + while (low <= high) { + next = (low + high) / 2; + p = tab + next; + compar = key - p->val; + if (compar == 0) + return p; + if (compar > 0) + low = next + 1; + else + high = next - 1; + } + return NULL; +} + +__private_extern__ void +__collate_lookup_l(const wchar_t *t, int *len, int *prim, int *sec, locale_t loc) +{ + struct __collate_st_chain_pri *p2; + int l; + + *len = 1; + *prim = *sec = 0; + p2 = chainsearch(t, &l, loc); + /* use the chain if prim >= 0 */ + if (p2 && p2->pri[0] >= 0) { + *len = l; + *prim = p2->pri[0]; + *sec = p2->pri[1]; + return; + } + if (*t <= UCHAR_MAX) { + *prim = __collate_char_pri_table[*t].pri[0]; + *sec = __collate_char_pri_table[*t].pri[1]; + return; + } + if (__collate_info->large_pri_count > 0) { + struct __collate_st_large_char_pri *match; + match = largesearch(*t, loc); + if (match) { + *prim = match->pri.pri[0]; + *sec = match->pri.pri[1]; + return; + } + } + *prim = (l = __collate_info->undef_pri[0]) >= 0 ? l : *t - l; + *sec = (l = __collate_info->undef_pri[1]) >= 0 ? l : *t - l; +} + +/* + * This is only provided for programs (like grep) that are calling this + * private function. This will go away eventually. + */ +void +__collate_lookup(const unsigned char *t, int *len, int *prim, int *sec) +{ + locale_t loc = __current_locale(); + wchar_t *w = __collate_mbstowcs((const char *)t, loc); + int sverrno; + + __collate_lookup_l(w, len, prim, sec, loc); + sverrno = errno; + free(w); + errno = sverrno; +} + +__private_extern__ void +__collate_lookup_which(const wchar_t *t, int *len, int *pri, int which, locale_t loc) +{ + struct __collate_st_chain_pri *p2; + int p, l; + + *len = 1; + *pri = 0; + p2 = chainsearch(t, &l, loc); + if (p2) { + p = p2->pri[which]; + /* use the chain if pri >= 0 */ + if (p >= 0) { + *len = l; + *pri = p; + return; + } + } + if (*t <= UCHAR_MAX) { + *pri = __collate_char_pri_table[*t].pri[which]; + return; + } + if (__collate_info->large_pri_count > 0) { + struct __collate_st_large_char_pri *match; + match = largesearch(*t, loc); + if (match) { + *pri = match->pri.pri[which]; + return; + } + } + *pri = (l = __collate_info->undef_pri[which]) >= 0 ? l : *t - l; +} + +__private_extern__ wchar_t * +__collate_mbstowcs(const char *s, locale_t loc) +{ + static const mbstate_t initial; + mbstate_t st; + size_t len; + const char *ss; + wchar_t *wcs; + + ss = s; + st = initial; + if ((len = mbsrtowcs_l(NULL, &ss, 0, &st, loc)) == (size_t)-1) + return NULL; + if ((wcs = (wchar_t *)malloc((len + 1) * sizeof(wchar_t))) == NULL) + __collate_err(EX_OSERR, __func__); + st = initial; + mbsrtowcs_l(wcs, &s, len, &st, loc); + wcs[len] = 0; + + return (wcs); +} + +__private_extern__ wchar_t * +__collate_wcsdup(const wchar_t *s) +{ + size_t len = wcslen(s) + 1; + wchar_t *wcs; + + if ((wcs = (wchar_t *)malloc(len * sizeof(wchar_t))) == NULL) + __collate_err(EX_OSERR, __func__); + wcscpy(wcs, s); + return (wcs); +} + +__private_extern__ void +__collate_xfrm(const wchar_t *src, wchar_t **xf, locale_t loc) +{ + int pri, len; + size_t slen; + const wchar_t *t; + wchar_t *tt = NULL, *tr = NULL; + int direc, pass; + wchar_t *xfp; + struct __collate_st_info *info = __collate_info; + int sverrno; + + for(pass = 0; pass < COLL_WEIGHTS_MAX; pass++) + xf[pass] = NULL; + for(pass = 0; pass < info->directive_count; pass++) { + direc = info->directive[pass]; + if (pass == 0 || !(info->flags & COLLATE_SUBST_DUP)) { + sverrno = errno; + free(tt); + errno = sverrno; + tt = __collate_substitute(src, pass, loc); + } + if (direc & DIRECTIVE_BACKWARD) { + wchar_t *bp, *fp, c; + sverrno = errno; + free(tr); + errno = sverrno; + tr = __collate_wcsdup(tt ? tt : src); + bp = tr; + fp = tr + wcslen(tr) - 1; + while(bp < fp) { + c = *bp; + *bp++ = *fp; + *fp-- = c; + } + t = (const wchar_t *)tr; + } else if (tt) + t = (const wchar_t *)tt; + else + t = (const wchar_t *)src; + sverrno = errno; + if ((xf[pass] = (wchar_t *)malloc(sizeof(wchar_t) * (wcslen(t) + 1))) == NULL) { + errno = sverrno; + slen = 0; + goto end; + } + errno = sverrno; + xfp = xf[pass]; + if (direc & DIRECTIVE_POSITION) { + while(*t) { + __collate_lookup_which(t, &len, &pri, pass, loc); + t += len; + if (pri <= 0) { + if (pri < 0) { + errno = EINVAL; + slen = 0; + goto end; + } + pri = COLLATE_MAX_PRIORITY; + } + *xfp++ = pri; + } + } else { + while(*t) { + __collate_lookup_which(t, &len, &pri, pass, loc); + t += len; + if (pri <= 0) { + if (pri < 0) { + errno = EINVAL; + slen = 0; + goto end; + } + continue; + } + *xfp++ = pri; + } + } + *xfp = 0; + } + end: + sverrno = errno; + free(tt); + free(tr); + errno = sverrno; +} + +__private_extern__ void +__collate_err(int ex, const char *f) +{ + const char *s; + int serrno = errno; + + s = _getprogname(); + _write(STDERR_FILENO, s, strlen(s)); + _write(STDERR_FILENO, ": ", 2); + s = f; + _write(STDERR_FILENO, s, strlen(s)); + _write(STDERR_FILENO, ": ", 2); + s = strerror(serrno); + _write(STDERR_FILENO, s, strlen(s)); + _write(STDERR_FILENO, "\n", 1); + exit(ex); +} + +/* + * __collate_collating_symbol takes the multibyte string specified by + * src and slen, and using ps, converts that to a wide character. Then + * it is checked to verify it is a collating symbol, and then copies + * it to the wide character string specified by dst and dlen (the + * results are not null terminated). The length of the wide characters + * copied to dst is returned if successful. Zero is returned if no such + * collating symbol exists. (size_t)-1 is returned if there are wide-character + * conversion errors, if the length of the converted string is greater that + * STR_LEN or if dlen is too small. It is up to the calling routine to + * preserve the mbstate_t structure as needed. + */ +__private_extern__ size_t +__collate_collating_symbol(wchar_t *dst, size_t dlen, const char *src, size_t slen, mbstate_t *ps, locale_t loc) +{ + wchar_t wname[STR_LEN]; + wchar_t w, *wp; + size_t len, l; + + /* POSIX locale */ + if (loc->__collate_load_error) { + if (dlen < 1) + return (size_t)-1; + if (slen != 1 || !isascii(*src)) + return 0; + *dst = *src; + return 1; + } + for(wp = wname, len = 0; slen > 0; len++) { + l = mbrtowc_l(&w, src, slen, ps, loc); + if (l == (size_t)-1 || l == (size_t)-2) + return (size_t)-1; + if (l == 0) + break; + if (len >= STR_LEN) + return -1; + *wp++ = w; + src += l; + slen = (long)slen - (long)l; + } + if (len == 0 || len > dlen) + return (size_t)-1; + if (len == 1) { + if (*wname <= UCHAR_MAX) { + if (__collate_char_pri_table[*wname].pri[0] >= 0) { + if (dlen > 0) + *dst = *wname; + return 1; + } + return 0; + } else if (__collate_info->large_pri_count > 0) { + struct __collate_st_large_char_pri *match; + match = largesearch(*wname, loc); + if (match && match->pri.pri[0] >= 0) { + if (dlen > 0) + *dst = *wname; + return 1; + } + } + return 0; + } + *wp = 0; + if (__collate_info->chain_count > 0) { + struct __collate_st_chain_pri *match; + int ll; + match = chainsearch(wname, &ll, loc); + if (match) { + if (ll < dlen) + dlen = ll; + wcsncpy(dst, wname, dlen); + return ll; + } + } + return 0; +} + +/* + * __collate_equiv_class returns the equivalence class number for the symbol + * specified by src and slen, using ps to convert from multi-byte to wide + * character. Zero is returned if the symbol is not in an equivalence + * class. -1 is returned if there are wide character conversion error, + * if there are any greater-than-8-bit characters or if a multi-byte symbol + * is greater or equal to STR_LEN in length. It is up to the calling + * routine to preserve the mbstate_t structure as needed. + */ +__private_extern__ int +__collate_equiv_class(const char *src, size_t slen, mbstate_t *ps, locale_t loc) +{ + wchar_t wname[STR_LEN]; + wchar_t w, *wp; + size_t len, l; + int e; + + /* POSIX locale */ + if (loc->__collate_load_error) + return 0; + for(wp = wname, len = 0; slen > 0; len++) { + l = mbrtowc_l(&w, src, slen, ps, loc); + if (l == (size_t)-1 || l == (size_t)-2) + return -1; + if (l == 0) + break; + if (len >= STR_LEN) + return -1; + *wp++ = w; + src += l; + slen = (long)slen - (long)l; + } + if (len == 0) + return -1; + if (len == 1) { + e = -1; + if (*wname <= UCHAR_MAX) + e = __collate_char_pri_table[*wname].pri[0]; + else if (__collate_info->large_pri_count > 0) { + struct __collate_st_large_char_pri *match; + match = largesearch(*wname, loc); + if (match) + e = match->pri.pri[0]; + } + if (e == 0) + return IGNORE_EQUIV_CLASS; + return e > 0 ? e : 0; + } + *wp = 0; + if (__collate_info->chain_count > 0) { + struct __collate_st_chain_pri *match; + int ll; + match = chainsearch(wname, &ll, loc); + if (match) { + e = match->pri[0]; + if (e == 0) + return IGNORE_EQUIV_CLASS; + return e < 0 ? -e : e; + } + } + return 0; +} + +/* + * __collate_equiv_match tries to match any single or multi-character symbol + * in equivalence class equiv_class in the multi-byte string specified by src + * and slen. If start is non-zero, it is taken to be the first (pre-converted) + * wide character. Subsequence wide characters, if needed, will use ps in + * the conversion. On a successful match, the length of the matched string + * is returned (including the start character). If dst is non-NULL, the + * matched wide-character string is copied to dst, a wide character array of + * length dlen (the results are not zero-terminated). If rlen is non-NULL, + * the number of character in src actually used is returned. Zero is + * returned by __collate_equiv_match if there is no match. (size_t)-1 is + * returned on error: if there were conversion errors or if dlen is too small + * to accept the results. On no match or error, ps is restored to its incoming + * state. + */ +size_t +__collate_equiv_match(int equiv_class, wchar_t *dst, size_t dlen, wchar_t start, const char *src, size_t slen, mbstate_t *ps, size_t *rlen, locale_t loc) +{ + wchar_t w; + size_t len, l, clen; + int i; + wchar_t buf[STR_LEN], *wp; + mbstate_t save; + const char *s = src; + size_t sl = slen; + struct __collate_st_chain_pri *ch = NULL; + + /* POSIX locale */ + if (loc->__collate_load_error) + return (size_t)-1; + if (equiv_class == IGNORE_EQUIV_CLASS) + equiv_class = 0; + if (ps) + save = *ps; + wp = buf; + len = clen = 0; + if (start) { + *wp++ = start; + len = 1; + } + /* convert up to the max chain length */ + while(sl > 0 && len < __collate_info->chain_max_len) { + l = mbrtowc_l(&w, s, sl, ps, loc); + if (l == (size_t)-1 || l == (size_t)-2 || l == 0) + break; + *wp++ = w; + s += l; + clen += l; + sl -= l; + len++; + } + *wp = 0; + if (len > 1 && (ch = chainsearch(buf, &i, loc)) != NULL) { + int e = ch->pri[0]; + if (e < 0) + e = -e; + if (e == equiv_class) + goto found; + } + /* try single character */ + i = 1; + if (*buf <= UCHAR_MAX) { + if (equiv_class == __collate_char_pri_table[*buf].pri[0]) + goto found; + } else if (__collate_info->large_pri_count > 0) { + struct __collate_st_large_char_pri *match; + match = largesearch(*buf, loc); + if (match && equiv_class == match->pri.pri[0]) + goto found; + } + /* no match */ + if (ps) + *ps = save; + return 0; +found: + /* if we converted more than we used, restore to initial and reconvert + * up to what did match */ + if (i < len) { + len = i; + if (ps) + *ps = save; + if (start) + i--; + clen = 0; + while(i-- > 0) { + l = mbrtowc_l(&w, src, slen, ps, loc); + src += l; + clen += l; + slen -= l; + } + } + if (dst) { + if (dlen < len) { + if (ps) + *ps = save; + return (size_t)-1; + } + for(wp = buf; len > 0; len--) + *dst++ = *wp++; + } + if (rlen) + *rlen = clen; + return len; +} + +/* + * __collate_equiv_value returns the primary collation value for the given + * collating symbol specified by str and len. Zero or negative is return + * if the collating symbol was not found. (Use by the bracket code in TRE.) + */ +__private_extern__ int +__collate_equiv_value(locale_t loc, const wchar_t *str, size_t len) +{ + int e; + + if (len < 1 || len >= STR_LEN) + return -1; + + /* POSIX locale */ + if (loc->__collate_load_error) + return (len == 1 && *str <= UCHAR_MAX) ? *str : -1; + + if (len == 1) { + e = -1; + if (*str <= UCHAR_MAX) + e = __collate_char_pri_table[*str].pri[0]; + else if (__collate_info->large_pri_count > 0) { + struct __collate_st_large_char_pri *match; + match = largesearch(*str, loc); + if (match) + e = match->pri.pri[0]; + } + if (e == 0) + return IGNORE_EQUIV_CLASS; + return e > 0 ? e : 0; + } + if (__collate_info->chain_count > 0) { + wchar_t name[STR_LEN]; + struct __collate_st_chain_pri *match; + int ll; + + wcsncpy(name, str, len); + name[len] = 0; + match = chainsearch(name, &ll, loc); + if (match) { + e = match->pri[0]; + if (e == 0) + return IGNORE_EQUIV_CLASS; + return e < 0 ? -e : e; + } + } + return 0; +} + +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN +static void +wntohl(wchar_t *str, int len) +{ + for(; *str && len > 0; str++, len--) + *str = ntohl(*str); +} +#endif /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + +#ifdef COLLATE_DEBUG +static char * +show(int c) +{ + static char buf[5]; + + if (c >=32 && c <= 126) + sprintf(buf, "'%c' ", c); + else + sprintf(buf, "\\x{%02x}", c); + return buf; +} + +static char * +showwcs(const wchar_t *t, int len) +{ + static char buf[64]; + char *cp = buf; + + for(; *t && len > 0; len--, t++) { + if (*t >=32 && *t <= 126) + *cp++ = *t; + else { + sprintf(cp, "\\x{%02x}", *t); + cp += strlen(cp); + } + } + *cp = 0; + return buf; +} + +void +__collate_print_tables() +{ + int i, z; + locale_t loc = __current_locale(); + + printf("Info: p=%d s=%d f=0x%02x m=%d dc=%d up=%d us=%d pc=%d sc=%d cc=%d lc=%d\n", + __collate_info->directive[0], __collate_info->directive[1], + __collate_info->flags, __collate_info->chain_max_len, + __collate_info->directive_count, + __collate_info->undef_pri[0], __collate_info->undef_pri[1], + __collate_info->subst_count[0], __collate_info->subst_count[1], + __collate_info->chain_count, __collate_info->large_pri_count); + for(z = 0; z < __collate_info->directive_count; z++) { + if (__collate_info->subst_count[z] > 0) { + struct __collate_st_subst *p2 = __collate_substitute_table[z]; + if (z == 0 && (__collate_info->flags & COLLATE_SUBST_DUP)) + printf("Both substitute tables:\n"); + else + printf("Substitute table %d:\n", z); + for (i = __collate_info->subst_count[z]; i-- > 0; p2++) + printf("\t%s --> \"%s\"\n", + show(p2->val), + showwcs(p2->str, STR_LEN)); + } + } + if (__collate_info->chain_count > 0) { + printf("Chain priority table:\n"); + struct __collate_st_chain_pri *p2 = __collate_chain_pri_table; + for (i = __collate_info->chain_count; i-- > 0; p2++) { + printf("\t\"%s\" :", showwcs(p2->str, STR_LEN)); + for(z = 0; z < __collate_info->directive_count; z++) + printf(" %d", p2->pri[z]); + putchar('\n'); + } + } + printf("Char priority table:\n"); + { + struct __collate_st_char_pri *p2 = __collate_char_pri_table; + for (i = 0; i < UCHAR_MAX + 1; i++, p2++) { + printf("\t%s :", show(i)); + for(z = 0; z < __collate_info->directive_count; z++) + printf(" %d", p2->pri[z]); + putchar('\n'); + } + } + if (__collate_info->large_pri_count > 0) { + struct __collate_st_large_char_pri *p2 = __collate_large_char_pri_table; + printf("Large priority table:\n"); + for (i = __collate_info->large_pri_count; i-- > 0; p2++) { + printf("\t%s :", show(p2->val)); + for(z = 0; z < __collate_info->directive_count; z++) + printf(" %d", p2->pri.pri[z]); + putchar('\n'); + } + } +} +#endif diff --git a/locale/FreeBSD/collate.h b/locale/FreeBSD/collate.h new file mode 100644 index 0000000..f50baba --- /dev/null +++ b/locale/FreeBSD/collate.h @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 1995 Alex Tatmanjants + * at Electronni Visti IA, Kiev, Ukraine. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/locale/collate.h,v 1.15 2005/02/27 20:31:13 ru Exp $ + */ + +#ifndef _COLLATE_H_ +#define _COLLATE_H_ + +#include +#ifndef __LIBC__ +#include +#endif /* !__LIBC__ */ +#include + +#define STR_LEN 10 +#define TABLE_SIZE 100 +#define COLLATE_VERSION "1.0\n" +#define COLLATE_VERSION1_1 "1.1\n" +#define COLLATE_VERSION1_1A "1.1A\n" +#define COLLATE_VERSION1_2 "1.2\n" + +/* see discussion in string/FreeBSD/strxfrm for this value */ +#define COLLATE_MAX_PRIORITY ((1 << 24) - 1) + +#define DIRECTIVE_UNDEF 0x00 +#define DIRECTIVE_FORWARD 0x01 +#define DIRECTIVE_BACKWARD 0x02 +#define DIRECTIVE_POSITION 0x04 + +#define DIRECTIVE_DIRECTION_MASK (DIRECTIVE_FORWARD | DIRECTIVE_BACKWARD) + +#define COLLATE_SUBST_DUP 0x0001 + +#define IGNORE_EQUIV_CLASS 1 + +struct __collate_st_info { + __uint8_t directive[COLL_WEIGHTS_MAX]; + __uint8_t flags; +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + __uint8_t directive_count:4; + __uint8_t chain_max_len:4; +#else + __uint8_t chain_max_len:4; + __uint8_t directive_count:4; +#endif + __int32_t undef_pri[COLL_WEIGHTS_MAX]; + __int32_t subst_count[COLL_WEIGHTS_MAX]; + __int32_t chain_count; + __int32_t large_pri_count; +}; + +struct __collate_st_char_pri { + __int32_t pri[COLL_WEIGHTS_MAX]; +}; +struct __collate_st_chain_pri { + __darwin_wchar_t str[STR_LEN]; + __int32_t pri[COLL_WEIGHTS_MAX]; +}; +struct __collate_st_large_char_pri { + __int32_t val; + struct __collate_st_char_pri pri; +}; +struct __collate_st_subst { + __int32_t val; + __darwin_wchar_t str[STR_LEN]; +}; + +#ifndef __LIBC__ +extern int __collate_load_error; +extern int __collate_substitute_nontrivial; +#define __collate_char_pri_table (*__collate_char_pri_table_ptr) +extern struct __collate_st_char_pri __collate_char_pri_table[UCHAR_MAX + 1]; +extern struct __collate_st_chain_pri *__collate_chain_pri_table; +extern __int32_t *__collate_chain_equiv_table; +extern struct __collate_st_info __collate_info; +#endif /* !__LIBC__ */ + +__BEGIN_DECLS +#ifdef __LIBC__ +__darwin_wchar_t *__collate_mbstowcs(const char *, locale_t); +__darwin_wchar_t *__collate_wcsdup(const __darwin_wchar_t *); +__darwin_wchar_t *__collate_substitute(const __darwin_wchar_t *, int, locale_t); +int __collate_load_tables(const char *, locale_t); +void __collate_lookup_l(const __darwin_wchar_t *, int *, int *, int *, locale_t); +void __collate_lookup_which(const __darwin_wchar_t *, int *, int *, int, locale_t); +void __collate_xfrm(const __darwin_wchar_t *, __darwin_wchar_t **, locale_t); +int __collate_range_cmp(__darwin_wchar_t, __darwin_wchar_t, locale_t); +size_t __collate_collating_symbol(__darwin_wchar_t *, size_t, const char *, size_t, __darwin_mbstate_t *, locale_t); +int __collate_equiv_class(const char *, size_t, __darwin_mbstate_t *, locale_t); +size_t __collate_equiv_match(int, __darwin_wchar_t *, size_t, __darwin_wchar_t, const char *, size_t, __darwin_mbstate_t *, size_t *, locale_t); +#else /* !__LIBC__ */ +void __collate_lookup(const unsigned char *, int *, int *, int *); +#endif /* __LIBC__ */ +#ifdef COLLATE_DEBUG +void __collate_print_tables(void); +#endif +__END_DECLS + +#endif /* !_COLLATE_H_ */ diff --git a/locale/FreeBSD/collcmp.c b/locale/FreeBSD/collcmp.c new file mode 100644 index 0000000..7f135bc --- /dev/null +++ b/locale/FreeBSD/collcmp.c @@ -0,0 +1,46 @@ +/* + * Copyright (C) 1996 by Andrey A. Chernov, Moscow, Russia. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/collcmp.c,v 1.18 2005/02/27 14:54:23 phantom Exp $"); + +#include +#include +#include "collate.h" + +/* + * Compare two characters using collate + */ + +__private_extern__ int +__collate_range_cmp(wchar_t c1, wchar_t c2, locale_t loc) +{ + static wchar_t s1[2], s2[2]; + + s1[0] = c1; + s2[0] = c2; + return (wcscoll_l(s1, s2, loc)); +} diff --git a/locale/FreeBSD/ctype.3 b/locale/FreeBSD/ctype.3 new file mode 100644 index 0000000..aa91313 --- /dev/null +++ b/locale/FreeBSD/ctype.3 @@ -0,0 +1,158 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ctype.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/ctype.3,v 1.18 2009/09/04 07:44:58 des Exp $ +.\" +.Dd March 30, 2004 +.Dt CTYPE 3 +.Os +.Sh NAME +.Nm digittoint , +.Nm isalnum , +.Nm isalpha , +.Nm isascii , +.Nm isblank , +.Nm iscntrl , +.Nm isdigit , +.Nm isgraph , +.Nm ishexnumber , +.Nm isideogram , +.Nm islower , +.Nm isnumber , +.Nm isphonogram , +.Nm isprint , +.Nm ispunct , +.Nm isrune , +.Nm isspace , +.Nm isspecial , +.Nm isupper , +.Nm isxdigit , +.Nm toascii , +.Nm tolower , +.Nm toupper +.Nd character classification macros +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn digittoint "int c" +.Ft int +.Fn isalnum "int c" +.Ft int +.Fn isalpha "int c" +.Ft int +.Fn isascii "int c" +.Ft int +.Fn iscntrl "int c" +.Ft int +.Fn isdigit "int c" +.Ft int +.Fn isgraph "int c" +.Ft int +.Fn ishexnumber "int c" +.Ft int +.Fn isideogram "int c" +.Ft int +.Fn islower "int c" +.Ft int +.Fn isnumber "int c" +.Ft int +.Fn isphonogram "int c" +.Ft int +.Fn isspecial "int c" +.Ft int +.Fn isprint "int c" +.Ft int +.Fn ispunct "int c" +.Ft int +.Fn isrune "int c" +.Ft int +.Fn isspace "int c" +.Ft int +.Fn isupper "int c" +.Ft int +.Fn isxdigit "int c" +.Ft int +.Fn toascii "int c" +.Ft int +.Fn tolower "int c" +.Ft int +.Fn toupper "int c" +.Sh DESCRIPTION +The above functions perform character tests and conversions on the integer +.Fa c . +They are available as macros, defined in the include file +.In ctype.h , +or as true functions in the C library. +See the specific manual pages for more information. +.Pp +Extended locale versions of these functions are documented in +.Xr ctype_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh SEE ALSO +.Xr digittoint 3 , +.Xr isalnum 3 , +.Xr isalpha 3 , +.Xr isascii 3 , +.Xr isblank 3 , +.Xr iscntrl 3 , +.Xr isdigit 3 , +.Xr isgraph 3 , +.Xr isideogram 3 , +.Xr islower 3 , +.Xr isphonogram 3 , +.Xr isprint 3 , +.Xr ispunct 3 , +.Xr isrune 3 , +.Xr isspace 3 , +.Xr isspecial 3 , +.Xr isupper 3 , +.Xr isxdigit 3 , +.Xr toascii 3 , +.Xr tolower 3 , +.Xr toupper 3 , +.Xr wctype 3 , +.Xr ascii 7 , +.Xr ctype_l 3 +.Sh STANDARDS +These functions, except for +.Fn digittoint , +.Fn isascii , +.Fn ishexnumber , +.Fn isideogram , +.Fn isnumber , +.Fn isphonogram , +.Fn isrune , +.Fn isspecial +and +.Fn toascii , +conform to +.St -isoC . diff --git a/locale/FreeBSD/digittoint.3 b/locale/FreeBSD/digittoint.3 new file mode 100644 index 0000000..3e86f72 --- /dev/null +++ b/locale/FreeBSD/digittoint.3 @@ -0,0 +1,78 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)digittoint.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/digittoint.3,v 1.6 2009/09/04 07:44:58 des Exp $ +.\" +.Dd April 6, 2001 +.Dt DIGITTOINT 3 +.Os +.Sh NAME +.Nm digittoint , +.Nm digittoint_l +.Nd convert a numeric character to its integer value +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fo digittoint +.Fa "int c" +.Fc +.In xlocale.h +.In ctype.h +.Ft int +.Fo digittoint_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn digittoint +function converts a numeric character to its corresponding integer value. +The character can be any decimal digit or hexadecimal digit. +With hexadecimal characters, the case of the values does not matter. +.Pp +While the +.Fn digittoint +function uses the current locale, the +.Fn digittoint_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn digittoint +function always returns an integer from the range of 0 to 15. +If the given character was not a digit as defined by +.Xr isxdigit 3 , +the function will return 0. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isdigit 3 , +.Xr isxdigit 3 , +.Xr xlocale 3 diff --git a/locale/FreeBSD/euc.5 b/locale/FreeBSD/euc.5 new file mode 100644 index 0000000..03619e7 --- /dev/null +++ b/locale/FreeBSD/euc.5 @@ -0,0 +1,134 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Paul Borman at Krystal Technologies. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)euc.4 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/euc.5,v 1.13 2007/01/09 00:28:00 imp Exp $ +.\" +.Dd November 8, 2003 +.Dt EUC 5 +.Os +.Sh NAME +.Nm euc +.Nd EUC encoding of wide characters +.Sh SYNOPSIS +.Nm ENCODING +.Qq EUC +.Pp +.Nm VARIABLE +.Ar len1 +.Ar mask1 +.Ar len2 +.Ar mask2 +.Ar len3 +.Ar mask3 +.Ar len4 +.Ar mask4 +.Ar mask +.Sh DESCRIPTION +.\"The +.\".Nm EUC +.\"encoding is provided for compatibility with +.\".Ux +.\"based systems. +.\"See +.\".Xr mklocale 1 +.\"for a complete description of the +.\".Ev LC_CTYPE +.\"source file format. +.\".Pp +.Nm EUC +implements a system of 4 multibyte codesets. +A multibyte character in the first codeset consists of +.Ar len1 +bytes starting with a byte in the range of 0x00 to 0x7f. +To allow use of +.Tn ASCII , +.Ar len1 +is always 1. +A multibyte character in the second codeset consists of +.Ar len2 +bytes starting with a byte in the range of 0x80-0xff excluding 0x8e and 0x8f. +A multibyte character in the third codeset consists of +.Ar len3 +bytes starting with the byte 0x8e. +A multibyte character in the fourth codeset consists of +.Ar len4 +bytes starting with the byte 0x8f. +.Pp +The +.Vt wchar_t +encoding of +.Nm EUC +multibyte characters is dependent on the +.Ar len +and +.Ar mask +arguments. +First, the bytes are moved into a +.Vt wchar_t +as follows: +.Bd -literal +byte0 << ((\fIlen\fPN-1) * 8) | byte1 << ((\fIlen\fPN-2) * 8) | ... | byte\fIlen\fPN-1 +.Ed +.Pp +The result is then ANDed with +.Ar ~mask +and ORed with +.Ar maskN . +Codesets 2 and 3 are special in that the leading byte (0x8e or 0x8f) is +first removed and the +.Ar lenN +argument is reduced by 1. +.Pp +For example, the +.Li ja_JP.eucJP +locale has the following +.Va VARIABLE +line: +.Bd -literal +VARIABLE 1 0x0000 2 0x8080 2 0x0080 3 0x8000 0x8080 +.Ed +.Pp +Codeset 1 consists of the values 0x0000 - 0x007f. +.Pp +Codeset 2 consists of the values who have the bits 0x8080 set. +.Pp +Codeset 3 consists of the values 0x0080 - 0x00ff. +.Pp +Codeset 4 consists of the values 0x8000 - 0xff7f excluding the values +which have the 0x0080 bit set. +.Pp +Notice that the global +.Ar mask +is set to 0x8080, this implies that from those 2 bits the codeset can +be determined. +.Sh SEE ALSO +.Xr mklocale 1 , +.Xr setlocale 3 diff --git a/locale/FreeBSD/euc.c b/locale/FreeBSD/euc.c new file mode 100644 index 0000000..5504b7b --- /dev/null +++ b/locale/FreeBSD/euc.c @@ -0,0 +1,277 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)euc.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/euc.c,v 1.22 2007/10/13 16:28:21 ache Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +static size_t _EUC_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +static int _EUC_mbsinit(const mbstate_t *, locale_t); +static size_t _EUC_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); + +typedef struct { + int count[4]; + wchar_t bits[4]; + wchar_t mask; +} _EucInfo; + +typedef struct { + wchar_t ch; + int set; + int want; +} _EucState; + +/* This will be called by the XL_RELEASE() macro to free the extra storage */ +static void +_EUC_free_extra(struct __xlocale_st_runelocale *xrl) +{ + free(xrl->_CurrentRuneLocale.__variable); +} + +int +_EUC_init(struct __xlocale_st_runelocale *xrl) +{ + _EucInfo *ei; + int x, new__mb_cur_max; + char *v, *e; + _RuneLocale *rl = &xrl->_CurrentRuneLocale; + + if (rl->__variable == NULL) + return (EFTYPE); + + v = (char *)rl->__variable; + + while (*v == ' ' || *v == '\t') + ++v; + + if ((ei = malloc(sizeof(_EucInfo))) == NULL) + return (errno == 0 ? ENOMEM : errno); + + new__mb_cur_max = 0; + for (x = 0; x < 4; ++x) { + ei->count[x] = (int)strtol(v, &e, 0); + if (v == e || !(v = e)) { + free(ei); + return (EFTYPE); + } + if (new__mb_cur_max < ei->count[x]) + new__mb_cur_max = ei->count[x]; + while (*v == ' ' || *v == '\t') + ++v; + ei->bits[x] = (int)strtol(v, &e, 0); + if (v == e || !(v = e)) { + free(ei); + return (EFTYPE); + } + while (*v == ' ' || *v == '\t') + ++v; + } + ei->mask = (int)strtol(v, &e, 0); + if (v == e || !(v = e)) { + free(ei); + return (EFTYPE); + } + rl->__variable = ei; + rl->__variable_len = sizeof(_EucInfo); + xrl->__mb_cur_max = new__mb_cur_max; + xrl->__mbrtowc = _EUC_mbrtowc; + xrl->__wcrtomb = _EUC_wcrtomb; + xrl->__mbsinit = _EUC_mbsinit; + xrl->__mb_sb_limit = 256; + xrl->__free_extra = (__free_extra_t)_EUC_free_extra; + return (0); +} + +static int +_EUC_mbsinit(const mbstate_t *ps, locale_t loc __unused) +{ + + return (ps == NULL || ((const _EucState *)ps)->want == 0); +} + +#define _SS2 0x008e +#define _SS3 0x008f + +#define GR_BITS 0x80808080 /* XXX: to be fixed */ + +static __inline int +_euc_set(u_int c) +{ + + c &= 0xff; + return ((c & 0x80) ? c == _SS3 ? 3 : c == _SS2 ? 2 : 1 : 0); +} + +static size_t +_EUC_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps, locale_t loc) +{ + _EucState *es; + int i, set, want; + wchar_t wc; + const char *os; + struct __xlocale_st_runelocale *rl = loc->__lc_ctype; + _EucInfo *CEI = (_EucInfo *)rl->_CurrentRuneLocale.__variable; + + es = (_EucState *)ps; + + if (es->want < 0 || es->want > rl->__mb_cur_max || es->set < 0 || + es->set > 3) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) { + s = ""; + n = 1; + pwc = NULL; + } + + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + + os = s; + + if (es->want == 0) { + want = CEI->count[set = _euc_set(*s)]; + if (set == 2 || set == 3) { + --want; + if (--n == 0) { + /* Incomplete multibyte sequence */ + es->set = set; + es->want = want; + es->ch = 0; + return ((size_t)-2); + } + ++s; + if (*s == '\0') { + errno = EILSEQ; + return ((size_t)-1); + } + } + wc = (unsigned char)*s++; + } else { + set = es->set; + want = es->want; + wc = es->ch; + } + for (i = (es->want == 0) ? 1 : 0; i < MIN(want, n); i++) { + if (*s == '\0') { + errno = EILSEQ; + return ((size_t)-1); + } + wc = (wc << 8) | (unsigned char)*s++; + } + if (i < want) { + /* Incomplete multibyte sequence */ + es->set = set; + es->want = want - i; + es->ch = wc; + return ((size_t)-2); + } + wc = (wc & ~CEI->mask) | CEI->bits[set]; + if (pwc != NULL) + *pwc = wc; + es->want = 0; + return (wc == L'\0' ? 0 : s - os); +} + +static size_t +_EUC_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc) +{ + _EucState *es; + wchar_t m, nm; + int i, len; + _EucInfo *CEI = (_EucInfo *)loc->__lc_ctype->_CurrentRuneLocale.__variable; + + es = (_EucState *)ps; + + if (es->want != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + + m = wc & CEI->mask; + nm = wc & ~m; + + if (m == CEI->bits[1]) { +CodeSet1: + /* Codeset 1: The first byte must have 0x80 in it. */ + i = len = CEI->count[1]; + while (i-- > 0) + *s++ = (nm >> (i << 3)) | 0x80; + } else { + if (m == CEI->bits[0]) + i = len = CEI->count[0]; + else if (m == CEI->bits[2]) { + i = len = CEI->count[2]; + *s++ = _SS2; + --i; + /* SS2 designates G2 into GR */ + nm |= GR_BITS; + } else if (m == CEI->bits[3]) { + i = len = CEI->count[3]; + *s++ = _SS3; + --i; + /* SS3 designates G3 into GR */ + nm |= GR_BITS; + } else + goto CodeSet1; /* Bletch */ + while (i-- > 0) + *s++ = (nm >> (i << 3)) & 0xff; + } + return (len); +} diff --git a/locale/FreeBSD/fix_grouping.c b/locale/FreeBSD/fix_grouping.c new file mode 100644 index 0000000..180c800 --- /dev/null +++ b/locale/FreeBSD/fix_grouping.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/fix_grouping.c,v 1.8 2003/06/26 10:46:16 phantom Exp $"); + +#include +#include +#include + +static const char nogrouping[] = { '\0' }; +static const char __nogrouping[] = { CHAR_MAX, '\0' }; + +/* + * Internal helper used to convert grouping sequences from string + * representation into POSIX specified form, i.e. + * + * "3;3;-1" -> "\003\003\177\000" + */ + +const char * +__fix_locale_grouping_str(const char *str) +{ + char *src, *dst; + char n; + + if (str == NULL || *str == '\0') { + return nogrouping; + } + + for (src = (char*)str, dst = (char*)str; *src != '\0'; src++) { + + /* input string examples: "3;3", "3;2;-1" */ + if (*src == ';') + continue; + + if (*src == '-' && *(src+1) == '1') { + *dst++ = CHAR_MAX; + src++; + continue; + } + + if (!isdigit((unsigned char)*src)) { + /* broken grouping string */ + return nogrouping; + } + + /* assume all numbers <= 99 */ + n = *src - '0'; + if (isdigit((unsigned char)*(src+1))) { + src++; + n *= 10; + n += *src - '0'; + } + + *dst = n; + /* NOTE: assume all input started with "0" as 'no grouping' */ + if (*dst == '\0') + return (dst == (char*)str) ? nogrouping : str; + dst++; + } + *dst = '\0'; + return str; +} + +/* + * internal helpers for SUSv3 compatibility. Since "nogrouping" needs to + * be just an empty string, we provide a routine to substitute __nogrouping + * so we don't have to modify code that expects CHAR_MAX. + */ +__private_extern__ const char * +__fix_nogrouping(const char *str) +{ + return ((str == NULL || *str == '\0') ? __nogrouping : str); +} diff --git a/locale/FreeBSD/gb18030.5 b/locale/FreeBSD/gb18030.5 new file mode 100644 index 0000000..5e70865 --- /dev/null +++ b/locale/FreeBSD/gb18030.5 @@ -0,0 +1,78 @@ +.\" Copyright (c) 2002, 2003 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/gb18030.5,v 1.6 2004/07/05 06:36:36 ru Exp $ +.\" +.Dd August 10, 2003 +.Dt GB18030 5 +.Os +.Sh NAME +.Nm gb18030 +.Nd "GB 18030 encoding method for Chinese text" +.Sh SYNOPSIS +.Nm ENCODING +.Qq GB18030 +.Sh DESCRIPTION +The +.Nm GB18030 +encoding implements GB 18030-2000, a PRC national standard for the encoding of +Chinese characters. +It is a superset of the older GB\ 2312-1980 and GBK encodings, +and incorporates Unicode's Unihan Extension A completely. +It also provides code space for all Unicode 3.0 code points. +.Pp +Multibyte characters in the +.Nm GB18030 +encoding can be one byte, two bytes, or +four bytes long. +There are a total of over 1.5 million code positions. +.Pp +.No GB\ 11383-1981 Pq Tn ASCII +characters are represented by single bytes in the range 0x00 to 0x7F. +.Pp +Chinese characters are represented as either two bytes or four bytes. +Characters that are represented by two bytes begin with a byte in the range +0x81-0xFE and end with a byte either in the range 0x40-0x7E or 0x80-0xFE. +.Pp +Characters that are represented by four bytes begin with a byte in the range +0x81-0xFE, have a second byte in the range 0x30-0x39, a third byte in the range +0x81-0xFE and a fourth byte in the range 0x30-0x39. +.Sh SEE ALSO +.Xr euc 5 , +.Xr gb2312 5 , +.Xr gbk 5 , +.Xr utf8 5 +.Rs +.%T "Chinese National Standard GB 18030-2000: Information Technology -- Chinese ideograms coded character set for information interchange -- Extension for the basic set" +.%D "March 2000" +.Re +.Rs +.%Q "The Unicode Consortium" +.%T "The Unicode Standard, Version 3.0" +.%D "2000" +.Re +.Sh STANDARDS +The +.Nm GB18030 +encoding is believed to be compatible with GB 18030-2000. diff --git a/locale/FreeBSD/gb18030.c b/locale/FreeBSD/gb18030.c new file mode 100644 index 0000000..baeaada --- /dev/null +++ b/locale/FreeBSD/gb18030.c @@ -0,0 +1,222 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * PRC National Standard GB 18030-2000 encoding of Chinese text. + * + * See gb18030(5) for details. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/gb18030.c,v 1.8 2007/10/13 16:28:21 ache Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include "mblocal.h" + +#define GB18030_MB_CUR_MAX 4 + +static size_t _GB18030_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +static int _GB18030_mbsinit(const mbstate_t *, locale_t); +static size_t _GB18030_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); + +typedef struct { + int count; + u_char bytes[4]; +} _GB18030State; + +int +_GB18030_init(struct __xlocale_st_runelocale *xrl) +{ + + xrl->__mbrtowc = _GB18030_mbrtowc; + xrl->__wcrtomb = _GB18030_wcrtomb; + xrl->__mbsinit = _GB18030_mbsinit; + xrl->__mb_cur_max = GB18030_MB_CUR_MAX; + xrl->__mb_sb_limit = 128; + + return (0); +} + +static int +_GB18030_mbsinit(const mbstate_t *ps, locale_t loc __unused) +{ + + return (ps == NULL || ((const _GB18030State *)ps)->count == 0); +} + +static size_t +_GB18030_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, + size_t n, mbstate_t * __restrict ps, locale_t loc __unused) +{ + _GB18030State *gs; + wchar_t wch; + int ch, len, ocount; + size_t ncopy; + + gs = (_GB18030State *)ps; + + if (gs->count < 0 || gs->count > sizeof(gs->bytes)) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) { + s = ""; + n = 1; + pwc = NULL; + } + + ncopy = MIN(MIN(n, GB18030_MB_CUR_MAX), sizeof(gs->bytes) - gs->count); + strncpy((char*)(gs->bytes + gs->count), s, ncopy); + ocount = gs->count; + gs->count += ncopy; + s = (char *)gs->bytes; + n = gs->count; + + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + + /* + * Single byte: [00-7f] + * Two byte: [81-fe][40-7e,80-fe] + * Four byte: [81-fe][30-39][81-fe][30-39] + */ + ch = (unsigned char)*s++; + if (ch <= 0x7f) { + len = 1; + wch = ch; + } else if (ch >= 0x81 && ch <= 0xfe) { + wch = ch; + if (n < 2) + return ((size_t)-2); + ch = (unsigned char)*s++; + if ((ch >= 0x40 && ch <= 0x7e) || (ch >= 0x80 && ch <= 0xfe)) { + wch = (wch << 8) | ch; + len = 2; + } else if (ch >= 0x30 && ch <= 0x39) { + /* + * Strip high bit off the wide character we will + * eventually output so that it is positive when + * cast to wint_t on 32-bit twos-complement machines. + */ + wch = ((wch & 0x7f) << 8) | ch; + if (n < 3) + return ((size_t)-2); + ch = (unsigned char)*s++; + if (ch < 0x81 || ch > 0xfe) + goto ilseq; + wch = (wch << 8) | ch; + if (n < 4) + return ((size_t)-2); + ch = (unsigned char)*s++; + if (ch < 0x30 || ch > 0x39) + goto ilseq; + wch = (wch << 8) | ch; + len = 4; + } else + goto ilseq; + } else + goto ilseq; + + if (pwc != NULL) + *pwc = wch; + gs->count = 0; + return (wch == L'\0' ? 0 : len - ocount); +ilseq: + errno = EILSEQ; + return ((size_t)-1); +} + +static size_t +_GB18030_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc __unused) +{ + _GB18030State *gs; + size_t len; + int c; + + gs = (_GB18030State *)ps; + + if (gs->count != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + if ((wc & ~0x7fffffff) != 0) + goto ilseq; + if (wc & 0x7f000000) { + /* Replace high bit that mbrtowc() removed. */ + wc |= 0x80000000; + c = (wc >> 24) & 0xff; + if (c < 0x81 || c > 0xfe) + goto ilseq; + *s++ = c; + c = (wc >> 16) & 0xff; + if (c < 0x30 || c > 0x39) + goto ilseq; + *s++ = c; + c = (wc >> 8) & 0xff; + if (c < 0x81 || c > 0xfe) + goto ilseq; + *s++ = c; + c = wc & 0xff; + if (c < 0x30 || c > 0x39) + goto ilseq; + *s++ = c; + len = 4; + } else if (wc & 0x00ff0000) + goto ilseq; + else if (wc & 0x0000ff00) { + c = (wc >> 8) & 0xff; + if (c < 0x81 || c > 0xfe) + goto ilseq; + *s++ = c; + c = wc & 0xff; + if (c < 0x40 || c == 0x7f || c == 0xff) + goto ilseq; + *s++ = c; + len = 2; + } else if (wc <= 0x7f) { + *s++ = wc; + len = 1; + } else + goto ilseq; + + return (len); +ilseq: + errno = EILSEQ; + return ((size_t)-1); +} diff --git a/locale/FreeBSD/gb2312.5 b/locale/FreeBSD/gb2312.5 new file mode 100644 index 0000000..1524462 --- /dev/null +++ b/locale/FreeBSD/gb2312.5 @@ -0,0 +1,57 @@ +.\" Copyright (c) 2003 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/gb2312.5,v 1.4 2004/07/05 06:36:36 ru Exp $ +.\" +.Dd November 7, 2003 +.Dt GB2312 5 +.Os +.Sh NAME +.Nm gb2312 +.Nd "GB2312 encoding method for Chinese text" +.Sh SYNOPSIS +.Nm ENCODING +.Qq GB2312 +.Sh DESCRIPTION +The +.Nm GB2312 +encoding implements GB\ 2312-1980, a PRC national standard +for the encoding of simplified Chinese characters. +.Pp +Multibyte characters in the GB2312 +encoding can be one byte or two bytes long. +.No GB\ 11383-1981 Pq Tn ASCII +characters are represented by single bytes in the range 0x00 to 0x7F. +Simplified Chinese characters are represented by two bytes, both in +the range 0xA1-0xFE. +.Sh SEE ALSO +.Xr euc 5 , +.Xr gb18030 5 , +.Xr gbk 5 +.Sh STANDARDS +The +.Nm GB2312 +encoding is believed to be compatible with GB\ 2312-1980. +This standard has been superseded by GB\ 18030-2000, but is still +in wide use. diff --git a/locale/FreeBSD/gb2312.c b/locale/FreeBSD/gb2312.c new file mode 100644 index 0000000..dea5a92 --- /dev/null +++ b/locale/FreeBSD/gb2312.c @@ -0,0 +1,157 @@ +/*- + * Copyright (c) 2004 Tim J. Robbins. All rights reserved. + * Copyright (c) 2003 David Xu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/gb2312.c,v 1.10 2007/10/13 16:28:21 ache Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include "mblocal.h" + +#define GB2312_MB_CUR_MAX 2 + +static size_t _GB2312_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +static int _GB2312_mbsinit(const mbstate_t *, locale_t); +static size_t _GB2312_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); +typedef struct { + int count; + u_char bytes[2]; +} _GB2312State; + +int +_GB2312_init(struct __xlocale_st_runelocale *xrl) +{ + + xrl->__mbrtowc = _GB2312_mbrtowc; + xrl->__wcrtomb = _GB2312_wcrtomb; + xrl->__mbsinit = _GB2312_mbsinit; + xrl->__mb_cur_max = GB2312_MB_CUR_MAX; + xrl->__mb_sb_limit = 128; + return (0); +} + +static int +_GB2312_mbsinit(const mbstate_t *ps, locale_t loc __unused) +{ + + return (ps == NULL || ((const _GB2312State *)ps)->count == 0); +} + +static __inline int +_GB2312_check(const char *str, size_t n) +{ + const u_char *s = (const u_char *)str; + + if (n == 0) + /* Incomplete multibyte sequence */ + return (-2); + if (s[0] >= 0xa1 && s[0] <= 0xfe) { + if (n < 2) + /* Incomplete multibyte sequence */ + return (-2); + if (s[1] < 0xa1 || s[1] > 0xfe) + /* Invalid multibyte sequence */ + return (-1); + return (2); + } else if (s[0] & 0x80) { + /* Invalid multibyte sequence */ + return (-1); + } + return (1); +} + +static size_t +_GB2312_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps, locale_t loc __unused) +{ + _GB2312State *gs; + wchar_t wc; + int i, len, ocount; + size_t ncopy; + + gs = (_GB2312State *)ps; + + if (gs->count < 0 || gs->count > sizeof(gs->bytes)) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) { + s = ""; + n = 1; + pwc = NULL; + } + + ncopy = MIN(MIN(n, GB2312_MB_CUR_MAX), sizeof(gs->bytes) - gs->count); + strncpy((char*)(gs->bytes + gs->count), s, ncopy); + ocount = gs->count; + gs->count += ncopy; + s = (char *)gs->bytes; + n = gs->count; + + if ((len = _GB2312_check(s, n)) < 0) + return ((size_t)len); + wc = 0; + i = len; + while (i-- > 0) + wc = (wc << 8) | (unsigned char)*s++; + if (pwc != NULL) + *pwc = wc; + gs->count = 0; + return (wc == L'\0' ? 0 : len - ocount); +} + +static size_t +_GB2312_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc __unused) +{ + _GB2312State *gs; + + gs = (_GB2312State *)ps; + + if (gs->count != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + if (wc & 0x8000) { + *s++ = (wc >> 8) & 0xff; + *s = wc & 0xff; + return (2); + } + *s = wc & 0xff; + return (1); +} diff --git a/locale/FreeBSD/gbk.5 b/locale/FreeBSD/gbk.5 new file mode 100644 index 0000000..c1f2539 --- /dev/null +++ b/locale/FreeBSD/gbk.5 @@ -0,0 +1,63 @@ +.\" Copyright (c) 2003 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/gbk.5,v 1.4 2004/07/05 06:36:36 ru Exp $ +.\" +.Dd August 10, 2003 +.Dt GBK 5 +.Os +.Sh NAME +.Nm gbk +.Nd "Guojia biaozhun kuozhan (GBK) encoding method for Chinese text" +.Sh SYNOPSIS +.Nm ENCODING +.Qq GBK +.Sh DESCRIPTION +GBK is a backwards-compatible extension of the GB\ 2312-1980 encoding +method for Chinese text, which adds the characters defined in the +Unified Han portion of the Unicode 2.1 standard. +.Pp +Multibyte characters in the GBK +encoding can be one byte or two bytes long. +.No GB\ 11383-1981 Pq Tn ASCII +characters are represented by single bytes in the range 0x00 to 0x7F. +Chinese characters are represented by two bytes, beginning with a byte in +the range 0x80-0xFE and ending with a byte in the range 0x40-0xFE. +.Sh SEE ALSO +.Xr euc 5 , +.Xr gb18030 5 , +.Xr gb2312 5 , +.Xr utf8 5 +.Rs +.%Q "The Unicode Consortium" +.%T "The Unicode Standard, Version 2.1" +.%D "1999" +.Re +.Rs +.%T "Chinese National Standard GB 18030-2000: Information Technology -- Chinese ideograms coded character set for information interchange -- Extension for the basic set" +.%D "March 2000" +.Re +.Sh STANDARDS +GBK is not a standard, but has been superseded by +GB\ 18030-2000. diff --git a/locale/FreeBSD/gbk.c b/locale/FreeBSD/gbk.c new file mode 100644 index 0000000..fb68b6b --- /dev/null +++ b/locale/FreeBSD/gbk.c @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/gbk.c,v 1.14 2007/10/13 16:28:21 ache Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +static size_t _GBK_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +static int _GBK_mbsinit(const mbstate_t *, locale_t); +static size_t _GBK_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); + +typedef struct { + wchar_t ch; +} _GBKState; + +int +_GBK_init(struct __xlocale_st_runelocale *xrl) +{ + + xrl->__mbrtowc = _GBK_mbrtowc; + xrl->__wcrtomb = _GBK_wcrtomb; + xrl->__mbsinit = _GBK_mbsinit; + xrl->__mb_cur_max = 2; + xrl->__mb_sb_limit = 128; + return (0); +} + +static int +_GBK_mbsinit(const mbstate_t *ps, locale_t loc __unused) +{ + + return (ps == NULL || ((const _GBKState *)ps)->ch == 0); +} + +static __inline int +_gbk_check(u_int c) +{ + + c &= 0xff; + return ((c >= 0x81 && c <= 0xfe) ? 2 : 1); +} + +static size_t +_GBK_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps, locale_t loc __unused) +{ + _GBKState *gs; + wchar_t wc; + size_t len; + + gs = (_GBKState *)ps; + + if ((gs->ch & ~0xFF) != 0) { + /* Bad conversion state. */ + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) { + s = ""; + n = 1; + pwc = NULL; + } + + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + + if (gs->ch != 0) { + if (*s == '\0') { + errno = EILSEQ; + return ((size_t)-1); + } + wc = (gs->ch << 8) | (*s & 0xFF); + if (pwc != NULL) + *pwc = wc; + gs->ch = 0; + return (1); + } + + len = (size_t)_gbk_check(*s); + wc = *s++ & 0xff; + if (len == 2) { + if (n < 2) { + /* Incomplete multibyte sequence */ + gs->ch = wc; + return ((size_t)-2); + } + if (*s == '\0') { + errno = EILSEQ; + return ((size_t)-1); + } + wc = (wc << 8) | (*s++ & 0xff); + if (pwc != NULL) + *pwc = wc; + return (2); + } else { + if (pwc != NULL) + *pwc = wc; + return (wc == L'\0' ? 0 : 1); + } +} + +static size_t +_GBK_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc __unused) +{ + _GBKState *gs; + + gs = (_GBKState *)ps; + + if (gs->ch != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + if (wc & 0x8000) { + *s++ = (wc >> 8) & 0xff; + *s = wc & 0xff; + return (2); + } + *s = wc & 0xff; + return (1); +} diff --git a/locale/FreeBSD/isalnum.3 b/locale/FreeBSD/isalnum.3 new file mode 100644 index 0000000..961b9b3 --- /dev/null +++ b/locale/FreeBSD/isalnum.3 @@ -0,0 +1,104 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isalnum.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/isalnum.3,v 1.24 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt ISALNUM 3 +.Os +.Sh NAME +.Nm isalnum +.Nd alphanumeric character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isalnum "int c" +.Sh DESCRIPTION +The +.Fn isalnum +function tests for any character for which +.Xr isalpha 3 +or +.Xr isdigit 3 +is true. +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +In the ASCII character set, this includes the following characters +(preceded by their numeric values, in octal): +.Pp +.Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ +.It "\&060\ ``0'' \t061\ ``1'' \t062\ ``2'' \t063\ ``3'' \t064\ ``4''" +.It "\&065\ ``5'' \t066\ ``6'' \t067\ ``7'' \t070\ ``8'' \t071\ ``9''" +.It "\&101\ ``A'' \t102\ ``B'' \t103\ ``C'' \t104\ ``D'' \t105\ ``E''" +.It "\&106\ ``F'' \t107\ ``G'' \t110\ ``H'' \t111\ ``I'' \t112\ ``J''" +.It "\&113\ ``K'' \t114\ ``L'' \t115\ ``M'' \t116\ ``N'' \t117\ ``O''" +.It "\&120\ ``P'' \t121\ ``Q'' \t122\ ``R'' \t123\ ``S'' \t124\ ``T''" +.It "\&125\ ``U'' \t126\ ``V'' \t127\ ``W'' \t130\ ``X'' \t131\ ``Y''" +.It "\&132\ ``Z'' \t141\ ``a'' \t142\ ``b'' \t143\ ``c'' \t144\ ``d''" +.It "\&145\ ``e'' \t146\ ``f'' \t147\ ``g'' \t150\ ``h'' \t151\ ``i''" +.It "\&152\ ``j'' \t153\ ``k'' \t154\ ``l'' \t155\ ``m'' \t156\ ``n''" +.It "\&157\ ``o'' \t160\ ``p'' \t161\ ``q'' \t162\ ``r'' \t163\ ``s''" +.It "\&164\ ``t'' \t165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x''" +.It "\&171\ ``y'' \t172\ ``z''" +.El +.Sh RETURN VALUES +The +.Fn isalnum +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswalnum +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr isalpha 3 , +.Xr isdigit 3 , +.Xr iswalnum 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn isalnum +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/isalpha.3 b/locale/FreeBSD/isalpha.3 new file mode 100644 index 0000000..3d9ad13 --- /dev/null +++ b/locale/FreeBSD/isalpha.3 @@ -0,0 +1,102 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isalpha.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/isalpha.3,v 1.23 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt ISALPHA 3 +.Os +.Sh NAME +.Nm isalpha +.Nd alphabetic character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isalpha "int c" +.Sh DESCRIPTION +The +.Fn isalpha +function tests for any character for which +.Xr isupper 3 +or +.Xr islower 3 +is true. +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +In the ASCII character set, this includes the following characters +(preceded by their numeric values, in octal): +.Pp +.Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ +.It "\&101\ ``A'' \t102\ ``B'' \t103\ ``C'' \t104\ ``D'' \t105\ ``E''" +.It "\&106\ ``F'' \t107\ ``G'' \t110\ ``H'' \t111\ ``I'' \t112\ ``J''" +.It "\&113\ ``K'' \t114\ ``L'' \t115\ ``M'' \t116\ ``N'' \t117\ ``O''" +.It "\&120\ ``P'' \t121\ ``Q'' \t122\ ``R'' \t123\ ``S'' \t124\ ``T''" +.It "\&125\ ``U'' \t126\ ``V'' \t127\ ``W'' \t130\ ``X'' \t131\ ``Y''" +.It "\&132\ ``Z'' \t141\ ``a'' \t142\ ``b'' \t143\ ``c'' \t144\ ``d''" +.It "\&145\ ``e'' \t146\ ``f'' \t147\ ``g'' \t150\ ``h'' \t151\ ``i''" +.It "\&152\ ``j'' \t153\ ``k'' \t154\ ``l'' \t155\ ``m'' \t156\ ``n''" +.It "\&157\ ``o'' \t160\ ``p'' \t161\ ``q'' \t162\ ``r'' \t163\ ``s''" +.It "\&164\ ``t'' \t165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x''" +.It "\&171\ ``y'' \t172\ ``z''" +.El +.Sh RETURN VALUES +The +.Fn isalpha +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswalpha +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr islower 3 , +.Xr isupper 3 , +.Xr iswalpha 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn isalpha +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/isascii.3 b/locale/FreeBSD/isascii.3 new file mode 100644 index 0000000..6a0c4ea --- /dev/null +++ b/locale/FreeBSD/isascii.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isascii.3 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD: src/lib/libc/locale/isascii.3,v 1.16 2009/09/04 07:44:58 des Exp $ +.\" +.Dd October 6, 2002 +.Dt ISASCII 3 +.Os +.Sh NAME +.Nm isascii +.Nd test for ASCII character +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isascii "int c" +.Sh DESCRIPTION +The +.Fn isascii +function tests for an +.Tn ASCII +character, which is any character +between 0 and octal 0177 inclusive. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr iswascii 3 , +.Xr ascii 7 diff --git a/locale/FreeBSD/isblank.3 b/locale/FreeBSD/isblank.3 new file mode 100644 index 0000000..5a4aef2 --- /dev/null +++ b/locale/FreeBSD/isblank.3 @@ -0,0 +1,85 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isblank.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/isblank.3,v 1.26 2009/11/11 11:31:02 roam Exp $ +.\" +.Dd July 17, 2005 +.Dt ISBLANK 3 +.Os +.Sh NAME +.Nm isblank +.Nd space or tab character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isblank "int c" +.Sh DESCRIPTION +The +.Fn isblank +function tests for a space or tab character. +For any locale, this includes the following standard characters: +.Pp +.Bl -column \&`\et''___ \&``\et''___ +.It "\&``\et''\t`` ''" +.El +.Pp +In the "C" locale, a successful +.Fn isblank +test is limited to these characters only. +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Sh RETURN VALUES +The +.Fn isblank +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswblank +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswblank 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn isblank +function +conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/iscntrl.3 b/locale/FreeBSD/iscntrl.3 new file mode 100644 index 0000000..bb7045d --- /dev/null +++ b/locale/FreeBSD/iscntrl.3 @@ -0,0 +1,92 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)iscntrl.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/iscntrl.3,v 1.22 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt ISCNTRL 3 +.Os +.Sh NAME +.Nm iscntrl +.Nd control character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn iscntrl "int c" +.Sh DESCRIPTION +The +.Fn iscntrl +function tests for any control character. +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +In the ASCII character set, this includes the following characters +(preceded by their numeric values, in octal): +.Pp +.Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ +.It "\&000\ NUL \t001\ SOH \t002\ STX \t003\ ETX \t004\ EOT" +.It "\&005\ ENQ \t006\ ACK \t007\ BEL \t010\ BS \t011\ HT" +.It "\&012\ NL \t013\ VT \t014\ NP \t015\ CR \t016\ SO" +.It "\&017\ SI \t020\ DLE \t021\ DC1 \t022\ DC2 \t023\ DC3" +.It "\&024\ DC4 \t025\ NAK \t026\ SYN \t027\ ETB \t030\ CAN" +.It "\&031\ EM \t032\ SUB \t033\ ESC \t034\ FS \t035\ GS" +.It "\&036\ RS \t037\ US \t177\ DEL" +.El +.Sh RETURN VALUES +The +.Fn iscntrl +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswcntrl +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswcntrl 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn iscntrl +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/isdigit.3 b/locale/FreeBSD/isdigit.3 new file mode 100644 index 0000000..0fffb88 --- /dev/null +++ b/locale/FreeBSD/isdigit.3 @@ -0,0 +1,103 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isdigit.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/isdigit.3,v 1.25 2009/09/04 07:44:58 des Exp $ +.\" +.Dd May 4, 2007 +.Dt ISDIGIT 3 +.Os +.Sh NAME +.Nm isdigit, isnumber +.Nd decimal-digit character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isdigit "int c" +.Ft int +.Fn isnumber "int c" +.Sh DESCRIPTION +The +.Fn isdigit +function tests for a decimal digit character. +Regardless of locale, this includes the following characters only: +.Pp +.Bl -column \&``0''______ \&``0''______ \&``0''______ \&``0''______ \&``0''______ +.It "\&``0''\t``1''\t``2''\t``3''\t``4''" +.It "\&``5''\t``6''\t``7''\t``8''\t``9''" +.El +.Pp +The +.Fn isnumber +function behaves similarly to +.Fn isdigit , +but may recognize additional characters, depending on the current locale +setting. +.Pp +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Sh RETURN VALUES +The +.Fn isdigit +and +.Fn isnumber +functions return zero if the character tests false and +return non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswdigit +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswdigit 3 , +.Xr multibyte 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn isdigit +function conforms to +.St -isoC . +.Sh HISTORY +The +.Fn isnumber +function appeared in +.Bx 4.4 . diff --git a/locale/FreeBSD/isgraph.3 b/locale/FreeBSD/isgraph.3 new file mode 100644 index 0000000..f20973f --- /dev/null +++ b/locale/FreeBSD/isgraph.3 @@ -0,0 +1,107 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isgraph.3 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD: src/lib/libc/locale/isgraph.3,v 1.25 2009/11/13 09:03:50 roam Exp $ +.\" +.Dd July 17, 2005 +.Dt ISGRAPH 3 +.Os +.Sh NAME +.Nm isgraph +.Nd printing character test (space character exclusive) +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isgraph "int c" +.Sh DESCRIPTION +The +.Fn isgraph +function tests for any printing character except space +.Pq Ql "\ " +and other +locale-specific space-like characters. +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +In the ASCII character set, this includes the following characters +(preceded by their numeric values, in octal): +.Pp +.Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ +.It "\&041\ ``!'' \t042\ ``""'' \t043\ ``#'' \t044\ ``$'' \t045\ ``%''" +.It "\&046\ ``&'' \t047\ ``''' \t050\ ``('' \t051\ ``)'' \t052\ ``*''" +.It "\&053\ ``+'' \t054\ ``,'' \t055\ ``-'' \t056\ ``.'' \t057\ ``/''" +.It "\&060\ ``0'' \t061\ ``1'' \t062\ ``2'' \t063\ ``3'' \t064\ ``4''" +.It "\&065\ ``5'' \t066\ ``6'' \t067\ ``7'' \t070\ ``8'' \t071\ ``9''" +.It "\&072\ ``:'' \t073\ ``;'' \t074\ ``<'' \t075\ ``='' \t076\ ``>''" +.It "\&077\ ``?'' \t100\ ``@'' \t101\ ``A'' \t102\ ``B'' \t103\ ``C''" +.It "\&104\ ``D'' \t105\ ``E'' \t106\ ``F'' \t107\ ``G'' \t110\ ``H''" +.It "\&111\ ``I'' \t112\ ``J'' \t113\ ``K'' \t114\ ``L'' \t115\ ``M''" +.It "\&116\ ``N'' \t117\ ``O'' \t120\ ``P'' \t121\ ``Q'' \t122\ ``R''" +.It "\&123\ ``S'' \t124\ ``T'' \t125\ ``U'' \t126\ ``V'' \t127\ ``W''" +.It "\&130\ ``X'' \t131\ ``Y'' \t132\ ``Z'' \t133\ ``['' \t134\ ``\e\|''" +.It "\&135\ ``]'' \t136\ ``^'' \t137\ ``_'' \t140\ ```'' \t141\ ``a''" +.It "\&142\ ``b'' \t143\ ``c'' \t144\ ``d'' \t145\ ``e'' \t146\ ``f''" +.It "\&147\ ``g'' \t150\ ``h'' \t151\ ``i'' \t152\ ``j'' \t153\ ``k''" +.It "\&154\ ``l'' \t155\ ``m'' \t156\ ``n'' \t157\ ``o'' \t160\ ``p''" +.It "\&161\ ``q'' \t162\ ``r'' \t163\ ``s'' \t164\ ``t'' \t165\ ``u''" +.It "\&166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y'' \t172\ ``z''" +.It "\&173\ ``{'' \t174\ ``|'' \t175\ ``}'' \t176\ ``~''" +.El +.Sh RETURN VALUES +The +.Fn isgraph +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswgraph +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswgraph 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn isgraph +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/isideogram.3 b/locale/FreeBSD/isideogram.3 new file mode 100644 index 0000000..9ee26b5 --- /dev/null +++ b/locale/FreeBSD/isideogram.3 @@ -0,0 +1,58 @@ +.\" +.\" Copyright (c) 2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/isideogram.3,v 1.4 2009/09/04 07:44:58 des Exp $ +.\" +.Dd March 30, 2004 +.Dt ISIDEOGRAM 3 +.Os +.Sh NAME +.Nm isideogram +.Nd ideographic character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isideogram "int c" +.Sh DESCRIPTION +The +.Fn isideogram +function tests for an ideographic character. +.Sh RETURN VALUES +The +.Fn isideogram +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isphonogram 3 , +.Xr iswideogram 3 , +.Xr isalnum_l +.Sh HISTORY +The +.Fn isideogram +function appeared in +.Bx 4.4 . diff --git a/locale/FreeBSD/islower.3 b/locale/FreeBSD/islower.3 new file mode 100644 index 0000000..066d7d6 --- /dev/null +++ b/locale/FreeBSD/islower.3 @@ -0,0 +1,92 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)islower.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/islower.3,v 1.22 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt ISLOWER 3 +.Os +.Sh NAME +.Nm islower +.Nd lower-case character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn islower "int c" +.Sh DESCRIPTION +The +.Fn islower +function tests for any lower-case letters. +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +In the ASCII character set, this includes the following characters +(with their numeric values shown in octal): +.Pp +.Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ +.It "\&141\ ``a'' \t142\ ``b'' \t143\ ``c'' \t144\ ``d'' \t145\ ``e''" +.It "\&146\ ``f'' \t147\ ``g'' \t150\ ``h'' \t151\ ``i'' \t152\ ``j''" +.It "\&153\ ``k'' \t154\ ``l'' \t155\ ``m'' \t156\ ``n'' \t157\ ``o''" +.It "\&160\ ``p'' \t161\ ``q'' \t162\ ``r'' \t163\ ``s'' \t164\ ``t''" +.It "\&165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y''" +.It "\&172\ ``z''" +.El +.Sh RETURN VALUES +The +.Fn islower +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswlower +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswlower 3 , +.Xr tolower 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn islower +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/isphonogram.3 b/locale/FreeBSD/isphonogram.3 new file mode 100644 index 0000000..39db048 --- /dev/null +++ b/locale/FreeBSD/isphonogram.3 @@ -0,0 +1,58 @@ +.\" +.\" Copyright (c) 2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/isphonogram.3,v 1.3 2009/09/04 07:44:58 des Exp $ +.\" +.Dd March 30, 2004 +.Dt ISPHONOGRAM 3 +.Os +.Sh NAME +.Nm isphonogram +.Nd phonographic character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isphonogram "int c" +.Sh DESCRIPTION +The +.Fn isphonogram +function tests for a phonographic character. +.Sh RETURN VALUES +The +.Fn isphonogram +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isideogram 3 , +.Xr iswphonogram 3 , +.Xr isalnum_l +.Sh HISTORY +The +.Fn isphonogram +function appeared in +.Bx 4.4 . diff --git a/locale/FreeBSD/isprint.3 b/locale/FreeBSD/isprint.3 new file mode 100644 index 0000000..25ae0b5 --- /dev/null +++ b/locale/FreeBSD/isprint.3 @@ -0,0 +1,105 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isprint.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/isprint.3,v 1.26 2009/11/13 09:07:33 roam Exp $ +.\" +.Dd July 17, 2005 +.Dt ISPRINT 3 +.Os +.Sh NAME +.Nm isprint +.Nd printing character test (space character inclusive) +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isprint "int c" +.Sh DESCRIPTION +The +.Fn isprint +function tests for any printing character, including space +.Pq Ql "\ " . +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +In the ASCII character set, this includes the following characters +(preceded by their numeric values, in octal): +.Pp +.Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ +.It "\&040\ sp \t041\ ``!'' \t042\ ``""'' \t043\ ``#'' \t044\ ``$''" +.It "\&045\ ``%'' \t046\ ``&'' \t047\ ``''' \t050\ ``('' \t051\ ``)''" +.It "\&052\ ``*'' \t053\ ``+'' \t054\ ``,'' \t055\ ``-'' \t056\ ``.''" +.It "\&057\ ``/'' \t060\ ``0'' \t061\ ``1'' \t062\ ``2'' \t063\ ``3''" +.It "\&064\ ``4'' \t065\ ``5'' \t066\ ``6'' \t067\ ``7'' \t070\ ``8''" +.It "\&071\ ``9'' \t072\ ``:'' \t073\ ``;'' \t074\ ``<'' \t075\ ``=''" +.It "\&076\ ``>'' \t077\ ``?'' \t100\ ``@'' \t101\ ``A'' \t102\ ``B''" +.It "\&103\ ``C'' \t104\ ``D'' \t105\ ``E'' \t106\ ``F'' \t107\ ``G''" +.It "\&110\ ``H'' \t111\ ``I'' \t112\ ``J'' \t113\ ``K'' \t114\ ``L''" +.It "\&115\ ``M'' \t116\ ``N'' \t117\ ``O'' \t120\ ``P'' \t121\ ``Q''" +.It "\&122\ ``R'' \t123\ ``S'' \t124\ ``T'' \t125\ ``U'' \t126\ ``V''" +.It "\&127\ ``W'' \t130\ ``X'' \t131\ ``Y'' \t132\ ``Z'' \t133\ ``[''" +.It "\&134\ ``\e\|'' \t135\ ``]'' \t136\ ``^'' \t137\ ``_'' \t140\ ```''" +.It "\&141\ ``a'' \t142\ ``b'' \t143\ ``c'' \t144\ ``d'' \t145\ ``e''" +.It "\&146\ ``f'' \t147\ ``g'' \t150\ ``h'' \t151\ ``i'' \t152\ ``j''" +.It "\&153\ ``k'' \t154\ ``l'' \t155\ ``m'' \t156\ ``n'' \t157\ ``o''" +.It "\&160\ ``p'' \t161\ ``q'' \t162\ ``r'' \t163\ ``s'' \t164\ ``t''" +.It "\&165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y''" +.It "\&172\ ``z'' \t173\ ``{'' \t174\ ``|'' \t175\ ``}'' \t176\ ``~''" +.El +.Sh RETURN VALUES +The +.Fn isprint +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswprint +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswprint 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn isprint +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/ispunct.3 b/locale/FreeBSD/ispunct.3 new file mode 100644 index 0000000..b4fcfa3 --- /dev/null +++ b/locale/FreeBSD/ispunct.3 @@ -0,0 +1,97 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ispunct.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/ispunct.3,v 1.23 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt ISPUNCT 3 +.Os +.Sh NAME +.Nm ispunct +.Nd punctuation character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn ispunct "int c" +.Sh DESCRIPTION +The +.Fn ispunct +function tests for any printing character, except for space +.Pq Ql "\ " +or a +character for which +.Xr isalnum 3 +is true. +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +In the ASCII character set, this includes the following characters +(preceded by their numeric values, in octal): +.Pp +.Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ +.It "\&041\ ``!'' \t042\ ``""'' \t043\ ``#'' \t044\ ``$'' \t045\ ``%''" +.It "\&046\ ``&'' \t047\ ``''' \t050\ ``('' \t051\ ``)'' \t052\ ``*''" +.It "\&053\ ``+'' \t054\ ``,'' \t055\ ``-'' \t056\ ``.'' \t057\ ``/''" +.It "\&072\ ``:'' \t073\ ``;'' \t074\ ``<'' \t075\ ``='' \t076\ ``>''" +.It "\&077\ ``?'' \t100\ ``@'' \t133\ ``['' \t134\ ``\e\|'' \t135\ ``]''" +.It "\&136\ ``^'' \t137\ ``_'' \t140\ ```'' \t173\ ``{'' \t174\ ``|''" +.It "\&175\ ``}'' \t176\ ``~''" +.El +.Sh RETURN VALUES +The +.Fn ispunct +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswpunct +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswpunct 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn ispunct +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/isrune.3 b/locale/FreeBSD/isrune.3 new file mode 100644 index 0000000..a98a159 --- /dev/null +++ b/locale/FreeBSD/isrune.3 @@ -0,0 +1,64 @@ +.\" +.\" Copyright (c) 2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/isrune.3,v 1.3 2009/09/04 07:44:58 des Exp $ +.\" +.Dd March 30, 2004 +.Dt ISRUNE 3 +.Os +.Sh NAME +.Nm isrune +.Nd valid character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isrune "int c" +.Sh DESCRIPTION +The +.Fn isrune +function tests for any character that is valid in the current +character set. +In the +.Tn ASCII +character set, this is equivalent to +.Fn isascii . +.Sh RETURN VALUES +The +.Fn isrune +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isascii 3 , +.Xr iswrune 3 , +.Xr ascii 7 , +.Xr isalnum_l +.Sh HISTORY +The +.Fn isrune +function appeared in +.Bx 4.4 . diff --git a/locale/FreeBSD/isspace.3 b/locale/FreeBSD/isspace.3 new file mode 100644 index 0000000..f6fa79a --- /dev/null +++ b/locale/FreeBSD/isspace.3 @@ -0,0 +1,89 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isspace.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/isspace.3,v 1.22 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt ISSPACE 3 +.Os +.Sh NAME +.Nm isspace +.Nd white-space character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isspace "int c" +.Sh DESCRIPTION +The +.Fn isspace +function tests for the white-space characters. +For any locale, this includes the following standard characters: +.Pp +.Bl -column \&`\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ +.It "\&``\et''\t``\en''\t``\ev''\t``\ef''\t``\er''\t`` ''" +.El +.Pp +In the "C" locale, +.Fn isspace +successful test is limited to these characters only. +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Sh RETURN VALUES +The +.Fn isspace +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswspace +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswspace 3 , +.Xr multibyte 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn isspace +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/isspecial.3 b/locale/FreeBSD/isspecial.3 new file mode 100644 index 0000000..dc18f3a --- /dev/null +++ b/locale/FreeBSD/isspecial.3 @@ -0,0 +1,60 @@ +.\" +.\" Copyright (c) 2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 30, 2004 +.Dt ISSPECIAL 3 +.Os +.Sh NAME +.Nm isspecial +.Nd special character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isspecial "int c" +.Sh DESCRIPTION +The +.Fn isspecial +function tests for a special character. +Special characters are locale dependent, and not necessarily consistent between +different locales. +Examples might include fractions and numbers inside circles. +.Sh RETURN VALUES +The +.Fn isspecial +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr iswspecial 3 , +.Xr isalnum_l +.Sh HISTORY +The +.Fn isspecial +function appeared in +.Bx 4.4 . diff --git a/locale/FreeBSD/isupper.3 b/locale/FreeBSD/isupper.3 new file mode 100644 index 0000000..c3274c6 --- /dev/null +++ b/locale/FreeBSD/isupper.3 @@ -0,0 +1,92 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isupper.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/isupper.3,v 1.23 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt ISUPPER 3 +.Os +.Sh NAME +.Nm isupper +.Nd upper-case character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isupper "int c" +.Sh DESCRIPTION +The +.Fn isupper +function tests for any upper-case letter. +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +In the ASCII character set, this includes the following characters +(preceded by their numeric values, in octal): +.Pp +.Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ +.It "\&101\ ``A'' \t102\ ``B'' \t103\ ``C'' \t104\ ``D'' \t105\ ``E''" +.It "\&106\ ``F'' \t107\ ``G'' \t110\ ``H'' \t111\ ``I'' \t112\ ``J''" +.It "\&113\ ``K'' \t114\ ``L'' \t115\ ``M'' \t116\ ``N'' \t117\ ``O''" +.It "\&120\ ``P'' \t121\ ``Q'' \t122\ ``R'' \t123\ ``S'' \t124\ ``T''" +.It "\&125\ ``U'' \t126\ ``V'' \t127\ ``W'' \t130\ ``X'' \t131\ ``Y''" +.It "\&132\ ``Z''" +.El +.Sh RETURN VALUES +The +.Fn isupper +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswupper +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswupper 3 , +.Xr toupper 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn isupper +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/iswalnum.3 b/locale/FreeBSD/iswalnum.3 new file mode 100644 index 0000000..d501ea9 --- /dev/null +++ b/locale/FreeBSD/iswalnum.3 @@ -0,0 +1,165 @@ +.\" $NetBSD: iswalnum.3,v 1.5 2002/07/10 14:46:10 yamt Exp $ +.\" +.\" Copyright (c) 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isalnum.3 5.2 (Berkeley) 6/29/91 +.\" $FreeBSD: src/lib/libc/locale/iswalnum.3,v 1.6 2007/01/09 00:28:00 imp Exp $ +.\" +.Dd October 3, 2002 +.Dt ISWALNUM 3 +.Os +.Sh NAME +.Nm iswalnum , +.Nm iswalpha , +.Nm iswascii , +.Nm iswblank , +.Nm iswcntrl , +.Nm iswdigit , +.Nm iswgraph , +.Nm iswhexnumber , +.Nm iswideogram , +.Nm iswlower , +.Nm iswnumber , +.Nm iswphonogram , +.Nm iswprint , +.Nm iswpunct , +.Nm iswrune , +.Nm iswspace , +.Nm iswspecial , +.Nm iswupper , +.Nm iswxdigit +.Nd wide character classification utilities +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.Ft int +.Fn iswalnum "wint_t wc" +.Ft int +.Fn iswalpha "wint_t wc" +.Ft int +.Fn iswascii "wint_t wc" +.Ft int +.Fn iswblank "wint_t wc" +.Ft int +.Fn iswcntrl "wint_t wc" +.Ft int +.Fn iswdigit "wint_t wc" +.Ft int +.Fn iswgraph "wint_t wc" +.Ft int +.Fn iswhexnumber "wint_t wc" +.Ft int +.Fn iswideogram "wint_t wc" +.Ft int +.Fn iswlower "wint_t wc" +.Ft int +.Fn iswnumber "wint_t wc" +.Ft int +.Fn iswphonogram "wint_t wc" +.Ft int +.Fn iswprint "wint_t wc" +.Ft int +.Fn iswpunct "wint_t wc" +.Ft int +.Fn iswrune "wint_t wc" +.Ft int +.Fn iswspace "wint_t wc" +.Ft int +.Fn iswspecial "wint_t wc" +.Ft int +.Fn iswupper "wint_t wc" +.Ft int +.Fn iswxdigit "wint_t wc" +.Sh DESCRIPTION +The above functions are character classification utility functions, +for use with wide characters +.Vt ( wchar_t +or +.Vt wint_t ) . +See the description for the similarly-named single byte classification +functions (such as +.Xr isalnum 3 ) , +for details. +.Pp +Extended locale versions of these functions are documented in +.Xr iswalnum_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The functions return zero if the character tests false and +return non-zero if the character tests true. +.Sh SEE ALSO +.Xr isalnum 3 , +.Xr isalpha 3 , +.Xr isascii 3 , +.Xr isblank 3 , +.Xr iscntrl 3 , +.Xr isdigit 3 , +.Xr isgraph 3 , +.Xr ishexnumber 3 , +.Xr isideogram 3 , +.Xr islower 3 , +.Xr isnumber 3 , +.Xr isphonogram 3 , +.Xr isprint 3 , +.Xr ispunct 3 , +.Xr isrune 3 , +.Xr isspace 3 , +.Xr isspecial 3 , +.Xr isupper 3 , +.Xr iswalnum_l 3 , +.Xr isxdigit 3 , +.Xr wctype 3 +.Sh STANDARDS +These functions conform to +.St -p1003.1-2001 , +except +.Fn iswascii , +.Fn iswhexnumber , +.Fn iswideogram , +.Fn iswnumber , +.Fn iswphonogram , +.Fn iswrune , +and +.Fn iswspecial , +which are +.Fx +extensions. +.Sh CAVEATS +The result of these functions is undefined unless +the argument is +.Dv WEOF +or a valid +.Vt wchar_t +value for the current locale. diff --git a/locale/FreeBSD/isxdigit.3 b/locale/FreeBSD/isxdigit.3 new file mode 100644 index 0000000..b1c2faa --- /dev/null +++ b/locale/FreeBSD/isxdigit.3 @@ -0,0 +1,103 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isxdigit.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/isxdigit.3,v 1.25 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt ISXDIGIT 3 +.Os +.Sh NAME +.Nm isxdigit, ishexnumber +.Nd hexadecimal-digit character test +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn isxdigit "int c" +.Ft int +.Fn ishexnumber "int c" +.Sh DESCRIPTION +The +.Fn isxdigit +function tests for any hexadecimal-digit character. +Regardless of locale, this includes the following characters only: +.Pp +.Bl -column \&``0''______ \&``0''______ \&``0''______ \&``0''______ \&``0''______ +.It "\&``0''\t``1''\t``2''\t``3''\t``4''" +.It "\&``5''\t``6''\t``7''\t``8''\t``9''" +.It "\&``A''\t``B''\t``C''\t``D''\t``E''" +.It "\&``F''\t``a''\t``b''\t``c''\t``d''" +.It "\&``e''\t``f''" +.El +.Pp +The +.Fn ishexnumber +function behaves similarly to +.Fn isxdigit , +but may recognize additional characters, +depending on the current locale setting. +.Pp +The value of the argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Sh RETURN VALUES +The +.Fn isxdigit +function returns zero if the character tests false and +returns non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswxdigit +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isalnum_l 3 , +.Xr iswxdigit 3 , +.Xr ascii 7 +.Sh STANDARDS +The +.Fn isxdigit +function conforms to +.St -isoC . +.Sh HISTORY +The +.Fn ishexnumber +function appeared in +.Bx 4.4 . diff --git a/locale/FreeBSD/ldpart.c b/locale/FreeBSD/ldpart.c new file mode 100644 index 0000000..10172af --- /dev/null +++ b/locale/FreeBSD/ldpart.c @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2000, 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/ldpart.c,v 1.15 2004/04/25 19:56:50 ache Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "ldpart.h" +#include "setlocale.h" + +static int split_lines(char *, const char *); + +__private_extern__ int +__part_load_locale(const char *name, + unsigned char *using_locale, + char **locale_buf, + const char *category_filename, + int locale_buf_size_max, + int locale_buf_size_min, + const char **dst_localebuf) +{ + int saverr, fd, i, num_lines; + char *lbuf, *p; + const char *plim; + char filename[PATH_MAX]; + struct stat st; + size_t namesize, bufsize; + + /* + * Slurp the locale file into the cache. + */ + namesize = strlen(name) + 1; + + /* 'PathLocale' must be already set & checked. */ + + /* Range checking not needed, 'name' size is limited */ + strcpy(filename, name); + strcat(filename, "/"); + strcat(filename, category_filename); + if ((fd = __open_path_locale(filename)) < 0) + return (_LDP_ERROR); + if (_fstat(fd, &st) != 0) + goto bad_locale; + if (st.st_size <= 0) { + errno = EFTYPE; + goto bad_locale; + } + bufsize = namesize + st.st_size; + if ((lbuf = malloc(bufsize)) == NULL) { + errno = ENOMEM; + goto bad_locale; + } + (void)strcpy(lbuf, name); + p = lbuf + namesize; + plim = p + st.st_size; + if (_read(fd, p, (size_t) st.st_size) != st.st_size) + goto bad_lbuf; + /* + * Parse the locale file into localebuf. + */ + if (plim[-1] != '\n') { + errno = EFTYPE; + goto bad_lbuf; + } + num_lines = split_lines(p, plim); + if (num_lines >= locale_buf_size_max) + num_lines = locale_buf_size_max; + else if (num_lines < locale_buf_size_min) { + errno = EFTYPE; + goto bad_lbuf; + } + (void)_close(fd); + /* + * Record the successful parse in the cache. + */ + if (*locale_buf != NULL) + free(*locale_buf); + *locale_buf = lbuf; + for (p = *locale_buf, i = 0; i < num_lines; i++) + dst_localebuf[i] = (p += strlen(p) + 1); + for (i = num_lines; i < locale_buf_size_max; i++) + dst_localebuf[i] = NULL; + *using_locale = 1; + + return (_LDP_LOADED); + +bad_lbuf: + saverr = errno; + free(lbuf); + errno = saverr; +bad_locale: + saverr = errno; + (void)_close(fd); + errno = saverr; + + return (_LDP_ERROR); +} + +static int +split_lines(char *p, const char *plim) +{ + int i; + + i = 0; + while (p < plim) { + if (*p == '\n') { + *p = '\0'; + i++; + } + p++; + } + return (i); +} + +__private_extern__ void +__ldpart_free_extra(struct __xlocale_st_ldpart *lp) +{ + if (lp) + free(lp->_locale_buf); +} diff --git a/locale/FreeBSD/ldpart.h b/locale/FreeBSD/ldpart.h new file mode 100644 index 0000000..938f735 --- /dev/null +++ b/locale/FreeBSD/ldpart.h @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2000, 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/locale/ldpart.h,v 1.6 2003/06/13 00:14:07 jkh Exp $ + */ + +#ifndef _LDPART_H_ +#define _LDPART_H_ + +#define _LDP_LOADED 0 +#define _LDP_ERROR (-1) +#define _LDP_CACHE 1 + +int __part_load_locale(const char *, unsigned char *, char **, const char *, + int, int, const char **); + +#endif /* !_LDPART_H_ */ diff --git a/locale/FreeBSD/lmessages.c b/locale/FreeBSD/lmessages.c new file mode 100644 index 0000000..2874ca6 --- /dev/null +++ b/locale/FreeBSD/lmessages.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/lmessages.c,v 1.14 2003/06/26 10:46:16 phantom Exp $"); + +#include "xlocale_private.h" + +#include +#include + +#include "ldpart.h" +#include "lmessages.h" + +#define LCMESSAGES_SIZE_FULL (sizeof(struct lc_messages_T) / sizeof(char *)) +#define LCMESSAGES_SIZE_MIN \ + (offsetof(struct lc_messages_T, yesstr) / sizeof(char *)) + +static char empty[] = ""; + +static const struct lc_messages_T _C_messages_locale = { + "^[yY]" , /* yesexpr */ + "^[nN]" , /* noexpr */ + "yes" , /* yesstr */ + "no" /* nostr */ +}; + +__private_extern__ int +__messages_load_locale(const char *name, locale_t loc) +{ + int ret; + struct __xlocale_st_messages *xp; + static struct __xlocale_st_messages *cache = NULL; + + /* 'name' must be already checked. */ + if (strcmp(name, "C") == 0 || strcmp(name, "POSIX") == 0) { + loc->_messages_using_locale = 0; + XL_RELEASE(loc->__lc_messages); + loc->__lc_messages = NULL; + return (_LDP_CACHE); + } + + /* + * If the locale name is the same as our cache, use the cache. + */ + if (cache && cache->_messages_locale_buf && strcmp(name, cache->_messages_locale_buf) == 0) { + loc->_messages_using_locale = 1; + XL_RELEASE(loc->__lc_messages); + loc->__lc_messages = cache; + XL_RETAIN(loc->__lc_messages); + return (_LDP_CACHE); + } + if ((xp = (struct __xlocale_st_messages *)malloc(sizeof(*xp))) == NULL) + return _LDP_ERROR; + xp->__refcount = 1; + xp->__free_extra = (__free_extra_t)__ldpart_free_extra; + xp->_messages_locale_buf = NULL; + + ret = __part_load_locale(name, &loc->_messages_using_locale, + &xp->_messages_locale_buf, "LC_MESSAGES/LC_MESSAGES", + LCMESSAGES_SIZE_FULL, LCMESSAGES_SIZE_MIN, + (const char **)&xp->_messages_locale); + if (ret == _LDP_LOADED) { + if (xp->_messages_locale.yesstr == NULL) + xp->_messages_locale.yesstr = empty; + if (xp->_messages_locale.nostr == NULL) + xp->_messages_locale.nostr = empty; + XL_RELEASE(loc->__lc_messages); + loc->__lc_messages = xp; + XL_RELEASE(cache); + cache = xp; + XL_RETAIN(cache); + } else if (ret == _LDP_ERROR) + free(xp); + return (ret); +} + +__private_extern__ struct lc_messages_T * +__get_current_messages_locale(locale_t loc) +{ + return (loc->_messages_using_locale + ? &loc->__lc_messages->_messages_locale + : (struct lc_messages_T *)&_C_messages_locale); +} + +#ifdef LOCALE_DEBUG +void +msgdebug() { +locale_t loc = __current_locale(); +printf( "yesexpr = %s\n" + "noexpr = %s\n" + "yesstr = %s\n" + "nostr = %s\n", + loc->__lc_messages->_messages_locale.yesexpr, + loc->__lc_messages->_messages_locale.noexpr, + loc->__lc_messages->_messages_locale.yesstr, + loc->__lc_messages->_messages_locale.nostr +); +} +#endif /* LOCALE_DEBUG */ diff --git a/locale/FreeBSD/lmessages.h b/locale/FreeBSD/lmessages.h new file mode 100644 index 0000000..47f08a9 --- /dev/null +++ b/locale/FreeBSD/lmessages.h @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2000, 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/locale/lmessages.h,v 1.3 2001/12/20 18:28:52 phantom Exp $ + */ + +#ifndef _LMESSAGES_H_ +#define _LMESSAGES_H_ + +#include + +struct lc_messages_T { + const char *yesexpr; + const char *noexpr; + const char *yesstr; + const char *nostr; +}; + +struct lc_messages_T *__get_current_messages_locale(locale_t); +int __messages_load_locale(const char *, locale_t); + +#endif /* !_LMESSAGES_H_ */ diff --git a/locale/FreeBSD/lmonetary.c b/locale/FreeBSD/lmonetary.c new file mode 100644 index 0000000..24091ea --- /dev/null +++ b/locale/FreeBSD/lmonetary.c @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2000, 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/lmonetary.c,v 1.19 2003/06/26 10:46:16 phantom Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include + +#include "ldpart.h" +#include "lmonetary.h" + +extern const char * __fix_locale_grouping_str(const char *); + +#define LCMONETARY_SIZE_FULL (sizeof(struct lc_monetary_T) / sizeof(char *)) +#define LCMONETARY_SIZE_MIN \ + (offsetof(struct lc_monetary_T, int_p_cs_precedes) / \ + sizeof(char *)) + +static char empty[] = ""; +static char numempty[] = { CHAR_MAX, '\0'}; + +static const struct lc_monetary_T _C_monetary_locale = { + empty, /* int_curr_symbol */ + empty, /* currency_symbol */ + empty, /* mon_decimal_point */ + empty, /* mon_thousands_sep */ + empty, /* mon_grouping [C99 7.11.2.1]*/ + empty, /* positive_sign */ + empty, /* negative_sign */ + numempty, /* int_frac_digits */ + numempty, /* frac_digits */ + numempty, /* p_cs_precedes */ + numempty, /* p_sep_by_space */ + numempty, /* n_cs_precedes */ + numempty, /* n_sep_by_space */ + numempty, /* p_sign_posn */ + numempty, /* n_sign_posn */ + numempty, /* int_p_cs_precedes */ + numempty, /* int_n_cs_precedes */ + numempty, /* int_p_sep_by_space */ + numempty, /* int_n_sep_by_space */ + numempty, /* int_p_sign_posn */ + numempty /* int_n_sign_posn */ +}; + +static char +cnv(const char *str) +{ + int i = strtol(str, NULL, 10); + + if (i == -1) + i = CHAR_MAX; + return ((char)i); +} + +__private_extern__ int +__monetary_load_locale(const char *name, locale_t loc) +{ + int ret; + struct __xlocale_st_monetary *xp; + static struct __xlocale_st_monetary *cache = NULL; + + /* 'name' must be already checked. */ + if (strcmp(name, "C") == 0 || strcmp(name, "POSIX") == 0) { + if (!loc->_monetary_using_locale) + return (_LDP_CACHE); + loc->_monetary_using_locale = 0; + XL_RELEASE(loc->__lc_monetary); + loc->__lc_monetary = NULL; + loc->__mlocale_changed = 1; + return (_LDP_CACHE); + } + + if (loc->_monetary_using_locale && strcmp(name, loc->__lc_monetary->_monetary_locale_buf) == 0) + return (_LDP_CACHE); + /* + * If the locale name is the same as our cache, use the cache. + */ + if (cache && cache->_monetary_locale_buf && strcmp(name, cache->_monetary_locale_buf) == 0) { + loc->_monetary_using_locale = 1; + XL_RELEASE(loc->__lc_monetary); + loc->__lc_monetary = cache; + XL_RETAIN(loc->__lc_monetary); + loc->__mlocale_changed = 1; + return (_LDP_CACHE); + } + if ((xp = (struct __xlocale_st_monetary *)malloc(sizeof(*xp))) == NULL) + return _LDP_ERROR; + xp->__refcount = 1; + xp->__free_extra = (__free_extra_t)__ldpart_free_extra; + xp->_monetary_locale_buf = NULL; + + ret = __part_load_locale(name, &loc->_monetary_using_locale, + &xp->_monetary_locale_buf, "LC_MONETARY", + LCMONETARY_SIZE_FULL, LCMONETARY_SIZE_MIN, + (const char **)&xp->_monetary_locale); + if (ret != _LDP_ERROR) + loc->__mlocale_changed = 1; + else + free(xp); + if (ret == _LDP_LOADED) { + xp->_monetary_locale.mon_grouping = + __fix_locale_grouping_str(xp->_monetary_locale.mon_grouping); + +#define M_ASSIGN_CHAR(NAME) (((char *)xp->_monetary_locale.NAME)[0] = \ + cnv(xp->_monetary_locale.NAME)) + + M_ASSIGN_CHAR(int_frac_digits); + M_ASSIGN_CHAR(frac_digits); + M_ASSIGN_CHAR(p_cs_precedes); + M_ASSIGN_CHAR(p_sep_by_space); + M_ASSIGN_CHAR(n_cs_precedes); + M_ASSIGN_CHAR(n_sep_by_space); + M_ASSIGN_CHAR(p_sign_posn); + M_ASSIGN_CHAR(n_sign_posn); + + /* + * The six additional C99 international monetary formatting + * parameters default to the national parameters when + * reading FreeBSD LC_MONETARY data files. + */ +#define M_ASSIGN_ICHAR(NAME) \ + do { \ + if (xp->_monetary_locale.int_##NAME == NULL) \ + xp->_monetary_locale.int_##NAME = \ + xp->_monetary_locale.NAME; \ + else \ + M_ASSIGN_CHAR(int_##NAME); \ + } while (0) + + M_ASSIGN_ICHAR(p_cs_precedes); + M_ASSIGN_ICHAR(n_cs_precedes); + M_ASSIGN_ICHAR(p_sep_by_space); + M_ASSIGN_ICHAR(n_sep_by_space); + M_ASSIGN_ICHAR(p_sign_posn); + M_ASSIGN_ICHAR(n_sign_posn); + XL_RELEASE(loc->__lc_monetary); + loc->__lc_monetary = xp; + XL_RELEASE(cache); + cache = xp; + XL_RETAIN(cache); + } + return (ret); +} + +__private_extern__ struct lc_monetary_T * +__get_current_monetary_locale(locale_t loc) +{ + return (loc->_monetary_using_locale + ? &loc->__lc_monetary->_monetary_locale + : (struct lc_monetary_T *)&_C_monetary_locale); +} + +#ifdef LOCALE_DEBUG +void +monetdebug() { +locale_t loc = __current_locale(); +printf( "int_curr_symbol = %s\n" + "currency_symbol = %s\n" + "mon_decimal_point = %s\n" + "mon_thousands_sep = %s\n" + "mon_grouping = %s\n" + "positive_sign = %s\n" + "negative_sign = %s\n" + "int_frac_digits = %d\n" + "frac_digits = %d\n" + "p_cs_precedes = %d\n" + "p_sep_by_space = %d\n" + "n_cs_precedes = %d\n" + "n_sep_by_space = %d\n" + "p_sign_posn = %d\n" + "n_sign_posn = %d\n", + "int_p_cs_precedes = %d\n" + "int_p_sep_by_space = %d\n" + "int_n_cs_precedes = %d\n" + "int_n_sep_by_space = %d\n" + "int_p_sign_posn = %d\n" + "int_n_sign_posn = %d\n", + loc->__lc_monetary->_monetary_locale.int_curr_symbol, + loc->__lc_monetary->_monetary_locale.currency_symbol, + loc->__lc_monetary->_monetary_locale.mon_decimal_point, + loc->__lc_monetary->_monetary_locale.mon_thousands_sep, + loc->__lc_monetary->_monetary_locale.mon_grouping, + loc->__lc_monetary->_monetary_locale.positive_sign, + loc->__lc_monetary->_monetary_locale.negative_sign, + loc->__lc_monetary->_monetary_locale.int_frac_digits[0], + loc->__lc_monetary->_monetary_locale.frac_digits[0], + loc->__lc_monetary->_monetary_locale.p_cs_precedes[0], + loc->__lc_monetary->_monetary_locale.p_sep_by_space[0], + loc->__lc_monetary->_monetary_locale.n_cs_precedes[0], + loc->__lc_monetary->_monetary_locale.n_sep_by_space[0], + loc->__lc_monetary->_monetary_locale.p_sign_posn[0], + loc->__lc_monetary->_monetary_locale.n_sign_posn[0], + loc->__lc_monetary->_monetary_locale.int_p_cs_precedes[0], + loc->__lc_monetary->_monetary_locale.int_p_sep_by_space[0], + loc->__lc_monetary->_monetary_locale.int_n_cs_precedes[0], + loc->__lc_monetary->_monetary_locale.int_n_sep_by_space[0], + loc->__lc_monetary->_monetary_locale.int_p_sign_posn[0], + loc->__lc_monetary->_monetary_locale.int_n_sign_posn[0] +); +} +#endif /* LOCALE_DEBUG */ diff --git a/locale/FreeBSD/lmonetary.h b/locale/FreeBSD/lmonetary.h new file mode 100644 index 0000000..b7c3d0f --- /dev/null +++ b/locale/FreeBSD/lmonetary.h @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2000, 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/locale/lmonetary.h,v 1.4 2002/10/09 09:19:28 tjr Exp $ + */ + +#ifndef _LMONETARY_H_ +#define _LMONETARY_H_ + +#include + +struct lc_monetary_T { + const char *int_curr_symbol; + const char *currency_symbol; + const char *mon_decimal_point; + const char *mon_thousands_sep; + const char *mon_grouping; + const char *positive_sign; + const char *negative_sign; + const char *int_frac_digits; + const char *frac_digits; + const char *p_cs_precedes; + const char *p_sep_by_space; + const char *n_cs_precedes; + const char *n_sep_by_space; + const char *p_sign_posn; + const char *n_sign_posn; + const char *int_p_cs_precedes; + const char *int_n_cs_precedes; + const char *int_p_sep_by_space; + const char *int_n_sep_by_space; + const char *int_p_sign_posn; + const char *int_n_sign_posn; +}; + +struct lc_monetary_T *__get_current_monetary_locale(locale_t); +int __monetary_load_locale(const char *, locale_t); + +#endif /* !_LMONETARY_H_ */ diff --git a/locale/FreeBSD/lnumeric.c b/locale/FreeBSD/lnumeric.c new file mode 100644 index 0000000..adfa25b --- /dev/null +++ b/locale/FreeBSD/lnumeric.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2000, 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/lnumeric.c,v 1.16 2003/06/26 10:46:16 phantom Exp $"); + +#include "xlocale_private.h" + +#include +#include + +#include "ldpart.h" +#include "lnumeric.h" + +extern const char *__fix_locale_grouping_str(const char *); + +#define LCNUMERIC_SIZE (sizeof(struct lc_numeric_T) / sizeof(char *)) + +static const struct lc_numeric_T _C_numeric_locale = { + ".", /* decimal_point */ + "", /* thousands_sep */ + "" /* grouping [C99 7.11.2.1]*/ +}; + +__private_extern__ int +__numeric_load_locale(const char *name, locale_t loc) +{ + int ret; + struct __xlocale_st_numeric *xp; + static struct __xlocale_st_numeric *cache = NULL; + + /* 'name' must be already checked. */ + if (strcmp(name, "C") == 0 || strcmp(name, "POSIX") == 0) { + if (!loc->_numeric_using_locale) + return (_LDP_CACHE); + loc->_numeric_using_locale = 0; + XL_RELEASE(loc->__lc_numeric); + loc->__lc_numeric = NULL; + loc->__nlocale_changed = 1; + return (_LDP_CACHE); + } + + if (loc->_numeric_using_locale && strcmp(name, loc->__lc_numeric->_numeric_locale_buf) == 0) + return (_LDP_CACHE); + /* + * If the locale name is the same as our cache, use the cache. + */ + if (cache && cache->_numeric_locale_buf && strcmp(name, cache->_numeric_locale_buf) == 0) { + loc->_numeric_using_locale = 1; + XL_RELEASE(loc->__lc_numeric); + loc->__lc_numeric = cache; + XL_RETAIN(loc->__lc_numeric); + loc->__nlocale_changed = 1; + return (_LDP_CACHE); + } + if ((xp = (struct __xlocale_st_numeric *)malloc(sizeof(*xp))) == NULL) + return _LDP_ERROR; + xp->__refcount = 1; + xp->__free_extra = (__free_extra_t)__ldpart_free_extra; + xp->_numeric_locale_buf = NULL; + + ret = __part_load_locale(name, &loc->_numeric_using_locale, + &xp->_numeric_locale_buf, "LC_NUMERIC", + LCNUMERIC_SIZE, LCNUMERIC_SIZE, + (const char **)&xp->_numeric_locale); + if (ret != _LDP_ERROR) + loc->__nlocale_changed = 1; + else + free(xp); + if (ret == _LDP_LOADED) { + /* Can't be empty according to C99 */ + if (*xp->_numeric_locale.decimal_point == '\0') + xp->_numeric_locale.decimal_point = + _C_numeric_locale.decimal_point; + xp->_numeric_locale.grouping = + __fix_locale_grouping_str(xp->_numeric_locale.grouping); + XL_RELEASE(loc->__lc_numeric); + loc->__lc_numeric = xp; + XL_RELEASE(cache); + cache = xp; + XL_RETAIN(cache); + } + return (ret); +} + +__private_extern__ struct lc_numeric_T * +__get_current_numeric_locale(locale_t loc) +{ + return (loc->_numeric_using_locale + ? &loc->__lc_numeric->_numeric_locale + : (struct lc_numeric_T *)&_C_numeric_locale); +} + +#ifdef LOCALE_DEBUG +void +numericdebug(void) { +locale_t loc = __current_locale(); +printf( "decimal_point = %s\n" + "thousands_sep = %s\n" + "grouping = %s\n", + loc->__lc_numeric->_numeric_locale.decimal_point, + loc->__lc_numeric->_numeric_locale.thousands_sep, + loc->__lc_numeric->_numeric_locale.grouping +); +} +#endif /* LOCALE_DEBUG */ diff --git a/locale/FreeBSD/lnumeric.h b/locale/FreeBSD/lnumeric.h new file mode 100644 index 0000000..e91835c --- /dev/null +++ b/locale/FreeBSD/lnumeric.h @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2000, 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/locale/lnumeric.h,v 1.3 2001/12/20 18:28:52 phantom Exp $ + */ + +#ifndef _LNUMERIC_H_ +#define _LNUMERIC_H_ + +#include + +struct lc_numeric_T { + const char *decimal_point; + const char *thousands_sep; + const char *grouping; +}; + +struct lc_numeric_T *__get_current_numeric_locale(locale_t); +int __numeric_load_locale(const char *, locale_t); + +#endif /* !_LNUMERIC_H_ */ diff --git a/locale/FreeBSD/localeconv.3 b/locale/FreeBSD/localeconv.3 new file mode 100644 index 0000000..01df550 --- /dev/null +++ b/locale/FreeBSD/localeconv.3 @@ -0,0 +1,239 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Donn Seeley at BSDI. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From @(#)setlocale.3 8.1 (Berkeley) 6/9/93 +.\" From FreeBSD: src/lib/libc/locale/setlocale.3,v 1.28 2003/11/15 02:26:04 tjr Exp +.\" $FreeBSD: src/lib/libc/locale/localeconv.3,v 1.3 2007/01/09 00:28:00 imp Exp $ +.\" +.Dd November 21, 2003 +.Dt LOCALECONV 3 +.Os +.Sh NAME +.Nm localeconv , +.Nm localeconv_l +.Nd natural language formatting for C +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In locale.h +.Ft struct lconv * +.Fo localeconv +.Fa "void" +.Fc +.In xlocale.h +.Ft struct lconv * +.Fo localeconv_l +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn localeconv +function returns a pointer to a structure +which provides parameters for formatting numbers, +especially currency values: +.Bd -literal -offset indent +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; + char int_p_cs_precedes; + char int_n_cs_precedes; + char int_p_sep_by_space; + char int_n_sep_by_space; + char int_p_sign_posn; + char int_n_sign_posn; +}; +.Ed +.Pp +The individual fields have the following meanings: +.Pp +.Bl -tag -width mon_decimal_point +.It Va decimal_point +The decimal point character, except for currency values, +cannot be an empty string. +.It Va thousands_sep +The separator between groups of digits +before the decimal point, except for currency values. +.It Va grouping +The sizes of the groups of digits, except for currency values. +This is a pointer to a vector of integers, each of size +.Vt char , +representing group size from low order digit groups +to high order (right to left). +The list may be terminated with 0 or +.Dv CHAR_MAX . +If the list is terminated with 0, +the last group size before the 0 is repeated to account for all the digits. +If the list is terminated with +.Dv CHAR_MAX , +no more grouping is performed. +.It Va int_curr_symbol +The standardized international currency symbol. +.It Va currency_symbol +The local currency symbol. +.It Va mon_decimal_point +The decimal point character for currency values. +.It Va mon_thousands_sep +The separator for digit groups in currency values. +.It Va mon_grouping +Like +.Va grouping +but for currency values. +.It Va positive_sign +The character used to denote nonnegative currency values, +usually the empty string. +.It Va negative_sign +The character used to denote negative currency values, +usually a minus sign. +.It Va int_frac_digits +The number of digits after the decimal point +in an international-style currency value. +.It Va frac_digits +The number of digits after the decimal point +in the local style for currency values. +.It Va p_cs_precedes +1 if the currency symbol precedes the currency value +for nonnegative values, 0 if it follows. +.It Va p_sep_by_space +1 if a space is inserted between the currency symbol +and the currency value for nonnegative values, 0 otherwise. +.It Va n_cs_precedes +Like +.Va p_cs_precedes +but for negative values. +.It Va n_sep_by_space +Like +.Va p_sep_by_space +but for negative values. +.It Va p_sign_posn +The location of the +.Va positive_sign +with respect to a nonnegative quantity and the +.Va currency_symbol , +coded as follows: +.Pp +.Bl -tag -width 3n -compact +.It Li 0 +Parentheses around the entire string. +.It Li 1 +Before the string. +.It Li 2 +After the string. +.It Li 3 +Just before +.Va currency_symbol . +.It Li 4 +Just after +.Va currency_symbol . +.El +.It Va n_sign_posn +Like +.Va p_sign_posn +but for negative currency values. +.It Va int_p_cs_precedes +Same as +.Va p_cs_precedes , +but for internationally formatted monetary quantities. +.It Va int_n_cs_precedes +Same as +.Va n_cs_precedes , +but for internationally formatted monetary quantities. +.It Va int_p_sep_by_space +Same as +.Va p_sep_by_space , +but for internationally formatted monetary quantities. +.It Va int_n_sep_by_space +Same as +.Va n_sep_by_space , +but for internationally formatted monetary quantities. +.It Va int_p_sign_posn +Same as +.Va p_sign_posn , +but for internationally formatted monetary quantities. +.It Va int_n_sign_posn +Same as +.Va n_sign_posn , +but for internationally formatted monetary quantities. +.El +.Pp +Unless mentioned above, +an empty string as a value for a field +indicates a zero length result or +a value that is not in the current locale. +A +.Dv CHAR_MAX +result similarly denotes an unavailable value. +.Pp +While the +.Fn localeconv +function uses the current locale, the +.Fn localeconv_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn localeconv +function returns a pointer to a static object +which may be altered by later calls to +.Xr setlocale 3 +or +.Fn localeconv . +.Sh ERRORS +No errors are defined. +.Sh SEE ALSO +.Xr setlocale 3 , +.Xr strfmon 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn localeconv +function conforms to +.St -isoC-99 . +.Sh HISTORY +The +.Fn localeconv +function first appeared in +.Bx 4.4 . diff --git a/locale/FreeBSD/localeconv.c b/locale/FreeBSD/localeconv.c new file mode 100644 index 0000000..bad6ae8 --- /dev/null +++ b/locale/FreeBSD/localeconv.c @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2001 Alexey Zelkin + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)localeconv.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/localeconv.c,v 1.14 2007/12/12 07:43:23 phantom Exp $"); + +#include "xlocale_private.h" + +#include +#include + +#include "lmonetary.h" +#include "lnumeric.h" + +#ifdef __APPLE_PR3417676_HACK__ +/*------------------------------------------------------------------------ + * PR-3417676: We need to provide a way to force "C" locale style number + * formatting independent of the locale setting. We provide private + * routines to get and set a flag that tells localeconv() to either return + * a "C" struct lconv, or the one dependent on the actual locale. + *------------------------------------------------------------------------*/ +static char empty[] = ""; +static char numempty[] = { CHAR_MAX, '\0' }; + +/* + * Default (C) locale conversion. + */ +static struct lconv _C_lconv = { + ".", /* decimal_point */ + empty, /* thousands_sep */ + numempty, /* grouping */ + empty, /* int_curr_symbol */ + empty, /* currency_symbol */ + empty, /* mon_decimal_point */ + empty, /* mon_thousands_sep */ + numempty, /* mon_grouping */ + empty, /* positive_sign */ + empty, /* negative_sign */ + CHAR_MAX, /* int_frac_digits */ + CHAR_MAX, /* frac_digits */ + CHAR_MAX, /* p_cs_precedes */ + CHAR_MAX, /* p_sep_by_space */ + CHAR_MAX, /* n_cs_precedes */ + CHAR_MAX, /* n_sep_by_space */ + CHAR_MAX, /* p_sign_posn */ + CHAR_MAX, /* n_sign_posn */ + CHAR_MAX, /* int_p_cs_precedes */ + CHAR_MAX, /* int_n_cs_precedes */ + CHAR_MAX, /* int_p_sep_by_space */ + CHAR_MAX, /* int_n_sep_by_space */ + CHAR_MAX, /* int_p_sign_posn */ + CHAR_MAX, /* int_n_sign_posn */ +}; +static int _onlyClocaleconv = 0; + +int +__getonlyClocaleconv(void) +{ + return _onlyClocaleconv; +} + +int +__setonlyClocaleconv(int val) +{ + int prev = _onlyClocaleconv; + + _onlyClocaleconv = val; + return prev; +} +#endif /* __APPLE_PR3417676_HACK__ */ + +/* + * The localeconv() function constructs a struct lconv from the current + * monetary and numeric locales. + * + * Because localeconv() may be called many times (especially by library + * routines like printf() & strtod()), the approprate members of the + * lconv structure are computed only when the monetary or numeric + * locale has been changed. + */ + +/* + * Return the current locale conversion. + */ +struct lconv * +localeconv_l(locale_t loc) +{ + NORMALIZE_LOCALE(loc); + + if (loc->__mlocale_changed) { + XL_LOCK(loc); + if (loc->__mlocale_changed) { + /* LC_MONETARY part */ + struct lc_monetary_T * mptr; + struct lconv *lc = &loc->__lc_localeconv; + +#define M_ASSIGN_STR(NAME) (lc->NAME = (char*)mptr->NAME) +#define M_ASSIGN_CHAR(NAME) (lc->NAME = mptr->NAME[0]) + + mptr = __get_current_monetary_locale(loc); + M_ASSIGN_STR(int_curr_symbol); + M_ASSIGN_STR(currency_symbol); + M_ASSIGN_STR(mon_decimal_point); + M_ASSIGN_STR(mon_thousands_sep); + M_ASSIGN_STR(mon_grouping); + M_ASSIGN_STR(positive_sign); + M_ASSIGN_STR(negative_sign); + M_ASSIGN_CHAR(int_frac_digits); + M_ASSIGN_CHAR(frac_digits); + M_ASSIGN_CHAR(p_cs_precedes); + M_ASSIGN_CHAR(p_sep_by_space); + M_ASSIGN_CHAR(n_cs_precedes); + M_ASSIGN_CHAR(n_sep_by_space); + M_ASSIGN_CHAR(p_sign_posn); + M_ASSIGN_CHAR(n_sign_posn); + M_ASSIGN_CHAR(int_p_cs_precedes); + M_ASSIGN_CHAR(int_n_cs_precedes); + M_ASSIGN_CHAR(int_p_sep_by_space); + M_ASSIGN_CHAR(int_n_sep_by_space); + M_ASSIGN_CHAR(int_p_sign_posn); + M_ASSIGN_CHAR(int_n_sign_posn); + loc->__mlocale_changed = 0; + } + XL_UNLOCK(loc); + } + + if (loc->__nlocale_changed) { + XL_LOCK(loc); + if (loc->__nlocale_changed) { + /* LC_NUMERIC part */ + struct lc_numeric_T * nptr; + struct lconv *lc = &loc->__lc_localeconv; + +#define N_ASSIGN_STR(NAME) (lc->NAME = (char*)nptr->NAME) + + nptr = __get_current_numeric_locale(loc); + N_ASSIGN_STR(decimal_point); + N_ASSIGN_STR(thousands_sep); + N_ASSIGN_STR(grouping); + loc->__nlocale_changed = 0; + } + XL_UNLOCK(loc); + } + + return &loc->__lc_localeconv; +} + +/* + * Return the current locale conversion. + */ +struct lconv * +localeconv() +{ +#ifdef __APPLE_PR3417676_HACK__ + /*-------------------------------------------------------------------- + * If _onlyClocaleconv is non-zero, just return __lconv, which is a "C" + * struct lconv *. Otherwise, do the normal thing. + *--------------------------------------------------------------------*/ + if (_onlyClocaleconv) + return &_C_lconv; +#endif /* __APPLE_PR3417676_HACK__ */ + return localeconv_l(__current_locale()); +} diff --git a/locale/FreeBSD/mblen.3 b/locale/FreeBSD/mblen.3 new file mode 100644 index 0000000..c3530e1 --- /dev/null +++ b/locale/FreeBSD/mblen.3 @@ -0,0 +1,127 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Donn Seeley of BSDI. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From @(#)multibyte.3 8.1 (Berkeley) 6/4/93 +.\" From FreeBSD: src/lib/libc/locale/multibyte.3,v 1.22 2003/11/08 03:23:11 tjr Exp +.\" $FreeBSD: src/lib/libc/locale/mblen.3,v 1.6 2007/01/09 00:28:00 imp Exp $ +.\" +.Dd April 11, 2004 +.Dt MBLEN 3 +.Os +.Sh NAME +.Nm mblen , +.Nm mblen_l +.Nd get number of bytes in a character +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fo mblen +.Fa "const char *s" +.Fa "size_t n" +.Fc +.In stdlib.h +.In xlocale.h +.Ft int +.Fo mblen_l +.Fa "const char *s" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn mblen +function computes the length, in bytes, +of a multibyte character +.Fa s , +according to the current conversion state. +Up to +.Fa n +bytes are examined. +.Pp +A call with a null +.Fa s +pointer returns nonzero if the current locale requires shift states, +zero otherwise. +If shift states are required, the shift state is reset to the initial state. +.Pp +Although the +.Fn mblen +function uses the current locale, the +.Fn mblen_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If +.Fa s +is +.Dv NULL , +the +.Fn mblen +function returns nonzero if shift states are supported, +zero otherwise. +.Pp +Otherwise, if +.Fa s +is not a null pointer, +.Fn mblen +either returns 0 if +.Fa s +represents the null wide character, or returns +the number of bytes processed in +.Fa s , +or returns \-1 if no multibyte character +could be recognized or converted. +In this case, +.Fn mblen Ns 's +internal conversion state is undefined. +.Sh ERRORS +The +.Fn mblen +function will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid multibyte sequence was detected. +.It Bq Er EINVAL +The internal conversion state is not valid. +.El +.Sh SEE ALSO +.Xr mbrlen 3 , +.Xr mbtowc 3 , +.Xr multibyte 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn mblen +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/mblen.c b/locale/FreeBSD/mblen.c new file mode 100644 index 0000000..f6bfa52 --- /dev/null +++ b/locale/FreeBSD/mblen.c @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mblen.c,v 1.9 2004/07/29 06:18:40 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include "mblocal.h" + +int +mblen_l(const char *s, size_t n, locale_t loc) +{ + static const mbstate_t initial; + size_t rval; + + NORMALIZE_LOCALE(loc); + if (s == NULL) { + /* No support for state dependent encodings. */ + loc->__mbs_mblen = initial; + return (0); + } + rval = loc->__lc_ctype->__mbrtowc(NULL, s, n, &loc->__mbs_mblen, loc); + if (rval == (size_t)-1 || rval == (size_t)-2) + return (-1); + return ((int)rval); +} + +int +mblen(const char *s, size_t n) +{ + return mblen_l(s, n, __current_locale()); +} diff --git a/locale/FreeBSD/mblocal.h b/locale/FreeBSD/mblocal.h new file mode 100644 index 0000000..8029a70 --- /dev/null +++ b/locale/FreeBSD/mblocal.h @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/locale/mblocal.h,v 1.7 2008/01/21 23:48:12 ache Exp $ + */ + +#ifndef _MBLOCAL_H_ +#define _MBLOCAL_H_ + +#include + +/* + * Rune initialization function prototypes. + */ +__attribute__((visibility("hidden"))) int _none_init(struct __xlocale_st_runelocale *); +__attribute__((visibility("hidden"))) int _ascii_init(struct __xlocale_st_runelocale *); +__attribute__((visibility("hidden"))) int _UTF2_init(struct __xlocale_st_runelocale *); +__attribute__((visibility("hidden"))) int _UTF8_init(struct __xlocale_st_runelocale *); +__attribute__((visibility("hidden"))) int _EUC_init(struct __xlocale_st_runelocale *); +__attribute__((visibility("hidden"))) int _GB18030_init(struct __xlocale_st_runelocale *); +__attribute__((visibility("hidden"))) int _GB2312_init(struct __xlocale_st_runelocale *); +__attribute__((visibility("hidden"))) int _GBK_init(struct __xlocale_st_runelocale *); +__attribute__((visibility("hidden"))) int _BIG5_init(struct __xlocale_st_runelocale *); +__attribute__((visibility("hidden"))) int _MSKanji_init(struct __xlocale_st_runelocale *); + +__attribute__((visibility("hidden"))) size_t _none_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +__attribute__((visibility("hidden"))) int _none_mbsinit(const mbstate_t *, locale_t); +__attribute__((visibility("hidden"))) size_t _none_mbsnrtowcs(wchar_t * __restrict dst, + const char ** __restrict src, size_t nms, size_t len, + mbstate_t * __restrict ps __unused, locale_t); +__attribute__((visibility("hidden"))) size_t _none_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); +__attribute__((visibility("hidden"))) size_t _none_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict, locale_t); + +extern size_t __mbsnrtowcs_std(wchar_t * __restrict, const char ** __restrict, + size_t, size_t, mbstate_t * __restrict, locale_t); +extern size_t __wcsnrtombs_std(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict, locale_t); + +#endif /* _MBLOCAL_H_ */ diff --git a/locale/FreeBSD/mbrlen.3 b/locale/FreeBSD/mbrlen.3 new file mode 100644 index 0000000..ca7be65 --- /dev/null +++ b/locale/FreeBSD/mbrlen.3 @@ -0,0 +1,168 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/mbrlen.3,v 1.8 2004/06/30 19:32:41 ru Exp $ +.\" +.Dd April 7, 2004 +.Dt MBRLEN 3 +.Os +.Sh NAME +.Nm mbrlen , +.Nm mbrlen_l +.Nd "get number of bytes in a character (restartable)" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft size_t +.Fo mbrlen +.Fa "const char *restrict s" +.Fa "size_t n" +.Fa "mbstate_t *restrict ps" +.Fc +.In wchar.h +.In xlocale.h +.Ft size_t +.Fo mbrlen_l +.Fa "const char *restrict s" +.Fa "size_t n" +.Fa "mbstate_t *restrict ps" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn mbrlen +function inspects at most +.Fa n +bytes, pointed to by +.Fa s , +to determine the number of bytes needed to complete the next +multibyte character. +.Pp +The +.Vt mbstate_t +argument, +.Fa ps , +is used to keep track of the shift state. +If it is +.Dv NULL , +.Fn mbrlen +uses an internal, static +.Vt mbstate_t +object, which is initialized to the initial conversion state +at program startup. +.Pp +It is equivalent to: +.Pp +.Dl "mbrtowc(NULL, s, n, ps);" +.Pp +Except that, when +.Fa ps +is a +.Dv NULL +pointer, +.Fn mbrlen +uses its own static, internal +.Vt mbstate_t +object to keep track of the shift state. +.Pp +Although the +.Fn mbrlen +function uses the current locale, the +.Fn mbrlen_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn mbrlen +functions returns: +.Bl -tag -width indent +.It 0 +The next +.Fa n +or fewer bytes +represent the null wide character +.Pq Li "L'\e0'" . +.It >0 +The next +.Fa n +or fewer bytes +represent a valid character, +.Fn mbrlen +returns the number of bytes used to complete the multibyte character. +.It Po Vt size_t Pc Ns \-2 +The next +.Fa n +contribute to, but do not complete, a valid multibyte character sequence, +and all +.Fa n +bytes have been processed. +.It Po Vt size_t Pc Ns \-1 +An encoding error has occurred. +The next +.Fa n +or fewer bytes do not contribute to a valid multibyte character. +.El +.Sh EXAMPLES +A function that calculates the number of characters in a multibyte +character string: +.Bd -literal -offset indent +size_t +nchars(const char *s) +{ + size_t charlen, chars; + mbstate_t mbs; + + chars = 0; + memset(&mbs, 0, sizeof(mbs)); + while ((charlen = mbrlen(s, MB_CUR_MAX, &mbs)) != 0 && + charlen != (size_t)-1 && charlen != (size_t)-2) { + s += charlen; + chars++; + } + + return (chars); +} +.Ed +.Sh ERRORS +The +.Fn mbrlen +function will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid multibyte sequence was detected. +.It Bq Er EINVAL +The conversion state is invalid. +.El +.Sh SEE ALSO +.Xr mblen 3 , +.Xr mbrtowc 3 , +.Xr multibyte 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn mbrlen +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/mbrlen.c b/locale/FreeBSD/mbrlen.c new file mode 100644 index 0000000..2f0227a --- /dev/null +++ b/locale/FreeBSD/mbrlen.c @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mbrlen.c,v 1.4 2004/05/12 14:26:54 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include "mblocal.h" + +size_t +mbrlen_l(const char * __restrict s, size_t n, mbstate_t * __restrict ps, + locale_t loc) +{ + NORMALIZE_LOCALE(loc); + if (ps == NULL) + ps = &loc->__mbs_mbrlen; + return (loc->__lc_ctype->__mbrtowc(NULL, s, n, ps, loc)); +} + +size_t +mbrlen(const char * __restrict s, size_t n, mbstate_t * __restrict ps) +{ + return mbrlen_l(s, n, ps, __current_locale()); +} diff --git a/locale/FreeBSD/mbrtowc.3 b/locale/FreeBSD/mbrtowc.3 new file mode 100644 index 0000000..4066184 --- /dev/null +++ b/locale/FreeBSD/mbrtowc.3 @@ -0,0 +1,161 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/mbrtowc.3,v 1.5 2004/06/30 19:32:41 ru Exp $ +.\" +.Dd April 8, 2004 +.Dt MBRTOWC 3 +.Os +.Sh NAME +.Nm mbrtowc , +.Nm mbrtowc_l +.Nd "convert a character to a wide-character code (restartable)" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft size_t +.Fo mbrtowc +.Fa "wchar_t *restrict pwc" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fa "mbstate_t *restrict ps" +.Fc +.In wchar.h +.In xlocale.h +.Ft size_t +.Fo mbrtowc_l +.Fa "wchar_t *restrict pwc" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fa "mbstate_t *restrict ps" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn mbrtowc +function inspects at most +.Fa n +bytes, pointed to by +.Fa s , +to determine the number of bytes needed to complete the next multibyte +character. +If a character can be completed, and +.Fa pwc +is not +.Dv NULL , +the wide character which is represented by +.Fa s +is stored in the +.Vt wchar_t +it points to. +.Pp +If +.Fa s +is +.Dv NULL , +.Fn mbrtowc +behaves as if +.Fa pwc +were +.Dv NULL , +.Fa s +were an empty string +.Pq Qq , +and +.Fa n +were 1. +.Pp +The +.Vt mbstate_t +argument, +.Fa ps , +is used to keep track of the shift state. +If it is +.Dv NULL , +.Fn mbrtowc +uses an internal, static +.Vt mbstate_t +object, which is initialized to the initial conversion state +at program startup. +.Pp +While the +.Fn mbrtowc +function uses the current locale, the +.Fn mbrtowc_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn mbrtowc +functions returns: +.Bl -tag -width indent +.It 0 +The next +.Fa n +or fewer bytes +represent the null wide character +.Pq Li "L'\e0'" . +.It >0 +The next +.Fa n +or fewer bytes +represent a valid character, +.Fn mbrtowc +returns the number of bytes used to complete the multibyte character. +.It Po Vt size_t Pc Ns \-2 +The next +.Fa n +contribute to, but do not complete, a valid multibyte character sequence, +and all +.Fa n +bytes have been processed. +.It Po Vt size_t Pc Ns \-1 +An encoding error has occurred. +The next +.Fa n +or fewer bytes do not contribute to a valid multibyte character. +.El +.Sh ERRORS +The +.Fn mbrtowc +function will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid multibyte sequence was detected. +.It Bq Er EINVAL +The conversion state is invalid. +.El +.Sh SEE ALSO +.Xr mbtowc 3 , +.Xr multibyte 3 , +.Xr setlocale 3 , +.Xr wcrtomb 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn mbrtowc +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/mbrtowc.c b/locale/FreeBSD/mbrtowc.c new file mode 100644 index 0000000..023c8b2 --- /dev/null +++ b/locale/FreeBSD/mbrtowc.c @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mbrtowc.c,v 1.7 2004/05/12 14:09:04 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include "mblocal.h" + +size_t +mbrtowc_l(wchar_t * __restrict pwc, const char * __restrict s, + size_t n, mbstate_t * __restrict ps, locale_t loc) +{ + NORMALIZE_LOCALE(loc); + if (ps == NULL) + ps = &loc->__mbs_mbrtowc; + return (loc->__lc_ctype->__mbrtowc(pwc, s, n, ps, loc)); +} + +size_t +mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, + size_t n, mbstate_t * __restrict ps) +{ + return mbrtowc_l(pwc, s, n, ps, __current_locale()); +} diff --git a/locale/FreeBSD/mbsinit.3 b/locale/FreeBSD/mbsinit.3 new file mode 100644 index 0000000..8dfa1bf --- /dev/null +++ b/locale/FreeBSD/mbsinit.3 @@ -0,0 +1,81 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/mbsinit.3,v 1.3 2004/04/08 09:59:02 tjr Exp $ +.\" +.Dd April 8, 2004 +.Dt MBSINIT 3 +.Os +.Sh NAME +.Nm mbsinit , +.Nm mbsinit_l +.Nd "determine conversion object status" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft int +.Fn mbsinit "const mbstate_t *ps" +.In wchar.h +.In xlocale.h +.Ft int +.Fn mbsinit_l "const mbstate_t *ps" "locale_t loc" +.Sh DESCRIPTION +The +.Fn mbsinit +function determines whether the +.Vt mbstate_t +object pointed to by +.Fa ps +describes an initial conversion state. +.Pp +While the +.Fn mbsinit +function uses the current locale, the +.Fn mbsinit_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn mbsinit +function returns non-zero if +.Fa ps +is +.Dv NULL +or describes an initial conversion state; +otherwise, it returns zero. +.Sh SEE ALSO +.Xr mbrlen 3 , +.Xr mbrtowc 3 , +.Xr mbsrtowcs 3 , +.Xr multibyte 3 , +.Xr wcrtomb 3 , +.Xr wcsrtombs 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn mbsinit +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/mbsinit.c b/locale/FreeBSD/mbsinit.c new file mode 100644 index 0000000..bbc2266 --- /dev/null +++ b/locale/FreeBSD/mbsinit.c @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mbsinit.c,v 1.3 2004/05/12 14:09:04 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include "mblocal.h" + +int +mbsinit_l(const mbstate_t *ps, locale_t loc) +{ + + NORMALIZE_LOCALE(loc); + return (loc->__lc_ctype->__mbsinit(ps, loc)); +} + +int +mbsinit(const mbstate_t *ps) +{ + return mbsinit_l(ps, __current_locale()); +} diff --git a/locale/FreeBSD/mbsnrtowcs.c b/locale/FreeBSD/mbsnrtowcs.c new file mode 100644 index 0000000..41cdd86 --- /dev/null +++ b/locale/FreeBSD/mbsnrtowcs.c @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mbsnrtowcs.c,v 1.1 2004/07/21 10:54:57 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "mblocal.h" + +size_t +mbsnrtowcs_l(wchar_t * __restrict dst, const char ** __restrict src, + size_t nms, size_t len, mbstate_t * __restrict ps, locale_t loc) +{ + NORMALIZE_LOCALE(loc); + if (ps == NULL) + ps = &loc->__mbs_mbsnrtowcs; + return (loc->__lc_ctype->__mbsnrtowcs(dst, src, nms, len, ps, loc)); +} + +size_t +mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, + size_t nms, size_t len, mbstate_t * __restrict ps) +{ + return mbsnrtowcs_l(dst, src, nms, len, ps, __current_locale()); +} + +__private_extern__ size_t +__mbsnrtowcs_std(wchar_t * __restrict dst, const char ** __restrict src, + size_t nms, size_t len, mbstate_t * __restrict ps, locale_t loc) +{ + const char *s; + size_t nchr; + wchar_t wc; + size_t nb; + size_t (*__mbrtowc)(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t) + = loc->__lc_ctype->__mbrtowc; + + s = *src; + nchr = 0; + + if (dst == NULL) { + for (;;) { + if ((nb = __mbrtowc(&wc, s, nms, ps, loc)) == (size_t)-1) + /* Invalid sequence - mbrtowc() sets errno. */ + return ((size_t)-1); + else if (nb == 0 || nb == (size_t)-2) + return (nchr); + s += nb; + nms -= nb; + nchr++; + } + /*NOTREACHED*/ + } + + while (len-- > 0) { + if ((nb = __mbrtowc(dst, s, nms, ps, loc)) == (size_t)-1) { + *src = s; + return ((size_t)-1); + } else if (nb == (size_t)-2) { + *src = s + nms; + return (nchr); + } else if (nb == 0) { + *src = NULL; + return (nchr); + } + s += nb; + nms -= nb; + nchr++; + dst++; + } + *src = s; + return (nchr); +} diff --git a/locale/FreeBSD/mbsrtowcs.3 b/locale/FreeBSD/mbsrtowcs.3 new file mode 100644 index 0000000..ff6e699 --- /dev/null +++ b/locale/FreeBSD/mbsrtowcs.3 @@ -0,0 +1,174 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/mbsrtowcs.3,v 1.6 2005/01/11 20:50:49 ru Exp $ +.Dd July 21, 2004 +.Dt MBSRTOWCS 3 +.Os +.Sh NAME +.Nm mbsnrtowcs , +.Nm mbsnrtowcs_l , +.Nm mbsrtowcs , +.Nm mbsrtowcs_l +.Nd "convert a character string to a wide-character string (restartable)" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft size_t +.Fo mbsnrtowcs +.Fa "wchar_t *restrict dst" +.Fa "const char **restrict src" +.Fa "size_t nms" +.Fa "size_t len" +.Fa "mbstate_t *restrict ps" +.Fc +.Ft size_t +.Fo mbsrtowcs +.Fa "wchar_t *restrict dst" +.Fa "const char **restrict src" +.Fa "size_t len" +.Fa "mbstate_t *restrict ps" +.Fc +.In wchar.h +.In xlocale.h +.Ft size_t +.Fo mbsrtowcs_l +.Fa "wchar_t *restrict dst" +.Fa "const char **restrict src" +.Fa "size_t len" +.Fa "mbstate_t *restrict ps" +.Fa "locale_t loc" +.Fc +.Ft size_t +.Fo mbsnrtowcs_l +.Fa "wchar_t *restrict dst" +.Fa "const char **restrict src" +.Fa "size_t nms" +.Fa "size_t len" +.Fa "mbstate_t *restrict ps" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn mbsrtowcs +function converts a sequence of multibyte characters, pointed to indirectly by +.Fa src , +into a sequence of corresponding wide characters. It stores at most +.Fa len +of them in the +.Vt wchar_t +array pointed to by +.Fa dst , +until it encounters a terminating null character +.Pq Li '\e0' . +.Pp +If +.Fa dst +is +.Dv NULL , +no characters are stored. +.Pp +If +.Fa dst +is not +.Dv NULL , +the pointer pointed to by +.Fa src +is updated to point to the character after the one that conversion stopped at. +If conversion stops because a null character is encountered, +.Fa *src +is set to +.Dv NULL . +.Pp +The +.Vt mbstate_t +argument, +.Fa ps , +is used to keep track of the shift state. +If it is +.Dv NULL , +.Fn mbsrtowcs +uses an internal, static +.Vt mbstate_t +object, which is initialized to the initial conversion state +at program startup. +.Pp +The +.Fn mbsnrtowcs +function behaves identically to +.Fn mbsrtowcs , +except that conversion stops after reading at most +.Fa nms +bytes from the buffer pointed to by +.Fa src . +.Pp +While the +.Fn mbsrtowcs +and +.Fn mbsnrtowcs +functions use the current locale, the +.Fn mbsrtowcs_l +and +.Fn mbsnrtowcs_l +functions may be passed locales directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn mbsrtowcs +and +.Fn mbsnrtowcs +functions return the number of wide characters stored in +the array pointed to by +.Fa dst +if successful, otherwise it returns +.Po Vt size_t Pc Ns \-1 . +.Sh ERRORS +The +.Fn mbsrtowcs +and +.Fn mbsnrtowcs +functions will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid multibyte character sequence was encountered. +.It Bq Er EINVAL +The conversion state is invalid. +.El +.Sh SEE ALSO +.Xr mbrtowc 3 , +.Xr mbstowcs 3 , +.Xr multibyte 3 , +.Xr wcsrtombs 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn mbsrtowcs +function conforms to +.St -isoC-99 . +.Pp +The +.Fn mbsnrtowcs +function is an extension to the standard. diff --git a/locale/FreeBSD/mbsrtowcs.c b/locale/FreeBSD/mbsrtowcs.c new file mode 100644 index 0000000..da8b1e4 --- /dev/null +++ b/locale/FreeBSD/mbsrtowcs.c @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mbsrtowcs.c,v 1.6 2004/07/21 10:54:57 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "mblocal.h" + +size_t +mbsrtowcs_l(wchar_t * __restrict dst, const char ** __restrict src, size_t len, + mbstate_t * __restrict ps, locale_t loc) +{ + NORMALIZE_LOCALE(loc); + if (ps == NULL) + ps = &loc->__mbs_mbsrtowcs; + return (loc->__lc_ctype->__mbsnrtowcs(dst, src, SIZE_T_MAX, len, ps, loc)); +} + +size_t +mbsrtowcs(wchar_t * __restrict dst, const char ** __restrict src, size_t len, + mbstate_t * __restrict ps) +{ + return mbsrtowcs_l(dst, src, len, ps, __current_locale()); +} diff --git a/locale/FreeBSD/mbstowcs.3 b/locale/FreeBSD/mbstowcs.3 new file mode 100644 index 0000000..9e52e79 --- /dev/null +++ b/locale/FreeBSD/mbstowcs.3 @@ -0,0 +1,107 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Donn Seeley of BSDI. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From @(#)multibyte.3 8.1 (Berkeley) 6/4/93 +.\" From FreeBSD: src/lib/libc/locale/multibyte.3,v 1.22 2003/11/08 03:23:11 tjr Exp +.\" $FreeBSD: src/lib/libc/locale/mbstowcs.3,v 1.5 2007/01/09 00:28:00 imp Exp $ +.\" +.Dd April 8, 2004 +.Dt MBSTOWCS 3 +.Os +.Sh NAME +.Nm mbstowcs , +.Nm mbstowcs_l +.Nd convert a character string to a wide-character string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft size_t +.Fo mbstowcs +.Fa "wchar_t *restrict pwcs" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fc +.In stdlib.h +.In xlocale.h +.Ft size_t +.Fo mbstowcs_l +.Fa "wchar_t *restrict pwcs" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn mbstowcs +function converts a multibyte character string +.Fa s , +beginning in the initial conversion state, +into a wide character string +.Fa pwcs . +No more than +.Fa n +wide characters are stored. +A terminating null wide character is appended, if there is room. +.Pp +Although the +.Fn mbstowcs +function uses the current locale, the +.Fn mbstowcs_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn mbstowcs +function returns the number of wide characters converted, +not counting any terminating null wide character, or \-1 +if an invalid multibyte character was encountered. +.Sh ERRORS +The +.Fn mbstowcs +function will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid multibyte sequence was detected. +.It Bq Er EINVAL +The conversion state is invalid. +.El +.Sh SEE ALSO +.Xr mbsrtowcs 3 , +.Xr mbtowc 3 , +.Xr multibyte 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn mbstowcs +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/mbstowcs.c b/locale/FreeBSD/mbstowcs.c new file mode 100644 index 0000000..80bc4fe --- /dev/null +++ b/locale/FreeBSD/mbstowcs.c @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mbstowcs.c,v 1.12 2009/01/15 18:53:52 rdivacky Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include "mblocal.h" + +size_t +mbstowcs_l(wchar_t * __restrict pwcs, const char * __restrict s, size_t n, + locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs; + const char *sp; + + NORMALIZE_LOCALE(loc); + mbs = initial; + sp = s; + return (loc->__lc_ctype->__mbsnrtowcs(pwcs, &sp, SIZE_T_MAX, n, &mbs, loc)); +} + +size_t +mbstowcs(wchar_t * __restrict pwcs, const char * __restrict s, size_t n) +{ + return mbstowcs_l(pwcs, s, n, __current_locale()); +} diff --git a/locale/FreeBSD/mbtowc.3 b/locale/FreeBSD/mbtowc.3 new file mode 100644 index 0000000..b4ec676 --- /dev/null +++ b/locale/FreeBSD/mbtowc.3 @@ -0,0 +1,134 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Donn Seeley of BSDI. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From @(#)multibyte.3 8.1 (Berkeley) 6/4/93 +.\" From FreeBSD: src/lib/libc/locale/multibyte.3,v 1.22 2003/11/08 03:23:11 tjr Exp +.\" $FreeBSD: src/lib/libc/locale/mbtowc.3,v 1.5 2007/01/09 00:28:00 imp Exp $ +.\" +.Dd April 11, 2004 +.Dt MBTOWC 3 +.Os +.Sh NAME +.Nm mbtowc , +.Nm mbtowc_l +.Nd convert a character to a wide-character code +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fo mbtowc +.Fa "wchar_t *restrict pwc" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fc +.In stdlib.h +.In xlocale.h +.Ft int +.Fo mbtowc_l +.Fa "wchar_t *restrict pwc" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn mbtowc +function converts a multibyte character +.Fa s +into a wide character, according to the current conversion state, +and stores the result +in the object pointed to by +.Fa pwc . +Up to +.Fa n +bytes are examined. +.Pp +A call with a null +.Fa s +pointer returns nonzero if the current encoding requires shift states, +zero otherwise; +if shift states are required, the shift state is reset to the initial state. +.Pp +While the +.Fn mbtowc +function uses the current locale, the +.Fn mbtowc_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If +.Fa s +is +.Dv NULL , +the +.Fn mbtowc +function returns nonzero if shift states are supported, +zero otherwise. +.Pp +Otherwise, if +.Fa s +is not a null pointer, +.Fn mbtowc +either returns 0 if +.Fa s +represents the null wide character, or returns +the number of bytes processed in +.Fa s , +or returns \-1 if no multibyte character +could be recognized or converted. +In this case, +.Fn mbtowc Ns 's +internal conversion state is undefined. +.Sh ERRORS +The +.Fn mbtowc +function will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid multibyte sequence was detected. +.It Bq Er EINVAL +The internal conversion state is invalid. +.El +.Sh SEE ALSO +.Xr btowc 3 , +.Xr mblen 3 , +.Xr mbrtowc 3 , +.Xr mbstowcs 3 , +.Xr multibyte 3 , +.Xr wctomb 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn mbtowc +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/mbtowc.c b/locale/FreeBSD/mbtowc.c new file mode 100644 index 0000000..aeb75b7 --- /dev/null +++ b/locale/FreeBSD/mbtowc.c @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mbtowc.c,v 1.11 2004/07/29 06:18:40 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include "mblocal.h" + +int +mbtowc_l(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + locale_t loc) +{ + static const mbstate_t initial; + size_t rval; + + NORMALIZE_LOCALE(loc); + if (s == NULL) { + /* No support for state dependent encodings. */ + loc->__mbs_mbtowc = initial; + return (0); + } + rval = loc->__lc_ctype->__mbrtowc(pwc, s, n, &loc->__mbs_mbtowc, loc); + if (rval == (size_t)-1 || rval == (size_t)-2) + return (-1); + return ((int)rval); +} + +int +mbtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n) +{ + return mbtowc_l(pwc, s, n, __current_locale()); +} diff --git a/locale/FreeBSD/mskanji.5 b/locale/FreeBSD/mskanji.5 new file mode 100644 index 0000000..29802d5 --- /dev/null +++ b/locale/FreeBSD/mskanji.5 @@ -0,0 +1,70 @@ +.\" Copyright (c) 2002, 2003 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/mskanji.5,v 1.4 2004/07/05 06:36:36 ru Exp $ +.\" +.Dd August 7, 2003 +.Dt MSKANJI 5 +.Os +.Sh NAME +.Nm mskanji +.Nd "Shift-JIS (MS Kanji) encoding for Japanese text" +.Sh SYNOPSIS +.Nm ENCODING +.Qq MSKanji +.Sh DESCRIPTION +Shift-JIS, also known as MS Kanji or SJIS, is an encoding system for +Japanese characters, developed by Microsoft Corporation. +It encodes the characters from the +.Tn JIS +X 0201 (ASCII/JIS-Roman) and +.Tn JIS +X 0208 (Japanese) character sets as sequences of either one or two bytes. +.Pp +Characters from the +.Tn ASCII Ns +/JIS-Roman character set are encoded as single bytes between 0x00 and 0x7F +(ASCII) or 0xA1 and 0xDF (Half-width katakana). +.Pp +Characters from the +.Tn JIS +X 0208 character set are encoded as two bytes. +The first ranges from +0x81 - 0x9F, 0xE0 - 0xEA, 0xED - 0xEE (not +.Tn JIS : +.Tn NEC Ns - Ns +selected +.Tn IBM +extended characters), +0xF0 - 0xF9 (not +.Tn JIS : +user defined), +or 0xFA - 0xFC (not +.Tn JIS : +.Tn IBM +extended characters). +The second byte ranges from 0x40 - 0xFC, excluding 0x7F (delete). +.Sh SEE ALSO +.Xr euc 5 , +.Xr utf8 5 diff --git a/locale/FreeBSD/mskanji.c b/locale/FreeBSD/mskanji.c new file mode 100644 index 0000000..0b854f3 --- /dev/null +++ b/locale/FreeBSD/mskanji.c @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. + * + * ja_JP.SJIS locale table for BSD4.4/rune + * version 1.0 + * (C) Sin'ichiro MIYATANI / Phase One, Inc + * May 12, 1995 + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Phase One, Inc. + * 4. The name of Phase One, Inc. may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)mskanji.c 1.0 (Phase One) 5/5/95"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mskanji.c,v 1.18 2007/10/13 16:28:22 ache Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +static size_t _MSKanji_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +static int _MSKanji_mbsinit(const mbstate_t *, locale_t); +static size_t _MSKanji_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); + +typedef struct { + wchar_t ch; +} _MSKanjiState; + +int +_MSKanji_init(struct __xlocale_st_runelocale *xrl) +{ + + xrl->__mbrtowc = _MSKanji_mbrtowc; + xrl->__wcrtomb = _MSKanji_wcrtomb; + xrl->__mbsinit = _MSKanji_mbsinit; + xrl->__mb_cur_max = 2; + xrl->__mb_sb_limit = 256; + return (0); +} + +static int +_MSKanji_mbsinit(const mbstate_t *ps, locale_t loc __unused) +{ + + return (ps == NULL || ((const _MSKanjiState *)ps)->ch == 0); +} + +static size_t +_MSKanji_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps, locale_t loc __unused) +{ + _MSKanjiState *ms; + wchar_t wc; + + ms = (_MSKanjiState *)ps; + + if ((ms->ch & ~0xFF) != 0) { + /* Bad conversion state. */ + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) { + s = ""; + n = 1; + pwc = NULL; + } + + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + + if (ms->ch != 0) { + if (*s == '\0') { + errno = EILSEQ; + return ((size_t)-1); + } + wc = (ms->ch << 8) | (*s & 0xFF); + if (pwc != NULL) + *pwc = wc; + ms->ch = 0; + return (1); + } + wc = *s++ & 0xff; + if ((wc > 0x80 && wc < 0xa0) || (wc >= 0xe0 && wc < 0xfd)) { + if (n < 2) { + /* Incomplete multibyte sequence */ + ms->ch = wc; + return ((size_t)-2); + } + if (*s == '\0') { + errno = EILSEQ; + return ((size_t)-1); + } + wc = (wc << 8) | (*s++ & 0xff); + if (pwc != NULL) + *pwc = wc; + return (2); + } else { + if (pwc != NULL) + *pwc = wc; + return (wc == L'\0' ? 0 : 1); + } +} + +static size_t +_MSKanji_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc __unused) +{ + _MSKanjiState *ms; + int len, i; + + ms = (_MSKanjiState *)ps; + + if (ms->ch != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + len = (wc > 0x100) ? 2 : 1; + for (i = len; i-- > 0; ) + *s++ = wc >> (i << 3); + return (len); +} diff --git a/locale/FreeBSD/multibyte.3 b/locale/FreeBSD/multibyte.3 new file mode 100644 index 0000000..de7099c --- /dev/null +++ b/locale/FreeBSD/multibyte.3 @@ -0,0 +1,142 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Donn Seeley of BSDI. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)multibyte.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/multibyte.3,v 1.28 2007/01/09 00:28:00 imp Exp $ +.\" +.Dd April 8, 2004 +.Dt MULTIBYTE 3 +.Os +.Sh NAME +.Nm multibyte +.Nd multibyte and wide character manipulation functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In limits.h +.In stdlib.h +.In wchar.h +.Sh DESCRIPTION +The basic elements of some written natural languages, such as Chinese, +cannot be represented uniquely with single C +.Vt char Ns s . +The C standard supports two different ways of dealing with +extended natural language encodings: +wide characters and +multibyte characters. +Wide characters are an internal representation +which allows each basic element to map +to a single object of type +.Vt wchar_t . +Multibyte characters are used for input and output +and code each basic element as a sequence of C +.Vt char Ns s . +Individual basic elements may map into one or more +(up to +.Dv MB_LEN_MAX ) +bytes in a multibyte character. +.Pp +The current locale +.Pq Xr setlocale 3 +governs the interpretation of wide and multibyte characters. +The locale category +.Dv LC_CTYPE +specifically controls this interpretation. +The +.Vt wchar_t +type is wide enough to hold the largest value +in the wide character representations for all locales. +.Pp +Multibyte strings may contain +.Sq shift +indicators to switch to and from +particular modes within the given representation. +If explicit bytes are used to signal shifting, +these are not recognized as separate characters +but are lumped with a neighboring character. +There is always a distinguished +.Sq initial +shift state. +Some functions (e.g., +.Xr mblen 3 , +.Xr mbtowc 3 +and +.Xr wctomb 3 ) +maintain static shift state internally, whereas +others store it in an +.Vt mbstate_t +object passed by the caller. +Shift states are undefined after a call to +.Xr setlocale 3 +with the +.Dv LC_CTYPE +or +.Dv LC_ALL +categories. +.Pp +For convenience in processing, +the wide character with value 0 +(the null wide character) +is recognized as the wide character string terminator, +and the character with value 0 +(the null byte) +is recognized as the multibyte character string terminator. +Null bytes are not permitted within multibyte characters. +.Pp +The C library provides the following functions for dealing with +multibyte characters: +.Bl -column "Description" +.It Sy "Function Description" +.It Xr mblen 3 Ta "get number of bytes in a character" +.It Xr mbrlen 3 Ta "get number of bytes in a character (restartable)" +.It Xr mbrtowc 3 Ta "convert a character to a wide-character code (restartable)" +.It Xr mbsrtowcs 3 Ta "convert a character string to a wide-character string (restartable)" +.It Xr mbstowcs 3 Ta "convert a character string to a wide-character string" +.It Xr mbtowc 3 Ta "convert a character to a wide-character code" +.It Xr wcrtomb 3 Ta "convert a wide-character code to a character (restartable)" +.It Xr wcstombs 3 Ta "convert a wide-character string to a character string" +.It Xr wcsrtombs 3 Ta "convert a wide-character string to a character string (restartable)" +.It Xr wctomb 3 Ta "convert a wide-character code to a character" +.El +.Sh SEE ALSO +.Xr mklocale 1 , +.Xr setlocale 3 , +.Xr stdio 3 , +.Xr big5 5 , +.Xr euc 5 , +.Xr gb18030 5 , +.Xr gb2312 5 , +.Xr gbk 5 , +.Xr mskanji 5 , +.Xr utf8 5 +.Sh STANDARDS +These functions conform to +.St -isoC-99 . diff --git a/locale/FreeBSD/nextwctype.3 b/locale/FreeBSD/nextwctype.3 new file mode 100644 index 0000000..d2b959f --- /dev/null +++ b/locale/FreeBSD/nextwctype.3 @@ -0,0 +1,80 @@ +.\" +.\" Copyright (c) 2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/nextwctype.3,v 1.3 2005/07/21 10:27:45 tjr Exp $ +.\" +.Dd July 21, 2005 +.Dt NEXTWCTYPE 3 +.Os +.Sh NAME +.Nm nextwctype , +.Nm nextwctype_l +.Nd "iterate through character classes" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.Ft wint_t +.Fn nextwctype "wint_t ch" "wctype_t wct" +.In xlocale.h +.Ft wint_t +.Fn nextwctype_l "wint_t ch" "wctype_t wct" "locale_t loc" +.Sh DESCRIPTION +The +.Fn nextwctype +function determines the next character after +.Fa ch +that is a member of character class +.Fa wct . +If +.Fa ch +is \-1, the search begins at the first member of +.Fa wct . +.Pp +While the +.Fn nextwctype +function uses the current locale, the + .Fn nextwctype_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn nextwctype +function returns the next character, or \-1 if there are no more. +.Sh COMPATIBILITY +This function is a non-standard +.Fx +extension and should not be used where the standard +.Fn iswctype +function would suffice. +.Sh SEE ALSO +.Xr wctype 3 , +.Xr xlocale 3 +.Sh HISTORY +The +.Fn nextwctype +function appeared in +.Fx 5.4 . diff --git a/locale/FreeBSD/nextwctype.c b/locale/FreeBSD/nextwctype.c new file mode 100644 index 0000000..75e5056 --- /dev/null +++ b/locale/FreeBSD/nextwctype.c @@ -0,0 +1,100 @@ +/*- + * Copyright (c) 2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/nextwctype.c,v 1.1 2004/07/08 06:43:37 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +wint_t +nextwctype_l(wint_t wc, wctype_t wct, locale_t loc) +{ + size_t lim; + _RuneRange *rr; + _RuneEntry *base, *re; + int noinc; + _RuneLocale *rl = &loc->__lc_ctype->_CurrentRuneLocale; + + noinc = 0; + if (wc < _CACHED_RUNES) { + wc++; + while (wc < _CACHED_RUNES) { + if (rl->__runetype[wc] & wct) + return (wc); + wc++; + } + wc--; + } + rr = &rl->__runetype_ext; + if (rr->__ranges != NULL && wc < rr->__ranges[0].__min) { + wc = rr->__ranges[0].__min; + noinc = 1; + } + + /* Binary search -- see bsearch.c for explanation. */ + base = rr->__ranges; + for (lim = rr->__nranges; lim != 0; lim >>= 1) { + re = base + (lim >> 1); + if (re->__min <= wc && wc <= re->__max) + goto found; + else if (wc > re->__max) { + base = re + 1; + lim--; + } + } + return (-1); +found: + if (!noinc) + wc++; + if (re->__min <= wc && wc <= re->__max) { + if (re->__types != NULL) { + for (; wc <= re->__max; wc++) + if (re->__types[wc - re->__min] & wct) + return (wc); + } else if (re->__map & wct) + return (wc); + } + while (++re < rr->__ranges + rr->__nranges) { + wc = re->__min; + if (re->__types != NULL) { + for (; wc <= re->__max; wc++) + if (re->__types[wc - re->__min] & wct) + return (wc); + } else if (re->__map & wct) + return (wc); + } + return (-1); +} + +wint_t +nextwctype(wint_t wc, wctype_t wct) +{ + return nextwctype_l(wc, wct, __current_locale()); +} diff --git a/locale/FreeBSD/nl_langinfo.3 b/locale/FreeBSD/nl_langinfo.3 new file mode 100644 index 0000000..3d846de --- /dev/null +++ b/locale/FreeBSD/nl_langinfo.3 @@ -0,0 +1,109 @@ +.\" Copyright (c) 2001 Alexey Zelkin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/nl_langinfo.3,v 1.7 2009/11/16 14:33:31 brueffer Exp $ +.\" +.Dd May 3, 2001 +.Dt NL_LANGINFO 3 +.Os +.Sh NAME +.Nm nl_langinfo , +.Nm nl_langinfo_l +.Nd language information +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In langinfo.h +.Ft char * +.Fo nl_langinfo +.Fa "nl_item item" +.Fc +.In langinfo.h +.In xlocale.h +.Ft char * +.Fo nl_langinfo_l +.Fa "nl_item item" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn nl_langinfo +function returns a pointer to a string containing information relevant to +the particular language or cultural area defined in the program's locale. +The manifest constant names and values of +.Fa item +are defined in +.In langinfo.h . +.Pp +Calls to +.Fn setlocale +with a category corresponding to the category of +.Fa item , +or to the +category +.Dv LC_ALL , +may overwrite the buffer pointed to by the return value. +.Sh RETURN VALUES +In a locale where langinfo data is not defined, +.Fn nl_langinfo +returns a pointer to the corresponding string in the +.Tn POSIX +locale. +In all locales, +.Fn nl_langinfo +returns a pointer to an empty string if +.Fa item +contains an invalid setting. +.Sh EXAMPLES +For example: +.Pp +.Dl nl_langinfo(ABDAY_1) +.Pp +would return a pointer to the string +.Qq Li Dom +if the identified language was +Portuguese, and +.Qq Li Sun +if the identified language was English. +.Pp +While the +.Fn nl_langinfo +function uses the current locale, the +.Fn nl_langinfo_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh SEE ALSO +.Xr setlocale 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn nl_langinfo +function conforms to +.St -susv2 . +.Sh HISTORY +The +.Fn nl_langinfo +function first appeared in +.Fx 4.6 . diff --git a/locale/FreeBSD/nl_langinfo.c b/locale/FreeBSD/nl_langinfo.c new file mode 100644 index 0000000..8a69f90 --- /dev/null +++ b/locale/FreeBSD/nl_langinfo.c @@ -0,0 +1,190 @@ +/*- + * Copyright (c) 2001, 2003 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/nl_langinfo.c,v 1.17 2003/06/26 10:46:16 phantom Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include + +#include "lnumeric.h" +#include "lmessages.h" +#include "lmonetary.h" +#include "timelocal.h" + +#define _REL(BASE) ((int)item-BASE) + +char * +nl_langinfo_l(nl_item item, locale_t loc) +{ + char *ret, *cs; + const char *s; + static char *csym = NULL; + + NORMALIZE_LOCALE(loc); + switch (item) { + case CODESET: + ret = ""; + if ((s = querylocale(LC_CTYPE_MASK, loc)) != NULL) { + if ((cs = strchr(s, '.')) != NULL) + ret = cs + 1; + else if (strcmp(s, "C") == 0 || + strcmp(s, "POSIX") == 0) + ret = "US-ASCII"; + else if (strcmp(s, "UTF-8") == 0) + ret = "UTF-8"; + } + break; + case D_T_FMT: + ret = (char *) __get_current_time_locale(loc)->c_fmt; + break; + case D_FMT: + ret = (char *) __get_current_time_locale(loc)->x_fmt; + break; + case T_FMT: + ret = (char *) __get_current_time_locale(loc)->X_fmt; + break; + case T_FMT_AMPM: + ret = (char *) __get_current_time_locale(loc)->ampm_fmt; + break; + case AM_STR: + ret = (char *) __get_current_time_locale(loc)->am; + break; + case PM_STR: + ret = (char *) __get_current_time_locale(loc)->pm; + break; + case DAY_1: case DAY_2: case DAY_3: + case DAY_4: case DAY_5: case DAY_6: case DAY_7: + ret = (char*) __get_current_time_locale(loc)->weekday[_REL(DAY_1)]; + break; + case ABDAY_1: case ABDAY_2: case ABDAY_3: + case ABDAY_4: case ABDAY_5: case ABDAY_6: case ABDAY_7: + ret = (char*) __get_current_time_locale(loc)->wday[_REL(ABDAY_1)]; + break; + case MON_1: case MON_2: case MON_3: case MON_4: + case MON_5: case MON_6: case MON_7: case MON_8: + case MON_9: case MON_10: case MON_11: case MON_12: + ret = (char*) __get_current_time_locale(loc)->month[_REL(MON_1)]; + break; + case ABMON_1: case ABMON_2: case ABMON_3: case ABMON_4: + case ABMON_5: case ABMON_6: case ABMON_7: case ABMON_8: + case ABMON_9: case ABMON_10: case ABMON_11: case ABMON_12: + ret = (char*) __get_current_time_locale(loc)->mon[_REL(ABMON_1)]; + break; + case ERA: + /* XXX: need to be implemented */ + ret = ""; + break; + case ERA_D_FMT: + /* XXX: need to be implemented */ + ret = ""; + break; + case ERA_D_T_FMT: + /* XXX: need to be implemented */ + ret = ""; + break; + case ERA_T_FMT: + /* XXX: need to be implemented */ + ret = ""; + break; + case ALT_DIGITS: + /* XXX: need to be implemented */ + ret = ""; + break; + case RADIXCHAR: + ret = (char*) __get_current_numeric_locale(loc)->decimal_point; + break; + case THOUSEP: + ret = (char*) __get_current_numeric_locale(loc)->thousands_sep; + break; + case YESEXPR: + ret = (char*) __get_current_messages_locale(loc)->yesexpr; + break; + case NOEXPR: + ret = (char*) __get_current_messages_locale(loc)->noexpr; + break; + /* + * YESSTR and NOSTR items marked with LEGACY are available, but not + * recomended by SUSv2 to be used in portable applications since + * they're subject to remove in future specification editions. + */ + case YESSTR: /* LEGACY */ + ret = (char*) __get_current_messages_locale(loc)->yesstr; + break; + case NOSTR: /* LEGACY */ + ret = (char*) __get_current_messages_locale(loc)->nostr; + break; + /* + * SUSv2 special formatted currency string + */ + case CRNCYSTR: + ret = ""; + cs = (char*) __get_current_monetary_locale(loc)->currency_symbol; + if (*cs != '\0') { + char pos = localeconv_l(loc)->p_cs_precedes; + + if (pos == localeconv_l(loc)->n_cs_precedes) { + char psn = '\0'; + + if (pos == CHAR_MAX) { + if (strcmp(cs, __get_current_monetary_locale(loc)->mon_decimal_point) == 0) + psn = '.'; + } else + psn = pos ? '-' : '+'; + if (psn != '\0') { + int clen = strlen(cs); + + if ((csym = reallocf(csym, clen + 2)) != NULL) { + *csym = psn; + strcpy(csym + 1, cs); + ret = csym; + } + } + } + } + break; + case D_MD_ORDER: /* FreeBSD local extension */ + ret = (char *) __get_current_time_locale(loc)->md_order; + break; + default: + return ""; /* do not consult POSIX */ + } + if (ret && !ret[0] && item != D_MD_ORDER && item != CODESET && loc != _c_locale) { + ret = nl_langinfo_l(item, _c_locale); + } + return (ret); +} + +char * +nl_langinfo(nl_item item) +{ + return (nl_langinfo_l(item, __current_locale())); +} diff --git a/locale/FreeBSD/nomacros.c b/locale/FreeBSD/nomacros.c new file mode 100644 index 0000000..eea37d0 --- /dev/null +++ b/locale/FreeBSD/nomacros.c @@ -0,0 +1,12 @@ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/nomacros.c,v 1.5 2002/03/22 21:52:18 obrien Exp $"); + +/* + * Tell to generate extern versions of all its inline + * functions. The extern versions get called if the system doesn't + * support inlines or the user defines _DONT_USE_CTYPE_INLINE_ + * before including . + */ +#define _EXTERNALIZE_CTYPE_INLINES_ + +#include diff --git a/locale/FreeBSD/none.c b/locale/FreeBSD/none.c new file mode 100644 index 0000000..b6a346d --- /dev/null +++ b/locale/FreeBSD/none.c @@ -0,0 +1,179 @@ +/*- + * Copyright 2013 Garrett D'Amore + * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)none.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +/* setup defaults */ + +int __mb_cur_max = 1; +int __mb_sb_limit = 256; /* Expected to be <= _CACHED_RUNES */ + +int +_none_init(struct __xlocale_st_runelocale *xrl) +{ + + xrl->__mbrtowc = _none_mbrtowc; + xrl->__mbsinit = _none_mbsinit; + xrl->__mbsnrtowcs = _none_mbsnrtowcs; + xrl->__wcrtomb = _none_wcrtomb; + xrl->__wcsnrtombs = _none_wcsnrtombs; + xrl->__mb_cur_max = 1; + xrl->__mb_sb_limit = 256; + return(0); +} + +int +_none_mbsinit(const mbstate_t *ps __unused, locale_t loc __unused) +{ + + /* + * Encoding is not state dependent - we are always in the + * initial state. + */ + return (1); +} + +size_t +_none_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps __unused, locale_t loc __unused) +{ + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (0); + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + if (pwc != NULL) + *pwc = (unsigned char)*s; + return (*s == '\0' ? 0 : 1); +} + +size_t +_none_wcrtomb(char * __restrict s, wchar_t wc, + mbstate_t * __restrict ps __unused, locale_t loc __unused) +{ + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + if (wc < 0 || wc > UCHAR_MAX) { + errno = EILSEQ; + return ((size_t)-1); + } + *s = (unsigned char)wc; + return (1); +} + +size_t +_none_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, + size_t nms, size_t len, mbstate_t * __restrict ps __unused, locale_t loc __unused) +{ + const char *s; + size_t nchr; + + if (dst == NULL) { + s = memchr(*src, '\0', nms); + return (s != NULL ? s - *src : nms); + } + + s = *src; + nchr = 0; + while (len-- > 0 && nms-- > 0) { + if ((*dst++ = (unsigned char)*s++) == L'\0') { + *src = NULL; + return (nchr); + } + nchr++; + } + *src = s; + return (nchr); +} + +size_t +_none_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, + size_t nwc, size_t len, mbstate_t * __restrict ps __unused, locale_t loc __unused) +{ + const wchar_t *s; + size_t nchr; + + if (dst == NULL) { + for (s = *src; nwc > 0 && *s != L'\0'; s++, nwc--) { + if (*s < 0 || *s > UCHAR_MAX) { + errno = EILSEQ; + return ((size_t)-1); + } + } + return (s - *src); + } + + s = *src; + nchr = 0; + while (len-- > 0 && nwc-- > 0) { + if (*s < 0 || *s > UCHAR_MAX) { + *src = s; + errno = EILSEQ; + return ((size_t)-1); + } + if ((*dst++ = *s++) == '\0') { + *src = NULL; + return (nchr); + } + nchr++; + } + *src = s; + return (nchr); +} diff --git a/locale/FreeBSD/rune.c b/locale/FreeBSD/rune.c new file mode 100644 index 0000000..4264eb6 --- /dev/null +++ b/locale/FreeBSD/rune.c @@ -0,0 +1,369 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#ifndef RUNEOFF32 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rune.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/rune.c,v 1.12 2004/07/29 06:16:19 tjr Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#else +#include "runetype.h" +#endif /* !RUNEOFF32 */ +#include +#ifndef RUNEOFF32 +#include +#include +#include +#include +#include "un-namespace.h" +#endif /* !RUNEOFF32 */ + +#if defined(__LP64__) || defined(RUNEOFF32) +/* + * Because the LC_CTYPE files were created with a 32-bit program, we need + * to adjust for the larger pointers in LP64 (the longs have already been + * replaced by 32-bit equivalents). Also, natural alignment will pad + * 64-bit types to 8-byte boundaries, and make structures containing + * 64-bit types sized to 8-byte boundaries. + */ +#include +#ifndef RUNEOFF32 +#include "rune32.h" +#define BYTES32BITS 4 +#define BYTES64BITS 8 +/* whether to skip over a pointer or not (one-to-one with off64) */ +int skip[] = { + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 0 +}; +#endif /* !RUNEOFF32 */ +int off64[] = { + offsetof(_RuneLocale, __sgetrune), + offsetof(_RuneLocale, __sputrune), + offsetof(_RuneLocale, __runetype_ext), + offsetof(_RuneLocale, __runetype_ext) + offsetof(_RuneRange, __ranges), + offsetof(_RuneLocale, __maplower_ext), + offsetof(_RuneLocale, __maplower_ext) + offsetof(_RuneRange, __ranges), + offsetof(_RuneLocale, __mapupper_ext), + offsetof(_RuneLocale, __mapupper_ext) + offsetof(_RuneRange, __ranges), + offsetof(_RuneLocale, __variable), + offsetof(_RuneLocale, __charclasses), + sizeof(_RuneLocale) +}; +#define NOFF (sizeof(off64) / sizeof(int)) +#ifdef RUNEOFF32 +/* + * This program generates a header file (on stdout) that containes the 32-bit + * offsets, plus some 32-bit sizes + */ +main() +{ + int i; + printf("#define SIZEOF32_RUNEENTRY %d\n", sizeof(_RuneEntry)); + printf("#define SIZEOF32_RUNELOCALE %d\n", sizeof(_RuneLocale)); + printf("int off32[] = {\n"); + for(i = 0; i < NOFF; i++) + printf("\t%d,\n", off64[i]); + printf("};\n"); + return 0; +} +#endif /* RUNEOFF32 */ +#else /* !__LP64__ && !RUNEOFF32 */ +#define SIZEOF32_RUNELOCALE sizeof(_RuneLocale) +#endif /* __LP64__ || RUNEOFF32 */ + +#ifndef RUNEOFF32 +struct __xlocale_st_runelocale * +_Read_RuneMagi(fp) + FILE *fp; +{ + struct __xlocale_st_runelocale *data; + void *lastp; + _RuneLocale *rl; + _RuneEntry *rr; + struct stat sb; + int x, saverr; + + if (_fstat(fileno(fp), &sb) < 0) + return (NULL); + + if (sb.st_size < SIZEOF32_RUNELOCALE) { + errno = EFTYPE; + return (NULL); + } + +#ifdef __LP64__ + /* will adjust later */ + if ((data = (struct __xlocale_st_runelocale *)malloc(sizeof(struct __xlocale_st_runelocale))) == NULL) +#else /* !__LP64__ */ + if ((data = (struct __xlocale_st_runelocale *)malloc(sizeof(struct __xlocale_st_runelocale) - sizeof(_RuneLocale) + sb.st_size)) == NULL) +#endif /* __LP64__ */ + return (NULL); + data->__refcount = 1; + data->__free_extra = NULL; + + errno = 0; + rewind(fp); /* Someone might have read the magic number once already */ + if (errno) { + saverr = errno; + free(data); + errno = saverr; + return (NULL); + } + + rl = &data->_CurrentRuneLocale; + +#ifdef __LP64__ + if (fread(rl, SIZEOF32_RUNELOCALE, 1, fp) != 1) +#else /* !__LP64__ */ + if (fread(rl, sb.st_size, 1, fp) != 1) +#endif /* __LP64__ */ + { + saverr = errno; + free(data); + errno = saverr; + return (NULL); + } + +#ifndef __LP64__ + lastp = (char *)rl + sb.st_size; + + rl->__variable = rl + 1; +#endif /* __LP64__ */ + + if (memcmp(rl->__magic, _RUNE_MAGIC_A, sizeof(rl->__magic))) { + free(data); + errno = EFTYPE; + return (NULL); + } + +#ifdef __LP64__ + /* shift things into the right position */ + for (x = NOFF - 2; x >= 0; x--) + memmove((char *)rl + off64[x] + (skip[x] ? BYTES64BITS : 0), + (char *)rl + off32[x] + (skip[x] ? BYTES32BITS : 0), + off32[x + 1] - off32[x] - (skip[x] ? BYTES32BITS : 0)); +#endif /* __LP64__ */ +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + rl->__invalid_rune = ntohl(rl->__invalid_rune); + rl->__variable_len = ntohl(rl->__variable_len); + rl->__ncharclasses = ntohl(rl->__ncharclasses); + rl->__runetype_ext.__nranges = ntohl(rl->__runetype_ext.__nranges); + rl->__maplower_ext.__nranges = ntohl(rl->__maplower_ext.__nranges); + rl->__mapupper_ext.__nranges = ntohl(rl->__mapupper_ext.__nranges); + + for (x = 0; x < _CACHED_RUNES; ++x) { + rl->__runetype[x] = ntohl(rl->__runetype[x]); + rl->__maplower[x] = ntohl(rl->__maplower[x]); + rl->__mapupper[x] = ntohl(rl->__mapupper[x]); + } +#endif /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + +#ifdef __LP64__ + { + int count = rl->__runetype_ext.__nranges + rl->__maplower_ext.__nranges + + rl->__mapupper_ext.__nranges; + int extra = sb.st_size - SIZEOF32_RUNELOCALE - count * SIZEOF32_RUNEENTRY - rl->__ncharclasses * sizeof(_RuneCharClass); + _RuneEntry *rp; + + if (extra < 0) { + saverr = errno; + free(data); + errno = saverr; + return (NULL); + } + if ((data = (struct __xlocale_st_runelocale *)reallocf(data, sizeof(struct __xlocale_st_runelocale) + + count * sizeof(_RuneEntry) + + rl->__ncharclasses * sizeof(_RuneCharClass) + + extra)) == NULL) + return (NULL); + rl = &data->_CurrentRuneLocale; + rl->__variable = rl + 1; + rp = (_RuneEntry *)rl->__variable; + for (x = 0; x < count; x++, rp++) + if (fread(rp, SIZEOF32_RUNEENTRY, 1, fp) != 1) { + saverr = errno; + free(data); + errno = saverr; + return (NULL); + } + if (rl->__ncharclasses > 0) { + if (fread(rp, sizeof(_RuneCharClass), rl->__ncharclasses, fp) != rl->__ncharclasses) { + saverr = errno; + free(data); + errno = saverr; + return (NULL); + } + rp = (_RuneEntry *)((char *)rp + rl->__ncharclasses * sizeof(_RuneCharClass)); + } + if (extra > 0 && fread(rp, extra, 1, fp) != 1) { + saverr = errno; + free(data); + errno = saverr; + return (NULL); + } + lastp = (char *)rp + extra; + } +#endif /* __LP64__ */ + rl->__runetype_ext.__ranges = (_RuneEntry *)rl->__variable; + rl->__variable = rl->__runetype_ext.__ranges + + rl->__runetype_ext.__nranges; + if (rl->__variable > lastp) { + free(data); + errno = EFTYPE; + return (NULL); + } + + rl->__maplower_ext.__ranges = (_RuneEntry *)rl->__variable; + rl->__variable = rl->__maplower_ext.__ranges + + rl->__maplower_ext.__nranges; + if (rl->__variable > lastp) { + free(data); + errno = EFTYPE; + return (NULL); + } + + rl->__mapupper_ext.__ranges = (_RuneEntry *)rl->__variable; + rl->__variable = rl->__mapupper_ext.__ranges + + rl->__mapupper_ext.__nranges; + if (rl->__variable > lastp) { + free(data); + errno = EFTYPE; + return (NULL); + } + + for (x = 0; x < rl->__runetype_ext.__nranges; ++x) { + rr = rl->__runetype_ext.__ranges; + +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + rr[x].__min = ntohl(rr[x].__min); + rr[x].__max = ntohl(rr[x].__max); +#endif /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + if ((rr[x].__map = ntohl(rr[x].__map)) == 0) { + int len = rr[x].__max - rr[x].__min + 1; + rr[x].__types = rl->__variable; + rl->__variable = rr[x].__types + len; + if (rl->__variable > lastp) { + free(data); + errno = EFTYPE; + return (NULL); + } +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + while (len-- > 0) + rr[x].__types[len] = ntohl(rr[x].__types[len]); +#endif /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + } else + rr[x].__types = 0; + } + +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + for (x = 0; x < rl->__maplower_ext.__nranges; ++x) { + rr = rl->__maplower_ext.__ranges; + + rr[x].__min = ntohl(rr[x].__min); + rr[x].__max = ntohl(rr[x].__max); + rr[x].__map = ntohl(rr[x].__map); + } + + for (x = 0; x < rl->__mapupper_ext.__nranges; ++x) { + rr = rl->__mapupper_ext.__ranges; + + rr[x].__min = ntohl(rr[x].__min); + rr[x].__max = ntohl(rr[x].__max); + rr[x].__map = ntohl(rr[x].__map); + } +#endif /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + + if (rl->__ncharclasses > 0) { + rl->__charclasses = (_RuneCharClass *)rl->__variable; + rl->__variable = (void *)(rl->__charclasses + rl->__ncharclasses); + if (rl->__variable > lastp) { + free(data); + errno = EFTYPE; + return (NULL); + } +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + for (x = 0; x < rl->__ncharclasses; ++x) + rl->__charclasses[x].__mask = ntohl(rl->__charclasses[x].__mask); +#endif /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + } + + if (((char *)rl->__variable) + rl->__variable_len > (char *)lastp) { + free(data); + errno = EFTYPE; + return (NULL); + } + + /* + * Go out and zero pointers that should be zero. + */ + if (!rl->__variable_len) + rl->__variable = 0; + + if (!rl->__runetype_ext.__nranges) + rl->__runetype_ext.__ranges = 0; + + if (!rl->__maplower_ext.__nranges) + rl->__maplower_ext.__ranges = 0; + + if (!rl->__mapupper_ext.__nranges) + rl->__mapupper_ext.__ranges = 0; + + data->__datasize = lastp - (void *)data; + return (data); +} +#endif /* !RUNEOFF32 */ +#pragma clang diagnostic pop diff --git a/locale/FreeBSD/rune32.h b/locale/FreeBSD/rune32.h new file mode 100644 index 0000000..c3dfe30 --- /dev/null +++ b/locale/FreeBSD/rune32.h @@ -0,0 +1,20 @@ +/* + * This file is statically generated by running: + * cc -arch i386 -D_LIBC_NO_FEATURE_VERIFICATION -DRUNEOFF32 -o rune32 locale/FreeBSD/rune.c + */ + +#define SIZEOF32_RUNEENTRY 16 +#define SIZEOF32_RUNELOCALE 3164 +int off32[] = { + 40, + 44, + 3124, + 3128, + 3132, + 3136, + 3140, + 3144, + 3148, + 3160, + 3164, +}; diff --git a/locale/FreeBSD/runetype.c b/locale/FreeBSD/runetype.c new file mode 100644 index 0000000..6ffcf72 --- /dev/null +++ b/locale/FreeBSD/runetype.c @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/runetype.c,v 1.14 2007/01/09 00:28:00 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +unsigned long +___runetype_l(__ct_rune_t c, locale_t loc) +{ + size_t lim; + _RuneRange *rr; + _RuneEntry *base, *re; + + if (c < 0 || c == EOF) + return(0L); + + NORMALIZE_LOCALE(loc); + rr = &loc->__lc_ctype->_CurrentRuneLocale.__runetype_ext; + /* Binary search -- see bsearch.c for explanation. */ + base = rr->__ranges; + for (lim = rr->__nranges; lim != 0; lim >>= 1) { + re = base + (lim >> 1); + if (re->__min <= c && c <= re->__max) { + if (re->__types) + return(re->__types[c - re->__min]); + else + return(re->__map); + } else if (c > re->__max) { + base = re + 1; + lim--; + } + } + + return(0L); +} + +unsigned long +___runetype(__ct_rune_t c) +{ + return ___runetype_l(c, __current_locale()); +} diff --git a/locale/FreeBSD/setlocale.3 b/locale/FreeBSD/setlocale.3 new file mode 100644 index 0000000..8c263b9 --- /dev/null +++ b/locale/FreeBSD/setlocale.3 @@ -0,0 +1,185 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Donn Seeley at BSDI. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)setlocale.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD$ +.\" +.Dd November 21, 2003 +.Dt SETLOCALE 3 +.Os +.Sh NAME +.Nm setlocale +.Nd natural language formatting for C +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In locale.h +.Ft char * +.Fo setlocale +.Fa "int category" +.Fa "const char *locale" +.Fc +.Sh DESCRIPTION +The +.Fn setlocale +function sets the C library's notion +of natural language formatting style +for particular sets of routines. +Each such style is called a +.Sq locale +and is invoked using an appropriate name passed as a C string. +.Pp +The +.Fn setlocale +function recognizes several categories of routines. +These are the categories and the sets of routines they select: +.Bl -tag -width LC_MONETARY +.It Dv LC_ALL +Set the entire locale generically. +.It Dv LC_COLLATE +Set a locale for string collation routines. +This controls alphabetic ordering in +.Fn strcoll +and +.Fn strxfrm . +.It Dv LC_CTYPE +Set a locale for the +.Xr ctype 3 +and +.Xr multibyte 3 +functions. +This controls recognition of upper and lower case, +alphabetic or non-alphabetic characters, +and so on. +.It Dv LC_MESSAGES +Set a locale for message catalogs, see +.Xr catopen 3 +function. +.It Dv LC_MONETARY +Set a locale for formatting monetary values; +this affects the +.Fn localeconv +function. +.It Dv LC_NUMERIC +Set a locale for formatting numbers. +This controls the formatting of decimal points +in input and output of floating point numbers +in functions such as +.Fn printf +and +.Fn scanf , +as well as values returned by +.Fn localeconv . +.It Dv LC_TIME +Set a locale for formatting dates and times using the +.Fn strftime +function. +.El +.Pp +Only three locales are defined by default: +the empty string +.Li \&"\|" +(which denotes the native environment) and the +.Li \&"C" +and +.Li \&"POSIX" +locales (which denote the C language environment). +A +.Fa locale +argument of +.Dv NULL +causes +.Fn setlocale +to return the current locale. An argument of +.Li \&"\|" +will determine the name of the new locale taking into account the environment +variables LANG and LC_*. If these environment variables yield a locale that is +invalid, NULL will be returned and the current locale will remain unchanged. +By default, C programs start in the +.Li \&"C" +locale. +The only function in the library that sets the locale is +.Fn setlocale ; +the locale is never changed as a side effect of some other routine. +.Sh RETURN VALUES +Upon successful completion, +.Fn setlocale +returns the string associated with the specified +.Fa category +for the requested +.Fa locale . +The +.Fn setlocale +function returns +.Dv NULL +and fails to change the locale +if the given combination of +.Fa category +and +.Fa locale +makes no sense. +.Sh FILES +.Bl -tag -width /usr/share/locale/locale/category -compact +.It Pa $PATH_LOCALE/ Ns Em locale/category +.It Pa /usr/share/locale/ Ns Em locale/category +locale file for the locale +.Em locale +and the category +.Em category . +.It Pa /usr/local/share/locale/ Ns Em locale/category +locale file for the locale +.Em locale +and the category +.Em category . +.El +.Sh ERRORS +No errors are defined. +.Sh SEE ALSO +.Xr colldef 1 , +.Xr mklocale 1 , +.Xr catopen 3 , +.Xr ctype 3 , +.Xr localeconv 3 , +.Xr multibyte 3 , +.Xr strcoll 3 , +.Xr strxfrm 3 , +.Xr euc 5 , +.Xr utf8 5 , +.Xr environ 7 +.Sh STANDARDS +The +.Fn setlocale +function conforms to +.St -isoC-99 . +.Sh HISTORY +The +.Fn setlocale +function first appeared in +.Bx 4.4 . diff --git a/locale/FreeBSD/setlocale.c b/locale/FreeBSD/setlocale.c new file mode 100644 index 0000000..11b259e --- /dev/null +++ b/locale/FreeBSD/setlocale.c @@ -0,0 +1,393 @@ +/* + * Copyright (c) 1996 - 2002 FreeBSD Project + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setlocale.c 8.1 (Berkeley) 7/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/setlocale.c,v 1.51 2007/01/09 00:28:00 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include /* for _PATH_LOCALE */ +#include +#include +#include +#include +#include "collate.h" +#include "lmonetary.h" /* for __monetary_load_locale() */ +#include "lnumeric.h" /* for __numeric_load_locale() */ +#include "lmessages.h" /* for __messages_load_locale() */ +#include "setlocale.h" +#include "ldpart.h" +#include "timelocal.h" /* for __time_load_locale() */ + +/* + * Category names for getenv() + */ +static const char * const categories[_LC_LAST] = { + "LC_ALL", + "LC_COLLATE", + "LC_CTYPE", + "LC_MONETARY", + "LC_NUMERIC", + "LC_TIME", + "LC_MESSAGES", +}; + +/* + * Current locales for each category + */ +static char current_categories[_LC_LAST][ENCODING_LEN + 1] = { + "C", + "C", + "C", + "C", + "C", + "C", + "C", +}; + +/* + * Path to locale storage directory + */ +char *_PathLocale; + +/* + * The locales we are going to try and load + */ +static char new_categories[_LC_LAST][ENCODING_LEN + 1]; +static char saved_categories[_LC_LAST][ENCODING_LEN + 1]; + +static char *currentlocale(void); +static char *loadlocale(int); +__private_extern__ const char *__get_locale_env(int); + +#define UNLOCK_AND_RETURN(x) {XL_UNLOCK(&__global_locale); return (x);} + +char * +setlocale(category, locale) + int category; + const char *locale; +{ + int i, j, len, saverr, save__numeric_fp_cvt; + const char *env, *r; + locale_t save__lc_numeric_loc; + + if (category < LC_ALL || category >= _LC_LAST) { + errno = EINVAL; + return (NULL); + } + + if (locale == NULL) + return (category != LC_ALL ? + current_categories[category] : currentlocale()); + + XL_LOCK(&__global_locale); + /* + * Default to the current locale for everything. + */ + for (i = 1; i < _LC_LAST; ++i) + (void)strcpy(new_categories[i], current_categories[i]); + + /* + * Now go fill up new_categories from the locale argument + */ + if (!*locale) { + if (category == LC_ALL) { + for (i = 1; i < _LC_LAST; ++i) { + env = __get_locale_env(i); + if (strlen(env) > ENCODING_LEN) { + errno = EINVAL; + UNLOCK_AND_RETURN (NULL); + } + (void)strcpy(new_categories[i], env); + } + } else { + env = __get_locale_env(category); + if (strlen(env) > ENCODING_LEN) { + errno = EINVAL; + UNLOCK_AND_RETURN (NULL); + } + (void)strcpy(new_categories[category], env); + } + } else if (category != LC_ALL) { + if (strlen(locale) > ENCODING_LEN) { + errno = EINVAL; + UNLOCK_AND_RETURN (NULL); + } + (void)strcpy(new_categories[category], locale); + } else { + if ((r = strchr(locale, '/')) == NULL) { + if (strlen(locale) > ENCODING_LEN) { + errno = EINVAL; + UNLOCK_AND_RETURN (NULL); + } + for (i = 1; i < _LC_LAST; ++i) + (void)strcpy(new_categories[i], locale); + } else { + for (i = 1; r[1] == '/'; ++r) + ; + if (!r[1]) { + errno = EINVAL; + UNLOCK_AND_RETURN (NULL); /* Hmm, just slashes... */ + } + do { + if (i == _LC_LAST) + break; /* Too many slashes... */ + if ((len = r - locale) > ENCODING_LEN) { + errno = EINVAL; + UNLOCK_AND_RETURN (NULL); + } + (void)strlcpy(new_categories[i], locale, + len + 1); + i++; + while (*r == '/') + r++; + locale = r; + while (*r && *r != '/') + r++; + } while (*locale); + while (i < _LC_LAST) { + (void)strcpy(new_categories[i], + new_categories[i-1]); + i++; + } + } + } + + if (category != LC_ALL) + UNLOCK_AND_RETURN (loadlocale(category)); + + save__numeric_fp_cvt = __global_locale.__numeric_fp_cvt; + save__lc_numeric_loc = __global_locale.__lc_numeric_loc; + XL_RETAIN(save__lc_numeric_loc); + for (i = 1; i < _LC_LAST; ++i) { + (void)strcpy(saved_categories[i], current_categories[i]); + if (loadlocale(i) == NULL) { + saverr = errno; + for (j = 1; j < i; j++) { + (void)strcpy(new_categories[j], + saved_categories[j]); + if (loadlocale(j) == NULL) { + (void)strcpy(new_categories[j], "C"); + (void)loadlocale(j); + } + } + __global_locale.__numeric_fp_cvt = save__numeric_fp_cvt; + __global_locale.__lc_numeric_loc = save__lc_numeric_loc; + XL_RELEASE(save__lc_numeric_loc); + errno = saverr; + UNLOCK_AND_RETURN (NULL); + } + } + XL_RELEASE(save__lc_numeric_loc); + UNLOCK_AND_RETURN (currentlocale()); +} + +static char * +currentlocale() +{ + int i; + + size_t bufsiz = _LC_LAST * (ENCODING_LEN + 1/*"/"*/ + 1); + static char *current_locale_string = NULL; + + if (current_locale_string == NULL) { + current_locale_string = malloc(bufsiz); + if (current_locale_string == NULL) { + return NULL; + } + } + + (void)strlcpy(current_locale_string, current_categories[1], bufsiz); + + for (i = 2; i < _LC_LAST; ++i) + if (strcmp(current_categories[1], current_categories[i])) { + for (i = 2; i < _LC_LAST; ++i) { + (void)strcat(current_locale_string, "/"); + (void)strcat(current_locale_string, + current_categories[i]); + } + break; + } + return (current_locale_string); +} + +static char * +loadlocale(category) + int category; +{ + char *new = new_categories[category]; + char *old = current_categories[category]; + int (*func)(const char *, locale_t); + int saved_errno; + + if ((new[0] == '.' && + (new[1] == '\0' || (new[1] == '.' && new[2] == '\0'))) || + strchr(new, '/') != NULL) { + errno = EINVAL; + return (NULL); + } + + saved_errno = errno; + errno = __detect_path_locale(); + if (errno != 0) + return (NULL); + errno = saved_errno; + + switch (category) { + case LC_CTYPE: + func = __wrap_setrunelocale; + break; + case LC_COLLATE: + func = __collate_load_tables; + break; + case LC_TIME: + func = __time_load_locale; + break; + case LC_NUMERIC: + func = __numeric_load_locale; + break; + case LC_MONETARY: + func = __monetary_load_locale; + break; + case LC_MESSAGES: + func = __messages_load_locale; + break; + default: + errno = EINVAL; + return (NULL); + } + + if (strcmp(new, old) == 0) + return (old); + + if (func(new, &__global_locale) != _LDP_ERROR) { + (void)strcpy(old, new); + switch (category) { + case LC_CTYPE: + if (__global_locale.__numeric_fp_cvt == LC_NUMERIC_FP_SAME_LOCALE) + __global_locale.__numeric_fp_cvt = LC_NUMERIC_FP_UNINITIALIZED; + break; + case LC_NUMERIC: + __global_locale.__numeric_fp_cvt = LC_NUMERIC_FP_UNINITIALIZED; + XL_RELEASE(__global_locale.__lc_numeric_loc); + __global_locale.__lc_numeric_loc = NULL; + break; + } + return (old); + } + + return (NULL); +} + +__private_extern__ const char * +__get_locale_env(category) + int category; +{ + const char *env; + + /* 1. check LC_ALL. */ + env = getenv(categories[0]); + + /* 2. check LC_* */ + if (env == NULL || !*env) + env = getenv(categories[category]); + + /* 3. check LANG */ + if (env == NULL || !*env) + env = getenv("LANG"); + + /* 4. if none is set, fall to "C" */ + if (env == NULL || !*env) + env = "C"; + + return (env); +} + +/* + * Detect locale storage location and store its value to _PathLocale variable + */ +__private_extern__ int +__detect_path_locale(void) +{ + if (_PathLocale == NULL) { + char *p = getenv("PATH_LOCALE"); + + if (p != NULL && !issetugid()) { + if (strlen(p) + 1/*"/"*/ + ENCODING_LEN + + 1/*"/"*/ + CATEGORY_LEN >= PATH_MAX) + return (ENAMETOOLONG); + _PathLocale = strdup(p); + if (_PathLocale == NULL) + return (errno == 0 ? ENOMEM : errno); + } else + _PathLocale = _PATH_LOCALE; + } + return (0); +} + +__private_extern__ int +__open_path_locale(const char *subpath) +{ + char filename[PATH_MAX]; + int fd; + + strcpy(filename, _PathLocale); + strcat(filename, "/"); + strcat(filename, subpath); + fd = _open(filename, O_RDONLY); + if (fd >= 0) { + return fd; + } + + strcpy(filename, _PATH_LOCALE); + strcat(filename, "/"); + strcat(filename, subpath); + fd = _open(filename, O_RDONLY); + if (fd >= 0) { + return fd; + } + + strcpy(filename, "/usr/local/share/locale"); + strcat(filename, "/"); + strcat(filename, subpath); + return _open(filename, O_RDONLY); +} + diff --git a/locale/FreeBSD/setlocale.h b/locale/FreeBSD/setlocale.h new file mode 100644 index 0000000..fd002f2 --- /dev/null +++ b/locale/FreeBSD/setlocale.h @@ -0,0 +1,43 @@ +/*- + * Copyright (C) 1997 by Andrey A. Chernov, Moscow, Russia. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/locale/setlocale.h,v 1.6 2003/07/06 02:03:37 ache Exp $ + */ + +#ifndef _SETLOCALE_H_ +#define _SETLOCALE_H_ + +#include + +#define ENCODING_LEN 31 +#define CATEGORY_LEN 11 + +extern char *_PathLocale; + +int __detect_path_locale(void); +int __wrap_setrunelocale(const char *, locale_t); +int __open_path_locale(const char *); + +#endif /* !_SETLOCALE_H_ */ diff --git a/locale/FreeBSD/setrunelocale.c b/locale/FreeBSD/setrunelocale.c new file mode 100644 index 0000000..852109c --- /dev/null +++ b/locale/FreeBSD/setrunelocale.c @@ -0,0 +1,207 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/setrunelocale.c,v 1.51 2008/01/23 03:05:35 ache Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include "ldpart.h" +#include "mblocal.h" +#include "setlocale.h" + +extern struct __xlocale_st_runelocale *_Read_RuneMagi(FILE *); + +#ifdef UNIFDEF_LEGACY_RUNE_APIS +/* depreciated interfaces */ +rune_t sgetrune(const char *, size_t, char const **); +int sputrune(rune_t, char *, size_t, char **); +#endif /* UNIFDEF_LEGACY_RUNE_APIS */ + +__private_extern__ int +__setrunelocale(const char *encoding, locale_t loc) +{ + FILE *fp; + char name[PATH_MAX]; + struct __xlocale_st_runelocale *xrl; + _RuneLocale *rl; + int saverr, ret; + static struct __xlocale_st_runelocale *CachedRuneLocale; + extern int __mb_cur_max; + extern int __mb_sb_limit; + static os_unfair_lock cache_lock = OS_UNFAIR_LOCK_INIT; + + /* + * The "C" and "POSIX" locale are always here. + */ + if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) { + XL_RELEASE(loc->__lc_ctype); + loc->__lc_ctype = &_DefaultRuneXLocale; + /* no need to retain _DefaultRuneXLocale */ + if (loc == &__global_locale) { + _CurrentRuneLocale = &loc->__lc_ctype->_CurrentRuneLocale; + __mb_cur_max = loc->__lc_ctype->__mb_cur_max; + __mb_sb_limit = loc->__lc_ctype->__mb_sb_limit; + } + return (0); + } + + /* + * If the locale name is the same as our cache, use the cache. + */ + os_unfair_lock_lock(&cache_lock); + if (CachedRuneLocale != NULL && + strcmp(encoding, CachedRuneLocale->__ctype_encoding) == 0) { + XL_RELEASE(loc->__lc_ctype); + loc->__lc_ctype = CachedRuneLocale; + XL_RETAIN(loc->__lc_ctype); + if (loc == &__global_locale) { + _CurrentRuneLocale = &loc->__lc_ctype->_CurrentRuneLocale; + __mb_cur_max = loc->__lc_ctype->__mb_cur_max; + __mb_sb_limit = loc->__lc_ctype->__mb_sb_limit; + } + os_unfair_lock_unlock(&cache_lock); + return (0); + } + os_unfair_lock_unlock(&cache_lock); + + /* + * Slurp the locale file into the cache. + */ + + /* Range checking not needed, encoding length already checked before */ + (void) strcpy(name, encoding); + (void) strcat(name, "/LC_CTYPE"); + + if ((fp = fdopen(__open_path_locale(name), "r")) == NULL) + return (errno == 0 ? ENOENT : errno); + + if ((xrl = _Read_RuneMagi(fp)) == NULL) { + saverr = (errno == 0 ? EFTYPE : errno); + (void)fclose(fp); + return (saverr); + } + (void)fclose(fp); + + xrl->__mbrtowc = NULL; + xrl->__mbsinit = NULL; + xrl->__mbsnrtowcs = __mbsnrtowcs_std; + xrl->__wcrtomb = NULL; + xrl->__wcsnrtombs = __wcsnrtombs_std; + + rl = &xrl->_CurrentRuneLocale; + +#ifdef UNIFDEF_LEGACY_RUNE_APIS + /* provide backwards compatibility (depreciated interface) */ + rl->__sputrune = sputrune; + rl->__sgetrune = sgetrune; +#else /* UNIFDEF_LEGACY_RUNE_APIS */ + rl->__sputrune = NULL; + rl->__sgetrune = NULL; +#endif /* UNIFDEF_LEGACY_RUNE_APIS */ + + if (strcmp(rl->__encoding, "NONE") == 0) + ret = _none_init(xrl); + else if (strcmp(rl->__encoding, "ASCII") == 0) + ret = _ascii_init(xrl); + else if (strcmp(rl->__encoding, "UTF-8") == 0) + ret = _UTF8_init(xrl); + else if (strcmp(rl->__encoding, "EUC") == 0) + ret = _EUC_init(xrl); + else if (strcmp(rl->__encoding, "GB18030") == 0) + ret = _GB18030_init(xrl); + else if (strcmp(rl->__encoding, "GB2312") == 0) + ret = _GB2312_init(xrl); + else if (strcmp(rl->__encoding, "GBK") == 0) + ret = _GBK_init(xrl); + else if (strcmp(rl->__encoding, "BIG5") == 0) + ret = _BIG5_init(xrl); + else if (strcmp(rl->__encoding, "MSKanji") == 0) + ret = _MSKanji_init(xrl); + else if (strcmp(rl->__encoding, "UTF2") == 0) + ret = _UTF2_init(xrl); + else + ret = EFTYPE; + + if (ret == 0) { + (void)strcpy(xrl->__ctype_encoding, encoding); + XL_RELEASE(loc->__lc_ctype); + loc->__lc_ctype = xrl; + if (loc == &__global_locale) { + _CurrentRuneLocale = &loc->__lc_ctype->_CurrentRuneLocale; + __mb_cur_max = loc->__lc_ctype->__mb_cur_max; + __mb_sb_limit = loc->__lc_ctype->__mb_sb_limit; + } + os_unfair_lock_lock(&cache_lock); + XL_RELEASE(CachedRuneLocale); + CachedRuneLocale = xrl; + XL_RETAIN(CachedRuneLocale); + os_unfair_lock_unlock(&cache_lock); + } else + XL_RELEASE(xrl); + + return (ret); +} + +#ifdef UNIFDEF_LEGACY_RUNE_APIS +int +setrunelocale(const char *encoding) +{ + int ret; + + XL_LOCK(&__global_locale); + ret = __setrunelocale(encoding, &__global_locale); + XL_UNLOCK(&__global_locale); + return ret; +} +#endif /* UNIFDEF_LEGACY_RUNE_APIS */ + +__private_extern__ int +__wrap_setrunelocale(const char *locale, locale_t loc) +{ + int ret = __setrunelocale(locale, loc); + + if (ret != 0) { + errno = ret; + return (_LDP_ERROR); + } + return (_LDP_LOADED); +} + diff --git a/locale/FreeBSD/table.c b/locale/FreeBSD/table.c new file mode 100644 index 0000000..747b604 --- /dev/null +++ b/locale/FreeBSD/table.c @@ -0,0 +1,468 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 6/27/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/table.c,v 1.28 2007/01/09 00:28:00 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include "mblocal.h" + +/* _DefaultRuneLocale is depreciated; _DefaultRuneXLocale is used instead */ +_RuneLocale _DefaultRuneLocale __attribute__((section("__DATA,__constrw"))) = { + _RUNE_MAGIC_A, + "NONE", + NULL, + NULL, + 0xFFFD, + + { /*00*/ _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + /*08*/ _CTYPE_C, + _CTYPE_C|_CTYPE_S|_CTYPE_B, + _CTYPE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'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + }, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + }, +}; + +struct __xlocale_st_runelocale _DefaultRuneXLocale __attribute__((section("__DATA,__constrw"))) = { + 0, + XPERMANENT, + "C", + 1, + 256, + _none_mbrtowc, + _none_mbsinit, + _none_mbsnrtowcs, + _none_wcrtomb, + _none_wcsnrtombs, + sizeof(struct __xlocale_st_runelocale), + { + _RUNE_MAGIC_A, + "NONE", + NULL, + NULL, + 0xFFFD, + + { /*00*/ _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + /*08*/ _CTYPE_C, + _CTYPE_C|_CTYPE_S|_CTYPE_B, + _CTYPE_C|_CTYPE_S, + _CTYPE_C|_CTYPE_S, + _CTYPE_C|_CTYPE_S, + _CTYPE_C|_CTYPE_S, + _CTYPE_C, + _CTYPE_C, + /*10*/ _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + /*18*/ _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + _CTYPE_C, + /*20*/ _CTYPE_S|_CTYPE_B|_CTYPE_R, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYP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_CTYPE_L|_CTYPE_R|_CTYPE_G|_CTYPE_A, + _CTYPE_L|_CTYPE_R|_CTYPE_G|_CTYPE_A, + /*78*/ _CTYPE_L|_CTYPE_R|_CTYPE_G|_CTYPE_A, + _CTYPE_L|_CTYPE_R|_CTYPE_G|_CTYPE_A, + _CTYPE_L|_CTYPE_R|_CTYPE_G|_CTYPE_A, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_P|_CTYPE_R|_CTYPE_G, + _CTYPE_C, + }, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8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, 0x3f, + 0x40, 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + }, + }, +}; + +_RuneLocale *_CurrentRuneLocale = &_DefaultRuneXLocale._CurrentRuneLocale; diff --git a/locale/FreeBSD/toascii.3 b/locale/FreeBSD/toascii.3 new file mode 100644 index 0000000..7c37d11 --- /dev/null +++ b/locale/FreeBSD/toascii.3 @@ -0,0 +1,69 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)toascii.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/toascii.3,v 1.10 2009/09/04 07:44:58 des Exp $ +.\" +.Dd June 4, 1993 +.Dt TOASCII 3 +.Os +.Sh NAME +.Nm toascii +.Nd convert a byte to 7-bit ASCII +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fn toascii "int c" +.Sh DESCRIPTION +The +.Fn toascii +function strips all but the low 7 bits from a letter, +including parity or other marker bits. +.Sh RETURN VALUES +The +.Fn toascii +function always returns a valid ASCII character. +.Sh SEE ALSO +.Xr digittoint 3 , +.Xr isalnum 3 , +.Xr isalpha 3 , +.Xr isascii 3 , +.Xr iscntrl 3 , +.Xr isdigit 3 , +.Xr isgraph 3 , +.Xr islower 3 , +.Xr isprint 3 , +.Xr ispunct 3 , +.Xr isspace 3 , +.Xr isupper 3 , +.Xr isxdigit 3 , +.Xr stdio 3 , +.Xr tolower 3 , +.Xr toupper 3 , +.Xr ascii 7 diff --git a/locale/FreeBSD/tolower.3 b/locale/FreeBSD/tolower.3 new file mode 100644 index 0000000..0ac4aba --- /dev/null +++ b/locale/FreeBSD/tolower.3 @@ -0,0 +1,98 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)tolower.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/tolower.3,v 1.21 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt TOLOWER 3 +.Os +.Sh NAME +.Nm tolower , +.Nm tolower_l +.Nd upper case to lower case letter conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fo tolower +.Fa "int c" +.Fc +.In ctype.h +.In xlocale.h +.Ft int +.Fo tolower_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn tolower +function converts an upper-case letter to the corresponding lower-case +letter. +The argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +Although the +.Fn tolower +function uses the current locale, the +.Fn tolower_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If the argument is an upper-case letter, the +.Fn tolower +function returns the corresponding lower-case letter if there is +one; otherwise, the argument is returned unchanged. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn towlower +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr islower 3 , +.Xr towlower 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn tolower +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/tolower.c b/locale/FreeBSD/tolower.c new file mode 100644 index 0000000..298b321 --- /dev/null +++ b/locale/FreeBSD/tolower.c @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/tolower.c,v 1.13 2007/01/09 00:28:01 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +__ct_rune_t +___tolower_l(c, loc) + __ct_rune_t c; + locale_t loc; +{ + size_t lim; + _RuneRange *rr; + _RuneEntry *base, *re; + + if (c < 0 || c == EOF) + return(c); + + NORMALIZE_LOCALE(loc); + /* + * the following is not used by tolower(), but can be used by + * tolower_l(). This provides the oppurtunity to optimize tolower() + * when compatibility for Panther and lower is no longer needed + */ + if (c < _CACHED_RUNES) + return loc->__lc_ctype->_CurrentRuneLocale.__maplower[c]; + rr = &loc->__lc_ctype->_CurrentRuneLocale.__maplower_ext; + /* Binary search -- see bsearch.c for explanation. */ + base = rr->__ranges; + for (lim = rr->__nranges; lim != 0; lim >>= 1) { + re = base + (lim >> 1); + if (re->__min <= c && c <= re->__max) + return (re->__map + c - re->__min); + else if (c > re->__max) { + base = re + 1; + lim--; + } + } + + return(c); +} + +__ct_rune_t +___tolower(c) + __ct_rune_t c; +{ + return ___tolower_l(c, __current_locale()); +} diff --git a/locale/FreeBSD/toupper.3 b/locale/FreeBSD/toupper.3 new file mode 100644 index 0000000..5b196a9 --- /dev/null +++ b/locale/FreeBSD/toupper.3 @@ -0,0 +1,98 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)toupper.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/toupper.3,v 1.21 2009/09/04 07:44:58 des Exp $ +.\" +.Dd July 17, 2005 +.Dt TOUPPER 3 +.Os +.Sh NAME +.Nm toupper , +.Nm toupper_l +.Nd lower case to upper case letter conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.Ft int +.Fo toupper +.Fa "int c" +.Fc +.In ctype.h +.In xlocale.h +.Ft int +.Fo toupper_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn toupper +function converts a lower-case letter to the corresponding +upper-case letter. +The argument must be representable as an +.Vt "unsigned char" +or the value of +.Dv EOF . +.Pp +Although the +.Fn toupper +function uses the current locale, the +.Fn toupper_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If the argument is a lower-case letter, the +.Fn toupper +function returns the corresponding upper-case letter if there is +one; otherwise, the argument is returned unchanged. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn towupper +function should be used instead. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr isupper 3 , +.Xr towupper 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn toupper +function conforms to +.St -isoC . diff --git a/locale/FreeBSD/toupper.c b/locale/FreeBSD/toupper.c new file mode 100644 index 0000000..d02ddd6 --- /dev/null +++ b/locale/FreeBSD/toupper.c @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/toupper.c,v 1.13 2007/01/09 00:28:01 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +__ct_rune_t +___toupper_l(c, loc) + __ct_rune_t c; + locale_t loc; +{ + size_t lim; + _RuneRange *rr; + _RuneEntry *base, *re; + + if (c < 0 || c == EOF) + return(c); + + NORMALIZE_LOCALE(loc); + /* + * the following is not used by toupper(), but can be used by + * toupper_l(). This provides the oppurtunity to optimize toupper() + * when compatibility for Panther and lower is no longer needed + */ + if (c < _CACHED_RUNES) + return loc->__lc_ctype->_CurrentRuneLocale.__mapupper[c]; + rr = &loc->__lc_ctype->_CurrentRuneLocale.__mapupper_ext; + /* Binary search -- see bsearch.c for explanation. */ + base = rr->__ranges; + for (lim = rr->__nranges; lim != 0; lim >>= 1) { + re = base + (lim >> 1); + if (re->__min <= c && c <= re->__max) + return (re->__map + c - re->__min); + else if (c > re->__max) { + base = re + 1; + lim--; + } + } + + return(c); +} + +__ct_rune_t +___toupper(c) + __ct_rune_t c; +{ + return ___toupper_l(c, __current_locale()); +} diff --git a/locale/FreeBSD/towlower.3 b/locale/FreeBSD/towlower.3 new file mode 100644 index 0000000..248d5b1 --- /dev/null +++ b/locale/FreeBSD/towlower.3 @@ -0,0 +1,85 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)tolower.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/towlower.3,v 1.6 2007/01/09 00:28:01 imp Exp $ +.\" +.Dd October 3, 2002 +.Dt TOWLOWER 3 +.Os +.Sh NAME +.Nm towlower , +.Nm towlower_l +.Nd "upper case to lower case letter conversion (wide character version)" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.Ft wint_t +.Fo towlower +.Fa "wint_t wc" +.Fc +.In wctype.h +.In xlocale.h +.Ft wint_t +.Fo towlower_l +.Fa "wint_t wc" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn towlower +function converts an upper-case letter to the corresponding lower-case +letter. +.Pp +Although the +.Fn towlower +function uses the current locale, the +.Fn towlower_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If the argument is an upper-case letter, the +.Fn towlower +function returns the corresponding lower-case letter if there is +one; otherwise, the argument is returned unchanged. +.Sh SEE ALSO +.Xr iswlower 3 , +.Xr tolower 3 , +.Xr towupper 3 , +.Xr wctrans 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn towlower +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/towupper.3 b/locale/FreeBSD/towupper.3 new file mode 100644 index 0000000..5df8bb0 --- /dev/null +++ b/locale/FreeBSD/towupper.3 @@ -0,0 +1,85 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)toupper.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/towupper.3,v 1.3 2007/01/09 00:28:01 imp Exp $ +.\" +.Dd October 3, 2002 +.Dt TOWUPPER 3 +.Os +.Sh NAME +.Nm towupper , +.Nm towupper_l +.Nd "lower case to upper case letter conversion (wide character version)" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.Ft wint_t +.Fo towupper +.Fa "wint_t wc" +.Fc +.In wctype.h +.In xlocale.h +.Ft wint_t +.Fo towupper_l +.Fa "wint_t wc" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn towupper +function converts a lower-case letter to the corresponding +upper-case letter. +.Pp +Although the +.Fn towupper +function uses the current locale, the +.Fn towupper_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If the argument is a lower-case letter, the +.Fn towupper +function returns the corresponding upper-case letter if there is +one; otherwise, the argument is returned unchanged. +.Sh SEE ALSO +.Xr iswupper 3 , +.Xr toupper 3 , +.Xr towlower 3 , +.Xr wctrans 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn towupper +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/utf2.c b/locale/FreeBSD/utf2.c new file mode 100644 index 0000000..006b32f --- /dev/null +++ b/locale/FreeBSD/utf2.c @@ -0,0 +1,411 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +// MWW: Generated by applying utf2.c.patch to utf8.c in the FreeBSD patch sets. + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/utf8.c,v 1.16 2007/10/15 09:51:30 ache Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +#define UTF2_MB_CUR_MAX 3 + +static size_t _UTF2_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +static int _UTF2_mbsinit(const mbstate_t *, locale_t); +static size_t _UTF2_mbsnrtowcs(wchar_t * __restrict, + const char ** __restrict, size_t, size_t, + mbstate_t * __restrict, locale_t); +static size_t _UTF2_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); +static size_t _UTF2_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict, locale_t); + +typedef struct { + wchar_t ch; + int want; + wchar_t lbound; +} _UTF2State; + +int +_UTF2_init(struct __xlocale_st_runelocale *xrl) +{ + + xrl->__mbrtowc = _UTF2_mbrtowc; + xrl->__wcrtomb = _UTF2_wcrtomb; + xrl->__mbsinit = _UTF2_mbsinit; + xrl->__mbsnrtowcs = _UTF2_mbsnrtowcs; + xrl->__wcsnrtombs = _UTF2_wcsnrtombs; + xrl->__mb_cur_max = UTF2_MB_CUR_MAX; + /* + * UCS-4 encoding used as the internal representation, so + * slots 0x0080-0x00FF are occuped and must be excluded + * from the single byte ctype by setting the limit. + */ + xrl->__mb_sb_limit = 128; + + return (0); +} + +static int +_UTF2_mbsinit(const mbstate_t *ps, locale_t loc) +{ + + return (ps == NULL || ((const _UTF2State *)ps)->want == 0); +} + +static size_t +_UTF2_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps, locale_t loc) +{ + _UTF2State *us; + int ch, i, mask, want; + wchar_t lbound, wch; + + us = (_UTF2State *)ps; + + if (us->want < 0 || us->want > 6) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) { + s = ""; + n = 1; + pwc = NULL; + } + + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + + if (us->want == 0 && ((ch = (unsigned char)*s) & ~0x7f) == 0) { + /* Fast path for plain ASCII characters. */ + if (pwc != NULL) + *pwc = ch; + return (ch != '\0' ? 1 : 0); + } + + if (us->want == 0) { + /* + * Determine the number of octets that make up this character + * from the first octet, and a mask that extracts the + * interesting bits of the first octet. We already know + * the character is at least two bytes long. + * + * We also specify a lower bound for the character code to + * detect redundant, non-"shortest form" encodings. For + * example, the sequence C0 80 is _not_ a legal representation + * of the null character. This enforces a 1-to-1 mapping + * between character codes and their multibyte representations. + */ + ch = (unsigned char)*s; + if ((ch & 0x80) == 0) { + mask = 0x7f; + want = 1; + lbound = 0; + } else if ((ch & 0xe0) == 0xc0) { + mask = 0x1f; + want = 2; + lbound = 0x80; + } else if ((ch & 0xf0) == 0xe0) { + mask = 0x0f; + want = 3; + lbound = 0x800; + } else { + /* + * Malformed input; input is not UTF2. + */ + errno = EILSEQ; + return ((size_t)-1); + } + } else { + want = us->want; + lbound = us->lbound; + } + + /* + * Decode the octet sequence representing the character in chunks + * of 6 bits, most significant first. + */ + if (us->want == 0) + wch = (unsigned char)*s++ & mask; + else + wch = us->ch; + for (i = (us->want == 0) ? 1 : 0; i < MIN(want, n); i++) { + if ((*s & 0xc0) != 0x80) { + /* + * Malformed input; bad characters in the middle + * of a character. + */ + errno = EILSEQ; + return ((size_t)-1); + } + wch <<= 6; + wch |= *s++ & 0x3f; + } + if (i < want) { + /* Incomplete multibyte sequence. */ + us->want = want - i; + us->lbound = lbound; + us->ch = wch; + return ((size_t)-2); + } + if (wch < lbound) { + /* + * Malformed input; redundant encoding. + */ + errno = EILSEQ; + return ((size_t)-1); + } + if (pwc != NULL) + *pwc = wch; + us->want = 0; + return (wch == L'\0' ? 0 : want); +} + +static size_t +_UTF2_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, + size_t nms, size_t len, mbstate_t * __restrict ps, locale_t loc) +{ + _UTF2State *us; + const char *s; + size_t nchr; + wchar_t wc; + size_t nb; + + us = (_UTF2State *)ps; + + s = *src; + nchr = 0; + + if (dst == NULL) { + /* + * The fast path in the loop below is not safe if an ASCII + * character appears as anything but the first byte of a + * multibyte sequence. Check now to avoid doing it in the loop. + */ + if (nms > 0 && us->want > 0 && (signed char)*s > 0) { + errno = EILSEQ; + return ((size_t)-1); + } + for (;;) { + if (nms > 0 && (signed char)*s > 0) + /* + * Fast path for plain ASCII characters + * excluding NUL. + */ + nb = 1; + else if ((nb = _UTF2_mbrtowc(&wc, s, nms, ps, loc)) == + (size_t)-1) + /* Invalid sequence - mbrtowc() sets errno. */ + return ((size_t)-1); + else if (nb == 0 || nb == (size_t)-2) + return (nchr); + s += nb; + nms -= nb; + nchr++; + } + /*NOTREACHED*/ + } + + /* + * The fast path in the loop below is not safe if an ASCII + * character appears as anything but the first byte of a + * multibyte sequence. Check now to avoid doing it in the loop. + */ + if (nms > 0 && len > 0 && us->want > 0 && (signed char)*s > 0) { + errno = EILSEQ; + return ((size_t)-1); + } + while (len-- > 0) { + if (nms > 0 && (signed char)*s > 0) { + /* + * Fast path for plain ASCII characters + * excluding NUL. + */ + *dst = (wchar_t)*s; + nb = 1; + } else if ((nb = _UTF2_mbrtowc(dst, s, nms, ps, loc)) == + (size_t)-1) { + *src = s; + return ((size_t)-1); + } else if (nb == (size_t)-2) { + *src = s + nms; + return (nchr); + } else if (nb == 0) { + *src = NULL; + return (nchr); + } + s += nb; + nms -= nb; + nchr++; + dst++; + } + *src = s; + return (nchr); +} + +static size_t +_UTF2_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc) +{ + _UTF2State *us; + unsigned char lead; + int i, len; + + us = (_UTF2State *)ps; + + if (us->want != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + + if ((wc & ~0x7f) == 0) { + /* Fast path for plain ASCII characters. */ + *s = (char)wc; + return (1); + } + + /* + * Determine the number of octets needed to represent this character. + * We always output the shortest sequence possible. Also specify the + * first few bits of the first octet, which contains the information + * about the sequence length. + */ + if ((wc & ~0x7f) == 0) { + lead = 0; + len = 1; + } else if ((wc & ~0x7ff) == 0) { + lead = 0xc0; + len = 2; + } else if ((wc & ~0xffff) == 0) { + lead = 0xe0; + len = 3; + } else { + errno = EILSEQ; + return ((size_t)-1); + } + + /* + * Output the octets representing the character in chunks + * of 6 bits, least significant last. The first octet is + * a special case because it contains the sequence length + * information. + */ + for (i = len - 1; i > 0; i--) { + s[i] = (wc & 0x3f) | 0x80; + wc >>= 6; + } + *s = (wc & 0xff) | lead; + + return (len); +} + +static size_t +_UTF2_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, + size_t nwc, size_t len, mbstate_t * __restrict ps, locale_t loc) +{ + _UTF2State *us; + char buf[MB_LEN_MAX]; + const wchar_t *s; + size_t nbytes; + size_t nb; + + us = (_UTF2State *)ps; + + if (us->want != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + s = *src; + nbytes = 0; + + if (dst == NULL) { + while (nwc-- > 0) { + if (0 <= *s && *s < 0x80) + /* Fast path for plain ASCII characters. */ + nb = 1; + else if ((nb = _UTF2_wcrtomb(buf, *s, ps, loc)) == + (size_t)-1) + /* Invalid character - wcrtomb() sets errno. */ + return ((size_t)-1); + if (*s == L'\0') + return (nbytes + nb - 1); + s++; + nbytes += nb; + } + return (nbytes); + } + + while (len > 0 && nwc-- > 0) { + if (0 <= *s && *s < 0x80) { + /* Fast path for plain ASCII characters. */ + nb = 1; + *dst = *s; + } else if (len > (size_t)UTF2_MB_CUR_MAX) { + /* Enough space to translate in-place. */ + if ((nb = _UTF2_wcrtomb(dst, *s, ps, loc)) == (size_t)-1) { + *src = s; + return ((size_t)-1); + } + } else { + /* + * May not be enough space; use temp. buffer. + */ + if ((nb = _UTF2_wcrtomb(buf, *s, ps, loc)) == (size_t)-1) { + *src = s; + return ((size_t)-1); + } + if (nb > (int)len) + /* MB sequence for character won't fit. */ + break; + memcpy(dst, buf, nb); + } + if (*s == L'\0') { + *src = NULL; + return (nbytes + nb - 1); + } + s++; + dst += nb; + len -= nb; + nbytes += nb; + } + *src = s; + return (nbytes); +} diff --git a/locale/FreeBSD/utf8.5 b/locale/FreeBSD/utf8.5 new file mode 100644 index 0000000..e5c3b61 --- /dev/null +++ b/locale/FreeBSD/utf8.5 @@ -0,0 +1,102 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Paul Borman at Krystal Technologies. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)utf2.4 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/utf8.5,v 1.7 2007/01/09 00:28:01 imp Exp $ +.\" +.Dd April 7, 2004 +.Dt UTF8 5 +.Os +.Sh NAME +.Nm utf8 +.Nd "UTF-8, a transformation format of ISO 10646" +.Sh SYNOPSIS +.Nm ENCODING +.Qq UTF-8 +.Sh DESCRIPTION +The +.Nm UTF-8 +encoding represents UCS-4 characters as a sequence of octets, using +between 1 and 6 for each character. +It is backwards compatible with +.Tn ASCII , +so 0x00-0x7f refer to the +.Tn ASCII +character set. +The multibyte encoding of +.No non- Ns Tn ASCII +characters +consist entirely of bytes whose high order bit is set. +The actual +encoding is represented by the following table: +.Bd -literal +[0x00000000 - 0x0000007f] [00000000.0bbbbbbb] -> 0bbbbbbb +[0x00000080 - 0x000007ff] [00000bbb.bbbbbbbb] -> 110bbbbb, 10bbbbbb +[0x00000800 - 0x0000ffff] [bbbbbbbb.bbbbbbbb] -> + 1110bbbb, 10bbbbbb, 10bbbbbb +[0x00010000 - 0x001fffff] [00000000.000bbbbb.bbbbbbbb.bbbbbbbb] -> + 11110bbb, 10bbbbbb, 10bbbbbb, 10bbbbbb +[0x00200000 - 0x03ffffff] [000000bb.bbbbbbbb.bbbbbbbb.bbbbbbbb] -> + 111110bb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb +[0x04000000 - 0x7fffffff] [0bbbbbbb.bbbbbbbb.bbbbbbbb.bbbbbbbb] -> + 1111110b, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb +.Ed +.Pp +If more than a single representation of a value exists (for example, +0x00; 0xC0 0x80; 0xE0 0x80 0x80) the shortest representation is always +used. +Longer ones are detected as an error as they pose a potential +security risk, and destroy the 1:1 character:octet sequence mapping. +.Sh SEE ALSO +.Xr euc 5 +.Rs +.%A "Rob Pike" +.%A "Ken Thompson" +.%T "Hello World" +.%J "Proceedings of the Winter 1993 USENIX Technical Conference" +.%Q "USENIX Association" +.%D "January 1993" +.Re +.Rs +.%A "F. Yergeau" +.%T "UTF-8, a transformation format of ISO 10646" +.%O "RFC 2279" +.%D "January 1998" +.Re +.Rs +.%Q "The Unicode Consortium" +.%T "The Unicode Standard, Version 3.0" +.%D "2000" +.%O "as amended by the Unicode Standard Annex #27: Unicode 3.1 and by the Unicode Standard Annex #28: Unicode 3.2" +.Re +.Sh STANDARDS +The +.Nm +encoding is compatible with RFC 2279 and Unicode 3.2. diff --git a/locale/FreeBSD/utf8.c b/locale/FreeBSD/utf8.c new file mode 100644 index 0000000..100573e --- /dev/null +++ b/locale/FreeBSD/utf8.c @@ -0,0 +1,467 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/utf8.c,v 1.16 2007/10/15 09:51:30 ache Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +/* + * 10952550: detect ill-formed UTF-8 + * Unicode 6.0, section D92, mandates specific byte sequences for well- + * formed UTF-8. UTF-8 sequences are now limited to 4 bytes, while the + * FreeBSD code originally handled up to 6. Illegal surrogate code point + * sequences are now detected. And while "non-shortest forms" were detected, + * this only happened after completing the sequence. Now, all ill-formed + * sequences are detected at the earliest point. + * + * Table 3-7. Well-Formed UTF-8 Byte Sequences + * + * Code Points 1st 2nd 3rd 4th Byte + * U+0000..U+007F 00..7F + * U+0080..U+07FF C2..DF 80..BF + * U+0800..U+0FFF E0 A0..BF 80..BF + * U+1000..U+CFFF E1..EC 80..BF 80..BF + * U+D000..U+D7FF ED 80..9F 80..BF + * U+E000..U+FFFF EE..EF 80..BF 80..BF + * U+10000..U+3FFFF F0 90..BF 80..BF 80..BF + * U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF + * U+100000..U+10FFFF F4 80..8F 80..BF 80..BF + * + * Note that while any 3rd and 4th byte can be in the range 80..BF, the + * second byte is often limited to a smaller range. + */ + +typedef struct { + unsigned char lowerbound; + unsigned char upperbound; +} SecondByte; +static SecondByte sb_00_00 = {0x00, 0x00}; +static SecondByte sb_80_8F = {0x80, 0x8F}; +static SecondByte sb_80_9F = {0x80, 0x9F}; +static SecondByte sb_80_BF = {0x80, 0xBF}; +static SecondByte sb_90_BF = {0x90, 0xBF}; +static SecondByte sb_A0_BF = {0xA0, 0xBF}; + +#define UTF8_MB_CUR_MAX 4 + +static size_t _UTF8_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); +static int _UTF8_mbsinit(const mbstate_t *, locale_t); +static size_t _UTF8_mbsnrtowcs(wchar_t * __restrict, + const char ** __restrict, size_t, size_t, + mbstate_t * __restrict, locale_t); +static size_t _UTF8_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); +static size_t _UTF8_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict, locale_t); + +typedef struct { + wchar_t ch; + int want; + SecondByte sb; +} _UTF8State; + +int +_UTF8_init(struct __xlocale_st_runelocale *xrl) +{ + + xrl->__mbrtowc = _UTF8_mbrtowc; + xrl->__wcrtomb = _UTF8_wcrtomb; + xrl->__mbsinit = _UTF8_mbsinit; + xrl->__mbsnrtowcs = _UTF8_mbsnrtowcs; + xrl->__wcsnrtombs = _UTF8_wcsnrtombs; + xrl->__mb_cur_max = UTF8_MB_CUR_MAX; + /* + * UCS-4 encoding used as the internal representation, so + * slots 0x0080-0x00FF are occuped and must be excluded + * from the single byte ctype by setting the limit. + */ + xrl->__mb_sb_limit = 128; + + return (0); +} + +static int +_UTF8_mbsinit(const mbstate_t *ps, locale_t loc) +{ + + return (ps == NULL || ((const _UTF8State *)ps)->want == 0); +} + +static size_t +_UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps, locale_t loc) +{ + _UTF8State *us; + int ch, i, mask, want; + wchar_t wch; + SecondByte sb; + + us = (_UTF8State *)ps; + + if (us->want < 0 || us->want > UTF8_MB_CUR_MAX) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) { + s = ""; + n = 1; + pwc = NULL; + } + + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + + if (us->want == 0 && ((ch = (unsigned char)*s) & ~0x7f) == 0) { + /* Fast path for plain ASCII characters. */ + if (pwc != NULL) + *pwc = ch; + return (ch != '\0' ? 1 : 0); + } + + if (us->want == 0) { + /* + * Determine the number of octets that make up this character + * from the first octet, and a mask that extracts the + * interesting bits of the first octet. We already know + * the character is at least two bytes long. + * + * We detect if the first byte is illegal, and set sb to + * the legal range of the second byte. + */ + ch = (unsigned char)*s; + if ((ch & 0x80) == 0) { + mask = 0x7f; + want = 1; + sb = sb_00_00; + } else if ((ch & 0xe0) == 0xc0) { + if (ch < 0xc2) goto malformed; + mask = 0x1f; + want = 2; + sb = sb_80_BF; + } else if ((ch & 0xf0) == 0xe0) { + mask = 0x0f; + want = 3; + switch (ch) { + case 0xe0: + sb = sb_A0_BF; + break; + case 0xed: + sb = sb_80_9F; + break; + default: + sb = sb_80_BF; + break; + } + } else if ((ch & 0xf8) == 0xf0) { + if (ch > 0xf4) goto malformed; + mask = 0x07; + want = 4; + switch (ch) { + case 0xf0: + sb = sb_90_BF; + break; + case 0xf4: + sb = sb_80_8F; + break; + default: + sb = sb_80_BF; + break; + } + } else { +malformed: + /* + * Malformed input; input is not UTF-8. + */ + errno = EILSEQ; + return ((size_t)-1); + } + } else { + want = us->want; + sb = us->sb; + } + + /* + * Decode the octet sequence representing the character in chunks + * of 6 bits, most significant first. + */ + if (us->want == 0) + wch = (unsigned char)*s++ & mask; + else + wch = us->ch; + for (i = (us->want == 0) ? 1 : 0; i < MIN(want, n); i++) { + if (sb.lowerbound) { + if ((unsigned char)*s < sb.lowerbound || + (unsigned char)*s > sb.upperbound) goto malformed; + sb = sb_00_00; + } else if ((*s & 0xc0) != 0x80) goto malformed; + wch <<= 6; + wch |= *s++ & 0x3f; + } + if (i < want) { + /* Incomplete multibyte sequence. */ + us->want = want - i; + us->sb = sb; + us->ch = wch; + return ((size_t)-2); + } + if (pwc != NULL) + *pwc = wch; + us->want = 0; + return (wch == L'\0' ? 0 : want); +} + +static size_t +_UTF8_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, + size_t nms, size_t len, mbstate_t * __restrict ps, locale_t loc) +{ + _UTF8State *us; + const char *s; + size_t nchr; + wchar_t wc; + size_t nb; + + us = (_UTF8State *)ps; + + s = *src; + nchr = 0; + + if (dst == NULL) { + /* + * The fast path in the loop below is not safe if an ASCII + * character appears as anything but the first byte of a + * multibyte sequence. Check now to avoid doing it in the loop. + */ + if (nms > 0 && us->want > 0 && (signed char)*s > 0) { + errno = EILSEQ; + return ((size_t)-1); + } + for (;;) { + if (nms > 0 && (signed char)*s > 0) + /* + * Fast path for plain ASCII characters + * excluding NUL. + */ + nb = 1; + else if ((nb = _UTF8_mbrtowc(&wc, s, nms, ps, loc)) == + (size_t)-1) + /* Invalid sequence - mbrtowc() sets errno. */ + return ((size_t)-1); + else if (nb == 0 || nb == (size_t)-2) + return (nchr); + s += nb; + nms -= nb; + nchr++; + } + /*NOTREACHED*/ + } + + /* + * The fast path in the loop below is not safe if an ASCII + * character appears as anything but the first byte of a + * multibyte sequence. Check now to avoid doing it in the loop. + */ + if (nms > 0 && len > 0 && us->want > 0 && (signed char)*s > 0) { + errno = EILSEQ; + return ((size_t)-1); + } + while (len-- > 0) { + if (nms > 0 && (signed char)*s > 0) { + /* + * Fast path for plain ASCII characters + * excluding NUL. + */ + *dst = (wchar_t)*s; + nb = 1; + } else if ((nb = _UTF8_mbrtowc(dst, s, nms, ps, loc)) == + (size_t)-1) { + *src = s; + return ((size_t)-1); + } else if (nb == (size_t)-2) { + *src = s + nms; + return (nchr); + } else if (nb == 0) { + *src = NULL; + return (nchr); + } + s += nb; + nms -= nb; + nchr++; + dst++; + } + *src = s; + return (nchr); +} + +static size_t +_UTF8_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc) +{ + _UTF8State *us; + unsigned char lead; + int i, len; + + us = (_UTF8State *)ps; + + if (us->want != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + + if ((wc & ~0x7f) == 0) { + /* Fast path for plain ASCII characters. */ + *s = (char)wc; + return (1); + } + + /* + * Determine the number of octets needed to represent this character. + * We always output the shortest sequence possible. Also specify the + * first few bits of the first octet, which contains the information + * about the sequence length. + */ + if ((wc & ~0x7f) == 0) { + lead = 0; + len = 1; + } else if ((wc & ~0x7ff) == 0) { + lead = 0xc0; + len = 2; + } else if ((wc & ~0xffff) == 0) { + if (wc >= 0xd800 && wc <= 0xdfff) goto illegal; + lead = 0xe0; + len = 3; + } else if ((wc & ~0x1fffff) == 0) { + if (wc > 0x10ffff) goto illegal; + lead = 0xf0; + len = 4; + } else { +illegal: + errno = EILSEQ; + return ((size_t)-1); + } + + /* + * Output the octets representing the character in chunks + * of 6 bits, least significant last. The first octet is + * a special case because it contains the sequence length + * information. + */ + for (i = len - 1; i > 0; i--) { + s[i] = (wc & 0x3f) | 0x80; + wc >>= 6; + } + *s = (wc & 0xff) | lead; + + return (len); +} + +static size_t +_UTF8_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, + size_t nwc, size_t len, mbstate_t * __restrict ps, locale_t loc) +{ + _UTF8State *us; + char buf[MB_LEN_MAX]; + const wchar_t *s; + size_t nbytes; + size_t nb; + + us = (_UTF8State *)ps; + + if (us->want != 0) { + errno = EINVAL; + return ((size_t)-1); + } + + s = *src; + nbytes = 0; + + if (dst == NULL) { + while (nwc-- > 0) { + if (0 <= *s && *s < 0x80) + /* Fast path for plain ASCII characters. */ + nb = 1; + else if ((nb = _UTF8_wcrtomb(buf, *s, ps, loc)) == + (size_t)-1) + /* Invalid character - wcrtomb() sets errno. */ + return ((size_t)-1); + if (*s == L'\0') + return (nbytes + nb - 1); + s++; + nbytes += nb; + } + return (nbytes); + } + + while (len > 0 && nwc-- > 0) { + if (0 <= *s && *s < 0x80) { + /* Fast path for plain ASCII characters. */ + nb = 1; + *dst = *s; + } else if (len > (size_t)UTF8_MB_CUR_MAX) { + /* Enough space to translate in-place. */ + if ((nb = _UTF8_wcrtomb(dst, *s, ps, loc)) == (size_t)-1) { + *src = s; + return ((size_t)-1); + } + } else { + /* + * May not be enough space; use temp. buffer. + */ + if ((nb = _UTF8_wcrtomb(buf, *s, ps, loc)) == (size_t)-1) { + *src = s; + return ((size_t)-1); + } + if (nb > (int)len) + /* MB sequence for character won't fit. */ + break; + memcpy(dst, buf, nb); + } + if (*s == L'\0') { + *src = NULL; + return (nbytes + nb - 1); + } + s++; + dst += nb; + len -= nb; + nbytes += nb; + } + *src = s; + return (nbytes); +} diff --git a/locale/FreeBSD/wcrtomb.3 b/locale/FreeBSD/wcrtomb.3 new file mode 100644 index 0000000..2b320a2 --- /dev/null +++ b/locale/FreeBSD/wcrtomb.3 @@ -0,0 +1,128 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wcrtomb.3,v 1.4 2004/04/08 09:59:02 tjr Exp $ +.\" +.Dd April 8, 2004 +.Dt WCRTOMB 3 +.Os +.Sh NAME +.Nm wcrtomb , +.Nm wcrtomb_l +.Nd "convert a wide-character code to a character (restartable)" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft size_t +.Fo wcrtomb +.Fa "char *restrict s" +.Fa "wchar_t wc" +.Fa "mbstate_t *restrict ps" +.Fc +.In wchar.h +.In xlocale.h +.Ft size_t +.Fo wcrtomb_l +.Fa "char *restrict s" +.Fa "wchar_t wc" +.Fa "mbstate_t *restrict ps" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcrtomb +function stores a multibyte sequence representing the +wide character +.Fa wc , +including any necessary shift sequences, to the +character array +.Fa s . +A maximum of +.Dv MB_CUR_MAX +bytes will be stored. +.Pp +If +.Fa s +is +.Dv NULL , +.Fn wcrtomb +behaves as if +.Fa s +pointed to an internal buffer and +.Fa wc +were a null wide character (L'\e0'). +.Pp +The +.Ft mbstate_t +argument, +.Fa ps , +is used to keep track of the shift state. +If it is +.Dv NULL , +.Fn wcrtomb +uses an internal, static +.Vt mbstate_t +object, which is initialized to the initial conversion state +at program startup. +.Pp +While the +.Fn wcrtomb +function uses the current locale, the +.Fn wcrtomb_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn wcrtomb +functions returns the length (in bytes) of the multibyte sequence +needed to represent +.Fa wc , +or +.Po Vt size_t Pc Ns \-1 +if +.Fa wc +is not a valid wide character code. +.Sh ERRORS +The +.Fn wcrtomb +function will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid wide character code was specified. +.It Bq Er EINVAL +The conversion state is invalid. +.El +.Sh SEE ALSO +.Xr mbrtowc 3 , +.Xr multibyte 3 , +.Xr setlocale 3 , +.Xr wctomb 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn wcrtomb +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/wcrtomb.c b/locale/FreeBSD/wcrtomb.c new file mode 100644 index 0000000..81b99d4 --- /dev/null +++ b/locale/FreeBSD/wcrtomb.c @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcrtomb.c,v 1.8 2004/05/12 14:09:04 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include "mblocal.h" + +size_t +wcrtomb_l(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, + locale_t loc) +{ + NORMALIZE_LOCALE(loc); + if (ps == NULL) + ps = &loc->__mbs_wcrtomb; + return (loc->__lc_ctype->__wcrtomb(s, wc, ps, loc)); +} + +size_t +wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) +{ + return wcrtomb_l(s, wc, ps, __current_locale()); +} diff --git a/locale/FreeBSD/wcsftime.3 b/locale/FreeBSD/wcsftime.3 new file mode 100644 index 0000000..b11967a --- /dev/null +++ b/locale/FreeBSD/wcsftime.3 @@ -0,0 +1,88 @@ +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wcsftime.3,v 1.2 2002/11/29 17:35:09 ru Exp $ +.\" +.Dd September 8, 2002 +.Dt WCSFTIME 3 +.Os +.Sh NAME +.Nm wcsftime , +.Nm wcsftime_l +.Nd "convert date and time to a wide-character string" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft size_t +.Fo wcsftime +.Fa "wchar_t *restrict wcs" +.Fa "size_t maxsize" +.Fa "const wchar_t *restrict format" +.Fa "const struct tm *restrict timeptr" +.Fc +.In wchar.h +.In xlocale.h +.Ft size_t +.Fo wcsftime_l +.Fa "wchar_t *restrict wcs" +.Fa "size_t maxsize" +.Fa "const wchar_t *restrict format" +.Fa "const struct tm *restrict timeptr" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcsftime +function is equivalent to the +.Fn strftime +function, except for the types of its arguments. +Refer to +.Xr strftime 3 +for a detailed description. +.Pp +While the +.Fn wcsftime +function uses the current locale, the +.Fn wcsftime_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh COMPATIBILITY +Some early implementations of +.Fn wcsftime +had a +.Fa format +argument with type +.Vt "const char *" , +instead of +.Vt "const wchar_t *" . +.Sh SEE ALSO +.Xr strftime 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn wcsftime +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/wcsftime.c b/locale/FreeBSD/wcsftime.c new file mode 100644 index 0000000..ddf989a --- /dev/null +++ b/locale/FreeBSD/wcsftime.c @@ -0,0 +1,119 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcsftime.c,v 1.6 2009/01/15 20:45:59 rdivacky Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include + +/* + * Convert date and time to a wide-character string. + * + * This is the wide-character counterpart of strftime(). So that we do not + * have to duplicate the code of strftime(), we convert the format string to + * multibyte, call strftime(), then convert the result back into wide + * characters. + * + * This technique loses in the presence of stateful multibyte encoding if any + * of the conversions in the format string change conversion state. When + * stateful encoding is implemented, we will need to reset the state between + * format specifications in the format string. + */ +size_t +wcsftime_l(wchar_t * __restrict wcs, size_t maxsize, + const wchar_t * __restrict format, const struct tm * __restrict timeptr, + locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs; + char *dst, *sformat; + const char *dstp; + const wchar_t *formatp; + size_t n, sflen; + int sverrno; + + NORMALIZE_LOCALE(loc); + sformat = dst = NULL; + + /* + * Convert the supplied format string to a multibyte representation + * for strftime(), which only handles single-byte characters. + */ + mbs = initial; + formatp = format; + sflen = wcsrtombs_l(NULL, &formatp, 0, &mbs, loc); + if (sflen == (size_t)-1) + goto error; + if ((sformat = malloc(sflen + 1)) == NULL) + goto error; + mbs = initial; + wcsrtombs_l(sformat, &formatp, sflen + 1, &mbs, loc); + + /* + * Allocate memory for longest multibyte sequence that will fit + * into the caller's buffer and call strftime() to fill it. + * Then, copy and convert the result back into wide characters in + * the caller's buffer. + */ + if (SIZE_T_MAX / MB_CUR_MAX_L(loc) <= maxsize) { + /* maxsize is prepostorously large - avoid int. overflow. */ + errno = EINVAL; + goto error; + } + if ((dst = malloc(maxsize * MB_CUR_MAX_L(loc))) == NULL) + goto error; + if (strftime_l(dst, maxsize, sformat, timeptr, loc) == 0) + goto error; + dstp = dst; + mbs = initial; + n = mbsrtowcs_l(wcs, &dstp, maxsize, &mbs, loc); + if (n == (size_t)-2 || n == (size_t)-1 || dstp != NULL) + goto error; + + free(sformat); + free(dst); + return (n); + +error: + sverrno = errno; + free(sformat); + free(dst); + errno = sverrno; + return (0); +} + +size_t +wcsftime(wchar_t * __restrict wcs, size_t maxsize, + const wchar_t * __restrict format, const struct tm * __restrict timeptr) +{ + return wcsftime_l(wcs, maxsize, format, timeptr, __current_locale()); +} diff --git a/locale/FreeBSD/wcsnrtombs.c b/locale/FreeBSD/wcsnrtombs.c new file mode 100644 index 0000000..adc29a1 --- /dev/null +++ b/locale/FreeBSD/wcsnrtombs.c @@ -0,0 +1,122 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcsnrtombs.c,v 1.3 2005/02/12 08:45:12 stefanf Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "mblocal.h" + +size_t +wcsnrtombs_l(char * __restrict dst, const wchar_t ** __restrict src, size_t nwc, + size_t len, mbstate_t * __restrict ps, locale_t loc) +{ + NORMALIZE_LOCALE(loc); + if (ps == NULL) + ps = &loc->__mbs_wcsnrtombs; + return (loc->__lc_ctype->__wcsnrtombs(dst, src, nwc, len, ps, loc)); +} + +size_t +wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t nwc, + size_t len, mbstate_t * __restrict ps) +{ + return wcsnrtombs_l(dst, src, nwc, len, ps, __current_locale()); +} + +__private_extern__ size_t +__wcsnrtombs_std(char * __restrict dst, const wchar_t ** __restrict src, + size_t nwc, size_t len, mbstate_t * __restrict ps, locale_t loc) +{ + mbstate_t mbsbak; + char buf[MB_LEN_MAX]; + const wchar_t *s; + size_t nbytes; + size_t nb; + struct __xlocale_st_runelocale *runeLocale = loc->__lc_ctype; + size_t (*__wcrtomb)(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t) = runeLocale->__wcrtomb; + int mb_cur_max = runeLocale->__mb_cur_max; + + s = *src; + nbytes = 0; + + if (dst == NULL) { + while (nwc-- > 0) { + if ((nb = __wcrtomb(buf, *s, ps, loc)) == (size_t)-1) + /* Invalid character - wcrtomb() sets errno. */ + return ((size_t)-1); + else if (*s == L'\0') + return (nbytes + nb - 1); + s++; + nbytes += nb; + } + return (nbytes); + } + + while (len > 0 && nwc-- > 0) { + if (len > (size_t)mb_cur_max) { + /* Enough space to translate in-place. */ + if ((nb = __wcrtomb(dst, *s, ps, loc)) == (size_t)-1) { + *src = s; + return ((size_t)-1); + } + } else { + /* + * May not be enough space; use temp. buffer. + * + * We need to save a copy of the conversion state + * here so we can restore it if the multibyte + * character is too long for the buffer. + */ + mbsbak = *ps; + if ((nb = __wcrtomb(buf, *s, ps, loc)) == (size_t)-1) { + *src = s; + return ((size_t)-1); + } + if (nb > (int)len) { + /* MB sequence for character won't fit. */ + *ps = mbsbak; + break; + } + memcpy(dst, buf, nb); + } + if (*s == L'\0') { + *src = NULL; + return (nbytes + nb - 1); + } + s++; + dst += nb; + len -= nb; + nbytes += nb; + } + *src = s; + return (nbytes); +} diff --git a/locale/FreeBSD/wcsrtombs.3 b/locale/FreeBSD/wcsrtombs.3 new file mode 100644 index 0000000..0848655 --- /dev/null +++ b/locale/FreeBSD/wcsrtombs.3 @@ -0,0 +1,175 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wcsrtombs.3,v 1.5 2004/07/21 10:54:57 tjr Exp $ +.\" +.Dd July 21, 2004 +.Dt WCSRTOMBS 3 +.Os +.Sh NAME +.Nm wcsnrtombs , +.Nm wcsnrtombs_l , +.Nm wcsrtombs , +.Nm wcsrtombs_l +.Nd "convert a wide-character string to a character string (restartable)" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft size_t +.Fo wcsnrtombs +.Fa "char *restrict dst" +.Fa "const wchar_t **restrict src" +.Fa "size_t nwc" +.Fa "size_t len" +.Fa "mbstate_t *restrict ps" +.Fc +.Ft size_t +.Fo wcsrtombs +.Fa "char *restrict dst" +.Fa "const wchar_t **restrict src" +.Fa "size_t len" +.Fa "mbstate_t *restrict ps" +.Fc +.In wchar.h +.In xlocale.h +.Ft size_t +.Fo wcsnrtombs_l +.Fa "char *restrict dst" +.Fa "const wchar_t **restrict src" +.Fa "size_t nwc" +.Fa "size_t len" +.Fa "mbstate_t *restrict ps" +.Fa "locale_t loc" +.Fc +.Ft size_t +.Fo wcsrtombs_l +.Fa "char *restrict dst" +.Fa "const wchar_t **restrict src" +.Fa "size_t len" +.Fa "mbstate_t *restrict ps" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcsrtombs +function converts a string of wide characters, +indirectly pointed to by +.Fa src , +to a corresponding multi-byte character string, +stored in the array pointed to by +.Fa dst . +No more than +.Fa len +bytes are written to +.Fa dst . +.Pp +If +.Fa dst +is +.Dv NULL , +no characters are stored. +.Pp +If +.Fa dst +is not +.Dv NULL , +the pointer pointed to by +.Fa src +is updated to point to the character after the one that conversion stopped at. +If conversion stops because a null character is encountered, +.Fa *src +is set to +.Dv NULL . +.Pp +The +.Vt mbstate_t +argument, +.Fa ps , +is used to keep track of the shift state. +If it is +.Dv NULL , +.Fn wcsrtombs +uses an internal, static +.Vt mbstate_t +object, which is initialized to the initial conversion state +at program startup. +.Pp +The +.Fn wcsnrtombs +function behaves identically to +.Fn wcsrtombs , +except that conversion stops after reading at most +.Fa nwc +characters from the buffer pointed to by +.Fa src . +.Pp +Although the +.Fn wcsrtombs +and +.Fn wcsnrtombs +functions use the current locale, the +.Fn wcsrtombs_l +and +.Fn wcsnrtombs_l +functions may be passed locales directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If successful, the +.Fn wcsrtombs +and +.Fn wcsnrtombs +functions return the number of bytes stored in +the array pointed to by +.Fa dst +(not including any terminating null); +otherwise, they return +.Po Vt size_t Pc Ns \-1 . +.Sh ERRORS +The +.Fn wcsrtombs +and +.Fn wcsnrtombs +functions will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid wide character was encountered. +.It Bq Er EINVAL +The conversion state is invalid. +.El +.Sh SEE ALSO +.Xr mbsrtowcs 3 , +.Xr wcrtomb 3 , +.Xr wcstombs 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn wcsrtombs +function conforms to +.St -isoC-99 . +.Pp +The +.Fn wcsnrtombs +function is an extension to the standard. diff --git a/locale/FreeBSD/wcsrtombs.c b/locale/FreeBSD/wcsrtombs.c new file mode 100644 index 0000000..483b862 --- /dev/null +++ b/locale/FreeBSD/wcsrtombs.c @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcsrtombs.c,v 1.6 2004/07/21 10:54:57 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "mblocal.h" + +size_t +wcsrtombs_l(char * __restrict dst, const wchar_t ** __restrict src, size_t len, + mbstate_t * __restrict ps, locale_t loc) +{ + NORMALIZE_LOCALE(loc); + if (ps == NULL) + ps = &loc->__mbs_wcsrtombs; + return (loc->__lc_ctype->__wcsnrtombs(dst, src, SIZE_T_MAX, len, ps, loc)); +} + +size_t +wcsrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t len, + mbstate_t * __restrict ps) +{ + return wcsrtombs_l(dst, src, len, ps, __current_locale()); +} diff --git a/locale/FreeBSD/wcstod.3 b/locale/FreeBSD/wcstod.3 new file mode 100644 index 0000000..9595d07 --- /dev/null +++ b/locale/FreeBSD/wcstod.3 @@ -0,0 +1,90 @@ +.\" Copyright (c) 2002, 2003 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wcstod.3,v 1.4 2003/05/22 13:02:27 ru Exp $ +.\" +.Dd February 22, 2003 +.Dt WCSTOD 3 +.Os +.Sh NAME +.Nm wcstod , +.Nm wcstof , +.Nm wcstold +.Nd convert string to +.Vt float , +.Vt double , +or +.Vt "long double" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft double +.Fo wcstod +.Fa "const wchar_t *restrict nptr" +.Fa "wchar_t **restrict endptr" +.Fc +.Ft float +.Fo wcstof +.Fa "const wchar_t *restrict nptr" +.Fa "wchar_t **restrict endptr" +.Fc +.Ft "long double" +.Fo wcstold +.Fa "const wchar_t *restrict nptr" +.Fa "wchar_t **restrict endptr" +.Fc +.Sh DESCRIPTION +The +.Fn wcstof , +.Fn wcstod , +and +.Fn wcstold +functions are the wide-character versions of the +.Fn strtof , +.Fn strtod , +and +.Fn strtold +functions. +Refer to +.Xr strtod 3 +for details. +.Pp +Extended locale versions of these functions are documented in +.Xr wcstod_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh SEE ALSO +.Xr strtod 3 , +.Xr wcstod_l 3 , +.Xr wcstol 3 +.Sh STANDARDS +The +.Fn wcstof , +.Fn wcstod +and +.Fn wcstold +functions conform to +.St -isoC-99 . diff --git a/locale/FreeBSD/wcstod.c b/locale/FreeBSD/wcstod.c new file mode 100644 index 0000000..0089af0 --- /dev/null +++ b/locale/FreeBSD/wcstod.c @@ -0,0 +1,126 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstod.c,v 1.4 2004/04/07 09:47:56 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include <_simple.h> + +/* + * __wcs_end_offset calculates the offset to the end within the wide character + * string, assuming numbers and letters are single bytes in multibyte + * representation, get the actual decimal string for localeconv_l. If the + * decimal point was within the string, compensate for the fact that the + * (possible more than one byte) decimal point one takes one wide character. + */ +__private_extern__ size_t +__wcs_end_offset(const char * __restrict buf, const char * __restrict end, locale_t loc) +{ + const char *decimalpoint = localeconv_l(loc)->decimal_point; + size_t n = end - buf; + char *p; + + if ((p = strnstr(buf, decimalpoint, n)) != NULL) + n -= strlen(decimalpoint) - 1; + return n; +} + +/* + * Convert a string to a double-precision number. + * + * This is the wide-character counterpart of strtod(). So that we do not + * have to duplicate the code of strtod() here, we convert the supplied + * wide character string to multibyte and call strtod() on the result. + * This assumes that the multibyte encoding is compatible with ASCII + * for at least the digits and letters. The radix character can be more + * than one byte. + */ + +double +wcstod_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs; + double val; + char *buf, *end; + size_t len; + locale_t ctype; + _SIMPLE_STRING b; + char mb[MB_CUR_MAX + 1]; + const wchar_t *nptr0 = nptr; + const wchar_t *first; + + NORMALIZE_LOCALE(loc); + ctype = __numeric_ctype(loc); + + while (iswspace_l(*nptr, ctype)) + nptr++; + + if ((b = _simple_salloc()) == NULL) + return (0.0); + + first = nptr; + mbs = initial; + while (*nptr && (len = wcrtomb_l(mb, *nptr, &mbs, ctype)) != (size_t)-1) { + mb[len] = 0; + if (_simple_sappend(b, mb) < 0) { /* no memory */ + _simple_sfree(b); + return (0.0); + } + nptr++; + } + + /* Let strtod() do most of the work for us. */ + buf = _simple_string(b); + val = strtod_l(buf, &end, loc); + + /* + * We only know where the number ended in the _multibyte_ + * representation of the string. If the caller wants to know + * where it ended, count multibyte characters to find the + * corresponding position in the wide char string. + */ + if (endptr != NULL) + /* XXX Assume each wide char is one byte. */ + *endptr = (end == buf) ? (wchar_t *)nptr0 : ((wchar_t *)first + __wcs_end_offset(buf, end, loc)); + + _simple_sfree(b); + + return (val); +} + +double +wcstod(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr) +{ + return wcstod_l(nptr, endptr, __current_locale()); +} diff --git a/locale/FreeBSD/wcstof.c b/locale/FreeBSD/wcstof.c new file mode 100644 index 0000000..f2a6373 --- /dev/null +++ b/locale/FreeBSD/wcstof.c @@ -0,0 +1,93 @@ +/*- + * Copyright (c) 2002, 2003 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstof.c,v 1.3 2004/04/07 09:47:56 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include <_simple.h> + +/* + * See wcstod() for comments as to the logic used. + */ + +extern size_t __wcs_end_offset(const char * __restrict buf, const char * __restrict end, locale_t loc); + +float +wcstof_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs; + float val; + char *buf, *end; + size_t len; + locale_t ctype; + _SIMPLE_STRING b; + char mb[MB_CUR_MAX + 1]; + const wchar_t *nptr0 = nptr; + const wchar_t *first; + + NORMALIZE_LOCALE(loc); + ctype = __numeric_ctype(loc); + + while (iswspace_l(*nptr, ctype)) + nptr++; + + if ((b = _simple_salloc()) == NULL) + return (0.0); + + first = nptr; + mbs = initial; + while (*nptr && (len = wcrtomb_l(mb, *nptr, &mbs, ctype)) != (size_t)-1) { + mb[len] = 0; + if (_simple_sappend(b, mb) < 0) { /* no memory */ + _simple_sfree(b); + return (0.0); + } + nptr++; + } + + buf = _simple_string(b); + val = strtof_l(buf, &end, loc); + + if (endptr != NULL) + *endptr = (end == buf) ? (wchar_t *)nptr0 : ((wchar_t *)first + __wcs_end_offset(buf, end, loc)); + + _simple_sfree(b); + + return (val); +} + +float +wcstof(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr) +{ + return wcstof_l(nptr, endptr, __current_locale()); +} diff --git a/locale/FreeBSD/wcstoimax.c b/locale/FreeBSD/wcstoimax.c new file mode 100644 index 0000000..9c3dc3d --- /dev/null +++ b/locale/FreeBSD/wcstoimax.c @@ -0,0 +1,134 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "from @(#)strtol.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +__FBSDID("FreeBSD: src/lib/libc/stdlib/strtoimax.c,v 1.8 2002/09/06 11:23:59 tjr Exp "); +#endif +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstoimax.c,v 1.3 2007/01/09 00:28:01 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include + +/* + * Convert a wide character string to an intmax_t integer. + */ +intmax_t +wcstoimax_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + int base, locale_t loc) +{ + const wchar_t *s; + uintmax_t acc; + wchar_t c; + uintmax_t cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * See strtoimax for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (iswspace_l(c, loc)); + if (c == L'-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == L'+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == L'0' && (*s == L'x' || *s == L'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = neg ? (uintmax_t)-(INTMAX_MIN + INTMAX_MAX) + INTMAX_MAX + : INTMAX_MAX; + cutlim = cutoff % base; + cutoff /= base; + for ( ; ; c = *s++) { +#ifdef notyet + if (iswdigit_l(c, loc)) + c = digittoint_l(c, loc); + else +#endif + if (c >= L'0' && c <= L'9') + c -= L'0'; + else if (c >= L'A' && c <= L'Z') + c -= L'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? INTMAX_MIN : INTMAX_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (wchar_t *)(any ? s - 1 : nptr); + return (acc); +} + +intmax_t +wcstoimax(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + int base) +{ + return wcstoimax_l(nptr, endptr, base, __current_locale()); +} diff --git a/locale/FreeBSD/wcstol.3 b/locale/FreeBSD/wcstol.3 new file mode 100644 index 0000000..89936c9 --- /dev/null +++ b/locale/FreeBSD/wcstol.3 @@ -0,0 +1,141 @@ +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wcstol.3,v 1.4 2002/11/29 17:35:09 ru Exp $ +.\" +.Dd September 7, 2002 +.Dt WCSTOL 3 +.Os +.Sh NAME +.Nm wcstoimax , +.Nm wcstol , +.Nm wcstoll , +.Nm wcstoul , +.Nm wcstoull , +.Nm wcstoumax +.Nd "convert a wide character string value to a" +.Vt intmax_t , +.Vt long , +.Vt "long long" , +.Vt "unsigned long" , +.Vt "unsigned long long" , +or +.Vt uintmax_t +integer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft long +.Fo wcstol +.Fa "const wchar_t *restrict nptr" +.Fa "wchar_t **restrict endptr" +.Fa "int base" +.Fc +.Ft "long long" +.Fo wcstoll +.Fa "const wchar_t *restrict nptr" +.Fa "wchar_t **restrict endptr" +.Fa "int base" +.Fc +.Ft "unsigned long" +.Fo wcstoul +.Fa "const wchar_t *restrict nptr" +.Fa "wchar_t **restrict endptr" +.Fa "int base" +.Fc +.Ft "unsigned long long" +.Fo wcstoull +.Fa "const wchar_t *restrict nptr" +.Fa "wchar_t **restrict endptr" +.Fa "int base" +.Fc +.In stddef.h +.In inttypes.h +.Ft intmax_t +.Fo wcstoimax +.Fa "const wchar_t *restrict nptr" +.Fa "wchar_t **restrict endptr" +.Fa "int base" +.Fc +.Ft uintmax_t +.Fo wcstoumax +.Fa "const wchar_t *restrict nptr" +.Fa "wchar_t **restrict endptr" +.Fa "int base" +.Fc +.Sh DESCRIPTION +The +.Fn wcstol , +.Fn wcstoul , +.Fn wcstoll , +.Fn wcstoull , +.Fn wcstoimax , +and +.Fn wcstoumax +functions are wide-character versions of the +.Fn strtol , +.Fn strtoul , +.Fn strtoll , +.Fn strtoull , +.Fn strtoimax , +and +.Fn strtoumax +functions, respectively. +Refer to their manual pages (for example +.Xr strtol 3 ) +for details. +.Pp +Extended locale versions of these functions are documented in +.Xr wcstol_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In stddef.h +is necessary for the +.Fn wcstoimax +and +.Fn wcstoumax +functions. +.Sh SEE ALSO +.Xr strtol 3 , +.Xr strtoul 3 , +.Xr wcstol_l 3 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn wcstol , +.Fn wcstoul , +.Fn wcstoll , +.Fn wcstoull , +.Fn wcstoimax , +and +.Fn wcstoumax +functions conform to +.St -isoC-99 . diff --git a/locale/FreeBSD/wcstol.c b/locale/FreeBSD/wcstol.c new file mode 100644 index 0000000..2509e55 --- /dev/null +++ b/locale/FreeBSD/wcstol.c @@ -0,0 +1,127 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstol.c,v 1.2 2007/01/09 00:28:01 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include + +/* + * Convert a string to a long integer. + */ +long +wcstol_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + int base, locale_t loc) +{ + const wchar_t *s; + unsigned long acc; + wchar_t c; + unsigned long cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * See strtol for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (iswspace_l(c, loc)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == L'+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == L'0' && (*s == L'x' || *s == L'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = neg ? (unsigned long)-(LONG_MIN + LONG_MAX) + LONG_MAX + : LONG_MAX; + cutlim = cutoff % base; + cutoff /= base; + for ( ; ; c = *s++) { +#ifdef notyet + if (iswdigit_l(c, loc)) + c = digittoint_l(c, loc); + else +#endif + if (c >= L'0' && c <= L'9') + c -= L'0'; + else if (c >= L'A' && c <= L'Z') + c -= L'A' - 10; + else if (c >= L'a' && c <= L'z') + c -= L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? LONG_MIN : LONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (wchar_t *)(any ? s - 1 : nptr); + return (acc); +} + +long +wcstol(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base) +{ + return wcstol_l(nptr, endptr, base, __current_locale()); +} diff --git a/locale/FreeBSD/wcstold.c b/locale/FreeBSD/wcstold.c new file mode 100644 index 0000000..45222d8 --- /dev/null +++ b/locale/FreeBSD/wcstold.c @@ -0,0 +1,93 @@ +/*- + * Copyright (c) 2002, 2003 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstold.c,v 1.4 2004/04/07 09:47:56 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include <_simple.h> + +/* + * See wcstod() for comments as to the logic used. + */ + +extern size_t __wcs_end_offset(const char * __restrict buf, const char * __restrict end, locale_t loc); + +long double +wcstold_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs; + long double val; + char *buf, *end; + size_t len; + locale_t ctype; + _SIMPLE_STRING b; + char mb[MB_CUR_MAX + 1]; + const wchar_t *nptr0 = nptr; + const wchar_t *first; + + NORMALIZE_LOCALE(loc); + ctype = __numeric_ctype(loc); + + while (iswspace_l(*nptr, ctype)) + nptr++; + + if ((b = _simple_salloc()) == NULL) + return (0.0); + + first = nptr; + mbs = initial; + while (*nptr && (len = wcrtomb_l(mb, *nptr, &mbs, ctype)) != (size_t)-1) { + mb[len] = 0; + if (_simple_sappend(b, mb) < 0) { /* no memory */ + _simple_sfree(b); + return (0.0); + } + nptr++; + } + + buf = _simple_string(b); + val = strtold_l(buf, &end, loc); + + if (endptr != NULL) + *endptr = (end == buf) ? (wchar_t *)nptr0 : ((wchar_t *)first + __wcs_end_offset(buf, end, loc)); + + _simple_sfree(b); + + return (val); +} + +long double +wcstold(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr) +{ + return wcstold_l(nptr, endptr, __current_locale()); +} diff --git a/locale/FreeBSD/wcstoll.c b/locale/FreeBSD/wcstoll.c new file mode 100644 index 0000000..af50ca8 --- /dev/null +++ b/locale/FreeBSD/wcstoll.c @@ -0,0 +1,133 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtoq.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +__FBSDID("FreeBSD: src/lib/libc/stdlib/strtoll.c,v 1.19 2002/09/06 11:23:59 tjr Exp "); +#endif +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstoll.c,v 1.2 2007/01/09 00:28:01 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include + +/* + * Convert a wide character string to a long long integer. + */ +long long +wcstoll_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + int base, locale_t loc) +{ + const wchar_t *s; + unsigned long long acc; + wchar_t c; + unsigned long long cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * See strtoll for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (iswspace_l(c, loc)); + if (c == L'-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == L'+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == L'0' && (*s == L'x' || *s == L'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = neg ? (unsigned long long)-(LLONG_MIN + LLONG_MAX) + LLONG_MAX + : LLONG_MAX; + cutlim = cutoff % base; + cutoff /= base; + for ( ; ; c = *s++) { +#ifdef notyet + if (iswdigit_l(c, loc)) + c = digittoint_l(c, loc); + else +#endif + if (c >= L'0' && c <= L'9') + c -= L'0'; + else if (c >= L'A' && c <= L'Z') + c -= L'A' - 10; + else if (c >= L'a' && c <= L'z') + c -= L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? LLONG_MIN : LLONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (wchar_t *)(any ? s - 1 : nptr); + return (acc); +} + +long long +wcstoll(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base) +{ + return wcstoll_l(nptr, endptr, base, __current_locale()); +} diff --git a/locale/FreeBSD/wcstombs.3 b/locale/FreeBSD/wcstombs.3 new file mode 100644 index 0000000..24c4b61 --- /dev/null +++ b/locale/FreeBSD/wcstombs.3 @@ -0,0 +1,111 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Donn Seeley of BSDI. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From @(#)multibyte.3 8.1 (Berkeley) 6/4/93 +.\" From FreeBSD: src/lib/libc/locale/multibyte.3,v 1.22 2003/11/08 03:23:11 tjr Exp +.\" $FreeBSD: src/lib/libc/locale/wcstombs.3,v 1.5 2007/01/09 00:28:01 imp Exp $ +.\" +.Dd April 8, 2004 +.Dt WCSTOMBS 3 +.Os +.Sh NAME +.Nm wcstombs , +.Nm wcstombs_l +.Nd convert a wide-character string to a character string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft size_t +.Fo wcstombs +.Fa "char *restrict s" +.Fa "const wchar_t *restrict pwcs" +.Fa "size_t n" +.Fc +.In stdlib.h +.In xlocale.h +.Ft size_t +.Fo wcstombs_l +.Fa "char *restrict s" +.Fa "const wchar_t *restrict pwcs" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcstombs +function converts a wide character string +.Fa pwcs +into a multibyte character string, +.Fa s , +beginning in the initial conversion state. +Up to +.Fa n +bytes are stored in +.Fa s . +Partial multibyte characters at the end of the string are not stored. +The multibyte character string is null terminated, if there is room. +.Pp +Although the +.Fn wcstombs +function uses the current locale, the +.Fn wcstombs_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn wcstombs +function returns the number of bytes converted +(not including any terminating null), if successful; +otherwise, it returns +.Po Vt size_t Pc Ns \-1 . +.Sh ERRORS +The +.Fn wcstombs +function will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid wide character was encountered. +.It Bq Er EINVAL +The conversion state is invalid. +.El +.Sh SEE ALSO +.Xr mbstowcs 3 , +.Xr multibyte 3 , +.Xr wcsrtombs 3 , +.Xr wctomb 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn wcstombs +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/wcstombs.c b/locale/FreeBSD/wcstombs.c new file mode 100644 index 0000000..a6d9ae3 --- /dev/null +++ b/locale/FreeBSD/wcstombs.c @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstombs.c,v 1.11 2009/01/15 18:53:52 rdivacky Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include "mblocal.h" + +size_t +wcstombs_l(char * __restrict s, const wchar_t * __restrict pwcs, size_t n, + locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs; + const wchar_t *pwcsp; + + NORMALIZE_LOCALE(loc); + mbs = initial; + pwcsp = pwcs; + return (loc->__lc_ctype->__wcsnrtombs(s, &pwcsp, SIZE_T_MAX, n, &mbs, loc)); +} + +size_t +wcstombs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n) +{ + return wcstombs_l(s, pwcs, n, __current_locale()); +} diff --git a/locale/FreeBSD/wcstoul.c b/locale/FreeBSD/wcstoul.c new file mode 100644 index 0000000..1cad0f6 --- /dev/null +++ b/locale/FreeBSD/wcstoul.c @@ -0,0 +1,125 @@ +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstoul.c,v 1.2 2007/01/09 00:28:01 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include + +/* + * Convert a wide character string to an unsigned long integer. + */ +unsigned long +wcstoul_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + int base, locale_t loc) +{ + const wchar_t *s; + unsigned long acc; + wchar_t c; + unsigned long cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * See strtol for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (iswspace_l(c, loc)); + if (c == L'-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == L'+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == L'0' && (*s == L'x' || *s == L'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = ULONG_MAX / base; + cutlim = ULONG_MAX % base; + for ( ; ; c = *s++) { +#ifdef notyet + if (iswdigit_l(c, loc)) + c = digittoint_l(c, loc); + else +#endif + if (c >= L'0' && c <= L'9') + c -= L'0'; + else if (c >= L'A' && c <= L'Z') + c -= L'A' - 10; + else if (c >= L'a' && c <= L'z') + c -= L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (wchar_t *)(any ? s - 1 : nptr); + return (acc); +} + +unsigned long +wcstoul(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base) +{ + return wcstoul_l(nptr, endptr, base, __current_locale()); +} diff --git a/locale/FreeBSD/wcstoull.c b/locale/FreeBSD/wcstoull.c new file mode 100644 index 0000000..474480e --- /dev/null +++ b/locale/FreeBSD/wcstoull.c @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtouq.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +__FBSDID("FreeBSD: src/lib/libc/stdlib/strtoull.c,v 1.18 2002/09/06 11:23:59 tjr Exp "); +#endif +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstoull.c,v 1.2 2007/01/09 00:28:01 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include + +/* + * Convert a wide character string to an unsigned long long integer. + */ +unsigned long long +wcstoull_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + int base, locale_t loc) +{ + const wchar_t *s; + unsigned long long acc; + wchar_t c; + unsigned long long cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * See strtoull for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (iswspace_l(c, loc)); + if (c == L'-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == L'+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == L'0' && (*s == L'x' || *s == L'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = ULLONG_MAX / base; + cutlim = ULLONG_MAX % base; + for ( ; ; c = *s++) { +#ifdef notyet + if (iswdigit_l(c, loc)) + c = digittoint_l(c, loc); + else +#endif + if (c >= L'0' && c <= L'9') + c -= L'0'; + else if (c >= L'A' && c <= L'Z') + c -= L'A' - 10; + else if (c >= L'a' && c <= L'z') + c -= L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULLONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (wchar_t *)(any ? s - 1 : nptr); + return (acc); +} + +unsigned long long +wcstoull(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + int base) +{ + return wcstoull_l(nptr, endptr, base, __current_locale()); +} diff --git a/locale/FreeBSD/wcstoumax.c b/locale/FreeBSD/wcstoumax.c new file mode 100644 index 0000000..1b447b8 --- /dev/null +++ b/locale/FreeBSD/wcstoumax.c @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "from @(#)strtoul.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +__FBSDID("FreeBSD: src/lib/libc/stdlib/strtoumax.c,v 1.8 2002/09/06 11:23:59 tjr Exp "); +#endif +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstoumax.c,v 1.2 2007/01/09 00:28:01 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include + +/* + * Convert a wide character string to a uintmax_t integer. + */ +uintmax_t +wcstoumax_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + int base, locale_t loc) +{ + const wchar_t *s; + uintmax_t acc; + wchar_t c; + uintmax_t cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * See strtoimax for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (iswspace_l(c, loc)); + if (c == L'-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == L'+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == L'0' && (*s == L'x' || *s == L'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = UINTMAX_MAX / base; + cutlim = UINTMAX_MAX % base; + for ( ; ; c = *s++) { +#ifdef notyet + if (iswdigit_l(c, loc)) + c = digittoint_l(c, loc); + else +#endif + if (c >= L'0' && c <= L'9') + c -= L'0'; + else if (c >= L'A' && c <= L'Z') + c -= L'A' - 10; + else if (c >= L'a' && c <= L'z') + c -= L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = UINTMAX_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (wchar_t *)(any ? s - 1 : nptr); + return (acc); +} + +uintmax_t +wcstoumax(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, + int base) +{ + return wcstoumax_l(nptr, endptr, base, __current_locale()); +} diff --git a/locale/FreeBSD/wctob.c b/locale/FreeBSD/wctob.c new file mode 100644 index 0000000..130d00d --- /dev/null +++ b/locale/FreeBSD/wctob.c @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wctob.c,v 1.4 2004/05/12 14:26:54 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include "mblocal.h" + +int +wctob_l(wint_t c, locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs = initial; + char buf[MB_LEN_MAX]; + + NORMALIZE_LOCALE(loc); + if (c == WEOF || loc->__lc_ctype->__wcrtomb(buf, c, &mbs, loc) != 1) + return (EOF); + return ((unsigned char)*buf); +} + +int +wctob(wint_t c) +{ + return wctob_l(c, __current_locale()); +} diff --git a/locale/FreeBSD/wctomb.3 b/locale/FreeBSD/wctomb.3 new file mode 100644 index 0000000..33f6e37 --- /dev/null +++ b/locale/FreeBSD/wctomb.3 @@ -0,0 +1,128 @@ +.\" Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Donn Seeley of BSDI. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From @(#)multibyte.3 8.1 (Berkeley) 6/4/93 +.\" From FreeBSD: src/lib/libc/locale/multibyte.3,v 1.22 2003/11/08 03:23:11 tjr Exp +.\" $FreeBSD: src/lib/libc/locale/wctomb.3,v 1.4 2007/01/09 00:28:01 imp Exp $ +.\" +.Dd April 8, 2004 +.Dt WCTOMB 3 +.Os +.Sh NAME +.Nm wctomb , +.Nm wctomb_l +.Nd convert a wide-character code to a character +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fo wctomb +.Fa "char *s" +.Fa "wchar_t wchar" +.Fc +.In stdlib.h +.In xlocale.h +.Ft int +.Fo wctomb_l +.Fa "char *s" +.Fa "wchar_t wchar" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wctomb +function converts a wide character, +.Fa wchar , +into a multibyte character and stores the result in +.Fa s . +The object pointed to by +.Fa s +must be large enough to accommodate the multibyte character, +which may be up to +.Dv MB_LEN_MAX +bytes. +.Pp +A call with a null +.Fa s +pointer returns nonzero if the current locale requires shift states, +zero otherwise; +if shift states are required, the shift state is reset to the initial state. +.Pp +Although the +.Fn wctomb +function uses the current locale, the +.Fn wctomb_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If +.Fa s +is +.Dv NULL , +the +.Fn wctomb +function returns nonzero if shift states are supported, +zero otherwise. +If +.Fa s +is valid, +.Fn wctomb +returns +the number of bytes processed in +.Fa s , +or \-1 if no multibyte character +could be recognized or converted. +In this case, +.Fn wctomb Ns 's +internal conversion state is undefined. +.Sh ERRORS +The +.Fn wctomb +function will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid multibyte sequence was detected. +.It Bq Er EINVAL +The internal conversion state is invalid. +.El +.Sh SEE ALSO +.Xr mbtowc 3 , +.Xr wcrtomb 3 , +.Xr wcstombs 3 , +.Xr wctob 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn wctomb +function conforms to +.St -isoC-99 . diff --git a/locale/FreeBSD/wctomb.c b/locale/FreeBSD/wctomb.c new file mode 100644 index 0000000..0df7799 --- /dev/null +++ b/locale/FreeBSD/wctomb.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wctomb.c,v 1.8 2004/07/29 06:18:40 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include "mblocal.h" + +int +wctomb_l(char *s, wchar_t wchar, locale_t loc) +{ + static const mbstate_t initial; + size_t rval; + + NORMALIZE_LOCALE(loc); + if (s == NULL) { + /* No support for state dependent encodings. */ + loc->__mbs_wctomb = initial; + return (0); + } + if ((rval = loc->__lc_ctype->__wcrtomb(s, wchar, &loc->__mbs_wctomb, loc)) == (size_t)-1) + return (-1); + return ((int)rval); +} + +int +wctomb(char *s, wchar_t wchar) +{ + return wctomb_l(s, wchar, __current_locale()); +} diff --git a/locale/FreeBSD/wctrans.3 b/locale/FreeBSD/wctrans.3 new file mode 100644 index 0000000..7cb0da6 --- /dev/null +++ b/locale/FreeBSD/wctrans.3 @@ -0,0 +1,156 @@ +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wctrans.3,v 1.3 2002/11/29 17:35:09 ru Exp $ +.\" +.Dd October 3, 2002 +.Dt WCTRANS 3 +.Os +.Sh NAME +.Nm towctrans , +.Nm towctrans_l , +.Nm wctrans , +.Nm wctrans_l +.Nd "wide character mapping functions" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.Ft wint_t +.Fo towctrans +.Fa "wint_t wc" +.Fa "wctrans_t desc" +.Fc +.Ft wctrans_t +.Fo wctrans +.Fa "const char *charclass" +.Fc +.In wctype.h +.In xlocale.h +.Ft wint_t +.Fo towctrans_l +.Fa "wint_t wc" +.Fa "wctrans_t desc" +.Fa "locale_t loc" +.Fc +.Ft wctrans_t +.Fo wctrans_l +.Fa "const char *charclass" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wctrans +function returns a value of type +.Vt wctrans_t , +which represents the requested wide character mapping operation and +may be used as the second argument for calls to +.Fn towctrans . +.Pp +The following character mapping names are recognised: +.Bl -column -offset indent ".Li tolower" ".Li toupper" +.It Li "tolower toupper" +.El +.Pp +The +.Fn towctrans +function transliterates the wide character +.Fa wc , +according to the mapping described by +.Fa desc . +.Pp +While the +.Fn towctrans +and +.Fn wctrans +functions use the current locale, the +.Fn towctrans_l +and +.Fn wctrans_l +functions may be passed locales directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn towctrans +function returns the transliterated character if successful, otherwise +it returns the character unchanged and sets +.Va errno . +.Pp +The +.Fn wctrans +function returns non-zero if successful, otherwise it returns zero +and sets +.Va errno . +.Sh EXAMPLES +Reimplement +.Fn towupper +in terms of +.Fn towctrans +and +.Fn wctrans : +.Bd -literal -offset indent +wint_t +mytowupper(wint_t wc) +{ + return (towctrans(wc, wctrans("toupper"))); +} +.Ed +.Sh ERRORS +The +.Fn towctrans +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The supplied +.Fa desc +argument is invalid. +.El +.Pp +The +.Fn wctrans +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The requested mapping name is invalid. +.El +.Sh SEE ALSO +.Xr tolower 3 , +.Xr toupper 3 , +.Xr wctype 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn towctrans +and +.Fn wctrans +functions conform to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn towctrans +and +.Fn wctrans +functions first appeared in +.Fx 5.0 . diff --git a/locale/FreeBSD/wctrans.c b/locale/FreeBSD/wctrans.c new file mode 100644 index 0000000..30ca5b9 --- /dev/null +++ b/locale/FreeBSD/wctrans.c @@ -0,0 +1,100 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wctrans.c,v 1.3 2003/11/01 08:20:58 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +enum { + _WCT_ERROR = 0, + _WCT_TOLOWER = 1, + _WCT_TOUPPER = 2 +}; + +wint_t +towctrans_l(wint_t wc, wctrans_t desc, locale_t loc) +{ + + NORMALIZE_LOCALE(loc); + switch (desc) { + case _WCT_TOLOWER: + wc = towlower_l(wc, loc); + break; + case _WCT_TOUPPER: + wc = towupper_l(wc, loc); + break; + case _WCT_ERROR: + default: + errno = EINVAL; + break; + } + + return (wc); +} + +wint_t +towctrans(wint_t wc, wctrans_t desc) +{ + return towctrans_l(wc, desc, __current_locale()); +} + +wctrans_t +wctrans(const char *charclass) +{ + struct { + const char *name; + wctrans_t trans; + } ccls[] = { + { "tolower", _WCT_TOLOWER }, + { "toupper", _WCT_TOUPPER }, + { NULL, _WCT_ERROR }, /* Default */ + }; + int i; + + i = 0; + while (ccls[i].name != NULL && strcmp(ccls[i].name, charclass) != 0) + i++; + + if (ccls[i].trans == _WCT_ERROR) + errno = EINVAL; + return (ccls[i].trans); +} + +/* + * The extended locale version just calls the regular version. If there + * is ever support for arbitrary per-locale translations, this need to + * be modified. + */ +wctrans_t +wctrans_l(const char *charclass, locale_t loc) +{ + return wctrans(charclass); +} diff --git a/locale/FreeBSD/wctype.3 b/locale/FreeBSD/wctype.3 new file mode 100644 index 0000000..5175972 --- /dev/null +++ b/locale/FreeBSD/wctype.3 @@ -0,0 +1,153 @@ +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wctype.3,v 1.7 2006/10/13 16:11:12 ru Exp $ +.\" +.Dd March 27, 2004 +.Dt WCTYPE 3 +.Os +.Sh NAME +.Nm iswctype , +.Nm iswctype_l , +.Nm wctype , +.Nm wctype_l +.Nd "wide character class functions" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.Ft int +.Fo iswctype +.Fa "wint_t wc" +.Fa "wctype_t charclass" +.Fc +.Ft wctype_t +.Fo wctype +.Fa "const char *property" +.Fc +.In wctype.h +.In xlocale.h +.Ft int +.Fo iswctype_l +.Fa "wint_t wc" +.Fa "wctype_t charclass" +.Fa "locale_t loc" +.Fc +.Ft wctype_t +.Fo wctype_l +.Fa "const char *property" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wctype +function returns a value of type +.Vt wctype_t , +which represents the requested wide character class and +may be used as the second argument for calls to +.Fn iswctype . +.Pp +The following character class names are recognised: +.Bl -column -offset indent ".Li alnum" ".Li cntrl" ".Li ideogram" ".Li print" ".Li space" +.It Li "alnum cntrl ideogram print space xdigit" +.It Li "alpha digit lower punct special" +.It Li "blank graph phonogram rune upper" +.El +.Pp +The +.Fn iswctype +function checks whether the wide character +.Fa wc +is in the character class +.Fa charclass . +.Pp +Although the +.Fn iswctype +and +.Fn wctype +functions use the current locale, the +.Fn iswctype_l +and +.Fn wctype_l +functions may be passed locales directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn iswctype +function returns non-zero if and only if +.Fa wc +has the property described by +.Fa charclass , +or +.Fa charclass +is zero. +.Pp +The +.Fn wctype +function returns 0 if +.Fa property +is invalid; otherwise, it returns a value of type +.Vt wctype_t +that can be used in subsequent calls to +.Fn iswctype . +.Sh EXAMPLES +Reimplement +.Xr iswalpha 3 +in terms of +.Fn iswctype +and +.Fn wctype : +.Bd -literal -offset indent +int +myiswalpha(wint_t wc) +{ + return (iswctype(wc, wctype("alpha"))); +} +.Ed +.Sh SEE ALSO +.Xr ctype 3 , +.Xr nextwctype 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn iswctype +and +.Fn wctype +functions conform to +.St -p1003.1-2001 . +The +.Dq Li ideogram , +.Dq Li phonogram , +.Dq Li special , +and +.Dq Li rune +character classes are extensions. +.Sh HISTORY +The +.Fn iswctype +and +.Fn wctype +functions first appeared in +.Fx 5.0 . diff --git a/locale/FreeBSD/wctype.c b/locale/FreeBSD/wctype.c new file mode 100644 index 0000000..f94c133 --- /dev/null +++ b/locale/FreeBSD/wctype.c @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wctype.c,v 1.4 2008/03/17 18:22:23 antoine Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include + +wctype_t +wctype_l(const char *property, locale_t loc) +{ + _RuneLocale *rl; + static const struct { + const char *name; + wctype_t mask; + } props[] = { + { "alnum", _CTYPE_A|_CTYPE_D }, + { "alpha", _CTYPE_A }, + { "blank", _CTYPE_B }, + { "cntrl", _CTYPE_C }, + { "digit", _CTYPE_D }, + { "graph", _CTYPE_G }, + { "lower", _CTYPE_L }, + { "print", _CTYPE_R }, + { "punct", _CTYPE_P }, + { "space", _CTYPE_S }, + { "upper", _CTYPE_U }, + { "xdigit", _CTYPE_X }, + { "ideogram", _CTYPE_I }, /* BSD extension */ + { "special", _CTYPE_T }, /* BSD extension */ + { "phonogram", _CTYPE_Q }, /* BSD extension */ + { "rune", 0xFFFFFF00L }, /* BSD extension */ + { NULL, 0UL }, /* Default */ + }; + int i; + + i = 0; + while (props[i].name != NULL && strcmp(props[i].name, property) != 0) + i++; + + if (props[i].mask) + return (props[i].mask); + + NORMALIZE_LOCALE(loc); + rl = &loc->__lc_ctype->_CurrentRuneLocale; + if ((i = rl->__ncharclasses) > 0) { + _RuneCharClass *rp; + for (rp = rl->__charclasses; i-- > 0; rp++) { + if (strncmp(rp->__name, property, CHARCLASS_NAME_MAX) == 0) + return (rp->__mask); + } + } + return 0; +} + +wctype_t +wctype(const char *property) +{ + return wctype_l(property, __current_locale()); +} diff --git a/locale/FreeBSD/wcwidth.3 b/locale/FreeBSD/wcwidth.3 new file mode 100644 index 0000000..4c014ce --- /dev/null +++ b/locale/FreeBSD/wcwidth.3 @@ -0,0 +1,106 @@ +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wcwidth.3,v 1.6 2004/08/17 04:56:03 trhodes Exp $ +.\" +.Dd August 17, 2004 +.Dt WCWIDTH 3 +.Os +.Sh NAME +.Nm wcwidth , +.Nm wcwidth_l +.Nd "number of column positions of a wide-character code" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft int +.Fo wcwidth +.Fa "wchar_t wc" +.Fc +.In wchar.h +.In xlocale.h +.Ft int +.Fo wcwidth_l +.Fa "wchar_t wc" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcwidth +function determines the number of column positions required to +display the wide character +.Fa wc . +.Pp +Although the +.Fn wcwidth +function uses the current locale, the +.Fn wcwidth_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn wcwidth +function returns 0 if the +.Fa wc +argument is a null wide character (L'\e0'), +\-1 if +.Fa wc +is not printable; +otherwise, it returns the number of column positions the +character occupies. +.Sh EXAMPLES +This code fragment reads text from standard input and +breaks lines that are more than 20 column positions wide, +similar to the +.Xr fold 1 +utility: +.Bd -literal -offset indent +wint_t ch; +int column, w; + +column = 0; +while ((ch = getwchar()) != WEOF) { + w = wcwidth(ch); + if (w > 0 && column + w >= 20) { + putwchar(L'\en'); + column = 0; + } + putwchar(ch); + if (ch == L'\en') + column = 0; + else if (w > 0) + column += w; +} +.Ed +.Sh SEE ALSO +.Xr iswprint 3 , +.Xr wcswidth 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn wcwidth +function conforms to +.St -p1003.1-2001 . diff --git a/locale/FreeBSD/wcwidth.c b/locale/FreeBSD/wcwidth.c new file mode 100644 index 0000000..ae533e7 --- /dev/null +++ b/locale/FreeBSD/wcwidth.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/wcwidth.c,v 1.8 2007/01/09 00:28:01 imp Exp $"); + +#include "xlocale_private.h" + +#include + +#undef wcwidth + +int +wcwidth(wchar_t wc) +{ + + return (__wcwidth_l(wc, __current_locale())); +} + +int +wcwidth_l(wchar_t wc, locale_t loc) +{ + + NORMALIZE_LOCALE(loc); + return (__wcwidth_l(wc, loc)); +} diff --git a/locale/ctype_l.3 b/locale/ctype_l.3 new file mode 100644 index 0000000..7e380b4 --- /dev/null +++ b/locale/ctype_l.3 @@ -0,0 +1,186 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ctype.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/ctype.3,v 1.15 2004/06/30 20:09:08 ru Exp $ +.\" +.Dd March 11, 2005 +.Dt CTYPE_L 3 +.Os +.Sh NAME +.Nm digittoint_l , +.Nm isalnum_l , +.Nm isalpha_l , +.Nm isascii_l , +.Nm isblank_l , +.Nm iscntrl_l , +.Nm isdigit_l , +.Nm isgraph_l , +.Nm ishexnumber_l , +.Nm isideogram_l , +.Nm islower_l , +.Nm isnumber_l , +.Nm isphonogram_l , +.Nm isprint_l , +.Nm ispunct_l , +.Nm isrune_l , +.Nm isspace_l , +.Nm isspecial_l , +.Nm isupper_l , +.Nm isxdigit_l , +.Nm toascii_l , +.Nm tolower_l , +.Nm toupper_l +.Nd character classification macros +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In ctype.h +.In xlocale.h +.Ft int +.Fo digittoint_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isalnum_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isalpha_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isascii_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo iscntrl_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isdigit_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isgraph_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo ishexnumber_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isideogram_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo islower_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isnumber_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isphonogram_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isprint_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo ispunct_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isrune_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isspace_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isspecial_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isupper_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isxdigit_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo toascii_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo tolower_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo toupper_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +These +functions are extended locale versions of the corresponding functions in +.Xr ctype 3 . +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr ctype 3 , +.Xr xlocale 3 diff --git a/locale/duplocale.3 b/locale/duplocale.3 new file mode 100644 index 0000000..76dd757 --- /dev/null +++ b/locale/duplocale.3 @@ -0,0 +1,36 @@ +.Dd March 11, 2005 +.Dt DUPLOCALE 3 +.Os +.Sh NAME +.Nm duplocale +.Nd Duplicate existing locale +.Sh SYNOPSIS +.In xlocale.h +.Ft locale_t +.Fn duplocale "locale_t loc" +.Sh DESCRIPTION +Duplicates an existing +.Vt locale_t . +Sub-structures are shared between the two +.Vt locale_t +structures. +Passing +.Dv NULL +will duplicate the current locale. +Passing +.Dv LC_GLOBAL_LOCALE +will duplicate the global locale. +.Sh RETURN VALUES +Returns a duplicated +.Vt locale_t , +or +.Dv NULL +on error. +Duplicated locales should be freed with +.Xr freelocale 3 . +.Sh SEE ALSO +.Xr freelocale 3 , +.Xr newlocale 3 , +.Xr querylocale 3 , +.Xr uselocale 3 , +.Xr xlocale 3 diff --git a/locale/freelocale.3 b/locale/freelocale.3 new file mode 100644 index 0000000..3cfcc10 --- /dev/null +++ b/locale/freelocale.3 @@ -0,0 +1,30 @@ +.Dd March 11, 2005 +.Dt FREELOCALE 3 +.Os +.Sh NAME +.Nm freelocale +.Nd Frees an allocated locale +.Sh SYNOPSIS +.In xlocale.h +.Ft int +.Fn freelocale "locale_t loc" +.Sh DESCRIPTION +Frees the storage associated with +.Va loc . +Sub-structures have their reference counts reduced, +and are freed if the reference count becomes zero. +.Sh RETURN VALUES +Returns zero on success, -1 on error. An error will occur if +.Va loc +is not a +.Vt locale_t , +or is +.Dv NULL +or +.Dv LC_GLOBAL_LOCALE . +.Sh SEE ALSO +.Xr duplocale 3 , +.Xr newlocale 3 , +.Xr querylocale 3 , +.Xr uselocale 3 , +.Xr xlocale 3 diff --git a/locale/frune.c b/locale/frune.c new file mode 100644 index 0000000..0db4f24 --- /dev/null +++ b/locale/frune.c @@ -0,0 +1,127 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)frune.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/frune.c,v 1.3 2002/09/18 06:19:12 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "runedepreciated.h" + +long +fgetrune(fp) + FILE *fp; +{ + rune_t r; + int c, len; + char buf[MB_LEN_MAX]; + char const *result; + __darwin_rune_t invalid_rune = __current_locale()->__lc_ctype->_CurrentRuneLocale.__invalid_rune; + static int warn_depreciated = 1; + + if (warn_depreciated) { + warn_depreciated = 0; + fprintf(stderr, __rune_depreciated_msg, "fgetrune"); + } + + len = 0; + do { + if ((c = getc(fp)) == EOF) { + if (len) + break; + return (EOF); + } + buf[len++] = c; + + if ((r = __sgetrune(buf, len, &result)) != invalid_rune) + return (r); + } while (result == buf && len < MB_LEN_MAX); + + while (--len > 0) + ungetc(buf[len], fp); + return (invalid_rune); +} + +int +fungetrune(r, fp) + rune_t r; + FILE* fp; +{ + int len; + char buf[MB_LEN_MAX]; + static int warn_depreciated = 1; + + if (warn_depreciated) { + warn_depreciated = 0; + fprintf(stderr, __rune_depreciated_msg, "fungetrune"); + } + + len = __sputrune(r, buf, MB_LEN_MAX, 0); + while (len-- > 0) + if (ungetc(buf[len], fp) == EOF) + return (EOF); + return (0); +} + +int +fputrune(r, fp) + rune_t r; + FILE *fp; +{ + int i, len; + char buf[MB_LEN_MAX]; + static int warn_depreciated = 1; + + if (warn_depreciated) { + warn_depreciated = 0; + fprintf(stderr, __rune_depreciated_msg, "fputrune"); + } + + len = __sputrune(r, buf, MB_LEN_MAX, 0); + + for (i = 0; i < len; ++i) + if (putc(buf[i], fp) == EOF) + return (EOF); + + return (0); +} diff --git a/locale/isalnum_l.3 b/locale/isalnum_l.3 new file mode 100644 index 0000000..0c60adc --- /dev/null +++ b/locale/isalnum_l.3 @@ -0,0 +1,185 @@ +.\" $NetBSD: iswalnum.3,v 1.5 2002/07/10 14:46:10 yamt Exp $ +.\" +.\" Copyright (c) 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isalnum.3 5.2 (Berkeley) 6/29/91 +.\" $FreeBSD: src/lib/libc/locale/iswalnum.3,v 1.5 2002/11/29 17:35:09 ru Exp $ +.\" +.Dd March 11, 2005 +.Dt ISALNUM_L 3 +.Os +.Sh NAME +.Nm isalnum_l , +.Nm isalpha_l , +.Nm isblank_l , +.Nm iscntrl_l , +.Nm isdigit_l , +.Nm isgraph_l , +.Nm ishexnumber_l , +.Nm isideogram_l , +.Nm islower_l , +.Nm isnumber_l , +.Nm isphonogram_l , +.Nm isprint_l , +.Nm ispunct_l , +.Nm isrune_l , +.Nm isspace_l , +.Nm isspecial_l , +.Nm isupper_l , +.Nm isxdigit_l +.Nd character classification utilities +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.In xlocale.h +.\" +.Ft int +.Fo isalnum_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isalpha_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isblank_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo iscntrl_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isdigit_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isgraph_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo ishexnumber_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isideogram_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo islower_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isnumber_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isphonogram_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isprint_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo ispunct_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isrune_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isspace_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isspecial_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isupper_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo isxdigit_l +.Fa "int c" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +These +functions are extended locale versions of the corresponding functions, +with the _l removed. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr isalnum 3 , +.Xr isalpha 3 , +.Xr isblank 3 , +.Xr iscntrl 3 , +.Xr isdigit 3 , +.Xr isgraph 3 , +.Xr ishexnumber 3 , +.Xr isideogram 3 , +.Xr islower 3 , +.Xr isnumber 3 , +.Xr isphonogram 3 , +.Xr isprint 3 , +.Xr ispunct 3 , +.Xr isrune 3 , +.Xr isspace 3 , +.Xr isspecial 3 , +.Xr isupper 3 , +.Xr isxdigit 3 , +.Xr xlocale 3 diff --git a/locale/isctype.c b/locale/isctype.c new file mode 100644 index 0000000..08dbab4 --- /dev/null +++ b/locale/isctype.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Tell to generate extern versions of all the top level inline + * functions. + */ +#define _EXTERNALIZE_CTYPE_INLINES_TOP_ + +#include diff --git a/locale/iswalnum_l.3 b/locale/iswalnum_l.3 new file mode 100644 index 0000000..5c7f4f5 --- /dev/null +++ b/locale/iswalnum_l.3 @@ -0,0 +1,115 @@ +.\" $NetBSD: iswalnum.3,v 1.5 2002/07/10 14:46:10 yamt Exp $ +.\" +.\" Copyright (c) 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)isalnum.3 5.2 (Berkeley) 6/29/91 +.\" $FreeBSD: src/lib/libc/locale/iswalnum.3,v 1.5 2002/11/29 17:35:09 ru Exp $ +.\" +.Dd March 11, 2005 +.Dt ISWALNUM_L 3 +.Os +.Sh NAME +.Nm iswalnum_l , +.Nm iswalpha_l , +.Nm iswblank_l , +.Nm iswcntrl_l , +.Nm iswdigit_l , +.Nm iswgraph_l , +.Nm iswhexnumber_l , +.Nm iswideogram_l , +.Nm iswlower_l , +.Nm iswnumber_l , +.Nm iswphonogram_l , +.Nm iswprint_l , +.Nm iswpunct_l , +.Nm iswrune_l , +.Nm iswspace_l , +.Nm iswspecial_l , +.Nm iswupper_l , +.Nm iswxdigit_l +.Nd wide character classification utilities +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.In xlocale.h +.Ft int +.Fn iswalnum_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswalpha_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswascii_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswblank_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswcntrl_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswdigit_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswgraph_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswhexnumber_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswideogram_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswlower_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswnumber_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswphonogram_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswprint_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswpunct_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswrune_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswspace_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswspecial_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswupper_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswxdigit_l "wint_t wc" "locale_t loc" +.Sh DESCRIPTION +These +functions are extended locale versions of the corresponding functions in +.Xr iswalnum 3 . +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr iswalnum 3 , +.Xr xlocale 3 diff --git a/locale/iswctype.c b/locale/iswctype.c new file mode 100644 index 0000000..32b4adb --- /dev/null +++ b/locale/iswctype.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +/* + * Tell to generate extern versions of all the top level inline + * functions. + */ +#define _EXTERNALIZE_WCTYPE_INLINES_TOP_ + +#include diff --git a/locale/lconv.c b/locale/lconv.c new file mode 100644 index 0000000..66dd0af --- /dev/null +++ b/locale/lconv.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * 3333969: SPSS links directly to __lconv, which is gone in Panther. + * So we resurrect the __lconv symbol, which points to data that never + * changes (as it never did in Jaguar). This should be removed for Merlot. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)lconv.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +static char empty[] = ""; + +/* + * Default (C) locale conversion. + */ +static struct lconv C_lconv = { + ".", /* decimal_point */ + empty, /* thousands_sep */ + empty, /* grouping */ + empty, /* int_curr_symbol */ + empty, /* currency_symbol */ + empty, /* mon_decimal_point */ + empty, /* mon_thousands_sep */ + empty, /* mon_grouping */ + empty, /* positive_sign */ + empty, /* negative_sign */ + CHAR_MAX, /* int_frac_digits */ + CHAR_MAX, /* frac_digits */ + CHAR_MAX, /* p_cs_precedes */ + CHAR_MAX, /* p_sep_by_space */ + CHAR_MAX, /* n_cs_precedes */ + CHAR_MAX, /* n_sep_by_space */ + CHAR_MAX, /* p_sign_posn */ + CHAR_MAX, /* n_sign_posn */ +}; + +/* + * Current locale conversion. + */ +struct lconv *__lconv = &C_lconv; diff --git a/locale/locale/UTF-8/LC_CTYPE b/locale/locale/UTF-8/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..b17dd82283510566ab4f0b730a65ee4d41132ef2 GIT binary patch literal 81360 zcmeI52XqzH+JDu4Y8pJsEESl>D%l6WGrD>&^9af&KytLA+yac2}24q4O)Pwra z0J3X5N7j&>(ySr5kO%ot01ZnshtRLpNj2{?t0m`e$@yDy{+67-CFgI+`CD@S)ycBw zuYL|!-~3j8j`U;=)qegp4$Jm`8E@JktyCnpskCi!z1KzCRcyOD=eP2))ZfbMLSLP8 zTh+02{;Jle)-efM5}*mmfK14OdQcx4KsMw+F62Qz6hK2LghtR9nm|)n3z|W5XaOx@ zZCD4^g;r1m#ZUsRVLfOAZDDfEez-cfLPKPt# zOgIb9hC$F14uf8BI2-}JVNIR?9L{wvoCoK_1yBYT!bNZ~TmqNEWpFtRh9PhT423J< zD!3Z1fnjhhTnE>~4R9me1UJJia4Y;9{sXtc|H18W2MmW1FcL<=Xcz-`!d);H?uL8d zUKj`W!Ts<6jE4u|A$S-bfeG*^JO&ftad-lrgs0$Xcm|$@S@0=*2A{(h@FmQKuV4;* z4d1}G@Ev>)bKwX05$3^9Fdr7cLiibG!mqFheuKsEJNyAl;1ieyb#?wp>f63+qEWXb&A=1K1EYf{kGl=m?#lGi(Z7pet+!o5L2cC2R#-!#1!jYzN!J4zMGX z!cMR=>;k*OZqN<>0lULLVGr07{snu%-mnjJhkao`*dGpn1EB{T1P8+*a47VI!=M)& z4o5(5SX1XehjX0^=fU}K0hGaoa1mS#m%ycP8C(v7VF+9SL*Yue3a*B0U>IBr*TMC0 z1KbEV!Od_B+zS7O|G;hVe{eh80mESgjD%4z8pgn#a2Je)yWt+V7skPTa6dc%FaUJ=o&cJLHd3AzEQr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WDKTyDuz(K9IsHl8gr@U#VV?=;~T1PV>Q)x@jca=_<`!j z_=)Q0_=W1%_>JoK_=9R~{7JPg)>Hiz8>lwMCaS+o0x82NxL6ujP|c6m zsFuYiRPEyfs`p|6)f@2^)tj-L>Lzr;+i@w?Wzm|dO|+%DJlauR8J|;ih^wfsj%%o{ zjq9kcj~l2u#*I|oQ=Q{xs$1e#s@vjAsugiN)g5ssRhPJnYG@3jdOC(vjfjy{qvIK> zFJdg!xOkT8xfoA1Atq8yipf+{Vk*`2m_hY?yg>D0d_}b~UZR>Av#4gr9I6jv6xG6b fo$90blxj?TM)h$lqFNkFsNRY9seIEkysLi!Lm~t3 literal 0 HcmV?d00001 diff --git a/locale/locale/be_BY.ISO8859-5/LC_CTYPE b/locale/locale/be_BY.ISO8859-5/LC_CTYPE new file mode 120000 index 0000000..d7d82eb --- /dev/null +++ b/locale/locale/be_BY.ISO8859-5/LC_CTYPE @@ -0,0 +1 @@ +../ru_RU.ISO8859-5/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/be_BY.ISO8859-5/LC_MESSAGES/LC_MESSAGES b/locale/locale/be_BY.ISO8859-5/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..97f0513 --- /dev/null +++ b/locale/locale/be_BY.ISO8859-5/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[âÂyY].* +^[ݽnN].* +âÐÚ +ÝÕ diff --git a/locale/locale/be_BY.ISO8859-5/LC_MONETARY b/locale/locale/be_BY.ISO8859-5/LC_MONETARY new file mode 100644 index 0000000..7ca3d13 --- /dev/null +++ b/locale/locale/be_BY.ISO8859-5/LC_MONETARY @@ -0,0 +1,15 @@ +BYR +àãÑ. +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/be_BY.ISO8859-5/LC_NUMERIC b/locale/locale/be_BY.ISO8859-5/LC_NUMERIC new file mode 120000 index 0000000..f1562fa --- /dev/null +++ b/locale/locale/be_BY.ISO8859-5/LC_NUMERIC @@ -0,0 +1 @@ +../be_BY.CP1251/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/be_BY.ISO8859-5/LC_TIME b/locale/locale/be_BY.ISO8859-5/LC_TIME new file mode 100644 index 0000000..7e79b22 --- /dev/null +++ b/locale/locale/be_BY.ISO8859-5/LC_TIME @@ -0,0 +1,58 @@ +áâã +Ûîâ +áÐÚ +ÚàÐ +âàÐ +çíà +Ûöß +ÖÝö +ÒÕà +ÚÐá +Ûöá +áÝÕ +áâãÔ×ÕÝï +ÛîâÐÓÐ +áÐÚÐÒöÚÐ +ÚàÐáÐÒöÚÐ +âàÐþÝï +çíàÒÕÝï +ÛößÕÝï +ÖÝöþÝï +ÒÕàÐáÝï +ÚÐáâàëçÝöÚÐ +ÛöáâÐßÐÔÐ +áÝÕÖÝï +ÝÔ +ßÝ +Ðþ +áà +çæ +ßâ +áÑ +ÝïÔ×ÕÛï +ßÐÝïÔ×ÕÛÐÚ +ÐþâÞàÐÚ +áÕàÐÔÐ +çÐæÒÕà +ßïâÝöæÐ +áãÑÞâÐ +%H:%M:%S +%d.%m.%y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +áâãÔ×ÕÝì +Ûîâë +áÐÚÐÒöÚ +ÚàÐáÐÒöÚ +âàÐÒÕÝì +çíàÒÕÝì +ÛößÕÝì +ÖÝöÒÕÝì +ÒÕàÐáÕÝì +ÚÐáâàëçÝöÚ +ÛöáâÐßÐÔ +áÝÕÖÐÝì +dm +%I:%M:%S %p diff --git a/locale/locale/be_BY.UTF-8/LC_COLLATE b/locale/locale/be_BY.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/be_BY.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/be_BY.UTF-8/LC_CTYPE b/locale/locale/be_BY.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/be_BY.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/be_BY.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/be_BY.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..4b763d2 --- /dev/null +++ b/locale/locale/be_BY.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[тТyY].* +^[нÐnN].* +так +не diff --git a/locale/locale/be_BY.UTF-8/LC_MONETARY b/locale/locale/be_BY.UTF-8/LC_MONETARY new file mode 100644 index 0000000..589c6a0 --- /dev/null +++ b/locale/locale/be_BY.UTF-8/LC_MONETARY @@ -0,0 +1,15 @@ +BYR +руб. +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/be_BY.UTF-8/LC_NUMERIC b/locale/locale/be_BY.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..f1562fa --- /dev/null +++ b/locale/locale/be_BY.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../be_BY.CP1251/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/be_BY.UTF-8/LC_TIME b/locale/locale/be_BY.UTF-8/LC_TIME new file mode 100644 index 0000000..29c51af --- /dev/null +++ b/locale/locale/be_BY.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Ñту +лют +Ñак +кра +тра +чÑÑ€ +ліп +жні +вер +ÐºÐ°Ñ +Ð»Ñ–Ñ +Ñне +ÑÑ‚ÑƒÐ´Ð·ÐµÐ½Ñ +лютага +Ñакавіка +краÑавіка +Ñ‚Ñ€Ð°ÑžÐ½Ñ +чÑÑ€Ð²ÐµÐ½Ñ +Ð»Ñ–Ð¿ÐµÐ½Ñ +Ð¶Ð½Ñ–ÑžÐ½Ñ +вераÑÐ½Ñ +каÑтрычніка +ліÑтапада +ÑÐ½ÐµÐ¶Ð½Ñ +нд +пн +аў +ÑÑ€ +чц +пт +Ñб +нÑÐ´Ð·ÐµÐ»Ñ +панÑдзелак +аўторак +Ñерада +чацвер +пÑтніца +Ñубота +%H:%M:%S +%d.%m.%y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Ñтудзень +люты +Ñакавік +краÑавік +травень +чÑрвень +ліпень +жнівень +вераÑень +каÑтрычнік +ліÑтапад +Ñнежань +dm +%I:%M:%S %p diff --git a/locale/locale/be_BY/LC_COLLATE b/locale/locale/be_BY/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/be_BY/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/be_BY/LC_CTYPE b/locale/locale/be_BY/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/be_BY/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/be_BY/LC_MESSAGES/LC_MESSAGES b/locale/locale/be_BY/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..4b763d2 --- /dev/null +++ b/locale/locale/be_BY/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[тТyY].* +^[нÐnN].* +так +не diff --git a/locale/locale/be_BY/LC_MONETARY b/locale/locale/be_BY/LC_MONETARY new file mode 100644 index 0000000..589c6a0 --- /dev/null +++ b/locale/locale/be_BY/LC_MONETARY @@ -0,0 +1,15 @@ +BYR +руб. +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/be_BY/LC_NUMERIC b/locale/locale/be_BY/LC_NUMERIC new file mode 120000 index 0000000..f1562fa --- /dev/null +++ b/locale/locale/be_BY/LC_NUMERIC @@ -0,0 +1 @@ +../be_BY.CP1251/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/be_BY/LC_TIME b/locale/locale/be_BY/LC_TIME new file mode 100644 index 0000000..29c51af --- /dev/null +++ b/locale/locale/be_BY/LC_TIME @@ -0,0 +1,58 @@ +Ñту +лют +Ñак +кра +тра +чÑÑ€ +ліп +жні +вер +ÐºÐ°Ñ +Ð»Ñ–Ñ +Ñне +ÑÑ‚ÑƒÐ´Ð·ÐµÐ½Ñ +лютага +Ñакавіка +краÑавіка +Ñ‚Ñ€Ð°ÑžÐ½Ñ +чÑÑ€Ð²ÐµÐ½Ñ +Ð»Ñ–Ð¿ÐµÐ½Ñ +Ð¶Ð½Ñ–ÑžÐ½Ñ +вераÑÐ½Ñ +каÑтрычніка +ліÑтапада +ÑÐ½ÐµÐ¶Ð½Ñ +нд +пн +аў +ÑÑ€ +чц +пт +Ñб +нÑÐ´Ð·ÐµÐ»Ñ +панÑдзелак +аўторак +Ñерада +чацвер +пÑтніца +Ñубота +%H:%M:%S +%d.%m.%y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Ñтудзень +люты +Ñакавік +краÑавік +травень +чÑрвень +ліпень +жнівень +вераÑень +каÑтрычнік +ліÑтапад +Ñнежань +dm +%I:%M:%S %p diff --git a/locale/locale/bg_BG.CP1251/LC_COLLATE b/locale/locale/bg_BG.CP1251/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..316c6c064ddff93deea2b412fb4b7ac788ae77bc GIT binary patch literal 2086 zcmY+-ceoc~7>DtG6)lnxg-SLhPDPSv*eff_j;Lf*LWt5%_AWDJoobt?LA7mcN40(IKvgq#q}nNJQPqx}sdkB7sp>>ss(P^-RsGn5 zYR}kyK?x4Ce?xMOo?xDIj?xVUt9-w+K9-?|UMpBK6N2nf+$EY5UC#ar` z(Ns^x(^SvIvsBN;^HeXyi&QVg7^+$E8P%MaOZ8*?M71=&qFNSTQ+*o?sJ@8?RNuwV zR14!5s$XL{)r$Cyswf&$?H&72EsptAU&a!uA7UldqF6=sd;CH5XY5Y3I@VDA6%DD@ z#%!vSV;xnySWmTYd`i_kPNn)gKBsCH8>lwMCaN#u6smdg57qbaFV%igLRI>o0x82N zc)233q`E4urs@$rsd~jVRK4R`s_WuXzt7)jw{f8W01i2E|~i zAu*I{SPZASEk;m{jd4^j$9Sq&Vgl8~c$Mn4m_+q@yg~J5yhZhPyhHVFOs1L=?@_%U bA5eW5A5l$>X;jnWW2#SL2Gz_crp229uHXal literal 0 HcmV?d00001 diff --git a/locale/locale/bg_BG.CP1251/LC_CTYPE b/locale/locale/bg_BG.CP1251/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..6ff93908ae77ddce37256e52647ea83464d43e44 GIT binary patch literal 3235 zcmd_pcW@L{90%|v0kI2~Bc34|f*y$)K|!&_-WwKF?7bH( z*n96Cd+)vbdGU_9*&&2+81jd2<}+{i?fdO__x66n8tXHI(=`LDhExrT=6Dp@*@mJD zd*a%tY3rW(>m}t;RNU*oOO!@YqO=1=bflOBC3K=QU1pn+Xzm&%n!8a-cY4q>DsJ{% zb5kqtnMle{%1_Eq%1_Eq%1_Fln_~Il8_ayaa4lrT_RKsFzeBhd|2<|`V}DCV;k{$; z)AIepJ;QooM*cZwwHCh?&hz((KTrO=a4y^%j@wgsu6E=L865}>-H~Dvl+cOJbfGKV z&~Qkn4bk$kcC*7MOc)@@Pg6eEWwg2#nLQ8ie*`j!m6ys z>hxg^)})NSti{^&V;$CIJ=SLfHl#lrF@TLJC(THz*^>-=QNt)|*_(Z+V>I=QVPEzm z%UBv{WPc9eK$ZcJh?#T)DGkBNxc%KjWkdOG7PxzG2_?$2JlCSuhZ}^t)_?{p5 zk)QaPU-*^Z_?aR(I}ZJSCGq~h&RV|zZ*&}l+QR-1^`ZYm{WL@iy-;o%YNZ-|7he z|CW*ZcT_ai)ugkv>H1Vu@A@jX<-_z)S5=_k9}Uyv<8he)s@CB+Komxb*Hhf_M_252hccB2hliKhtoJxN6|Q1J!#aa7meOJkw#yg zM5CYj(-@$WX`G@{Y1Ha88mH@A8UrS7^zV-M(b`G z_h<}_dvza;aeA1>BYKp^cs)+zDLqZ&8BL(^tX`loNpH}YthZ@Q(R(!B*9SDF>k}HE zY9@`@s-sb_uW5XvZ)tp|?`h1_FEoDDZ#3pB|Kstm7ElzV36~9HJIW(RtD_XEe=@9jzC!ja_;Q6wm zB|DVPDl0g%qqM(j=<$5ks;smJ@1rMj(%5bG-Bsz9n;As*{VI*!X5T}V mZW+rUvahW)cAI?-n)Ca<#V+#f&3XP=>>|(7oabp^*YH0gybY=V literal 0 HcmV?d00001 diff --git a/locale/locale/ca_ES.ISO8859-1/LC_CTYPE b/locale/locale/ca_ES.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/ca_ES.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/ca_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/ca_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..96af6ad --- /dev/null +++ b/locale/locale/ca_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[sSyY].* +^[nN].* diff --git a/locale/locale/ca_ES.ISO8859-1/LC_MONETARY b/locale/locale/ca_ES.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..06a619c --- /dev/null +++ b/locale/locale/ca_ES.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +EUR +Eu +, +. +3;3 + +- +2 +2 +1 +1 +1 +1 +1 +1 diff --git a/locale/locale/ca_ES.ISO8859-1/LC_NUMERIC b/locale/locale/ca_ES.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..f1ea6a0 --- /dev/null +++ b/locale/locale/ca_ES.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +-1 diff --git a/locale/locale/ca_ES.ISO8859-1/LC_TIME b/locale/locale/ca_ES.ISO8859-1/LC_TIME new file mode 100644 index 0000000..662bf35 --- /dev/null +++ b/locale/locale/ca_ES.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +gen +feb +mar +abr +mai +jun +jul +ago +set +oct +nov +des +gener +febrer +març +abril +maig +juny +juliol +agost +setembre +octubre +novembre +desembre +dg +dl +dt +dc +dj +dv +ds +diumenge +dilluns +dimarts +dimecres +dijous +divendres +dissabte +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y +AM +PM +%A, %e de %B de %Y, %X %Z +gener +febrer +març +abril +maig +juny +juliol +agost +setembre +octubre +novembre +desembre +dm +%I:%M:%S %p diff --git a/locale/locale/ca_ES.ISO8859-15/LC_COLLATE b/locale/locale/ca_ES.ISO8859-15/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..7708d9943b68a91a39b924fd929bc4517a7e9544 GIT binary patch literal 2518 zcma*mces@U0LSrj+Q`V>w5*7WWG9u1tcBC>>Vu=UOys zs}7C2sz;-~8qmn~kv|fvsUeNkwFZqfwHA#=TARi?T9?LpTA#)S+K|RZ+L*>B+LXp- z+MLD~+LA_NwWHBq2hixOE;J6+VKfd`R~kp?NE%1!7#hdvcp4|D2aTTUMWa%u&^T46 z(dezyX`G=mY4p)qG|tvJH2UfS8Ur+l#$a7ZV~DP!alMAp7^dMgMrb6BTQr)+7~MtV zZrwv;qVA(HNe|O_M32&VOjBq)t!HRFtLJDuuNP@d)oV0n>P;H6^d61(^#P69`k2Ni z`jp0JnonbazNPV$*X&kHbX}nNUtj!*Uqt%O^gi4%@ zDR_cSosz=2oTFH)r24)7i|2acM4qc(Qs~5ajKQ5)fJMmnWHS0`0KEw5h4x~5slCJw zw3pGrxEw=pwY|z-W3Q#daHGA!-ehm4Pii#16}jKr?QM3f9cS;L-Ie`#Ou_^9e*2(( zh~{-aj;Hi5jj4FaPO~rDSL_Ts-M&g^;&sfz+x9K{j(wNT##}qcerP|Ue``Md9C@F< zunX;%_G|kU?WXL%!BYHef3m;WU+FUZiGP&ybl3;au+&ZUHTV zpf-x4DDB+c&bGGt^!cQWPi?zV+M%7wMosLL-HQ5xn)dzvYwvUJxm6X!e&6@* z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eO$=!iG;4~=W}H;tAmqwW5` z-iuilHB;`Ei;-Sp+tMEDMSCN?!QNi}j>ofjAqo!G6?oH5w3F-CiIsXNg<6HZU{my<*b3goy P-UCv zqlrrB>HFi`)nD%G`ke25p65K*InQ<9*D0x8(yUBTMsacR7C9CQ8wxr7_ruKxzAK6? zRf@(|+M32T+LlIX~6#`$VZ;{shsqmA0p=%9;eT&zws zE>UM1m+CSam#YhnD|97|uIf#rj|R{fsOxA9*3C3-(XBLw=nfip>Mk00YdDP&dXUCL zdYHx|dW^;xJxSv!Jxyc0o}=-SCeV0Uuh4i^6KPD+J2a+hI*l26pT-CJkj89%Ok=)2 zq4B8}(D+>6(fD3J(D+e{X)MvNG?r;OjTKr=V~y6)_*3g?Y*2L?dutyWHMB2{n%a*> zE$vU^03Ar2MnLRG&rzHKfrOtc#Wvzch z8?^oJ^_Yps{feHWT>lN0;3vD( Y{%n7tE3guODCet?-)`DdO#gpu1cVd}?f?J) literal 0 HcmV?d00001 diff --git a/locale/locale/de_DE.ISO8859-15/LC_CTYPE b/locale/locale/de_DE.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/de_DE.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/de_DE.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/de_DE.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..d824a07 --- /dev/null +++ b/locale/locale/de_DE.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../de_DE.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/de_DE.ISO8859-15/LC_MONETARY b/locale/locale/de_DE.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..af29175 --- /dev/null +++ b/locale/locale/de_DE.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../de_DE.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/de_DE.ISO8859-15/LC_NUMERIC b/locale/locale/de_DE.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..04e6615 --- /dev/null +++ b/locale/locale/de_DE.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../de_DE.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/de_DE.ISO8859-15/LC_TIME b/locale/locale/de_DE.ISO8859-15/LC_TIME new file mode 120000 index 0000000..74c5512 --- /dev/null +++ b/locale/locale/de_DE.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../de_DE.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/de_DE.UTF-8/LC_COLLATE b/locale/locale/de_DE.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/de_DE.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/de_DE.UTF-8/LC_CTYPE b/locale/locale/de_DE.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/de_DE.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/de_DE.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/de_DE.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..d824a07 --- /dev/null +++ b/locale/locale/de_DE.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../de_DE.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/de_DE.UTF-8/LC_MONETARY b/locale/locale/de_DE.UTF-8/LC_MONETARY new file mode 120000 index 0000000..af29175 --- /dev/null +++ b/locale/locale/de_DE.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../de_DE.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/de_DE.UTF-8/LC_NUMERIC b/locale/locale/de_DE.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..04e6615 --- /dev/null +++ b/locale/locale/de_DE.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../de_DE.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/de_DE.UTF-8/LC_TIME b/locale/locale/de_DE.UTF-8/LC_TIME new file mode 100644 index 0000000..bab6db2 --- /dev/null +++ b/locale/locale/de_DE.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Jan +Feb +Mär +Apr +Mai +Jun +Jul +Aug +Sep +Okt +Nov +Dez +Januar +Februar +März +April +Mai +Juni +Juli +August +September +Oktober +November +Dezember +So +Mo +Di +Mi +Do +Fr +Sa +Sonntag +Montag +Dienstag +Mittwoch +Donnerstag +Freitag +Samstag +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Januar +Februar +März +April +Mai +Juni +Juli +August +September +Oktober +November +Dezember +dm +%I:%M:%S %p diff --git a/locale/locale/de_DE/LC_COLLATE b/locale/locale/de_DE/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/de_DE/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/de_DE/LC_CTYPE b/locale/locale/de_DE/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/de_DE/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/de_DE/LC_MESSAGES/LC_MESSAGES b/locale/locale/de_DE/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..d824a07 --- /dev/null +++ b/locale/locale/de_DE/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../de_DE.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/de_DE/LC_MONETARY b/locale/locale/de_DE/LC_MONETARY new file mode 120000 index 0000000..af29175 --- /dev/null +++ b/locale/locale/de_DE/LC_MONETARY @@ -0,0 +1 @@ +../de_DE.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/de_DE/LC_NUMERIC b/locale/locale/de_DE/LC_NUMERIC new file mode 120000 index 0000000..04e6615 --- /dev/null +++ b/locale/locale/de_DE/LC_NUMERIC @@ -0,0 +1 @@ +../de_DE.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/de_DE/LC_TIME b/locale/locale/de_DE/LC_TIME new file mode 100644 index 0000000..bab6db2 --- /dev/null +++ b/locale/locale/de_DE/LC_TIME @@ -0,0 +1,58 @@ +Jan +Feb +Mär +Apr +Mai +Jun +Jul +Aug +Sep +Okt +Nov +Dez +Januar +Februar +März +April +Mai +Juni +Juli +August +September +Oktober +November +Dezember +So +Mo +Di +Mi +Do +Fr +Sa +Sonntag +Montag +Dienstag +Mittwoch +Donnerstag +Freitag +Samstag +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Januar +Februar +März +April +Mai +Juni +Juli +August +September +Oktober +November +Dezember +dm +%I:%M:%S %p diff --git a/locale/locale/el_GR.ISO8859-7/LC_COLLATE b/locale/locale/el_GR.ISO8859-7/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..ba16075d0b247843514317a53443d46c842bf402 GIT binary patch literal 2086 zcmY+=WsnwB7>42fmhMJGKssf0K~S2NknUJq7Ni@cQ%aCVr470prIhaOZlt>#WS9G4 zo%C{r`Eh36(2&ru_(3{>Kp>bI9334M_3q;R!CR2Tu$WY0S!^nCEH0IJrcWe+ zC8Uzb5>rWHNvR~Wkc`s8qHpRH|AvD%GtfmD*N^N?i-5@{L7MiL{1PzO_bF8e0=8O|2P~=GKBrOKU}? zwY8(t-oB&qy>+0{(K=D-Y+a~ywQf|pTMsHdtrwNv_5+nZ)|W~@>rZ8X{YYh?4Wjas z4W=^B=2KZ<f3B~+H$UsV3KWmJ~i3MwmY6_tPNUn;9@4VAUFj>>x5KxLzCqO#ex zP}yqRsBE_#RCd}fD);OGl}GlN$}`JMC5vUHlFhPH$zeIE&R$Pwg`* zp_Y$Ie*2tC0V_!53;U8vAuCL!h!v$$%!*SfVI`@A*;iCv*h?xE>=l*Q_K->&TS%p? z{ZFN=-KSE^-cX6Mr&MZK1g(!qG{9nurZU8yP#I~zP#J4qQ~ATfX+2E0IaH3>P%6W0 zIF%7LiptOSE0xhUj>>qOKxLx+M&)<=lgcEUOc5XwG{vS;nPD@j%(B^3=Gqu4(`+}D z19q6o3A;*VkL{(h&-PO}XosjAv7=N@+9@ih?F^N(c8QrZc@2r Xx2fE<<5aHMc`DcK4n=?^2Lf*aS6~C~ literal 0 HcmV?d00001 diff --git a/locale/locale/el_GR.ISO8859-7/LC_CTYPE b/locale/locale/el_GR.ISO8859-7/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..f8d6d38fe915ad325311862e0224b47021885eab GIT binary patch literal 3227 zcmc)K1#nbH90%YdqcXxNEw58PD-QC^Y z;JayWCc_LeC8ay_&F;J1d%xZL-+Nt#rG`7E^l#ItbEkHJ({3?Voj9^CYKrkZ@@#G~R`2(>T_LY@RaL!;z zen@^uen@^uen@^uepWgzKU#zTvp>`NpYXpEsaxc{nd=w5j`oqc$nTqZ&3`@4%6gvZ zy>dq1650NF31rvD5+sfsL>A>DH+k^D1@e-Q{1l)dg(yrBic*Z?l)y#sX|p0D^Q&p)T9=*Nu&;SsYiVp(2zznrU^+jr5Vj>K}%ZEnq*SwLtpw4 z<{J7lfNQyqfn3iZQW?w;ZXk`Jq%({gxrv(@&MkDKJ3Z)0FM4yf@<+%T$tXrMhOvxe zJQJA6BqlS3sdy*?)0oZ-W-^P}%waC`n9l+hvWUejVJXX4&I(qtiq))PE$dj%1~#&Z z&1_*S+t|(ycCw4z>|rna*v|nD@&<=^lec)A!~DS!{^T$2;a%S2eLmnrKH_6O;Zr{2 zbH3n9zT#`X;ak4rdw$?Ye&T0-;a7g+cOv`Byr*|upUwQp`J-n)Y8+|Vh#@<%1c@UD zImtzC@(@p6@{ykc6r>P^DMC?-QJfNlC`l4PJ{`D#3%Q7nbfPmCa|vDO z%B5V!{F8p$X|GlsE@V>}a>$Rs8+g{fpPjp@u_CbO8$ z9Og2Q`7B@|i&)GOma>fHtY9UpSj`&NvX1p^U?ZE@%oet?jqU7UC%f3q9`>@2{T$#R zw{nQvxScyV%$*$JF7DZ_(6w_?QlqA|n4OIM3n!+g4@*hxpVlgH47o&1)c^nh literal 0 HcmV?d00001 diff --git a/locale/locale/el_GR.ISO8859-7/LC_MESSAGES/LC_MESSAGES b/locale/locale/el_GR.ISO8859-7/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..ab5a286 --- /dev/null +++ b/locale/locale/el_GR.ISO8859-7/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[íÍyY].* +^[ïÏnN].* +ÍÁÉ +Ï×É diff --git a/locale/locale/el_GR.ISO8859-7/LC_MONETARY b/locale/locale/el_GR.ISO8859-7/LC_MONETARY new file mode 100644 index 0000000..eede5d1 --- /dev/null +++ b/locale/locale/el_GR.ISO8859-7/LC_MONETARY @@ -0,0 +1,15 @@ +EUR +Eu +, +. +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/el_GR.ISO8859-7/LC_NUMERIC b/locale/locale/el_GR.ISO8859-7/LC_NUMERIC new file mode 100644 index 0000000..b93b567 --- /dev/null +++ b/locale/locale/el_GR.ISO8859-7/LC_NUMERIC @@ -0,0 +1,3 @@ +, +. +3;3 diff --git a/locale/locale/el_GR.ISO8859-7/LC_TIME b/locale/locale/el_GR.ISO8859-7/LC_TIME new file mode 100644 index 0000000..3bd95a3 --- /dev/null +++ b/locale/locale/el_GR.ISO8859-7/LC_TIME @@ -0,0 +1,58 @@ +Éáí +Öåâ +Ìáñ +Áðñ +Ìáú +Éïí +Éïë +Áõã +Óåð +Ïêô +Íïå +Äåê +Éáíïõáñßïõ +Öåâñïõáñßïõ +Ìáñôßïõ +Áðñéëßïõ +ÌáÀïõ +Éïõíßïõ +Éïõëßïõ +Áõãïýóôïõ +Óåðôåìâñßïõ +Ïêôùâñßïõ +Íïåìâñßïõ +Äåêåìâñßïõ +Êõñ +Äåõ +Ôñé +Ôåô +Ðåì +Ðáñ +Óáâ +ÊõñéáêÞ +ÄåõôÝñá +Ôñßôç +ÔåôÜñôç +ÐÝìðôç +ÐáñáóêåõÞ +ÓÜââáôï +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y +ðì +ìì +%a %e %b %Y %X %Z +ÉáíïõÜñéïò +ÖåâñïõÜñéïò +ÌÜñôéïò +Áðñßëéïò +ÌÜúïò +Éïýíéïò +Éïýëéïò +Áýãïõóôïò +ÓåðôÝìâñéïò +Ïêôþâñéïò +ÍïÝìâñéïò +ÄåêÝìâñéïò +dm +%I:%M:%S %p diff --git a/locale/locale/el_GR.UTF-8/LC_COLLATE b/locale/locale/el_GR.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/el_GR.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/el_GR.UTF-8/LC_CTYPE b/locale/locale/el_GR.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/el_GR.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/el_GR.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/el_GR.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..1780ce4 --- /dev/null +++ b/locale/locale/el_GR.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[νÎyY].* +^[οΟnN].* +ÎΑΙ +ΟΧΙ diff --git a/locale/locale/el_GR.UTF-8/LC_MONETARY b/locale/locale/el_GR.UTF-8/LC_MONETARY new file mode 120000 index 0000000..949dbdd --- /dev/null +++ b/locale/locale/el_GR.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../el_GR.ISO8859-7/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/el_GR.UTF-8/LC_NUMERIC b/locale/locale/el_GR.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..c741e0d --- /dev/null +++ b/locale/locale/el_GR.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../el_GR.ISO8859-7/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/el_GR.UTF-8/LC_TIME b/locale/locale/el_GR.UTF-8/LC_TIME new file mode 100644 index 0000000..2d2beba --- /dev/null +++ b/locale/locale/el_GR.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Ιαν +Φεβ +ÎœÎ±Ï +Î‘Ï€Ï +Μαϊ +Ιον +Ιολ +Αυγ +Σεπ +Οκτ +Îοε +Δεκ +ΙανουαÏίου +ΦεβÏουαÏίου +ΜαÏτίου +ΑπÏιλίου +ΜαÎου +Ιουνίου +Ιουλίου +ΑυγοÏστου +ΣεπτεμβÏίου +ΟκτωβÏίου +ÎοεμβÏίου +ΔεκεμβÏίου +ÎšÏ…Ï +Δευ +ΤÏι +Τετ +Πεμ +Î Î±Ï +Σαβ +ΚυÏιακή +ΔευτέÏα +ΤÏίτη +ΤετάÏτη +Πέμπτη +ΠαÏασκευή +Σάββατο +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y +πμ +μμ +%a %e %b %Y %X %Z +ΙανουάÏιος +ΦεβÏουάÏιος +ΜάÏτιος +ΑπÏίλιος +Μάϊος +ΙοÏνιος +ΙοÏλιος +ΑÏγουστος +ΣεπτέμβÏιος +ΟκτώβÏιος +ÎοέμβÏιος +ΔεκέμβÏιος +dm +%I:%M:%S %p diff --git a/locale/locale/el_GR/LC_COLLATE b/locale/locale/el_GR/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/el_GR/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/el_GR/LC_CTYPE b/locale/locale/el_GR/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/el_GR/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/el_GR/LC_MESSAGES/LC_MESSAGES b/locale/locale/el_GR/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..1780ce4 --- /dev/null +++ b/locale/locale/el_GR/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[νÎyY].* +^[οΟnN].* +ÎΑΙ +ΟΧΙ diff --git a/locale/locale/el_GR/LC_MONETARY b/locale/locale/el_GR/LC_MONETARY new file mode 120000 index 0000000..949dbdd --- /dev/null +++ b/locale/locale/el_GR/LC_MONETARY @@ -0,0 +1 @@ +../el_GR.ISO8859-7/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/el_GR/LC_NUMERIC b/locale/locale/el_GR/LC_NUMERIC new file mode 120000 index 0000000..c741e0d --- /dev/null +++ b/locale/locale/el_GR/LC_NUMERIC @@ -0,0 +1 @@ +../el_GR.ISO8859-7/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/el_GR/LC_TIME b/locale/locale/el_GR/LC_TIME new file mode 100644 index 0000000..2d2beba --- /dev/null +++ b/locale/locale/el_GR/LC_TIME @@ -0,0 +1,58 @@ +Ιαν +Φεβ +ÎœÎ±Ï +Î‘Ï€Ï +Μαϊ +Ιον +Ιολ +Αυγ +Σεπ +Οκτ +Îοε +Δεκ +ΙανουαÏίου +ΦεβÏουαÏίου +ΜαÏτίου +ΑπÏιλίου +ΜαÎου +Ιουνίου +Ιουλίου +ΑυγοÏστου +ΣεπτεμβÏίου +ΟκτωβÏίου +ÎοεμβÏίου +ΔεκεμβÏίου +ÎšÏ…Ï +Δευ +ΤÏι +Τετ +Πεμ +Î Î±Ï +Σαβ +ΚυÏιακή +ΔευτέÏα +ΤÏίτη +ΤετάÏτη +Πέμπτη +ΠαÏασκευή +Σάββατο +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y +πμ +μμ +%a %e %b %Y %X %Z +ΙανουάÏιος +ΦεβÏουάÏιος +ΜάÏτιος +ΑπÏίλιος +Μάϊος +ΙοÏνιος +ΙοÏλιος +ΑÏγουστος +ΣεπτέμβÏιος +ΟκτώβÏιος +ÎοέμβÏιος +ΔεκέμβÏιος +dm +%I:%M:%S %p diff --git a/locale/locale/en_AU.ISO8859-1/LC_COLLATE b/locale/locale/en_AU.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/en_AU.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-1/LC_CTYPE b/locale/locale/en_AU.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/en_AU.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_AU.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_AU.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-1/LC_MONETARY b/locale/locale/en_AU.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..0ac3991 --- /dev/null +++ b/locale/locale/en_AU.ISO8859-1/LC_MONETARY @@ -0,0 +1,21 @@ +AUD +$ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +1 +1 +1 +0 +0 +1 +1 diff --git a/locale/locale/en_AU.ISO8859-1/LC_NUMERIC b/locale/locale/en_AU.ISO8859-1/LC_NUMERIC new file mode 120000 index 0000000..7dfc804 --- /dev/null +++ b/locale/locale/en_AU.ISO8859-1/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-1/LC_TIME b/locale/locale/en_AU.ISO8859-1/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_AU.ISO8859-1/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-15/LC_COLLATE b/locale/locale/en_AU.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/en_AU.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-15/LC_CTYPE b/locale/locale/en_AU.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/en_AU.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_AU.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_AU.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-15/LC_MONETARY b/locale/locale/en_AU.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..ccd821d --- /dev/null +++ b/locale/locale/en_AU.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../en_AU.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-15/LC_NUMERIC b/locale/locale/en_AU.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..7dfc804 --- /dev/null +++ b/locale/locale/en_AU.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_AU.ISO8859-15/LC_TIME b/locale/locale/en_AU.ISO8859-15/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_AU.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_AU.US-ASCII/LC_COLLATE b/locale/locale/en_AU.US-ASCII/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_AU.US-ASCII/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_AU.US-ASCII/LC_CTYPE b/locale/locale/en_AU.US-ASCII/LC_CTYPE new file mode 120000 index 0000000..6f51d8f --- /dev/null +++ b/locale/locale/en_AU.US-ASCII/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_AU.US-ASCII/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_AU.US-ASCII/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_AU.US-ASCII/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_AU.US-ASCII/LC_MONETARY b/locale/locale/en_AU.US-ASCII/LC_MONETARY new file mode 120000 index 0000000..ccd821d --- /dev/null +++ b/locale/locale/en_AU.US-ASCII/LC_MONETARY @@ -0,0 +1 @@ +../en_AU.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_AU.US-ASCII/LC_NUMERIC b/locale/locale/en_AU.US-ASCII/LC_NUMERIC new file mode 120000 index 0000000..7dfc804 --- /dev/null +++ b/locale/locale/en_AU.US-ASCII/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_AU.US-ASCII/LC_TIME b/locale/locale/en_AU.US-ASCII/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_AU.US-ASCII/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_AU.UTF-8/LC_COLLATE b/locale/locale/en_AU.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_AU.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_AU.UTF-8/LC_CTYPE b/locale/locale/en_AU.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_AU.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_AU.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_AU.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..473a5d3 --- /dev/null +++ b/locale/locale/en_AU.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_AU.UTF-8/LC_MONETARY b/locale/locale/en_AU.UTF-8/LC_MONETARY new file mode 120000 index 0000000..ccd821d --- /dev/null +++ b/locale/locale/en_AU.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../en_AU.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_AU.UTF-8/LC_NUMERIC b/locale/locale/en_AU.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..03e92ae --- /dev/null +++ b/locale/locale/en_AU.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_AU.UTF-8/LC_TIME b/locale/locale/en_AU.UTF-8/LC_TIME new file mode 120000 index 0000000..2e50eb6 --- /dev/null +++ b/locale/locale/en_AU.UTF-8/LC_TIME @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_AU/LC_COLLATE b/locale/locale/en_AU/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_AU/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_AU/LC_CTYPE b/locale/locale/en_AU/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_AU/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_AU/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_AU/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..473a5d3 --- /dev/null +++ b/locale/locale/en_AU/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_AU/LC_MONETARY b/locale/locale/en_AU/LC_MONETARY new file mode 120000 index 0000000..ccd821d --- /dev/null +++ b/locale/locale/en_AU/LC_MONETARY @@ -0,0 +1 @@ +../en_AU.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_AU/LC_NUMERIC b/locale/locale/en_AU/LC_NUMERIC new file mode 120000 index 0000000..03e92ae --- /dev/null +++ b/locale/locale/en_AU/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_AU/LC_TIME b/locale/locale/en_AU/LC_TIME new file mode 120000 index 0000000..2e50eb6 --- /dev/null +++ b/locale/locale/en_AU/LC_TIME @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-1/LC_COLLATE b/locale/locale/en_CA.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/en_CA.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-1/LC_CTYPE b/locale/locale/en_CA.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/en_CA.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..4cd49df --- /dev/null +++ b/locale/locale/en_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[yYoO].* +^[nN].* diff --git a/locale/locale/en_CA.ISO8859-1/LC_MONETARY b/locale/locale/en_CA.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..69ff061 --- /dev/null +++ b/locale/locale/en_CA.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +CAD +$ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +1 diff --git a/locale/locale/en_CA.ISO8859-1/LC_NUMERIC b/locale/locale/en_CA.ISO8859-1/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_CA.ISO8859-1/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-1/LC_TIME b/locale/locale/en_CA.ISO8859-1/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_CA.ISO8859-1/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-15/LC_COLLATE b/locale/locale/en_CA.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/en_CA.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-15/LC_CTYPE b/locale/locale/en_CA.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/en_CA.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..113d302 --- /dev/null +++ b/locale/locale/en_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-15/LC_MONETARY b/locale/locale/en_CA.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..3866ba3 --- /dev/null +++ b/locale/locale/en_CA.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../en_CA.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-15/LC_NUMERIC b/locale/locale/en_CA.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_CA.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_CA.ISO8859-15/LC_TIME b/locale/locale/en_CA.ISO8859-15/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_CA.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_CA.US-ASCII/LC_COLLATE b/locale/locale/en_CA.US-ASCII/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_CA.US-ASCII/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_CA.US-ASCII/LC_CTYPE b/locale/locale/en_CA.US-ASCII/LC_CTYPE new file mode 120000 index 0000000..6f51d8f --- /dev/null +++ b/locale/locale/en_CA.US-ASCII/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_CA.US-ASCII/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_CA.US-ASCII/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..113d302 --- /dev/null +++ b/locale/locale/en_CA.US-ASCII/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_CA.US-ASCII/LC_MONETARY b/locale/locale/en_CA.US-ASCII/LC_MONETARY new file mode 120000 index 0000000..3866ba3 --- /dev/null +++ b/locale/locale/en_CA.US-ASCII/LC_MONETARY @@ -0,0 +1 @@ +../en_CA.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_CA.US-ASCII/LC_NUMERIC b/locale/locale/en_CA.US-ASCII/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_CA.US-ASCII/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_CA.US-ASCII/LC_TIME b/locale/locale/en_CA.US-ASCII/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_CA.US-ASCII/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_CA.UTF-8/LC_COLLATE b/locale/locale/en_CA.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_CA.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_CA.UTF-8/LC_CTYPE b/locale/locale/en_CA.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_CA.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_CA.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_CA.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..113d302 --- /dev/null +++ b/locale/locale/en_CA.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_CA.UTF-8/LC_MONETARY b/locale/locale/en_CA.UTF-8/LC_MONETARY new file mode 120000 index 0000000..3866ba3 --- /dev/null +++ b/locale/locale/en_CA.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../en_CA.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_CA.UTF-8/LC_NUMERIC b/locale/locale/en_CA.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..bfa4764 --- /dev/null +++ b/locale/locale/en_CA.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_CA.UTF-8/LC_TIME b/locale/locale/en_CA.UTF-8/LC_TIME new file mode 120000 index 0000000..2e50eb6 --- /dev/null +++ b/locale/locale/en_CA.UTF-8/LC_TIME @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_CA/LC_COLLATE b/locale/locale/en_CA/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_CA/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_CA/LC_CTYPE b/locale/locale/en_CA/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_CA/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_CA/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_CA/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..113d302 --- /dev/null +++ b/locale/locale/en_CA/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_CA/LC_MONETARY b/locale/locale/en_CA/LC_MONETARY new file mode 120000 index 0000000..3866ba3 --- /dev/null +++ b/locale/locale/en_CA/LC_MONETARY @@ -0,0 +1 @@ +../en_CA.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_CA/LC_NUMERIC b/locale/locale/en_CA/LC_NUMERIC new file mode 120000 index 0000000..bfa4764 --- /dev/null +++ b/locale/locale/en_CA/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_CA/LC_TIME b/locale/locale/en_CA/LC_TIME new file mode 120000 index 0000000..2e50eb6 --- /dev/null +++ b/locale/locale/en_CA/LC_TIME @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_GB.ISO8859-1/LC_COLLATE b/locale/locale/en_GB.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/en_GB.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_GB.ISO8859-1/LC_CTYPE b/locale/locale/en_GB.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/en_GB.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..4ab9cd9 --- /dev/null +++ b/locale/locale/en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[yY].* +^[nN].* diff --git a/locale/locale/en_GB.ISO8859-1/LC_MONETARY b/locale/locale/en_GB.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..a1754e0 --- /dev/null +++ b/locale/locale/en_GB.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +GBP +£ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +1 diff --git a/locale/locale/en_GB.ISO8859-1/LC_NUMERIC b/locale/locale/en_GB.ISO8859-1/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_GB.ISO8859-1/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_GB.ISO8859-1/LC_TIME b/locale/locale/en_GB.ISO8859-1/LC_TIME new file mode 100644 index 0000000..d8dfbc0 --- /dev/null +++ b/locale/locale/en_GB.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +Jan +Feb +Mar +Apr +May +Jun +Jul +Aug +Sep +Oct +Nov +Dec +January +February +March +April +May +June +July +August +September +October +November +December +Sun +Mon +Tue +Wed +Thu +Fri +Sat +Sunday +Monday +Tuesday +Wednesday +Thursday +Friday +Saturday +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +January +February +March +April +May +June +July +August +September +October +November +December +dm +%I:%M:%S %p diff --git a/locale/locale/en_GB.ISO8859-15/LC_COLLATE b/locale/locale/en_GB.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/en_GB.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_GB.ISO8859-15/LC_CTYPE b/locale/locale/en_GB.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/en_GB.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_GB.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_GB.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_GB.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_GB.ISO8859-15/LC_MONETARY b/locale/locale/en_GB.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..f2bd27a --- /dev/null +++ b/locale/locale/en_GB.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_GB.ISO8859-15/LC_NUMERIC b/locale/locale/en_GB.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_GB.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_GB.ISO8859-15/LC_TIME b/locale/locale/en_GB.ISO8859-15/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_GB.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_GB.US-ASCII/LC_COLLATE b/locale/locale/en_GB.US-ASCII/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_GB.US-ASCII/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_GB.US-ASCII/LC_CTYPE b/locale/locale/en_GB.US-ASCII/LC_CTYPE new file mode 120000 index 0000000..6f51d8f --- /dev/null +++ b/locale/locale/en_GB.US-ASCII/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_GB.US-ASCII/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_GB.US-ASCII/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_GB.US-ASCII/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_GB.US-ASCII/LC_MONETARY b/locale/locale/en_GB.US-ASCII/LC_MONETARY new file mode 120000 index 0000000..f2bd27a --- /dev/null +++ b/locale/locale/en_GB.US-ASCII/LC_MONETARY @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_GB.US-ASCII/LC_NUMERIC b/locale/locale/en_GB.US-ASCII/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_GB.US-ASCII/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_GB.US-ASCII/LC_TIME b/locale/locale/en_GB.US-ASCII/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_GB.US-ASCII/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_GB.UTF-8/LC_COLLATE b/locale/locale/en_GB.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_GB.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_GB.UTF-8/LC_CTYPE b/locale/locale/en_GB.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_GB.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_GB.UTF-8/LC_MONETARY b/locale/locale/en_GB.UTF-8/LC_MONETARY new file mode 100644 index 0000000..300d0e3 --- /dev/null +++ b/locale/locale/en_GB.UTF-8/LC_MONETARY @@ -0,0 +1,15 @@ +GBP +£ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +1 diff --git a/locale/locale/en_GB.UTF-8/LC_NUMERIC b/locale/locale/en_GB.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..bfa4764 --- /dev/null +++ b/locale/locale/en_GB.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_GB.UTF-8/LC_TIME b/locale/locale/en_GB.UTF-8/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_GB.UTF-8/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_GB/LC_COLLATE b/locale/locale/en_GB/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_GB/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_GB/LC_CTYPE b/locale/locale/en_GB/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_GB/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_GB/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_GB/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_GB/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_GB/LC_MONETARY b/locale/locale/en_GB/LC_MONETARY new file mode 100644 index 0000000..300d0e3 --- /dev/null +++ b/locale/locale/en_GB/LC_MONETARY @@ -0,0 +1,15 @@ +GBP +£ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +1 diff --git a/locale/locale/en_GB/LC_NUMERIC b/locale/locale/en_GB/LC_NUMERIC new file mode 120000 index 0000000..bfa4764 --- /dev/null +++ b/locale/locale/en_GB/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_GB/LC_TIME b/locale/locale/en_GB/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_GB/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_IE.UTF-8/LC_COLLATE b/locale/locale/en_IE.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_IE.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_IE.UTF-8/LC_CTYPE b/locale/locale/en_IE.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_IE.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_IE.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_IE.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..473a5d3 --- /dev/null +++ b/locale/locale/en_IE.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_IE.UTF-8/LC_MONETARY b/locale/locale/en_IE.UTF-8/LC_MONETARY new file mode 100644 index 0000000..7e6f50d --- /dev/null +++ b/locale/locale/en_IE.UTF-8/LC_MONETARY @@ -0,0 +1,15 @@ +EUR +€ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +1 diff --git a/locale/locale/en_IE.UTF-8/LC_NUMERIC b/locale/locale/en_IE.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..03e92ae --- /dev/null +++ b/locale/locale/en_IE.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_IE.UTF-8/LC_TIME b/locale/locale/en_IE.UTF-8/LC_TIME new file mode 120000 index 0000000..2e50eb6 --- /dev/null +++ b/locale/locale/en_IE.UTF-8/LC_TIME @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_IE/LC_COLLATE b/locale/locale/en_IE/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_IE/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_IE/LC_CTYPE b/locale/locale/en_IE/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_IE/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_IE/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_IE/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..473a5d3 --- /dev/null +++ b/locale/locale/en_IE/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_IE/LC_MONETARY b/locale/locale/en_IE/LC_MONETARY new file mode 100644 index 0000000..7e6f50d --- /dev/null +++ b/locale/locale/en_IE/LC_MONETARY @@ -0,0 +1,15 @@ +EUR +€ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +1 diff --git a/locale/locale/en_IE/LC_NUMERIC b/locale/locale/en_IE/LC_NUMERIC new file mode 120000 index 0000000..03e92ae --- /dev/null +++ b/locale/locale/en_IE/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_IE/LC_TIME b/locale/locale/en_IE/LC_TIME new file mode 120000 index 0000000..2e50eb6 --- /dev/null +++ b/locale/locale/en_IE/LC_TIME @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-1/LC_COLLATE b/locale/locale/en_NZ.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-1/LC_CTYPE b/locale/locale/en_NZ.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_NZ.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-1/LC_MONETARY b/locale/locale/en_NZ.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..4bc1046 --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +NZD +$ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +1 diff --git a/locale/locale/en_NZ.ISO8859-1/LC_NUMERIC b/locale/locale/en_NZ.ISO8859-1/LC_NUMERIC new file mode 120000 index 0000000..7dfc804 --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-1/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-1/LC_TIME b/locale/locale/en_NZ.ISO8859-1/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-1/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-15/LC_COLLATE b/locale/locale/en_NZ.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-15/LC_CTYPE b/locale/locale/en_NZ.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_NZ.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-15/LC_MONETARY b/locale/locale/en_NZ.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..fd1c6fc --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../en_NZ.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-15/LC_NUMERIC b/locale/locale/en_NZ.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..7dfc804 --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_NZ.ISO8859-15/LC_TIME b/locale/locale/en_NZ.ISO8859-15/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_NZ.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_NZ.US-ASCII/LC_COLLATE b/locale/locale/en_NZ.US-ASCII/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_NZ.US-ASCII/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_NZ.US-ASCII/LC_CTYPE b/locale/locale/en_NZ.US-ASCII/LC_CTYPE new file mode 120000 index 0000000..6f51d8f --- /dev/null +++ b/locale/locale/en_NZ.US-ASCII/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_NZ.US-ASCII/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_NZ.US-ASCII/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..3bd58c5 --- /dev/null +++ b/locale/locale/en_NZ.US-ASCII/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_NZ.US-ASCII/LC_MONETARY b/locale/locale/en_NZ.US-ASCII/LC_MONETARY new file mode 120000 index 0000000..fd1c6fc --- /dev/null +++ b/locale/locale/en_NZ.US-ASCII/LC_MONETARY @@ -0,0 +1 @@ +../en_NZ.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_NZ.US-ASCII/LC_NUMERIC b/locale/locale/en_NZ.US-ASCII/LC_NUMERIC new file mode 120000 index 0000000..7dfc804 --- /dev/null +++ b/locale/locale/en_NZ.US-ASCII/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_NZ.US-ASCII/LC_TIME b/locale/locale/en_NZ.US-ASCII/LC_TIME new file mode 120000 index 0000000..e098d6c --- /dev/null +++ b/locale/locale/en_NZ.US-ASCII/LC_TIME @@ -0,0 +1 @@ +../en_GB.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_NZ.UTF-8/LC_COLLATE b/locale/locale/en_NZ.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_NZ.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_NZ.UTF-8/LC_CTYPE b/locale/locale/en_NZ.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_NZ.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_NZ.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_NZ.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..473a5d3 --- /dev/null +++ b/locale/locale/en_NZ.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_NZ.UTF-8/LC_MONETARY b/locale/locale/en_NZ.UTF-8/LC_MONETARY new file mode 120000 index 0000000..fd1c6fc --- /dev/null +++ b/locale/locale/en_NZ.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../en_NZ.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_NZ.UTF-8/LC_NUMERIC b/locale/locale/en_NZ.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..03e92ae --- /dev/null +++ b/locale/locale/en_NZ.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_NZ.UTF-8/LC_TIME b/locale/locale/en_NZ.UTF-8/LC_TIME new file mode 120000 index 0000000..2e50eb6 --- /dev/null +++ b/locale/locale/en_NZ.UTF-8/LC_TIME @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_NZ/LC_COLLATE b/locale/locale/en_NZ/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_NZ/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_NZ/LC_CTYPE b/locale/locale/en_NZ/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_NZ/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_NZ/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_NZ/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..473a5d3 --- /dev/null +++ b/locale/locale/en_NZ/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_GB.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_NZ/LC_MONETARY b/locale/locale/en_NZ/LC_MONETARY new file mode 120000 index 0000000..fd1c6fc --- /dev/null +++ b/locale/locale/en_NZ/LC_MONETARY @@ -0,0 +1 @@ +../en_NZ.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_NZ/LC_NUMERIC b/locale/locale/en_NZ/LC_NUMERIC new file mode 120000 index 0000000..03e92ae --- /dev/null +++ b/locale/locale/en_NZ/LC_NUMERIC @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_NZ/LC_TIME b/locale/locale/en_NZ/LC_TIME new file mode 120000 index 0000000..2e50eb6 --- /dev/null +++ b/locale/locale/en_NZ/LC_TIME @@ -0,0 +1 @@ +../en_GB.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_US.ISO8859-1/LC_COLLATE b/locale/locale/en_US.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/en_US.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_US.ISO8859-1/LC_CTYPE b/locale/locale/en_US.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/en_US.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_US.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_US.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..656c71d --- /dev/null +++ b/locale/locale/en_US.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[yYsS].* +^[nN].* diff --git a/locale/locale/en_US.ISO8859-1/LC_MONETARY b/locale/locale/en_US.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..bf2ce33 --- /dev/null +++ b/locale/locale/en_US.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +USD +$ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +1 diff --git a/locale/locale/en_US.ISO8859-1/LC_NUMERIC b/locale/locale/en_US.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..5b1be07 --- /dev/null +++ b/locale/locale/en_US.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +. +, +3;3 diff --git a/locale/locale/en_US.ISO8859-1/LC_TIME b/locale/locale/en_US.ISO8859-1/LC_TIME new file mode 100644 index 0000000..44298c0 --- /dev/null +++ b/locale/locale/en_US.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +Jan +Feb +Mar +Apr +May +Jun +Jul +Aug +Sep +Oct +Nov +Dec +January +February +March +April +May +June +July +August +September +October +November +December +Sun +Mon +Tue +Wed +Thu +Fri +Sat +Sunday +Monday +Tuesday +Wednesday +Thursday +Friday +Saturday +%H:%M:%S +%m/%d/%Y +%a %b %e %X %Y +AM +PM +%a %b %e %X %Z %Y +January +February +March +April +May +June +July +August +September +October +November +December +md +%I:%M:%S %p diff --git a/locale/locale/en_US.ISO8859-15/LC_COLLATE b/locale/locale/en_US.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/en_US.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_US.ISO8859-15/LC_CTYPE b/locale/locale/en_US.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/en_US.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_US.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_US.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..56c982b --- /dev/null +++ b/locale/locale/en_US.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_US.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_US.ISO8859-15/LC_MONETARY b/locale/locale/en_US.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..881b81e --- /dev/null +++ b/locale/locale/en_US.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_US.ISO8859-15/LC_NUMERIC b/locale/locale/en_US.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_US.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_US.ISO8859-15/LC_TIME b/locale/locale/en_US.ISO8859-15/LC_TIME new file mode 120000 index 0000000..37b64e5 --- /dev/null +++ b/locale/locale/en_US.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_US.US-ASCII/LC_COLLATE b/locale/locale/en_US.US-ASCII/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_US.US-ASCII/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_US.US-ASCII/LC_CTYPE b/locale/locale/en_US.US-ASCII/LC_CTYPE new file mode 120000 index 0000000..6f51d8f --- /dev/null +++ b/locale/locale/en_US.US-ASCII/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_US.US-ASCII/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_US.US-ASCII/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..56c982b --- /dev/null +++ b/locale/locale/en_US.US-ASCII/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_US.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_US.US-ASCII/LC_MONETARY b/locale/locale/en_US.US-ASCII/LC_MONETARY new file mode 120000 index 0000000..881b81e --- /dev/null +++ b/locale/locale/en_US.US-ASCII/LC_MONETARY @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_US.US-ASCII/LC_NUMERIC b/locale/locale/en_US.US-ASCII/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_US.US-ASCII/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_US.US-ASCII/LC_TIME b/locale/locale/en_US.US-ASCII/LC_TIME new file mode 120000 index 0000000..37b64e5 --- /dev/null +++ b/locale/locale/en_US.US-ASCII/LC_TIME @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_US.UTF-8/LC_COLLATE b/locale/locale/en_US.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_US.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_US.UTF-8/LC_CTYPE b/locale/locale/en_US.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_US.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_US.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_US.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..56c982b --- /dev/null +++ b/locale/locale/en_US.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_US.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_US.UTF-8/LC_MONETARY b/locale/locale/en_US.UTF-8/LC_MONETARY new file mode 120000 index 0000000..881b81e --- /dev/null +++ b/locale/locale/en_US.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_US.UTF-8/LC_NUMERIC b/locale/locale/en_US.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_US.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_US.UTF-8/LC_TIME b/locale/locale/en_US.UTF-8/LC_TIME new file mode 120000 index 0000000..37b64e5 --- /dev/null +++ b/locale/locale/en_US.UTF-8/LC_TIME @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/en_US/LC_COLLATE b/locale/locale/en_US/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/en_US/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/en_US/LC_CTYPE b/locale/locale/en_US/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/en_US/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/en_US/LC_MESSAGES/LC_MESSAGES b/locale/locale/en_US/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..56c982b --- /dev/null +++ b/locale/locale/en_US/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../en_US.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/en_US/LC_MONETARY b/locale/locale/en_US/LC_MONETARY new file mode 120000 index 0000000..881b81e --- /dev/null +++ b/locale/locale/en_US/LC_MONETARY @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/en_US/LC_NUMERIC b/locale/locale/en_US/LC_NUMERIC new file mode 120000 index 0000000..187566b --- /dev/null +++ b/locale/locale/en_US/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/en_US/LC_TIME b/locale/locale/en_US/LC_TIME new file mode 120000 index 0000000..37b64e5 --- /dev/null +++ b/locale/locale/en_US/LC_TIME @@ -0,0 +1 @@ +../en_US.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/eo/LC_MESSAGES/texinfo.mo b/locale/locale/eo/LC_MESSAGES/texinfo.mo new file mode 100644 index 0000000000000000000000000000000000000000..483829a6a6d1f9097b74068269bb6f07515dff8e GIT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tsC>yi_`6#-!7iNIbL?cy30SwCvk5n-e)&FRR#6Xph zD1A_VyvqMJQJsVl&$ZZ#o*MSQjI*9ui7Xt2v_p!rrCGXDBo5Mb#LAtoUXWM`-9u}tS*i+O)Ehsj-p;cEZJMwR~_rdzn(;X-b&s-iRU$2jm>+h zEs8yX;wdbrz#&)r2Tdni|^9NBpbq1Dou9;Q+}J(R2vFKmB-Ed(XKB?_a!&a^kJzx2*u7q z`KJDgR@9__1YLj~-%L?ru@AY?idT8wxXYYBOZx8!flwtq0EOhVdE0BAeYxadZ;34O zo;*1D(lW~d>FxcLmP{>MbdQ+?vJxua5{U6On?Hv!fRoSd5M5%$v~1oq+KInc|D`2? z>~9{{oqLa~5PSqx8~xfXZnl+89A<>Uh$N9#g38vP`DxZyBp%E(r?9pI`PuTJhO`3T z({7M&hBI7_F-pP*qv|00v9($4*ysx|5ho1$WYaTh`e;RavWQaFbE?$cgvxequ`McW za>f{t>e1KY2B^*=n!{l$I}6~(!|3iDSN~C${@Pq>>gWJE$t6^mWnzGnc*2BWHbw{| z4tIXHQ2vQv{U6a`E@4)tDh(Sl(#YAg)nX9RT^p5WD=du_N{0l4j-9m&Rv?&ZIetR1il5<>$}BE@vJwKAWwPFd{EZvc*O`l#I6zK+Z6bff@*SNHjuqc9Mt+@Z<_qDrD8&iaH+n(ruGe TcWm?4V6H&*bZ4m5JCpwh+Xfp+ literal 0 HcmV?d00001 diff --git a/locale/locale/es_ES.ISO8859-1/LC_COLLATE b/locale/locale/es_ES.ISO8859-1/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..32849acaed29b34c47337ee1d51687390416c054 GIT binary patch literal 2518 zcma*nd6boN0EhAWs!?{?vt{4KkgP?rMYil~7%8bRb|p(8`xYtL71^_wCA(1BlBF6` z_91(AjpsY}`Tx#6=kq>u@A@jX<-_z)S5=_k9}Uyv<8he)s@CB+Komxb*Hhf_M_252hccB2hliKhtoJxN6|Q1J!#aa7meOJkw#yg zM5CYj(-@$WX`G@{Y1Ha88mH@A8UrS7^zV-M(b`G z_h<}_dvza;aeA1>BYKp^cs)+zDLqZ&8BL(^tX`loNpH}YthZ@Q(R(!B*9SDF>k}HE zY9@`@s-sb_uW5XvZ)tp|?`h1_FEoDDZ#3pB|Kstm7ElzV36~9HJIW(RtD_XEe=@9jzC!ja_;Q6wm zB|DVPDl0g%qqM(j=<$5ks;smJ@1rMj(%5bG-Bsz9n;As*{VI*!X5T}V mZW+rUvahW)cAI?-n)Ca<#V+#f&3XP=>>|(7oabp^*YH0gybY=V literal 0 HcmV?d00001 diff --git a/locale/locale/es_ES.ISO8859-1/LC_CTYPE b/locale/locale/es_ES.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/es_ES.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/es_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/es_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..96af6ad --- /dev/null +++ b/locale/locale/es_ES.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[sSyY].* +^[nN].* diff --git a/locale/locale/es_ES.ISO8859-1/LC_MONETARY b/locale/locale/es_ES.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..eede5d1 --- /dev/null +++ b/locale/locale/es_ES.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +EUR +Eu +, +. +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/es_ES.ISO8859-1/LC_NUMERIC b/locale/locale/es_ES.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..f1ea6a0 --- /dev/null +++ b/locale/locale/es_ES.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +-1 diff --git a/locale/locale/es_ES.ISO8859-1/LC_TIME b/locale/locale/es_ES.ISO8859-1/LC_TIME new file mode 100644 index 0000000..20e9ee2 --- /dev/null +++ b/locale/locale/es_ES.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +ene +feb +mar +abr +may +jun +jul +ago +sep +oct +nov +dic +enero +febrero +marzo +abril +mayo +junio +julio +agosto +septiembre +octubre +noviembre +diciembre +dom +lun +mar +mié +jue +vie +sáb +domingo +lunes +martes +miércoles +jueves +viernes +sábado +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y +AM +PM +%A, %e de %B de %Y, %X %Z +enero +febrero +marzo +abril +mayo +junio +julio +agosto +septiembre +octubre +noviembre +diciembre +dm +%I:%M:%S %p diff --git a/locale/locale/es_ES.ISO8859-15/LC_COLLATE b/locale/locale/es_ES.ISO8859-15/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..7708d9943b68a91a39b924fd929bc4517a7e9544 GIT binary patch literal 2518 zcma*mces@U0LSrj+Q`V>w5*7WWG9u1tcBC>>Vu=UOys zs}7C2sz;-~8qmn~kv|fvsUeNkwFZqfwHA#=TARi?T9?LpTA#)S+K|RZ+L*>B+LXp- z+MLD~+LA_NwWHBq2hixOE;J6+VKfd`R~kp?NE%1!7#hdvcp4|D2aTTUMWa%u&^T46 z(dezyX`G=mY4p)qG|tvJH2UfS8Ur+l#$a7ZV~DP!alMAp7^dMgMrb6BTQr)+7~MtV zZrwv;qVA(HNe|O_M32&VOjBq)t!HRFtLJDuuNP@d)oV0n>P;H6^d61(^#P69`k2Ni z`jp0JnonbazNPV$*X&kHbX}nNUtj!*Uqt%O^gi4%@ zDR_cSosz=2oTFH)r24)7i|2acM4qc(Qs~5ajKQ5)fJMmnWHS0`0KEw5h4x~5slCJw zw3pGrxEw=pwY|z-W3Q#daHGA!-ehm4Pii#16}jKr?QM3f9cS;L-Ie`#Ou_^9e*2(( zh~{-aj;Hi5jj4FaPO~rDSL_Ts-M&g^;&sfz+x9K{j(wNT##}qcerP|Ue``Md9C@F< zunX;%_G|kU?WXL%!BYHef3m;WU+F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@jg(iO)uwY06g)>m15 zjU8lXsbJAivXJYgxi!0qE0Q}1GVIc=S|*9UVp7PDDy`dE&VhY%$6EP73!RZH6i1#& z0snmyZ9=}C><3q-%d4A&Co2_zTg`v$i=FHU5KA=Ot1g!_k0mvIxOCD49UPgu y?+aC-YsGZNTo~brYalZ6h@MAdomCUbJ@t|UISZzhXU(UlUJWf?s&L~U&Hn()bqBow literal 0 HcmV?d00001 diff --git a/locale/locale/fr_BE.ISO8859-1/LC_COLLATE b/locale/locale/fr_BE.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_BE.ISO8859-1/LC_CTYPE b/locale/locale/fr_BE.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..6e9ca7b --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[oOyYjJ1].* +^[nN].* diff --git a/locale/locale/fr_BE.ISO8859-1/LC_MONETARY b/locale/locale/fr_BE.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..eede5d1 --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +EUR +Eu +, +. +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/fr_BE.ISO8859-1/LC_NUMERIC b/locale/locale/fr_BE.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..501fcb9 --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +, +. +-1 diff --git a/locale/locale/fr_BE.ISO8859-1/LC_TIME b/locale/locale/fr_BE.ISO8859-1/LC_TIME new file mode 120000 index 0000000..7d40425 --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-1/LC_TIME @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_BE.ISO8859-15/LC_COLLATE b/locale/locale/fr_BE.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_BE.ISO8859-15/LC_CTYPE b/locale/locale/fr_BE.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_BE.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_BE.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..4898c35 --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_BE.ISO8859-15/LC_MONETARY b/locale/locale/fr_BE.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..27fe0b8 --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../fr_BE.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_BE.ISO8859-15/LC_NUMERIC b/locale/locale/fr_BE.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..a082eb7 --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../fr_BE.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_BE.ISO8859-15/LC_TIME b/locale/locale/fr_BE.ISO8859-15/LC_TIME new file mode 120000 index 0000000..7d40425 --- /dev/null +++ b/locale/locale/fr_BE.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_BE.UTF-8/LC_COLLATE b/locale/locale/fr_BE.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/fr_BE.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_BE.UTF-8/LC_CTYPE b/locale/locale/fr_BE.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/fr_BE.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_BE.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_BE.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..4898c35 --- /dev/null +++ b/locale/locale/fr_BE.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_BE.UTF-8/LC_MONETARY b/locale/locale/fr_BE.UTF-8/LC_MONETARY new file mode 120000 index 0000000..27fe0b8 --- /dev/null +++ b/locale/locale/fr_BE.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../fr_BE.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_BE.UTF-8/LC_NUMERIC b/locale/locale/fr_BE.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..a082eb7 --- /dev/null +++ b/locale/locale/fr_BE.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../fr_BE.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_BE.UTF-8/LC_TIME b/locale/locale/fr_BE.UTF-8/LC_TIME new file mode 120000 index 0000000..9ca831f --- /dev/null +++ b/locale/locale/fr_BE.UTF-8/LC_TIME @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_BE/LC_COLLATE b/locale/locale/fr_BE/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/fr_BE/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_BE/LC_CTYPE b/locale/locale/fr_BE/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/fr_BE/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_BE/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_BE/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..4898c35 --- /dev/null +++ b/locale/locale/fr_BE/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_BE.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_BE/LC_MONETARY b/locale/locale/fr_BE/LC_MONETARY new file mode 120000 index 0000000..27fe0b8 --- /dev/null +++ b/locale/locale/fr_BE/LC_MONETARY @@ -0,0 +1 @@ +../fr_BE.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_BE/LC_NUMERIC b/locale/locale/fr_BE/LC_NUMERIC new file mode 120000 index 0000000..a082eb7 --- /dev/null +++ b/locale/locale/fr_BE/LC_NUMERIC @@ -0,0 +1 @@ +../fr_BE.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_BE/LC_TIME b/locale/locale/fr_BE/LC_TIME new file mode 120000 index 0000000..9ca831f --- /dev/null +++ b/locale/locale/fr_BE/LC_TIME @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-1/LC_COLLATE b/locale/locale/fr_CA.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-1/LC_CTYPE b/locale/locale/fr_CA.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..d04bab6 --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-1/LC_MONETARY b/locale/locale/fr_CA.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..09d05e3 --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +CAD +$ +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +2 diff --git a/locale/locale/fr_CA.ISO8859-1/LC_NUMERIC b/locale/locale/fr_CA.ISO8859-1/LC_NUMERIC new file mode 120000 index 0000000..dde788a --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-1/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-1/LC_TIME b/locale/locale/fr_CA.ISO8859-1/LC_TIME new file mode 120000 index 0000000..7d40425 --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-1/LC_TIME @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-15/LC_COLLATE b/locale/locale/fr_CA.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-15/LC_CTYPE b/locale/locale/fr_CA.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..d04bab6 --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-15/LC_MONETARY b/locale/locale/fr_CA.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..c41d73d --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../fr_CA.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-15/LC_NUMERIC b/locale/locale/fr_CA.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..dde788a --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_CA.ISO8859-15/LC_TIME b/locale/locale/fr_CA.ISO8859-15/LC_TIME new file mode 120000 index 0000000..7d40425 --- /dev/null +++ b/locale/locale/fr_CA.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_CA.UTF-8/LC_COLLATE b/locale/locale/fr_CA.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/fr_CA.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_CA.UTF-8/LC_CTYPE b/locale/locale/fr_CA.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/fr_CA.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_CA.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_CA.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..030a14d --- /dev/null +++ b/locale/locale/fr_CA.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_FR.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_CA.UTF-8/LC_MONETARY b/locale/locale/fr_CA.UTF-8/LC_MONETARY new file mode 120000 index 0000000..c41d73d --- /dev/null +++ b/locale/locale/fr_CA.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../fr_CA.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_CA.UTF-8/LC_NUMERIC b/locale/locale/fr_CA.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..8d6df1a --- /dev/null +++ b/locale/locale/fr_CA.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_CA.UTF-8/LC_TIME b/locale/locale/fr_CA.UTF-8/LC_TIME new file mode 120000 index 0000000..9ca831f --- /dev/null +++ b/locale/locale/fr_CA.UTF-8/LC_TIME @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_CA/LC_COLLATE b/locale/locale/fr_CA/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/fr_CA/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_CA/LC_CTYPE b/locale/locale/fr_CA/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/fr_CA/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_CA/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_CA/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..030a14d --- /dev/null +++ b/locale/locale/fr_CA/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_FR.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_CA/LC_MONETARY b/locale/locale/fr_CA/LC_MONETARY new file mode 120000 index 0000000..c41d73d --- /dev/null +++ b/locale/locale/fr_CA/LC_MONETARY @@ -0,0 +1 @@ +../fr_CA.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_CA/LC_NUMERIC b/locale/locale/fr_CA/LC_NUMERIC new file mode 120000 index 0000000..8d6df1a --- /dev/null +++ b/locale/locale/fr_CA/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_CA/LC_TIME b/locale/locale/fr_CA/LC_TIME new file mode 120000 index 0000000..9ca831f --- /dev/null +++ b/locale/locale/fr_CA/LC_TIME @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-1/LC_COLLATE b/locale/locale/fr_CH.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-1/LC_CTYPE b/locale/locale/fr_CH.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..2e12fbf --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[oOjJsSyY].* +^[nN].* diff --git a/locale/locale/fr_CH.ISO8859-1/LC_MONETARY b/locale/locale/fr_CH.ISO8859-1/LC_MONETARY new file mode 120000 index 0000000..9a2f574 --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-1/LC_MONETARY @@ -0,0 +1 @@ +../de_CH.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-1/LC_NUMERIC b/locale/locale/fr_CH.ISO8859-1/LC_NUMERIC new file mode 120000 index 0000000..dde788a --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-1/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-1/LC_TIME b/locale/locale/fr_CH.ISO8859-1/LC_TIME new file mode 120000 index 0000000..7d40425 --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-1/LC_TIME @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-15/LC_COLLATE b/locale/locale/fr_CH.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-15/LC_CTYPE b/locale/locale/fr_CH.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..bccb881 --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-15/LC_MONETARY b/locale/locale/fr_CH.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..88a3f13 --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../fr_CH.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-15/LC_NUMERIC b/locale/locale/fr_CH.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..dde788a --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_CH.ISO8859-15/LC_TIME b/locale/locale/fr_CH.ISO8859-15/LC_TIME new file mode 120000 index 0000000..7d40425 --- /dev/null +++ b/locale/locale/fr_CH.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_CH.UTF-8/LC_COLLATE b/locale/locale/fr_CH.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/fr_CH.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_CH.UTF-8/LC_CTYPE b/locale/locale/fr_CH.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/fr_CH.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_CH.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_CH.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..bccb881 --- /dev/null +++ b/locale/locale/fr_CH.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_CH.UTF-8/LC_MONETARY b/locale/locale/fr_CH.UTF-8/LC_MONETARY new file mode 120000 index 0000000..7b5f7cc --- /dev/null +++ b/locale/locale/fr_CH.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../de_CH.UTF-8/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_CH.UTF-8/LC_NUMERIC b/locale/locale/fr_CH.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..8d6df1a --- /dev/null +++ b/locale/locale/fr_CH.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_CH.UTF-8/LC_TIME b/locale/locale/fr_CH.UTF-8/LC_TIME new file mode 120000 index 0000000..9ca831f --- /dev/null +++ b/locale/locale/fr_CH.UTF-8/LC_TIME @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_CH/LC_COLLATE b/locale/locale/fr_CH/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/fr_CH/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_CH/LC_CTYPE b/locale/locale/fr_CH/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/fr_CH/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_CH/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_CH/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..bccb881 --- /dev/null +++ b/locale/locale/fr_CH/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_CH/LC_MONETARY b/locale/locale/fr_CH/LC_MONETARY new file mode 120000 index 0000000..7b5f7cc --- /dev/null +++ b/locale/locale/fr_CH/LC_MONETARY @@ -0,0 +1 @@ +../de_CH.UTF-8/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_CH/LC_NUMERIC b/locale/locale/fr_CH/LC_NUMERIC new file mode 120000 index 0000000..8d6df1a --- /dev/null +++ b/locale/locale/fr_CH/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_CH/LC_TIME b/locale/locale/fr_CH/LC_TIME new file mode 120000 index 0000000..9ca831f --- /dev/null +++ b/locale/locale/fr_CH/LC_TIME @@ -0,0 +1 @@ +../fr_FR.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_FR.ISO8859-1/LC_COLLATE b/locale/locale/fr_FR.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_FR.ISO8859-1/LC_CTYPE b/locale/locale/fr_FR.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..0502dd5 --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[oOyY].* +^[nN].* diff --git a/locale/locale/fr_FR.ISO8859-1/LC_MONETARY b/locale/locale/fr_FR.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..22c101d --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +EUR +Eu +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +2 diff --git a/locale/locale/fr_FR.ISO8859-1/LC_NUMERIC b/locale/locale/fr_FR.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..f1ea6a0 --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +-1 diff --git a/locale/locale/fr_FR.ISO8859-1/LC_TIME b/locale/locale/fr_FR.ISO8859-1/LC_TIME new file mode 100644 index 0000000..5b46ccc --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +jan +fév +mar +avr +mai +jui +jul +aoû +sep +oct +nov +déc +janvier +février +mars +avril +mai +juin +juillet +août +septembre +octobre +novembre +décembre +Dim +Lun +Mar +Mer +Jeu +Ven +Sam +Dimanche +Lundi +Mardi +Mercredi +Jeudi +Vendredi +Samedi +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y + + +%a %e %b %Y %X %Z +janvier +février +mars +avril +mai +juin +juillet +août +septembre +octobre +novembre +décembre +dm + diff --git a/locale/locale/fr_FR.ISO8859-15/LC_COLLATE b/locale/locale/fr_FR.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_FR.ISO8859-15/LC_CTYPE b/locale/locale/fr_FR.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_FR.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_FR.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..d04bab6 --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_FR.ISO8859-15/LC_MONETARY b/locale/locale/fr_FR.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..8fdf6b6 --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_FR.ISO8859-15/LC_NUMERIC b/locale/locale/fr_FR.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..dde788a --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_FR.ISO8859-15/LC_TIME b/locale/locale/fr_FR.ISO8859-15/LC_TIME new file mode 120000 index 0000000..7d40425 --- /dev/null +++ b/locale/locale/fr_FR.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/fr_FR.UTF-8/LC_COLLATE b/locale/locale/fr_FR.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/fr_FR.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_FR.UTF-8/LC_CTYPE b/locale/locale/fr_FR.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/fr_FR.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_FR.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_FR.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..d04bab6 --- /dev/null +++ b/locale/locale/fr_FR.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_FR.UTF-8/LC_MONETARY b/locale/locale/fr_FR.UTF-8/LC_MONETARY new file mode 120000 index 0000000..8fdf6b6 --- /dev/null +++ b/locale/locale/fr_FR.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_FR.UTF-8/LC_NUMERIC b/locale/locale/fr_FR.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..dde788a --- /dev/null +++ b/locale/locale/fr_FR.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_FR.UTF-8/LC_TIME b/locale/locale/fr_FR.UTF-8/LC_TIME new file mode 100644 index 0000000..37b0e07 --- /dev/null +++ b/locale/locale/fr_FR.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +jan +fév +mar +avr +mai +jui +jul +aoû +sep +oct +nov +déc +janvier +février +mars +avril +mai +juin +juillet +août +septembre +octobre +novembre +décembre +Dim +Lun +Mar +Mer +Jeu +Ven +Sam +Dimanche +Lundi +Mardi +Mercredi +Jeudi +Vendredi +Samedi +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y + + +%a %e %b %Y %X %Z +janvier +février +mars +avril +mai +juin +juillet +août +septembre +octobre +novembre +décembre +dm + diff --git a/locale/locale/fr_FR/LC_COLLATE b/locale/locale/fr_FR/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/fr_FR/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/fr_FR/LC_CTYPE b/locale/locale/fr_FR/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/fr_FR/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/fr_FR/LC_MESSAGES/LC_MESSAGES b/locale/locale/fr_FR/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..d04bab6 --- /dev/null +++ b/locale/locale/fr_FR/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../fr_FR.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/fr_FR/LC_MONETARY b/locale/locale/fr_FR/LC_MONETARY new file mode 120000 index 0000000..8fdf6b6 --- /dev/null +++ b/locale/locale/fr_FR/LC_MONETARY @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/fr_FR/LC_NUMERIC b/locale/locale/fr_FR/LC_NUMERIC new file mode 120000 index 0000000..dde788a --- /dev/null +++ b/locale/locale/fr_FR/LC_NUMERIC @@ -0,0 +1 @@ +../fr_FR.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/fr_FR/LC_TIME b/locale/locale/fr_FR/LC_TIME new file mode 100644 index 0000000..37b0e07 --- /dev/null +++ b/locale/locale/fr_FR/LC_TIME @@ -0,0 +1,58 @@ +jan +fév +mar +avr +mai +jui +jul +aoû +sep +oct +nov +déc +janvier +février +mars +avril +mai +juin +juillet +août +septembre +octobre +novembre +décembre +Dim +Lun +Mar +Mer +Jeu +Ven +Sam +Dimanche +Lundi +Mardi +Mercredi +Jeudi +Vendredi +Samedi +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y + + +%a %e %b %Y %X %Z +janvier +février +mars +avril +mai +juin +juillet +août +septembre +octobre +novembre +décembre +dm + diff --git a/locale/locale/he/LC_MESSAGES/texinfo.mo b/locale/locale/he/LC_MESSAGES/texinfo.mo new file mode 100644 index 0000000000000000000000000000000000000000..37652ea6973b73f6a869434adec9a638abc55849 GIT binary patch literal 54894 zcmd7533!}Wb^reoAPE8z5(ptAf!9tP+lfYYRuY*IIgXP!iR~nI0wD>}SQ^_yWR0Sc z;y4hNQp(b@v;|t0vi?{Clu}xD%GQmo6v9#pg-X_p?TKaCR*WSLE&YAI=iK+5cchWy zl;8h({`2_N_g(IO&pr2?bI-m0)yYqId&IB)xF|XU96vFNK733RedW1&8$~ys8%5`X zH-T>kUjx1eJo&sRY6JfYBx>{}@M`cY;0@s8+oNa=cq6zLd>42zxCgu(d``~Oy#pjl z^k#4o_$BZxa3tUpI-+PP&r87Pfj5II!8d}-!0&+Lo(td-@SUL2|0bv^ zO@OC?CoGSm1>ll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C=C`{Tg^qRm~%)ITOxd0$O=w-;m8O(;bj7OpEFb%CzVFw zpi$`oi6uZg_Hm7nu}NB7BJR1Fpy}Whj8VSFZ-hM9_r^gbzH>BKs@zcs$vrI6CT2Ie zM`?v1n9{7D_KnM|Zm@QQ49 zxOzZxA}7S`a=FeNjO}nyYkn&mGijt(d7UWQ{2D7PlCI9Za7!t&6la8p5yo_tCX2cC zl*3S3PiWFk_sP7n<#skOxJ$Cfx8_66o|$0qP;Po&5;j|^og(TpW3t0mGW%M6#Ss2x zzGK$f+Md@q2b8SsxE-AoibW2~w|3Y>?jvmfEtpxkEv9EEXRby-v*d?@r5@CHsc9X< zB3Xbjs0s^FJvyqUmub(4rh@2heoaKi>*FBQC6!u6cr$)!M=700d&}=Y+6At1`*EjF zJ>{$j=EUu#vDr4G+^Ze2PfAX-pz7*zZH+X?7vyde0Zi`e;xrvwkTbUmYZd9-ItWz0 z)d_9;gAO1Fy0OaLh^L^|w-LrqIawm5Bg3z-+|6Wax==7(q@I}eIfyDKf^1K!B*KXM zY+_k!vntX+W&zD6qcsytA#hx1$Cjm8AgR^qsz?F+SkEiMshmN1NKfu0+4>=zuhrJ@ zEctC|%Obnc?d(tA3WF2L{=M}Y3snnhReZ>TT0|6EuIfw<`fO{k1k{8m-7MsLwJL0< ziyoe+2Y)Cl_!xV2rfkV&at|9lE4Fv1av)vqveu8fSR3`R32U0JjUM!c0O-!^iytdB W^`7>oXcPn!T;n0_uc*}#p8prN+UBSL literal 0 HcmV?d00001 diff --git a/locale/locale/he_IL.UTF-8/LC_COLLATE b/locale/locale/he_IL.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/he_IL.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/he_IL.UTF-8/LC_CTYPE b/locale/locale/he_IL.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/he_IL.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/he_IL.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/he_IL.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..d03f5cc --- /dev/null +++ b/locale/locale/he_IL.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[yY×›].* +^[nNל].* diff --git a/locale/locale/he_IL.UTF-8/LC_MONETARY b/locale/locale/he_IL.UTF-8/LC_MONETARY new file mode 100644 index 0000000..565bc6b --- /dev/null +++ b/locale/locale/he_IL.UTF-8/LC_MONETARY @@ -0,0 +1,15 @@ +ILS +שח +. +, +3;3 + +- +2 +2 +1 +1 +1 +1 +1 +1 diff --git a/locale/locale/he_IL.UTF-8/LC_NUMERIC b/locale/locale/he_IL.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..2def76c --- /dev/null +++ b/locale/locale/he_IL.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.US-ASCII/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/he_IL.UTF-8/LC_TIME b/locale/locale/he_IL.UTF-8/LC_TIME new file mode 100644 index 0000000..c257e49 --- /dev/null +++ b/locale/locale/he_IL.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +ינו +פבר +מרץ +×פר +מ××™ +יונ +יול +×וג +ספט +×וק +נוב +דצמ +ינו×ר +פברו×ר +מרץ +×פריל +מ××™ +יוני +יולי +×וגוסט +ספטמבר +×וקטובר +נובמבר +דצמבר +×' +ב' +×’' +ד' +×”' +ו' +ש' +ר×שון +שני +שלישי +רביעי +חמישי +שישי +שבת +%H:%M:%S +%d/%m/%y +%Z %H:%M:%S %Y %b %d %a +AM +PM +%a %b %e %H:%M:%S %Z %Y +ינו×ר +פברו×ר +מרץ +×פריל +מ××™ +יוני +יולי +×וגוסט +ספטמבר +×וקטובר +נובמבר +דצמבר +md +%I:%M:%S %p diff --git a/locale/locale/he_IL/LC_COLLATE b/locale/locale/he_IL/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/he_IL/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/he_IL/LC_CTYPE b/locale/locale/he_IL/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/he_IL/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/he_IL/LC_MESSAGES/LC_MESSAGES b/locale/locale/he_IL/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..d03f5cc --- /dev/null +++ b/locale/locale/he_IL/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[yY×›].* +^[nNל].* diff --git a/locale/locale/he_IL/LC_MONETARY b/locale/locale/he_IL/LC_MONETARY new file mode 100644 index 0000000..565bc6b --- /dev/null +++ b/locale/locale/he_IL/LC_MONETARY @@ -0,0 +1,15 @@ +ILS +שח +. +, +3;3 + +- +2 +2 +1 +1 +1 +1 +1 +1 diff --git a/locale/locale/he_IL/LC_NUMERIC b/locale/locale/he_IL/LC_NUMERIC new file mode 120000 index 0000000..2def76c --- /dev/null +++ b/locale/locale/he_IL/LC_NUMERIC @@ -0,0 +1 @@ +../en_US.US-ASCII/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/he_IL/LC_TIME b/locale/locale/he_IL/LC_TIME new file mode 100644 index 0000000..c257e49 --- /dev/null +++ b/locale/locale/he_IL/LC_TIME @@ -0,0 +1,58 @@ +ינו +פבר +מרץ +×פר +מ××™ +יונ +יול +×וג +ספט +×וק +נוב +דצמ +ינו×ר +פברו×ר +מרץ +×פריל +מ××™ +יוני +יולי +×וגוסט +ספטמבר +×וקטובר +נובמבר +דצמבר +×' +ב' +×’' +ד' +×”' +ו' +ש' +ר×שון +שני +שלישי +רביעי +חמישי +שישי +שבת +%H:%M:%S +%d/%m/%y +%Z %H:%M:%S %Y %b %d %a +AM +PM +%a %b %e %H:%M:%S %Z %Y +ינו×ר +פברו×ר +מרץ +×פריל +מ××™ +יוני +יולי +×וגוסט +ספטמבר +×וקטובר +נובמבר +דצמבר +md +%I:%M:%S %p diff --git a/locale/locale/hi_IN.ISCII-DEV/LC_COLLATE b/locale/locale/hi_IN.ISCII-DEV/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..db496b27e8e8fca5eee33ba52f5c10ad96456f39 GIT binary patch literal 2086 zcmY+-XSfe!0ETh@)6hhzR3cQOA*X>9Wu+oo+NIJGi4w_*28C!EEk)C4(xB2#d&wvo zXedfqg>&5Z@qFpMuHSQC*ZY2Wi|Z9P+pe6aP$(3!MWv-BC1n@?AKuDoi`bHCtJs>V zd~8FtZTN|{j~%FXj0#j0qY~9lu`^ZW*oA7>*o~@6>`t{u>`7HM_M)m5)v5N58dNo7 zAF6$0KdRcXKUJNmOLagTNOe#gOjR!qp{gInRENe5RDGi#RsR@3H85_Z8We-6Zi>UG z4v!RNP5*SKLi?Puxp&UyP<26Jx2y#r;$d#Di21#luwN;}NPy zV*=I0c#P`tc!H{N97T0>G@)u5$51^PPf*u zJKmvsH{PRqKR%$E9UoGC6dzN45}#6i7N1jn5nob$6<<@$iEpUp#yqO|v4HB^_>O8} zETZ~8exUj>exh0&OQ@E{&s4v}uT;OqGOFL>531#{g6hxsi)v;3P4!Q#qFNnmsIG|4 zR98k9s;+SrRkygBs(bXHx+bor>KWHj^@`q9*GC_!wXu%s-}sMeeQcn*Ic}l4HHJ_P ajoYYhk6~29V+7U4D4{CdtU$^zg~BG!=>zcq literal 0 HcmV?d00001 diff --git a/locale/locale/hi_IN.ISCII-DEV/LC_CTYPE b/locale/locale/hi_IN.ISCII-DEV/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..9d6c1761c45805afa4e7b17adc5a9e36e162bfde GIT binary patch literal 3164 zcmeIx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&Q+KD!_leyep5tI!aX`OAy;S?QbiB z{%=S=k6qo&Unq4G(0OYdli55x>I6IX3oZGYp)#w`kw%@qT4t!up!|QR`3M(Bojq0V zJ!QV^dWvgAt8;JEGtklQd+hI8Kjg8<#-ej`)Rkq5;tE$$T=n@2q=9h1)0W%L4H~_C z=fPIdl^nBE?6?tFTY{H>h+X+czs+FQ(T{Sm9B^k-GZ#$LVm0BB*yP>`a z>D0AZ2ZfKF!h2G7N|;X%#So!>_j-D^!3pz2fUQxszo(|=@0lV(*(bm*aTiTBF1l(; lCN7(X#+YrvJwR(zuqlmD=eg)4%)6B$H76r7>zRc#`hPttjPL*e literal 0 HcmV?d00001 diff --git a/locale/locale/hr_HR.ISO8859-2/LC_COLLATE b/locale/locale/hr_HR.ISO8859-2/LC_COLLATE new file mode 120000 index 0000000..40a06bf --- /dev/null +++ b/locale/locale/hr_HR.ISO8859-2/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/hr_HR.ISO8859-2/LC_CTYPE b/locale/locale/hr_HR.ISO8859-2/LC_CTYPE new file mode 120000 index 0000000..cc430a3 --- /dev/null +++ b/locale/locale/hr_HR.ISO8859-2/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/hr_HR.ISO8859-2/LC_MESSAGES/LC_MESSAGES b/locale/locale/hr_HR.ISO8859-2/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..8010cfd --- /dev/null +++ b/locale/locale/hr_HR.ISO8859-2/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[dDyY].* +^[nN].* diff --git a/locale/locale/hr_HR.ISO8859-2/LC_MONETARY b/locale/locale/hr_HR.ISO8859-2/LC_MONETARY new file mode 100644 index 0000000..4817063 --- /dev/null +++ b/locale/locale/hr_HR.ISO8859-2/LC_MONETARY @@ -0,0 +1,21 @@ +HRK +Kn +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 +1 +1 +2 +2 +4 +4 diff --git a/locale/locale/hr_HR.ISO8859-2/LC_NUMERIC b/locale/locale/hr_HR.ISO8859-2/LC_NUMERIC new file mode 100644 index 0000000..8c2cdd9 --- /dev/null +++ b/locale/locale/hr_HR.ISO8859-2/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +0;0 diff --git a/locale/locale/hr_HR.ISO8859-2/LC_TIME b/locale/locale/hr_HR.ISO8859-2/LC_TIME new file mode 100644 index 0000000..edb71a7 --- /dev/null +++ b/locale/locale/hr_HR.ISO8859-2/LC_TIME @@ -0,0 +1,58 @@ +Sij +Vel +O¾u +Tra +Svi +Lip +Srp +Kol +Ruj +Lis +Stu +Pro +Sijeèanj +Veljaèa +O¾ujak +Travanj +Svibanj +Lipanj +Srpanj +Kolovoz +Rujan +Listopad +Studeni +Prosinac +Ne +Po +Ut +Sr +Èe +Pe +Su +Nedjelja +Ponedjeljak +Utorak +Srijeda +Èetvrtak +Petak +Subota +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Sijeèanj +Veljaèa +O¾ujak +Travanj +Svibanj +Lipanj +Srpanj +Kolovoz +Rujan +Listopad +Studeni +Prosinac +dm +%I:%M:%S %p diff --git a/locale/locale/hr_HR.UTF-8/LC_COLLATE b/locale/locale/hr_HR.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/hr_HR.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/hr_HR.UTF-8/LC_CTYPE b/locale/locale/hr_HR.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/hr_HR.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/hr_HR.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/hr_HR.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..539b19b --- /dev/null +++ b/locale/locale/hr_HR.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../hr_HR.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/hr_HR.UTF-8/LC_MONETARY b/locale/locale/hr_HR.UTF-8/LC_MONETARY new file mode 120000 index 0000000..8998e6e --- /dev/null +++ b/locale/locale/hr_HR.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../hr_HR.ISO8859-2/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/hr_HR.UTF-8/LC_NUMERIC b/locale/locale/hr_HR.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..a27007b --- /dev/null +++ b/locale/locale/hr_HR.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../hr_HR.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/hr_HR.UTF-8/LC_TIME b/locale/locale/hr_HR.UTF-8/LC_TIME new file mode 100644 index 0000000..d61a257 --- /dev/null +++ b/locale/locale/hr_HR.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Sij +Vel +Ožu +Tra +Svi +Lip +Srp +Kol +Ruj +Lis +Stu +Pro +SijeÄanj +VeljaÄa +Ožujak +Travanj +Svibanj +Lipanj +Srpanj +Kolovoz +Rujan +Listopad +Studeni +Prosinac +Ne +Po +Ut +Sr +ÄŒe +Pe +Su +Nedjelja +Ponedjeljak +Utorak +Srijeda +ÄŒetvrtak +Petak +Subota +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +SijeÄanj +VeljaÄa +Ožujak +Travanj +Svibanj +Lipanj +Srpanj +Kolovoz +Rujan +Listopad +Studeni +Prosinac +dm +%I:%M:%S %p diff --git a/locale/locale/hr_HR/LC_COLLATE b/locale/locale/hr_HR/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/hr_HR/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/hr_HR/LC_CTYPE b/locale/locale/hr_HR/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/hr_HR/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/hr_HR/LC_MESSAGES/LC_MESSAGES b/locale/locale/hr_HR/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..539b19b --- /dev/null +++ b/locale/locale/hr_HR/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../hr_HR.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/hr_HR/LC_MONETARY b/locale/locale/hr_HR/LC_MONETARY new file mode 120000 index 0000000..8998e6e --- /dev/null +++ b/locale/locale/hr_HR/LC_MONETARY @@ -0,0 +1 @@ +../hr_HR.ISO8859-2/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/hr_HR/LC_NUMERIC b/locale/locale/hr_HR/LC_NUMERIC new file mode 120000 index 0000000..a27007b --- /dev/null +++ b/locale/locale/hr_HR/LC_NUMERIC @@ -0,0 +1 @@ +../hr_HR.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/hr_HR/LC_TIME b/locale/locale/hr_HR/LC_TIME new file mode 100644 index 0000000..d61a257 --- /dev/null +++ b/locale/locale/hr_HR/LC_TIME @@ -0,0 +1,58 @@ +Sij +Vel +Ožu +Tra +Svi +Lip +Srp +Kol +Ruj +Lis +Stu +Pro +SijeÄanj +VeljaÄa +Ožujak +Travanj +Svibanj +Lipanj +Srpanj +Kolovoz +Rujan +Listopad +Studeni +Prosinac +Ne +Po +Ut +Sr +ÄŒe +Pe +Su +Nedjelja +Ponedjeljak +Utorak +Srijeda +ÄŒetvrtak +Petak +Subota +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +SijeÄanj +VeljaÄa +Ožujak +Travanj +Svibanj +Lipanj +Srpanj +Kolovoz +Rujan +Listopad +Studeni +Prosinac +dm +%I:%M:%S %p diff --git a/locale/locale/hu_HU.ISO8859-2/LC_COLLATE b/locale/locale/hu_HU.ISO8859-2/LC_COLLATE new file mode 120000 index 0000000..40a06bf --- /dev/null +++ b/locale/locale/hu_HU.ISO8859-2/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/hu_HU.ISO8859-2/LC_CTYPE b/locale/locale/hu_HU.ISO8859-2/LC_CTYPE new file mode 120000 index 0000000..cc430a3 --- /dev/null +++ b/locale/locale/hu_HU.ISO8859-2/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/hu_HU.ISO8859-2/LC_MESSAGES/LC_MESSAGES b/locale/locale/hu_HU.ISO8859-2/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..f746712 --- /dev/null +++ b/locale/locale/hu_HU.ISO8859-2/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[iIyY].* +^[nN].* +igen +nem diff --git a/locale/locale/hu_HU.ISO8859-2/LC_MONETARY b/locale/locale/hu_HU.ISO8859-2/LC_MONETARY new file mode 100644 index 0000000..dda2eb7 --- /dev/null +++ b/locale/locale/hu_HU.ISO8859-2/LC_MONETARY @@ -0,0 +1,15 @@ +HUF +Ft +, + +3;3 + +- +2 +2 +1 +2 +1 +2 +4 +4 diff --git a/locale/locale/hu_HU.ISO8859-2/LC_NUMERIC b/locale/locale/hu_HU.ISO8859-2/LC_NUMERIC new file mode 100644 index 0000000..7485a49 --- /dev/null +++ b/locale/locale/hu_HU.ISO8859-2/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +3;3 diff --git a/locale/locale/hu_HU.ISO8859-2/LC_TIME b/locale/locale/hu_HU.ISO8859-2/LC_TIME new file mode 100644 index 0000000..bea19e2 --- /dev/null +++ b/locale/locale/hu_HU.ISO8859-2/LC_TIME @@ -0,0 +1,58 @@ +Jan +Feb +Már +Ápr +Máj +Jún +Júl +Aug +Sze +Okt +Nov +Dec +Január +Február +Március +Április +Május +Június +Július +Augusztus +Szeptember +Október +November +December +Vas +Hét +Ked +Sze +Csü +Pén +Szo +Vasárnap +Hétfõ +Kedd +Szerda +Csütörtök +Péntek +Szombat +%H:%M:%S +%Y/%m/%d +%a %b %e %X %Y +de +du +%Y %b %e %a %X %Z +Január +Február +Március +Április +Május +Június +Július +Augusztus +Szeptember +Október +November +December +md +%I:%M:%S %p diff --git a/locale/locale/hu_HU.UTF-8/LC_COLLATE b/locale/locale/hu_HU.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/hu_HU.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/hu_HU.UTF-8/LC_CTYPE b/locale/locale/hu_HU.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/hu_HU.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/hu_HU.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/hu_HU.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..234aa7d --- /dev/null +++ b/locale/locale/hu_HU.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../hu_HU.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/hu_HU.UTF-8/LC_MONETARY b/locale/locale/hu_HU.UTF-8/LC_MONETARY new file mode 120000 index 0000000..a5d8a8a --- /dev/null +++ b/locale/locale/hu_HU.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../hu_HU.ISO8859-2/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/hu_HU.UTF-8/LC_NUMERIC b/locale/locale/hu_HU.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..37c7916 --- /dev/null +++ b/locale/locale/hu_HU.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../hu_HU.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/hu_HU.UTF-8/LC_TIME b/locale/locale/hu_HU.UTF-8/LC_TIME new file mode 100644 index 0000000..3a6abc4 --- /dev/null +++ b/locale/locale/hu_HU.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Jan +Feb +Már +Ãpr +Máj +Jún +Júl +Aug +Sze +Okt +Nov +Dec +Január +Február +Március +Ãprilis +Május +Június +Július +Augusztus +Szeptember +Október +November +December +Vas +Hét +Ked +Sze +Csü +Pén +Szo +Vasárnap +HétfÅ‘ +Kedd +Szerda +Csütörtök +Péntek +Szombat +%H:%M:%S +%Y/%m/%d +%a %b %e %X %Y +de +du +%Y %b %e %a %X %Z +Január +Február +Március +Ãprilis +Május +Június +Július +Augusztus +Szeptember +Október +November +December +md +%I:%M:%S %p diff --git a/locale/locale/hu_HU/LC_COLLATE b/locale/locale/hu_HU/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/hu_HU/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/hu_HU/LC_CTYPE b/locale/locale/hu_HU/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/hu_HU/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/hu_HU/LC_MESSAGES/LC_MESSAGES b/locale/locale/hu_HU/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..234aa7d --- /dev/null +++ b/locale/locale/hu_HU/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../hu_HU.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/hu_HU/LC_MONETARY b/locale/locale/hu_HU/LC_MONETARY new file mode 120000 index 0000000..a5d8a8a --- /dev/null +++ b/locale/locale/hu_HU/LC_MONETARY @@ -0,0 +1 @@ +../hu_HU.ISO8859-2/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/hu_HU/LC_NUMERIC b/locale/locale/hu_HU/LC_NUMERIC new file mode 120000 index 0000000..37c7916 --- /dev/null +++ b/locale/locale/hu_HU/LC_NUMERIC @@ -0,0 +1 @@ +../hu_HU.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/hu_HU/LC_TIME b/locale/locale/hu_HU/LC_TIME new file mode 100644 index 0000000..3a6abc4 --- /dev/null +++ b/locale/locale/hu_HU/LC_TIME @@ -0,0 +1,58 @@ +Jan +Feb +Már +Ãpr +Máj +Jún +Júl +Aug +Sze +Okt +Nov +Dec +Január +Február +Március +Ãprilis +Május +Június +Július +Augusztus +Szeptember +Október +November +December +Vas +Hét +Ked +Sze +Csü +Pén +Szo +Vasárnap +HétfÅ‘ +Kedd +Szerda +Csütörtök +Péntek +Szombat +%H:%M:%S +%Y/%m/%d +%a %b %e %X %Y +de +du +%Y %b %e %a %X %Z +Január +Február +Március +Ãprilis +Május +Június +Július +Augusztus +Szeptember +Október +November +December +md +%I:%M:%S %p diff --git a/locale/locale/hy_AM.ARMSCII-8/LC_COLLATE b/locale/locale/hy_AM.ARMSCII-8/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..9ce29603499dc4f0671538d69c308d426d84d15f GIT binary patch literal 2130 zcmaLZRg@QX7{+mSQ9`6a8l*dxZdmDVSQl6UB^RVYxFW3JMC=83?=z=atrwNv)`v=8>qn)(4WKg622mMoL#Pb3VN{0Ow^Y8f z5mZLn_f&qcQB+3T7%F3J9F_4lfyzXiL}ju~p)%E`QJHQ(Qu)bdP?>47sLZxGROZ?| zD)Vgtm4&v5%3@nWWvMNrvfO^A@{6sYveH&jNpBgbWVB3FGFuiZSuGot?3RN{PRm6l zx8d57KU>Y3out(qv)I~ki zMjcc{Ww#QoW|6cl+F2O=9N}n)M%I{0Ih1!R&`#)#)%GiuHMW+@I$KX=gKea;$u?8j zV!u)O-Tt8Rr){OO&9+n7VLPepvcIVOZM&)LvAtCG*?uYq>>!mxc9_Z$J4)r49j9`_ z{-N@(ouqQgPE+~M&QLjP=ct^w3sf%JB`TNg3YDvNjmmYqLFK01qH^2rP`PXOsQhpD usXVZUR36!5Do^Ywm1p*x$_sl*<&_1f)I_bfzX3t4QD*bWZ-n0U-gymIwiF}) literal 0 HcmV?d00001 diff --git a/locale/locale/hy_AM.ARMSCII-8/LC_CTYPE b/locale/locale/hy_AM.ARMSCII-8/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..5d562bd8f97206281360329c62df8e8fb6dd773f GIT binary patch literal 3221 zcmeIx1#DDz9Ki9{_O32C+<okX;kpfX z_aPhZHr(0J?{E1vBn{9)fCRFaeDZy{dw0KQ|F8~Ddx)(?P-xZA@q6w7(N zNiVogvxWH<=3AI=VZMd=7Uo-+|0czo|KBr6^o#QL4m5e{b;ditS9&kxImx~HzlpmK z-1BFf3%jzQ-C%+l?(l#d=ml^1fCXpx!5;xgf}}`>c6=N}?1>qYMIJ zLsNvK8SH3|7H}W}EfI-UXbmUYpe@=V3hfb%4(NzZ=!_V2L47npLo`BTG{L)?-<4V2 z&>df)2YR9xdZQ2eq94A-H|P%*mGLbGU?2uzFuue07=ob~h9B@Fe!_5!z(|b3XpF&F zjKg?Lz(h>KWK6+SOv7~ij9)MVGcgOZF$Z%o5A(55EvDi(wSJ$}c)Hy0HsK2SWtgcdV zUEQSOwz^Bjef2LD57lEDxBl6E?p7@B)1auFNT{?^p-yFViZUak?41!wM6w%J zNr+0JBAwIyt@|JEb$y=udfxZBuII1!S5&*G@s0&~3JVL%v6d?vw zbq$Sc)s04X^`LQ`uBXvcy=nB(AR2=;l*TaKL1Uyw(J0nkH15_tG{&if#sob;<3T+{ z<6%8QW3ry0@uZ%jF;!2~cwR5icu_CWctx+%n67te%+xFzv-L5Jx%!00Jbg*yD}7C4 zz826}q{TFr=tmk$^%IR{`i;i#T0vu_R?}Fk^)&v~1{!6mM&lq=r*W`q&^SajX&kCr zG!E0@G>%Yh8b|6V8bzu@<7gd2<5(R><9OAjaf0g6I8i6jsILYz8mbYE#yXkCscKH+ zOr1farT(GOOE1&7X^TP<1I+?8cc^Eb76!XZf~=<(_)OVqwQFGCmo7g zQG)T9fcxydcA}j`pVI|2a{hiy#$)zTJHxh@9AGUpGMCAfMxi_{%n7>%jrt2 J!Ww1&$0l=^16lw8 literal 0 HcmV?d00001 diff --git a/locale/locale/is_IS.ISO8859-1/LC_CTYPE b/locale/locale/is_IS.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/is_IS.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/is_IS.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/is_IS.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..ee50286 --- /dev/null +++ b/locale/locale/is_IS.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[jJyY].* +^[nN].* diff --git a/locale/locale/is_IS.ISO8859-1/LC_MONETARY b/locale/locale/is_IS.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..6ba717c --- /dev/null +++ b/locale/locale/is_IS.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +ISK +kr +, +. +3;3 + +- +0 +0 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/is_IS.ISO8859-1/LC_NUMERIC b/locale/locale/is_IS.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..7485a49 --- /dev/null +++ b/locale/locale/is_IS.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +3;3 diff --git a/locale/locale/is_IS.ISO8859-1/LC_TIME b/locale/locale/is_IS.ISO8859-1/LC_TIME new file mode 100644 index 0000000..dc63505 --- /dev/null +++ b/locale/locale/is_IS.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +maí +jún +júl +ágú +sep +okt +nóv +des +janúar +febrúar +mars +apríl +maí +júní +júlí +ágúst +september +október +nóvember +desember +sun +mán +þri +mið +fim +fös +lau +sunnudagur +mánudagur +þriðjudagur +miðvikudagur +fimmtudagur +föstudagur +laugardagur +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +fh +eh +%a %e %b %Y %X %Z +janúar +febrúar +mars +apríl +maí +júní +júlí +ágúst +september +október +nóvember +desember +dm +%I:%M:%S %p diff --git a/locale/locale/is_IS.ISO8859-15/LC_COLLATE b/locale/locale/is_IS.ISO8859-15/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..147ffbfd8c3d4e0945316053e299fffeeee08eba GIT binary patch literal 2086 zcmY+^d6ZC70LSr}gp`WN5)zTU49XfJNhMpBkfapJnpBFUvJ}~-p=^=0s1T6~l`LtB z(%5%HWFjHTOy8fr|9Izo?)TjH?m6$hbKiMIO^aI9EXYwt^>LnV}^$Lv{dV|Is&7(123uwHjg)~aFgvL^R zNMo7GXnd@%Xnd`2Xnd>hX_V_{8Y}b*jSBrn<1hV9;~%Z1QKemJG}dl3c2^S`duUG@ zdueYP`)FSp`>837X4;=dkq)47pbnzZTrFrEtV3uVs>5g;t|Mr))R8of($O?p=@=Tv zsXdJo)s99-ji-;`DrKL(!_^xUk|;P{YiOLUel%XzzckKJH+liOqX#Bq3M$o?#yVxM zSD`D;&)tJ+n1PxXK|(a(}73_*lX=|cCZ~ppVJU}1BPLQ9d2*3H`7tL z-QH$L+dJq`+=ya~L7w+Md#@d9$I<6?7LBaG9~1Dneat>#pQL&3XE0TN(wKpn_EkH} zzHVQ$v*~Khp>r`GZ`-%*JN8{#ip6%3ecygS=iyD1;Ui?9KDD3N&+O;)51mOP>%Txb TezZT><@P69ftC1Ong6;Tf1m?S literal 0 HcmV?d00001 diff --git a/locale/locale/is_IS.ISO8859-15/LC_CTYPE b/locale/locale/is_IS.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/is_IS.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/is_IS.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/is_IS.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..f0d2e2f --- /dev/null +++ b/locale/locale/is_IS.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../is_IS.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/is_IS.ISO8859-15/LC_MONETARY b/locale/locale/is_IS.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..4e5300d --- /dev/null +++ b/locale/locale/is_IS.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../is_IS.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/is_IS.ISO8859-15/LC_NUMERIC b/locale/locale/is_IS.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..7ba7d89 --- /dev/null +++ b/locale/locale/is_IS.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../is_IS.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/is_IS.ISO8859-15/LC_TIME b/locale/locale/is_IS.ISO8859-15/LC_TIME new file mode 120000 index 0000000..00b2408 --- /dev/null +++ b/locale/locale/is_IS.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../is_IS.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/is_IS.UTF-8/LC_COLLATE b/locale/locale/is_IS.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/is_IS.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/is_IS.UTF-8/LC_CTYPE b/locale/locale/is_IS.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/is_IS.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/is_IS.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/is_IS.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..f0d2e2f --- /dev/null +++ b/locale/locale/is_IS.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../is_IS.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/is_IS.UTF-8/LC_MONETARY b/locale/locale/is_IS.UTF-8/LC_MONETARY new file mode 120000 index 0000000..4e5300d --- /dev/null +++ b/locale/locale/is_IS.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../is_IS.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/is_IS.UTF-8/LC_NUMERIC b/locale/locale/is_IS.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..7ba7d89 --- /dev/null +++ b/locale/locale/is_IS.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../is_IS.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/is_IS.UTF-8/LC_TIME b/locale/locale/is_IS.UTF-8/LC_TIME new file mode 100644 index 0000000..5a9086f --- /dev/null +++ b/locale/locale/is_IS.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +maí +jún +júl +ágú +sep +okt +nóv +des +janúar +febrúar +mars +apríl +maí +júní +júlí +ágúst +september +október +nóvember +desember +sun +mán +þri +mið +fim +fös +lau +sunnudagur +mánudagur +þriðjudagur +miðvikudagur +fimmtudagur +föstudagur +laugardagur +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +fh +eh +%a %e %b %Y %X %Z +janúar +febrúar +mars +apríl +maí +júní +júlí +ágúst +september +október +nóvember +desember +dm +%I:%M:%S %p diff --git a/locale/locale/is_IS/LC_COLLATE b/locale/locale/is_IS/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/is_IS/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/is_IS/LC_CTYPE b/locale/locale/is_IS/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/is_IS/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/is_IS/LC_MESSAGES/LC_MESSAGES b/locale/locale/is_IS/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..f0d2e2f --- /dev/null +++ b/locale/locale/is_IS/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../is_IS.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/is_IS/LC_MONETARY b/locale/locale/is_IS/LC_MONETARY new file mode 120000 index 0000000..4e5300d --- /dev/null +++ b/locale/locale/is_IS/LC_MONETARY @@ -0,0 +1 @@ +../is_IS.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/is_IS/LC_NUMERIC b/locale/locale/is_IS/LC_NUMERIC new file mode 120000 index 0000000..7ba7d89 --- /dev/null +++ b/locale/locale/is_IS/LC_NUMERIC @@ -0,0 +1 @@ +../is_IS.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/is_IS/LC_TIME b/locale/locale/is_IS/LC_TIME new file mode 100644 index 0000000..5a9086f --- /dev/null +++ b/locale/locale/is_IS/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +maí +jún +júl +ágú +sep +okt +nóv +des +janúar +febrúar +mars +apríl +maí +júní +júlí +ágúst +september +október +nóvember +desember +sun +mán +þri +mið +fim +fös +lau +sunnudagur +mánudagur +þriðjudagur +miðvikudagur +fimmtudagur +föstudagur +laugardagur +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +fh +eh +%a %e %b %Y %X %Z +janúar +febrúar +mars +apríl +maí +júní +júlí +ágúst +september +október +nóvember +desember +dm +%I:%M:%S %p diff --git a/locale/locale/it_CH.ISO8859-1/LC_COLLATE b/locale/locale/it_CH.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/it_CH.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-1/LC_CTYPE b/locale/locale/it_CH.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/it_CH.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/it_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..cafdc89 --- /dev/null +++ b/locale/locale/it_CH.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-1/LC_MONETARY b/locale/locale/it_CH.ISO8859-1/LC_MONETARY new file mode 120000 index 0000000..9a2f574 --- /dev/null +++ b/locale/locale/it_CH.ISO8859-1/LC_MONETARY @@ -0,0 +1 @@ +../de_CH.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-1/LC_NUMERIC b/locale/locale/it_CH.ISO8859-1/LC_NUMERIC new file mode 120000 index 0000000..ce771d8 --- /dev/null +++ b/locale/locale/it_CH.ISO8859-1/LC_NUMERIC @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-1/LC_TIME b/locale/locale/it_CH.ISO8859-1/LC_TIME new file mode 120000 index 0000000..5c4263b --- /dev/null +++ b/locale/locale/it_CH.ISO8859-1/LC_TIME @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-15/LC_COLLATE b/locale/locale/it_CH.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/it_CH.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-15/LC_CTYPE b/locale/locale/it_CH.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/it_CH.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/it_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..cafdc89 --- /dev/null +++ b/locale/locale/it_CH.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-15/LC_MONETARY b/locale/locale/it_CH.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..a289ce6 --- /dev/null +++ b/locale/locale/it_CH.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../it_CH.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-15/LC_NUMERIC b/locale/locale/it_CH.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..ce771d8 --- /dev/null +++ b/locale/locale/it_CH.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/it_CH.ISO8859-15/LC_TIME b/locale/locale/it_CH.ISO8859-15/LC_TIME new file mode 120000 index 0000000..5c4263b --- /dev/null +++ b/locale/locale/it_CH.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/it_CH.UTF-8/LC_COLLATE b/locale/locale/it_CH.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/it_CH.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/it_CH.UTF-8/LC_CTYPE b/locale/locale/it_CH.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/it_CH.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/it_CH.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/it_CH.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..1491b88 --- /dev/null +++ b/locale/locale/it_CH.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../it_IT.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/it_CH.UTF-8/LC_MONETARY b/locale/locale/it_CH.UTF-8/LC_MONETARY new file mode 120000 index 0000000..7b5f7cc --- /dev/null +++ b/locale/locale/it_CH.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../de_CH.UTF-8/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/it_CH.UTF-8/LC_NUMERIC b/locale/locale/it_CH.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..5d26bd6 --- /dev/null +++ b/locale/locale/it_CH.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../it_IT.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/it_CH.UTF-8/LC_TIME b/locale/locale/it_CH.UTF-8/LC_TIME new file mode 120000 index 0000000..f34a4fa --- /dev/null +++ b/locale/locale/it_CH.UTF-8/LC_TIME @@ -0,0 +1 @@ +../it_IT.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/it_CH/LC_COLLATE b/locale/locale/it_CH/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/it_CH/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/it_CH/LC_CTYPE b/locale/locale/it_CH/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/it_CH/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/it_CH/LC_MESSAGES/LC_MESSAGES b/locale/locale/it_CH/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..1491b88 --- /dev/null +++ b/locale/locale/it_CH/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../it_IT.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/it_CH/LC_MONETARY b/locale/locale/it_CH/LC_MONETARY new file mode 120000 index 0000000..7b5f7cc --- /dev/null +++ b/locale/locale/it_CH/LC_MONETARY @@ -0,0 +1 @@ +../de_CH.UTF-8/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/it_CH/LC_NUMERIC b/locale/locale/it_CH/LC_NUMERIC new file mode 120000 index 0000000..5d26bd6 --- /dev/null +++ b/locale/locale/it_CH/LC_NUMERIC @@ -0,0 +1 @@ +../it_IT.UTF-8/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/it_CH/LC_TIME b/locale/locale/it_CH/LC_TIME new file mode 120000 index 0000000..f34a4fa --- /dev/null +++ b/locale/locale/it_CH/LC_TIME @@ -0,0 +1 @@ +../it_IT.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/it_IT.ISO8859-1/LC_COLLATE b/locale/locale/it_IT.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/it_IT.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/it_IT.ISO8859-1/LC_CTYPE b/locale/locale/it_IT.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/it_IT.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..96af6ad --- /dev/null +++ b/locale/locale/it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[sSyY].* +^[nN].* diff --git a/locale/locale/it_IT.ISO8859-1/LC_MONETARY b/locale/locale/it_IT.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..06a619c --- /dev/null +++ b/locale/locale/it_IT.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +EUR +Eu +, +. +3;3 + +- +2 +2 +1 +1 +1 +1 +1 +1 diff --git a/locale/locale/it_IT.ISO8859-1/LC_NUMERIC b/locale/locale/it_IT.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..cfdbb1f --- /dev/null +++ b/locale/locale/it_IT.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +, +. +0;0 diff --git a/locale/locale/it_IT.ISO8859-1/LC_TIME b/locale/locale/it_IT.ISO8859-1/LC_TIME new file mode 100644 index 0000000..5dca45f --- /dev/null +++ b/locale/locale/it_IT.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +Gen +Feb +Mar +Apr +Mag +Giu +Lug +Ago +Set +Ott +Nov +Dic +Gennaio +Febbraio +Marzo +Aprile +Maggio +Giugno +Luglio +Agosto +Settembre +Ottobre +Novembre +Dicembre +Dom +Lun +Mar +Mer +Gio +Ven +Sab +Domenica +Lunedì +Martedì +Mercoledì +Giovedì +Venerdì +Sabato +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Gennaio +Febbraio +Marzo +Aprile +Maggio +Giugno +Luglio +Agosto +Settembre +Ottobre +Novembre +Dicembre +dm +%I:%M:%S %p diff --git a/locale/locale/it_IT.ISO8859-15/LC_COLLATE b/locale/locale/it_IT.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/it_IT.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/it_IT.ISO8859-15/LC_CTYPE b/locale/locale/it_IT.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/it_IT.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/it_IT.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/it_IT.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..cafdc89 --- /dev/null +++ b/locale/locale/it_IT.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/it_IT.ISO8859-15/LC_MONETARY b/locale/locale/it_IT.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..2766405 --- /dev/null +++ b/locale/locale/it_IT.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/it_IT.ISO8859-15/LC_NUMERIC b/locale/locale/it_IT.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..ce771d8 --- /dev/null +++ b/locale/locale/it_IT.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/it_IT.ISO8859-15/LC_TIME b/locale/locale/it_IT.ISO8859-15/LC_TIME new file mode 120000 index 0000000..5c4263b --- /dev/null +++ b/locale/locale/it_IT.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/it_IT.UTF-8/LC_COLLATE b/locale/locale/it_IT.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/it_IT.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/it_IT.UTF-8/LC_CTYPE b/locale/locale/it_IT.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/it_IT.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/it_IT.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/it_IT.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..cafdc89 --- /dev/null +++ b/locale/locale/it_IT.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/it_IT.UTF-8/LC_MONETARY b/locale/locale/it_IT.UTF-8/LC_MONETARY new file mode 120000 index 0000000..2766405 --- /dev/null +++ b/locale/locale/it_IT.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/it_IT.UTF-8/LC_NUMERIC b/locale/locale/it_IT.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..ce771d8 --- /dev/null +++ b/locale/locale/it_IT.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/it_IT.UTF-8/LC_TIME b/locale/locale/it_IT.UTF-8/LC_TIME new file mode 100644 index 0000000..7b98516 --- /dev/null +++ b/locale/locale/it_IT.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Gen +Feb +Mar +Apr +Mag +Giu +Lug +Ago +Set +Ott +Nov +Dic +Gennaio +Febbraio +Marzo +Aprile +Maggio +Giugno +Luglio +Agosto +Settembre +Ottobre +Novembre +Dicembre +Dom +Lun +Mar +Mer +Gio +Ven +Sab +Domenica +Lunedì +Martedì +Mercoledì +Giovedì +Venerdì +Sabato +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Gennaio +Febbraio +Marzo +Aprile +Maggio +Giugno +Luglio +Agosto +Settembre +Ottobre +Novembre +Dicembre +dm +%I:%M:%S %p diff --git a/locale/locale/it_IT/LC_COLLATE b/locale/locale/it_IT/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/it_IT/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/it_IT/LC_CTYPE b/locale/locale/it_IT/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/it_IT/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/it_IT/LC_MESSAGES/LC_MESSAGES b/locale/locale/it_IT/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..cafdc89 --- /dev/null +++ b/locale/locale/it_IT/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../it_IT.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/it_IT/LC_MONETARY b/locale/locale/it_IT/LC_MONETARY new file mode 120000 index 0000000..2766405 --- /dev/null +++ b/locale/locale/it_IT/LC_MONETARY @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/it_IT/LC_NUMERIC b/locale/locale/it_IT/LC_NUMERIC new file mode 120000 index 0000000..ce771d8 --- /dev/null +++ b/locale/locale/it_IT/LC_NUMERIC @@ -0,0 +1 @@ +../it_IT.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/it_IT/LC_TIME b/locale/locale/it_IT/LC_TIME new file mode 100644 index 0000000..7b98516 --- /dev/null +++ b/locale/locale/it_IT/LC_TIME @@ -0,0 +1,58 @@ +Gen +Feb +Mar +Apr +Mag +Giu +Lug +Ago +Set +Ott +Nov +Dic +Gennaio +Febbraio +Marzo +Aprile +Maggio +Giugno +Luglio +Agosto +Settembre +Ottobre +Novembre +Dicembre +Dom +Lun +Mar +Mer +Gio +Ven +Sab +Domenica +Lunedì +Martedì +Mercoledì +Giovedì +Venerdì +Sabato +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Gennaio +Febbraio +Marzo +Aprile +Maggio +Giugno +Luglio +Agosto +Settembre +Ottobre +Novembre +Dicembre +dm +%I:%M:%S %p diff --git a/locale/locale/ja/LC_MESSAGES/texinfo.mo b/locale/locale/ja/LC_MESSAGES/texinfo.mo new file mode 100644 index 0000000000000000000000000000000000000000..ff3f98bcc5ea08daa24007b3788db6a840df6a74 GIT binary patch literal 46062 zcmd_Td3;?})&GASK&+sEs3?P{Ky3<5DT54UDwF~R+9E9|ljJtJZ7)r7V{SsJ2!cM3 z!y`EB^QbtaJwc>_hSJic^F-P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q)R4Za7)hhi97kdNo literal 0 HcmV?d00001 diff --git a/locale/locale/kk_KZ.PT154/LC_CTYPE b/locale/locale/kk_KZ.PT154/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..1284f9f57de76a61e59ae643311bc010ba4f717f GIT binary patch literal 3218 zcmd_qcW@MC7zf}@au-?vyPoyz9Yp~fVu)fVAjS%oON=B^)Fh}B1;rLS_AXZJy;tnL z_l~{y-hDpVomn%)I1WSpaA%%*cW=M<`|Zxodqc*It{qqy-oJ8C<$&m4AH`O-p}4}D zmfGlPYtQ6t!dNoH~{=}l)P&ycK5*Ca3L3)k%>{mkufKJ$N~DE<>DQ8Q#Ir2`%5L}$8S z;G(W{qdRjkH}fzr^D#dQupkTJ#iE5-ghg45#aV(pOR^M8vkc3!9LwWFMk}%sE3*o# z(u37lot~`0n)ISKeOQaNS%-C5kG`x=KQ^G80@c*88@24taO$XM4@NMOQH*9!_F``u zXrzfT?8Cn7$5_TOlws_|&g{aj%&GkGvL>)U2QZQ2n9LP%Jy<=2(=Zg#sc}7BJ%ckj zi?cb0&_9LaIe`;7iIX{n&>!|{t$(U}=f!SUZ{T{aVH!7c3Ab_?mlK}#O77xn!rJR% zp*QStBR3KHZz1&GM##7`7W!xK7H{(o@A4k+^8p|75g+pjpYj=>^95h>6<_lW-|`*b z^8-Kf6F>6{zw#Tu^9M6%&wTMw5yg~{A;EUQ)q4eLx0$-wf?E@of|t}y?_h3h-q9*nEy*j=07}ZnE$H?^B>k;8wtLmw1_1 zc$L?9oi})s>9l9Q_*RcT$({VnV{lc^-o5fQb%lmPO;c?{zOl9`Up+QoQQy#5m#@nA Stqv#UqYCvSdyE*@FZvU&&sA9f literal 0 HcmV?d00001 diff --git a/locale/locale/kk_KZ.PT154/LC_MESSAGES/LC_MESSAGES b/locale/locale/kk_KZ.PT154/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..c16a8ea --- /dev/null +++ b/locale/locale/kk_KZ.PT154/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[èÈyY].* +^[æÆnN].* +èÿ +æîê diff --git a/locale/locale/kk_KZ.PT154/LC_MONETARY b/locale/locale/kk_KZ.PT154/LC_MONETARY new file mode 100644 index 0000000..1574f00 --- /dev/null +++ b/locale/locale/kk_KZ.PT154/LC_MONETARY @@ -0,0 +1,15 @@ +KZT +òã. +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/kk_KZ.PT154/LC_NUMERIC b/locale/locale/kk_KZ.PT154/LC_NUMERIC new file mode 100644 index 0000000..7485a49 --- /dev/null +++ b/locale/locale/kk_KZ.PT154/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +3;3 diff --git a/locale/locale/kk_KZ.PT154/LC_TIME b/locale/locale/kk_KZ.PT154/LC_TIME new file mode 100644 index 0000000..77b58e6 --- /dev/null +++ b/locale/locale/kk_KZ.PT154/LC_TIME @@ -0,0 +1,58 @@ +àœ +àï +íàó +ñºó +ìàì +ìàó +ø³ë +òàì +ûð +àç +àð +æåë +àœòàð +àïàí +íàóðûç +ñºó³ð +ìàìûð +ìàóñûì +ø³ëäå +òàìûç +ûðê‰éåê +àçàí +àðàøà +æåëòîñàí +æê +äñ +ññ +ñð +áñ +æì +ñí +æåêñåíá³ +ä‰éñåíá³ +ñåéñåíá³ +ñºðñåíá³ +áåéñåíá³ +æ±ìà +ñåíá³ +%H:%M:%S +%d.%m.%Y +%A, %e %B %Y æ. %X + + +%A, %e %B %Y æ. %X (%Z) +àíòàð +àïàí +íàóðûç +ñºó³ð +ìàìûð +ìàóñûì +ø³ëäå +òàìûç +ûðê‰éåê +àçàí +àðàøà +æåëòîñàí +dm + diff --git a/locale/locale/kk_KZ.UTF-8/LC_COLLATE b/locale/locale/kk_KZ.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/kk_KZ.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/kk_KZ.UTF-8/LC_CTYPE b/locale/locale/kk_KZ.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/kk_KZ.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/kk_KZ.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/kk_KZ.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..9956d45 --- /dev/null +++ b/locale/locale/kk_KZ.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[иИyY].* +^[жЖnN].* +Ð¸Ñ +жок diff --git a/locale/locale/kk_KZ.UTF-8/LC_MONETARY b/locale/locale/kk_KZ.UTF-8/LC_MONETARY new file mode 100644 index 0000000..bd7f68e --- /dev/null +++ b/locale/locale/kk_KZ.UTF-8/LC_MONETARY @@ -0,0 +1,15 @@ +KZT +тг. +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/kk_KZ.UTF-8/LC_NUMERIC b/locale/locale/kk_KZ.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..e0c1bcb --- /dev/null +++ b/locale/locale/kk_KZ.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../kk_KZ.PT154/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/kk_KZ.UTF-8/LC_TIME b/locale/locale/kk_KZ.UTF-8/LC_TIME new file mode 100644 index 0000000..c3aa791 --- /dev/null +++ b/locale/locale/kk_KZ.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +қаң +ақп +нау +Ñәу +мам +мау +шіл +там +қыр +қаз +қар +жел +қаңтар +ақпан +наурыз +Ñәуір +мамыр +мауÑым +шілде +тамыз +қыркүйек +қазан +қараша +желтоқÑан +жк +Ð´Ñ +ÑÑ +ÑÑ€ +Ð±Ñ +жм +Ñн +жекÑенбі +дүйÑенбі +ÑейÑенбі +ÑәрÑенбі +бейÑенбі +жұма +Ñенбі +%H:%M:%S +%d.%m.%Y +%A, %e %B %Y ж. %X + + +%A, %e %B %Y ж. %X (%Z) +қантар +ақпан +наурыз +Ñәуір +мамыр +мауÑым +шілде +тамыз +қыркүйек +қазан +қараша +желтоқÑан +dm + diff --git a/locale/locale/kk_KZ/LC_COLLATE b/locale/locale/kk_KZ/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/kk_KZ/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/kk_KZ/LC_CTYPE b/locale/locale/kk_KZ/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/kk_KZ/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/kk_KZ/LC_MESSAGES/LC_MESSAGES b/locale/locale/kk_KZ/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..9956d45 --- /dev/null +++ b/locale/locale/kk_KZ/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[иИyY].* +^[жЖnN].* +Ð¸Ñ +жок diff --git a/locale/locale/kk_KZ/LC_MONETARY b/locale/locale/kk_KZ/LC_MONETARY new file mode 100644 index 0000000..bd7f68e --- /dev/null +++ b/locale/locale/kk_KZ/LC_MONETARY @@ -0,0 +1,15 @@ +KZT +тг. +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/kk_KZ/LC_NUMERIC b/locale/locale/kk_KZ/LC_NUMERIC new file mode 120000 index 0000000..e0c1bcb --- /dev/null +++ b/locale/locale/kk_KZ/LC_NUMERIC @@ -0,0 +1 @@ +../kk_KZ.PT154/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/kk_KZ/LC_TIME b/locale/locale/kk_KZ/LC_TIME new file mode 100644 index 0000000..c3aa791 --- /dev/null +++ b/locale/locale/kk_KZ/LC_TIME @@ -0,0 +1,58 @@ +қаң +ақп +нау +Ñәу +мам +мау +шіл +там +қыр +қаз +қар +жел +қаңтар +ақпан +наурыз +Ñәуір +мамыр +мауÑым +шілде +тамыз +қыркүйек +қазан +қараша +желтоқÑан +жк +Ð´Ñ +ÑÑ +ÑÑ€ +Ð±Ñ +жм +Ñн +жекÑенбі +дүйÑенбі +ÑейÑенбі +ÑәрÑенбі +бейÑенбі +жұма +Ñенбі +%H:%M:%S +%d.%m.%Y +%A, %e %B %Y ж. %X + + +%A, %e %B %Y ж. %X (%Z) +қантар +ақпан +наурыз +Ñәуір +мамыр +мауÑым +шілде +тамыз +қыркүйек +қазан +қараша +желтоқÑан +dm + diff --git a/locale/locale/ko_KR.CP949/LC_COLLATE b/locale/locale/ko_KR.CP949/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/ko_KR.CP949/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/ko_KR.CP949/LC_CTYPE b/locale/locale/ko_KR.CP949/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..63922d67a8a7e9591555f4563b19048a53d558dd GIT binary patch literal 134508 zcmeI51&~}-7KS^?OfqpKKpK|-!7aFjtgyQ*E37ZRyDY1$vW5+w;O-WNK?ipyxVw9B zclYllnW>Pvhk41oKKIt%zpK9L>67mFpL5>--$`bwV1uo<+G739w_Io4G3(XJKYH`l zZsi*MRI4=)>IJ=_4>UnD^o4%V0{y>Iqj}tbTJyMp zFbD?25Exo(8b@DMV$9iGN577K9sN4`b@c1#*U_(%Y4j)EgYr(%JO6Jt(2L26K=*+r zXokMf4_cr<41j?^;A(?m2n>apU}l&FW`$ue8_W)Kz;M9CwK-ufm>cGSd0{@79~OWG zVIdd+3&SF?C}7&!Vz4+Y0ZYPCurw?K%ffQ7JgfktU`1F7R)$qzRagyHhc#eLSPRyM z(Xcu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7CG<&G>risqHYwI2~QgiBS$JU>^7kyn_=B-^?_gnQZp9R+bs;*mmuUf~t zUTl4{uSWjvt?adX@^j@z{_d{qwR_Tk=AX5ES#>>j{$lG}`?UH}{mb8{w2#K@!}4X- zb?g3Btz%s;w*K_?W%a9iV{(w|UM*i%UAOjIwT^YY*!t7km({Q8%72v}uzXo{-Rik& z9qW3r^{u{CZ~V^!Lp!$okXt>pn?}^Ey*5HCbj{fMp`KKWll@}vmLGDfdwI~>YcBd; zb4sV&nPT}dx4M^Kti9%6tHK%lxe=BRDx|d%<+C?oFeXlvCQ_fSCA9JgF`Ni66F8W?` zN=Ny(vKFd)`6Z-X)N;}Hno~OEJZ1SYx4M^Kti9%l>zcX3Y{&k&lx$oSQyxF}swWG%G zsMC*np1%C{bYJpz`)9w{xjd>Jq~HPNU-?hLhw35Dd8qs=|H@vR?4_`GLJbLJbLJb< zr2H%Y%3hr8rLcG9U-?hLhw35D8KnFx|H@vR?4_`GLJbLJbLJb}l`$?!8v4wF>P(9>~@MUjR*h+|vL6 literal 0 HcmV?d00001 diff --git a/locale/locale/ko_KR.CP949/LC_MESSAGES/LC_MESSAGES b/locale/locale/ko_KR.CP949/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..71e6cbb --- /dev/null +++ b/locale/locale/ko_KR.CP949/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../ko_KR.eucKR/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/ko_KR.CP949/LC_MONETARY b/locale/locale/ko_KR.CP949/LC_MONETARY new file mode 120000 index 0000000..29a6be3 --- /dev/null +++ b/locale/locale/ko_KR.CP949/LC_MONETARY @@ -0,0 +1 @@ +../ko_KR.eucKR/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/ko_KR.CP949/LC_NUMERIC b/locale/locale/ko_KR.CP949/LC_NUMERIC new file mode 120000 index 0000000..cef8b5d --- /dev/null +++ b/locale/locale/ko_KR.CP949/LC_NUMERIC @@ -0,0 +1 @@ +../ko_KR.eucKR/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/ko_KR.CP949/LC_TIME b/locale/locale/ko_KR.CP949/LC_TIME new file mode 120000 index 0000000..26b933c --- /dev/null +++ b/locale/locale/ko_KR.CP949/LC_TIME @@ -0,0 +1 @@ +../ko_KR.eucKR/LC_TIME \ No newline at end of file diff --git a/locale/locale/ko_KR.UTF-8/LC_COLLATE b/locale/locale/ko_KR.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/ko_KR.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/ko_KR.UTF-8/LC_CTYPE b/locale/locale/ko_KR.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/ko_KR.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/ko_KR.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/ko_KR.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..71e6cbb --- /dev/null +++ b/locale/locale/ko_KR.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../ko_KR.eucKR/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/ko_KR.UTF-8/LC_MONETARY b/locale/locale/ko_KR.UTF-8/LC_MONETARY new file mode 100644 index 0000000..cd34868 --- /dev/null +++ b/locale/locale/ko_KR.UTF-8/LC_MONETARY @@ -0,0 +1,15 @@ +KRW +â‚© +. +, +3;3 + +- +0 +0 +1 +0 +1 +0 +1 +4 diff --git a/locale/locale/ko_KR.UTF-8/LC_NUMERIC b/locale/locale/ko_KR.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..cef8b5d --- /dev/null +++ b/locale/locale/ko_KR.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../ko_KR.eucKR/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/ko_KR.UTF-8/LC_TIME b/locale/locale/ko_KR.UTF-8/LC_TIME new file mode 100644 index 0000000..f4cad2d --- /dev/null +++ b/locale/locale/ko_KR.UTF-8/LC_TIME @@ -0,0 +1,58 @@ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +1ì›” +2ì›” +3ì›” +4ì›” +5ì›” +6ì›” +7ì›” +8ì›” +9ì›” +10ì›” +11ì›” +12ì›” +ì¼ +ì›” +í™” +수 +목 +금 +토 +ì¼ìš”ì¼ +ì›”ìš”ì¼ +í™”ìš”ì¼ +ìˆ˜ìš”ì¼ +ëª©ìš”ì¼ +ê¸ˆìš”ì¼ +í† ìš”ì¼ +%Hì‹œ %M분 %Sì´ˆ +%Y/%m/%d +%a %b/%e %H:%M:%S %Y +AM +PM +%Yë…„ %B %eì¼ %A %X %Z +1ì›” +2ì›” +3ì›” +4ì›” +5ì›” +6ì›” +7ì›” +8ì›” +9ì›” +10ì›” +11ì›” +12ì›” +md +%I:%M:%S %p diff --git a/locale/locale/ko_KR.eucKR/LC_COLLATE b/locale/locale/ko_KR.eucKR/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/ko_KR.eucKR/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/ko_KR.eucKR/LC_CTYPE b/locale/locale/ko_KR.eucKR/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..a8702979320c4a8c774c5c18e23f194a1b5d27b9 GIT binary patch literal 99027 zcmeI%2Xquw6vpvMm<<5}2%-={4N}Agp@;|~P3#rL4r0OH6)TDq>Afjni!lfi5bOm| zQE7^mrUHtJonjYM@V_K4ayTQ&QD&Xwe#`ltmz_;^X5YQv1tuN3UETGB^Dk-BzGFMD z=#ON+wGhc|`JU|+@-v0Kr+Yo6wdeWu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+;Do|FH2 ze9hrn-1FQlO3C-+#`lg#e9h%^xaZl_HJiG{&l7(XoG<@*!TY=CtMlJK|9QdtXXX8T z!TaYuPidX_e{bpExY~2|fO;URJ>WAbMSEbP2kKGhe`{+_lE_LjN+JFyh7^=WDt3I& z(dV9{&pk(zMKdayW zsRz^p>H+nDdO$s(9#9Xc2h;=V0rfxvdSKgoR{A=edx1gwTIBm13FrY`i`{#bLA|MC z;m-kO&Ti(SRC{GT{HzDlyr2XrlVXHigZ>R9+QL7B6gxhU0M zSr0$!L3H%Gg-B}dWn>rT$Oip^=Qr5@0=Xcnml)C1}Pdp(er>Uom*Jy6!{Wi5&|SN0R1{rH|o zu@`hr_UfYiEC0&9z1+K+EC0&B>jka$=793A{44kNa_?%c{44*i7qr@&1IoYhuiV?q zy{ozMul&1S&}wfEDF4d8a&Is9uI9?W^6z>|4yI#<0Zw@H`%D-}NFZZtI%D?jOdO@qbIiUP2|H{3++`F19|H{AX1+Dhxfby^W zEBE$t?`p36EB~$+wAz~k%D?ij+}q2&tGV*8{JUPzYHtoG|H{8|Z!h<*=E}eF?|MP2 zy*Z%#EC0&9z1+K+EC0&B>jka$=793A{44kNa_?%c{44*i7qr@&1IoYhuiV?qy{ozM zul&1S&}wfEDF4d8a&Is9uI9?W^6z>tYM;>BXYgp4k$FodkBmlq(JZrB-WQqiFB)$>!b^EC Gcz*%RHy{)M literal 0 HcmV?d00001 diff --git a/locale/locale/ko_KR.eucKR/LC_MESSAGES/LC_MESSAGES b/locale/locale/ko_KR.eucKR/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..96af6ad --- /dev/null +++ b/locale/locale/ko_KR.eucKR/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[sSyY].* +^[nN].* diff --git a/locale/locale/ko_KR.eucKR/LC_MONETARY b/locale/locale/ko_KR.eucKR/LC_MONETARY new file mode 100644 index 0000000..ceaa584 --- /dev/null +++ b/locale/locale/ko_KR.eucKR/LC_MONETARY @@ -0,0 +1,15 @@ +KRW +\ +. +, +3;3 + +- +0 +0 +1 +0 +1 +0 +1 +4 diff --git a/locale/locale/ko_KR.eucKR/LC_NUMERIC b/locale/locale/ko_KR.eucKR/LC_NUMERIC new file mode 100644 index 0000000..5b1be07 --- /dev/null +++ b/locale/locale/ko_KR.eucKR/LC_NUMERIC @@ -0,0 +1,3 @@ +. +, +3;3 diff --git a/locale/locale/ko_KR.eucKR/LC_TIME b/locale/locale/ko_KR.eucKR/LC_TIME new file mode 100644 index 0000000..d3b1d9d --- /dev/null +++ b/locale/locale/ko_KR.eucKR/LC_TIME @@ -0,0 +1,58 @@ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +1¿ù +2¿ù +3¿ù +4¿ù +5¿ù +6¿ù +7¿ù +8¿ù +9¿ù +10¿ù +11¿ù +12¿ù +ÀÏ +¿ù +È­ +¼ö +¸ñ +±Ý +Åä +ÀÏ¿äÀÏ +¿ù¿äÀÏ +È­¿äÀÏ +¼ö¿äÀÏ +¸ñ¿äÀÏ +±Ý¿äÀÏ +Åä¿äÀÏ +%H½Ã %MºÐ %SÃÊ +%Y/%m/%d +%a %b/%e %H:%M:%S %Y +AM +PM +%Y³â %B %eÀÏ %A %X %Z +1¿ù +2¿ù +3¿ù +4¿ù +5¿ù +6¿ù +7¿ù +8¿ù +9¿ù +10¿ù +11¿ù +12¿ù +md +%I:%M:%S %p diff --git a/locale/locale/ko_KR/LC_COLLATE b/locale/locale/ko_KR/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/ko_KR/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/ko_KR/LC_CTYPE b/locale/locale/ko_KR/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/ko_KR/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/ko_KR/LC_MESSAGES/LC_MESSAGES b/locale/locale/ko_KR/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..71e6cbb --- /dev/null +++ b/locale/locale/ko_KR/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../ko_KR.eucKR/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/ko_KR/LC_MONETARY b/locale/locale/ko_KR/LC_MONETARY new file mode 100644 index 0000000..cd34868 --- /dev/null +++ b/locale/locale/ko_KR/LC_MONETARY @@ -0,0 +1,15 @@ +KRW +â‚© +. +, +3;3 + +- +0 +0 +1 +0 +1 +0 +1 +4 diff --git a/locale/locale/ko_KR/LC_NUMERIC b/locale/locale/ko_KR/LC_NUMERIC new file mode 120000 index 0000000..cef8b5d --- /dev/null +++ b/locale/locale/ko_KR/LC_NUMERIC @@ -0,0 +1 @@ +../ko_KR.eucKR/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/ko_KR/LC_TIME b/locale/locale/ko_KR/LC_TIME new file mode 100644 index 0000000..f4cad2d --- /dev/null +++ b/locale/locale/ko_KR/LC_TIME @@ -0,0 +1,58 @@ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +1ì›” +2ì›” +3ì›” +4ì›” +5ì›” +6ì›” +7ì›” +8ì›” +9ì›” +10ì›” +11ì›” +12ì›” +ì¼ +ì›” +í™” +수 +목 +금 +토 +ì¼ìš”ì¼ +ì›”ìš”ì¼ +í™”ìš”ì¼ +ìˆ˜ìš”ì¼ +ëª©ìš”ì¼ +ê¸ˆìš”ì¼ +í† ìš”ì¼ +%Hì‹œ %M분 %Sì´ˆ +%Y/%m/%d +%a %b/%e %H:%M:%S %Y +AM +PM +%Yë…„ %B %eì¼ %A %X %Z +1ì›” +2ì›” +3ì›” +4ì›” +5ì›” +6ì›” +7ì›” +8ì›” +9ì›” +10ì›” +11ì›” +12ì›” +md +%I:%M:%S %p diff --git a/locale/locale/la_LN.ISO8859-1/LC_COLLATE b/locale/locale/la_LN.ISO8859-1/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..0adc341f2891e2db6bfad895494f0e6926bfed76 GIT binary patch literal 2086 zcmY+^X_U}Y9Eb6l7HyVF5?P`}kupeGGZ7V{gbI<2v4pZyA%?L;wvs|=jq9SYA zC4@>^>`RNx^nCTa@jvHtpL6g3o^#**irN$v*DlCcSXfwvwMu1WMa6#y|6ll55LH!; zMs;mMqlRkIsHHp-b+jps&9pgqf_t{rs^*m)A5>p)y}YQ*w^h$JB!Z2o0yAt z?A!KT`yS0)_{e@}KenIHKeT{;iG}#uer3P0-`YjAw{rhGEW>j9qg`QF(#(fn@u#x? FZ36%f13~}* literal 0 HcmV?d00001 diff --git a/locale/locale/la_LN.ISO8859-1/LC_CTYPE b/locale/locale/la_LN.ISO8859-1/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..637df66d3323f7b73f1ed96563007297b79fded1 GIT binary patch literal 3204 zcmc)K1#lHd90%YRc?pC-aCm5NcS~?+X-kW=P)Adm0u|bZP{Wbgd5TTDGNEFdzAuBOt!v`10P7dP8NiK4ehrHw?KLsd=z(64iQ-q=vqd4)D zpd_UzO&Q8k4mS~~Kt(E1nJQGJ8r7*mO=?k_I@F~e2_#aV1~jA*jcGztlDL6x+(BC*z%{|=9eRQBBo#;##x^lkq`^xG^e+Dp+K@4UH zLm9?!Mlh05cxeNp8N*n{F`fxbWD=8^!c?X)of*tz7PFbdT;?&K1uSF{i&?@_ma&`_ ztYj6dS;Jb^v7QZVWD}d&!dAAiogM6C7rWWRUiPt{103NU-sL^s=L0_EBR=L6KIJn$ z=L^2%E57C%zU4c<=Lde|5I^xVzwj%+@jHKTm?NC4{G)1Tlz+_p@fJon5kwLsifFQs zl^C)SOLlS)M^18)n>^$tANeUjK|&OwFhwXzF^UsU2})9m(v+br zs7?)PQj6Nup)U1EAd&hspdpQDOcR>YjOJXxg|y%zF6I(iaw(V5iq^EDEthiz?P$-H zT*cK~!?j$;^>m;ko#;##x^lkq`^xG^e+Dp+K@4UHLm9?!Mlh05q%oQ?jAb0-nZQIQ zF_|e$Wg63&!Axc`n>oy79`jkiLKd-@B`jqb%UQunR<{6&lIiBYQUgRZS<`oX{DzEW6 zZ}28>@ivD!$hpcts&+>C$INHc%AcH!KhavYZyTSGP$#iUjrdkcsXcq?yY)y)N$QrG LoD$zVIW_PnvE@RI literal 0 HcmV?d00001 diff --git a/locale/locale/la_LN.ISO8859-1/LC_TIME b/locale/locale/la_LN.ISO8859-1/LC_TIME new file mode 100644 index 0000000..1b43d23 --- /dev/null +++ b/locale/locale/la_LN.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +Ian +Feb +Mar +Apr +Mai +Iun +Iul +Aug +Sep +Oct +Nov +Dec +Ianuarius +Februarius +Martius +Aprilis +Maius +Iunius +Iulius +Augustus +September +October +November +December +Sol +Lun +Mar +Mer +Iov +Ven +Sat +dies Solis +dies Lunae +dies Martis +dies Mercurii +dies Iovis +dies Veneris +dies Saturni +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Ianuarius +Februarius +Martius +Aprilis +Maius +Iunius +Iulius +Augustus +September +October +November +December +dm +%I:%M:%S %p diff --git a/locale/locale/la_LN.ISO8859-15/LC_COLLATE b/locale/locale/la_LN.ISO8859-15/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..6ce1ff04b2f73290f4981f6d81f74b50b4b7b3ed GIT binary patch literal 2086 zcmY+^ceqev0LSrrBQu4pN~Nqa;?lC>Dw(B>kdY*_L`fnQw;c+}Y)DxpJ7kq;$+cZY zNT_HSk$G?5pT7S%&+|Fo=RN0ro^#IgzRxLYR8+i8L5{-0!b+SgRaBIh|99d4C+-!* zX4;%aWod>gGJ!sTZOB$`zn#PGbg~q9BN29$?qj9>eLxqjA12pwUU4X>?In8kgu& z8kgyE8dvB_8r{^L##QP;<7!<;qmKsA7^qullxP@@;Tl0>q(;-YL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e-u#rt{W(!-{#&&kFlY7|3ZuUg`d)0mH=f0>1)B_ykK_22^9^p|Q<8hwgNuJ_q zp5a-Z<9S}-MPA}%Ug1?<;}Ea&25<5fZ}SfCa+rghuKc6c&MrT42HCZmvBB`M*1l`! ka7s#YYEpybaEG*v{sWRy!+rXt4NU8kkv=dyC_N+a4+#52A^-pY literal 0 HcmV?d00001 diff --git a/locale/locale/la_LN.ISO8859-15/LC_TIME b/locale/locale/la_LN.ISO8859-15/LC_TIME new file mode 120000 index 0000000..58b846c --- /dev/null +++ b/locale/locale/la_LN.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/la_LN.ISO8859-2/LC_COLLATE b/locale/locale/la_LN.ISO8859-2/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..03fce4e198348707d78b29648585a4d221883270 GIT binary patch literal 2086 zcmY+^dwk7x9LMn;-TqFbZ?OrWP{y zTkf~U$hBgOE>^pky(oX6w&dp*A2^T+vJKIaz_91@y0NS{C;kd0%u%*>38td08* zd>16yEeDkcEGLy*mYYf*(~ro5mXAt)D?sHTdzi{2R**^|dz8v!R+vf=dz?y9D@LWb zm7wy3JxQgcm7?;L)u+(x1C=+eBbB%8Z7QAY z9V(rz3ze?cjY@axLFHZRNu`(drqajWqY`HCQwg_WR3dB)m9aLCN~C>E0qXu(t}SVbx!R*6bwt3su!RijefYEY?ZwWz#gFH@;)uTZID zb*Y3}Jt|=sh;J>5eu_q>^?1bL3-qienj<7`M@1cqcPF_oW@|1JK3G;PN8j0=RXti_}ZQ8e&f!g z30MR@mpRb=x&r;zE+P>>xa-{?-3?Ut{{)h-#og>~r8}|9-Q(_d_fowd4!VcvHf(oy q&}5u+Ptg>dcF(wH-Ct-M)A?UQ8vbyvyMMYjXgdCZ=HeROkpBVaS_4A> literal 0 HcmV?d00001 diff --git a/locale/locale/la_LN.ISO8859-2/LC_CTYPE b/locale/locale/la_LN.ISO8859-2/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..562a4d0d34a49ae325bb5661bcf3e354dacad188 GIT binary patch literal 3204 zcmc)J2XK@{7zW@=$b}>XLWiS<9(oOgUKACDM8Qst7y(OE2sU~r^xm6@f(1oH!GdD% zy?*%(PCv!758BH7qaA%&`Z+7q7_b>PN9i5xgCwo};%&g3wfqy+>{jvzLJ^ZGi zB6^BCGqNAwEf9!H`|pCufj}@hhFFRbN04}mlR#pj8NvLdKrp`q$&{oNDS^0r*L67k z!+i!r@(QDD?9_~7vQ`ni&*K{Q6===P;^X(rRF{bbbU5q$_#8aFE5=o*2KDaQSEtgfFrojc800n$nEsw4f!eXiXc^ zX-hjYXio<^(uvM=p)1|U<{XA{E;*dXForXN^SOWvxrkgY<`OPtB%{b0vz>n~0gv?GJ|bf6=h=u8*7(v9x);24gj zC&zI-C(w%%If>r%A(Jdl<`nwUk5f5~(>a4PIg7LD&j1E8h`|iuXyuQQHI{LVX95$M z#AK#0m1#_81~bWL7PFbdT;?&K1uSF{i&?@_ma&`_tYj6dS;Jb^v7QZF%|@RlA<-)$|@zejyP5AYxl@i33@D39?tPw*s9 z@ifoyEYI;gFYqES@iMQlmsfd>*Lj0Cd5gE%#~zMU{sCtfmVeNGVIwWFnR;mS>X((8 gk&)iMX{*%U*?A*!%|nN0kIWvLmoqYTR8C&tPxt{v(f|Me literal 0 HcmV?d00001 diff --git a/locale/locale/la_LN.ISO8859-2/LC_TIME b/locale/locale/la_LN.ISO8859-2/LC_TIME new file mode 120000 index 0000000..58b846c --- /dev/null +++ b/locale/locale/la_LN.ISO8859-2/LC_TIME @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/la_LN.ISO8859-4/LC_COLLATE b/locale/locale/la_LN.ISO8859-4/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..ded44802b65fd69b48bd2896a49ec2b378d9ff44 GIT binary patch literal 2086 zcmY+^b&ytN7>4ovkdT&c5NU*k1*9aUM3e^UknWO3x*Gujk#1N*B$kE+>28o%QjwMv zaM$aG`yalU-?`?T@0~ew-t)`}2@WY8CrH0QAP|jXw5X`a$hQ~XKk#3Wd|=V3#ITrD zV%djOVw-LvaV;K|_?Cc5Li>nHB1=pqi6y0y%#u?{VJWGkveZ=4SXwISEIpMB_A!-= zR)$JhD@UcgeMzOFeMRLPt4yVeRi#qRYEr3f-%_b-^{CXh22>haBPxxp36-Yy9hGL* zoJtF8Nu`ywrqagRQE6}8sr0a3RQlLJDuZkYm7zA8$`~6*Wr9tlGTCNO`PpVtnPqdR z%(JCbmf3PDD=d`CDqBrujr~exoo%ENX1l0_+a4-=?J$)ic8tn#J4@x9U8Hi!E>nrH z+f@Fvzo`6e_o+Oz=Tu(UODg}`D=Kg7KPr(HMG*+R6Z8q^lF2et$zoZlWV7s4a#&6( zpIR;|xhK+{|>JqNZ!uhcKWqx2JT>kX}(V3 zBL2W{R*8z{su9}{^8`KVNN4Kln+3n3B5=*U c;a;cJErQ;Jz7J2_NA6?yANQ&IjMkC=0ibgO4*&oF literal 0 HcmV?d00001 diff --git a/locale/locale/la_LN.ISO8859-4/LC_CTYPE b/locale/locale/la_LN.ISO8859-4/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..9822645fea40f183fa04aedef14d96f4534c8a8e GIT binary patch literal 3204 zcmc)J2XGWs7zgkpzl$bEBGKf0#F3wPq9jm&f+Xge5zS7DM6(N#Oks*pG!mcfTu0Mk zo--PgACn)GACn)GACn)Ge>COD55I%|v;O`42k$s|&Y%Wo4BvTp-tco+!+XN@pf{Kw zTElsGJ@_0-JY*j3nHM!Y=i&Aa&y!d6pPv2DEb9kHJ|*}==O>;h2^63pURWfFLioc) z3R8rl6r(sLC`lPxd)P}}hfilp{uY zDo~M1RHh0kRHYi#sX3%tlnyv!@S%4_WAb>84j-r{ZE;a&Eyi@eI;XYbtd_gl|xq=t(r n2S?Z5JyX)sTBJ89Wu+oo+NIJGi4w_*28C!EEk)C4(xB2#d&wvo zXedfqg>&5Z@qFpMuHSQC*ZY2Wi|Z9P+pe6aP$(3!MWv-BC1n@?AKuDoi`bHCtJs>V zd~8FtZTN|{j~%FXj0#j0qY~9lu`^ZW*oA7>*o~@6>`t{u>`7HM_M)m5)v5N58dNo- z7S%qnFV%ign`-~4Lsd5ppgJ%PqB=P0Q5_QXsfy!Js>9-Nsw1KSRl{gRb!0TAIx3E) zY7$MUj)`NbnniP}7SWQbRUAjvI*zA0Ax@-f6K$zZigr}(<7BE+;#8{B;&iGGaR$|y zaTe9taSqkFaURwAaRF7wxRC0ixR|O_TtaneTt;Llj^$YMb$g5r|J_oQ1y*|RQ+QB)xfxsYETTOx+!j^x+QL<8WKaPZj0NghQ)BI z5pf6A$QVU+XWT_~cicmDZ`?;UI>u0qjd4`>#{*Ok#zRyO$9Sqo;!&yzF_G%Ac%15q zc#`U=c$#WbOs1L=Q>mVbXQ`fx=c!(Z7pbPjbgGx)WvW-=RjL^=lj^m2o$8I4MfGO9 zMfG;PL-lUFNA-SuKs7r)r1~g6rurm4rTQ#Br}`qkr1~nprkWGqP|b~bRP$p2)wl5- z)xuar^?m$6^<(@*wK$egEsdY4eu-bHev4&PzsDa`%VP!ApYa#f%J`e=pIAk;I@VCF ajdfK2#(z}nV*}O3D4{CdtU$^zg~BEgmILts literal 0 HcmV?d00001 diff --git a/locale/locale/la_LN.US-ASCII/LC_CTYPE b/locale/locale/la_LN.US-ASCII/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..a321cba477e3fd6be92d74994fa6860c4c45b354 GIT binary patch literal 3199 zcmeIyWw2IN6b9fAxF4O8m-5ox4bq~b0?HK&P(nl$K@luUnoBoGcPpKWAl=>F-65&? zpu-<#1jb?b;kag=UwfVNo_)^Rr*e}9bt=@XTe@PUisb^2U6FM@LgX@f9`uN79(B+A z>rqPu0wJ0IyAQ(Fmk%>YGL820k=)`zvMld2~AQ%yg*u)_&@d6hclw_?Sb%GM)Zl65HW(;E)$9N_%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^Lpq$qAlbdLd^qW literal 0 HcmV?d00001 diff --git a/locale/locale/lt_LT.ISO8859-13/LC_CTYPE b/locale/locale/lt_LT.ISO8859-13/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..8fd0b1692798c1173fa675146b35785ab2aeec55 GIT binary patch literal 3205 zcmc)J1&~!$90%aXvTv!S^O29vrDN$(RFqJ#$rV??K!wGko29$Ek#3N*y8|2S?!boc z4YM=M8(q*@@XUO3=iGD8`JH?J_jDZ4H@RI>ua@mQv~L|a>lWk5Gl*&BnP_L2bEY-Z z#^YK90N=M*R!sFqz+O0|5yFUcl^8g8Cl=xwIX@Z_fGF8W^jF@ z|CLC7^u5#j#!t0OE|CMBnOK6vk%g>eBRe^8-~u_xMQ-wtmwe=>00k*TVTvF$P?Ta6 zrvxP_MVQi*p)BPnPX#Ix*<@v^P?c&VP@Njoq!zWQLtW}op9c8Ifrd1qF->SnGn&(a zByON5HE)j=9%-3~ zAv3WAi6aYH$wqc^5Km5Wk()f^B_H`IKtT#om?DHIN->I4f|8UXOlitcmU5J*0u`x5 zWvWn>Y9vsd8q}l~wW&j0>QSEtB+`&ZG^PnnX-0Ee(2`bMz=gEtA};0<+HfhC(Ux|! zrvsOB1s&ailVy z2~1=XlbOO)rZJrv%w!g`nZsP>F`or2WD$#5!cvy8oE5BO6{}gpTGnwt>)F6YHnEv4 zY-JnU*}+bBv70^YB{F{>`#Hct4sn=Xrq_d5M>K zg;#lvBfQQVyvbX<%{#oyQ4Vvi@{e0Pz5El#(`%K}2E(UXn@%0ViHY?ZCe*4EZkv?S Yr*A@oaL?XJ{gQg7B=-yVPfiJ(1mF-uM*si- literal 0 HcmV?d00001 diff --git a/locale/locale/lt_LT.ISO8859-13/LC_MESSAGES/LC_MESSAGES b/locale/locale/lt_LT.ISO8859-13/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..b6b1239 --- /dev/null +++ b/locale/locale/lt_LT.ISO8859-13/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[tTyY].* +^[nN].* +taip +ne diff --git a/locale/locale/lt_LT.ISO8859-13/LC_MONETARY b/locale/locale/lt_LT.ISO8859-13/LC_MONETARY new file mode 100644 index 0000000..e3f0169 --- /dev/null +++ b/locale/locale/lt_LT.ISO8859-13/LC_MONETARY @@ -0,0 +1,15 @@ +LTL +Lt +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/lt_LT.ISO8859-13/LC_NUMERIC b/locale/locale/lt_LT.ISO8859-13/LC_NUMERIC new file mode 100644 index 0000000..7485a49 --- /dev/null +++ b/locale/locale/lt_LT.ISO8859-13/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +3;3 diff --git a/locale/locale/lt_LT.ISO8859-13/LC_TIME b/locale/locale/lt_LT.ISO8859-13/LC_TIME new file mode 100644 index 0000000..4b1fee0 --- /dev/null +++ b/locale/locale/lt_LT.ISO8859-13/LC_TIME @@ -0,0 +1,58 @@ +Sau +Vas +Kov +Bal +Geg +Bir +Lie +Rgp +Rgs +Spa +Lap +Grd +sausio +vasario +kovo +balandþio +geguþës +birþelio +liepos +rugpjûèio +rugsëjo +spalio +lapkrièio +gruodþio +Sk +Pr +An +Tr +Kt +Pn +Ðt +Sekmadienis +Pirmadienis +Antradienis +Treèiadienis +Ketvirtadienis +Penktadienis +Ðeðtadienis +%H:%M:%S +%Y.%m.%d +%a %b %e %X %Y + + +%A, %Y m. %B %e d. %T %Z +sausis +vasaris +kovas +balandis +geguþë +birþelis +liepa +rugpjûtis +rugsëjis +spalis +lapkritis +gruodis +md + diff --git a/locale/locale/lt_LT.ISO8859-4/LC_COLLATE b/locale/locale/lt_LT.ISO8859-4/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..a1238dcb9ae8add712c8d62703dfae209b804cab GIT binary patch literal 2086 zcmY+?b#zvB9LMqJ0VxRuX%SRXdeVr5iiAi?hlGm2KsqHxDKH0v5rT{{LSjlP9gYzO zC{hDuI7&b%36a=*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E?nmxim zWr^2qG_XQOv5i;LS(JtRD6C8CKow|VPrMJY!{QZ>9-D0iekD(fcOU?rq1FCzT&N^~ z12>@{8|n8?P8OB|lTyt&IA;+BWyCZ^PN zcetf!xkSHy&mHz9A@#Q}Myb1`hC?=ZO^o7}=cAOh@Hp^)q18(mIvnzsmAD$@WbvHA z#e_v3t)waXEtS#m92REH&YhOSkON8MLR-3I!>|EBeyb{(S zqEa2=5DEl0&VMPsEGrh5>Uq*+^y+s0%z=um;cE%}U!!+Z;!NEY>dpmZui$o7;#e-p zme<5)OZ&_Dj6;6vjCB7z;IX2!83Q@B@ng7M(R{7JO*jl*o;8nwOfzyA1nSk$ zkP$jK?@g)yF&lQOa_X!*ejpIBp9(;L-J@=e^NnM7aWp1!!DcuI#%F@7S9Hb{6U;(^ z3@}`kQitEhNBp?`Ov&amSc$z`v=Z(lEkG)FUTBPlxAuq|>?0vGvGUCO*vF^+jhL15R~tx_g%*;ISe$rLcmg%V$rA3q*InapqB zq9N~++Sk--##~0Kpw@*pL>WvFM@K;Vld0$N>!1k&xbF@&a+d4w&mp!o5Ik~}^vAnG z8>?fu<1Bmanv_qFKP$GP#Yyj^$?H(~8x{1By}dh(f@Eusd9|s{VkMYevQ1h4ykE^0!C{hd<5HhlbG{!Q*G}y;KP1+>%bd4b82&a<>r1$%;YLlqPihy z6kYr?YyR;nm>k37)+VB&1T?<06wj1d?7`-@Omq-IpNm|q%->Da# zjK}O*WcWs}NS|2{7F_?dLdIaj^^uWs9d!^`4Te+x^_lL^X!WMrQ47A=NvVwxzx3n4|D+fMBrm)lm25$~KG)ZQ5d*NUIrY~aJ urWF)a3>Zq?Y^B%;se`ObyGYR;x&&mXvG)7yk6-uGyKhbT+*tknHT?~-Vhzjy literal 0 HcmV?d00001 diff --git a/locale/locale/nl/LC_MESSAGES/texinfo.mo b/locale/locale/nl/LC_MESSAGES/texinfo.mo new file mode 100644 index 0000000000000000000000000000000000000000..81ecd32f915276ebd607c7272412bb6f39c106c4 GIT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lM%Ln?m zN%hznil_Ljjt((ioP5(-uS_`2CkrJ>QFL(3_;2o!KJDeV&RRGWY0im0?L?gu+&(O7 zJJBaB=F0gAWw2{s?&z#VPmo~clNu*M;@k!G{HrFO6#8gd&8wLm=A-N*3;h3;dvPc+ z51@`+ZoBNH?adfJh3puE@_ojb&8(56$@idc8-Elqqd|UjPhju)_R03VJ0-Xk90Io+ zkn9+Z6)sHoSL_iq&=g4Fm?ohOjioKYnLV{5itKY)kEIx#0HPIr^foH7eYzwkw%p0zv|FT-dls{EsF_>I*~~*| zYxy=;jd+j`bqEG!1$GAwCLLawTWu2H?+dTkhIY^VuQ)ndhhmI1ZE-CUtL10;blYJk z`v5vvtFxV(Y*VE8Stk{?LM=RHOzidiQ^LeZVY@Bhfia@Vu;x#00#OrbSRSgxI^^@} zrAg6MPxdnGCVU~pc|Ku_zT$fdTL_>deS8}~6rHdlrL{kCqbULTV;K>}C!~%ioNU|c zw3md2zR8(vbB0ceS;N~(fM)udFNuYXTpA`uCm*1WIrG5@aqd7v;TPsXHL{`fn3xq;+a?rCBU@l~yL@;GR`Nxp$Wzs~xJoAwkIj0!=t zC8F;PquPY_>5pM2E1YTaz-$?}8Oq_y&9RGB8c8_kCw_>jFD?D!HLvdhb3x+11CI|$&S6q$`irk-Xmc&MBq>5q_S((2r7Tr? zpOL_IUi~!L$k++hvlX;n|8fj&up@xVyOQaB36ld&?m2RVuUA>A;h>*5N@?un{6Cg< zeT9V8sO$`&q8*^i89;;eDKEF30wl>iB_Y5mK=EVWoNas;2Ak5-SZ2pz&Hswi}k62IM<%hLyP3fKHp4CXyuhcv-*JX+UW|&6dol z3v2ZaM;m&NXXrB9$jaxLxH`a>KI5`y$dVCls^jBdQf&R~X)C#PgOxlFthi50{y%c6 BZzuo& literal 0 HcmV?d00001 diff --git a/locale/locale/no_NO.ISO8859-1/LC_COLLATE b/locale/locale/no_NO.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/no_NO.ISO8859-1/LC_CTYPE b/locale/locale/no_NO.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/no_NO.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/no_NO.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/no_NO.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..ee50286 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[jJyY].* +^[nN].* diff --git a/locale/locale/no_NO.ISO8859-1/LC_MONETARY b/locale/locale/no_NO.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..b14b233 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +NOK +kr +, +. +3;3 + +- +2 +2 +1 +0 +1 +0 +4 +4 diff --git a/locale/locale/no_NO.ISO8859-1/LC_NUMERIC b/locale/locale/no_NO.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..b93b567 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +, +. +3;3 diff --git a/locale/locale/no_NO.ISO8859-1/LC_TIME b/locale/locale/no_NO.ISO8859-1/LC_TIME new file mode 100644 index 0000000..1006f25 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +mai +jun +jul +aug +sep +okt +nov +des +januar +februar +mars +april +mai +juni +juli +august +september +oktober +november +desember +søn +man +tir +ons +tor +fre +lør +søndag +mandag +tirsdag +onsdag +torsdag +fredag +lørdag +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +januar +februar +mars +april +mai +juni +juli +august +september +oktober +november +desember +dm +%I:%M:%S %p diff --git a/locale/locale/no_NO.ISO8859-15/LC_COLLATE b/locale/locale/no_NO.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/no_NO.ISO8859-15/LC_CTYPE b/locale/locale/no_NO.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/no_NO.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/no_NO.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/no_NO.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..0a854c2 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../no_NO.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/no_NO.ISO8859-15/LC_MONETARY b/locale/locale/no_NO.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..ec19b22 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../no_NO.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/no_NO.ISO8859-15/LC_NUMERIC b/locale/locale/no_NO.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..fb24065 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../no_NO.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/no_NO.ISO8859-15/LC_TIME b/locale/locale/no_NO.ISO8859-15/LC_TIME new file mode 120000 index 0000000..20ec6f1 --- /dev/null +++ b/locale/locale/no_NO.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../no_NO.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/no_NO.UTF-8/LC_COLLATE b/locale/locale/no_NO.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/no_NO.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/no_NO.UTF-8/LC_CTYPE b/locale/locale/no_NO.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/no_NO.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/no_NO.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/no_NO.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..0a854c2 --- /dev/null +++ b/locale/locale/no_NO.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../no_NO.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/no_NO.UTF-8/LC_MONETARY b/locale/locale/no_NO.UTF-8/LC_MONETARY new file mode 120000 index 0000000..ec19b22 --- /dev/null +++ b/locale/locale/no_NO.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../no_NO.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/no_NO.UTF-8/LC_NUMERIC b/locale/locale/no_NO.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..fb24065 --- /dev/null +++ b/locale/locale/no_NO.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../no_NO.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/no_NO.UTF-8/LC_TIME b/locale/locale/no_NO.UTF-8/LC_TIME new file mode 100644 index 0000000..f7db116 --- /dev/null +++ b/locale/locale/no_NO.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +mai +jun +jul +aug +sep +okt +nov +des +januar +februar +mars +april +mai +juni +juli +august +september +oktober +november +desember +søn +man +tir +ons +tor +fre +lør +søndag +mandag +tirsdag +onsdag +torsdag +fredag +lørdag +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +januar +februar +mars +april +mai +juni +juli +august +september +oktober +november +desember +dm +%I:%M:%S %p diff --git a/locale/locale/no_NO/LC_COLLATE b/locale/locale/no_NO/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/no_NO/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/no_NO/LC_CTYPE b/locale/locale/no_NO/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/no_NO/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/no_NO/LC_MESSAGES/LC_MESSAGES b/locale/locale/no_NO/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..0a854c2 --- /dev/null +++ b/locale/locale/no_NO/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../no_NO.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/no_NO/LC_MONETARY b/locale/locale/no_NO/LC_MONETARY new file mode 120000 index 0000000..ec19b22 --- /dev/null +++ b/locale/locale/no_NO/LC_MONETARY @@ -0,0 +1 @@ +../no_NO.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/no_NO/LC_NUMERIC b/locale/locale/no_NO/LC_NUMERIC new file mode 120000 index 0000000..fb24065 --- /dev/null +++ b/locale/locale/no_NO/LC_NUMERIC @@ -0,0 +1 @@ +../no_NO.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/no_NO/LC_TIME b/locale/locale/no_NO/LC_TIME new file mode 100644 index 0000000..f7db116 --- /dev/null +++ b/locale/locale/no_NO/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +mai +jun +jul +aug +sep +okt +nov +des +januar +februar +mars +april +mai +juni +juli +august +september +oktober +november +desember +søn +man +tir +ons +tor +fre +lør +søndag +mandag +tirsdag +onsdag +torsdag +fredag +lørdag +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +januar +februar +mars +april +mai +juni +juli +august +september +oktober +november +desember +dm +%I:%M:%S %p diff --git a/locale/locale/pl/LC_MESSAGES/texinfo.mo b/locale/locale/pl/LC_MESSAGES/texinfo.mo new file mode 100644 index 0000000000000000000000000000000000000000..a09723256aa4101caa89f64508e36d17c68e6b99 GIT binary patch literal 75698 zcmd?Sd7NEEna6#?BG95J2(k$$!H^E7I{^V95a>Vx1hSEI2n3M6-F?%!>E*U}$)y`{ z8=X-{X9l-%M%>03w{g@M#SKNreH&+STya;N$+%%$W*l|i@9%l4&N;XHb|*OV{_%d^ z{^aC$&pB0fs-Al4si&TLs_GlZAMw(JzY7jalGDMDJ~~N$!SAuN^fXEOmM6)%;A-$s zz&iK@@URt0ayQruc7dM(7l2;`uL8det_RN~@;Yz~+yLGKUH~3(UXrW=SAt6ac2McQ z8C(p05mXj_6EJ;Zk}TzZ4frH*0$dHg9wbZ2zk&QqPCh?L_?N8bKixkQ>;~TjD*bPO zXM$a1;uP>4a3Q!R;7%~*{<#6)1X7gb)1b=n-{F4kg`ST+;FUaoE4UT{{0uyn`-?70 zlH;BnwUz)A2i+&=^C0bdFdHTejr{Qeqz6nNIfNwNq$A3Pb{4l3Rxcp~^5 zQ1p5QcnB+1!e zFW3ie1J{5r11|-?2CAM<=0^2i4)_*O`8ojV`=?OZqVq*yFSrAwYLn-Ij|A@pMX%3* z%EvcA<^NHag?a){<9-czIye9>1MdVM2fi89_dXe({}>cqPrKafa~-I1>;_f;c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vE_^HZv$+~qu4*{#9=psQV4%O?Y{tXz+&&(@ z+y4%w0Gskt_>58p)2$D)bG3$6^CI0PNJE}Ky4oprKKb!rAq_^mXv1cM(I$x8%Y7_kX&*JrIC_uRJyynQ3Rz!LSWbH zmir5H&Tp>spZPHLOi0d<(AWWO!C){7`zVo-5fT3%cz?&afJC)uRH9o9DlshJw(JE1?YSpMzw=bxCX|<@-vAR_1TLUT$?JFu@TO%rstqGN;){IJXYeA)@wW8A6 z+E8h0?WuIIZ>V&$UR3(n04f7*5S76;jLL8uL1na!p%P}3sZ6nOD${Kyl{xkkm4&v5 z%3@neWreMzvdUId*-Y!tNY&WRfwBM=x zX?LkSu%}d>**{dC+e<2M>@AfDi=+q!-w9-3Eg3BnmCTlf$|shU%BPl%N_NXZ>Ba1?_Vxg{&}@B36`2F)L1`gq5TcYNe=jwe?g+S$QfW@I8LC zc2w5bbUFj-575lc!ZNE(Whs8f@^| z|JqtAnvGX@ZQ*n(I-sN5$?f8Hrh5L7=xN<(cc?wk2Yu1swC)G>I}FAUcPQe95SsBKs|_KIPRXHyRpaJOE1|4dJ)&{GQ9%zntPSjFx~$xJiuf3 Sq5H&rM4#gYG#B?#PyPd6AOn5? literal 0 HcmV?d00001 diff --git a/locale/locale/pl_PL.ISO8859-2/LC_CTYPE b/locale/locale/pl_PL.ISO8859-2/LC_CTYPE new file mode 120000 index 0000000..cc430a3 --- /dev/null +++ b/locale/locale/pl_PL.ISO8859-2/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pl_PL.ISO8859-2/LC_MESSAGES/LC_MESSAGES b/locale/locale/pl_PL.ISO8859-2/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..02916ea --- /dev/null +++ b/locale/locale/pl_PL.ISO8859-2/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[tTyY].* +^[nN].* +tak +nie diff --git a/locale/locale/pl_PL.ISO8859-2/LC_MONETARY b/locale/locale/pl_PL.ISO8859-2/LC_MONETARY new file mode 100644 index 0000000..9f696b7 --- /dev/null +++ b/locale/locale/pl_PL.ISO8859-2/LC_MONETARY @@ -0,0 +1,15 @@ +PLN +z³ +, + +3;3 + +- +2 +2 +1 +2 +1 +2 +4 +4 diff --git a/locale/locale/pl_PL.ISO8859-2/LC_NUMERIC b/locale/locale/pl_PL.ISO8859-2/LC_NUMERIC new file mode 100644 index 0000000..7485a49 --- /dev/null +++ b/locale/locale/pl_PL.ISO8859-2/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +3;3 diff --git a/locale/locale/pl_PL.ISO8859-2/LC_TIME b/locale/locale/pl_PL.ISO8859-2/LC_TIME new file mode 100644 index 0000000..7b0f9a9 --- /dev/null +++ b/locale/locale/pl_PL.ISO8859-2/LC_TIME @@ -0,0 +1,58 @@ +sty +lut +mar +kwi +maj +cze +lip +sie +wrz +pa¼ +lis +gru +stycznia +lutego +marca +kwietnia +maja +czerwca +lipca +sierpnia +wrze¶nia +pa¼dziernika +listopada +grudnia +ndz +pon +wto +¶ro +czw +ptk +sob +niedziela +poniedzia³ek +wtorek +¶roda +czwartek +pi±tek +sobota +%H:%M:%S +%Y.%m.%d +%a %e %b %X %Y + + +%a %e %b %X %Y %Z +styczeñ +luty +marzec +kwiecieñ +maj +czerwiec +lipiec +sierpieñ +wrzesieñ +pa¼dziernik +listopad +grudzieñ +dm + diff --git a/locale/locale/pl_PL.UTF-8/LC_COLLATE b/locale/locale/pl_PL.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/pl_PL.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/pl_PL.UTF-8/LC_CTYPE b/locale/locale/pl_PL.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/pl_PL.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pl_PL.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/pl_PL.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..281222f --- /dev/null +++ b/locale/locale/pl_PL.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../pl_PL.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/pl_PL.UTF-8/LC_MONETARY b/locale/locale/pl_PL.UTF-8/LC_MONETARY new file mode 100644 index 0000000..ac86e6c --- /dev/null +++ b/locale/locale/pl_PL.UTF-8/LC_MONETARY @@ -0,0 +1,15 @@ +PLN +zÅ‚ +, + +3;3 + +- +2 +2 +1 +2 +1 +2 +4 +4 diff --git a/locale/locale/pl_PL.UTF-8/LC_NUMERIC b/locale/locale/pl_PL.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..4d1d378 --- /dev/null +++ b/locale/locale/pl_PL.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../pl_PL.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/pl_PL.UTF-8/LC_TIME b/locale/locale/pl_PL.UTF-8/LC_TIME new file mode 100644 index 0000000..0d65091 --- /dev/null +++ b/locale/locale/pl_PL.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +sty +lut +mar +kwi +maj +cze +lip +sie +wrz +paź +lis +gru +stycznia +lutego +marca +kwietnia +maja +czerwca +lipca +sierpnia +wrzeÅ›nia +października +listopada +grudnia +ndz +pon +wto +Å›ro +czw +ptk +sob +niedziela +poniedziaÅ‚ek +wtorek +Å›roda +czwartek +piÄ…tek +sobota +%H:%M:%S +%Y.%m.%d +%a %e %b %X %Y + + +%a %e %b %X %Y %Z +styczeÅ„ +luty +marzec +kwiecieÅ„ +maj +czerwiec +lipiec +sierpieÅ„ +wrzesieÅ„ +październik +listopad +grudzieÅ„ +dm + diff --git a/locale/locale/pl_PL/LC_COLLATE b/locale/locale/pl_PL/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/pl_PL/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/pl_PL/LC_CTYPE b/locale/locale/pl_PL/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/pl_PL/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pl_PL/LC_MESSAGES/LC_MESSAGES b/locale/locale/pl_PL/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..281222f --- /dev/null +++ b/locale/locale/pl_PL/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../pl_PL.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/pl_PL/LC_MONETARY b/locale/locale/pl_PL/LC_MONETARY new file mode 100644 index 0000000..ac86e6c --- /dev/null +++ b/locale/locale/pl_PL/LC_MONETARY @@ -0,0 +1,15 @@ +PLN +zÅ‚ +, + +3;3 + +- +2 +2 +1 +2 +1 +2 +4 +4 diff --git a/locale/locale/pl_PL/LC_NUMERIC b/locale/locale/pl_PL/LC_NUMERIC new file mode 120000 index 0000000..4d1d378 --- /dev/null +++ b/locale/locale/pl_PL/LC_NUMERIC @@ -0,0 +1 @@ +../pl_PL.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/pl_PL/LC_TIME b/locale/locale/pl_PL/LC_TIME new file mode 100644 index 0000000..0d65091 --- /dev/null +++ b/locale/locale/pl_PL/LC_TIME @@ -0,0 +1,58 @@ +sty +lut +mar +kwi +maj +cze +lip +sie +wrz +paź +lis +gru +stycznia +lutego +marca +kwietnia +maja +czerwca +lipca +sierpnia +wrzeÅ›nia +października +listopada +grudnia +ndz +pon +wto +Å›ro +czw +ptk +sob +niedziela +poniedziaÅ‚ek +wtorek +Å›roda +czwartek +piÄ…tek +sobota +%H:%M:%S +%Y.%m.%d +%a %e %b %X %Y + + +%a %e %b %X %Y %Z +styczeÅ„ +luty +marzec +kwiecieÅ„ +maj +czerwiec +lipiec +sierpieÅ„ +wrzesieÅ„ +październik +listopad +grudzieÅ„ +dm + diff --git a/locale/locale/pt_BR.ISO8859-1/LC_COLLATE b/locale/locale/pt_BR.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..22ce411 --- /dev/null +++ b/locale/locale/pt_BR.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../pt_PT.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/pt_BR.ISO8859-1/LC_CTYPE b/locale/locale/pt_BR.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/pt_BR.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pt_BR.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/pt_BR.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..a1626db --- /dev/null +++ b/locale/locale/pt_BR.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../pt_PT.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/pt_BR.ISO8859-1/LC_MONETARY b/locale/locale/pt_BR.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..de2e2f1 --- /dev/null +++ b/locale/locale/pt_BR.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +BRL +R$ +, +. +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/pt_BR.ISO8859-1/LC_NUMERIC b/locale/locale/pt_BR.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..b93b567 --- /dev/null +++ b/locale/locale/pt_BR.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +, +. +3;3 diff --git a/locale/locale/pt_BR.ISO8859-1/LC_TIME b/locale/locale/pt_BR.ISO8859-1/LC_TIME new file mode 100644 index 0000000..c556a3c --- /dev/null +++ b/locale/locale/pt_BR.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +Jan +Fev +Mar +Abr +Mai +Jun +Jul +Ago +Set +Out +Nov +Dez +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +Dom +Seg +Ter +Qua +Qui +Sex +Sáb +Domingo +Segunda Feira +Terça Feira +Quarta Feira +Quinta Feira +Sexta Feira +Sábado +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y + + +%a %e %b %Y %X %Z +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +dm + diff --git a/locale/locale/pt_BR.UTF-8/LC_COLLATE b/locale/locale/pt_BR.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/pt_BR.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/pt_BR.UTF-8/LC_CTYPE b/locale/locale/pt_BR.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/pt_BR.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pt_BR.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/pt_BR.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..315d6f2 --- /dev/null +++ b/locale/locale/pt_BR.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../pt_PT.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/pt_BR.UTF-8/LC_MONETARY b/locale/locale/pt_BR.UTF-8/LC_MONETARY new file mode 120000 index 0000000..15a9bbf --- /dev/null +++ b/locale/locale/pt_BR.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../pt_BR.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/pt_BR.UTF-8/LC_NUMERIC b/locale/locale/pt_BR.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..cfe25e0 --- /dev/null +++ b/locale/locale/pt_BR.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../pt_BR.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/pt_BR.UTF-8/LC_TIME b/locale/locale/pt_BR.UTF-8/LC_TIME new file mode 100644 index 0000000..052e3ee --- /dev/null +++ b/locale/locale/pt_BR.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Jan +Fev +Mar +Abr +Mai +Jun +Jul +Ago +Set +Out +Nov +Dez +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +Dom +Seg +Ter +Qua +Qui +Sex +Sáb +Domingo +Segunda Feira +Terça Feira +Quarta Feira +Quinta Feira +Sexta Feira +Sábado +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y + + +%a %e %b %Y %X %Z +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +dm + diff --git a/locale/locale/pt_BR/LC_COLLATE b/locale/locale/pt_BR/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/pt_BR/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/pt_BR/LC_CTYPE b/locale/locale/pt_BR/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/pt_BR/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pt_BR/LC_MESSAGES/LC_MESSAGES b/locale/locale/pt_BR/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..315d6f2 --- /dev/null +++ b/locale/locale/pt_BR/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../pt_PT.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/pt_BR/LC_MONETARY b/locale/locale/pt_BR/LC_MONETARY new file mode 120000 index 0000000..15a9bbf --- /dev/null +++ b/locale/locale/pt_BR/LC_MONETARY @@ -0,0 +1 @@ +../pt_BR.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/pt_BR/LC_NUMERIC b/locale/locale/pt_BR/LC_NUMERIC new file mode 120000 index 0000000..cfe25e0 --- /dev/null +++ b/locale/locale/pt_BR/LC_NUMERIC @@ -0,0 +1 @@ +../pt_BR.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/pt_BR/LC_TIME b/locale/locale/pt_BR/LC_TIME new file mode 100644 index 0000000..052e3ee --- /dev/null +++ b/locale/locale/pt_BR/LC_TIME @@ -0,0 +1,58 @@ +Jan +Fev +Mar +Abr +Mai +Jun +Jul +Ago +Set +Out +Nov +Dez +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +Dom +Seg +Ter +Qua +Qui +Sex +Sáb +Domingo +Segunda Feira +Terça Feira +Quarta Feira +Quinta Feira +Sexta Feira +Sábado +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y + + +%a %e %b %Y %X %Z +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +dm + diff --git a/locale/locale/pt_PT.ISO8859-1/LC_COLLATE b/locale/locale/pt_PT.ISO8859-1/LC_COLLATE new file mode 120000 index 0000000..8c84ab1 --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-1/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/pt_PT.ISO8859-1/LC_CTYPE b/locale/locale/pt_PT.ISO8859-1/LC_CTYPE new file mode 120000 index 0000000..c21e28d --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-1/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-1/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pt_PT.ISO8859-1/LC_MESSAGES/LC_MESSAGES b/locale/locale/pt_PT.ISO8859-1/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..96af6ad --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-1/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[sSyY].* +^[nN].* diff --git a/locale/locale/pt_PT.ISO8859-1/LC_MONETARY b/locale/locale/pt_PT.ISO8859-1/LC_MONETARY new file mode 100644 index 0000000..91e1cfc --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-1/LC_MONETARY @@ -0,0 +1,15 @@ +EUR +Eu +. +. +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/pt_PT.ISO8859-1/LC_NUMERIC b/locale/locale/pt_PT.ISO8859-1/LC_NUMERIC new file mode 100644 index 0000000..8c2cdd9 --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-1/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +0;0 diff --git a/locale/locale/pt_PT.ISO8859-1/LC_TIME b/locale/locale/pt_PT.ISO8859-1/LC_TIME new file mode 100644 index 0000000..23d3672 --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-1/LC_TIME @@ -0,0 +1,58 @@ +Jan +Fev +Mar +Abr +Mai +Jun +Jul +Ago +Set +Out +Nov +Dez +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +Dom +Seg +Ter +Qua +Qui +Sex +Sáb +Domingo +Segunda Feira +Terça Feira +Quarta Feira +Quinta Feira +Sexta Feira +Sábado +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y + + +%a %e %b %Y %X %Z +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +dm + diff --git a/locale/locale/pt_PT.ISO8859-15/LC_COLLATE b/locale/locale/pt_PT.ISO8859-15/LC_COLLATE new file mode 120000 index 0000000..d537854 --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-15/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/pt_PT.ISO8859-15/LC_CTYPE b/locale/locale/pt_PT.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pt_PT.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/pt_PT.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..a1626db --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../pt_PT.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/pt_PT.ISO8859-15/LC_MONETARY b/locale/locale/pt_PT.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..81b8808 --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../pt_PT.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/pt_PT.ISO8859-15/LC_NUMERIC b/locale/locale/pt_PT.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..1a54d10 --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../pt_PT.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/pt_PT.ISO8859-15/LC_TIME b/locale/locale/pt_PT.ISO8859-15/LC_TIME new file mode 120000 index 0000000..cf558d7 --- /dev/null +++ b/locale/locale/pt_PT.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../pt_PT.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/pt_PT.UTF-8/LC_COLLATE b/locale/locale/pt_PT.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/pt_PT.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/pt_PT.UTF-8/LC_CTYPE b/locale/locale/pt_PT.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/pt_PT.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pt_PT.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/pt_PT.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..a1626db --- /dev/null +++ b/locale/locale/pt_PT.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../pt_PT.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/pt_PT.UTF-8/LC_MONETARY b/locale/locale/pt_PT.UTF-8/LC_MONETARY new file mode 120000 index 0000000..81b8808 --- /dev/null +++ b/locale/locale/pt_PT.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../pt_PT.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/pt_PT.UTF-8/LC_NUMERIC b/locale/locale/pt_PT.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..1a54d10 --- /dev/null +++ b/locale/locale/pt_PT.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../pt_PT.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/pt_PT.UTF-8/LC_TIME b/locale/locale/pt_PT.UTF-8/LC_TIME new file mode 100644 index 0000000..f32f695 --- /dev/null +++ b/locale/locale/pt_PT.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Jan +Fev +Mar +Abr +Mai +Jun +Jul +Ago +Set +Out +Nov +Dez +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +Dom +Seg +Ter +Qua +Qui +Sex +Sáb +Domingo +Segunda Feira +Terça Feira +Quarta Feira +Quinta Feira +Sexta Feira +Sábado +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y + + +%a %e %b %Y %X %Z +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +dm + diff --git a/locale/locale/pt_PT/LC_COLLATE b/locale/locale/pt_PT/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/pt_PT/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/pt_PT/LC_CTYPE b/locale/locale/pt_PT/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/pt_PT/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/pt_PT/LC_MESSAGES/LC_MESSAGES b/locale/locale/pt_PT/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..a1626db --- /dev/null +++ b/locale/locale/pt_PT/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../pt_PT.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/pt_PT/LC_MONETARY b/locale/locale/pt_PT/LC_MONETARY new file mode 120000 index 0000000..81b8808 --- /dev/null +++ b/locale/locale/pt_PT/LC_MONETARY @@ -0,0 +1 @@ +../pt_PT.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/pt_PT/LC_NUMERIC b/locale/locale/pt_PT/LC_NUMERIC new file mode 120000 index 0000000..1a54d10 --- /dev/null +++ b/locale/locale/pt_PT/LC_NUMERIC @@ -0,0 +1 @@ +../pt_PT.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/pt_PT/LC_TIME b/locale/locale/pt_PT/LC_TIME new file mode 100644 index 0000000..f32f695 --- /dev/null +++ b/locale/locale/pt_PT/LC_TIME @@ -0,0 +1,58 @@ +Jan +Fev +Mar +Abr +Mai +Jun +Jul +Ago +Set +Out +Nov +Dez +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +Dom +Seg +Ter +Qua +Qui +Sex +Sáb +Domingo +Segunda Feira +Terça Feira +Quarta Feira +Quinta Feira +Sexta Feira +Sábado +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y + + +%a %e %b %Y %X %Z +Janeiro +Fevereiro +Março +Abril +Maio +Junho +Julho +Agosto +Setembro +Outubro +Novembro +Dezembro +dm + diff --git a/locale/locale/ro/LC_MESSAGES/texinfo.mo b/locale/locale/ro/LC_MESSAGES/texinfo.mo new file mode 100644 index 0000000000000000000000000000000000000000..3a4129a8a9900ff5c74136a5e62bbfc24b11497e GIT binary patch literal 75177 zcmdqKd3+>CdB@%B17l%>ZSZ~duD#xs+0m{~%-U;fy@xG(FYjt?j4zF(kuv-yUo_gx3s&5^2(9073&O0DUP69uAWRm=v-;<~5X_EA>Op>#}wcrcDCirOZ zfK^Fy2iOPpfS&;ufnNbPf?owUfu|CA0GtFjgYN~;0}nboN!Ea?L8ZS3RJwPAOTn*z z%EIphrspI{FZb)g$AC3(E%-)|EG0hz`Ij7bZj$gX*~EXke=4{fd=IGfzXhHO_K=C= z!85_d;QD}LV9Nco1HKugD9NWmmE(8ee#7~mk6qw8p1%#;Kn46eco_E=T#zJ3fg8X> zz{i1)0EYrjgOB3=DPReF8A#ORA3^2!x8M=rX^%~k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z+TQ|`g<{1*UyH17*+9Gc1yIYj;Z+P_RE}StXeUuExvM2YuOWum%)BOBiUaA(c+le- zOOh1VMtXb&Xz4i{R1c17&`l3@AowTt2!^{{XKW^tKD)b2*l-sF4LlGg47w?^kR2i& zoo-pr1)YJjR?t~5NbD@ql$`3@GwUzF+ez0>KY2Y!V^mdX} z!zPl@>w9fINC2HodXusEn8&Fb&~o2A;Po@Hp9t$ywC%Xqq;dlJR_$v_K6<0Ynak)u z-s)v+>2FhU?G>!T*&`le*o`|#alOu_L&0E{fSgowI!j>!e=+@r?OJ&#He^vkwOVX5 z(i{hSpCGb`zBDWe4y~~@OE5$Sc11}V=Fs98FoxG>14Jd-OJd=VkGm>=tjYvEmPDz+ z1U0EDA<#|>1FR?jwvjN}kMcL|=Gy@{Kb7F|c=0r22Cq;=t_Z5+NiMe1_HREq(8W(^ z`RzceBO$nrD6>-dlm?M}(UR>g#SR7k4Vj?X=73NJSEsz?SqP*1lK`)*+u)G3VjMl} zD+7HCrWg;2#O8;80>JhudG!VXu_&YDUx~hvfqGn=|Ee(S40Ov#{V`hY15#&U@191; LQv0kw`upKO8Fn@) literal 0 HcmV?d00001 diff --git a/locale/locale/ro_RO.ISO8859-2/LC_COLLATE b/locale/locale/ro_RO.ISO8859-2/LC_COLLATE new file mode 120000 index 0000000..40a06bf --- /dev/null +++ b/locale/locale/ro_RO.ISO8859-2/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/ro_RO.ISO8859-2/LC_CTYPE b/locale/locale/ro_RO.ISO8859-2/LC_CTYPE new file mode 120000 index 0000000..cc430a3 --- /dev/null +++ b/locale/locale/ro_RO.ISO8859-2/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/ro_RO.ISO8859-2/LC_MESSAGES/LC_MESSAGES b/locale/locale/ro_RO.ISO8859-2/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..bebffa4 --- /dev/null +++ b/locale/locale/ro_RO.ISO8859-2/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,3 @@ +^[dDyY].* +^[nN].* + diff --git a/locale/locale/ro_RO.ISO8859-2/LC_MONETARY b/locale/locale/ro_RO.ISO8859-2/LC_MONETARY new file mode 100644 index 0000000..d1cc30b --- /dev/null +++ b/locale/locale/ro_RO.ISO8859-2/LC_MONETARY @@ -0,0 +1,15 @@ +ROL +Lei +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/ro_RO.ISO8859-2/LC_NUMERIC b/locale/locale/ro_RO.ISO8859-2/LC_NUMERIC new file mode 100644 index 0000000..7485a49 --- /dev/null +++ b/locale/locale/ro_RO.ISO8859-2/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +3;3 diff --git a/locale/locale/ro_RO.ISO8859-2/LC_TIME b/locale/locale/ro_RO.ISO8859-2/LC_TIME new file mode 100644 index 0000000..e81ed00 --- /dev/null +++ b/locale/locale/ro_RO.ISO8859-2/LC_TIME @@ -0,0 +1,58 @@ +Ian +Feb +Mar +Apr +Mai +Iun +Iul +Aug +Sep +Oct +Noi +Dec +Ianuarie +Februarie +Martie +Aprilie +Mai +Iunie +Iulie +August +Septembrie +Octombrie +Noiembrie +Decembrie +Dum +Lun +Mar +Mie +Joi +Vin +Sâm +Duminicã +Luni +Marþi +Miercuri +Joi +Vineri +Sâmbãtã +%H:%M:%S +%d.%m.%Y +%a %e %b %Y %X +am +pm +%a %e %b %Y %X %Z +Ianuarie +Februarie +Martie +Aprilie +Mai +Iunie +Iulie +August +Septembrie +Octombrie +Noiembrie +Decembrie +dm +%I:%M:%S %p diff --git a/locale/locale/ro_RO.UTF-8/LC_COLLATE b/locale/locale/ro_RO.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/ro_RO.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/ro_RO.UTF-8/LC_CTYPE b/locale/locale/ro_RO.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/ro_RO.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/ro_RO.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/ro_RO.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..a3ef065 --- /dev/null +++ b/locale/locale/ro_RO.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../ro_RO.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/ro_RO.UTF-8/LC_MONETARY b/locale/locale/ro_RO.UTF-8/LC_MONETARY new file mode 120000 index 0000000..a60658d --- /dev/null +++ b/locale/locale/ro_RO.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../ro_RO.ISO8859-2/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/ro_RO.UTF-8/LC_NUMERIC b/locale/locale/ro_RO.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..63c4b53 --- /dev/null +++ b/locale/locale/ro_RO.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../ro_RO.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/ro_RO.UTF-8/LC_TIME b/locale/locale/ro_RO.UTF-8/LC_TIME new file mode 100644 index 0000000..fc2f58a --- /dev/null +++ b/locale/locale/ro_RO.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Ian +Feb +Mar +Apr +Mai +Iun +Iul +Aug +Sep +Oct +Noi +Dec +Ianuarie +Februarie +Martie +Aprilie +Mai +Iunie +Iulie +August +Septembrie +Octombrie +Noiembrie +Decembrie +Dum +Lun +Mar +Mie +Joi +Vin +Sâm +Duminică +Luni +MarÅ£i +Miercuri +Joi +Vineri +Sâmbătă +%H:%M:%S +%d.%m.%Y +%a %e %b %Y %X +am +pm +%a %e %b %Y %X %Z +Ianuarie +Februarie +Martie +Aprilie +Mai +Iunie +Iulie +August +Septembrie +Octombrie +Noiembrie +Decembrie +dm +%I:%M:%S %p diff --git a/locale/locale/ro_RO/LC_COLLATE b/locale/locale/ro_RO/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/ro_RO/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/ro_RO/LC_CTYPE b/locale/locale/ro_RO/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/ro_RO/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/ro_RO/LC_MESSAGES/LC_MESSAGES b/locale/locale/ro_RO/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..a3ef065 --- /dev/null +++ b/locale/locale/ro_RO/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../ro_RO.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/ro_RO/LC_MONETARY b/locale/locale/ro_RO/LC_MONETARY new file mode 120000 index 0000000..a60658d --- /dev/null +++ b/locale/locale/ro_RO/LC_MONETARY @@ -0,0 +1 @@ +../ro_RO.ISO8859-2/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/ro_RO/LC_NUMERIC b/locale/locale/ro_RO/LC_NUMERIC new file mode 120000 index 0000000..63c4b53 --- /dev/null +++ b/locale/locale/ro_RO/LC_NUMERIC @@ -0,0 +1 @@ +../ro_RO.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/ro_RO/LC_TIME b/locale/locale/ro_RO/LC_TIME new file mode 100644 index 0000000..fc2f58a --- /dev/null +++ b/locale/locale/ro_RO/LC_TIME @@ -0,0 +1,58 @@ +Ian +Feb +Mar +Apr +Mai +Iun +Iul +Aug +Sep +Oct +Noi +Dec +Ianuarie +Februarie +Martie +Aprilie +Mai +Iunie +Iulie +August +Septembrie +Octombrie +Noiembrie +Decembrie +Dum +Lun +Mar +Mie +Joi +Vin +Sâm +Duminică +Luni +MarÅ£i +Miercuri +Joi +Vineri +Sâmbătă +%H:%M:%S +%d.%m.%Y +%a %e %b %Y %X +am +pm +%a %e %b %Y %X %Z +Ianuarie +Februarie +Martie +Aprilie +Mai +Iunie +Iulie +August +Septembrie +Octombrie +Noiembrie +Decembrie +dm +%I:%M:%S %p diff --git a/locale/locale/ru/LC_MESSAGES/texinfo.mo b/locale/locale/ru/LC_MESSAGES/texinfo.mo new file mode 100644 index 0000000000000000000000000000000000000000..04eba1eaeea7a1f659becb4b02e425a3689ebce0 GIT binary patch literal 75348 zcmdqKdz@WWdH=t|MP*dHq9C`OU`T>FlYoE_ZWACtgd{)$h=R;y<|H|0GBeJZA;e47 z-qe0;TkEY>w6#`it!=$mtJX}&AxtKjlgx!-0>q*~E67EGqKNkU{yfiG`|LBf1l#W) zzu&yF^ErF3`&!R>o@YJlS$pq)`C%VR_&ei}BsmV;{<0)_ir?)g>1mQQElQG8!KL7z zfMxJ?;312XT=ECE#7)72t^^UJkZ{E5L7oXMl&DmL%taOF-p+3#fd* z1kMHT1XYD+1E#M}k_Fsf488&E0GEPa0I5>)pCJE|qfbu~{v}uNpYGoW&Ii8wS)9Z0FcoEP430y`8{2Y7{_h+4z zBrgY-fzJou1il1p4%h|0lKc091@L1aNt4?^)%O|jrQk_tC&?V}bns~KI#B7lz@xxF z0M%cg0#5<^K&AUBcntV!@C5MHOFZ3~;5_ax2NkajE(3ob)Hv(}j|HCvmH*M_B+1EO zBiIC916~Y%96T4i8`L--&5g#r81T!W>h%Pu@{eJ#)z4>vjo_O>hBo;icqI5eQ2jLk zsvi46)&HgEhj9Xr<^E#uIItO92)-LU9{duh^6m)F9|hH~$6ny$xg1nG-Ue#?KOFF@ z;ETE63#y-g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qd11z+XABAGhCDi$ZM)r)nYbvyxtpu>q0oe@Fyc+No;}k`p7@n4JwAgx&E)qQF58CW)pzh=fyARzFmr8}uo4}B$*Y!kGev(LkPulHb zl;abLWG7mSB=;0WKi+=5vWYZ}<`w^%``tCEDWu=nybtksYof&kp}Z(SWfBQUi5U5H zgX?+1(!{aE{)!ynqv^$#y-d=a$=`@;f_9TIZymkK;2Bqug?t;X>I07k>R~y&fKAzc SCN4Mrn>*$WTFC3&Z2ce8dinGK literal 0 HcmV?d00001 diff --git a/locale/locale/ru_RU.CP1251/LC_COLLATE b/locale/locale/ru_RU.CP1251/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..fa28c7e499cbad5ae453d707dbd4f254e67681b0 GIT binary patch literal 2086 zcmY+-ceoc~7>DtG6)lnxLM59LN0B5N_R5N~BPtn{5Tdk`z01s|k|MjTiptR-grbR3 zD3ywHy6@xrkN3Jh&;4HS`^Qt%u&8C#a-Kq=P@Y-7w6vt8?BV}|zjCS&6{)s}EvYI+ zWvVLS5><<>sJ4#kRNF)is%>LCs_kP3s+zGQ)lRW9Rjt^CYS-9}s&>?&svEmg)r&o; z_KLl!4u}J(8pc6X2S+2S#&IasVR1Os5z&n5$Y@S=R2)s!B3e?liq=%e#IaPz#qm@p z#EDcV#mQ8s#2Hj)##vNnM_a0M;#{hB(VptOIG^f*xRC0ixR~ma=su@WSE{?>ZmN6YUaI@zeyRuJL8^!1VX8;sQL5oFg6gq&oa%{qlIp2=nrdV` zL-lMtNA-NXK=oq0MD=pKLNzKzQ+*M$sOH3%R7+zS)z2}H>X-PAYJPlA^+VLBS`fcd z{TR!sR>W^qD`OQ^Q5-_GPwY#zIKH9!HkME=ir=Yzia)6SjMY?YVh^gnVlCCWXh5|- zW>cLSJ*e8m-&Fg>Osb}FI@N}lOVuPcQf-QVsJ@QVsJ@EVsTRh+RQpE>Rq1~Uqzt3r z<*K-v>YBKgs#|oYx-NQBT^~14-59;7Zi<_!Zi(Jhx5jN$eWEYb?a_~_e+-}+7=x$= z#}KNaaR=3~xRYv3yh=4TUZWZp a3DxA7LNzr$rTQ$UQB98-RG&vNE#3@`00Z#= literal 0 HcmV?d00001 diff --git a/locale/locale/ru_RU.CP1251/LC_CTYPE b/locale/locale/ru_RU.CP1251/LC_CTYPE new file mode 120000 index 0000000..333aa0d --- /dev/null +++ b/locale/locale/ru_RU.CP1251/LC_CTYPE @@ -0,0 +1 @@ +../bg_BG.CP1251/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/ru_RU.CP1251/LC_MESSAGES/LC_MESSAGES b/locale/locale/ru_RU.CP1251/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..8780759 --- /dev/null +++ b/locale/locale/ru_RU.CP1251/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[äÄyY].* +^[íÍnN].* +äà +íåò diff --git a/locale/locale/ru_RU.CP1251/LC_MONETARY b/locale/locale/ru_RU.CP1251/LC_MONETARY new file mode 100644 index 0000000..62e9ce8 --- /dev/null +++ b/locale/locale/ru_RU.CP1251/LC_MONETARY @@ -0,0 +1,15 @@ +RUB +ðóá. +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/ru_RU.CP1251/LC_NUMERIC b/locale/locale/ru_RU.CP1251/LC_NUMERIC new file mode 120000 index 0000000..adcfb16 --- /dev/null +++ b/locale/locale/ru_RU.CP1251/LC_NUMERIC @@ -0,0 +1 @@ +../ru_RU.KOI8-R/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/ru_RU.CP1251/LC_TIME b/locale/locale/ru_RU.CP1251/LC_TIME new file mode 100644 index 0000000..867960b --- /dev/null +++ b/locale/locale/ru_RU.CP1251/LC_TIME @@ -0,0 +1,58 @@ +ÿíâ +ôåâ +ìàð +àïð +ìàé +èþí +èþë +àâã +ñåí +îêò +íîÿ +äåê +ÿíâàðÿ +ôåâðàëÿ +ìàðòà +àïðåëÿ +ìàÿ +èþíÿ +èþëÿ +àâãóñòà +ñåíòÿáðÿ +îêòÿáðÿ +íîÿáðÿ +äåêàáðÿ +âñ +ïí +âò +ñð +÷ò +ïò +ñá +âîñêðåñåíüå +ïîíåäåëüíèê +âòîðíèê +ñðåäà +÷åòâåðã +ïÿòíèöà +ñóááîòà +%H:%M:%S +%d.%m.%Y +%A, %e %B %Y ã. %X + + +%A, %e %B %Y ã. %X (%Z) +ÿíâàðü +ôåâðàëü +ìàðò +àïðåëü +ìàé +èþíü +èþëü +àâãóñò +ñåíòÿáðü +îêòÿáðü +íîÿáðü +äåêàáðü +dm + diff --git a/locale/locale/ru_RU.CP866/LC_COLLATE b/locale/locale/ru_RU.CP866/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..4c6cc1bfc727b581ec0731fb1cc8ff45bcdc71dc GIT binary patch literal 2086 zcmY+-ceoc~7>DumI}u3{Wu`clP~r$t8Ye4R4I>%Z4WWz_g^J233K=0q%T~yiJ&Fc} z?2%1r8ReYryT1SQUf1Wj-|Kz`Jv; z)T62&4XAdHJ*f7Ky{H;RW2(KQ3DrKaFI8#mN7Xd;r#c`Gq-quiQ5_u3sanJ#R4t z4yv(nC)HhXH`P5cj_TgHkLvyyPxV^7PW48-Nwp@rQJooQQJo#cY5)>f-1_)i*Aox->4Mx;*+(T@n4M2E>(ASH(c8L2)(JHSqw|gqTS6U_3-M zDW*_OjcHU5$0Jma#$!~E#}iaf#@|%`#J^N?;ybGE;|Hpb<0Gmi@d4Gs_>$_2_?&7% zETZ}~ex&*;-lzIAzNY#nKBJl+e^C7r-%`zvzo>qT->H6zpQ%2LPpIa`JgQ}}lxlH& zNVPInP_2s9RLkQjs_8L<>gjlf>e-k{^;|qp^+LQz^-{b{^-8=-H7m}enjCAX{*Q91 diVX^6Jx0OH+wl(7Tk#&%yU~#9zbK(4>i{V~1MvU= literal 0 HcmV?d00001 diff --git a/locale/locale/ru_RU.CP866/LC_CTYPE b/locale/locale/ru_RU.CP866/LC_CTYPE new file mode 100644 index 0000000000000000000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kCUlRiBqXgi_@t(#2Hj)##vNn z$2nBz#(7ld#|2b3#vrP}aTC?eaSPS0F@$Pp+(vbK45JzzBdG3(kyNANPO7`&ZmN6Y zUaI?IG}V|GOEoU;r+OeBqbqD-wJ5%)`XPR#`Y9GuEs3R6KSwR9OXC-+U*k8b zW$`=JAF-TjMf^$iSFEI}AAeK*6CJ58jEkr)j!smU#AQ^M#}!na<4US7(Ut0|=tgyQ zbf@YO*HB#>J*lpXUR1r~da6Eg16AMXN7X+DPz{XnRFA}?R1;z%)noAl)syiQ)zdMF zYI01Wni|hgJsZzaJs&Sny%^J|rpHTEFUKoXuf`0jneiIc>+uHFtaz8|@mNK*I@VCF ajdfK2#(z}nV*}O3D4{CdtU$^zg~BGQYynAg9~zob3h`5q;$`M>7x&-2-rwRZNRq;>zO+4Y}@ z`THjj=NeCl1WJ)e5~V4F4=yN6Im%Okid3R9Rj5ies#60S3~Ew~+SH*g^@vcP1~jA* zjcGztY&K|43tG~O*0iB5?PyO2I?{<0I@5(zy3&pAq|t+(^dg-MG8xSnqMX85#*xLT zoJKa|$>DU);7oGKBcB4!;%v^LkaHQzForXNk&NO%+Q02;iu>m_h#{6Z;t7#JDH2JdG-XJpEafOq1u9aB%2c5$)u>Jl!qlV| zwW&j0>Jgzn4QNOs8qIGz(Yk&`%?p$uad7RG$ zT*yUS%q3jPWn9h`T*+3h;%ctpTCU@IZs104;%08)R&L{V?%+=D;%@HYUhd<59^gS9 z;$a@)Q6A%Qp5RHI;%N?c{x*9kY5%sXDej-!J&wM`Pa?ZU{~?1?Q&YOOPKk^jmyw$n x&2JUS%E`*l%E-QnLU6 literal 0 HcmV?d00001 diff --git a/locale/locale/ru_RU.ISO8859-5/LC_MESSAGES/LC_MESSAGES b/locale/locale/ru_RU.ISO8859-5/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..2886ebc --- /dev/null +++ b/locale/locale/ru_RU.ISO8859-5/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[Ô´yY].* +^[ݽnN].* +ÔÐ +ÝÕâ diff --git a/locale/locale/ru_RU.ISO8859-5/LC_MONETARY b/locale/locale/ru_RU.ISO8859-5/LC_MONETARY new file mode 100644 index 0000000..51b0bf3 --- /dev/null +++ b/locale/locale/ru_RU.ISO8859-5/LC_MONETARY @@ -0,0 +1,15 @@ +RUB +àãÑ. +, + +3;3 + +- +2 +2 +0 +1 +0 +1 +1 +1 diff --git a/locale/locale/ru_RU.ISO8859-5/LC_NUMERIC b/locale/locale/ru_RU.ISO8859-5/LC_NUMERIC new file mode 120000 index 0000000..adcfb16 --- /dev/null +++ b/locale/locale/ru_RU.ISO8859-5/LC_NUMERIC @@ -0,0 +1 @@ +../ru_RU.KOI8-R/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/ru_RU.ISO8859-5/LC_TIME b/locale/locale/ru_RU.ISO8859-5/LC_TIME new file mode 100644 index 0000000..06d5669 --- /dev/null +++ b/locale/locale/ru_RU.ISO8859-5/LC_TIME @@ -0,0 +1,58 @@ +ïÝÒ +äÕÒ +ÜÐà +Ðßà +ÜÐÙ +ØîÝ +ØîÛ +ÐÒÓ +áÕÝ +ÞÚâ +ÝÞï +ÔÕÚ +ïÝÒÐàï +äÕÒàÐÛï +ÜÐàâÐ +ÐßàÕÛï +ÜÐï +ØîÝï +ØîÛï +ÐÒÓãáâÐ +áÕÝâïÑàï +ÞÚâïÑàï +ÝÞïÑàï +ÔÕÚÐÑàï +Òá +ßÝ +Òâ +áà +çâ +ßâ +áÑ +ÒÞáÚàÕáÕÝìÕ +ßÞÝÕÔÕÛìÝØÚ +ÒâÞàÝØÚ +áàÕÔÐ +çÕâÒÕàÓ +ßïâÝØæÐ +áãÑÑÞâÐ +%H:%M:%S +%d.%m.%Y +%A, %e %B %Y Ó. %X + + +%A, %e %B %Y Ó. %X (%Z) +ïÝÒÐàì +äÕÒàÐÛì +ÜÐàâ +ÐßàÕÛì +ÜÐÙ +ØîÝì +ØîÛì +ÐÒÓãáâ +áÕÝâïÑàì +ÞÚâïÑàì +ÝÞïÑàì +ÔÕÚÐÑàì +dm + diff --git a/locale/locale/ru_RU.KOI8-R/LC_COLLATE b/locale/locale/ru_RU.KOI8-R/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..2ed3ad04505edf70ce7f2d66af8fd50d3b78525b GIT binary patch literal 2086 zcmY+@XV?x@0EhACK^ZMnq^;1#Tbf$Zu%ay~2@Mo!NK1=Kno>rkR1^&wLOUueqf!(p zr9q`=5PDzto&T54b^XqLopU~%^W~J(FKJSx;3yW0<(SKrm6ewMxAFgpvx3S;1**+r zbE=9_iK=pViMEI>skVx(skVu#RMnz7)wZ!6)%Hl{69EVUH7Kc+E5sj&ijH9TI zj$^2fjV4r0;{>V`qZw86XhGF7T2Y-Gt*P3?DO9J%X;i1j8B}M+SyXM~Y^ru~4psX& zm+HLeKy`j}q`DwFQT2=dRJX?+RCmSzs=Hz!)!lIq)xB{a)&21R)u4EgYH&P6^>7TK z8XCi>hQ}jRkH%wEBjRzYCt@VklkpVQ2k{}*w3tp&EN)Vm$6BAne5!@9nChEYM)gzt zLiKz6Nwqfqp;{N~sW!yFRHacyHD?o^Sx{kCd_*-nj-xt0_Mn;@GpYPjhhj!Fp!zsI zrTQ$!Qhgo^sJ@6VsTRdoR7>J(s-^KQ)pzkd)erF_)$-^{wIY6|`ZZQk{T8dJR>vPy zf5qQaYvLrTsqr+`sCa|w*%(7LIi8_R)ROQ|l49#lQ!a;jc&1=W>t j8`V{DHC6AphN@d!NOg1EMAbcRpt>b)q`E%((!Lu3a2Esc literal 0 HcmV?d00001 diff --git a/locale/locale/ru_RU.KOI8-R/LC_CTYPE b/locale/locale/ru_RU.KOI8-R/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..c388d2c75997c77438239435a4ff3a514fda9d42 GIT binary patch literal 3223 zcmc)Kb##_h90%~1v3Jzye94#Y(Om;YMFe!V3-qNH?RqTe?BI?e1>u?oRwn zoR0>vN`h##x=I{$I7M+~2dAD=Y8USYjOMhUC9P;p8{&!3n?!CTiJRy{ zU;1$~x6q$kN#-^Na62iaGLSUx;7;yh5O>p+Zgi&yJ?X`{${#Fi2tygha7HkaQH*8` zV;RSICg5TPCNhc1Okpb1n9dAlGK<;FVJ`ES&jJ>*h{Y^nDa%;S3RZFtt60q%*0PTE zY+xgs*vuBTvW@NRAY=SacCnj1>}4POIlw^HNAm8eV=s#1;W)SxD{s7)Mos7pQS(}0FF zqA^WqN;8_%f|j(RHEoEeE$z5~3u(_qT+AhO;8Hqr8J*}%7cS=t61bA9xSDIYmg~5l z8|X?my3>Q6^x|CQ50*8Ap$uaKU7KI9`l<`X{UGd|}FzT_*u<{Q4{JHF=!e&i>9<`;hDH-6_2{^T!? zbByzuFaETx#mP$eL`z6ZP3;#+4tMO*p=s@eaAMy`N+fY$Qc5^AX<)ebpm57bV&A0r TyNYulKzF@q0X;=k@rW^T)Y;ekUY2Bs6c3et|$B8{2G|nHd>bJMQ0b zEJ(6j4k`~=PAa)9HksQP^n{e zsf1cRDq$FiZ!L;`ibkgOc*Nlg^tIJgzA_#E5}MiB&@3)NJ6lFY`TRQEptLoJ*R z#t@63BcP6QN4leFBtCRMqWY$MfZ-NRCqn%kF_`2|cBi^iXj{|u&qO@FcIUd^xbtWN z7D4Z24)mNZL;tmlNW>5BdiO_n1J(0CfvuKAH)D(Kq`RQ*ad*3WslE>f-9vO6wqu7S o)00q7AqA)1GwxaU7uv>j{g;r2Kiuo?pY9Esj(?!JxP~|6e;7~$UH||9 literal 0 HcmV?d00001 diff --git a/locale/locale/sl_SI.ISO8859-2/LC_CTYPE b/locale/locale/sl_SI.ISO8859-2/LC_CTYPE new file mode 120000 index 0000000..cc430a3 --- /dev/null +++ b/locale/locale/sl_SI.ISO8859-2/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/sl_SI.ISO8859-2/LC_MESSAGES/LC_MESSAGES b/locale/locale/sl_SI.ISO8859-2/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..28a7674 --- /dev/null +++ b/locale/locale/sl_SI.ISO8859-2/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[YyJj].* +^[Nn].* diff --git a/locale/locale/sl_SI.ISO8859-2/LC_MONETARY b/locale/locale/sl_SI.ISO8859-2/LC_MONETARY new file mode 100644 index 0000000..ecbf5a5 --- /dev/null +++ b/locale/locale/sl_SI.ISO8859-2/LC_MONETARY @@ -0,0 +1,15 @@ +SIT +SIT +, + +3;3 + +- +2 +2 +0 +2 +0 +2 +2 +2 diff --git a/locale/locale/sl_SI.ISO8859-2/LC_NUMERIC b/locale/locale/sl_SI.ISO8859-2/LC_NUMERIC new file mode 100644 index 0000000..d6efdaa --- /dev/null +++ b/locale/locale/sl_SI.ISO8859-2/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +0;0 diff --git a/locale/locale/sl_SI.ISO8859-2/LC_TIME b/locale/locale/sl_SI.ISO8859-2/LC_TIME new file mode 100644 index 0000000..523a521 --- /dev/null +++ b/locale/locale/sl_SI.ISO8859-2/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +maj +jun +jul +avg +sep +okt +nov +dec +januar +februar +marec +april +maj +junij +julij +avgust +september +oktober +november +december +ned +pon +tor +sre +èet +pet +sob +nedelja +ponedeljek +torek +sreda +èetrtek +petek +sobota +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +januar +februar +marec +april +maj +junij +julij +avgust +september +oktober +november +december +dm +%I:%M:%S %p diff --git a/locale/locale/sl_SI.UTF-8/LC_COLLATE b/locale/locale/sl_SI.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/sl_SI.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/sl_SI.UTF-8/LC_CTYPE b/locale/locale/sl_SI.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/sl_SI.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/sl_SI.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/sl_SI.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..06c4ff1 --- /dev/null +++ b/locale/locale/sl_SI.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../sl_SI.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/sl_SI.UTF-8/LC_MONETARY b/locale/locale/sl_SI.UTF-8/LC_MONETARY new file mode 120000 index 0000000..1e59f98 --- /dev/null +++ b/locale/locale/sl_SI.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../sl_SI.ISO8859-2/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/sl_SI.UTF-8/LC_NUMERIC b/locale/locale/sl_SI.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..b89b816 --- /dev/null +++ b/locale/locale/sl_SI.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../sl_SI.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/sl_SI.UTF-8/LC_TIME b/locale/locale/sl_SI.UTF-8/LC_TIME new file mode 100644 index 0000000..22164fd --- /dev/null +++ b/locale/locale/sl_SI.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +maj +jun +jul +avg +sep +okt +nov +dec +januar +februar +marec +april +maj +junij +julij +avgust +september +oktober +november +december +ned +pon +tor +sre +Äet +pet +sob +nedelja +ponedeljek +torek +sreda +Äetrtek +petek +sobota +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +januar +februar +marec +april +maj +junij +julij +avgust +september +oktober +november +december +dm +%I:%M:%S %p diff --git a/locale/locale/sl_SI/LC_COLLATE b/locale/locale/sl_SI/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/sl_SI/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/sl_SI/LC_CTYPE b/locale/locale/sl_SI/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/sl_SI/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/sl_SI/LC_MESSAGES/LC_MESSAGES b/locale/locale/sl_SI/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..06c4ff1 --- /dev/null +++ b/locale/locale/sl_SI/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../sl_SI.ISO8859-2/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/sl_SI/LC_MONETARY b/locale/locale/sl_SI/LC_MONETARY new file mode 120000 index 0000000..1e59f98 --- /dev/null +++ b/locale/locale/sl_SI/LC_MONETARY @@ -0,0 +1 @@ +../sl_SI.ISO8859-2/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/sl_SI/LC_NUMERIC b/locale/locale/sl_SI/LC_NUMERIC new file mode 120000 index 0000000..b89b816 --- /dev/null +++ b/locale/locale/sl_SI/LC_NUMERIC @@ -0,0 +1 @@ +../sl_SI.ISO8859-2/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/sl_SI/LC_TIME b/locale/locale/sl_SI/LC_TIME new file mode 100644 index 0000000..22164fd --- /dev/null +++ b/locale/locale/sl_SI/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +maj +jun +jul +avg +sep +okt +nov +dec +januar +februar +marec +april +maj +junij +julij +avgust +september +oktober +november +december +ned +pon +tor +sre +Äet +pet +sob +nedelja +ponedeljek +torek +sreda +Äetrtek +petek +sobota +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +januar +februar +marec +april +maj +junij +julij +avgust +september +oktober +november +december +dm +%I:%M:%S %p diff --git a/locale/locale/sr_YU.ISO8859-2/LC_COLLATE b/locale/locale/sr_YU.ISO8859-2/LC_COLLATE new file mode 120000 index 0000000..40a06bf --- /dev/null +++ b/locale/locale/sr_YU.ISO8859-2/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/sr_YU.ISO8859-2/LC_CTYPE b/locale/locale/sr_YU.ISO8859-2/LC_CTYPE new file mode 120000 index 0000000..cc430a3 --- /dev/null +++ b/locale/locale/sr_YU.ISO8859-2/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-2/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/sr_YU.ISO8859-2/LC_MESSAGES/LC_MESSAGES b/locale/locale/sr_YU.ISO8859-2/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..8010cfd --- /dev/null +++ b/locale/locale/sr_YU.ISO8859-2/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[dDyY].* +^[nN].* diff --git a/locale/locale/sr_YU.ISO8859-2/LC_MONETARY b/locale/locale/sr_YU.ISO8859-2/LC_MONETARY new file mode 100644 index 0000000..8a3b6ef --- /dev/null +++ b/locale/locale/sr_YU.ISO8859-2/LC_MONETARY @@ -0,0 +1,15 @@ +YUD +din +, + +3;3 + +- +2 +2 +0 +2 +0 +2 +2 +2 diff --git a/locale/locale/sr_YU.ISO8859-2/LC_NUMERIC b/locale/locale/sr_YU.ISO8859-2/LC_NUMERIC new file mode 100644 index 0000000..8c2cdd9 --- /dev/null +++ b/locale/locale/sr_YU.ISO8859-2/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +0;0 diff --git a/locale/locale/sr_YU.ISO8859-2/LC_TIME b/locale/locale/sr_YU.ISO8859-2/LC_TIME new file mode 100644 index 0000000..43b3f62 --- /dev/null +++ b/locale/locale/sr_YU.ISO8859-2/LC_TIME @@ -0,0 +1,58 @@ +jan +feb +mar +apr +maj +jun +jul +avg +sep +okt +nov +dec +januar +februar +mart +april +maj +juni +juli +avgust +septembar +oktobar +novembar +decembar +ned +pon +uto +sre +èet +pet +sub +nedelja +ponedeljak +utorak +sreda +èetvrtak +petak +subota +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +januar +februar +mart +april +maj +juni +juli +avgust +septembar +oktobar +novembar +decembar +dm +%I:%M:%S %p diff --git a/locale/locale/sr_YU.ISO8859-5/LC_COLLATE b/locale/locale/sr_YU.ISO8859-5/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..6aebf6ff108270f02b0d4546e77a13aa6310cccd GIT binary patch literal 2086 zcmY+-ci0b97>98`O(~_URD?>Iy(#SwkrpjvYftU1tQMkVwF}X`1j!>`YZA zT%xkEE7fjMj%xSVgQ|S&Nwrs0psE;^s47Pls=cEs)jqK=)qYWps(S2CRU>Lq9S{dn z9Tc^x4vs^p>O@_tdQqRMK{TW~G>WJWi$+w3#}QPG<4CHb;%KU4;#jKV;&`ePq6t;g zXhwBnG^c72CsDPGR#YcPYpPS?RI1bBbgDC=4OQDXlj^KEo9di6m#ST~r|J;rQFV+? zRGp&>Rj;^%>dxp*)hGH=^^5*gcg5XQ_r$$a_r(CJfiZ~c{uoR(Bp#r8Fose+6vL>7 z#|WyCF^cNpc!cWFc#LXx%%Pea^Qh*>t5mPW0;+|vh-z^xp;{Wts9uldR4d{QsyE{; zs<-1Es(0f(s`q0h)d#VPYIS@_^-+9G^+~LuS{t8It&5sepTz}KpT`$eU&dEdU&p0X zS42;$8{!+PZ{s_v+oCH~x9CpQBhII~FfO9HI4+_3J}#rWJg%g=Dz2uwCa$HrF0QA# zF>a!|Ic}l4HEyR`9~-ECh##qbil3=|iN~p)h$pF@il?c@#8|3lVjR`4@hsJI@dDM0 z@iNtfm`F7#CR0s~X;iPobgCIKi)v$R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3mp9Pj6-W`Et8ukF%!=|wP%ENvM1iv43J)|em?m1mwkHa$J5>V8UEA$1Jm>Y AwEzGB literal 0 HcmV?d00001 diff --git a/locale/locale/sv_SE.ISO8859-1/LC_COLLATE b/locale/locale/sv_SE.ISO8859-1/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..3e3436ac38adf74da2bcdf526ec7e54fc2dece42 GIT binary patch literal 2086 zcmY+^d3?xq9LMo(k+XzQ$dRkUSkB0?$QhEzQHGhxnH#iAU!+q~Y}+vCCS@pyh;-_P&&$M5m@Js!VrNN`AK_5fXhfq_A+L1}5Jsp&T! zTzD2B4_PKEneAaJSu87+Y^Ik;4$Dd95qp$ME_;khZp%X@uRTsBpXH}gz@DJ;q!px6 z$O=<=%8F1aYQ?A&w|Z3STLUVM?G-95>{TkSSt}~9TWcz9tUZ-C?JX)DEsRRIMNo;f zx2g27o>Y2SZz_GPFO_$!AC-5lKa~MCgi4f+pfb{;sl?cLDiiD@DzP?|$~2o!WroF3 znPu~+%(qXdEU-_hEVL!`o~7)U*>Wl??Q1IE*jg&LCV{X}J- zB~UqRKT|nkN2w%Q5|tBnlFBJNP33n>rt;T)&applDO4`ne^jp9O)9r6mCDmrf=Wp% zMWwWrq4JD9OXWE$OQoEZrxI)xs8qBND$iRbDwVAYm8w>aN_BgIN)4+?uoTVG;2uZnsuP^zHOv($KIe4fo_OIcYJIAQ+dyB zQ)y}8w5v}03;~UpB@CV1&Tbbv(4y!ts6*Wk+~IV!t)ilN4Mt)VVlc-2&>icJqp_Ie zPIM=`Q)o0sBMvh$3m?0)-MQ`@`h~TlqWMcK#A0`m`z;DWicsc`xguhe8FJ*# zn%msB4ur7zeC^xo#q)Z-pU?Aqo`_867IR)k7XD@LWb zJx=8bdy+~Ct52nYHKOv8HKo$RT2g6cuTpuL9-lWprI#B6oov4IaIF-)!4wbIf zjY@axLFHZRNu`(drqajyQt4+ys6^NYR3a^kO0<1SFhZyv?Hjo6Ytd`<_aIEv53KEu*sBexkC{5~-}QBr3_ap2}w1LghExN@bVr zrt-V(p^{>$R1Vo;Dn~4h%5ghEBRI}<-YFJGwwd{E+wXF`7x>k?M3l>V{ zMQcdq6>CQ2Wou4F@8x$GU}^Ly24xB)642PLQ)y>|sjRTuRN7cLeH;4zyC4Dck!}O2 z+%i4yzYvDE^taCx(1cmy@C{ON5c)>up}$4Yp-|s*-*<=6g|>i-=0%9aa75!H_e1w% z_Y)d}FWiytm+mMUg%OCwc<6e+cE55bx)bPPYfDA*4~WNfcbYrHok?}ybFswI=rJT> zwY$pw+5Lt7V}Dc8d>Khti}m=`-QaF?H_@%w?rw8;xI1Yw)*%IdK+kEPyVpJ7?x$Dm Z4Jw+i;sj2)C*9NT8F~R1@vmvVbO$c&184vM literal 0 HcmV?d00001 diff --git a/locale/locale/sv_SE.ISO8859-15/LC_CTYPE b/locale/locale/sv_SE.ISO8859-15/LC_CTYPE new file mode 120000 index 0000000..bc6feeb --- /dev/null +++ b/locale/locale/sv_SE.ISO8859-15/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.ISO8859-15/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/sv_SE.ISO8859-15/LC_MESSAGES/LC_MESSAGES b/locale/locale/sv_SE.ISO8859-15/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..59af175 --- /dev/null +++ b/locale/locale/sv_SE.ISO8859-15/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../sv_SE.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/sv_SE.ISO8859-15/LC_MONETARY b/locale/locale/sv_SE.ISO8859-15/LC_MONETARY new file mode 120000 index 0000000..176da4e --- /dev/null +++ b/locale/locale/sv_SE.ISO8859-15/LC_MONETARY @@ -0,0 +1 @@ +../sv_SE.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/sv_SE.ISO8859-15/LC_NUMERIC b/locale/locale/sv_SE.ISO8859-15/LC_NUMERIC new file mode 120000 index 0000000..8385f6c --- /dev/null +++ b/locale/locale/sv_SE.ISO8859-15/LC_NUMERIC @@ -0,0 +1 @@ +../sv_SE.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/sv_SE.ISO8859-15/LC_TIME b/locale/locale/sv_SE.ISO8859-15/LC_TIME new file mode 120000 index 0000000..808165f --- /dev/null +++ b/locale/locale/sv_SE.ISO8859-15/LC_TIME @@ -0,0 +1 @@ +../sv_SE.ISO8859-1/LC_TIME \ No newline at end of file diff --git a/locale/locale/sv_SE.UTF-8/LC_COLLATE b/locale/locale/sv_SE.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/sv_SE.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/sv_SE.UTF-8/LC_CTYPE b/locale/locale/sv_SE.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/sv_SE.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/sv_SE.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/sv_SE.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..59af175 --- /dev/null +++ b/locale/locale/sv_SE.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../sv_SE.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/sv_SE.UTF-8/LC_MONETARY b/locale/locale/sv_SE.UTF-8/LC_MONETARY new file mode 120000 index 0000000..176da4e --- /dev/null +++ b/locale/locale/sv_SE.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../sv_SE.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/sv_SE.UTF-8/LC_NUMERIC b/locale/locale/sv_SE.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..8385f6c --- /dev/null +++ b/locale/locale/sv_SE.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../sv_SE.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/sv_SE.UTF-8/LC_TIME b/locale/locale/sv_SE.UTF-8/LC_TIME new file mode 100644 index 0000000..d3601a5 --- /dev/null +++ b/locale/locale/sv_SE.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Jan +Feb +Mar +Apr +Maj +Jun +Jul +Aug +Sep +Okt +Nov +Dec +Januari +Februari +Mars +April +Maj +Juni +Juli +Augusti +September +Oktober +November +December +Sön +Mån +Tis +Ons +Tor +Fre +Lör +Söndag +Måndag +Tisdag +Onsdag +Torsdag +Fredag +Lördag +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Januari +Februari +Mars +April +Maj +Juni +Juli +Augusti +September +Oktober +November +December +dm +%I:%M:%S %p diff --git a/locale/locale/sv_SE/LC_COLLATE b/locale/locale/sv_SE/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/sv_SE/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/sv_SE/LC_CTYPE b/locale/locale/sv_SE/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/sv_SE/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/sv_SE/LC_MESSAGES/LC_MESSAGES b/locale/locale/sv_SE/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..59af175 --- /dev/null +++ b/locale/locale/sv_SE/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../sv_SE.ISO8859-1/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/sv_SE/LC_MONETARY b/locale/locale/sv_SE/LC_MONETARY new file mode 120000 index 0000000..176da4e --- /dev/null +++ b/locale/locale/sv_SE/LC_MONETARY @@ -0,0 +1 @@ +../sv_SE.ISO8859-1/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/sv_SE/LC_NUMERIC b/locale/locale/sv_SE/LC_NUMERIC new file mode 120000 index 0000000..8385f6c --- /dev/null +++ b/locale/locale/sv_SE/LC_NUMERIC @@ -0,0 +1 @@ +../sv_SE.ISO8859-1/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/sv_SE/LC_TIME b/locale/locale/sv_SE/LC_TIME new file mode 100644 index 0000000..d3601a5 --- /dev/null +++ b/locale/locale/sv_SE/LC_TIME @@ -0,0 +1,58 @@ +Jan +Feb +Mar +Apr +Maj +Jun +Jul +Aug +Sep +Okt +Nov +Dec +Januari +Februari +Mars +April +Maj +Juni +Juli +Augusti +September +Oktober +November +December +Sön +Mån +Tis +Ons +Tor +Fre +Lör +Söndag +Måndag +Tisdag +Onsdag +Torsdag +Fredag +Lördag +%H:%M:%S +%d.%m.%Y +%a %e %b %X %Y +am +pm +%a %e %b %Y %X %Z +Januari +Februari +Mars +April +Maj +Juni +Juli +Augusti +September +Oktober +November +December +dm +%I:%M:%S %p diff --git a/locale/locale/tr/LC_MESSAGES/texinfo.mo b/locale/locale/tr/LC_MESSAGES/texinfo.mo new file mode 100644 index 0000000000000000000000000000000000000000..09fa6558c688aa42e7b01b2cad3054c6ce66b60e GIT binary patch literal 73295 zcmdSC2bf(~b@zQ_o8rOP-~w*g$Fk*-jPA&m3%2Akk~Ox4Ey=bmK@*MV;UDN^zSkblXs=OhXLlB@Vn_s;;AgYN;A|2M#s z!9EIc9C!wJ3b-NQb};4sc>&)HQkCRWpz865a6fdOmt!Y*DbL>y4$%O=01xB-{PUCK zNN@;z2zUc{1UM3K8a$f&r-LQ%WgtnDe+5XmV)Pi$AZ^`N;eH213nv6 zd%Y4o1NffsbC}>COZDxxW%rycReFJ_}Sod@&j$y5>(ijh z@eNSrf5gS1pTHBi-vFKnj({t{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locale/tr_TR.ISO8859-9/LC_COLLATE b/locale/locale/tr_TR.ISO8859-9/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/tr_TR.ISO8859-9/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/tr_TR.ISO8859-9/LC_CTYPE b/locale/locale/tr_TR.ISO8859-9/LC_CTYPE new file mode 120000 index 0000000..6f51d8f --- /dev/null +++ b/locale/locale/tr_TR.ISO8859-9/LC_CTYPE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/tr_TR.ISO8859-9/LC_MESSAGES/LC_MESSAGES b/locale/locale/tr_TR.ISO8859-9/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..28eb19f --- /dev/null +++ b/locale/locale/tr_TR.ISO8859-9/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,2 @@ +^[IiYy].* +^[nN].* diff --git a/locale/locale/tr_TR.ISO8859-9/LC_MONETARY b/locale/locale/tr_TR.ISO8859-9/LC_MONETARY new file mode 100644 index 0000000..90393cb --- /dev/null +++ b/locale/locale/tr_TR.ISO8859-9/LC_MONETARY @@ -0,0 +1,15 @@ +TRL +L +, +. +3;3 + +- +2 +2 +1 +1 +1 +1 +1 +1 diff --git a/locale/locale/tr_TR.ISO8859-9/LC_NUMERIC b/locale/locale/tr_TR.ISO8859-9/LC_NUMERIC new file mode 100644 index 0000000..8c2cdd9 --- /dev/null +++ b/locale/locale/tr_TR.ISO8859-9/LC_NUMERIC @@ -0,0 +1,3 @@ +, + +0;0 diff --git a/locale/locale/tr_TR.ISO8859-9/LC_TIME b/locale/locale/tr_TR.ISO8859-9/LC_TIME new file mode 100644 index 0000000..3775aa5 --- /dev/null +++ b/locale/locale/tr_TR.ISO8859-9/LC_TIME @@ -0,0 +1,58 @@ +Oca +Þub +Mar +Nis +May +Haz +Tem +Aðu +Eyl +Eki +Kas +Ara +Ocak +Þubat +Mart +Nisan +Mayýs +Haziran +Temmuz +Aðustos +Eylül +Ekim +Kasým +Aralýk +Paz +Pts +Sal +Çar +Per +Cum +Cts +Pazar +Pazartesi +Salý +Çarþamba +Perþembe +Cuma +Cumartesi +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y +AM +PM +%e %b %Y %a %Z %X +Ocak +Subat +Mart +Nisan +Mayis +Haziran +Temmuz +Agustos +Eylul +Ekim +Kasim +Aralik +dm +%I:%M:%S %p diff --git a/locale/locale/tr_TR.UTF-8/LC_COLLATE b/locale/locale/tr_TR.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/tr_TR.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/tr_TR.UTF-8/LC_CTYPE b/locale/locale/tr_TR.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/tr_TR.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/tr_TR.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/tr_TR.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..8917cf1 --- /dev/null +++ b/locale/locale/tr_TR.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../tr_TR.ISO8859-9/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/tr_TR.UTF-8/LC_MONETARY b/locale/locale/tr_TR.UTF-8/LC_MONETARY new file mode 120000 index 0000000..28a6932 --- /dev/null +++ b/locale/locale/tr_TR.UTF-8/LC_MONETARY @@ -0,0 +1 @@ +../tr_TR.ISO8859-9/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/tr_TR.UTF-8/LC_NUMERIC b/locale/locale/tr_TR.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..be4e524 --- /dev/null +++ b/locale/locale/tr_TR.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../tr_TR.ISO8859-9/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/tr_TR.UTF-8/LC_TIME b/locale/locale/tr_TR.UTF-8/LC_TIME new file mode 100644 index 0000000..812c032 --- /dev/null +++ b/locale/locale/tr_TR.UTF-8/LC_TIME @@ -0,0 +1,58 @@ +Oca +Åžub +Mar +Nis +May +Haz +Tem +AÄŸu +Eyl +Eki +Kas +Ara +Ocak +Åžubat +Mart +Nisan +Mayıs +Haziran +Temmuz +AÄŸustos +Eylül +Ekim +Kasım +Aralık +Paz +Pts +Sal +Çar +Per +Cum +Cts +Pazar +Pazartesi +Salı +ÇarÅŸamba +PerÅŸembe +Cuma +Cumartesi +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y +AM +PM +%e %b %Y %a %Z %X +Ocak +Subat +Mart +Nisan +Mayis +Haziran +Temmuz +Agustos +Eylul +Ekim +Kasim +Aralik +dm +%I:%M:%S %p diff --git a/locale/locale/tr_TR/LC_COLLATE b/locale/locale/tr_TR/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/tr_TR/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/tr_TR/LC_CTYPE b/locale/locale/tr_TR/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/tr_TR/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/tr_TR/LC_MESSAGES/LC_MESSAGES b/locale/locale/tr_TR/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..8917cf1 --- /dev/null +++ b/locale/locale/tr_TR/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../tr_TR.ISO8859-9/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/tr_TR/LC_MONETARY b/locale/locale/tr_TR/LC_MONETARY new file mode 120000 index 0000000..28a6932 --- /dev/null +++ b/locale/locale/tr_TR/LC_MONETARY @@ -0,0 +1 @@ +../tr_TR.ISO8859-9/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/tr_TR/LC_NUMERIC b/locale/locale/tr_TR/LC_NUMERIC new file mode 120000 index 0000000..be4e524 --- /dev/null +++ b/locale/locale/tr_TR/LC_NUMERIC @@ -0,0 +1 @@ +../tr_TR.ISO8859-9/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/tr_TR/LC_TIME b/locale/locale/tr_TR/LC_TIME new file mode 100644 index 0000000..812c032 --- /dev/null +++ b/locale/locale/tr_TR/LC_TIME @@ -0,0 +1,58 @@ +Oca +Åžub +Mar +Nis +May +Haz +Tem +AÄŸu +Eyl +Eki +Kas +Ara +Ocak +Åžubat +Mart +Nisan +Mayıs +Haziran +Temmuz +AÄŸustos +Eylül +Ekim +Kasım +Aralık +Paz +Pts +Sal +Çar +Per +Cum +Cts +Pazar +Pazartesi +Salı +ÇarÅŸamba +PerÅŸembe +Cuma +Cumartesi +%H:%M:%S +%d/%m/%Y +%a %e %b %X %Y +AM +PM +%e %b %Y %a %Z %X +Ocak +Subat +Mart +Nisan +Mayis +Haziran +Temmuz +Agustos +Eylul +Ekim +Kasim +Aralik +dm +%I:%M:%S %p diff --git a/locale/locale/uk_UA.ISO8859-5/LC_COLLATE b/locale/locale/uk_UA.ISO8859-5/LC_COLLATE new file mode 100644 index 0000000000000000000000000000000000000000..2dbc407493b73d9cb448177a7af0d76fe7bc1614 GIT binary patch literal 2086 zcmY+-XSfe!0ETh@)6hhzR3cQOA*X>9Wu+oo+NIJGi4w_*28C!EEk)C4(xB2#d&wvo zXedfqg>&5Z@qFpMuHSQC*ZY2Wi|Z9P+pe6aP$(3!MWv-BC1n@?AKuDoi`bHCtJs>V zd~8FtZTN|{j~%FXj0#j0qY~9lu`^ZW*oA7>*o~@6>`t{u>`7HM_M)m5)v5N58dNo7 zAF6$0KdRcXKUJNmOLagTNOe#gOjR!qp{gInRENf4RENhAR1KmbRiikPs&O1eb#yeL zY8uB-9UIN4nnw$&meGppxM)pve4IdaVzi-Z8z)h42Rqmh!529>Ub1zb8-q>=6r5Trp`O1isKx-I2LY{MFc^gyB{DK1;{Sv92X_I9YSE}fw-{7nS}ZEDO^-+% zi%TV*#ix?MKBSV+5>ZKPNvI^XkEkTGu!>Z^v`SPeTNNr*ts0f;R)b1St3{=@)uB??>QSk04X8A*l^<*tmDx6j%3PaA zWxg$-vd|V$S!_$F{BB369JONc-< z8>n2iD^#x9H7Yl3C6$|Yo5~&ghss@RL#4Idqw=kFpz@zRr1HofQ+aAFs64YWR1Vux zD$8syl^^XVD!Xk3l|8nO%0}BnWwULevemXx*>1m5*)} literal 0 HcmV?d00001 diff --git a/locale/locale/uk_UA.KOI8-U/LC_CTYPE b/locale/locale/uk_UA.KOI8-U/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..35448943c5b82b927a36a39102f7bdd31621f3d0 GIT binary patch literal 3202 zcmc)K1$32V7zgl=vAYd67!8*k-Q7J37fK3(P*Of($WJUG;)o}K0{@y3$}Sj$vJ*+75QRw&VzV9BiFBOv429)~ z<%i{m<%i{m<%i{;NICK&_aHXmL&>zsX&eL1&9en;Q3JxVS-C z%2A#QRHPCqRHh15sYZ2bP?K8JrVe$fM|~R5kVZ772~BB6b6U`nRC9jzvzW~s<}#1@EMOsvSj-ZZvW(@dU?r%koJje6Az>B=Z%e=y?yvFOi!JE9r+Z-Y<^Th}Gh#^0*goq=a z1PV})M3N{(VUj6AQHoKV5|pGAr71(0vXrAd6{tuhQm9N7s#1;W)SxD{s7)Q}QjhvH zpdpQDOcR>YjOMhUC9P;p8`{#2_H>{lsdS<8g}a>$Rs8+g{fpSjp@u_CbO8$ z9Og2Q`7B@|i&)GOma>fHtY9UpSj`&NvW`2rll9!i-E3eZo7l`2?qMt2*v<}i67A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_RD?B{i^o!vAoTF^EMyP z+k8B>nOv8*xlNSkw#*?Pi{qJSKM!*M@%E$Lc;vqCVw)Z1IP$Ub`1#oTwv8CyMNB-` z>G>_6r>bpkGtoBpov2+^eePS{R<&zA7VTp#;&}PI<^5QrcI0-kEw{_%soIvuiv2v! zc=L$*GOhi~j_jJLZOkFgOE6P0Ovkv>F~<9JUMD->IPY-{R1tNVsE_@;ZQXa7@4EQS z--m3=`yWyMc#JRppU2TL!Z8uQL{s7A`!pQ?6cEgr*X)TtZ#qs@9FrWoU3__+$NL^s zbKkM+*Ib|0wE0+7pS(7_XMP8Bn0UOZ7+xP6J;%h-bUjtA`9#MioX_iVo8wMv_j&kn zyfKce*;yVd`NuoYqw~&VSHe!gE uTjHtc6W3$A+)}QKcCU$Rt6VPcx3A0VGly8m@Hw8z5M#G%SAI@noc{yOjj3$_ literal 0 HcmV?d00001 diff --git a/locale/locale/zh_CN.GB18030/LC_MESSAGES/LC_MESSAGES b/locale/locale/zh_CN.GB18030/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..3062692 --- /dev/null +++ b/locale/locale/zh_CN.GB18030/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[yY£ù£ÙÊÇ].* +^[nN£î£Î²»·ñ].* +ÊÇ +·ñ diff --git a/locale/locale/zh_CN.GB18030/LC_MONETARY b/locale/locale/zh_CN.GB18030/LC_MONETARY new file mode 100644 index 0000000..094797a --- /dev/null +++ b/locale/locale/zh_CN.GB18030/LC_MONETARY @@ -0,0 +1,15 @@ +CNY +£¤ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +4 diff --git a/locale/locale/zh_CN.GB18030/LC_NUMERIC b/locale/locale/zh_CN.GB18030/LC_NUMERIC new file mode 120000 index 0000000..579237c --- /dev/null +++ b/locale/locale/zh_CN.GB18030/LC_NUMERIC @@ -0,0 +1 @@ +../zh_CN.eucCN/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/zh_CN.GB18030/LC_TIME b/locale/locale/zh_CN.GB18030/LC_TIME new file mode 100644 index 0000000..14e4c6d --- /dev/null +++ b/locale/locale/zh_CN.GB18030/LC_TIME @@ -0,0 +1,58 @@ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +Ò»Ô +¶þÔ +ÈýÔ +ËÄÔ +ÎåÔ +ÁùÔ +ÆßÔ +°ËÔ +¾ÅÔ +ʮԠ+ʮһÔ +Ê®¶þÔ +ÈÕ +Ò» +¶þ +Èý +ËÄ +Îå +Áù +ÐÇÆÚÈÕ +ÐÇÆÚÒ» +ÐÇÆÚ¶þ +ÐÇÆÚÈý +ÐÇÆÚËÄ +ÐÇÆÚÎå +ÐÇÆÚÁù +%Hʱ%M·Ö%SÃë +%Y/%m/%d +%a %b/%e %T %Y +ÉÏÎç +ÏÂÎç +%YÄê%bÔÂ%eÈÕ %A %X %Z +Ò»Ô +¶þÔ +ÈýÔ +ËÄÔ +ÎåÔ +ÁùÔ +ÆßÔ +°ËÔ +¾ÅÔ +ʮԠ+ʮһÔ +Ê®¶þÔ +md +%I:%M:%S %p diff --git a/locale/locale/zh_CN.GB2312/LC_COLLATE b/locale/locale/zh_CN.GB2312/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/zh_CN.GB2312/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/zh_CN.GB2312/LC_CTYPE b/locale/locale/zh_CN.GB2312/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..45ef85fa1fd075e2c23d8c0eff3512df6a068b8a GIT binary patch literal 8604 zcmeI%1(Y1+0l@Li`6U-$WFdHf;3UB{q(Y4f^+J%glqywf*x>{gcPDqrT`unK?(XjH ziiZB?E_?lYjWxZ5zP`+Rzc=~c&dxV8yEl`3x$*A1?zrLhJFmOGX`{vs8^sQANweL4 zq&2loMf-Wr{`Q%AJ*!D9meJtgW#+|VnR!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<|3g1I;z`GwbpA=_pLG67=bv=`N#~z* z{z>PbbpA=_pUjJ{Uv%9Mn)%gy^Q)whP6nA|kxdS{``o|z)qL}-i?Hi z+}|Fa2f^na^SgX#?S1@x-v9P+|4m)XJ-siyXQ#H?_qyVB`Yd|y*Jj_x9=-2Se{Kh| z|ARRGxcweBj<4ca|MJ~GG{5uz?Y(sWpZ!5x_wc;q4P2Ka4)hvC^G!z_+G`Mt=JYD~ E2aXFr?f?J) literal 0 HcmV?d00001 diff --git a/locale/locale/zh_CN.GB2312/LC_MESSAGES/LC_MESSAGES b/locale/locale/zh_CN.GB2312/LC_MESSAGES/LC_MESSAGES new file mode 100644 index 0000000..3062692 --- /dev/null +++ b/locale/locale/zh_CN.GB2312/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1,4 @@ +^[yY£ù£ÙÊÇ].* +^[nN£î£Î²»·ñ].* +ÊÇ +·ñ diff --git a/locale/locale/zh_CN.GB2312/LC_MONETARY b/locale/locale/zh_CN.GB2312/LC_MONETARY new file mode 100644 index 0000000..094797a --- /dev/null +++ b/locale/locale/zh_CN.GB2312/LC_MONETARY @@ -0,0 +1,15 @@ +CNY +£¤ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +4 diff --git a/locale/locale/zh_CN.GB2312/LC_NUMERIC b/locale/locale/zh_CN.GB2312/LC_NUMERIC new file mode 120000 index 0000000..579237c --- /dev/null +++ b/locale/locale/zh_CN.GB2312/LC_NUMERIC @@ -0,0 +1 @@ +../zh_CN.eucCN/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/zh_CN.GB2312/LC_TIME b/locale/locale/zh_CN.GB2312/LC_TIME new file mode 100644 index 0000000..14e4c6d --- /dev/null +++ b/locale/locale/zh_CN.GB2312/LC_TIME @@ -0,0 +1,58 @@ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +Ò»Ô +¶þÔ +ÈýÔ +ËÄÔ +ÎåÔ +ÁùÔ +ÆßÔ +°ËÔ +¾ÅÔ +ʮԠ+ʮһÔ +Ê®¶þÔ +ÈÕ +Ò» +¶þ +Èý +ËÄ +Îå +Áù +ÐÇÆÚÈÕ +ÐÇÆÚÒ» +ÐÇÆÚ¶þ +ÐÇÆÚÈý +ÐÇÆÚËÄ +ÐÇÆÚÎå +ÐÇÆÚÁù +%Hʱ%M·Ö%SÃë +%Y/%m/%d +%a %b/%e %T %Y +ÉÏÎç +ÏÂÎç +%YÄê%bÔÂ%eÈÕ %A %X %Z +Ò»Ô +¶þÔ +ÈýÔ +ËÄÔ +ÎåÔ +ÁùÔ +ÆßÔ +°ËÔ +¾ÅÔ +ʮԠ+ʮһÔ +Ê®¶þÔ +md +%I:%M:%S %p diff --git a/locale/locale/zh_CN.GBK/LC_COLLATE b/locale/locale/zh_CN.GBK/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/zh_CN.GBK/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/zh_CN.GBK/LC_CTYPE b/locale/locale/zh_CN.GBK/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..2c0116fb3bb7995a97556d3e98f8257719ebb9b0 GIT binary patch literal 8844 zcmeI%2T)XZ0>|-H7wp|6l3q+=dhd;RC3lz0m0V9uV(u=NtGSwMNsNk0lPaJT1;GM{ zbd+KN>0krt(m|Ri9VtTcU9-5q$;>H}alD(GyqV7|f4=X%Kg;eupZs5a|Gjr!dHdZL zUt03AVf@=fcD;m&OW5c0E^*AI&NhQVMpV*(~(5{$5dH6~*Ure1Uo zE5~UDE63@Wfti?v*#@H{KiB2-AD*X`4fESDzYX)-Fux7++c3Wk^IuM%oB#Z4F#dPS zmwW!-{st!S%uFBXNif0+)|iYbn2Kqb4nA;(nV5yyn1i{Phxu55t8g{0!9wsRHe8GA za6N9ojkpOn;}+bC+pq|?;||;j-n53ha5wJ3y|@qe;{iN~hwv~S!J~K#kK+k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*#*8)ux}E z*xEsBKcv~rX~d0fU5!sfD^?UNTgzuM*C{C0oXb03ZP}BPPsj2dOVXRPN-^db8i55x z$MSvstq*Bs$&MA8c1{kN1#C-~G?AwDs|MiX_Fe5Hpv7)kD>hcApdV|!wRh#tS7k!i z9;bV;6{C5eIbe$mx?Z!ju4&5l`AzRiz9ZWKg$D;lE6(1PolnJ45ctu^bc4|8SD`+_ z;JXaYhvwfUw(AVydvLODrinJk)R30=yDW<@9YWt5Jlo6*eQvUXt8(61?d0eNnt zc_ZIW<)(I*!1%jt2B)_5Y3`R-mOA^+nW)okoDBVP&r-N@a)wM~ir2=c+MM}>&r)RH zFeBTz%}p8J^ViD^`FPG!54~7MMmpIMdfV+wx14x3XH7?-|8->2^0H2CXOs}$dw<%+qX zpMd5_H|}-OZg(_tGB>*n=8^2J?kINlv5PH}A&uMOYz&C$7bf9UuQ6=wcAp5neMwByK}R2dS|`p~|YJCCeBy7Jd{H%tDb z;&y_ZGxU*iY2`Z;;9%X&dFJZ3%;e1+0aHVzOKkj2ccW7mZF|vgIrTr#)1~iJw8xas zOIo`OUuJq<_xrwdb5HLwZK~T6Lb(U4A8y<$eKa!@+u7_us)1G7d$c~*hwVy=VmfU- z^I%f}5zW}O$DQ+w_5#=Ja+?Q>NR{Tx9GTlf|FNmeELJh=Pz@@vOY|)&2FEB^ zHmw3bPR#!5bTDW55uar3koN9rY?rA{AIa)4kX<0s^_uGyzG>C;AzfX@j)vFQtl$)J z=Ee}el<}8^u#Bl+A72>43E@9>9q8KM{M4E**4K4>IQ^+i%W|!*v_^Q-U54L+$z0??5&EcWJzoo`3w7kIr#Z{gXgo5|;yT%A=pOHo88@QN JK+B!M{{c^BpdbJM literal 0 HcmV?d00001 diff --git a/locale/locale/zh_CN/LC_MONETARY b/locale/locale/zh_CN/LC_MONETARY new file mode 100644 index 0000000..23b7c7a --- /dev/null +++ b/locale/locale/zh_CN/LC_MONETARY @@ -0,0 +1,15 @@ +CNY +ï¿¥ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +4 diff --git a/locale/locale/zh_CN/LC_NUMERIC b/locale/locale/zh_CN/LC_NUMERIC new file mode 120000 index 0000000..579237c --- /dev/null +++ b/locale/locale/zh_CN/LC_NUMERIC @@ -0,0 +1 @@ +../zh_CN.eucCN/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/zh_CN/LC_TIME b/locale/locale/zh_CN/LC_TIME new file mode 100644 index 0000000..faca7e3 --- /dev/null +++ b/locale/locale/zh_CN/LC_TIME @@ -0,0 +1,58 @@ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +一月 +二月 +三月 +四月 +五月 +六月 +七月 +八月 +ä¹æœˆ +å月 +å一月 +å二月 +æ—¥ +一 +二 +三 +å›› +五 +å…­ +星期日 +星期一 +星期二 +星期三 +星期四 +星期五 +星期六 +%Hæ—¶%M分%S秒 +%Y/%m/%d +%a %b/%e %T %Y +ä¸Šåˆ +ä¸‹åˆ +%Yå¹´%b月%eæ—¥ %A %X %Z +一月 +二月 +三月 +四月 +五月 +六月 +七月 +八月 +ä¹æœˆ +å月 +å一月 +å二月 +md +%I:%M:%S %p diff --git a/locale/locale/zh_HK.Big5HKSCS/LC_COLLATE b/locale/locale/zh_HK.Big5HKSCS/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/zh_HK.Big5HKSCS/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/zh_HK.Big5HKSCS/LC_CTYPE b/locale/locale/zh_HK.Big5HKSCS/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..2ee435e7b31ed97b2f5604c556f153843bbd25f4 GIT binary patch literal 11712 zcmeI&2T+uE9*6N2!4}g^A-(tBdr(s^yZSO87k58WT+C$?fjJ|iw z1Exd2Ik4$LIE-PNUpmM>2V2wLhq#zbju-v+oJN{VP9q1w0fXTPCk(+*48!n$dkiP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^ z;PTJM>VMhTUOIn3qlOLQI^}@DaD)?vU?_%RI7Z;N-tO058~(h${`$x8uv`NVc5V8d XuPuji{ngi!?cc=zNc6t{5C8l#v|+D` literal 0 HcmV?d00001 diff --git a/locale/locale/zh_HK.Big5HKSCS/LC_MESSAGES/LC_MESSAGES b/locale/locale/zh_HK.Big5HKSCS/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..33f4e2e --- /dev/null +++ b/locale/locale/zh_HK.Big5HKSCS/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../zh_TW.Big5/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/zh_HK.Big5HKSCS/LC_MONETARY b/locale/locale/zh_HK.Big5HKSCS/LC_MONETARY new file mode 120000 index 0000000..ecf464b --- /dev/null +++ b/locale/locale/zh_HK.Big5HKSCS/LC_MONETARY @@ -0,0 +1 @@ +../zh_HK.UTF-8/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/zh_HK.Big5HKSCS/LC_NUMERIC b/locale/locale/zh_HK.Big5HKSCS/LC_NUMERIC new file mode 120000 index 0000000..579237c --- /dev/null +++ b/locale/locale/zh_HK.Big5HKSCS/LC_NUMERIC @@ -0,0 +1 @@ +../zh_CN.eucCN/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/zh_HK.Big5HKSCS/LC_TIME b/locale/locale/zh_HK.Big5HKSCS/LC_TIME new file mode 120000 index 0000000..c8511db --- /dev/null +++ b/locale/locale/zh_HK.Big5HKSCS/LC_TIME @@ -0,0 +1 @@ +../zh_TW.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/zh_HK.UTF-8/LC_COLLATE b/locale/locale/zh_HK.UTF-8/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/zh_HK.UTF-8/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/zh_HK.UTF-8/LC_CTYPE b/locale/locale/zh_HK.UTF-8/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/zh_HK.UTF-8/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/zh_HK.UTF-8/LC_MESSAGES/LC_MESSAGES b/locale/locale/zh_HK.UTF-8/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..1275da7 --- /dev/null +++ b/locale/locale/zh_HK.UTF-8/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../zh_TW.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/zh_HK.UTF-8/LC_MONETARY b/locale/locale/zh_HK.UTF-8/LC_MONETARY new file mode 100644 index 0000000..aa2b32e --- /dev/null +++ b/locale/locale/zh_HK.UTF-8/LC_MONETARY @@ -0,0 +1,15 @@ +HKD +HK$ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +0 diff --git a/locale/locale/zh_HK.UTF-8/LC_NUMERIC b/locale/locale/zh_HK.UTF-8/LC_NUMERIC new file mode 120000 index 0000000..fdb9105 --- /dev/null +++ b/locale/locale/zh_HK.UTF-8/LC_NUMERIC @@ -0,0 +1 @@ +../zh_TW.Big5/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/zh_HK.UTF-8/LC_TIME b/locale/locale/zh_HK.UTF-8/LC_TIME new file mode 120000 index 0000000..c8511db --- /dev/null +++ b/locale/locale/zh_HK.UTF-8/LC_TIME @@ -0,0 +1 @@ +../zh_TW.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/zh_HK/LC_COLLATE b/locale/locale/zh_HK/LC_COLLATE new file mode 120000 index 0000000..0fd8c43 --- /dev/null +++ b/locale/locale/zh_HK/LC_COLLATE @@ -0,0 +1 @@ +../la_LN.US-ASCII/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/zh_HK/LC_CTYPE b/locale/locale/zh_HK/LC_CTYPE new file mode 120000 index 0000000..ffd19f7 --- /dev/null +++ b/locale/locale/zh_HK/LC_CTYPE @@ -0,0 +1 @@ +../UTF-8/LC_CTYPE \ No newline at end of file diff --git a/locale/locale/zh_HK/LC_MESSAGES/LC_MESSAGES b/locale/locale/zh_HK/LC_MESSAGES/LC_MESSAGES new file mode 120000 index 0000000..1275da7 --- /dev/null +++ b/locale/locale/zh_HK/LC_MESSAGES/LC_MESSAGES @@ -0,0 +1 @@ +../../zh_TW.UTF-8/LC_MESSAGES/LC_MESSAGES \ No newline at end of file diff --git a/locale/locale/zh_HK/LC_MONETARY b/locale/locale/zh_HK/LC_MONETARY new file mode 100644 index 0000000..aa2b32e --- /dev/null +++ b/locale/locale/zh_HK/LC_MONETARY @@ -0,0 +1,15 @@ +HKD +HK$ +. +, +3;3 + +- +2 +2 +1 +0 +1 +0 +1 +0 diff --git a/locale/locale/zh_HK/LC_NUMERIC b/locale/locale/zh_HK/LC_NUMERIC new file mode 120000 index 0000000..fdb9105 --- /dev/null +++ b/locale/locale/zh_HK/LC_NUMERIC @@ -0,0 +1 @@ +../zh_TW.Big5/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/zh_HK/LC_TIME b/locale/locale/zh_HK/LC_TIME new file mode 120000 index 0000000..c8511db --- /dev/null +++ b/locale/locale/zh_HK/LC_TIME @@ -0,0 +1 @@ +../zh_TW.UTF-8/LC_TIME \ No newline at end of file diff --git a/locale/locale/zh_TW.Big5/LC_COLLATE b/locale/locale/zh_TW.Big5/LC_COLLATE new file mode 120000 index 0000000..d26a8e8 --- /dev/null +++ b/locale/locale/zh_TW.Big5/LC_COLLATE @@ -0,0 +1 @@ +../is_IS.ISO8859-1/LC_COLLATE \ No newline at end of file diff --git a/locale/locale/zh_TW.Big5/LC_CTYPE b/locale/locale/zh_TW.Big5/LC_CTYPE new file mode 100644 index 0000000000000000000000000000000000000000..453b2d961ff01e8df575b4e93945d80e853087fc GIT binary patch literal 8980 zcmeI%1$15Y0mtzdZJHWV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(rb~Wd&GRq6Y*w+@@uFfq+y>o8q-H$Gm&xoX}q>c*% zN@7Mz`FG#2{GU}F zy+`k!QTP?@aIntr+V|qt&0Hjq6JN?j%dX>*cDJ>d^%l(}i~WWr%g5faV{@VBS^E}w z*ZqYIZ;;Dn5pKM{!Yj1w<_Mr&RhViAs-3;DXM0AkJA5d$>49+lko5x(nfnDg@M9NI zk@K9_wP$nAeqdq$$pDFAbIFnauf1aLx%KFx^|t>KXIE~uJrknFtlPnm#kVfVN`FJ` z)*UkAZEE+R7oL-L&NmyMR#|k(7-_z|^v0K?{;wZKbqzy?D80{nz*1vbTTWV8?UzDx!+2c~&;Mdx(8+?`Dj0 o@9@rpgAZ)|_1?X`wYwkL{{j~d`{v21ZBC`;vSEJL2)*F_H-~ywb^rhX literal 0 HcmV?d00001 diff --git a/locale/locale/zh_TW/LC_MONETARY b/locale/locale/zh_TW/LC_MONETARY new file mode 120000 index 0000000..2e6b296 --- /dev/null +++ b/locale/locale/zh_TW/LC_MONETARY @@ -0,0 +1 @@ +../zh_TW.Big5/LC_MONETARY \ No newline at end of file diff --git a/locale/locale/zh_TW/LC_NUMERIC b/locale/locale/zh_TW/LC_NUMERIC new file mode 120000 index 0000000..fdb9105 --- /dev/null +++ b/locale/locale/zh_TW/LC_NUMERIC @@ -0,0 +1 @@ +../zh_TW.Big5/LC_NUMERIC \ No newline at end of file diff --git a/locale/locale/zh_TW/LC_TIME b/locale/locale/zh_TW/LC_TIME new file mode 100644 index 0000000..cb19370 --- /dev/null +++ b/locale/locale/zh_TW/LC_TIME @@ -0,0 +1,58 @@ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +1月 +2月 +3月 +4月 +5月 +6月 +7月 +8月 +9月 +10月 +11月 +12月 +æ—¥ +一 +二 +三 +å›› +五 +å…­ +周日 +周一 +周二 +周三 +周四 +周五 +周六 +%H時%M分%S秒 +%Y/%m/%d +%a %b/%e %T %Y +ä¸Šåˆ +ä¸‹åˆ +%Yå¹´%b月%eæ—¥ %A %X %Z +1月 +2月 +3月 +4月 +5月 +6月 +7月 +8月 +9月 +10月 +11月 +12月 +md +%I:%M:%S %p diff --git a/locale/mbrune.3 b/locale/mbrune.3 new file mode 100644 index 0000000..47fe006 --- /dev/null +++ b/locale/mbrune.3 @@ -0,0 +1,176 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Paul Borman at Krystal Technologies. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)mbrune.3 8.2 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/locale/mbrune.3,v 1.15 2003/02/06 11:04:46 charnier Exp $ +.\" +.Dd April 19, 1994 +.Dt MBRUNE 3 +.Os +.Sh NAME +.Nm mbrune , +.Nm mbrrune , +.Nm mbmb +.Nd multibyte rune support for C +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In rune.h +.Ft char * +.Fn mbrune "const char *string" "rune_t rune" +.Ft char * +.Fn mbrrune "const char *string" "rune_t rune" +.Ft char * +.Fn mbmb "const char *string" "char *pattern" +.Sh DESCRIPTION +.Bf Em +The +.Bx 4.4 +.Dq rune +functions have been deprecated in favour of the +.Tn ISO +C99 extended multibyte and wide character facilities +and should not be used in new applications. +.Ef +Consider working with wide characters instead, and using +.Xr wcschr 3 , +.Xr wcsrchr 3 , +and +.Xr wcsstr 3 +instead of these functions. +.Pp +These routines provide the corresponding functionality of +.Fn strchr , +.Fn strrchr +and +.Fn strstr +for multibyte strings. +.Pp +The +.Fn mbrune +function locates the first occurrence of +.Fn rune +in the string pointed to by +.Fa string . +The terminating +.Dv NUL +character is considered part of the string. +If +.Fa rune +is +.Ql \e0 , +.Fn mbrune +locates the terminating +.Ql \e0 . +.Pp +The +.Fn mbrrune +function +locates the last occurrence of +.Fa rune +in the string +.Fa string . +If +.Fa rune +is +.Ql \e0 , +.Fn mbrune +locates the terminating +.Ql \e0 . +.Pp +The +.Fn mbmb +function locates the first occurrence of the null-terminated string +.Fa pattern +in the null-terminated string +.Fa string . +If +.Fa pattern +is the empty string, +.Fn mbmb +returns +.Fa string ; +if +.Fa pattern +occurs nowhere in +.Fa string , +.Fn mbmb +returns +.Dv NULL ; +otherwise +.Fn mbmb +returns a pointer to the first character of the first occurrence of +.Fa pattern . +.Sh RETURN VALUES +The function +.Fn mbrune +returns a pointer to the located character, or +.Dv NULL +if the character does not appear in the string. +.Pp +The +.Fn mbrrune +function +returns a pointer to the character, or +.Dv NULL +if the character does not appear in the string. +.Pp +The +.Fn mbmb +function +returns a pointer to the +.Fa pattern , +or +.Dv NULL +if the +.Fa pattern +does not appear in the string. +.Sh SEE ALSO +.Xr rune 3 , +.Xr setlocale 3 , +.Xr euc 4 , +.Xr utf2 4 , +.Xr utf8 5 +.Sh HISTORY +The +.Fn mbrune , +.Fn mbrrune , +and +.Fn mbmb +functions +first appeared in Plan 9 from Bell Labs as +.Fn utfrune , +.Fn utfrrune , +and +.Fn utfutf . diff --git a/locale/mbrune.c b/locale/mbrune.c new file mode 100644 index 0000000..b0876d4 --- /dev/null +++ b/locale/mbrune.c @@ -0,0 +1,133 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)mbrune.c 8.1 (Berkeley) 6/27/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/mbrune.c,v 1.3 2002/09/18 06:11:21 tjr Exp $"); + +#include +#include +#include +#include +#include "runedepreciated.h" + +char * +mbrune(string, c) + const char *string; + rune_t c; +{ + char const *result; + rune_t r; + static int warn_depreciated = 1; + + if (warn_depreciated) { + warn_depreciated = 0; + fprintf(stderr, __rune_depreciated_msg, "mbrune"); + } + + while ((r = __sgetrune(string, MB_LEN_MAX, &result))) { + if (r == c) + return ((char *)string); + string = result == string ? string + 1 : result; + } + + return (c == *string ? (char *)string : NULL); +} + +char * +mbrrune(string, c) + const char *string; + rune_t c; +{ + const char *last = 0; + char const *result; + rune_t r; + static int warn_depreciated = 1; + + if (warn_depreciated) { + warn_depreciated = 0; + fprintf(stderr, __rune_depreciated_msg, "mbrrune"); + } + + while ((r = __sgetrune(string, MB_LEN_MAX, &result))) { + if (r == c) + last = string; + string = result == string ? string + 1 : result; + } + return (c == *string ? (char *)string : (char *)last); +} + +char * +mbmb(string, pattern) + const char *string; + char *pattern; +{ + rune_t first, r; + size_t plen, slen; + char const *result; + static int warn_depreciated = 1; + + if (warn_depreciated) { + warn_depreciated = 0; + fprintf(stderr, __rune_depreciated_msg, "mbmb"); + } + + plen = strlen(pattern); + slen = strlen(string); + if (plen > slen) + return (0); + + first = __sgetrune(pattern, plen, &result); + if (result == string) + return (0); + + while (slen >= plen && (r = __sgetrune(string, slen, &result))) { + if (r == first) { + if (strncmp(string, pattern, slen) == 0) + return ((char *) string); + } + if (result == string) { + --slen; + ++string; + } else { + slen -= result - string; + string = result; + } + } + return (0); +} diff --git a/locale/newlocale.3 b/locale/newlocale.3 new file mode 100644 index 0000000..84f7cc8 --- /dev/null +++ b/locale/newlocale.3 @@ -0,0 +1,88 @@ +.Dd March 11, 2005 +.Dt NEWLOCALE 3 +.Os +.Sh NAME +.Nm newlocale +.Nd Create a new locale +.Sh SYNOPSIS +.In xlocale.h +.Ft locale_t +.Fn newlocale "int mask" "const char * locale" "locale_t base" +.Sh DESCRIPTION +Creates a new +.Vt locale_t +based off the locale specified by +.Va base . +The categories specified by +.Va mask +will be replaced to correspond with the named +.Va locale . +.Pp +The +.Va mask +is the logical OR of the following: +.Bl -tag -width LC_MONETARY_MASK +.It Dv LC_COLLATE_MASK +Collation +.It Dv LC_CTYPE_MASK +Character type +.It Dv LC_MESSAGES_MASK +Messages +.It Dv LC_MONETARY_MASK +Monetary +.It Dv LC_NUMERIC_MASK +Numeric +.It Dv LC_TIME_MASK +Time +.It Dv LC_ALL_MASK +The logical OR of all of the above +.El +.Pp +The +.Va locale +string is typically the name of one of the directories in +.Pa /usr/share/locale . +If +.Va locale +is +.Dv NULL , +then the C locale is used. If +.Va locale +is an empty string, then it will look for environment variables: +LC_ALL, then LC_* if the corresponding LC_*_MASK bit is set, then +the LANG environment variable. If none of these are found, it +will default to the C locale. +.Pp +If +.Va base +is +.Dv NULL , +the current locale is used. If +.Va base +is +.Dv LC_GLOBAL_LOCALE , +the global locale is used. +.Pp +If +.Va mask +is +.Dv LC_ALL_MASK , +.Va base +is ignored. In order to create a C +.Vt locale_t +value, use +.Fn newlocale "LC_ALL_MASK" "NULL" "NULL" . +.Sh RETURN VALUES +Returns a new +.Vt locale_t , +or +.Dv NULL +in case of error. +New locales should be freed with +.Xr freelocale 3 . +.Sh SEE ALSO +.Xr duplocale 3 , +.Xr freelocale 3 , +.Xr querylocale 3 , +.Xr uselocale 3 , +.Xr xlocale 3 diff --git a/locale/querylocale.3 b/locale/querylocale.3 new file mode 100644 index 0000000..e97ebab --- /dev/null +++ b/locale/querylocale.3 @@ -0,0 +1,31 @@ +.Dd March 11, 2005 +.Dt QUERYLOCALE 3 +.Os +.Sh NAME +.Nm querylocale +.Nd Get locale name for a specified category +.Sh SYNOPSIS +.In xlocale.h +.Ft const char * +.Fn querylocale "int mask" "locale_t loc" +.Sh DESCRIPTION +Returns the name of the locale for the category specified by +.Va mask . +The +.Va mask +is scanned starting at the least significant bit, +until the first set bit is found. This happens +to scan the categories alphabetically, not +including +.Dv LC_ALL_MASK , +but it is best to specify one category at a time. +The available categories are documented in +.Xr xlocale 3 +and +.Xr newlocale 3 . +.Sh SEE ALSO +.Xr duplocale 3 , +.Xr freelocale 3 , +.Xr newlocale 3 , +.Xr uselocale 3 , +.Xr xlocale 3 diff --git a/locale/rune.3 b/locale/rune.3 new file mode 100644 index 0000000..c34654e --- /dev/null +++ b/locale/rune.3 @@ -0,0 +1,286 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Paul Borman at Krystal Technologies. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)rune.3 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD: src/lib/libc/locale/rune.3,v 1.22 2002/12/19 09:40:22 ru Exp $ +.\" +.Dd October 6, 2002 +.Dt RUNE 3 +.Os +.Sh NAME +.Nm setrunelocale , +.Nm setinvalidrune , +.Nm sgetrune , +.Nm sputrune , +.Nm fgetrune , +.Nm fungetrune , +.Nm fputrune +.Nd rune support for C +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In rune.h +.In errno.h +.Ft int +.Fn setrunelocale "char *locale" +.Ft void +.Fn setinvalidrune "rune_t rune" +.Ft rune_t +.Fn sgetrune "const char *string" "size_t n" "char const **result" +.Ft int +.Fn sputrune "rune_t rune" "char *string" "size_t n" "char **result" +.Pp +.In stdio.h +.Ft long +.Fn fgetrune "FILE *stream" +.Ft int +.Fn fungetrune "rune_t rune" "FILE *stream" +.Ft int +.Fn fputrune "rune_t rune" "FILE *stream" +.Sh DESCRIPTION +.Bf Em +The +.Bx 4.4 +.Dq rune +functions have been deprecated in favour of the +.Tn ISO +C99 extended multibyte and wide character facilities +and should not be used in new applications. +.Ef +Consider using +.Xr setlocale 3 , +.Xr mbrtowc 3 , +.Xr wcrtomb 3 , +.Xr fgetwc 3 , +.Xr ungetwc 3 , +and +.Xr fputwc 3 +instead. +.Pp +The +.Fn setrunelocale +controls the type of encoding used to represent runes as multibyte strings +as well as the properties of the runes as defined in +.Aq Pa ctype.h . +The +.Fa locale +argument indicates which locale to load. +If the locale is successfully loaded, +.Dv 0 +is returned, otherwise an errno value is returned to indicate the +type of error. +.Pp +The +.Fn setinvalidrune +function sets the value of the global value +.Dv _INVALID_RUNE +to be +.Fa rune . +.Pp +The +.Fn sgetrune +function tries to read a single multibyte character from +.Fa string , +which is at most +.Fa n +bytes long. +If +.Fn sgetrune +is successful, the rune is returned. +If +.Fa result +is not +.Dv NULL , +.Fa *result +will point to the first byte which was not converted in +.Fa string . +If the first +.Fa n +bytes of +.Fa string +do not describe a full multibyte character, +.Dv _INVALID_RUNE +is returned and +.Fa *result +will point to +.Fa string . +If there is an encoding error at the start of +.Fa string , +.Dv _INVALID_RUNE +is returned and +.Fa *result +will point to the second character of +.Fa string . +.Pp +the +.Fn sputrune +function tries to encode +.Fa rune +as a multibyte string and store it at +.Fa string , +but no more than +.Fa n +bytes will be stored. +If +.Fa result +is not +.Dv NULL , +.Fa *result +will be set to point to the first byte in string following the new +multibyte character. +If +.Fa string +is +.Dv NULL , +.Fa *result +will point to +.Dv "(char *)0 +" +.Fa x , +where +.Fa x +is the number of bytes that would be needed to store the multibyte value. +If the multibyte character would consist of more than +.Fa n +bytes and +.Fa result +is not +.Dv NULL , +.Fa *result +will be set to +.Dv NULL . +In all cases, +.Fn sputrune +will return the number of bytes which would be needed to store +.Fa rune +as a multibyte character. +.Pp +The +.Fn fgetrune +function operates the same as +.Fn sgetrune +with the exception that it attempts to read enough bytes from +.Fa stream +to decode a single rune. It returns either +.Dv EOF +on end of file, +.Dv _INVALID_RUNE +on an encoding error, or the rune decoded if all went well. +.Pp +The +.Fn fungetrune +function pushes the multibyte encoding, as provided by +.Fn sputrune , +of +.Fa rune +onto +.Fa stream +such that the next +.Fn fgetrune +call will return +.Fa rune . +It returns +.Dv EOF +if it fails and +.Dv 0 +on success. +.Pp +The +.Fn fputrune +function writes the multibyte encoding of +.Fa rune , +as provided by +.Fn sputrune , +onto +.Fa stream . +It returns +.Dv EOF +on failure and +.Dv 0 +on success. +.Sh RETURN VALUES +The +.Fn setrunelocale +function returns one of the following values: +.Bl -tag -width Er +.It Er 0 +The +.Fn setrunelocale +function +was successful. +.It Bq Er EINVAL +The +.Fa locale +name was incorrect. +.It Bq Er ENOENT +The locale could not be found. +.It Bq Er EFTYPE +The file found was not a valid file. +.El +.Pp +The +.Fn sgetrune +function either returns the rune read or +.Dv _INVALID_RUNE . +The +.Fn sputrune +function returns the number of bytes needed to store +.Fa rune +as a multibyte string. +.Sh FILES +.Bl -tag -width /usr/share/locale/locale/LC_CTYPE -compact +.It Pa $PATH_LOCALE/ Ns Em locale Ns /LC_CTYPE +.It Pa /usr/share/locale/ Ns Em locale Ns /LC_CTYPE +binary LC_CTYPE file for the locale +.Em locale . +.It Pa /usr/local/share/locale/ Ns Em locale Ns /LC_CTYPE +binary LC_CTYPE file for the locale +.Em locale . +.El +.Sh SEE ALSO +.Xr mbrune 3 , +.Xr setlocale 3 , +.Xr euc 4 , +.Xr utf2 4 , +.Xr utf8 5 +.Sh HISTORY +These functions first appeared in +.Bx 4.4 . +.Pp +The +.Fn setrunelocale +function and the other non-ANSI rune functions were inspired by +.Sy "Plan 9 from Bell Labs" . +.\"They were conceived at the San Diego 1993 Summer USENIX conference by +.\"Paul Borman of Krystal Technologies, Keith Bostic of CSRG and Andrew Hume +.\"of Bell Labs. diff --git a/locale/runedepreciated.c b/locale/runedepreciated.c new file mode 100644 index 0000000..85bc78d --- /dev/null +++ b/locale/runedepreciated.c @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "runedepreciated.h" + +__private_extern__ const char __rune_depreciated_msg[] = "\ +%s and other functions prototyped in rune.h are depreciated in favor of\n\ +the ISO C99 extended multibyte and wide character facilities and should not\n\ +be used in new applications.\n\ +"; + +__private_extern__ rune_t +__sgetrune(const char *string, size_t n, char const **result) +{ + wchar_t wc; + size_t converted = mbrtowc(&wc, string, n, NULL); + __darwin_rune_t invalid_rune = __current_locale()->__lc_ctype->_CurrentRuneLocale.__invalid_rune; + + switch (converted) { + case (size_t)-2: /* incomplete */ + if (result) + *result = string; + return invalid_rune; + case (size_t)-1: /* invalid */ + if (result) + *result = string + 1; + return invalid_rune; + case (size_t)0: /* null wide character */ + { + int i; + + for (i = 1; i < n; i++) + if (mbrtowc(&wc, string, n, NULL) == (size_t)0) + break; + if (result) + *result = string + i; + return (rune_t)0; + } + default: + if (result) + *result = string + converted; + return (rune_t)wc; + } + /* NOTREACHED */ +} + +__private_extern__ int +__sputrune(rune_t rune, char *string, size_t n, char **result) +{ + char buf[MB_CUR_MAX]; + size_t converted = wcrtomb(buf, rune, NULL); + + if (converted == (size_t)-1) { + if (result) + *result = string; + } else if (n >= converted) { + if (string) + bcopy(buf, string, converted); + if (result) + *result = string + converted; + } else if (result) + *result = NULL; + return (converted == (size_t)-1 ? 0 : converted); +} + +__private_extern__ rune_t +sgetrune(const char *string, size_t n, char const **result) +{ + static int warn_depreciated = 1; + + if (warn_depreciated) { + warn_depreciated = 0; + fprintf(stderr, __rune_depreciated_msg, "sgetrune"); + } + return __sgetrune(string, n, result); +} + +__private_extern__ int +sputrune(rune_t rune, char *string, size_t n, char **result) +{ + static int warn_depreciated = 1; + + if (warn_depreciated) { + warn_depreciated = 0; + fprintf(stderr, __rune_depreciated_msg, "sputrune"); + } + return __sputrune(rune, string, n, result); +} diff --git a/locale/runedepreciated.h b/locale/runedepreciated.h new file mode 100644 index 0000000..11b1a79 --- /dev/null +++ b/locale/runedepreciated.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#undef sgetrune +#undef sputrune +#undef __sgetrune +#undef __sputrune + +extern const char __rune_depreciated_msg[]; + +/* The real, depreciated routines, that don't print the depreciated message */ +extern rune_t __sgetrune(const char *, size_t, char const **); +extern int __sputrune(rune_t, char *, size_t, char **); diff --git a/locale/setinvalidrune.c b/locale/setinvalidrune.c new file mode 100644 index 0000000..b975342 --- /dev/null +++ b/locale/setinvalidrune.c @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/locale/setinvalidrune.c,v 1.3 2002/09/24 09:25:37 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include "runedepreciated.h" + +void +setinvalidrune(ir) + rune_t ir; +{ + static int warn_depreciated = 1; + locale_t loc = __current_locale(); + + if (warn_depreciated) { + warn_depreciated = 0; + fprintf(stderr, __rune_depreciated_msg, "setinvalidrune"); + } + + if (loc->__lc_ctype->_CurrentRuneLocale.__invalid_rune != ir) { + struct __xlocale_st_runelocale *new = (struct __xlocale_st_runelocale *)malloc(loc->__lc_ctype->__datasize); + if (!new) + return; + *new = *loc->__lc_ctype; + new->__refcount = 1; + new->_CurrentRuneLocale.__invalid_rune = ir; + XL_RELEASE(loc->__lc_ctype); + loc->__lc_ctype = new; + } +} diff --git a/locale/uselocale.3 b/locale/uselocale.3 new file mode 100644 index 0000000..df15583 --- /dev/null +++ b/locale/uselocale.3 @@ -0,0 +1,31 @@ +.Dd March 11, 2005 +.Dt USELOCALE 3 +.Os +.Sh NAME +.Nm uselocale +.Nd Set the per-thread locale +.Sh SYNOPSIS +.In xlocale.h +.Ft locale_t +.Fn uselocale "locale_t loc" +.Sh DESCRIPTION +Sets the per-thread locale to +.Va loc . +Specify +.Dv LC_GLOBAL_LOCALE +to turn off any per-thread locale. +Pass +.Dv NULL +to return the current value of the per-thread locale (or +.Dv LC_GLOBAL_LOCALE ) +without changing the locale. +.Sh RETURN VALUES +Returns the previous locale, or +.Dv LC_GLOBAL_LOCALE +if no per-thread locale was in effect. +.Sh SEE ALSO +.Xr duplocale 3 , +.Xr freelocale 3 , +.Xr newlocale 3 , +.Xr querylocale 3 , +.Xr xlocale 3 diff --git a/locale/utf2.5 b/locale/utf2.5 new file mode 100644 index 0000000..c5e6c59 --- /dev/null +++ b/locale/utf2.5 @@ -0,0 +1,94 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Paul Borman at Krystal Technologies. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)utf2.4 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/locale/utf2.4,v 1.10 2002/10/10 22:56:18 tjr Exp $ +.\" +.Dd October 11, 2002 +.Dt UTF2 5 +.Os +.Sh NAME +.Nm utf2 +.Nd "Universal character set Transformation Format encoding of runes +.Sh SYNOPSIS +.Nm ENCODING +.Qq UTF2 +.Sh DESCRIPTION +.Bf Em +The UTF2 encoding has been deprecated in favour of UTF-8. +.Ef +New applications should not use UTF2. +.Pp +The +.Nm UTF2 +encoding is based on a proposed X-Open multibyte +\s-1FSS-UCS-TF\s+1 (File System Safe Universal Character Set Transformation Format) encoding as used in +.Sy "Plan 9 from Bell Labs" . +Although it is capable of representing more than 16 bits, +the current implementation is limited to 16 bits as defined by the +Unicode Standard. +.Pp +.Nm UTF2 +representation is backwards compatible with ASCII, so 0x00-0x7f refer to the +ASCII character set. The multibyte encoding of runes between 0x0080 and 0xffff +consist entirely of bytes whose high order bit is set. The actual +encoding is represented by the following table: +.Bd -literal +[0x0000 - 0x007f] [00000000.0bbbbbbb] -> 0bbbbbbb +[0x0080 - 0x07ff] [00000bbb.bbbbbbbb] -> 110bbbbb, 10bbbbbb +[0x0800 - 0xffff] [bbbbbbbb.bbbbbbbb] -> 1110bbbb, 10bbbbbb, 10bbbbbb +.Ed +.Pp +If more than a single representation of a value exists (for example, +0x00; 0xC0 0x80; 0xE0 0x80 0x80) the shortest representation is always +used (but the longer ones will be correctly decoded). +.Pp +The final three encodings provided by X-Open: +.Bd -literal +[00000000.000bbbbb.bbbbbbbb.bbbbbbbb] -> + 11110bbb, 10bbbbbb, 10bbbbbb, 10bbbbbb + +[000000bb.bbbbbbbb.bbbbbbbb.bbbbbbbb] -> + 111110bb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb + +[0bbbbbbb.bbbbbbbb.bbbbbbbb.bbbbbbbb] -> + 1111110b, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb +.Ed +.Pp +which provides for the entire proposed ISO-10646 31 bit standard are currently +not implemented. +.Sh "SEE ALSO" +.Xr mklocale 1 , +.Xr setlocale 3 , +.Xr utf8 5 diff --git a/locale/wcstod_l.3 b/locale/wcstod_l.3 new file mode 100644 index 0000000..a2d5564 --- /dev/null +++ b/locale/wcstod_l.3 @@ -0,0 +1,66 @@ +.\" Copyright (c) 2002, 2003 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wcstod.3,v 1.4 2003/05/22 13:02:27 ru Exp $ +.\" +.Dd March 11, 2005 +.Dt WCSTOD_L 3 +.Os +.Sh NAME +.Nm wcstof_l , +.Nm wcstod_l , +.Nm wcstold_l +.Nd convert string to +.Vt float , double +or +.Vt "long double" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.In xlocale.h +.Ft float +.Fn wcstof_l "const wchar_t * restrict nptr" "wchar_t ** restrict endptr" "locale_t loc" +.Ft "long double" +.Fn wcstold_l "const wchar_t * restrict nptr" "wchar_t ** restrict endptr" "locale_t loc" +.Ft double +.Fn wcstod_l "const wchar_t * restrict nptr" "wchar_t ** restrict endptr" "locale_t loc" +.Sh DESCRIPTION +The +.Fn wcstof_l , +.Fn wcstod_l , +and +.Fn wcstold_l +functions are extended locale versions of the +.Fn wcstof , +.Fn wcstod , +and +.Fn wcstold +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr wcstod 3 , +.Xr xlocale 3 diff --git a/locale/wcstol_l.3 b/locale/wcstol_l.3 new file mode 100644 index 0000000..942c8c0 --- /dev/null +++ b/locale/wcstol_l.3 @@ -0,0 +1,112 @@ +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/locale/wcstol.3,v 1.4 2002/11/29 17:35:09 ru Exp $ +.\" +.Dd March 11, 2005 +.Dt WCSTOL_L 3 +.Os +.Sh NAME +.Nm wcstoimax_l , +.Nm wcstol_l , +.Nm wcstoll_l , +.Nm wcstoul_l , +.Nm wcstoull_l , +.Nm wcstoumax_l +.Nd "convert a wide character string value to a" +.Vt long , +.Vt "unsigned long" , +.Vt "long long" , +.Vt "unsigned long long" , +.Vt intmax_t +or +.Vt uintmax_t +integer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.In xlocale.h +.Ft long +.Fo wcstol_l +.Fa "const wchar_t * restrict nptr" +.Fa "wchar_t ** restrict endptr" +.Fa "int base" "locale_t loc" +.Fc +.Ft "long long" +.Fo wcstoll_l +.Fa "const wchar_t * restrict nptr" +.Fa "wchar_t ** restrict endptr" +.Fa "int base" "locale_t loc" +.Fc +.Ft "unsigned long" +.Fo wcstoul_l +.Fa "const wchar_t * restrict nptr" +.Fa "wchar_t ** restrict endptr" +.Fa "int base" "locale_t loc" +.Fc +.Ft "unsigned long long" +.Fo wcstoull_l +.Fa "const wchar_t * restrict nptr" +.Fa "wchar_t ** restrict endptr" +.Fa "int base" "locale_t loc" +.Fc +.In inttypes.h +.In xlocale.h +.Ft intmax_t +.Fo wcstoimax_l +.Fa "const wchar_t * restrict nptr" +.Fa "wchar_t ** restrict endptr" +.Fa "int base" "locale_t loc" +.Fc +.Ft uintmax_t +.Fo wcstoumax_l +.Fa "const wchar_t * restrict nptr" +.Fa "wchar_t ** restrict endptr" +.Fa "int base" "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcstol_l , +.Fn wcstoul_l , +.Fn wcstoll_l , +.Fn wcstoull_l , +.Fn wcstoimax_l +and +.Fn wcstoumax_l +functions are extended locale versions of the +.Fn wcstol , +.Fn wcstoul , +.Fn wcstoll , +.Fn wcstoull , +.Fn wcstoimax +and +.Fn wcstoumax +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr wcstol 3 , +.Xr xlocale 3 diff --git a/locale/xlocale.3 b/locale/xlocale.3 new file mode 100644 index 0000000..f1a2640 --- /dev/null +++ b/locale/xlocale.3 @@ -0,0 +1,250 @@ +.Dd March 11, 2005 +.Dt XLOCALE 3 +.Os +.Sh NAME +.Nm xlocale +.Nd Extended locale support. +.Sh LIBRARY +.Lb libc +.Sh DESCRIPTION +Include +.Aq xlocale.h +for extended locale support. +It can be used alone or with the POSIX locale API in +.Aq locale.h . +.Pp +The extended locale, or "xlocale" API consists of five basic routines, +which are documented separately: +.Xr duplocale 3 , +.Xr freelocale 3 , +.Xr newlocale 3 , +.Xr querylocale 3 , +and +.Xr uselocale 3 . +For each of these routines, if a NULL +.Vt locale_t +is given, the current locale is used. +.Pp +In addition, +.Aq xlocale.h +defines a few macros: +.Pp +.Bl -dash +.It +LC_GLOBAL_LOCALE - A special +.Vt locale_t +value that corresponds to the global, process-wide locale. +.It +LC_C_LOCALE - A special +.Vt locale_t +value that corresponds to the C, system locale. +.It +MB_CUR_MAX - This macro is traditionally defined as an integer +containing the value of the longest multi-byte string +that a single-wide character in the global locale can translate into. +With extended locales, this macro is replaced with a function +that returns the value of the longest multi-byte string +that a single-wide character in the current locale (per-thread or global) +can translate into. +.It +MB_CUR_MAX_L(loc) - This macro is equivalent to MB_CUR_MAX, +except that it may be passed a specific locale directly. +.El +.Sh CAVEATS +The POSIX +.Xr setlocale 3 +function only affects the global locale, +so using it when a per-thread locale is in effect +will not change locale behavior for that thread. +However, it will change behavior for threads +with no per-thread locale in effect. +#ifdef UNIFDEF_LEGACY_RUNE_APIS +.Pp +The routines defined in +.Aq rune.h +are deprecated, and may not be fully consistent with the xlocale API. +Of particular note is +.Fn setinvalidrune , +which would normally modify the value in the global locale. +Since this value resides in a sub-structure of +.Vt locale_t +and sub-structures may be shared by multiple locales, +.Fn setinvalidrune +has been modified to make a copy of the sub-structure. +This prevents it from affecting other locales. +#endif /* UNIFDEF_LEGACY_RUNE_APIS */ +.Sh SEE ALSO +.Xr duplocale 3 , +.Xr freelocale 3 , +.Xr localeconv 3 , +.Xr newlocale 3 , +.Xr querylocale 3 , +.Xr uselocale 3 +.Sh CONVENIENCE FUNCTIONS +The xlocale API also includes "convenience functions": +functions that can be executed using a given locale, +rather than the current locale. +These functions all take one extra +.Vt locale_t +argument at the end of the traditional argument list, +except in the case of variable-argument functions, +in which case the extra argument comes before the format string. +If a NULL +.Vt locale_t +is passed, the C locale will be used. +.Pp +For completeness, +the convenience functions are listed here +(organized by the header file that contains the original function). +.Pp +.Bl -tag -width monetary.h +.It Aq _wctype.h +.Xr iswalnum_l 3 , +.Xr iswalpha_l 3 , +.Xr iswcntrl_l 3 , +.Xr iswctype_l 3 , +.Xr iswdigit_l 3 , +.Xr iswgraph_l 3 , +.Xr iswlower_l 3 , +.Xr iswprint_l 3 , +.Xr iswpunct_l 3 , +.Xr iswspace_l 3 , +.Xr iswupper_l 3 , +.Xr iswxdigit_l 3 , +.Xr towlower_l 3 , +.Xr towupper_l 3 , +.Xr wctype_l 3 +.It Aq ctype.h +.Xr digittoint_l 3 , +.Xr isalnum_l 3 , +.Xr isalpha_l 3 , +.Xr isblank_l 3 , +.Xr iscntrl_l 3 , +.Xr isdigit_l 3 , +.Xr isgraph_l 3 , +.Xr ishexnumber_l 3 , +.Xr isideogram_l 3 , +.Xr islower_l 3 , +.Xr isnumber_l 3 , +.Xr isphonogram_l 3 , +.Xr isprint_l 3 , +.Xr ispunct_l 3 , +.Xr isrune_l 3 , +.Xr isspace_l 3 , +.Xr isspecial_l 3 , +.Xr isupper_l 3 , +.Xr isxdigit_l 3 , +.Xr tolower_l 3 , +.Xr toupper_l 3 +.It Aq inttypes.h +.Xr strtoimax_l 3 , +.Xr strtoumax_l 3 , +.Xr wcstoimax_l 3 , +.Xr wcstoumax_l 3 +.It Aq langinfo.h +.Xr nl_langinfo_l 3 +.It Aq monetary.h +.Xr strfmon_l 3 +.It Aq stdio.h +.Xr asprintf_l 3 , +.Xr fprintf_l 3 , +.Xr fscanf_l 3 , +.Xr printf_l 3 , +.Xr scanf_l 3 , +.Xr snprintf_l 3 , +.Xr sprintf_l 3 , +.Xr sscanf_l 3 , +.Xr vasprintf_l 3 , +.Xr vfprintf_l 3 , +.Xr vfscanf_l 3 , +.Xr vprintf_l 3 , +.Xr vscanf_l 3 , +.Xr vsnprintf_l 3 , +.Xr vsprintf_l 3 , +.Xr vsscanf_l 3 +.It Aq stdlib.h +.Xr atof_l 3 , +.Xr atoi_l 3 , +.Xr atol_l 3 , +.Xr atoll_l 3 , +.Xr mblen_l 3 , +.Xr mbstowcs_l 3 , +.Xr mbtowc_l 3 , +.Xr strtod_l 3 , +.Xr strtof_l 3 , +.Xr strtol_l 3 , +.Xr strtold_l 3 , +.Xr strtoll_l 3 , +.Xr strtoq_l 3 , +.Xr strtoul_l 3 , +.Xr strtoull_l 3 , +.Xr strtouq_l 3 , +.Xr wcstombs_l 3 , +.Xr wctomb_l 3 +.It Aq string.h +.Xr strcoll_l 3 , +.Xr strxfrm_l 3 , +.Xr strcasecmp_l 3 , +.Xr strcasestr_l 3 , +.Xr strncasecmp_l 3 +.It Aq time.h +.Xr strftime_l 3 , +.Xr strptime_l 3 +.It Aq wchar.h +.Xr btowc_l 3 , +.Xr fgetwc_l 3 , +.Xr *fgetws_l 3 , +.Xr fputwc_l 3 , +.Xr fputws_l 3 , +.Xr fwprintf_l 3 , +.Xr fwscanf_l 3 , +.Xr getwc_l 3 , +.Xr getwchar_l 3 , +.Xr mbrlen_l 3 , +.Xr mbrtowc_l 3 , +.Xr mbsinit_l 3 , +.Xr mbsnrtowcs_l 3 , +.Xr mbsrtowcs_l 3 , +.Xr putwc_l 3 , +.Xr putwchar_l 3 , +.Xr swprintf_l 3 , +.Xr swscanf_l 3 , +.Xr ungetwc_l 3 , +.Xr vfwprintf_l 3 , +.Xr vfwscanf_l 3 , +.Xr vswprintf_l 3 , +.Xr vswscanf_l 3 , +.Xr vwprintf_l 3 , +.Xr vwscanf_l 3 , +.Xr wcrtomb_l 3 , +.Xr wcscoll_l 3 , +.Xr wcsftime_l 3 , +.Xr wcsnrtombs_l 3 , +.Xr wcsrtombs_l 3 , +.Xr wcstod_l 3 , +.Xr wcstof_l 3 , +.Xr wcstol_l 3 , +.Xr wcstold_l 3 , +.Xr wcstoll_l 3 , +.Xr wcstoul_l 3 , +.Xr wcstoull_l 3 , +.Xr wcswidth_l 3 , +.Xr wcsxfrm_l 3 , +.Xr wctob_l 3 , +.Xr wcwidth_l 3 , +.Xr wprintf_l 3 , +.Xr wscanf_l 3 +.It Aq wctype.h +.Xr iswblank_l 3 , +.Xr iswhexnumber_l 3 , +.Xr iswideogram_l 3 , +.Xr iswnumber_l 3 , +.Xr iswphonogram_l 3 , +.Xr iswrune_l 3 , +.Xr iswspecial_l 3 , +.Xr nextwctype_l 3 , +.Xr towctrans_l 3 , +.Xr wctrans_l 3 +.It Aq xlocale.h +.Xr localeconv_l 3 +.El diff --git a/locale/xlocale.c b/locale/xlocale.c new file mode 100644 index 0000000..6efb9a5 --- /dev/null +++ b/locale/xlocale.c @@ -0,0 +1,498 @@ +/* + * Copyright (c) 2005, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "xlocale_private.h" +#include +#include +#include +#include "ldpart.h" + +#define NMBSTATET 10 +#define C_LOCALE_INITIALIZER { \ + 0, XPERMANENT, \ + {}, {}, {}, {}, {}, \ + {}, {}, {}, {}, {}, \ + OS_UNFAIR_LOCK_INIT, \ + XMAGIC, \ + 1, 0, 0, 0, 0, 0, 1, 1, 0, \ + NULL, \ + &_DefaultRuneXLocale, \ +} + +static char C[] = "C"; +static struct _xlocale __c_locale = C_LOCALE_INITIALIZER; +const locale_t _c_locale = (const locale_t)&__c_locale; +struct _xlocale __global_locale = C_LOCALE_INITIALIZER; +pthread_key_t __locale_key = (pthread_key_t)-1; + +extern int __collate_load_tables(const char *, locale_t); +extern int __detect_path_locale(void); +extern const char *__get_locale_env(int); +extern int __messages_load_locale(const char *, locale_t); +extern int __monetary_load_locale(const char *, locale_t); +extern int __numeric_load_locale(const char *, locale_t); +extern int __setrunelocale(const char *, locale_t); +extern int __time_load_locale(const char *, locale_t); + +static void _releaselocale(locale_t loc); + +/* + * check that the encoding is the right size, isn't . or .. and doesn't + * contain any slashes + */ +static inline __attribute__((always_inline)) int +_checkencoding(const char *encoding) +{ + return (encoding && (strlen(encoding) > ENCODING_LEN + || (encoding[0] == '.' && (encoding[1] == 0 + || (encoding[1] == '.' && encoding[2] == 0))) + || strchr(encoding, '/') != NULL)) ? -1 : 0; +} + +/* + * check that the locale has the right magic number + */ +static inline __attribute__((always_inline)) int +_checklocale(const locale_t loc) +{ + if (!loc) + return 0; + return (loc == LC_GLOBAL_LOCALE || loc->__magic == XMAGIC) ? 0 : -1; +} + +/* + * copy a locale_t except anything before the magic value + */ +static inline __attribute__((always_inline)) void +_copylocale(locale_t dst, const locale_t src) +{ + memcpy(&dst->__magic, &src->__magic, sizeof(*dst) - offsetof(struct _xlocale, __magic)); +} + +/* + * Make a copy of a locale_t, locking/unlocking the source. + * A NULL locale_t means to make a copy of the current + * locale while LC_GLOBAL_LOCALE means to copy the global locale. If + * &__c_locale is passed (meaning a C locale is desired), just make + * a copy. + */ +static locale_t +_duplocale(locale_t loc) +{ + locale_t new; + + if ((new = (locale_t)malloc(sizeof(struct _xlocale))) == NULL) + return NULL; + new->__refcount = 1; + new->__free_extra = (__free_extra_t)_releaselocale; + new->__lock = OS_UNFAIR_LOCK_INIT; + if (loc == NULL) + loc = __current_locale(); + else if (loc == LC_GLOBAL_LOCALE) + loc = &__global_locale; + else if (loc == &__c_locale) { + *new = __c_locale; + new->__refcount = 1; + new->__free_extra = (__free_extra_t)_releaselocale; + new->__lock = OS_UNFAIR_LOCK_INIT; + return new; + } + XL_LOCK(loc); + _copylocale(new, loc); + XL_UNLOCK(loc); + /* __mbs_mblen is the first of NMBSTATET mbstate_t buffers */ + bzero(&new->__mbs_mblen, offsetof(struct _xlocale, __magic) + - offsetof(struct _xlocale, __mbs_mblen)); + /* collate */ + XL_RETAIN(new->__lc_collate); + /* ctype */ + XL_RETAIN(new->__lc_ctype); + /* messages */ + XL_RETAIN(new->__lc_messages); + /* monetary */ + XL_RETAIN(new->__lc_monetary); + /* numeric */ + XL_RETAIN(new->__lc_numeric); + XL_RETAIN(new->__lc_numeric_loc); + /* time */ + XL_RETAIN(new->__lc_time); + + return new; +} + +/* + * Modify a locale_t, setting the parts specified in the mask + * to the locale specified by the string. If the string is NULL, the C + * locale is used. If the string is empty, the value is determined from + * the environment. -1 is returned on error, and loc is in a partial state. + */ +static int +_modifylocale(locale_t loc, int mask, __const char *locale) +{ + int m, ret; + const char *enc = NULL; + char *oenc; + + if (!locale) + locale = C; + + ret = __detect_path_locale(); + if (ret) { + errno = ret; + return -1; + } + + if (*locale) + enc = locale; + for(m = 1; m <= _LC_LAST_MASK; m <<= 1) { + if (m & mask) { + switch(m) { + case LC_COLLATE_MASK: + if (!*locale) { + enc = __get_locale_env(LC_COLLATE); + if (_checkencoding(enc) < 0) { + errno = EINVAL; + return -1; + } + } + oenc = (loc->__collate_load_error ? C : loc->__lc_collate->__encoding); + if (strcmp(enc, oenc) != 0 && __collate_load_tables(enc, loc) == _LDP_ERROR) + return -1; + break; + case LC_CTYPE_MASK: + if (!*locale) { + enc = __get_locale_env(LC_CTYPE); + if (_checkencoding(enc) < 0) { + errno = EINVAL; + return -1; + } + } + if (strcmp(enc, loc->__lc_ctype->__ctype_encoding) != 0) { + if ((ret = __setrunelocale(enc, loc)) != 0) { + errno = ret; + return -1; + } + if (loc->__numeric_fp_cvt == LC_NUMERIC_FP_SAME_LOCALE) + loc->__numeric_fp_cvt = LC_NUMERIC_FP_UNINITIALIZED; + } + break; + case LC_MESSAGES_MASK: + if (!*locale) { + enc = __get_locale_env(LC_MESSAGES); + if (_checkencoding(enc) < 0) { + errno = EINVAL; + return -1; + } + } + oenc = (loc->_messages_using_locale ? loc->__lc_messages->_messages_locale_buf : C); + if (strcmp(enc, oenc) != 0 && __messages_load_locale(enc, loc) == _LDP_ERROR) + return -1; + break; + case LC_MONETARY_MASK: + if (!*locale) { + enc = __get_locale_env(LC_MONETARY); + if (_checkencoding(enc) < 0) { + errno = EINVAL; + return -1; + } + } + oenc = (loc->_monetary_using_locale ? loc->__lc_monetary->_monetary_locale_buf : C); + if (strcmp(enc, oenc) != 0 && __monetary_load_locale(enc, loc) == _LDP_ERROR) + return -1; + break; + case LC_NUMERIC_MASK: + if (!*locale) { + enc = __get_locale_env(LC_NUMERIC); + if (_checkencoding(enc) < 0) { + errno = EINVAL; + return -1; + } + } + oenc = (loc->_numeric_using_locale ? loc->__lc_numeric->_numeric_locale_buf : C); + if (strcmp(enc, oenc) != 0) { + if (__numeric_load_locale(enc, loc) == _LDP_ERROR) + return -1; + loc->__numeric_fp_cvt = LC_NUMERIC_FP_UNINITIALIZED; + XL_RELEASE(loc->__lc_numeric_loc); + loc->__lc_numeric_loc = NULL; + } + break; + case LC_TIME_MASK: + if (!*locale) { + enc = __get_locale_env(LC_TIME); + if (_checkencoding(enc) < 0) { + errno = EINVAL; + return -1; + } + } + oenc = (loc->_time_using_locale ? loc->__lc_time->_time_locale_buf : C); + if (strcmp(enc, oenc) != 0 && __time_load_locale(enc, loc) == _LDP_ERROR) + return -1; + break; + } + } + } + return 0; +} + +/* + * release all the memory objects (the memory will be freed when the refcount + * becomes zero) + */ +static void +_releaselocale(locale_t loc) +{ + /* collate */ + XL_RELEASE(loc->__lc_collate); + /* ctype */ + XL_RELEASE(loc->__lc_ctype); + /* messages */ + XL_RELEASE(loc->__lc_messages); + /* monetary */ + XL_RELEASE(loc->__lc_monetary); + /* numeric */ + XL_RELEASE(loc->__lc_numeric); + XL_RELEASE(loc->__lc_numeric_loc); + /* time */ + XL_RELEASE(loc->__lc_time); +} + +/* + * EXTERNAL: Duplicate a (non-NULL) locale_t. LC_GLOBAL_LOCALE means the + * global locale, while NULL means the current locale. NULL is returned + * on error. + */ +locale_t +duplocale(locale_t loc) +{ + if (_checklocale(loc) < 0) { + errno = EINVAL; + return NULL; + } + return _duplocale(loc); +} + +/* + * EXTERNAL: Free a locale_t, releasing all memory objects. Don't free + * illegal locale_t's or the global locale. + */ +int +freelocale(locale_t loc) +{ + if (!loc || _checklocale(loc) < 0 || loc == &__global_locale + || loc == LC_GLOBAL_LOCALE || loc == &__c_locale) { + errno = EINVAL; + return -1; + } + XL_RELEASE(loc); + return 0; +} + +/* + * EXTERNAL: Create a new locale_t, based on the base locale_t, and modified + * by the mask and locale string. If the base is NULL, the current locale + * is used as the base. If locale is NULL, changes are made from the C locale + * for categories set in mask. + */ +locale_t +newlocale(int mask, __const char *locale, locale_t base) +{ + locale_t new; + int lcmask = (mask & LC_ALL_MASK); + + if (_checkencoding(locale) < 0) { + errno = EINVAL; + return NULL; + } + if (lcmask == LC_ALL_MASK) + base = (locale_t)&__c_locale; + else if (_checklocale(base) < 0) { + errno = EINVAL; + return NULL; + } + new = _duplocale(base); + if (new == NULL) + return NULL; + if (lcmask == 0 || (lcmask == LC_ALL_MASK && locale == NULL)) + return new; + if (_modifylocale(new, lcmask, locale) < 0) { + freelocale(new); + return NULL; + } + return new; +} + +/* + * PRIVATE EXTERNAL: Returns the locale that can be used by wcstod and + * family, to convert the wide character string to a multi-byte string + * (the LC_NUMERIC and LC_CTYPE locales may be different). + */ +__private_extern__ locale_t +__numeric_ctype(locale_t loc) +{ + switch(loc->__numeric_fp_cvt) { + case LC_NUMERIC_FP_UNINITIALIZED: { + const char *ctype = loc->__lc_ctype->__ctype_encoding; + const char *numeric = (loc->_numeric_using_locale ? loc->__lc_numeric->_numeric_locale_buf : C); + if (strcmp(ctype, numeric) == 0) { + loc->__numeric_fp_cvt = LC_NUMERIC_FP_SAME_LOCALE; + return loc; + } else { + loc->__lc_numeric_loc = newlocale(LC_CTYPE_MASK, numeric, (locale_t)&__c_locale); + if (loc->__lc_numeric_loc) { + loc->__numeric_fp_cvt = LC_NUMERIC_FP_USE_LOCALE; + return loc->__lc_numeric_loc; + } else { /* shouldn't happen, but just use the same locale */ + loc->__numeric_fp_cvt = LC_NUMERIC_FP_SAME_LOCALE; + return loc; + } + } + } + case LC_NUMERIC_FP_SAME_LOCALE: + return loc; + case LC_NUMERIC_FP_USE_LOCALE: + return loc->__lc_numeric_loc; + } + return loc; /* shouldn't happen */ +} + +/* + * EXTERNAL: Returns the locale string for the part specified in mask. The + * least significant bit is used. If loc is NULL, the current per-thread + * locale is used. + */ +const char * +querylocale(int mask, locale_t loc) +{ + int m; + const char *ret; + + if (_checklocale(loc) < 0 || (mask & LC_ALL_MASK) == 0) { + errno = EINVAL; + return NULL; + } + DEFAULT_CURRENT_LOCALE(loc); + m = ffs(mask); + if (m == 0 || m > _LC_NUM_MASK) { + errno = EINVAL; + return NULL; + } + XL_LOCK(loc); + switch(1 << (m - 1)) { + case LC_COLLATE_MASK: + ret = (loc->__collate_load_error ? C : loc->__lc_collate->__encoding); + break; + case LC_CTYPE_MASK: + ret = loc->__lc_ctype->__ctype_encoding; + break; + case LC_MESSAGES_MASK: + ret = (loc->_messages_using_locale ? loc->__lc_messages->_messages_locale_buf : C); + break; + case LC_MONETARY_MASK: + ret = (loc->_monetary_using_locale ? loc->__lc_monetary->_monetary_locale_buf : C); + break; + case LC_NUMERIC_MASK: + ret = (loc->_numeric_using_locale ? loc->__lc_numeric->_numeric_locale_buf : C); + break; + case LC_TIME_MASK: + ret = (loc->_time_using_locale ? loc->__lc_time->_time_locale_buf : C); + break; + default: + /* should never get here */ + XL_UNLOCK(loc); + errno = EINVAL; + return NULL; + } + XL_UNLOCK(loc); + return ret; +} + +/* + * EXTERNAL: Set the thread-specific locale. The previous locale is returned. + * Use LC_GLOBAL_LOCALE to set the global locale. LC_GLOBAL_LOCALE + * may also be returned if there was no previous thread-specific locale in + * effect. If loc is NULL, the current locale is returned, but no locale + * chance is made. NULL is returned on error. + */ +locale_t +uselocale(locale_t loc) +{ + locale_t orig; + + if (loc == NULL) + orig = (locale_t)pthread_getspecific(__locale_key); + else { + if (_checklocale(loc) < 0) { + errno = EINVAL; + return NULL; + } + if (loc == LC_GLOBAL_LOCALE || + loc == &__global_locale) /* should never happen */ + loc = NULL; + XL_RETAIN(loc); + orig = pthread_getspecific(__locale_key); + pthread_setspecific(__locale_key, loc); + XL_RELEASE(orig); + } + return (orig ? orig : LC_GLOBAL_LOCALE); +} + +/* + * EXTERNAL: Used by the MB_CUR_MAX macro to determine the thread-specific + * value. + */ +int +___mb_cur_max(void) +{ + return __current_locale()->__lc_ctype->__mb_cur_max; +} + +/* + * EXTERNAL: Used by the MB_CUR_MAX_L macro to determine the thread-specific + * value, from the given locale_t. + */ +int +___mb_cur_max_l(locale_t loc) +{ + return __locale_ptr(loc)->__lc_ctype->__mb_cur_max; +} + +static void +__xlocale_release(void *loc) +{ + locale_t l = loc; + XL_RELEASE(l); +} + +/* + * Called from the Libc initializer to setup the thread-specific key. + */ +__private_extern__ void +__xlocale_init(void) +{ + if (__locale_key == (pthread_key_t)-1) { + __locale_key = __LIBC_PTHREAD_KEY_XLOCALE; + pthread_key_init_np(__locale_key, __xlocale_release); + } +} + diff --git a/locale/xlocale_private.h b/locale/xlocale_private.h new file mode 100644 index 0000000..99bf7c3 --- /dev/null +++ b/locale/xlocale_private.h @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2005, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE_PRIVATE_H_ +#define _XLOCALE_PRIVATE_H_ + +#include +#define __DARWIN_XLOCALE_PRIVATE +#include +#undef __DARWIN_XLOCALE_PRIVATE +#include +#include +#include +#include +#include +#include +#include +#include "setlocale.h" +#include "collate.h" +#include "runetype.h" +#include "lmessages.h" +#include "lmonetary.h" +#include "lnumeric.h" +#include "timelocal.h" +#include + +#undef MB_CUR_MAX +#define MB_CUR_MAX (__current_locale()->__lc_ctype->__mb_cur_max) +#undef MB_CUR_MAX_L +#define MB_CUR_MAX_L(x) ((x)->__lc_ctype->__mb_cur_max) + +typedef void (*__free_extra_t)(void *); + +#define XPERMANENT ((__free_extra_t)-1) +#define XMAGIC 0x786c6f63616c6530LL /* 'xlocale0' */ + +#define __STRUCT_COMMON \ + int32_t __refcount; \ + __free_extra_t __free_extra; + +struct __xlocale_st_collate { + __STRUCT_COMMON + char __encoding[ENCODING_LEN + 1]; + struct __collate_st_info __info; + struct __collate_st_subst *__substitute_table[COLL_WEIGHTS_MAX]; + struct __collate_st_chain_pri *__chain_pri_table; + struct __collate_st_large_char_pri *__large_char_pri_table; + struct __collate_st_char_pri __char_pri_table[UCHAR_MAX + 1]; +}; +struct __xlocale_st_runelocale { + __STRUCT_COMMON + char __ctype_encoding[ENCODING_LEN + 1]; + int __mb_cur_max; + int __mb_sb_limit; + size_t (*__mbrtowc)(wchar_t * __restrict, const char * __restrict, + size_t, __darwin_mbstate_t * __restrict, struct _xlocale *); + int (*__mbsinit)(const __darwin_mbstate_t *, struct _xlocale *); + size_t (*__mbsnrtowcs)(wchar_t * __restrict, const char ** __restrict, + size_t, size_t, __darwin_mbstate_t * __restrict, struct _xlocale *); + size_t (*__wcrtomb)(char * __restrict, wchar_t, + __darwin_mbstate_t * __restrict, struct _xlocale *); + size_t (*__wcsnrtombs)(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, __darwin_mbstate_t * __restrict, struct _xlocale *); + int __datasize; + _RuneLocale _CurrentRuneLocale; +}; +struct __xlocale_st_ldpart { + __STRUCT_COMMON + char *_locale_buf; +}; +/* + * the next four structures must have the first three fields of the same + * as the _xlocale_st_ldpart structure above. + */ +struct __xlocale_st_messages { + __STRUCT_COMMON + char *_messages_locale_buf; + struct lc_messages_T _messages_locale; +}; +struct __xlocale_st_monetary { + __STRUCT_COMMON + char *_monetary_locale_buf; + struct lc_monetary_T _monetary_locale; +}; +struct __xlocale_st_numeric { + __STRUCT_COMMON + char *_numeric_locale_buf; + struct lc_numeric_T _numeric_locale; +}; +struct __xlocale_st_time { + __STRUCT_COMMON + char *_time_locale_buf; + struct lc_time_T _time_locale; +}; + +/* the extended locale structure */ + /* values for __numeric_fp_cvt */ +#define LC_NUMERIC_FP_UNINITIALIZED 0 +#define LC_NUMERIC_FP_SAME_LOCALE 1 +#define LC_NUMERIC_FP_USE_LOCALE 2 + +struct _xlocale { +/* The item(s) before __magic are not copied when duplicating locale_t's */ + __STRUCT_COMMON /* only used for locale_t's in __lc_numeric_loc */ + /* 10 independent mbstate_t buffers! */ + __darwin_mbstate_t __mbs_mblen; + __darwin_mbstate_t __mbs_mbrlen; + __darwin_mbstate_t __mbs_mbrtowc; + __darwin_mbstate_t __mbs_mbsnrtowcs; + __darwin_mbstate_t __mbs_mbsrtowcs; + __darwin_mbstate_t __mbs_mbtowc; + __darwin_mbstate_t __mbs_wcrtomb; + __darwin_mbstate_t __mbs_wcsnrtombs; + __darwin_mbstate_t __mbs_wcsrtombs; + __darwin_mbstate_t __mbs_wctomb; + os_unfair_lock __lock; +/* magic (Here up to the end is copied when duplicating locale_t's) */ + int64_t __magic; +/* flags */ + unsigned char __collate_load_error; + unsigned char __collate_substitute_nontrivial; + unsigned char _messages_using_locale; + unsigned char _monetary_using_locale; + unsigned char _numeric_using_locale; + unsigned char _time_using_locale; + unsigned char __mlocale_changed; + unsigned char __nlocale_changed; + unsigned char __numeric_fp_cvt; +/* collate */ + struct __xlocale_st_collate *__lc_collate; +/* ctype */ + struct __xlocale_st_runelocale *__lc_ctype; +/* messages */ + struct __xlocale_st_messages *__lc_messages; +/* monetary */ + struct __xlocale_st_monetary *__lc_monetary; +/* numeric */ + struct __xlocale_st_numeric *__lc_numeric; + struct _xlocale *__lc_numeric_loc; +/* time */ + struct __xlocale_st_time *__lc_time; +/* localeconv */ + struct lconv __lc_localeconv; +}; + +#define DEFAULT_CURRENT_LOCALE(x) \ + if ((x) == NULL) { \ + (x) = __current_locale(); \ + } else if ((x) == LC_GLOBAL_LOCALE) { \ + (x) = &__global_locale; \ + } + +#define NORMALIZE_LOCALE(x) if ((x) == LC_C_LOCALE) { \ + (x) = _c_locale; \ + } else if ((x) == LC_GLOBAL_LOCALE) { \ + (x) = &__global_locale; \ + } + +#define XL_LOCK(x) os_unfair_lock_lock(&(x)->__lock); +#define XL_RELEASE(x) if ((x) && (x)->__free_extra != XPERMANENT && OSAtomicDecrement32Barrier(&(x)->__refcount) == 0) { \ + if ((x)->__free_extra) \ + (*(x)->__free_extra)((x)); \ + free((x)); \ + (x) = NULL; \ + } +#define XL_RETAIN(x) if ((x) && (x)->__free_extra != XPERMANENT) { OSAtomicIncrement32Barrier(&(x)->__refcount); } +#define XL_UNLOCK(x) os_unfair_lock_unlock(&(x)->__lock); + +__attribute__((visibility("hidden"))) +extern struct __xlocale_st_runelocale _DefaultRuneXLocale; + +__attribute__((visibility("hidden"))) +extern struct _xlocale __global_locale; + +__attribute__((visibility("hidden"))) +extern pthread_key_t __locale_key; + +__BEGIN_DECLS + +void __ldpart_free_extra(struct __xlocale_st_ldpart *); +locale_t __numeric_ctype(locale_t); +void __xlocale_init(void); + +static inline __attribute__((always_inline)) locale_t +__current_locale(void) +{ +#if TARGET_IPHONE_SIMULATOR + /* Crash in _objc_inform for duplicate class name during simulator launch + * TODO: Remove after the simulator's libSystem is initialized properly. + */ + if (__locale_key == (pthread_key_t)-1) { + return &__global_locale; + } +#endif + void *__thread_locale; + if (_pthread_has_direct_tsd()) { + __thread_locale = _pthread_getspecific_direct(__locale_key); + } else { + __thread_locale = pthread_getspecific(__locale_key); + } + return (__thread_locale ? (locale_t)__thread_locale : &__global_locale); +} + +static inline __attribute__((always_inline)) locale_t +__locale_ptr(locale_t __loc) +{ + NORMALIZE_LOCALE(__loc); + return __loc; +} + +__END_DECLS + +#endif /* _XLOCALE_PRIVATE_H_ */ diff --git a/man/FreeBSD/environ.7 b/man/FreeBSD/environ.7 new file mode 100644 index 0000000..901f7eb --- /dev/null +++ b/man/FreeBSD/environ.7 @@ -0,0 +1,291 @@ +.\" Copyright (c) 1983, 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)environ.7 8.3 (Berkeley) 4/19/94 +.\" $FreeBSD$ +.\" +.Dd April 12, 2003 +.Dt ENVIRON 7 +.Os +.Sh NAME +.Nm environ +.Nd user environment +.Sh SYNOPSIS +.Ar extern char **environ ; +.Sh DESCRIPTION +An array of strings called the +.Ar environment +is made available by +.Xr execve 2 +when a process begins. +By convention these strings have the form +.Dq Ar name=value . +The following names are used by various commands: +.Bl -tag -width LC_MONETARY +.It Ev BLOCKSIZE +The size of the block units used by several commands, most notably +.Xr df 1 , +.Xr du 1 +and +.Xr ls 1 . +This variable is processed by the +.Xr getbsize 3 +function. +.It Ev COLUMNS +The user's preferred width in column positions for the terminal. +Utilities such as +.Xr ls 1 +and +.Xr who 1 +use this to format output into columns. +If unset or empty, utilities will use an +.Xr ioctl 2 +call to ask the terminal driver for the width. +.It Ev EDITOR +Default editor name. +.It Ev EXINIT +A startup list of commands read by +.Xr ex 1 +and +.Xr vi 1 . +.It Ev HOME +A user's login directory, set by +.Xr login 1 +from the password file +.Xr passwd 5 . +.It Ev LANG +This variable configures all programs which use +.Xr setlocale 3 +to use the specified locale unless the +.Ev LC_* +variables are set. +.It Ev LC_ALL +Overrides the values of +.Ev LC_COLLATE , +.Ev LC_CTYPE , +.Ev LC_MESSAGES , +.Ev LC_MONETARY , +.Ev LC_NUMERIC , +.Ev LC_TIME +and +.Ev LANG . +.It Ev LC_COLLATE +Locale to be used for ordering of strings. +.It Ev LC_CTYPE +Locale to be used for character classification +(letter, space, digit, etc.) and for interpreting byte sequences as +multibyte characters. +.It Ev LC_MESSAGES +Locale to be used for diagnostic messages. +.It Ev LC_MONETARY +Locale to be used for interpreting monetary input +and formatting output. +.It Ev LC_NUMERIC +Locale to be used for interpreting numeric input and +formatting output. +.It Ev LC_TIME +Locale to be used for interpreting dates input and +for formatting output. +.It Ev MAIL +The location of the user's +mailbox instead of the default in /var/mail, +used by +.Xr mail 1 , +.Xr sh 1 , +and many other mail clients. +.It Ev NLSPATH +List of directories to be searched for the message catalog referred to by +.Ev LC_MESSAGES . +See +.Xr catopen 3 . +.It Ev PAGER +Default paginator program. +The program specified by this variable is used by +.Xr mail 1 , +.Xr man 1 , +.Xr ftp 1 , +etc, to display information which is longer than the current display. +.It Ev PATH +The sequence of directories, separated by colons, searched by +.Xr csh 1 , +.Xr sh 1 , +.Xr system 3 , +.Xr execvp 3 , +etc, when looking for an executable file. +.Ev PATH +is set to ``/usr/bin:/bin'' initially by +.Xr login 1 . +.It Ev PRINTER +The name of the default printer to be used by +.Xr lpr 1 , +.Xr lpq 1 , +and +.Xr lprm 1 . +.It Ev PWD +The current directory pathname. +.It Ev SHELL +The full pathname of the user's login shell. +.It Ev TERM +The kind of terminal for which output is to be prepared. +This information is used by commands, such as +.Xr nroff 1 +or +.Xr plot 1 +which may exploit special terminal capabilities. +See +.Pa /usr/share/misc/termcap +.Pq Xr termcap 5 +for a list of terminal types. +.It Ev TERMCAP +The string describing the terminal in +.Ev TERM , +or, if +it begins with a '/', the name of the termcap file. +See +.Ev TERMPATH +below, and +.Xr termcap 5 . +.It Ev TERMPATH +A sequence of pathnames of termcap files, separated by colons or spaces, +which are searched for terminal descriptions in the order listed. +Having +no +.Ev TERMPATH +is equivalent to a +.Ev TERMPATH +of +.Dq Pa $HOME/.termcap:/etc/termcap . +.Ev TERMPATH +is ignored if +.Ev TERMCAP +contains a full pathname. +.It Ev TMPDIR +The directory in which to store temporary files. +Most applications use either +.Dq /tmp +or +.Dq /var/tmp . +Setting this variable will make them use another directory. +.It Ev TZ +The timezone to use when displaying dates. +The normal format is a pathname relative to +.Dq Pa /usr/share/zoneinfo . +For example, the command +.Dq env TZ=America/Los_Angeles date +displays the current time in California. +See +.Xr tzset 3 +for more information. +.It Ev USER +The login name of the user. +.El +.Pp +Further names may be placed in the environment by the +.Ic export +command and +.Ar name=value +arguments in +.Xr sh 1 , +or by the +.Ic setenv +command if you use +.Xr csh 1 . +It is unwise to change certain +.Xr sh 1 +variables that are frequently exported by +.Pa .profile +files, such as +.Ev MAIL , +.Ev PS1 , +.Ev PS2 , +and +.Ev IFS , +unless you know what you are doing. +.Pp +The current environment variables can be printed with +.Xr env 1 , +.Xr set 1 +or +.Xr printenv 1 +in +.Xr sh 1 +and +.Xr env 1 , +.Xr printenv 1 +or the +.Cm printenv +built-in command in +.Xr csh 1 . +.Sh PROGRAMMING +Programs can query and modify the environment, using the environment routines +.Xr getenv 3 , +.Xr putenv 3 , +.Xr setenv 3 +and +.Xr unsetenv 3 . +Direct access can be made through the global variable +.Va environ , +though it is recommended that changes to the enviroment still be made through +the environment routines. +.Pp +Shared libraries and bundles don't have direct access to +.Va environ , +which is only available to the loader +.Xr ld 1 +when a complete program is being linked. +The environment routines can still be used, but if direct access to +.Va environ +is needed, the +.Fn _NSGetEnviron +routine, defined in +.In crt_externs.h , +can be used to retrieve the address of +.Va environ +at runtime. +.Sh SEE ALSO +.Xr cd 1 , +.Xr csh 1 , +.Xr env 1 , +.Xr ex 1 , +.Xr login 1 , +.Xr printenv 1 , +.Xr sh 1 , +.Xr execve 2 , +.Xr execle 3 , +.Xr getenv 3 , +.Xr putenv 3 , +.Xr setenv 3 , +.Xr unsetenv 3 , +.Xr setlocale 3 , +.Xr system 3 , +.Xr termcap 3 , +.Xr termcap 5 +.Sh HISTORY +The +.Nm +manual page appeared in +.Bx 4.2 . diff --git a/man/FreeBSD/stdarg.3 b/man/FreeBSD/stdarg.3 new file mode 100644 index 0000000..f83aeb7 --- /dev/null +++ b/man/FreeBSD/stdarg.3 @@ -0,0 +1,245 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)stdarg.3 8.1 (Berkeley) 6/5/93 +.\" $FreeBSD: src/share/man/man3/stdarg.3,v 1.15 2005/01/21 08:36:36 ru Exp $ +.\" +.Dd October 25, 2002 +.Dt STDARG 3 +.Os +.Sh NAME +.Nm stdarg +.Nd variable argument lists +.Sh SYNOPSIS +.In stdarg.h +.Ft void +.Fn va_start "va_list ap" last +.Ft type +.Fn va_arg "va_list ap" type +.Ft void +.Fn va_copy "va_list dest" "va_list src" +.Ft void +.Fn va_end "va_list ap" +.Sh DESCRIPTION +A function may be called with a varying number of arguments of varying +types. +The include file +.In stdarg.h +declares a type +.Pq Em va_list +and defines three macros for stepping +through a list of arguments whose number and types are not known to +the called function. +.Pp +The called function must declare an object of type +.Em va_list +which is used by the macros +.Fn va_start , +.Fn va_arg , +.Fn va_copy , +and +.Fn va_end . +.Pp +The +.Fn va_start +macro must be called first, and it initializes +.Fa ap , +which can be passed to +.Fn va_arg +for each argument to be processed. +Calling +.Fn va_end +signals that there are no further arguments, and causes +.Fa ap +to be invalidated. +Note that each call to +.Fn va_start +must be matched by a call to +.Fn va_end , +from within the same function. +.Pp +The parameter +.Fa last +is the name of the last parameter before the variable argument list, +i.e., the last parameter of which the calling function knows the type. +.Pp +Because the address of this parameter is used in the +.Fn va_start +macro, it should not be declared as a register variable, or as a +function or an array type. +.Pp +The +.Fn va_arg +macro expands to an expression that has the type and value of the next +argument in the call. +The parameter +.Fa ap +is the +.Em va_list Fa ap +initialized by +.Fn va_start . +Each call to +.Fn va_arg +modifies +.Fa ap +so that the next call returns the next argument. +The parameter +.Fa type +is a type name specified so that the type of a pointer to an +object that has the specified type can be obtained simply by +adding a * +to +.Fa type . +.Pp +If there is no next argument, or if +.Fa type +is not compatible with the type of the actual next argument +(as promoted according to the default argument promotions), +random errors will occur. +.Pp +The first use of the +.Fn va_arg +macro after that of the +.Fn va_start +macro returns the argument after +.Fa last . +Successive invocations return the values of the remaining +arguments. +.Pp +The +.Fn va_copy +macro copies the state of the variable argument list, +.Fa src , +previously initialized by +.Fn va_start , +to the variable argument list, +.Fa dest , +which must not have been previously initialized by +.Fn va_start , +without an intervening call to +.Fn va_end . +The state preserved in +.Fa dest +is equivalent to calling +.Fn va_start +and +.Fn va_arg +on +.Fa dest +in the same way as was used on +.Fa src . +The copied variable argument list can subsequently be passed to +.Fn va_arg , +and must finally be passed to +.Fn va_end +when through with it. +.Pp +After a variable argument list is invalidated by +.Fn va_end , +it can be reinitialized with +.Fn va_start +or made a copy of another variable argument list with +.Fn va_copy . +.Sh EXAMPLES +The function +.Em foo +takes a string of format characters and prints out the argument +associated with each format character based on the type. +.Bd -literal -offset indent +void foo(char *fmt, ...) +{ + va_list ap, ap2; + int d; + char c, *s; + + va_start(ap, fmt); + va_copy(ap2, ap); + while (*fmt) + switch(*fmt++) { + case 's': /* string */ + s = va_arg(ap, char *); + printf("string %s\en", s); + break; + case 'd': /* int */ + d = va_arg(ap, int); + printf("int %d\en", d); + break; + case 'c': /* char */ + /* Note: char is promoted to int. */ + c = va_arg(ap, int); + printf("char %c\en", c); + break; + } + va_end(ap); + ... + /* use ap2 to iterate over the arguments again */ + ... + va_end(ap2); +} +.Ed +.Sh COMPATIBILITY +These macros are +.Em not +compatible with the historic macros they replace. +A backward compatible version can be found in the include +file +.In varargs.h . +.Sh STANDARDS +The +.Fn va_start , +.Fn va_arg , +.Fn va_copy , +and +.Fn va_end +macros conform to +.St -isoC-99 . +.Sh BUGS +Unlike the +.Em varargs +macros, the +.Nm +macros do not permit programmers to +code a function with no fixed arguments. +This problem generates work mainly when converting +.Em varargs +code to +.Nm +code, +but it also creates difficulties for variadic functions that +wish to pass all of their arguments on to a function +that takes a +.Em va_list +argument, such as +.Xr vfprintf 3 . diff --git a/man/assert.3 b/man/assert.3 new file mode 100644 index 0000000..af51048 --- /dev/null +++ b/man/assert.3 @@ -0,0 +1,96 @@ +.\" $NetBSD: assert.3,v 1.5 1994/11/30 15:24:30 jtc Exp $ +.\" +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)assert.3 8.1 (Berkeley) 6/9/93 +.\" +.Dd June 9, 1993 +.Dt ASSERT 3 +.Os +.Sh NAME +.Nm assert +.Nd expression verification macro +.Sh SYNOPSIS +.Fd #include +.Fn assert expression +.Sh DESCRIPTION +The +.Fn assert +macro tests the given +.Ar expression +and if it is false, +the calling process is terminated. +A +diagnostic message is written to +.Em stderr +and the +.Xr abort 3 +function is called, effectively terminating the program. +.Pp +If +.Ar expression +is true, +the +.Fn assert +macro does nothing. +.Pp +The +.Fn assert +macro +may be removed at compile time with +the +.Xr cc 1 +option +.Fl DNDEBUG . +.Sh DIAGNOSTICS +The following diagnostic message is written to +.Em stderr +if +.Ar expression +is false: +.Bd -literal -offset indent +"assertion \e"%s\e" failed: file \e"%s\e", line %d\en", \e + "expression", __FILE__, __LINE__); +.Ed +.Sh SEE ALSO +.Xr cc 1 , +.Xr abort 3 +.Sh STANDARDS +The +.Fn assert +macro conforms to +.St -ansiC . +.Sh HISTORY +A +.Nm assert +macro appeared in +.At v6 . diff --git a/man/bitstring.3 b/man/bitstring.3 new file mode 100644 index 0000000..2a9c1b5 --- /dev/null +++ b/man/bitstring.3 @@ -0,0 +1,191 @@ +.\" $NetBSD: bitstring.3,v 1.4 1994/11/30 15:24:31 jtc Exp $ +.\" +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Paul Vixie. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)bitstring.3 8.1 (Berkeley) 7/19/93 +.\" +.Dd July 19, 1993 +.Dt BITSTRING 3 +.Os BSD 4 +.Sh NAME +.Nm bit_alloc , +.Nm bit_clear , +.Nm bit_decl , +.Nm bit_ffs , +.Nm bit_nclear , +.Nm bit_nset, +.Nm bit_set , +.Nm bitstr_size , +.Nm bit_test +.Nd bit-string manipulation macros +.Sh SYNOPSIS +.Fd #include +.Ft bitstr_t * +.Fn bit_alloc "int nbits" +.Fn bit_decl "bitstr_t *name" "int nbits" +.Fn bit_clear "bitstr_t *name" "int bit" +.Fn bit_ffc "bitstr_t *name" "int nbits" "int *value" +.Fn bit_ffs "bitstr_t *name" "int nbits" "int *value" +.Fn bit_nclear "bitstr_t *name" "int start" "int stop" +.Fn bit_nset "bitstr_t *name" "int start" "int stop" +.Fn bit_set "bitstr_t *name" "int bit" +.Ft int +.Fn bitstr_size "int nbits" +.Ft int +.Fn bit_test "bitstr_t *name" "int bit" +.Sh DESCRIPTION +These macros operate on strings of bits. +.Pp +The macro +.Fn bit_alloc +returns a pointer of type +.Dq Fa "bitstr_t *" +to sufficient space to store +.Fa nbits +bits, or +.Dv NULL +if no space is available. +.Pp +The macro +.Fn bit_decl +allocates sufficient space to store +.Fa nbits +bits on the stack. +.Pp +The macro +.Fn bitstr_size +returns the number of elements of type +.Fa bitstr_t +necessary to store +.Fa nbits +bits. +This is useful for copying bit strings. +.Pp +The macros +.Fn bit_clear +and +.Fn bit_set +clear or set the zero-based numbered bit +.Fa bit , +in the bit string +.Ar name . +.Pp +The +.Fn bit_nset +and +.Fn bit_nclear +macros +set or clear the zero-based numbered bits from +.Fa start +to +.Fa stop +in the bit string +.Ar name . +.Pp +The +.Fn bit_test +macro +evaluates to non-zero if the zero-based numbered bit +.Fa bit +of bit string +.Fa name +is set, and zero otherwise. +.Pp +The +.Fn bit_ffs +macro +stores in the location referenced by +.Fa value +the zero-based number of the first bit set in the array of +.Fa nbits +bits referenced by +.Fa name . +If no bits are set, the location referenced by +.Fa value +is set to \-1. +.Pp +The macro +.Fn bit_ffc +stores in the location referenced by +.Fa value +the zero-based number of the first bit not set in the array of +.Fa nbits +bits referenced by +.Fa name . +If all bits are set, the location referenced by +.Fa value +is set to \-1. +.Pp +The macros +.Fn bit_clear , +.Fn bit_set +and +.Fn bit_test +will evaluate the +.Fa bit +argument more than once, so avoid using pre- or post-, increment or decrement. +The arguments to the other macros are evaluated only once and may safely +have side effects. +.Sh EXAMPLE +.Bd -literal -offset indent +#include +#include + +... +#define LPR_BUSY_BIT 0 +#define LPR_FORMAT_BIT 1 +#define LPR_DOWNLOAD_BIT 2 +... +#define LPR_AVAILABLE_BIT 9 +#define LPR_MAX_BITS 10 + +make_lpr_available() +{ + bitstr_t bit_decl(bitlist, LPR_MAX_BITS); + ... + bit_nclear(bitlist, 0, LPR_MAX_BITS - 1); + ... + if (!bit_test(bitlist, LPR_BUSY_BIT)) { + bit_clear(bitlist, LPR_FORMAT_BIT); + bit_clear(bitlist, LPR_DOWNLOAD_BIT); + bit_set(bitlist, LPR_AVAILABLE_BIT); + } +} +.Ed +.Sh SEE ALSO +.Xr malloc 3 +.Sh HISTORY +The +.Nm bitstring +functions first appeared in 4.4BSD. diff --git a/man/gethostuuid.2 b/man/gethostuuid.2 new file mode 100644 index 0000000..3684830 --- /dev/null +++ b/man/gethostuuid.2 @@ -0,0 +1,55 @@ +.Dd Nov 5, 2008 +.Dt GETHOSTUUID \&2 "Mac OS X System Calls Manual" +.Os "Mac OS X" +.Sh NAME +.Nm gethostuuid +.Nd return a unique identifier for the current machine +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fo gethostuuid +.Fa "uuid_t id" +.Fa "const struct timespec *wait" +.Fc +.Sh DESCRIPTION +The +.Fn gethostuuid +function returns a 16-byte +.Ft uuid_t +specified by +.Fa id , +that uniquely identifies the current machine. +Be aware that the hardware identifiers that +.Fn gethostuuid +uses to generate the UUID can themselves be modified. +.Pp +The +.Fa wait +argument is a pointer to a +.Ft "struct timespec" +that specifies the maximum time to wait for the result. +Setting the +.Fa tv_sec +and +.Fa tv_nsec +fields to zero means to wait indefinitely until it completes. +.Sh RETURN VALUES +The +.Fn gethostuuid +function returns zero on success or -1 on error. +.Sh ERRORS +The +.Fn gethostuuid +functions fails if: +.Bl -tag -width Er +.It Bq Er EFAULT +.Fa wait +points to memory that is not a valid part of the process +address space. +.It Bq Er EWOULDBLOCK +The +.Fa wait +timeout expired before the UUID could be obtained. +.El +.Sh SEE ALSO +.Xr uuid 3 diff --git a/man/manpages.lst b/man/manpages.lst new file mode 100644 index 0000000..65ecdeb --- /dev/null +++ b/man/manpages.lst @@ -0,0 +1,372 @@ +# manpage tables +# [ ...] + +# man2 +brk.2 brk.2 sbrk.2 +creat.2 creat.2 +gethostuuid.2 gethostuuid.2 +killpg.2 killpg.2 +nanosleep.2 nanosleep.2 +sigblock.2 sigblock.2 +sigpause.2 sigpause.2 +sigsetmask.2 sigsetmask.2 sigmask.2 +sigvec.2 sigvec.2 +sigwait.2 sigwait.2 + +# man3 +a64l.3 a64l.3 l64a.3 +abort.3 abort.3 +abs.3 abs.3 +acl.3 acl.3 posix1e.3 +acl_add_flag_np.3 acl_add_flag_np.3 +acl_add_perm.3 acl_add_perm.3 +acl_clear_flags_np.3 acl_clear_flags_np.3 +acl_clear_perms.3 acl_clear_perms.3 +acl_copy_entry.3 acl_copy_entry.3 +acl_copy_ext.3 acl_copy_ext.3 acl_copy_ext_native.3 acl_copy_int.3 acl_copy_int_native.3 acl_size.3 +acl_create_entry.3 acl_create_entry.3 acl_create_entry_np.3 +acl_delete_entry.3 acl_delete_entry.3 +acl_delete_flag_np.3 acl_delete_flag_np.3 +acl_delete_perm.3 acl_delete_perm.3 +acl_dup.3 acl_dup.3 +acl_free.3 acl_free.3 +acl_from_text.3 acl_from_text.3 +acl_get.3 acl_get.3 acl_get_fd.3 acl_get_fd_np.3 acl_get_file.3 acl_get_link_np.3 +acl_get_entry.3 acl_get_entry.3 +acl_get_flagset_np.3 acl_get_flagset_np.3 +acl_get_perm_np.3 acl_get_perm_np.3 +acl_get_permset.3 acl_get_permset.3 +acl_get_permset_mask_np.3 acl_get_permset_mask_np.3 acl_set_permset_mask_np.3 acl_maximal_permset_mask_np.3 +acl_get_qualifier.3 acl_get_qualifier.3 +acl_get_tag_type.3 acl_get_tag_type.3 +acl_init.3 acl_init.3 +acl_set.3 acl_set.3 acl_set_fd.3 acl_set_fd_np.3 acl_set_file.3 acl_set_link_np.3 +acl_set_flagset_np.3 acl_set_flagset_np.3 +acl_set_permset.3 acl_set_permset.3 +acl_set_qualifier.3 acl_set_qualifier.3 +acl_set_tag_type.3 acl_set_tag_type.3 +acl_to_text.3 acl_to_text.3 +acl_valid.3 acl_valid.3 acl_valid_fd_np.3 acl_valid_file_np.3 acl_valid_link_np.3 +addr2ascii.3 addr2ascii.3 ascii2addr.3 +alarm.3 alarm.3 +alloca.3 alloca.3 +arc4random.3 arc4random.3 arc4random_addrandom.3 arc4random_buf.3 arc4random_stir.3 arc4random_uniform.3 +assert.3 assert.3 +atexit.3 atexit.3 atexit_b.3 +atof.3 atof.3 atof_l.3 +atoi.3 atoi.3 atoi_l.3 +atol.3 atol.3 atol_l.3 atoll.3 atoll_l.3 +backtrace.3 backtrace.3 backtrace_symbols.3 backtrace_symbols_fd.3 backtrace_from_fp.3 backtrace_image_offsets.3 +basename.3 basename.3 basename_r.3 +bcmp.3 bcmp.3 +bcopy.3 bcopy.3 +bitstring.3 bitstring.3 bit_alloc.3 bit_clear.3 bit_decl.3 bit_ffs.3 bit_nclear.3 bit_nset.3 bit_set.3 bit_test.3 bitstr_size.3 +bsd_signal.3 bsd_signal.3 +bsearch.3 bsearch.3 bsearch_b.3 +bstring.3 bstring.3 +btowc.3 btowc.3 wctob.3 btowc_l.3 wctob_l.3 +btree.3 btree.3 +byteorder.3 byteorder.3 htonl.3 htons.3 ntohl.3 ntohs.3 +bzero.3 bzero.3 +catclose.3 catclose.3 +catgets.3 catgets.3 +catopen.3 catopen.3 +clock.3 clock.3 +clock_gettime.3 clock_gettime.3 clock_settime.3 clock_getres.3 clock_gettime_nsec_np.3 +confstr.3 confstr.3 +open_memstream.3 open_memstream.3 open_wmemstream.3 +crypt.3 crypt.3 encrypt.3 setkey.3 +ctermid.3 ctermid.3 ctermid_r.3 +ctime.3 ctime.3 asctime.3 asctime_r.3 asctime_r.3 ctime_r.3 difftime.3 gmtime.3 gmtime.3 gmtime_r.3 gmtime_r.3 localtime.3 localtime_r.3 mktime.3 mktime.3 timegm.3 timelocal.3 +ctype.3 ctype.3 +ctype_l.3 ctype_l.3 +daemon.3 daemon.3 +dbm.3 dbm.3 dbm_clearerr.3 dbm_close.3 dbm_delete.3 dbm_dirfno.3 dbm_error.3 dbm_fetch.3 dbm_firstkey.3 dbm_nextkey.3 dbm_open.3 dbm_store.3 +dbopen.3 dbopen.3 db.3 +devname.3 devname.3 devname_r.3 +digittoint.3 digittoint.3 digittoint_l.3 +directory.3 directory.3 closedir.3 dirfd.3 fdopendir.3 opendir.3 readdir.3 readdir_r.3 rewinddir.3 seekdir.3 telldir.3 +dirname.3 dirname.3 dirname_r.3 +div.3 div.3 +duplocale.3 duplocale.3 +ecvt.3 ecvt.3 fcvt.3 gcvt.3 +endutxent.3 endutxent.3 getutxent.3 getutxid.3 getutxline.3 pututxline.3 setutxent.3 +err.3 err.3 err_set_exit.3 err_set_file.3 errc.3 errx.3 verr.3 verrc.3 verrx.3 vwarn.3 vwarnc.3 vwarnx.3 warn.3 warnc.3 warnx.3 err_set_exit_b.3 +ethers.3 ethers.3 ether_aton.3 ether_hostton.3 ether_line.3 ether_ntoa.3 ether_ntohost.3 +exec.3 exec.3 execl.3 execle.3 execlp.3 execv.3 execvp.3 +exit.3 exit.3 _Exit.3 +fclose.3 fclose.3 +ferror.3 ferror.3 clearerr.3 clearerr_unlocked.3 feof.3 feof_unlocked.3 ferror_unlocked.3 fileno.3 fileno_unlocked.3 +fflush.3 fflush.3 fpurge.3 +fgetln.3 fgetln.3 +fgets.3 fgets.3 gets.3 +fgetwln.3 fgetwln.3 fgetwln_l.3 +fgetws.3 fgetws.3 fgetws_l.3 +flockfile.3 flockfile.3 ftrylockfile.3 funlockfile.3 +fmtcheck.3 fmtcheck.3 +fmtmsg.3 fmtmsg.3 +fnmatch.3 fnmatch.3 +fopen.3 fopen.3 fdopen.3 freopen.3 fmemopen.3 +fparseln.3 fparseln.3 +fputs.3 fputs.3 puts.3 +fputws.3 fputws.3 fputws_l.3 +fread.3 fread.3 fwrite.3 +freelocale.3 freelocale.3 +fseek.3 fseek.3 fgetpos.3 fseeko.3 fsetpos.3 ftell.3 ftello.3 rewind.3 +ftime.3 ftime.3 +ftok.3 ftok.3 +fts.3 fts.3 fts_children.3 fts_close.3 fts_open.3 fts_read.3 fts_set.3 fts_open_b.3 +ftw.3 ftw.3 nftw.3 +funopen.3 funopen.3 fropen.3 fwopen.3 +fwide.3 fwide.3 +getbsize.3 getbsize.3 +getc.3 getc.3 fgetc.3 getc_unlocked.3 getchar.3 getchar_unlocked.3 getw.3 +getcap.3 getcap.3 cgetcap.3 cgetclose.3 cgetent.3 cgetfirst.3 cgetmatch.3 cgetnext.3 cgetnum.3 cgetset.3 cgetstr.3 cgetustr.3 +getcwd.3 getcwd.3 getwd.3 +getdate.3 getdate.3 +getdomainname.3 getdomainname.3 setdomainname.3 +getenv.3 getenv.3 putenv.3 setenv.3 unsetenv.3 +gethostid.3 gethostid.3 sethostid.3 +gethostname.3 gethostname.3 sethostname.3 +getlastlogx.3 getlastlogx.3 getlastlogxbyname.3 getutmp.3 getutmpx.3 utmpxname.3 +getline.3 getline.3 getdelim.3 +getloadavg.3 getloadavg.3 +getmntinfo.3 getmntinfo.3 getmntinfo_r_np.3 +getopt.3 getopt.3 +getopt_long.3 getopt_long.3 getopt_long_only.3 +getpagesize.3 getpagesize.3 +getpass.3 getpass.3 +getpeereid.3 getpeereid.3 +getprogname.3 getprogname.3 setprogname.3 +getsubopt.3 getsubopt.3 +getttyent.3 getttyent.3 endttyent.3 getttynam.3 setttyent.3 +getusershell.3 getusershell.3 endusershell.3 setusershell.3 +getvfsbyname.3 getvfsbyname.3 +getwc.3 getwc.3 fgetwc.3 getwchar.3 +getwc_l.3 getwc_l.3 fgetwc_l.3 getwchar_l.3 +glob.3 glob.3 globfree.3 +grantpt.3 grantpt.3 posix_openpt.3 ptsname.3 unlockpt.3 +hash.3 hash.3 +hcreate.3 hcreate.3 hdestroy.3 hsearch.3 +imaxabs.3 imaxabs.3 +imaxdiv.3 imaxdiv.3 +index.3 index.3 +inet.3 inet.3 addr.3 inet_addr.3 inet_aton.3 inet_lnaof.3 inet_makeaddr.3 inet_netof.3 inet_network.3 inet_ntoa.3 inet_ntop.3 inet_pton.3 network.3 ntoa.3 +inet_net.3 inet_net.3 inet_net_ntop.3 inet_net_pton.3 +insque.3 insque.3 remque.3 +intro.3 intro.3 +isalnum.3 isalnum.3 +isalnum_l.3 isalnum_l.3 isalpha_l.3 isblank_l.3 iscntrl_l.3 isdigit_l.3 isgraph_l.3 ishexnumber_l.3 isideogram_l.3 islower_l.3 isnumber_l.3 isphonogram_l.3 isprint_l.3 ispunct_l.3 isrune_l.3 isspace_l.3 isspecial_l.3 isupper_l.3 isxdigit_l.3 +isalpha.3 isalpha.3 +isascii.3 isascii.3 +isblank.3 isblank.3 +iscntrl.3 iscntrl.3 +isdigit.3 isdigit.3 isnumber.3 +isgraph.3 isgraph.3 +isideogram.3 isideogram.3 +islower.3 islower.3 +isphonogram.3 isphonogram.3 +isprint.3 isprint.3 +ispunct.3 ispunct.3 +isrune.3 isrune.3 +isspace.3 isspace.3 +isspecial.3 isspecial.3 +isupper.3 isupper.3 +iswalnum.3 iswalnum.3 iswalpha.3 iswascii.3 iswblank.3 iswcntrl.3 iswdigit.3 iswgraph.3 iswhexnumber.3 iswideogram.3 iswlower.3 iswnumber.3 iswphonogram.3 iswprint.3 iswpunct.3 iswrune.3 iswspace.3 iswspecial.3 iswupper.3 iswxdigit.3 +iswalnum_l.3 iswalnum_l.3 iswalpha_l.3 iswblank_l.3 iswcntrl_l.3 iswdigit_l.3 iswgraph_l.3 iswhexnumber_l.3 iswideogram_l.3 iswlower_l.3 iswnumber_l.3 iswphonogram_l.3 iswprint_l.3 iswpunct_l.3 iswrune_l.3 iswspace_l.3 iswspecial_l.3 iswupper_l.3 iswxdigit_l.3 +isxdigit.3 isxdigit.3 ishexnumber.3 +labs.3 labs.3 +lchflags.3 lchflags.3 +lchmod.3 lchmod.3 +ldiv.3 ldiv.3 +linkaddr.3 linkaddr.3 link_addr.3 link_ntoa.3 +llabs.3 llabs.3 +lldiv.3 lldiv.3 +localeconv.3 localeconv.3 localeconv_l.3 +lockf.3 lockf.3 +login.3 login.3 logwtmp.3 logout.3 +lsearch.3 lsearch.3 lfind.3 +lutimes.3 lutimes.3 +mblen.3 mblen.3 mblen_l.3 +mbrlen.3 mbrlen.3 mbrlen_l.3 +mbrtowc.3 mbrtowc.3 mbrtowc_l.3 +mbrune.3 mbrune.3 mbmb.3 mbrrune.3 +mbsinit.3 mbsinit.3 mbsinit_l.3 +mbsrtowcs.3 mbsrtowcs.3 mbsnrtowcs.3 mbsrtowcs_l.3 mbsnrtowcs_l.3 +mbstowcs.3 mbstowcs.3 mbstowcs_l.3 +mbtowc.3 mbtowc.3 mbtowc_l.3 +memccpy.3 memccpy.3 +memchr.3 memchr.3 +memcmp.3 memcmp.3 +memcpy.3 memcpy.3 +memmem.3 memmem.3 +memmove.3 memmove.3 +memory.3 memory.3 +memset.3 memset.3 +memset_s.3 memset_s.3 +memset_pattern.3 memset_pattern.3 memset_pattern4.3 memset_pattern8.3 memset_pattern16.3 +mkpath_np.3 mkpath_np.3 +mktemp.3 mktemp.3 mkdtemp.3 mkstemp.3 mkstemps.3 mkostemp.3 mkostemps.3 mkdtempat_np.3 mkstempsat_np.3 mkostempsat_np.3 +mpool.3 mpool.3 mpool_close.3 mpool_filter.3 mpool_get.3 mpool_new.3 mpool_open.3 mpool_put.3 mpool_sync.3 +multibyte.3 multibyte.3 +newlocale.3 newlocale.3 +nextwctype.3 nextwctype.3 nextwctype_l.3 +nice.3 nice.3 +nl_langinfo.3 nl_langinfo.3 nl_langinfo_l.3 +nlist.3 nlist.3 +opendev.3 opendev.3 +openpty.3 openpty.3 forkpty.3 login_tty.3 +pause.3 pause.3 +popen.3 popen.3 pclose.3 +posix_memalign.3 posix_memalign.3 +printf.3 printf.3 asprintf.3 dprintf.3 fprintf.3 snprintf.3 sprintf.3 vasprintf.3 vdprintf.3 vfprintf.3 vprintf.3 vsnprintf.3 vsprintf.3 +printf_l.3 printf_l.3 asprintf_l.3 fprintf_l.3 snprintf_l.3 sprintf_l.3 vasprintf_l.3 vfprintf_l.3 vprintf_l.3 vsnprintf_l.3 vsprintf_l.3 +psignal.3 psignal.3 sys_siglist.3 sys_signame.3 strsignal.3 sys_siglist.3 sys_signame.3 +psort.3 psort.3 psort_b.3 psort_r.3 +putc.3 putc.3 fputc.3 putc_unlocked.3 putchar.3 putchar_unlocked.3 putw.3 +putwc.3 putwc.3 fputwc.3 putwchar.3 +putwc_l.3 putwc_l.3 fputwc_l.3 putwchar_l.3 +pwcache.3 pwcache.3 group_from_gid.3 user_from_uid.3 +qsort.3 qsort.3 heapsort.3 mergesort.3 qsort_r.3 heapsort_b.3 mergesort_b.3 qsort_b.3 +querylocale.3 querylocale.3 +radixsort.3 radixsort.3 sradixsort.3 +raise.3 raise.3 +rand.3 rand.3 rand_r.3 srand.3 sranddev.3 +rand48.3 rand48.3 _rand48.3 drand48.3 erand48.3 jrand48.3 lcong48.3 lrand48.3 mrand48.3 nrand48.3 seed48.3 srand48.3 +random.3 random.3 initstate.3 setstate.3 srandom.3 srandomdev.3 +rbtree.3 rbtree.3 rb_tree_init.3 rb_tree_insert_node.3 rb_tree_remove_node.3 rb_tree_find_node.3 rb_tree_find_node_geq.3 rb_tree_find_node_leq.3 rb_tree_iterate.3 rb_tree_count.3 RB_TREE_MIN.3 RB_TREE_MAX.3 RB_TREE_FOREACH.3 RB_TREE_FOREACH_REVERSE.3 +readpassphrase.3 readpassphrase.3 +realpath.3 realpath.3 +recno.3 recno.3 +regex.3 regex.3 regcomp.3 regexec.3 regerror.3 regfree.3 regncomp.3 regnexec.3 regwcomp.3 regwexec.3 regwncomp.3 regwnexec.3 regcomp_l.3 regncomp_l.3 regwcomp_l.3 regwncomp_l.3 +remove.3 remove.3 +rindex.3 rindex.3 +rune.3 rune.3 fgetrune.3 fputrune.3 fungetrune.3 setinvalidrune.3 setrunelocale.3 sgetrune.3 sputrune.3 +scandir.3 scandir.3 alphasort.3 scandir_b.3 +scanf.3 scanf.3 fscanf.3 sscanf.3 vfscanf.3 vscanf.3 vsscanf.3 +scanf_l.3 scanf_l.3 fscanf_l.3 sscanf_l.3 vfscanf_l.3 vscanf_l.3 vsscanf_l.3 +setbuf.3 setbuf.3 setbuffer.3 setlinebuf.3 setvbuf.3 +setlocale.3 setlocale.3 +setmode.3 setmode.3 getmode.3 +setruid.3 setruid.3 setrgid.3 +siginterrupt.3 siginterrupt.3 +signal.3 signal.3 +signbit.3 signbit.3 +sigsetops.3 sigsetops.3 sigaddset.3 sigdelset.3 sigemptyset.3 sigfillset.3 sigismember.3 +sleep.3 sleep.3 +sockatmark.3 sockatmark.3 +sourcefilter.3 sourcefilter.3 getsourcefilter.3 getipv4sourcefilter.3 setsourcefilter.3 setipv4sourcefilter.3 +statvfs.3 statvfs.3 fstatvfs.3 +stdarg.3 stdarg.3 va_arg.3 va_copy.3 va_end.3 va_start.3 +stdio.3 stdio.3 +strcasecmp.3 strcasecmp.3 strcasecmp_l.3 strncasecmp.3 strncasecmp_l.3 +strcat.3 strcat.3 strncat.3 +strchr.3 strchr.3 strrchr.3 +strcmp.3 strcmp.3 strncmp.3 +strcoll.3 strcoll.3 strcoll_l.3 +strcpy.3 strcpy.3 stpcpy.3 stpncpy.3 strncpy.3 +strdup.3 strdup.3 strndup.3 +strerror.3 strerror.3 perror.3 strerror_r.3 sys_errlist.3 sys_nerr.3 +strfmon.3 strfmon.3 strfmon_l.3 +strftime.3 strftime.3 strftime_l.3 +string.3 string.3 +stringlist.3 stringlist.3 sl_add.3 sl_find.3 sl_free.3 sl_init.3 +strlcpy.3 strlcpy.3 strlcat.3 +strlen.3 strlen.3 strnlen.3 +strmode.3 strmode.3 +strpbrk.3 strpbrk.3 +strptime.3 strptime.3 strptime_l.3 +strsep.3 strsep.3 +strspn.3 strspn.3 strcspn.3 +strstr.3 strstr.3 strcasestr.3 strcasestr_l.3 strnstr.3 +strtod.3 strtod.3 strtof.3 strtold.3 +strtod_l.3 strtod_l.3 strtof_l.3 strtold_l.3 +strtofflags.3 strtofflags.3 fflagstostr.3 +strtok.3 strtok.3 strtok_r.3 +strtol.3 strtol.3 strtoll.3 strtoq.3 strtoimax.3 +strtol_l.3 strtol_l.3 strtoimax_l.3 strtoll_l.3 strtoq_l.3 strtoul_l.3 strtoull_l.3 strtoumax_l.3 strtouq_l.3 +strtoul.3 strtoul.3 strtoull.3 strtoumax.3 strtouq.3 +strxfrm.3 strxfrm.3 strxfrm_l.3 +style.3 style.3 +swab.3 swab.3 +sync_volume_np.3 sync_volume_np.3 fsync_volume_np.3 +sysconf.3 sysconf.3 +sysctl.3 sysctl.3 sysctlbyname.3 sysctlnametomib.3 +sysexits.3 sysexits.3 +system.3 system.3 +tcgetpgrp.3 tcgetpgrp.3 +tcgetsid.3 tcgetsid.3 +tcsendbreak.3 tcsendbreak.3 tcdrain.3 tcflow.3 tcflush.3 +tcsetattr.3 tcsetattr.3 cfgetispeed.3 cfgetospeed.3 cfmakeraw.3 cfsetispeed.3 cfsetospeed.3 cfsetspeed.3 tcgetattr.3 +tcsetpgrp.3 tcsetpgrp.3 +time.3 time.3 +time2posix.3 time2posix.3 posix2time.3 +times.3 times.3 +timezone.3 timezone.3 +timingsafe_bcmp.3 timingsafe_bcmp.3 +timespec_get.3 timespec_get.3 +tmpnam.3 tmpnam.3 tempnam.3 tmpfile.3 +toascii.3 toascii.3 +tolower.3 tolower.3 tolower_l.3 +toupper.3 toupper.3 toupper_l.3 +towlower.3 towlower.3 towlower_l.3 +towupper.3 towupper.3 towupper_l.3 +tsearch.3 tsearch.3 tdelete.3 tfind.3 twalk.3 +ttyname.3 ttyname.3 ttyname_r.3 isatty.3 ttyslot.3 +tzset.3 tzset.3 tzsetwall.3 +ualarm.3 ualarm.3 +ulimit.3 ulimit.3 +uname.3 uname.3 +ungetc.3 ungetc.3 +ungetwc.3 ungetwc.3 ungetwc_l.3 +unvis.3 unvis.3 strunvis.3 strunvisx.3 +uselocale.3 uselocale.3 +usleep.3 usleep.3 +utime.3 utime.3 +vis.3 vis.3 nvis.3 strvis.3 strnvis.3 strvisx.3 strnvisx.3 strenvisx.3 svis.3 snvis.3 strsvis.3 strsnvis.3 strsvisx.3 strsnvisx.3 strsenvisx.3 +wcrtomb.3 wcrtomb.3 wcrtomb_l.3 +wcscoll.3 wcscoll.3 wcscoll_l.3 +wcsftime.3 wcsftime.3 wcsftime_l.3 +wcsrtombs.3 wcsrtombs.3 wcsnrtombs.3 wcsrtombs_l.3 wcsnrtombs_l.3 +wcstod.3 wcstod.3 wcstof.3 wcstold.3 +wcstod_l.3 wcstod_l.3 wcstof_l.3 wcstold_l.3 +wcstok.3 wcstok.3 +wcstol.3 wcstol.3 wcstoimax.3 wcstoll.3 wcstoul.3 wcstoull.3 wcstoumax.3 +wcstol_l.3 wcstol_l.3 wcstoimax_l.3 wcstoll_l.3 wcstoul_l.3 wcstoull_l.3 wcstoumax_l.3 +wcstombs.3 wcstombs.3 wcstombs_l.3 +wcswidth.3 wcswidth.3 wcswidth_l.3 +wcsxfrm.3 wcsxfrm.3 wcsxfrm_l.3 +wctomb.3 wctomb.3 wctomb_l.3 +wctrans.3 wctrans.3 towctrans.3 towctrans_l.3 wctrans_l.3 +wctype.3 wctype.3 iswctype.3 iswctype_l.3 wctype_l.3 +wcwidth.3 wcwidth.3 wcwidth_l.3 +wmemchr.3 wmemchr.3 wmemcmp.3 wmemcpy.3 wmemmove.3 wmemset.3 wcpcpy.3 wcpncpy.3 wcsdup.3 wcscasecmp.3 wcscasecmp_l.3 wcscat.3 wcschr.3 wcscmp.3 wcscpy.3 wcscspn.3 wcslcat.3 wcslcpy.3 wcslen.3 wcsncasecmp.3 wcsncasecmp_l.3 wcsncat.3 wcsncmp.3 wcsncpy.3 wcsnlen.3 wcspbrk.3 wcsrchr.3 wcsspn.3 wcsstr.3 +wordexp.3 wordexp.3 wordfree.3 +wprintf.3 wprintf.3 fwprintf.3 swprintf.3 vwprintf.3 vfwprintf.3 vswprintf.3 +wprintf_l.3 wprintf_l.3 fwprintf_l.3 swprintf_l.3 vwprintf_l.3 vfwprintf_l.3 vswprintf_l.3 +wscanf.3 wscanf.3 fwscanf.3 swscanf.3 vfwscanf.3 vswscanf.3 vwscanf.3 +wscanf_l.3 wscanf_l.3 fwscanf_l.3 swscanf_l.3 vfwscanf_l.3 vswscanf_l.3 vwscanf_l.3 +xlocale.3 xlocale.3 +xprintf.3 xprintf.3 asxprintf.3 dxprintf.3 fxprintf.3 sxprintf.3 vasxprintf.3 vdxprintf.3 vfxprintf.3 vsxprintf.3 vxprintf.3 +xprintf_comp.3 xprintf_comp.3 free_printf_comp.3 new_printf_comp.3 +xprintf_domain.3 xprintf_domain.3 copy_printf_domain.3 free_printf_domain.3 new_printf_domain.3 register_printf_domain_function.3 register_printf_domain_render_std.3 +xprintf_exec.3 xprintf_exec.3 asxprintf_exec.3 dxprintf_exec.3 fxprintf_exec.3 sxprintf_exec.3 vasxprintf_exec.3 vdxprintf_exec.3 vfxprintf_exec.3 vsxprintf_exec.3 vxprintf_exec.3 + +# man5 +big5.5 big5.5 +compat.5 compat.5 +euc.5 euc.5 +gb18030.5 gb18030.5 +gb2312.5 gb2312.5 +gbk.5 gbk.5 +mskanji.5 mskanji.5 +tzfile.5 tzfile.5 +utf2.5 utf2.5 +utf8.5 utf8.5 +utmp.5 utmp.5 lastlog.5 wtmp.5 +utmpx.5 utmpx.5 +xprintf.5 xprintf.5 + +# man7 +environ.7 environ.7 +re_format.7 re_format.7 diff --git a/man/style.3 b/man/style.3 new file mode 100644 index 0000000..1be83b9 --- /dev/null +++ b/man/style.3 @@ -0,0 +1,1482 @@ +.\" Copyright (c) 2017 Apple Inc. All rights reserved. +.Dd 12 January, 2018 +.Dt style 3 +.Os Darwin +.Sh NAME +.Nm style +.Nd C language style guide for Darwin low-level userspace projects +.Sh DESCRIPTION +This style's primary objective is to be as friendly to the code review process +as possible. Therefore, the style aims to ensure that code changes to the +project produce diffs that are +.Pp +.Bl -bullet -compact -offset indent +.It +small +.It +unambiguous +.It +viewable in side-by-side comparison tools +.El +.Pp +As a secondary objective, this style also aims to make code as clear as possible +for an uninitiated programmer reading it. "Clever" syntactic shortcuts are +actively discouraged in favor of code that is easy to understand, even if it is +less concise. Coincidentally, this practice also tends to lend itself to +generating more readable diffs. +.Pp +Like any style, consistent adherence across a project is a virtue in and of +itself, resulting in less distraction for the reader. However, these guidelines +should be taken as exactly that: guidelines. No style can be completely adhered +to all the time. When you have convinced yourself that a deviation from the +style is called for, just make sure it is for the greater good and maintains the +style's aims of minimizing diffs and code complexity. +.Sh GENERAL PRINCIPLES +.Ss Vertical space is a commodity +Scrolling vertically has always been easier than scrolling horizontally. +Computer mouse manufacturers went so far as to dedicate hardware to the task of +scrolling vertically when they came up with scroll wheels. Even on modern +trackpads, while it is possible to scroll horizontally, it is far easier to +scroll vertically. You just flick upwards. Do not be afraid to introduce extra +lines of code if it will result in clearer, more human-parseable diffs when +those lines are changed. +.Ss Horizontal space is precious +Scrolling horizontally is typically awkward, imprecise, and does not lend itself +well toward reading on computers or even in print. (Academic journals frequently +publish with two narrow columns per page to make reading easier, for example.) +Lines should be wrapped consciously; this should not be left to the editor. A +soft-wrapping scheme that looks good in your editor may not look good in someone +else's editor (or with a different configuration for the same editor). +.Pp +Just as natural language comments are difficult to read in one, long line, +so too are lines of code. Both natural languages and programming languages +deserve conscious, deliberate wrapping to improve readability. +.Pp +Wrap at a column width narrow enough to accommodate side-by-side patch +review. 80 is more likely to accommodate this, but 120 might be fine too. Pick a +reasonable column width and stick to it. Think about the lines you are wrapping. +If you have to wrap a line, do so in a way that is clear, and be willing to make +changes to accommodate that (e.g. don't be afraid to declare a variable +separately if having the declaration and assignment on the same line causes it +to wrap in an unclear way). +.Ss Indentation is for scope indication and nothing else +Indentation's sole purpose is to indicate scope. You should not use indentation +to align characters on two lines of source code (beyond, of course, aligning +the first characters of each line if they are both in the same scope). +.Pp +Given this aspect of the style, it does not particularly matter whether the +author chooses spaces or tabs for indentation, and therefore the style makes no +prescription (other than to pick one and stick with it). +.Pp +This style also has another implication: tabs and spaces should never appear +in sequence. Each line will be a series of tabs followed by the first character +of code. Tabs will never appear after the initial indentation of the line. +.Ss Don't require leaving the source to understand it +Always think of future maintainers and document your thought process for them. +Remember, a "future maintainer" might be you after you've forgotten why you did +something. For non-trivial changes, you should not rely on linking to a +ticket-tracking system to provide context and explanation for a piece of code. +You should strive to ensure the reader of your code does not have to +context-switch out of reading it in order to understand it. +.Pp +This is not to say that linking to external resources in code is bad, but +if a change's purpose can be reasonably expressed without interrupting how the +code reads and flows, just do it. You don't need to publish a whitepaper in +comments, but don't just give a link or ticket number with no context. +.Ss Each line of code should minimize entropy +It is actually very difficult to construct a hash comparison scheme that humans +can use without error consistently, and there have been successful social +engineering attacks on getting humans to read two hashes that are "close enough" +as identical. This means that humans need a lot of help telling the difference +between two lines of text. +.Pp +For any expression, divide it up into fundamental atoms (variable declarations, +conditionals, etc.) and then assign each of those atoms to its own line of code. +If you do this, when you change a single atom, it is immediately obvious that +.Em only +that atom changed and nothing else did. The more atoms share lines of code, the +more likely it is that changes to them will generate complex diffs that humans +will have difficulty understanding. +.Ss Don't assume a specific editor +Assume people will be reading your code in a tool that you do not control and +cannot influence. Try viewing your code in such a tool and make sure that it is +understandable. If you follow the guidelines of this style, your code may appear +different in another viewer (in terms of how many columns are required to +display a single line), but its structure will appear identical. +.Sh SPECIFIC GUIDELINES +.Ss Column Width and Line Wrap +80 columns opens the door for a three-way, side-by-side comparison, but it could +be impractical for a number of reasons. 120 columns should provide a nice +balance, but really all that matters is that you pick a width and stick to it. +.Pp +When indenting a continuation line, indent over by two additional tabs. This +visually separates the indented line from the next line, which may itself be +indented. If there is an operator in the middle of the line, the operator should +.Em not +be wrapped to the continuation line. +.Pp +.Em Good +.Bd -literal -offset indent +if (some_condition && some_other_condition && + yet_another_condition) { + exit(0); +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +if (some_condition && some_other_condition && + yet_another_condition) { + exit(0); +} + +if (some_condition && some_other_condition + && yet_another_condition) { + exit(0); +} +.Ed +.Pp +Notice on the good example that the +.Ic exit(0) +line is made obviously distinct from the indented conditions above it. It's very +clear on quick visual inspection that it's not a part of the conditional checks. +The +.Ic && +is left on the first line because, when reviewing a patch to this area, it will +be immediately clear to the reviewer that that line continues to the next one. +.Pp +.Ss Avoid prettifying alignment +Indentation is used only for indicating scope, so no consideration is given to +visual alignment of equal signs, colons, etc. across multiple lines. +.Pp +.Em Good +.Bd -literal -offset indent +typedef enum { + THING0 = 0, + THING1 = 1, + THING_THAT_IS_REALLY_LONG = 2, +} thing_t; +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +enum { + THING0 = 0, + THING1 = 1, + THING_THAT_IS_REALLY_LONG = 2, +}; +.Ed +.Pp +This creates bloated diffs. If you have to re-align a ton of lines after you've +added something longer, you get a bunch of whitespace diffs. So for variable +declarations, enumerations, assignments, etc. just keep every line independent. +.Pp +There is one exception to this rule, and that is if you choose to define a +flagset in terms of its raw hexadecimal values and wish to align them. In this +case, it is a significant benefit to have these values aligned, and you may do +so with spaces. +.Pp +.Em Example +.Bd -literal -offset indent +typedef enum { + F_INIT = 0x00, + F_FOO = 0x01, + F_BARBAZ = 0x02, + F_CAD = 0x04, + F_FAD = 0x08, + F_FUD = 0x10, + F_FLAME = 0x20, + F_FOOD = 0x40, +} flag_t; +.Ed +.Ss Only one blank line at a time +Use blank lines to separate logical chunks of code. Do not use more than one. +.Ss Initialization +C99 has named initializers for structures. Prefer those to initializing members +one-by-one later on. Both structures and arrays should be initialized in the +same style, with each element of the initializer being on its own line. This is +so that when an element is added to or removed from the initialization list, +that change gets its own line of diff. +.Pp +The exception to this is the string literal. +.Pp +.Em Good +.Bd -literal -offset indent +struct my_struct baz = { + .ms_foo = 1, + .ms_bar = NULL, +}; + +char *strings[] = { + "string", + "other string", +}; +.Ed +.Em Bad +.Bd -literal -offset indent +struct my_struct baz = { 1, NULL }; + +struct my_struct baz = { + 1, + NULL +}; + +struct my_struct baz = { .ms_foo = 1, .ms_bar = NULL, }; +.Ed +.Pp +The last element of an initializer list should be followed by a comma. This is +so that when you add a new element to that list, it's a one-line diff rather +rather than a two-line diff (one line of diff to add the +.Ic , +to the previous-last element, and another line of diff to add the new-last +element). +.Pp +.Em Good +.Bd -literal -offset indent +enum { + THING0, + THING1, +}; + +struct my_point p = { + .x = 1, + .y = 0, + .z = 1, +}; +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +enum { + THING0, THING1, +}; + +enum { + THING0, + THING1 +}; + +struct my_point p = { .x = 1, .y = 0, .z = 1 }; +.Ed +.Pp +Note that, if your project requires ANSI C compliance, you should disregard this +guideline, as it will not work under C89. +.Ss Avoid function name overloading +The +.Xr clang 1 +compiler supports extensions to the C language which allow for function name +overloading. Name overloading generally leads to code which is difficult to +read and introspect and should be avoided. +.Ss Prefix `struct` members +Any +.Ic struct +which is shared or exported should have a common prefix for each member. This +helps avoid collisions with preprocessor macros. +.Pp +.Em Good +.Bd -literal -offset indent +struct foobar { + int64_t fb_baz; + char *fb_string; +}; +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +struct foobar { + int64_t baz; + char *string; +}; +.Ed +.Pp +.Ss Types end with `_t` +A type is indicated with +.Ic _t +at the end of the +.Ic typedef , +whether the type refers to a +.Ic struct , +.Ic union , +.Ic enum , +etc. All types are indicated this way. Types are in all lower-case letters. +.Pp +.Em Good +.Bd -literal -offset indent +typedef uint64_t handle_t; +typedef enum foo foo_t; +typedef union bar bar_t; +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +typedef uint64_t Handle; +typedef enum foo foo_e; +typedef union bar bar_u; +.Ed +.Ss Use explicitly-sized integer types +Avoid integer types whose names do not indicate size, such as +.Ic int +or +.Ic long . +Instead, use the types from +.Ic stdint.h +(e.g. +.Ic int64_t , +.Ic uint32_t , +etc.), which explicitly indicate size. You may use size-ambiguous integer types +if an API requires it. +.Ss Use `sizeof()` on variables rather than types where appropriate +The +.Ic sizeof() +operator can take both types and variables as arguments. Where possible and +relevant, always pass a variable. This ensures that if the variable's type +changes, the proper size is used automatically. +.Pp +.Em Good +.Bd -literal -offset indent +uuid_t ident; +memcpy(ident, buff, sizeof(ident)); +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +uuid_t ident; +memcpy(ident, buff, sizeof(uuid_t)); +.Ed +.Pp +.Em IMPORTANT : +When applied to a +.Ic char * , +.Ic sizeof() +will return the width of a pointer, +.Em not +the size of the string literal it points to, so take care to only use +.Xr strlen 3 +for such cases. +.Pp +Relatedly, when applied to an array variable that is a parameter in a function's +parameter list, +.Ic sizeof() +will return the width of a pointer, +.Em not +the size of the type. +.Pp +.Em Good +.Bd -literal -offset indent +char *string = "the quick brown fox"; +size_t len = strlen(string); + +void +foo(uuid_t u) +{ + uuid_t u2; + memcpy(u2, u, sizeof(uuid_t)); +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +char *string = "the quick brown fox"; +size_t len = sizeof(string) - 1; + +void +foo(uuid_t u) +{ + uuid_t u2; + + // sizeof(u) == sizeof(void *) in this context. + memcpy(u2, u, sizeof(u)); +} +.Ed +.Ss Functions which take no parameters have a parameter list of `void` +In C, an empty function parameter list means that +.Em any +set of parameters is acceptable. In virtually all cases where you do this, you +mean to have a parameter list of +.Ic void . +.Pp +.Em Good +.Bd -literal -offset indent +void +foo(void) +{ + do_a_thing_without_arguments(); +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +void +foo() +{ + do_a_thing_without_arguments(); +} +.Ed +.Ss Preprocessor macros +Preprocessor definitions are written in all-caps. Macros which are function-like +may be lower-case provided they do not double-evaluate their arguments. +Function-like macros that do double-evaluate their arguments should be in +all-caps. +.Pp +.Em Good +.Bd -literal -offset indent +#define FOO 1 +#define halt() abort() + +// Does not double-evaluate _a and _b such that max(i++, j) is safe. +#define max(_a, _b) ({ \\ + typeof(_a) a1 = (_a); \\ + typeof(_b) b1 = (_b); \\ + (a1 < b1 ? b1 : a1); \\ +}) + +// Double-evaluates _a and _b, so MAX(i++, j) is not safe. +#define MAX(_a, _b) ((_a) < (_b) ? (_b) : (_a)) +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +#define kFoo 1 + +// Double-evaluates _a and _b. +#define max(_a, _b) ((_a) < (_b) ? (_b) : (_a)) +.Ed +.Pp +Where possible, you should prefer inline functions to preprocessor macros, or +split a macro into a preprocessor piece and an inline function piece. +.Pp +.Em Example +.Bd -literal -offset indent +static inline void +_debug_uint64_impl(const char *name, uint64_t val) +{ + fprintf(stderr, "%s = %llu\\n", name, val); +} + +#define debug_uint64(_v) do { \\ + _debug_uint64_impl(#_v, _v); \\ +} while (0) +.Ed +.Pp +In this example, the preprocessor is used to do something that only the +preprocessor can do: stringify the input variable's name. But once that work is +done, the actual logging of the value is done by an inline function. This keeps +the code much more readable. +.Ss Preprocessor macro parameters should be distinguished +Preprocessor macro expansion can run afoul of naming collisions with other +variables that are in the same scope as the macro being expanded. To help avoid +such collisions, parameters to preprocessor macros should have a prefix, suffix +or both. Another good option is to use a +.Ic _[A-Z] +prefix, since it is reserved by the C standard and will not collide with +preprocessor evaluation. +.Pp +.Em Example +.Bd -literal -offset indent +#define foo2(_x_) ((_x_) * 2) +#define foo4(_x) ((_x) * 4) +#define foo8(_X) ((_X) * 8) +.Ed +.Ss Preprocessor macro parameters should always be evaluated +When passing a parameter to a preprocessor macro, it should always be referred +to within parentheses to force evaluation. The exception is for parameters +intended to be string literals. +.Pp +.Em Good +.Bd -literal -offset indent +#define add2(__x) ((__x) + 2) +#define println(__fmt, ...) printf(__fmt "\\n", ## __VA_ARGS__) +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +#define add2(__x) x + 2 +.Ed +.Ss Preprocessor directives always start at column 0 +Preprocessor directives do not have scope, and therefore they always start at +column zero. +.Pp +.Em Good +.Bd -literal -offset indent +if (do_loop) { + for (i = 0; i < 10; i++) { +#if CONFIG_FOOBAR + foobar(i); +#else + foobaz(i); +#endif + } +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +if (do_loop) { + for (i = 0; i < 10; i++) { + #if CONFIG_FOOBAR + foobar(i); + #else + foobaz(i); + #endif + } +} +.Ed +.Ss Always reference string length directly +Do not hard-code the size of a string. Use either +.Ic sizeof(str) - 1 +or +.Ic strlen(str) . +In the latter case, +.Xr clang 1 +is smart enough to recognize when a constant string is being passed to +.Xr strlen(3) +and replace the function call with the string's actual length. +.Pp +.Em Good +.Bd -literal -offset indent +char str[] = "string"; +frob_string(str, sizeof(str) - 1); +frob_string(str, strlen(str)); +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +char str[] = "string"; +frob_string(str, 6); +.Ed +.Ss Don't pointlessly validate inputs +If you control all call sites for a function, then there is no point to +validating the inputs to that function. If none of your call sites pass +.Ic NULL , +to a pointer parameter, for example, then the a +.Ic NULL +input indicates that there is state corruption in your address space. You may +think that it's good to catch such corruption, but +.Ic NULL +is just +.Em one +possible invalid pointer value. What if the invalid input is +.Ic 0x1 ? +What if it is +.Ic 0x2 ? +Should you also check for those? +.Pp +This kind of input checking complicates code. Because it indicates state +corruption, the only sensible thing to do in that situation would be to abort. +But the operating system has mechanisms in place to detect the reference of an +invalid resource, such as virtual memory and use-after-free detection. There is +no point to you duplicating these mechanisms. +.Pp +Of course, you should always validate inputs +.Em when they come from untrusted external sources +(such as a file or IPC message), but if the inputs only ever comes from your +program, you should trust them. +.Pp +.Em Good +.Bd -literal -offset indent +static foo_t * +get_item(foo_t *arr, size_t idx) +{ + return &arr[idx]; +} + +int +only_call_site(foo_t *f) +{ + foo_t *arr = calloc(10, sizeof(arr[0])); + if (!arr) { + return errno; + } + + *f = get_item(arr, 0); + return 0; +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +static foo_t * +get_item(foo_t *arr, size_t idx) +{ + if (!arr) { + // No point to this check since we'll abort immediately below when we + // try to dereference `arr`. The crash report will have more than enough + // information to diagnose the NULL pointer dereference if it ever + // happens. + abort(); + } + return &arr[idx]; +} + +int +only_call_site(foo_t *f) +{ + foo_t *arr = calloc(10, sizeof(arr[0])); + if (!arr) { + return errno; + } + + *f = get_item(arr, 0); + return 0; +} +.Ed +.Ss Abort on bad API inputs +The C language provides precious few compile-time validation mechanisms, and so +in many cases it is not possible to fully describe to the compiler the range of +expected inputs for an API. So your API should validate input from its caller +and abort on invalid input. Returning an error in such a case is pointless, +since the caller probably isn't checking the return code anyway. The only sure +way to get the programmer's attention is to abort the calling process with a +helpful message. The +.Ic os_crash +routine allows you to supply such a message that the crash reporter on Darwin +will display in its crash report. +.Pp +.Em Good +.Bd -literal -offset indent +uint8_t +foo_a_bar(uint8_t number) +{ + if (number > (UINT8_MAX / 2)) { + os_crash("number given to foo_a_bar() too large"); + } + return (number * 2); +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +int +foo_a_bar(uint8_t number, uint8_t *new_number) +{ + if (number > (UINT8_MAX / 2)) { + return EINVAL; + } + *new_number = (number * 2); + return 0; +} +.Ed +.Ss Don't mingle POSIX return codes and errors +Some POSIX routines have return values that indicate whether you should check +.Ic errno , +and others just return the error directly. While POSIX generally documents what +does what pretty well, there are lots of SPIs scattered around the system that +use both conventions and aren't documented at all, leaving you to spelunk +through the implementation to find out what's what. +.Pp +To avoid confusion, do not re-use the same variable for the return codes from +these functions. If an API returns a code indicating that you should check +.Ic errno , +name it +.Ic ret +or similar. If it returns the error directly, name it +.Ic error +or similar and make it of type +.Ic errno_t . +This makes it very clear to the person reading the code that you did the work to +find out how the API worked. By naming the variable you store the return value +in appropriately, a reader of your code (possibly Future You) can immediately +know what's going on. +.Pp +If you are making new API or SPI that returns an error code, make it return +.Ic errno_t +and do not use the global +.Ic errno +for communicating error information. +.Pp +.Em Good +.Bd -literal -offset indent +#include + +errno_t error = posix_spawn(NULL, "ls", NULL, NULL, argv, envp); +switch (error) { +case 0: + // Handle success. + break; +case EACCES: + // Handle "permission denied". + break; +} + +int ret = reboot(RB_AUTOBOOT); +if (ret == -1) { + switch (errno) { + case EPERM: + // Handle "permission denied". + break; + case EBUSY: + // Handle "reboot already in progress". + break; + } +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +int ret = posix_spawn(NULL, "ls", NULL, NULL, argv, envp); +switch (error) { +case 0: + // Handle success. + break; +case EACCES: + // Handle "permission denied". + break; +} + +int error = reboot(RB_AUTOBOOT); +if (error == -1) { + switch (errno) { + case EPERM: + // Handle "permission denied". + break; + case EBUSY: + // Handle "reboot already in progress". + break; + } +} +.Ed +.Ss Avoid complex `if` statements and return distinct error codes +Breaking up a single complex +.Ic if +statement +into multiple distinct checks is both more readable and makes it possible to be +more granular about handling failure cases. It also leads to smaller diffs if +one of those conditions turns out to require special handling. +.Pp +Complex +.Ic if +statements are often associated with input validation and just returning an +error code (usually +.Ic EINVAL ) +if any input is invalid. While deciding which error to return in which case is +more of an art than a science, that doesn't mean you should just give up and +return a single error every time there isn't an immediately obvious fit to the +case you've encountered. +.Pp +Ideally, every case where your routine may fail should be represented by a +distinct error code, but this is often not practical. Still, you should attempt +to distinguish each +.Em likely +failure case with its own error code. The POSIX error space is fairly rich, and +error descriptions are brief enough that they can be liberally interpreted. For +example, +.Ic ESRCH +can be used to apply to any situation where a resource could not be located, not +just conditions where there is literally "No such process". +.Pp +This isn't to say that you should never have compound conditions in an +.Ic if +statement, but the groupings should almost always be small, and the grouped +checks should be highly likely to require change as a group when change is +needed. +.Pp +.Em Good +.Bd -literal -offset indent +if (foo->f_int > 10 || foo->f_int < 5) + return ERANGE; +} + +if (!foo->f_uaddr) { + return EFAULT; +} + +if (foo->f_has_idx && foo->f_idx > 100) { + return ERANGE; +} + +if (foo->f_state != FS_INITIALIZED) { + return EBUSY; +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +if (foo->f_int > 10 || foo->f_int < 5 || !foo->f_uaddr || (foo->f_has_idx && foo->f_idx > 100) || + foo->f_state != FS_INITIALIZED) { + return EINVAL; +} +.Ed +.Pp +See +.Xr intro 2 , +.Ic , +and +.Ic +for the error codes supported on Darwin. +.Ss Don't NULL-check when calling `free(3)` +.Ic NULL +is valid input to +.Xr free 3 . +It's part of the API contract. Armed with this knowledge, you can do things like +avoid conditional memory calls, which are always weird. +.Pp +.Em Good +.Bd -literal -offset indent +char buff[1024]; +char *ptr = buff; +char *what2free = NULL; + +if (condition) { + ptr = malloc(8); + what2free = ptr; +} + +free(what2free); +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +char buff[1024]; +char *ptr = buff; +bool did_malloc = false; + +if (condition) { + ptr = malloc(8); + did_malloc = true; +} + +if (did_malloc) { + free(ptr); +} +.Ed +.Ss Distinguish exported and non-exported symbols +Any non-exported symbols should be prefixed with a +.Ic _ . +Thus any +.Ic static +functions, project-local interfaces, etc. should have this prefix. Exported +symbols (API or SPI) should +.Em not +have such a prefix. +.Pp +.Em Good +.Bd -literal -offset indent +static const char *_thing = "thing"; +static void _foo(void); + +void +_project_local_interface(void); +.Ed +.Em Bad +.Bd -literal -offset indent +static const char *thing = "thing"; +static void foo(void); + +void +project_local_interface(void); +.Ed +.Pp +Global variables should have a sensible prefix, preferably related to the +project name -- e.g. globals in the +.Xr libxpc 3 +project are prefixed with +.Ic xpc_ . +.Pp +You may also consider declaring a global structure which contains all of your +project's shared, unexported global state. This makes it very clear when code is +referencing that state. Also, if your project is a library at the libSystem +layer, this is required if you are ever to adopt +.Xr os_alloc_once 3 . +.Pp +.Em Example +.Bd -literal -offset indent +typedef struct _foobar_globals { + uint64_t fg_global_int; + char *fg_global_string; +} foobar_globals_t; + +foobar_globals_t _g; +foobar_globals_t *g = &_g; +.Ed +.Ss Distinguish SPIs meant for one caller +Sometimes projects must create bespoke SPIs for one particular caller, and these +SPIs are not considered suitable for general use. Append a suffix to these SPIs +to indicate their bespokeness and the intended caller with +.Ic _4caller . +For example, if you add an SPI specifically for IOKit, your suffix would likely +be +.Ic _4IOKit . +.Ss Use `#if` instead of `#ifdef` where appropriate +.Ic #ifdef +is to check if a token is +.Em defined at all to anything. +.Ic #if +is to check the token's value. The C standard specifies that when a token is +undefined, +.Ic #if +will evaluate it as +.Ic 0 . +When checking for features, it's almost always more appropriate to use +.Ic #if +since the lack of a feature could still be communicated by setting the token's +value to +.Ic 0 , +which would pass the +.Ic #ifdef +check. +.Ss Use Function Attributes from `` +If you're on Darwin, +.Ic libplatform +defines a lot of nice macros for compiler attributes. Use them to decorate your +functions. This gives the compiler lots more information so it can do fancy +optimizations. Things like +.Ic OS_NONNULL +let the compiler know that a parameter should never be +.Ic NULL . +.Ic OS_WARN_RESULT +is great for enforcing that a caller always check the return value of a +function. +.Pp +.Ic OS_MALLOC +lets the compiler know that the function returns a heap allocation, and +.Ic OS_OBJECT_RETURNS_RETAINED +lets ARC know that the function returns an object with a reference that the +caller is responsible for releasing. +.Pp +You can avoid having to decorate all your pointer parameters by using +.Ic OS_ASSUME_NONNULL_BEGIN +and +.Ic OS_ASSUME_NONNULL_END +and specifically annotating variables which +.Em can +be +.Ic NULL +with the +.Ic _Nullable +keyword. Either approach is acceptable. +.Pp +Generally, use these attributes on functions which will have callers who cannot +view the implementation. Putting many of these attributes on (for example) an +inline function is harmless, but the compiler can reason about things like +.Ic OS_NONNULL +and infer it when it can view the implementation at all call sites. +.Pp +So as a rule of thumb, if it's in a header, decorate it appropriately. These +attributes can also serve as nice implicit documentation around API and SPI. For +example, if you have a decoration of +.Ic OS_NONNULL1 , +you don't have to spell out in the HeaderDoc that you can't pass +.Ic NULL +for that parameter; it'll be right there in the declaration, and the compiler +will catch attempts to do so. +.Ss Distinguish C function definitions from declarations +In C, make the definition of a function findable and distinguishable from its +declaration (if any) through regular expressions. This way, you can find the +implementation of +.Ic foo +by doing a regex search for +.Ic ^foo , +and you won't get the declaration as a result. +.Pp +.Em Good +.Bd -literal -offset indent +static int foo(int bar); + +int +foo(int bar) +{ + return bar; +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +static int foo(int bar); + +int foo(int bar) +{ + return bar; +} +.Ed +.Pp +This has the additional benefit of allowing you to change the name/parameter +list of a function independently of the return type. A diff of either will not +be confused with the rest of the function signature. +.Ss Use HeaderDoc for API declarations +Make them look nice. Include the appropriate decorations (including an explicit +export attribute such as +.Ic OS_EXPORT +so it's very, very clear that it's intended to be API), availability attributes, +and HeaderDoc. Put this stuff before the function. +.Pp +.Em Example +.Bd -literal -offset indent +/*! + * @function foo + * Returns `bar` and ignores another parameter. + * + * @param bar + * The value to return. + * + * @param baz + * The value to ignore. + * + * @result + * The value of `bar`. This routine cannot fail. + */ +__API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +OS_EXPORT OS_WARN_RESULT OS_NONNULL2 +int +foo(int bar, char *baz); +.Ed +.Ss Comments +In general, use C++/C99-style comments. But there may be good reasons to use the +classic C-style comments, such as for HeaderDoc, which requires them, e.g. +.Bd -literal -offset indent +/*! + * Documentation + */ +.Ed +.Pp +Long, top-level comments may also use classic C-style comments. +.Pp +C++/C99-style comments may directly follow code on the same line only if they +are extremely brief. Otherwise, in general, comments and code should not share +a line. +.Pp +Also, do not get cute with +.Ic /* */ +comments and embed them within code. +.Pp +.Em Good +.Bd -literal -offset indent +// Comment on what the loop does. +for (i = 0; i < cnt; i++) { + // some code... +} + +/* + * A top-level or very long comment. + */ + +int ret = esoteric_spi(); // returns -1 on failure, does not set errno +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +//Comment + +int ret = esoteric_spi(); // This SPI returns -1 on failure but does not set + // errno, so here is a comment explaining that that really should be above + // the line of code rather than immediately following it. + +foo(arg1, /* first argument */, arg2 /* second argument */); +.Ed +.Ss `case` and `switch` are indented at the same level +.Ic case +and +.Ic switch +belong at the same column indent because indentation indicates scope, and due to +case fall-through, all cases are in the same scope -- one lower than the +previous. (Unless you scope them explicitly with braces, but you should avoid +doing that if at all possible.) +.Pp +.Em Good +.Bd -literal -offset indent +switch (thing) { +case THING1: + exit(0); + break; +case THING2: + exit(1); + break; +default: + __builtin_unreachable(); +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +switch (thing) { +case THING1: { + exit(0); + break; +} +case THING2: { + exit(1); + break; +} +default: + __builtin_unreachable(); +} + +switch (thing) { + case THING1: + exit(0); + break; + case THING2: + exit(1); + break; + default: { + __builtin_unreachable(); + } +} +.Ed +.Ss Use typed `enum`s +If you're declaring an +.Ic enum , +you should +.Ic typedef +it so the compiler can reason about valid values and know the width of the +.Ic enum +type if possible. The +.Ic OS_ENUM +macro provides the correct behavior for C, C++, and Objective-C. +.Ss Initialize all variables and fail closed +If you pre-declare a variable before using it, initialize it to a sane value. If +this value is something like the return value of the function, initialize it to +a value which indicates failure of the operation. You should +.Em always +do this even if there are no code paths which fail to initialize the variable +later. It's just good practice, and it gives the person reading your code an +indication of what ranges of values the variable is expected to hold. +.Pp +.Em Good +.Bd -literal -offset indent +int result = -1; + +if (success) { + result = 0; +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +int result; + +if (success) { + result = 0; +} +.Ed +.Pp +Any error variable should always be initialized to a non-success condition. In +general, consider success as something that your code must +.Em explicitly declare +and that the absence of such a declaration indicates failure. +.Pp +.Em Good +.Bd -literal -offset indent +int error = -1; + +if (is_root()) { + error = 0; +} else { + error = EPERM; +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +int error = 0; + +if (!is_root()) { + error = EPERM; +} +.Ed +.Pp +Note that you may omit an initializer for a complex +.Ic struct +type (such as the +.Xr stat 2 +.Ic struct ) +but then it is incumbent upon you to ensure that that variable is not used +uninitialized except to populate it. For many +.Ic struct +types, you can initialize them with +.Ic {0} . +This will not work for structures with nested structures though. For those you +can use +.Xr bzero 3 +or similar. +.Ss Using `goto` is fine +.Ic goto +has gotten a bad rap, but it's probably the best way in C to do lots of +sequential error handling. You don't +.Em have +to use +.Ic goto +if you don't want to, but if you do, just keep a a couple things in mind. +.Pp +.Bl -bullet -compact -offset indent +.It +Compile with +.Ic -Wsometimes-uninitialized . +With this warning, +.Xr clang 1 +will catch cases where a variable may be used uninitialized because a +.Ic goto +skipped the initialization. +.It +Never use +.Ic goto +as a looping construct. The C language has a few different control statements +for looping and iteration. Use one of those; it's not the 70's anymore. +.El +.Pp +These guidelines make it simple to use +.Ic goto +effectively while avoiding the +most common pitfalls. +.Ss Avoid magic Booleans +Sometimes you have to pass a parameter to a function to trigger some sort of +behavior. Avoid using a magic Boolean for these cases. Instead, use an invariant +that describes the behavior you are triggering. +.Pp +.Em Good +.Bd -literal -offset indent +replace_spaces(string, REPLACE_TABS_TOO); +replace_spaces(string, REPLACE_ONLY_SPACES); +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +replace_spaces(string, true); +replace_spaces(string, false); +.Ed +.Pp +If you find yourself creating many such Boolean values for function parameters, +you should seriously considering defining a set of flags and passing that as one +parameter instead. +.Ss Spaces around binary operators +In general, avoid code that looks crunched together, especially around +operators. Specifically: +.Bl -bullet -compact -offset indent +.It +Unary operators should +.Em not +have spaces around them. +.It +Binary operators +.Em should +have spaces around them. +.It +The ternary operator +.Em should +have spacing around it. +.El +.Pp +.Em Good +.Bd -literal -offset indent +i++; +j = i + k; +k += condition ? i : j; +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +i ++; +j=i+k +k+=condition?i:j; +.Ed +.Ss Reserve the ternary operator for trivial cases +Don't use the ternary operator to choose between complex or long expressions. +Reserve it for very trivial cases that are highly unlikely to change. In general +if you've found yourself putting the expressions in your usage of ternary +operator on multiple lines, you should just be using an +.Ic if +statement. +.Pp +.Em Good +.Bd -literal -offset indent +i += condition ? j : k; +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +i += (i < j && j > k || i == j) ? foo(bar, baz, 0, NULL) : frob(bar, 0, NULL, baz); +.Ed +.Ss Spaces around parentheses +.Bl -bullet -compact -offset indent +.It +Put a space between the control statement and the parenthesis indicating its +condition. +.It +Do +.Em not +put a space between the end of a function name and the parenthesis +indicating its argument list. +.It +Do +.Em not +put spaces between any parenthesis and its following content. +.El +.Pp +.Em Good +.Bd -literal -offset indent +if (condition) { + do_thing(); +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +if(condition) { + do_thing (); +} + +if ( condition ) { + do_thing ( argument ); +} +.Ed +.Pp +.Em Worse +.Bd -literal -offset indent +while( condition) { + do_thing( ); +} +.Ed +.Ss Braces and statements +Always, always, always use braces for your control statements. Lack of braces +can and has led to serious security issues that were missed during code review, +and putting the braces there from the start means that adding new statements to +that clause does not require you to also add the braces. +.Pp +The clause should be indented on the next line with no blank lines in between. +.Pp +.Em Good +.Bd -literal -offset indent +if (condition) { + do_thing(); +} + +while (condition) { + do_thing(); +} +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +if (condition) do_thing(); + +if (condition) + do_thing(); + +while (condition) do_thing(); + +while (condition) { + + do_thing(); +} +.Ed +.Pp +Even trivial uses of braceless +.Ic if +statements are problematic. Consider the following: +.Pp +.Em Bad +.Bd -literal -offset indent +if (error) i++, +i++; +.Ed +.Pp +This is admittedly contrived, but it would be likely to escape code review +because it's very easy to miss that the first line ends with a +.Ic , +rather than a +.Ic ; . +Braces in +.Ic if +statements are sensitive enough to security that the best policy is to simply +always use them, without exception. +.Pp +Specific rules for braces: +.Bl -bullet -compact -offset indent +.It +.Ic else +goes between two braces on the same line. +.It +The brace which indicates the expression associated with a control flow +statement goes on the same line as that statement or the same line as the last +continuation line of the statement. +.It +The brace which begins the definition of a +.Ic struct , +.Ic union , +.Ic enum , +etc. goes on the same line as the declaration. +.It +The brace concluding the expression associated with a control flow statement +is aligned with the same column as that control flow statement. +.It +The opening brace of a function definition goes on its own line and is +immediately followed by a new line. +.It +Control statements with empty bodies should have empty braces. +.El +.Pp +.Em Good +.Bd -literal -offset indent +if (condition) { + do_thing(); +} else { + do_other_thing(); +} + +void +function(void) +{ + return; +} + +struct my_struct { + uint32_t thing; +}; + +for (cur; cur; cur = cur->next) { } +.Ed +.Pp +.Em Bad +.Bd -literal -offset indent +if (condition) +{ + do_thing(); +} +else +{ + do_other_thing(); +} + +if (condition) +{ + do_thing(); +} +else + do_other_thing(); + +void +function(void) { + return; +} + +struct my_struct +{ + uint32_t thing; +}; + +for (cur; cur; cur = cur->next) +.Ed +.Pp +.Em Worse +.Bd -literal -offset indent +if (condition) + { + do_thing(); + } + +void +function(void) +{ return; +} +.Ed +.Sh SEE ALSO +.Xr style 9 , +.Xr intro 2 , +.Xr errno 3 , +.Xr types 5 +.Sh HISTORY +This style was largely derived from the style that evolved through the +.Xr launchd 8 , +.Xr libdispatch 3 , +and +.Xr libxpc 3 +projects. diff --git a/man/utmp.5 b/man/utmp.5 new file mode 100644 index 0000000..b822a4e --- /dev/null +++ b/man/utmp.5 @@ -0,0 +1,234 @@ +.\" $NetBSD: utmp.5,v 1.5 1994/11/30 19:31:35 jtc Exp $ +.\" +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)utmp.5 8.2 (Berkeley) 3/17/94 +.\" +.Dd March 17, 1994 +.Dt UTMP 5 +.Os BSD 4 +.Sh NAME +.Nm utmp , +.Nm wtmp , +.Nm lastlog +.Nd login records (DEPRECATED) +.Sh SYNOPSIS +.Fd #include +.Sh DESCRIPTION +The interfaces in file +.Aq Pa utmp.h +are all +.Sy DEPRECATED +and are only provided for compatibility with previous releases of Mac OS X. +See +.Xr pututxline 3 +and +.Xr utmpx 5 +for the supported interfaces. +.Pp +.Aq Pa utmp.h +declares the structures used to record information about current +users in the file +.Nm utmp , +logins and logouts in the file +.Nm wtmp , +and last logins in the file +.Nm lastlog . +The time stamps of date changes, shutdowns and reboots are also logged in +the +.Nm wtmp +file. +.Pp +These files can grow rapidly on busy systems, daily or weekly rotation +is recommended. +If any of these files do not exist, it is not created. +These +files must be created manually and are normally maintained in either the script +.Pa /etc/daily +or the script +.Pa /etc/weekly . +(See +.Xr cron 8 . ) +.Bd -literal -offset indent +#define _PATH_UTMP "/var/run/utmp" +#define _PATH_WTMP "/var/log/wtmp" +#define _PATH_LASTLOG "/var/log/lastlog" + +#define UT_NAMESIZE 8 +#define UT_LINESIZE 8 +#define UT_HOSTSIZE 16 + +struct lastlog { + time_t ll_time; + char ll_line[UT_LINESIZE]; + char ll_host[UT_HOSTSIZE]; +}; + +struct utmp { + char ut_line[UT_LINESIZE]; + char ut_name[UT_NAMESIZE]; + char ut_host[UT_HOSTSIZE]; + time_t ut_time; +}; +.Ed +.Pp +Each time a user logs in, the +.Xr login +program looks up the user's +.Tn UID +in the file +.Nm lastlog. +If it is found, the timestamp of the last time the user logged +in, the terminal line and the hostname +are written to the standard output. (Providing the login is not +.Em quiet , +see +.Xr login 1 . ) +The +.Xr login +program then records the new login time in the file +.Nm lastlog . +.Pp +After the new +.Fa lastlog +record is written , +.\" the +.\" .Xr libutil 3 +.\" routine +the file +.Nm utmp +is opened and the +.Fa utmp +record for the user inserted. +This record remains there until +the user logs out at which time it is deleted. +The +.Nm utmp +file is used by the programs +.Xr rwho 1 , +.Xr users 1 , +.Xr w 1 , +and +.Xr who 1 . +.Pp +Next, the +.Xr login +program opens the file +.Nm wtmp , +and appends the user's +.Fa utmp +record. +The same +.Fa utmp +record, with an updated time stamp is later appended +to the file when the user logs out. (See +.Xr launchd 8 . ) +The +.Nm wtmp +file is used by the programs +.Xr last 1 +and +.Xr ac 8 . +.Pp +In the event of a date change, a shutdown or reboot, the +following items are logged in the +.Nm wtmp +file. +.Pp +.Bl -tag -width shutdownxx -compact +.It Li reboot +.It Li shutdown +A system reboot or shutdown has been initiated. +The character +.Ql \&~ +is placed in the field +.Fa ut_line , +and +.Li reboot +or +.Li shutdown +in the field +.Fa ut_name . +(See +.Xr shutdown 8 +and +.Xr reboot 8 . ) +.Pp +.It Li date +The system time has been manually or automatically updated. +(See +.Xr date 1 . ) +The command name +.Xr date +is recorded in the field +.Fa ut_name . +In the field +.Fa ut_line , +the character +.Ql \\*(Ba +indicates the time prior to the change, and the character +.Ql \&{ +indicates the new time. +.El +.Sh FILES +.Bf Sy +(These files no longer exist in 10.5 or later.) +.Ef +.Pp +.Bl -tag -width /var/log/lastlog -compact +.It Pa /var/run/utmp +The +.Nm utmp file. +.It Pa /var/log/wtmp +The +.Nm wtmp file. +.It Pa /var/log/lastlog +The +.Nm lastlog file. +.El +.Sh SEE ALSO +.Xr last 1 , +.Xr login 1 , +.Xr who 1 , +.Xr ac 8 , +.Xr launchd 8 +.Sh HISTORY +A +.Nm utmp +and +.Nm wtmp +file format appeared in +.At v6 . +The +.Nm lastlog +file format appeared in +.Bx 3.0 . diff --git a/nbsdcompat/_nbsd_compat_.h b/nbsdcompat/_nbsd_compat_.h new file mode 100644 index 0000000..0ca368d --- /dev/null +++ b/nbsdcompat/_nbsd_compat_.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __NBSD_COMPAT__H_ +#define __NBSD_COMPAT__H_ + +#define _DIAGASSERT(x) /* */ +#define __warn_references(x,y) /* */ + +#endif /* __NBSD_COMPAT__H_ */ diff --git a/nbsdcompat/namespace.h b/nbsdcompat/namespace.h new file mode 100644 index 0000000..6b02dd6 --- /dev/null +++ b/nbsdcompat/namespace.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * This file left intentionally blank + */ diff --git a/net/CMakeLists.txt b/net/CMakeLists.txt new file mode 100644 index 0000000..cca27a6 --- /dev/null +++ b/net/CMakeLists.txt @@ -0,0 +1,49 @@ +project(libc-net) + +cmake_minimum_required(VERSION 3.10) + +#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../../platform-include/net/if_var.h") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") + +add_definitions(-Dinet_aton=__inet_aton -Dinet_addr=__inet_addr) + +set(net_sources + FreeBSD/addr2ascii.c + FreeBSD/ascii2addr.c + FreeBSD/inet_addr.c + FreeBSD/inet_lnaof.c + FreeBSD/inet_makeaddr.c + FreeBSD/inet_neta.c + FreeBSD/inet_net_ntop.c + FreeBSD/inet_netof.c + FreeBSD/inet_net_pton.c + FreeBSD/inet_network.c + FreeBSD/inet_ntoa.c + FreeBSD/linkaddr.c + FreeBSD/nsap_addr.c + FreeBSD/recv.c + FreeBSD/send.c + FreeBSD/sockatmark.c + FreeBSD/sourcefilter.c + inet_ntop.c + inet_pton.c +) + +add_darling_object_library(libc-net ${net_sources}) + +# *** +# Cancelable variants +# *** +set(net-cancelable_sources FreeBSD/send.c FreeBSD/recv.c) +add_library(libc-net_cancelable OBJECT ${net-cancelable_sources}) +SET_TARGET_PROPERTIES(libc-net_cancelable PROPERTIES COMPILE_FLAGS "-U__DARWIN_UNIX03 -DBUILDING_VARIANT -DVARIANT_CANCELABLE -U__DARWIN_NON_CANCELABLE=1") + +# *** +# Legacy i386 variants +# +if (TARGET_i386) + set(net-legacy_sources FreeBSD/recv.c FreeBSD/send.c) + add_library(libc-net_legacy OBJECT ${net-legacy_sources}) + SET_TARGET_PROPERTIES(libc-net_legacy PROPERTIES COMPILE_FLAGS + "-DBUILDING_VARIANT -DVARIANT_LEGACY -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0 -U__DARWIN_64_BIT_INO_T -D_DARWIN_NO_64_BIT_INODE") +endif (TARGET_i386) diff --git a/net/FreeBSD/addr2ascii.3 b/net/FreeBSD/addr2ascii.3 new file mode 100644 index 0000000..3660991 --- /dev/null +++ b/net/FreeBSD/addr2ascii.3 @@ -0,0 +1,232 @@ +.\" +.\" Copyright 1996 Massachusetts Institute of Technology +.\" +.\" Permission to use, copy, modify, and distribute this software and +.\" its documentation for any purpose and without fee is hereby +.\" granted, provided that both the above copyright notice and this +.\" permission notice appear in all copies, that both the above +.\" copyright notice and this permission notice appear in all +.\" supporting documentation, and that the name of M.I.T. not be used +.\" in advertising or publicity pertaining to distribution of the +.\" software without specific, written prior permission. M.I.T. makes +.\" no representations about the suitability of this software for any +.\" purpose. It is provided "as is" without express or implied +.\" warranty. +.\" +.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS +.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT +.\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $ANA: addr2ascii.3,v 1.1 1996/06/13 18:41:46 wollman Exp $ +.\" $FreeBSD: src/lib/libc/net/addr2ascii.3,v 1.17 2004/10/09 17:13:58 maxim Exp $ +.\" +.Dd June 13, 1996 +.Dt ADDR2ASCII 3 +.Os +.Sh NAME +.Nm addr2ascii , +.Nm ascii2addr +.Nd Generic address formatting routines +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In arpa/inet.h +.Ft "char *" +.Fn addr2ascii "int af" "const void *addrp" "int len" "char *buf" +.Ft int +.Fn ascii2addr "int af" "const char *ascii" "void *result" +.Sh DESCRIPTION +The routines +.Fn addr2ascii +and +.Fn ascii2addr +are used to convert network addresses between binary form and a +printable form appropriate to the address family. +Both functions take +an +.Fa af +argument, specifying the address family to be used in the conversion +process. +(Currently, only the +.Dv AF_INET +and +.Dv AF_LINK +address families are supported.) +.Pp +The +.Fn addr2ascii +function +is used to convert binary, network-format addresses into printable +form. +In addition to +.Fa af , +there are three other arguments. +The +.Fa addrp +argument is a pointer to the network address to be converted. +The +.Fa len +argument is the length of the address. +The +.Fa buf +argument is an optional pointer to a caller-allocated buffer to hold +the result; if a null pointer is passed, +.Fn addr2ascii +uses a statically-allocated buffer. +.Pp +The +.Fn ascii2addr +function performs the inverse operation to +.Fn addr2ascii . +In addition to +.Fa af , +it takes two arguments, +.Fa ascii +and +.Fa result . +The +.Fa ascii +argument is a pointer to the string which is to be converted into +binary. +The +.Fa result +argument is a pointer to an appropriate network address structure for +the specified family. +.Pp +The following gives the appropriate structure to use for binary +addresses in the specified family: +.Pp +.Bl -tag -width AF_INETxxxx -compact +.It Dv AF_INET +.Li struct in_addr +(in +.In arpa/inet.h ) +.It Dv AF_LINK +.Li struct sockaddr_dl +(in +.In net/if_dl.h ) +.\" .It Dv AF_INET6 +.\" .Li struct in6_addr +.\" (in +.\" .In netinet6/in6.h ) +.El +.Pp +.Dv AF_INET and AF_LINK constants are defined in +.In sys/socket.h +.Sh RETURN VALUES +The +.Fn addr2ascii +function returns the address of the buffer it was passed, or a static +buffer if the a null pointer was passed; on failure, it returns a null +pointer. +The +.Fn ascii2addr +function returns the length of the binary address in bytes, or -1 on +failure. +.Sh EXAMPLES +The +.Xr inet 3 +functions +.Fn inet_ntoa +and +.Fn inet_aton +could be implemented thusly: +.Bd -literal -offset indent +#include +#include + +char * +inet_ntoa(struct in_addr addr) +{ + return addr2ascii(AF_INET, &addr, sizeof addr, 0); +} + +int +inet_aton(const char *ascii, struct in_addr *addr) +{ + return (ascii2addr(AF_INET, ascii, addr) + == sizeof(*addr)); +} +.Ed +.Pp +In actuality, this cannot be done because +.Fn addr2ascii +and +.Fn ascii2addr +are implemented in terms of the +.Xr inet 3 +functions, rather than the other way around. +.Sh ERRORS +When a failure is returned, +.Li errno +is set to one of the following values: +.Bl -tag -width Er +.It Bq Er ENAMETOOLONG +The +.Fn addr2ascii +routine was passed a +.Fa len +argument which was inappropriate for the address family given by +.Fa af . +.It Bq Er EPROTONOSUPPORT +Either routine was passed an +.Fa af +argument other than +.Dv AF_INET +or +.Dv AF_LINK . +.It Bq Er EINVAL +The string passed to +.Fn ascii2addr +was improperly formatted for address family +.Fa af . +.El +.Sh SEE ALSO +.Xr inet 3 , +.Xr linkaddr 3 , +.Xr inet 4 +.Sh HISTORY +An interface close to this one was originally suggested by Craig +Partridge. +This particular interface originally appeared in the +.Tn INRIA +.Tn IPv6 +implementation. +.Sh AUTHORS +Code and documentation by +.An Garrett A. Wollman , +MIT Laboratory for Computer Science. +.Sh BUGS +The original implementations supported IPv6. +This support should +eventually be resurrected. +The +.Tn NRL +implementation also included support for the +.Dv AF_ISO +and +.Dv AF_NS +address families. +.Pp +The genericity of this interface is somewhat questionable. +A truly +generic interface would provide a means for determining the length of +the buffer to be used so that it could be dynamically allocated, and +would always require a +.Dq Li "struct sockaddr" +to hold the binary address. +Unfortunately, this is incompatible with existing +practice. +This limitation means that a routine for printing network +addresses from arbitrary address families must still have internal +knowledge of the maximum buffer length needed and the appropriate part +of the address to use as the binary address. diff --git a/net/FreeBSD/addr2ascii.c b/net/FreeBSD/addr2ascii.c new file mode 100644 index 0000000..9ae6bf3 --- /dev/null +++ b/net/FreeBSD/addr2ascii.c @@ -0,0 +1,101 @@ +/* + * Copyright 1996 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby + * granted, provided that both the above copyright notice and this + * permission notice appear in all copies, that both the above + * copyright notice and this permission notice appear in all + * supporting documentation, and that the name of M.I.T. not be used + * in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. M.I.T. makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS + * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $ANA: addr2ascii.c,v 1.1 1996/06/13 18:41:46 wollman Exp $ + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/net/addr2ascii.c,v 1.2 2002/03/22 21:52:28 obrien Exp $"); + +#include +#include + +#include +#include + +#include +#include +#include + +#include + +/*- + * Convert a network address from binary to printable numeric format. + * This API is copied from INRIA's IPv6 implementation, but it is a + * bit bogus in two ways: + * + * 1) There is no value in passing both an address family and + * an address length; either one should imply the other, + * or we should be passing sockaddrs instead. + * 2) There should by contrast be /added/ a length for the buffer + * that we pass in, so that programmers are spared the need to + * manually calculate (read: ``guess'') the maximum length. + * + * Flash: the API is also the same in the NRL implementation, and seems to + * be some sort of standard, so we appear to be stuck with both the bad + * naming and the poor choice of arguments. + */ +char * +addr2ascii(int af, const void *addrp, int len, char *buf) +{ + if (buf == NULL) { + static char *staticbuf = NULL; + + if (staticbuf == NULL) { + staticbuf = malloc(64); // 64 for AF_LINK > 16 for AF_INET + if (staticbuf == NULL) { + return NULL; + } + } + + buf = staticbuf; + } + + switch(af) { + case AF_INET: + if (len != sizeof(struct in_addr)) { + errno = ENAMETOOLONG; + return 0; + } + strcpy(buf, inet_ntoa(*(const struct in_addr *)addrp)); + break; + + case AF_LINK: + if (len != sizeof(struct sockaddr_dl)) { + errno = ENAMETOOLONG; + return 0; + } + strcpy(buf, link_ntoa((const struct sockaddr_dl *)addrp)); + break; + + default: + errno = EPROTONOSUPPORT; + return 0; + } + return buf; +} diff --git a/net/FreeBSD/ascii2addr.c b/net/FreeBSD/ascii2addr.c new file mode 100644 index 0000000..bf2263b --- /dev/null +++ b/net/FreeBSD/ascii2addr.c @@ -0,0 +1,75 @@ +/* + * Copyright 1996 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby + * granted, provided that both the above copyright notice and this + * permission notice appear in all copies, that both the above + * copyright notice and this permission notice appear in all + * supporting documentation, and that the name of M.I.T. not be used + * in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. M.I.T. makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS + * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $ANA: ascii2addr.c,v 1.2 1996/06/13 18:46:02 wollman Exp $ + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/net/ascii2addr.c,v 1.4 2002/03/22 21:52:28 obrien Exp $"); + +#include +#include + +#include +#include + +#include +#include +#include + +int +ascii2addr(af, ascii, result) + int af; + const char *ascii; + void *result; +{ + struct in_addr *ina; + char strbuf[4*sizeof("123")]; /* long enough for V4 only */ + + switch(af) { + case AF_INET: + ina = result; + strbuf[0] = '\0'; + strncat(strbuf, ascii, (sizeof strbuf)-1); + if (inet_aton(strbuf, ina)) + return sizeof(struct in_addr); + errno = EINVAL; + break; + + case AF_LINK: + link_addr(ascii, result); + /* oops... no way to detect failure */ + return sizeof(struct sockaddr_dl); + + default: + errno = EPROTONOSUPPORT; + break; + } + + return -1; +} diff --git a/net/FreeBSD/inet.3 b/net/FreeBSD/inet.3 new file mode 100644 index 0000000..de22fa2 --- /dev/null +++ b/net/FreeBSD/inet.3 @@ -0,0 +1,318 @@ +.\" Copyright (c) 1983, 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From: @(#)inet.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/net/inet.3,v 1.36 2007/06/14 07:13:28 delphij Exp $ +.\" +.Dd June 14, 2007 +.Dt INET 3 +.Os +.Sh NAME +.Nm inet_addr , +.Nm inet_aton , +.Nm inet_lnaof , +.Nm inet_makeaddr , +.Nm inet_netof , +.Nm inet_network , +.Nm inet_ntoa , +.Nm inet_ntop , +.Nm inet_pton +.Nd Internet address manipulation routines +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In arpa/inet.h +.Ft in_addr_t +.Fo inet_addr +.Fa "const char *cp" +.Fc +.Ft int +.Fo inet_aton +.Fa "const char *cp" +.Fa "struct in_addr *pin" +.Fc +.Ft in_addr_t +.Fo inet_lnaof +.Fa "struct in_addr in" +.Fc +.Ft struct in_addr +.Fo inet_makeaddr +.Fa "in_addr_t net" +.Fa "in_addr_t lna" +.Fc +.Ft in_addr_t +.Fo inet_netof +.Fa "struct in_addr in" +.Fc +.Ft in_addr_t +.Fo inet_network +.Fa "const char *cp" +.Fc +.Ft char * +.Fo inet_ntoa +.Fa "struct in_addr in" +.Fc +.Ft const char * +.Fo inet_ntop +.Fa "int af" +.Fa "const void * restrict src" +.Fa "char * restrict dst" +.Fa "socklen_t size" +.Fc +.Ft int +.Fo inet_pton +.Fa "int af" +.Fa "const char * restrict src" +.Fa "void * restrict dst" +.Fc +.Sh DESCRIPTION +The routines +.Fn inet_aton , +.Fn inet_addr +and +.Fn inet_network +interpret character strings representing +numbers expressed in the Internet standard +.Ql .\& +notation. +.Pp +The +.Fn inet_pton +function converts a presentation format address (that is, printable form +as held in a character string) to network format (usually a +.Ft struct in_addr +or some other internal binary representation, in network byte order). +It returns 1 if the address was valid for the specified address family, or +0 if the address was not parseable in the specified address family, or -1 +if some system error occurred (in which case +.Va errno +will have been set). +This function is presently valid for +.Dv AF_INET +and +.Dv AF_INET6 . +.Pp +The +.Fn inet_aton +routine interprets the specified character string as an Internet address, +placing the address into the structure provided. +It returns 1 if the string was successfully interpreted, +or 0 if the string is invalid. +The +.Fn inet_addr +and +.Fn inet_network +functions return numbers suitable for use +as Internet addresses and Internet network +numbers, respectively. +.Pp +The function +.Fn inet_ntop +converts an address +.Fa *src +from network format +(usually a +.Ft struct in_addr +or some other binary form, in network byte order) to presentation format +(suitable for external display purposes). +The +.Fa size +argument specifies the size, in bytes, of the buffer +.Fa *dst . +.Dv INET_ADDRSTRLEN +and +.Dv INET6_ADDRSTRLEN +define the maximum size required to convert an address of the respective +type. +It returns NULL if a system error occurs (in which case, +.Va errno +will have been set), or it returns a pointer to the destination string. +This function is presently valid for +.Dv AF_INET +and +.Dv AF_INET6 . +.Pp +The routine +.Fn inet_ntoa +takes an Internet address and returns an +.Tn ASCII +string representing the address in +.Ql .\& +notation. +The routine +.Fn inet_makeaddr +takes an Internet network number and a local +network address and constructs an Internet address +from it. +The routines +.Fn inet_netof +and +.Fn inet_lnaof +break apart Internet host addresses, returning +the network number and local network address part, +respectively. +.Pp +All Internet addresses are returned in network +order (bytes ordered from left to right). +All network numbers and local address parts are +returned as machine byte order integer values. +.Sh INTERNET ADDRESSES +Values specified using the +.Ql .\& +notation take one +of the following forms: +.Bd -literal -offset indent +a.b.c.d +a.b.c +a.b +a +.Ed +.Pp +When four parts are specified, each is interpreted +as a byte of data and assigned, from left to right, +to the four bytes of an Internet address. +Note +that when an Internet address is viewed as a 32-bit +integer quantity on the +.Tn VAX +the bytes referred to +above appear as +.Dq Li d.c.b.a . +That is, +.Tn VAX +bytes are +ordered from right to left. +.Pp +When a three part address is specified, the last +part is interpreted as a 16-bit quantity and placed +in the right-most two bytes of the network address. +This makes the three part address format convenient +for specifying Class B network addresses as +.Dq Li 128.net.host . +.Pp +When a two part address is supplied, the last part +is interpreted as a 24-bit quantity and placed in +the right most three bytes of the network address. +This makes the two part address format convenient +for specifying Class A network addresses as +.Dq Li net.host . +.Pp +When only one part is given, the value is stored +directly in the network address without any byte +rearrangement. +.Pp +All numbers supplied as +.Dq parts +in a +.Ql .\& +notation +may be decimal, octal, or hexadecimal, as specified +in the C language (i.e., a leading 0x or 0X implies +hexadecimal; otherwise, a leading 0 implies octal; +otherwise, the number is interpreted as decimal). +.Sh DIAGNOSTICS +The constant +.Dv INADDR_NONE +is returned by +.Fn inet_addr +and +.Fn inet_network +for malformed requests. +.Sh ERRORS +The +.Fn inet_ntop +call fails if: +.Bl -tag -width Er +.It Bq Er EAFNOSUPPORT +.Fa *src +was not an +.Dv AF_INET +or +.Dv AF_INET6 +family address. +.It Bq Er ENOSPC +.Fa size +was not large enough to store the presentation form of the address. +.El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Fd #include +.Fd #include +.Pp +These include files are necessary for all functions. +.Sh SEE ALSO +.Xr byteorder 3 , +.Xr getaddrinfo 3 , +.Xr gethostbyname 3 , +.Xr getnameinfo 3 , +.Xr getnetent 3 , +.Xr inet_net 3 , +.Xr hosts 5 , +.Xr networks 5 +.Rs +.%R RFC +.%N 2373 +.%D July 1998 +.%T "IP Version 6 Addressing Architecture" +.Re +.Sh STANDARDS +The +.Fn inet_ntop +and +.Fn inet_pton +functions conform to +.St -xns5.2 . +Note that +.Fn inet_pton +does not accept 1-, 2-, or 3-part dotted addresses; all four parts +must be specified and are interpreted only as decimal values. +This is a narrower input set than that accepted by +.Fn inet_aton . +.Sh HISTORY +These +functions appeared in +.Bx 4.2 . +.Sh BUGS +The value +.Dv INADDR_NONE +(0xffffffff) is a valid broadcast address, but +.Fn inet_addr +cannot return that value without indicating failure. +The newer +.Fn inet_aton +function does not share this problem. +The problem of host byte ordering versus network byte ordering is +confusing. +The string returned by +.Fn inet_ntoa +resides in a static memory area. +.Pp +The +.Fn inet_addr +function should return a +.Fa struct in_addr . diff --git a/net/FreeBSD/inet_addr.c b/net/FreeBSD/inet_addr.c new file mode 100644 index 0000000..46519d8 --- /dev/null +++ b/net/FreeBSD/inet_addr.c @@ -0,0 +1,233 @@ +/* + * Copyright (c) 1983, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Portions Copyright (c) 1993 by Digital Equipment Corporation. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies, and that + * the name of Digital Equipment Corporation not be used in advertising or + * publicity pertaining to distribution of the document or software without + * specific, written prior permission. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +/* + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (c) 1996-1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcomma" + +#if defined(LIBC_SCCS) && !defined(lint) +static const char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; +static const char rcsid[] = "$Id: inet_addr.c,v 1.4.18.1 2005/04/27 05:00:52 sra Exp $"; +#endif /* LIBC_SCCS and not lint */ + +/* the algorithms only can deal with ASCII, so we optimize for it */ +#define USE_ASCII + +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/inet_addr.c,v 1.4 2007/06/03 17:20:26 ume Exp $"); + +#include "port_before.h" + +#include +#include + +#include +#include + +#include + +#include "port_after.h" + +/*% + * Ascii internet address interpretation routine. + * The value returned is in network order. + */ +in_addr_t /* XXX should be struct in_addr :( */ +inet_addr(const char *cp) { + struct in_addr val; + + if (inet_aton(cp, &val)) + return (val.s_addr); + return (INADDR_NONE); +} + +/*% + * Check whether "cp" is a valid ascii representation + * of an Internet address and convert to a binary address. + * Returns 1 if the address is valid, 0 if not. + * This replaces inet_addr, the return value from which + * cannot distinguish between failure and a local broadcast address. + * strict == 1 disallows trailing characters. + */ +int +_inet_aton_check(const char *cp, struct in_addr *addr, int strict) +{ + u_long val; + int base, n; + char c; + u_int8_t parts[4]; + u_int8_t *pp = parts; + int digit; + + c = *cp; + for (;;) { + /* + * Collect number up to ``.''. + * Values are specified as for C: + * 0x=hex, 0=octal, isdigit=decimal. + */ + if (!isdigit((unsigned char)c)) + return (0); + val = 0; base = 10; digit = 0; + if (c == '0') { + c = *++cp; + if (c == 'x' || c == 'X') + base = 16, c = *++cp; + else { + base = 8; + digit = 1 ; + } + } + for (;;) { + if (isascii(c) && isdigit((unsigned char)c)) { + if (base == 8 && (c == '8' || c == '9')) + return (0); + val = (val * base) + (c - '0'); + c = *++cp; + digit = 1; + } else if (base == 16 && isascii(c) && + isxdigit((unsigned char)c)) { + val = (val << 4) | + (c + 10 - (islower((unsigned char)c) ? 'a' : 'A')); + c = *++cp; + digit = 1; + } else + break; + } + if (c == '.') { + /* + * Internet format: + * a.b.c.d + * a.b.c (with c treated as 16 bits) + * a.b (with b treated as 24 bits) + */ + if (pp >= parts + 3 || val > 0xffU) + return (0); + *pp++ = val; + c = *++cp; + } else + break; + } + /* + * Check for trailing characters. + */ + if (c != '\0') { + if (strict) return (0); + if (!isascii(c) || !isspace(c)) return (0); + } + /* + * Did we get a valid digit? + */ + if (!digit) + return (0); + /* + * Concoct the address according to + * the number of parts specified. + */ + n = pp - parts + 1; + switch (n) { + case 1: /*%< a -- 32 bits */ + break; + + case 2: /*%< a.b -- 8.24 bits */ + if (val > 0xffffffU) + return (0); + val |= parts[0] << 24; + break; + + case 3: /*%< a.b.c -- 8.8.16 bits */ + if (val > 0xffffU) + return (0); + val |= (parts[0] << 24) | (parts[1] << 16); + break; + + case 4: /*%< a.b.c.d -- 8.8.8.8 bits */ + if (val > 0xffU) + return (0); + val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); + break; + } + if (addr != NULL) + addr->s_addr = htonl(val); + return (1); +} + +int +inet_aton(const char *cp, struct in_addr *addr) +{ + return _inet_aton_check(cp, addr, 0); +} + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_addr +__weak_reference(__inet_addr, inet_addr); +#undef inet_aton +__weak_reference(__inet_aton, inet_aton); + +#pragma clang diagnostic pop +/*! \file */ diff --git a/net/FreeBSD/inet_lnaof.c b/net/FreeBSD/inet_lnaof.c new file mode 100644 index 0000000..44a0835 --- /dev/null +++ b/net/FreeBSD/inet_lnaof.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/inet_lnaof.c,v 1.4 2007/06/03 17:20:26 ume Exp $"); + +#include "port_before.h" + +#include +#include +#include + +#include "port_after.h" + +/*% + * Return the local network address portion of an + * internet address; handles class a/b/c network + * number formats. + */ +in_addr_t +inet_lnaof(in) + struct in_addr in; +{ + in_addr_t i = ntohl(in.s_addr); + + if (IN_CLASSA(i)) + return ((i)&IN_CLASSA_HOST); + else if (IN_CLASSB(i)) + return ((i)&IN_CLASSB_HOST); + else + return ((i)&IN_CLASSC_HOST); +} + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_lnaof +__weak_reference(__inet_lnaof, inet_lnaof); + +/*! \file */ diff --git a/net/FreeBSD/inet_makeaddr.c b/net/FreeBSD/inet_makeaddr.c new file mode 100644 index 0000000..0a0e302 --- /dev/null +++ b/net/FreeBSD/inet_makeaddr.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/inet_makeaddr.c,v 1.4 2007/06/03 17:20:26 ume Exp $"); + +#include "port_before.h" + +#include +#include +#include + +#include "port_after.h" + +/*% + * Formulate an Internet address from network + host. Used in + * building addresses stored in the ifnet structure. + */ +struct in_addr +inet_makeaddr(net, host) + in_addr_t net, host; +{ + struct in_addr a; + + if (net < 128U) + a.s_addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST); + else if (net < 65536U) + a.s_addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST); + else if (net < 16777216L) + a.s_addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST); + else + a.s_addr = net | host; + a.s_addr = htonl(a.s_addr); + return (a); +} + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_makeaddr +__weak_reference(__inet_makeaddr, inet_makeaddr); + +/*! \file */ diff --git a/net/FreeBSD/inet_net.3 b/net/FreeBSD/inet_net.3 new file mode 100644 index 0000000..469ebad --- /dev/null +++ b/net/FreeBSD/inet_net.3 @@ -0,0 +1,167 @@ +.\" $NetBSD: inet_net.3,v 1.4 1999/03/22 19:44:52 garbled Exp $ +.\" +.\" Copyright (c) 1997 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Luke Mewburn. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/net/inet_net.3,v 1.4 2007/01/09 00:28:02 imp Exp $ +.\" +.Dd February 26, 2006 +.Dt INET_NET 3 +.Os +.Sh NAME +.Nm inet_net_ntop , +.Nm inet_net_pton +.Nd Internet network number manipulation routines +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In arpa/inet.h +.Ft char * +.Fn inet_net_ntop "int af" "const void *src" "int bits" "char *dst" "size_t size" +.Ft int +.Fn inet_net_pton "int af" "const char *src" "void *dst" "size_t size" +.Sh DESCRIPTION +The +.Fn inet_net_ntop +function converts an Internet network number from network format (usually a +.Vt "struct in_addr" +or some other binary form, in network byte order) to CIDR presentation format +(suitable for external display purposes). +The +.Fa bits +argument +is the number of bits in +.Fa src +that are the network number. +It returns +.Dv NULL +if a system error occurs (in which case, +.Va errno +will have been set), or it returns a pointer to the destination string. +.Pp +The +.Fn inet_net_pton +function converts a presentation format Internet network number (that is, +printable form as held in a character string) to network format (usually a +.Vt "struct in_addr" +or some other internal binary representation, in network byte order). +It returns the number of bits (either computed based on the class, or +specified with /CIDR), or \-1 if a failure occurred +(in which case +.Va errno +will have been set. +It will be set to +.Er ENOENT +if the Internet network number was not valid). +.Pp +The currently supported values for +.Fa af +are +.Dv AF_INET +and +.Dv AF_INET6 . +The +.Fa size +argument +is the size of the result buffer +.Fa dst . +.Pp +.Sh NETWORK NUMBERS (IP VERSION 4) +Internet network numbers may be specified in one of the following forms: +.Bd -literal -offset indent +a.b.c.d/bits +a.b.c.d +a.b.c +a.b +a +.Ed +.Pp +When four parts are specified, each is interpreted +as a byte of data and assigned, from left to right, +to the four bytes of an Internet network number. +Note +that when an Internet network number is viewed as a 32-bit +integer quantity on a system that uses little-endian +byte order (such as the +.Tn Intel 386 , 486 , +and +.Tn Pentium +processors) the bytes referred to above appear as +.Dq Li d.c.b.a . +That is, little-endian bytes are ordered from right to left. +.Pp +When a three part number is specified, the last +part is interpreted as a 16-bit quantity and placed +in the rightmost two bytes of the Internet network number. +This makes the three part number format convenient +for specifying Class B network numbers as +.Dq Li 128.net.host . +.Pp +When a two part number is supplied, the last part +is interpreted as a 24-bit quantity and placed in +the rightmost three bytes of the Internet network number. +This makes the two part number format convenient +for specifying Class A network numbers as +.Dq Li net.host . +.Pp +When only one part is given, the value is stored +directly in the Internet network number without any byte +rearrangement. +.Pp +All numbers supplied as +.Dq parts +in a +.Ql \&. +notation +may be decimal, octal, or hexadecimal, as specified +in the C language (i.e., a leading 0x or 0X implies +hexadecimal; otherwise, a leading 0 implies octal; +otherwise, the number is interpreted as decimal). +.\" +.\" .Sh NETWORK NUMBERS (IP VERSION 6) +.\" XXX - document this! +.\" +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Fd #include +.Fd #include +.Pp +These include files were necessary for all functions. +.Sh SEE ALSO +.Xr byteorder 3 , +.Xr inet 3 , +.Xr networks 5 +.Sh HISTORY +The +.Fn inet_net_ntop +and +.Fn inet_net_pton +functions appeared in BIND 4.9.4. diff --git a/net/FreeBSD/inet_net_ntop.c b/net/FreeBSD/inet_net_ntop.c new file mode 100644 index 0000000..890b3aa --- /dev/null +++ b/net/FreeBSD/inet_net_ntop.c @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 1996,1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.3.18.2 2006/06/20 02:51:32 marka Exp $"; +#endif +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/inet_net_ntop.c,v 1.4 2007/06/03 17:20:26 ume Exp $"); + +#include "port_before.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "port_after.h" + +#ifdef SPRINTF_CHAR +# define SPRINTF(x) strlen(sprintf/**/x) +#else +# define SPRINTF(x) ((size_t)sprintf x) +#endif + +static char * inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, + size_t size); +static char * inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, + size_t size); + +/*% + * char * + * inet_net_ntop(af, src, bits, dst, size) + * convert network number from network to presentation format. + * generates CIDR style result always. + * return: + * pointer to dst, or NULL if an error occurred (check errno). + * author: + * Paul Vixie (ISC), July 1996 + */ +char * +inet_net_ntop(af, src, bits, dst, size) + int af; + const void *src; + int bits; + char *dst; + size_t size; +{ + switch (af) { + case AF_INET: + return (inet_net_ntop_ipv4(src, bits, dst, size)); + case AF_INET6: + return (inet_net_ntop_ipv6(src, bits, dst, size)); + default: + errno = EAFNOSUPPORT; + return (NULL); + } +} + +/*% + * static char * + * inet_net_ntop_ipv4(src, bits, dst, size) + * convert IPv4 network number from network to presentation format. + * generates CIDR style result always. + * return: + * pointer to dst, or NULL if an error occurred (check errno). + * note: + * network byte order assumed. this means 192.5.5.240/28 has + * 0b11110000 in its fourth octet. + * author: + * Paul Vixie (ISC), July 1996 + */ +static char * +inet_net_ntop_ipv4(src, bits, dst, size) + const u_char *src; + int bits; + char *dst; + size_t size; +{ + char *odst = dst; + char *t; + u_int m; + int b; + + if (bits < 0 || bits > 32) { + errno = EINVAL; + return (NULL); + } + + if (bits == 0) { + if (size < sizeof "0") + goto emsgsize; + *dst++ = '0'; + size--; + *dst = '\0'; + } + + /* Format whole octets. */ + for (b = bits / 8; b > 0; b--) { + if (size <= sizeof "255.") + goto emsgsize; + t = dst; + dst += SPRINTF((dst, "%u", *src++)); + if (b > 1) { + *dst++ = '.'; + *dst = '\0'; + } + size -= (size_t)(dst - t); + } + + /* Format partial octet. */ + b = bits % 8; + if (b > 0) { + if (size <= sizeof ".255") + goto emsgsize; + t = dst; + if (dst != odst) + *dst++ = '.'; + m = ((1 << b) - 1) << (8 - b); + dst += SPRINTF((dst, "%u", *src & m)); + size -= (size_t)(dst - t); + } + + /* Format CIDR /width. */ + if (size <= sizeof "/32") + goto emsgsize; + dst += SPRINTF((dst, "/%u", bits)); + return (odst); + + emsgsize: + errno = EMSGSIZE; + return (NULL); +} + +/*% + * static char * + * inet_net_ntop_ipv6(src, bits, fakebits, dst, size) + * convert IPv6 network number from network to presentation format. + * generates CIDR style result always. Picks the shortest representation + * unless the IP is really IPv4. + * always prints specified number of bits (bits). + * return: + * pointer to dst, or NULL if an error occurred (check errno). + * note: + * network byte order assumed. this means 192.5.5.240/28 has + * 0b11110000 in its fourth octet. + * author: + * Vadim Kogan (UCB), June 2001 + * Original version (IPv4) by Paul Vixie (ISC), July 1996 + */ + +static char * +inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) { + u_int m; + int b; + int p; + int zero_s, zero_l, tmp_zero_s, tmp_zero_l; + int i; + int is_ipv4 = 0; + unsigned char inbuf[16]; + char outbuf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128")]; + char *cp; + int words; + u_char *s; + + if (bits < 0 || bits > 128) { + errno = EINVAL; + return (NULL); + } + + cp = outbuf; + + if (bits == 0) { + *cp++ = ':'; + *cp++ = ':'; + *cp = '\0'; + } else { + /* Copy src to private buffer. Zero host part. */ + p = (bits + 7) / 8; + memcpy(inbuf, src, p); + memset(inbuf + p, 0, 16 - p); + b = bits % 8; + if (b != 0) { + m = ~0 << (8 - b); + inbuf[p-1] &= m; + } + + s = inbuf; + + /* how many words need to be displayed in output */ + words = (bits + 15) / 16; + if (words == 1) + words = 2; + + /* Find the longest substring of zero's */ + zero_s = zero_l = tmp_zero_s = tmp_zero_l = 0; + for (i = 0; i < (words * 2); i += 2) { + if ((s[i] | s[i+1]) == 0) { + if (tmp_zero_l == 0) + tmp_zero_s = i / 2; + tmp_zero_l++; + } else { + if (tmp_zero_l && zero_l < tmp_zero_l) { + zero_s = tmp_zero_s; + zero_l = tmp_zero_l; + tmp_zero_l = 0; + } + } + } + + if (tmp_zero_l && zero_l < tmp_zero_l) { + zero_s = tmp_zero_s; + zero_l = tmp_zero_l; + } + + if (zero_l != words && zero_s == 0 && ((zero_l == 6) || + ((zero_l == 5 && s[10] == 0xff && s[11] == 0xff) || + ((zero_l == 7 && s[14] != 0 && s[15] != 1))))) + is_ipv4 = 1; + + /* Format whole words. */ + for (p = 0; p < words; p++) { + if (zero_l != 0 && p >= zero_s && p < zero_s + zero_l) { + /* Time to skip some zeros */ + if (p == zero_s) + *cp++ = ':'; + if (p == words - 1) + *cp++ = ':'; + s++; + s++; + continue; + } + + if (is_ipv4 && p > 5 ) { + *cp++ = (p == 6) ? ':' : '.'; + cp += SPRINTF((cp, "%u", *s++)); + /* we can potentially drop the last octet */ + if (p != 7 || bits > 120) { + *cp++ = '.'; + cp += SPRINTF((cp, "%u", *s++)); + } + } else { + if (cp != outbuf) + *cp++ = ':'; + cp += SPRINTF((cp, "%x", *s * 256 + s[1])); + s += 2; + } + } + } + /* Format CIDR /width. */ + sprintf(cp, "/%u", bits); + if (strlen(outbuf) + 1 > size) + goto emsgsize; + strcpy(dst, outbuf); + + return (dst); + +emsgsize: + errno = EMSGSIZE; + return (NULL); +} + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_net_ntop +__weak_reference(__inet_net_ntop, inet_net_ntop); + +/*! \file */ diff --git a/net/FreeBSD/inet_net_pton.c b/net/FreeBSD/inet_net_pton.c new file mode 100644 index 0000000..4493011 --- /dev/null +++ b/net/FreeBSD/inet_net_pton.c @@ -0,0 +1,420 @@ +/* + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 1996,1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.2 2008/08/26 04:42:43 marka Exp $"; +#endif + +/* the algorithms only can deal with ASCII, so we optimize for it */ +#define USE_ASCII + +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/inet_net_pton.c,v 1.4 2008/12/14 19:39:53 ume Exp $"); + +#include "port_before.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "port_after.h" + +#ifdef SPRINTF_CHAR +# define SPRINTF(x) strlen(sprintf/**/x) +#else +# define SPRINTF(x) ((size_t)sprintf x) +#endif + +/*% + * static int + * inet_net_pton_ipv4(src, dst, size) + * convert IPv4 network number from presentation to network format. + * accepts hex octets, hex strings, decimal octets, and /CIDR. + * "size" is in bytes and describes "dst". + * return: + * number of bits, either imputed classfully or specified with /CIDR, + * or -1 if some failure occurred (check errno). ENOENT means it was + * not an IPv4 network specification. + * note: + * network byte order assumed. this means 192.5.5.240/28 has + * 0b11110000 in its fourth octet. + * author: + * Paul Vixie (ISC), June 1996 + */ +static int +inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) { + static const char xdigits[] = "0123456789abcdef"; + static const char digits[] = "0123456789"; + int n, ch, tmp = 0, dirty, bits; + const u_char *odst = dst; + + ch = *src++; + if (ch == '0' && (src[0] == 'x' || src[0] == 'X') + && isascii((unsigned char)(src[1])) + && isxdigit((unsigned char)(src[1]))) { + /* Hexadecimal: Eat nybble string. */ + if (size <= 0U) + goto emsgsize; + dirty = 0; + src++; /*%< skip x or X. */ + while ((ch = *src++) != '\0' && isascii(ch) && isxdigit(ch)) { + if (isupper(ch)) + ch = tolower(ch); + n = strchr(xdigits, ch) - xdigits; + assert(n >= 0 && n <= 15); + if (dirty == 0) + tmp = n; + else + tmp = (tmp << 4) | n; + if (++dirty == 2) { + if (size-- <= 0U) + goto emsgsize; + *dst++ = (u_char) tmp; + dirty = 0; + } + } + if (dirty) { /*%< Odd trailing nybble? */ + if (size-- <= 0U) + goto emsgsize; + *dst++ = (u_char) (tmp << 4); + } + } else if (isascii(ch) && isdigit(ch)) { + /* Decimal: eat dotted digit string. */ + for (;;) { + tmp = 0; + do { + n = strchr(digits, ch) - digits; + assert(n >= 0 && n <= 9); + tmp *= 10; + tmp += n; + if (tmp > 255) + goto enoent; + } while ((ch = *src++) != '\0' && + isascii(ch) && isdigit(ch)); + if (size-- <= 0U) + goto emsgsize; + *dst++ = (u_char) tmp; + if (ch == '\0' || ch == '/') + break; + if (ch != '.') + goto enoent; + ch = *src++; + if (!isascii(ch) || !isdigit(ch)) + goto enoent; + } + } else + goto enoent; + + bits = -1; + if (ch == '/' && isascii((unsigned char)(src[0])) && + isdigit((unsigned char)(src[0])) && dst > odst) { + /* CIDR width specifier. Nothing can follow it. */ + ch = *src++; /*%< Skip over the /. */ + bits = 0; + do { + n = strchr(digits, ch) - digits; + assert(n >= 0 && n <= 9); + bits *= 10; + bits += n; + if (bits > 32) + goto enoent; + } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch)); + if (ch != '\0') + goto enoent; + } + + /* Firey death and destruction unless we prefetched EOS. */ + if (ch != '\0') + goto enoent; + + /* If nothing was written to the destination, we found no address. */ + if (dst == odst) + goto enoent; + /* If no CIDR spec was given, infer width from net class. */ + if (bits == -1) { + if (*odst >= 240) /*%< Class E */ + bits = 32; + else if (*odst >= 224) /*%< Class D */ + bits = 8; + else if (*odst >= 192) /*%< Class C */ + bits = 24; + else if (*odst >= 128) /*%< Class B */ + bits = 16; + else /*%< Class A */ + bits = 8; + /* If imputed mask is narrower than specified octets, widen. */ + if (bits < ((dst - odst) * 8)) + bits = (dst - odst) * 8; + /* + * If there are no additional bits specified for a class D + * address adjust bits to 4. + */ + if (bits == 8 && *odst == 224) + bits = 4; + } + /* Extend network to cover the actual mask. */ + while (bits > ((dst - odst) * 8)) { + if (size-- <= 0U) + goto emsgsize; + *dst++ = '\0'; + } + return (bits); + + enoent: + errno = ENOENT; + return (-1); + + emsgsize: + errno = EMSGSIZE; + return (-1); +} + +static int +getbits(const char *src, int *bitsp) { + static const char digits[] = "0123456789"; + int n; + int val; + char ch; + + val = 0; + n = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + pch = strchr(digits, ch); + if (pch != NULL) { + if (n++ != 0 && val == 0) /*%< no leading zeros */ + return (0); + val *= 10; + val += (pch - digits); + if (val > 128) /*%< range */ + return (0); + continue; + } + return (0); + } + if (n == 0) + return (0); + *bitsp = val; + return (1); +} + +static int +getv4(const char *src, u_char *dst, int *bitsp) { + static const char digits[] = "0123456789"; + u_char *odst = dst; + int n; + u_int val; + char ch; + + val = 0; + n = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + pch = strchr(digits, ch); + if (pch != NULL) { + if (n++ != 0 && val == 0) /*%< no leading zeros */ + return (0); + val *= 10; + val += (pch - digits); + if (val > 255) /*%< range */ + return (0); + continue; + } + if (ch == '.' || ch == '/') { + if (dst - odst > 3) /*%< too many octets? */ + return (0); + *dst++ = val; + if (ch == '/') + return (getbits(src, bitsp)); + val = 0; + n = 0; + continue; + } + return (0); + } + if (n == 0) + return (0); + if (dst - odst > 3) /*%< too many octets? */ + return (0); + *dst++ = val; + return (1); +} + +static int +inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) { + static const char xdigits_l[] = "0123456789abcdef", + xdigits_u[] = "0123456789ABCDEF"; + u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; + const char *xdigits, *curtok; + int ch, saw_xdigit; + u_int val; + int digits; + int bits; + size_t bytes; + int words; + int ipv4; + + memset((tp = tmp), '\0', NS_IN6ADDRSZ); + endp = tp + NS_IN6ADDRSZ; + colonp = NULL; + /* Leading :: requires some special handling. */ + if (*src == ':') + if (*++src != ':') + goto enoent; + curtok = src; + saw_xdigit = 0; + val = 0; + digits = 0; + bits = -1; + ipv4 = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) + pch = strchr((xdigits = xdigits_u), ch); + if (pch != NULL) { + val <<= 4; + val |= (pch - xdigits); + if (++digits > 4) + goto enoent; + saw_xdigit = 1; + continue; + } + if (ch == ':') { + curtok = src; + if (!saw_xdigit) { + if (colonp) + goto enoent; + colonp = tp; + continue; + } else if (*src == '\0') + goto enoent; + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + saw_xdigit = 0; + digits = 0; + val = 0; + continue; + } + if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && + getv4(curtok, tp, &bits) > 0) { + tp += NS_INADDRSZ; + saw_xdigit = 0; + ipv4 = 1; + break; /*%< '\\0' was seen by inet_pton4(). */ + } + if (ch == '/' && getbits(src, &bits) > 0) + break; + goto enoent; + } + if (saw_xdigit) { + if (tp + NS_INT16SZ > endp) + goto enoent; + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + } + if (bits == -1) + bits = 128; + + words = (bits + 15) / 16; + if (words < 2) + words = 2; + if (ipv4) + words = 8; + endp = tmp + 2 * words; + + if (colonp != NULL) { + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + int i; + + if (tp == endp) + goto enoent; + for (i = 1; i <= n; i++) { + endp[- i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + if (tp != endp) + goto enoent; + + bytes = (bits + 7) / 8; + if (bytes > size) + goto emsgsize; + memcpy(dst, tmp, bytes); + return (bits); + + enoent: + errno = ENOENT; + return (-1); + + emsgsize: + errno = EMSGSIZE; + return (-1); +} + +/*% + * int + * inet_net_pton(af, src, dst, size) + * convert network number from presentation to network format. + * accepts hex octets, hex strings, decimal octets, and /CIDR. + * "size" is in bytes and describes "dst". + * return: + * number of bits, either imputed classfully or specified with /CIDR, + * or -1 if some failure occurred (check errno). ENOENT means it was + * not a valid network specification. + * author: + * Paul Vixie (ISC), June 1996 + */ +int +inet_net_pton(int af, const char *src, void *dst, size_t size) { + switch (af) { + case AF_INET: + return (inet_net_pton_ipv4(src, dst, size)); + case AF_INET6: + return (inet_net_pton_ipv6(src, dst, size)); + default: + errno = EAFNOSUPPORT; + return (-1); + } +} + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_net_pton +__weak_reference(__inet_net_pton, inet_net_pton); + +/*! \file */ diff --git a/net/FreeBSD/inet_neta.c b/net/FreeBSD/inet_neta.c new file mode 100644 index 0000000..3914b8a --- /dev/null +++ b/net/FreeBSD/inet_neta.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 1996,1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char rcsid[] = "$Id: inet_neta.c,v 1.2.18.1 2005/04/27 05:00:53 sra Exp $"; +#endif +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/inet_neta.c,v 1.3 2007/06/03 17:20:26 ume Exp $"); + +#include "port_before.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "port_after.h" + +#ifdef SPRINTF_CHAR +# define SPRINTF(x) strlen(sprintf/**/x) +#else +# define SPRINTF(x) ((size_t)sprintf x) +#endif + +/*% + * char * + * inet_neta(src, dst, size) + * format an in_addr_t network number into presentation format. + * return: + * pointer to dst, or NULL if an error occurred (check errno). + * note: + * format of ``src'' is as for inet_network(). + * author: + * Paul Vixie (ISC), July 1996 + */ +char * +inet_neta(src, dst, size) + in_addr_t src; + char *dst; + size_t size; +{ + char *odst = dst; + char *tp; + + while (src & 0xffffffff) { + u_char b = (src & 0xff000000) >> 24; + + src <<= 8; + if (b) { + if (size < sizeof "255.") + goto emsgsize; + tp = dst; + dst += SPRINTF((dst, "%u", b)); + if (src != 0L) { + *dst++ = '.'; + *dst = '\0'; + } + size -= (size_t)(dst - tp); + } + } + if (dst == odst) { + if (size < sizeof "0.0.0.0") + goto emsgsize; + strcpy(dst, "0.0.0.0"); + } + return (odst); + + emsgsize: + errno = EMSGSIZE; + return (NULL); +} + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_neta +__weak_reference(__inet_neta, inet_neta); + +/*! \file */ diff --git a/net/FreeBSD/inet_netof.c b/net/FreeBSD/inet_netof.c new file mode 100644 index 0000000..8d5256b --- /dev/null +++ b/net/FreeBSD/inet_netof.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/inet_netof.c,v 1.4 2007/06/03 17:20:26 ume Exp $"); + +#include "port_before.h" + +#include +#include +#include + +#include "port_after.h" + +/*% + * Return the network number from an internet + * address; handles class a/b/c network #'s. + */ +in_addr_t +inet_netof(in) + struct in_addr in; +{ + in_addr_t i = ntohl(in.s_addr); + + if (IN_CLASSA(i)) + return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT); + else if (IN_CLASSB(i)) + return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT); + else + return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT); +} + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_netof +__weak_reference(__inet_netof, inet_netof); + +/*! \file */ diff --git a/net/FreeBSD/inet_network.c b/net/FreeBSD/inet_network.c new file mode 100644 index 0000000..e889f20 --- /dev/null +++ b/net/FreeBSD/inet_network.c @@ -0,0 +1,119 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcomma" + +#if defined(LIBC_SCCS) && !defined(lint) +static const char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93"; + +/* the algorithms only can deal with ASCII, so we optimize for it */ +#define USE_ASCII + +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/inet_network.c,v 1.5 2008/01/14 22:55:20 cperciva Exp $"); + +#include "port_before.h" + +#include +#include +#include +#include + +#include "port_after.h" + +/*% + * Internet network address interpretation routine. + * The library routines call this routine to interpret + * network numbers. + */ +in_addr_t +inet_network(cp) + const char *cp; +{ + in_addr_t val, base, n; + char c; + in_addr_t parts[4], *pp = parts; + int i, digit; + +again: + val = 0; base = 10; digit = 0; + if (*cp == '0') + digit = 1, base = 8, cp++; + if (*cp == 'x' || *cp == 'X') + base = 16, cp++; + while ((c = *cp) != 0) { + if (isdigit((unsigned char)c)) { + if (base == 8U && (c == '8' || c == '9')) + return (INADDR_NONE); + val = (val * base) + (c - '0'); + cp++; + digit = 1; + continue; + } + if (base == 16U && isxdigit((unsigned char)c)) { + val = (val << 4) + + (c + 10 - (islower((unsigned char)c) ? 'a' : 'A')); + cp++; + digit = 1; + continue; + } + break; + } + if (!digit) + return (INADDR_NONE); + if (pp >= parts + 4 || val > 0xffU) + return (INADDR_NONE); + if (*cp == '.') { + *pp++ = val, cp++; + goto again; + } + if (*cp && !isspace(*cp&0xff)) + return (INADDR_NONE); + *pp++ = val; + n = pp - parts; + if (n > 4U) + return (INADDR_NONE); + for (val = 0, i = 0; i < n; i++) { + val <<= 8; + val |= parts[i] & 0xff; + } + return (val); +} + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_network +__weak_reference(__inet_network, inet_network); + +#pragma clang diagnostic pop +/*! \file */ diff --git a/net/FreeBSD/inet_ntoa.c b/net/FreeBSD/inet_ntoa.c new file mode 100644 index 0000000..00ee7e1 --- /dev/null +++ b/net/FreeBSD/inet_ntoa.c @@ -0,0 +1,80 @@ +/*- + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93"; +static const char rcsid[] = "$Id: inet_ntoa.c,v 1.1.352.1 2005/04/27 05:00:54 sra Exp $"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/inet_ntoa.c,v 1.6 2007/06/14 07:13:28 delphij Exp $"); + +#include "port_before.h" + +#include +#include +#include +#include + +#include +#include + +#include "port_after.h" + +/*% + * Convert network-format internet address + * to base 256 d.d.d.d representation. + */ +/*const*/ char * +inet_ntoa(struct in_addr in) { + static char ret[18]; + + strcpy(ret, "[inet_ntoa error]"); + (void) inet_ntop(AF_INET, &in, ret, sizeof ret); + return (ret); +} + +#if 0 +char * +inet_ntoa_r(struct in_addr in, char *buf, socklen_t size) +{ + + (void) inet_ntop(AF_INET, &in, buf, size); + return (buf); +} +#endif + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_ntoa +__weak_reference(__inet_ntoa, inet_ntoa); +__weak_reference(__inet_ntoa_r, inet_ntoa_r); + +/*! \file */ diff --git a/net/FreeBSD/linkaddr.3 b/net/FreeBSD/linkaddr.3 new file mode 100644 index 0000000..17ddfaa --- /dev/null +++ b/net/FreeBSD/linkaddr.3 @@ -0,0 +1,134 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Donn Seeley at BSDI. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From: @(#)linkaddr.3 8.1 (Berkeley) 7/28/93 +.\" $FreeBSD: src/lib/libc/net/linkaddr.3,v 1.16 2007/02/28 21:18:38 bms Exp $ +.\" +.Dd February 28, 2007 +.Dt LINK_ADDR 3 +.Os +.Sh NAME +.Nm link_addr , +.Nm link_ntoa +.Nd elementary address specification routines for link level access +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.In net/if_dl.h +.Ft void +.Fn link_addr "const char *addr" "struct sockaddr_dl *sdl" +.Ft char * +.Fn link_ntoa "const struct sockaddr_dl *sdl" +.Sh DESCRIPTION +The routine +.Fn link_addr +interprets character strings representing +link-level addresses, returning binary information suitable +for use in system calls. +The routine +.Fn link_ntoa +takes +a link-level +address and returns an +.Tn ASCII +string representing some of the information present, +including the link level address itself, and the interface name +or number, if present. +This facility is experimental and is +still subject to change. +.Pp +For +.Fn link_addr , +the string +.Fa addr +may contain +an optional network interface identifier of the form +.Dq "name unit-number" , +suitable for the first argument to +.Xr ifconfig 8 , +followed in all cases by a colon and +an interface address in the form of +groups of hexadecimal digits +separated by periods. +Each group represents a byte of address; +address bytes are filled left to right from +low order bytes through high order bytes. +.Pp +.\" A regular expression may make this format clearer: +.\" .Bd -literal -offset indent +.\" ([a-z]+[0-9]+:)?[0-9a-f]+(\e.[0-9a-f]+)* +.\" .Ed +.\" .Pp +Thus +.Li le0:8.0.9.13.d.30 +represents an ethernet address +to be transmitted on the first Lance ethernet interface. +.Sh RETURN VALUES +The +.Fn link_ntoa +function +always returns a null terminated string. +The +.Fn link_addr +function +has no return value. +(See +.Sx BUGS . ) +.Sh SEE ALSO +.Xr getnameinfo 3 +.Sh HISTORY +The +.Fn link_addr +and +.Fn link_ntoa +functions appeared in +.Bx 4.3 Reno . +.Sh BUGS +The returned values for link_ntoa +reside in a static memory area. +.Pp +The function +.Fn link_addr +should diagnose improperly formed input, and there should be an unambiguous +way to recognize this. +.Pp +If the +.Va sdl_len +field of the link socket address +.Fa sdl +is 0, +.Fn link_ntoa +will not insert a colon before the interface address bytes. +If this translated address is given to +.Fn link_addr +without inserting an initial colon, +the latter will not interpret it correctly. diff --git a/net/FreeBSD/linkaddr.c b/net/FreeBSD/linkaddr.c new file mode 100644 index 0000000..a43ced3 --- /dev/null +++ b/net/FreeBSD/linkaddr.c @@ -0,0 +1,168 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)linkaddr.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/net/linkaddr.c,v 1.4 2007/01/09 00:28:02 imp Exp $"); + +#include +#include +#include +#include + +/* States*/ +#define NAMING 0 +#define GOTONE 1 +#define GOTTWO 2 +#define RESET 3 +/* Inputs */ +#define DIGIT (4*0) +#define END (4*1) +#define DELIM (4*2) +#define LETTER (4*3) + +void +link_addr(const char *addr, struct sockaddr_dl *sdl) +{ + char *cp = sdl->sdl_data; + char *cplim = sdl->sdl_len + (char *)sdl; + int byte = 0, state = NAMING, new; + + bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1); + sdl->sdl_family = AF_LINK; + do { + state &= ~LETTER; + if ((*addr >= '0') && (*addr <= '9')) { + new = *addr - '0'; + } else if ((*addr >= 'a') && (*addr <= 'f')) { + new = *addr - 'a' + 10; + } else if ((*addr >= 'A') && (*addr <= 'F')) { + new = *addr - 'A' + 10; + } else if (*addr == 0) { + state |= END; + } else if (state == NAMING && + (((*addr >= 'A') && (*addr <= 'Z')) || + ((*addr >= 'a') && (*addr <= 'z')))) + state |= LETTER; + else + state |= DELIM; + addr++; + switch (state /* | INPUT */) { + case NAMING | DIGIT: + case NAMING | LETTER: + *cp++ = addr[-1]; + continue; + case NAMING | DELIM: + state = RESET; + sdl->sdl_nlen = cp - sdl->sdl_data; + continue; + case GOTTWO | DIGIT: + *cp++ = byte; + /* FALLTHROUGH */ + case RESET | DIGIT: + state = GOTONE; + byte = new; + continue; + case GOTONE | DIGIT: + state = GOTTWO; + byte = new + (byte << 4); + continue; + default: /* | DELIM */ + state = RESET; + *cp++ = byte; + byte = 0; + continue; + case GOTONE | END: + case GOTTWO | END: + *cp++ = byte; + /* FALLTHROUGH */ + case RESET | END: + break; + } + break; + } while (cp < cplim); + sdl->sdl_alen = cp - LLADDR(sdl); + new = cp - (char *)sdl; + if (new > sizeof(*sdl)) + sdl->sdl_len = new; + return; +} + +static const char hexlist[] = "0123456789abcdef"; + +char * +link_ntoa(const struct sockaddr_dl *sdl) +{ + static char obuf[64]; + char *out = obuf; + int i; + u_char *in = (u_char *)LLADDR(sdl); + u_char *inlim = in + sdl->sdl_alen; + int firsttime = 1; + + /* + * the length of the output string is length of network name (eg "le0") + * plus 3 * each byte (eg. "XX.") assuming the print representation is + * two bytes plus the period + * + * The ":" is accounted for as the last byte doesn't have a "." at the + * end + */ + if (sdl->sdl_nlen + 3*sdl->sdl_alen >= sizeof(obuf)) { + goto exit; + } + + if (sdl->sdl_nlen) { + bcopy(sdl->sdl_data, obuf, sdl->sdl_nlen); + out += sdl->sdl_nlen; + if (sdl->sdl_alen) + *out++ = ':'; + } + while (in < inlim) { + if (firsttime) + firsttime = 0; + else + *out++ = '.'; + i = *in++; + if (i > 0xf) { + out[1] = hexlist[i & 0xf]; + i >>= 4; + out[0] = hexlist[i]; + out += 2; + } else { + *out++ = hexlist[i]; + } + } + +exit: + *out = 0; + return (obuf); +} diff --git a/net/FreeBSD/nsap_addr.c b/net/FreeBSD/nsap_addr.c new file mode 100644 index 0000000..5bf73e5 --- /dev/null +++ b/net/FreeBSD/nsap_addr.c @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 1996-1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char rcsid[] = "$Id: nsap_addr.c,v 1.3.18.2 2005/07/28 07:38:08 marka Exp $"; + +/* the algorithms only can deal with ASCII, so we optimize for it */ +#define USE_ASCII + +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/inet/nsap_addr.c,v 1.3 2007/06/03 17:20:26 ume Exp $"); + +#include "port_before.h" + +#include +#include +#include + +#include +#include +#include + +#include +#include +//#include + +#include "port_after.h" + +#include + +static char +xtob(int c) { + return (c - (((c >= '0') && (c <= '9')) ? '0' : '7')); +} + +u_int +inet_nsap_addr(const char *ascii, u_char *binary, int maxlen) { + u_char c, nib; + u_int len = 0; + + if (ascii[0] != '0' || (ascii[1] != 'x' && ascii[1] != 'X')) + return (0); + ascii += 2; + + while ((c = *ascii++) != '\0' && len < (u_int)maxlen) { + if (c == '.' || c == '+' || c == '/') + continue; + if (!isascii(c)) + return (0); + if (islower(c)) + c = toupper(c); + if (isxdigit(c)) { + nib = xtob(c); + c = *ascii++; + if (c != '\0') { + c = toupper(c); + if (isxdigit(c)) { + *binary++ = (nib << 4) | xtob(c); + len++; + } else + return (0); + } + else + return (0); + } + else + return (0); + } + return (len); +} + +char * +inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) { + int nib; + int i; + char *tmpbuf = NULL; + char *start; + + if (tmpbuf == NULL) { + tmpbuf = malloc(255*3); + if (tmpbuf == NULL) return NULL; + } + if (ascii) + start = ascii; + else { + ascii = tmpbuf; + start = tmpbuf; + } + + *ascii++ = '0'; + *ascii++ = 'x'; + + if (binlen > 255) + binlen = 255; + + for (i = 0; i < binlen; i++) { + nib = *binary >> 4; + *ascii++ = nib + (nib < 10 ? '0' : '7'); + nib = *binary++ & 0x0f; + *ascii++ = nib + (nib < 10 ? '0' : '7'); + if (((i % 2) == 0 && (i + 1) < binlen)) + *ascii++ = '.'; + } + *ascii = '\0'; + return (start); +} + +/* + * Weak aliases for applications that use certain private entry points, + * and fail to include . + */ +#undef inet_nsap_addr +__weak_reference(__inet_nsap_addr, inet_nsap_addr); +#undef inet_nsap_ntoa +__weak_reference(__inet_nsap_ntoa, inet_nsap_ntoa); + +/*! \file */ diff --git a/net/FreeBSD/recv.c b/net/FreeBSD/recv.c new file mode 100644 index 0000000..a8c5fca --- /dev/null +++ b/net/FreeBSD/recv.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)recv.c 8.2 (Berkeley) 2/21/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/net/recv.c,v 1.4 2007/01/09 00:28:02 imp Exp $"); + +#include "namespace.h" +#include +#include + +#include +#include "un-namespace.h" + +#ifdef VARIANT_CANCELABLE +ssize_t __recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); +#else /* !VARIANT_CANCELABLE */ +ssize_t __recvfrom_nocancel(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); +#endif /* VARIANT_CANCELABLE */ + +ssize_t +recv(s, buf, len, flags) + int s, flags; + size_t len; + void *buf; +{ +#ifdef VARIANT_CANCELABLE + return (__recvfrom(s, buf, len, flags, NULL, 0)); +#else /* !VARIANT_CANCELABLE */ + return (__recvfrom_nocancel(s, buf, len, flags, NULL, 0)); +#endif /* VARIANT_CANCELABLE */ +} diff --git a/net/FreeBSD/send.c b/net/FreeBSD/send.c new file mode 100644 index 0000000..eeb3fa9 --- /dev/null +++ b/net/FreeBSD/send.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)send.c 8.2 (Berkeley) 2/21/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/net/send.c,v 1.4 2007/01/09 00:28:02 imp Exp $"); + +#include "namespace.h" +#include +#include + +#include +#include "un-namespace.h" + +#ifdef VARIANT_CANCELABLE +ssize_t __sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); +#else /* !VARIANT_CANCELABLE */ +ssize_t __sendto_nocancel(int, const void *, size_t, int, const struct sockaddr *, socklen_t); +#endif /* VARIANT_CANCELABLE */ + +ssize_t +send(s, msg, len, flags) + int s, flags; + size_t len; + const void *msg; +{ +#ifdef VARIANT_CANCELABLE + return (__sendto(s, msg, len, flags, NULL, 0)); +#else /* !VARIANT_CANCELABLE */ + return (__sendto_nocancel(s, msg, len, flags, NULL, 0)); +#endif /* VARIANT_CANCELABLE */ +} diff --git a/net/FreeBSD/sockatmark.3 b/net/FreeBSD/sockatmark.3 new file mode 100644 index 0000000..0c09189 --- /dev/null +++ b/net/FreeBSD/sockatmark.3 @@ -0,0 +1,123 @@ +.\" Copyright (c) 2002 William C. Fenner. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/net/sockatmark.3,v 1.4 2002/12/19 09:40:22 ru Exp $ +.\" +.Dd October 13, 2002 +.Dt SOCKATMARK 3 +.Os +.Sh NAME +.Nm sockatmark +.Nd determine whether the read pointer is at the OOB mark +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/socket.h +.Ft int +.Fn sockatmark "int s" +.Sh DESCRIPTION +To find out if the read pointer is currently pointing at +the mark in the data stream, the +.Fn sockatmark +function is provided. +If +.Fn sockatmark +returns 1, the next read will return data +after the mark. +Otherwise (assuming out of band data has arrived), +the next read will provide data sent by the client prior +to transmission of the out of band signal. +The routine used +in the remote login process to flush output on receipt of an +interrupt or quit signal is shown below. +It reads the normal data up to the mark (to discard it), +then reads the out-of-band byte. +.Bd -literal -offset indent +#include +\&... +oob() +{ + int out = FWRITE, mark; + char waste[BUFSIZ]; + + /* flush local terminal output */ + ioctl(1, TIOCFLUSH, (char *)&out); + for (;;) { + if ((mark = sockatmark(rem)) < 0) { + perror("sockatmark"); + break; + } + if (mark) + break; + (void) read(rem, waste, sizeof (waste)); + } + if (recv(rem, &mark, 1, MSG_OOB) < 0) { + perror("recv"); + ... + } + ... +} +.Ed +.Sh RETURN VALUES +Upon successful completion, the +.Fn sockatmark +function returns the value 1 if the read pointer is pointing at +the OOB mark, 0 if it is not. +Otherwise, the value \-1 is returned +and the global variable +.Va errno +is set to +indicate the error. +.Sh ERRORS +The +.Fn sockatmark +call fails if: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa s +argument +is not a valid descriptor. +.It Bq Er ENOTTY +The +.Fa s +argument +is a descriptor for a file, not a socket. +.El +.Sh SEE ALSO +.Xr recv 2 , +.Xr send 2 +.Sh HISTORY +The +.Fn sockatmark +function was introduced by +.St -p1003.1-2001 , +to standardize the historical +.Dv SIOCATMARK +.Xr ioctl 2 . +The +.Er ENOTTY +error instead of the usual +.Er ENOTSOCK +is to match the historical behavior of +.Dv SIOCATMARK . diff --git a/net/FreeBSD/sockatmark.c b/net/FreeBSD/sockatmark.c new file mode 100644 index 0000000..497ce7f --- /dev/null +++ b/net/FreeBSD/sockatmark.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2002 William C. Fenner. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/net/sockatmark.c,v 1.1 2002/12/13 22:22:55 fenner Exp $ + */ +#include + +int sockatmark(int s) +{ + int atmark; + + if (ioctl(s, SIOCATMARK, &atmark) == -1) + return -1; + return atmark; +} diff --git a/net/FreeBSD/sourcefilter.3 b/net/FreeBSD/sourcefilter.3 new file mode 100644 index 0000000..081dfa3 --- /dev/null +++ b/net/FreeBSD/sourcefilter.3 @@ -0,0 +1,238 @@ +.\" Copyright (c) 2007-2009 Bruce Simpson. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/net/sourcefilter.3,v 1.2 2009/03/04 01:59:14 bms Exp $ +.\" +.Dd February 13, 2009 +.Dt SOURCEFILTER 3 +.Os +.Sh NAME +.Nm sourcefilter +.Nd advanced multicast group membership API +.Sh SYNOPSIS +.In sys/socket.h +.In netinet/in.h +.Ft int +.Fo getipv4sourcefilter +.Fa "int s" +.Fa "struct in_addr interface" +.Fa "struct in_addr group" +.Fa "uint32_t *fmode" +.Fa "uint32_t *numsrc" +.Fa "struct in_addr *slist" +.Fc +.Ft int +.Fo getsourcefilter +.Fa "int s" +.Fa "uint32_t interface" +.Fa "struct sockaddr *group" +.Fa "socklen_t grouplen" +.Fa "uint32_t *fmode" +.Fa "uint32_t *numsrc" +.Fa "struct sockaddr_storage *slist" +.Fc +.Ft int +.Fo setipv4sourcefilter +.Fa "int s" +.Fa "struct in_addr interface" +.Fa "struct in_addr group" +.Fa "uint32_t fmode" +.Fa "uint32_t numsrc" +.Fa "struct in_addr *slist" +.Fc +.Ft int +.Fo setsourcefilter +.Fa "int s" +.Fa "uint32_t interface" +.Fa "struct sockaddr *group" +.Fa "socklen_t grouplen" +.Fa "uint32_t fmode" +.Fa "uint32_t numsrc" +.Fa "struct sockaddr_storage *slist" +.Fc +.Sh DESCRIPTION +The +.Nm +functions implement the advanced, full-state multicast API +defined in RFC 3678. +An application may use these functions to atomically set and +retrieve the multicast source address filters associated with a socket +.Fa s +and a multicast +.Fa group . +.Pp +The functions +.Fn getipv4sourcefilter +and +.Fn getsourcefilter +allow an application to discover the filter mode, and +source filter entries, +for an existing group membership. +.Pp +The kernel will always return the number of source filter +entries on the socket for that group in +.Fa *numsrc . +If the +.Fa *numsrc +argument is non-zero, the kernel will attempt to return up to +.Fa *numsrc +filter entries in the array pointed to by +.Fa slist . +The +.Fa *numsrc +argument may be set to 0, in which case the +.Fa slist +argument will be ignored. +.Pp +For the +.Fn setipv4sourcefilter +and +.Fn setsourcefilter +functions, +the +.Fa fmode +argument may be used to place the socket into inclusive or exclusive +group membership modes, by using the +.Dv MCAST_INCLUDE +or +.Dv MCAST_EXCLUDE +constants respectively. +The +.Fa numsrc +argument specifies the number of source entries in the +.Fa slist +array. +If the +.Fa numsrc +argument has a value of 0, +all source filters will be removed from the socket. +Removing all source filters from a membership which is in the +.Dv MCAST_INCLUDE +filter mode will cause the group to be left on that socket. +.Pp +The protocol-independent function +.Fn setsourcefilter +allows an application to join a multicast group on an interface +which may not have an assigned protocol address, +by passing its index for the +.Fa interface +argument. +.Pp +Any changes made by these functions +will be communicated to IGMPv3 and/or MLDv2 routers +on the local network as appropriate. +If no IGMPv3 or MLDv2 routers are present, changes in the source filter +lists made by these functions will not cause +state changes to be transmitted, with the exception of any +change which causes a group to be joined or left. +The kernel will continue to maintain the source filter state +regardless of the IGMP or MLD version in use on the link. +.Sh IMPLEMENTATION NOTES +The IPv4 specific versions of these functions are implemented in terms +of the protocol-independent functions. +Application writers are encouraged to use the protocol-independent functions +for efficiency, and forwards compatibility with IPv6 networks. +.Pp +For the protocol-independent functions +.Fn getsourcefilter +and +.Fn setsourcefilter , +the argument +.Fa grouplen +argument specifies the size of the structure pointed to by +.Fa group . +This is required in order to differentiate between different +address families. +.Pp +Currently +.Fx +does not support source address selection for the IPv4 +protocol family, therefore the use of multicast APIs with +an unnumbered IPv4 interface is +.Em not recommended. +In all cases, the first assigned IPv4 address on the interface +will be used as the source address of IGMP control traffic. +If this address is removed or changed, the results are undefined. +.Sh RETURN VALUES +.Rv -std getsourcefilter getipv4sourcefilter setsourcefilter setipv4sourcefilter +.Sh ERRORS +The +.Nm +functions may fail because of: +.Bl -tag -width Er +.It Bq Er EADDRNOTAVAIL +The network interface which the +.Dv interface +argument refers to was not configured in the system, +or the system is not a member of the +.Dv group . +.It Bq Er EAFNOSUPPORT +The +.Dv group +and/or one or more of the +.Dv slist +arguments were of an address family unsupported by the system, +or the address family of the +.Dv group +and +.Dv slist +arguments were not identical. +.It Bq Er EINVAL +The +.Dv group +argument does not contain a multicast address. +The +.Dv fmode +argument is invalid; it must be set to either +.Dv MCAST_INCLUDE +or +.Dv MCAST_EXCLUDE . +The +.Dv numsrc +or +.Dv slist +arguments do not specify a source list. +.It Bq Er ENOMEM +Insufficient memory was available to carry out the requested +operation. +.El +.Sh SEE ALSO +.Xr ip 4 , +.Xr ip6 4 +.Rs +.%A D. Thaler +.%A B. Fenner +.%A B. Quinn +.%T "Socket Interface Extensions for Multicast Source Filters" +.%N RFC 3678 +.%D Jan 2004 +.Re +.Sh HISTORY +The +.Nm +functions first appeared in +.Fx 7.0 . +.Sh AUTHORS +Bruce M. Simpson +.Aq bms@FreeBSD.org diff --git a/net/FreeBSD/sourcefilter.c b/net/FreeBSD/sourcefilter.c new file mode 100644 index 0000000..779a96b --- /dev/null +++ b/net/FreeBSD/sourcefilter.c @@ -0,0 +1,410 @@ +/*- + * Copyright (c) 2007-2009 Bruce Simpson. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/net/sourcefilter.c,v 1.5 2009/04/29 09:58:31 bms Exp $"); + +/* 8120237: enable INET6 */ +#define __APPLE_USE_RFC_3542 + +#include "namespace.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "un-namespace.h" + +/* + * Advanced (Full-state) multicast group membership APIs [RFC3678] + * Currently this module assumes IPv4 support (INET) in the base system. + */ +#ifndef INET +#define INET +#endif +/* 8120237: enable INET6 */ +#ifndef INET6 +#define INET6 +#endif + +union sockunion { + struct sockaddr_storage ss; + struct sockaddr sa; + struct sockaddr_dl sdl; +#ifdef INET + struct sockaddr_in sin; +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; +#endif +}; +typedef union sockunion sockunion_t; + +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + +/* + * Internal: Map an IPv4 unicast address to an interface index. + * This is quite inefficient so it is recommended applications use + * the newer, more portable, protocol independent API. + */ +static uint32_t +__inaddr_to_index(in_addr_t ifaddr) +{ + struct ifaddrs *ifa; + struct ifaddrs *ifaddrs; + char *ifname; + int ifindex; + sockunion_t *psu; + + if (getifaddrs(&ifaddrs) < 0) + return (0); + + ifindex = 0; + ifname = NULL; + + /* + * Pass #1: Find the ifaddr entry corresponding to the + * supplied IPv4 address. We should really use the ifindex + * consistently for matches, however it is not available to + * us on this pass. + */ + for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { + psu = (sockunion_t *)ifa->ifa_addr; + if (psu && psu->ss.ss_family == AF_INET && + psu->sin.sin_addr.s_addr == ifaddr) { + ifname = ifa->ifa_name; + break; + } + } + if (ifname == NULL) + goto out; + + /* + * Pass #2: Find the index of the interface matching the name + * we obtained from looking up the IPv4 ifaddr in pass #1. + * There must be a better way of doing this. + */ + for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { + psu = (sockunion_t *)ifa->ifa_addr; + if (psu && psu->ss.ss_family == AF_LINK && + strcmp(ifa->ifa_name, ifname) == 0) { + ifindex = psu->sdl.sdl_index; + break; + } + } + assert(ifindex != 0); + +out: + freeifaddrs(ifaddrs); + return (ifindex); +} + +/* + * Set IPv4 source filter list in use on socket. + * + * Stubbed to setsourcefilter(). Performs conversion of structures which + * may be inefficient; applications are encouraged to use the + * protocol-independent API. + */ +int +setipv4sourcefilter(int s, struct in_addr interface, struct in_addr group, + uint32_t fmode, uint32_t numsrc, struct in_addr *slist) +{ +#ifdef INET + sockunion_t tmpgroup; + struct in_addr *pina; + sockunion_t *psu, *tmpslist; + int err; + size_t i; + uint32_t ifindex; + + assert(s != -1); + + tmpslist = NULL; + + if (!IN_MULTICAST(ntohl(group.s_addr)) || + (fmode != MCAST_INCLUDE && fmode != MCAST_EXCLUDE)) { + errno = EINVAL; + return (-1); + } + + ifindex = __inaddr_to_index(interface.s_addr); + if (ifindex == 0) { + errno = EADDRNOTAVAIL; + return (-1); + } + + memset(&tmpgroup, 0, sizeof(sockunion_t)); + tmpgroup.sin.sin_family = AF_INET; + tmpgroup.sin.sin_len = sizeof(struct sockaddr_in); + tmpgroup.sin.sin_addr = group; + + if (numsrc != 0 || slist != NULL) { + tmpslist = calloc(numsrc, sizeof(sockunion_t)); + if (tmpslist == NULL) { + errno = ENOMEM; + return (-1); + } + + pina = slist; + psu = tmpslist; + for (i = 0; i < numsrc; i++, pina++, psu++) { + psu->sin.sin_family = AF_INET; + psu->sin.sin_len = sizeof(struct sockaddr_in); + psu->sin.sin_addr = *pina; + } + } + + err = setsourcefilter(s, ifindex, (struct sockaddr *)&tmpgroup, + sizeof(struct sockaddr_in), fmode, numsrc, + (struct sockaddr_storage *)tmpslist); + + if (tmpslist != NULL) + free(tmpslist); + + return (err); +#else /* !INET */ + return (EAFNOSUPPORT); +#endif /* INET */ +} + +/* + * Get IPv4 source filter list in use on socket. + * + * Stubbed to getsourcefilter(). Performs conversion of structures which + * may be inefficient; applications are encouraged to use the + * protocol-independent API. + * An slist of NULL may be used for guessing the required buffer size. + */ +int +getipv4sourcefilter(int s, struct in_addr interface, struct in_addr group, + uint32_t *fmode, uint32_t *numsrc, struct in_addr *slist) +{ + sockunion_t *psu, *tmpslist; + sockunion_t tmpgroup; + struct in_addr *pina; + int err; + size_t i; + uint32_t ifindex, onumsrc; + + assert(s != -1); + assert(fmode != NULL); + assert(numsrc != NULL); + + onumsrc = *numsrc; + *numsrc = 0; + tmpslist = NULL; + + if (!IN_MULTICAST(ntohl(group.s_addr)) || + (onumsrc != 0 && slist == NULL)) { + errno = EINVAL; + return (-1); + } + + ifindex = __inaddr_to_index(interface.s_addr); + if (ifindex == 0) { + errno = EADDRNOTAVAIL; + return (-1); + } + + memset(&tmpgroup, 0, sizeof(sockunion_t)); + tmpgroup.sin.sin_family = AF_INET; + tmpgroup.sin.sin_len = sizeof(struct sockaddr_in); + tmpgroup.sin.sin_addr = group; + + if (onumsrc != 0 || slist != NULL) { + tmpslist = calloc(onumsrc, sizeof(sockunion_t)); + if (tmpslist == NULL) { + errno = ENOMEM; + return (-1); + } + } + + err = getsourcefilter(s, ifindex, (struct sockaddr *)&tmpgroup, + sizeof(struct sockaddr_in), fmode, numsrc, + (struct sockaddr_storage *)tmpslist); + + if (tmpslist != NULL && *numsrc != 0) { + pina = slist; + psu = tmpslist; + for (i = 0; i < MIN(onumsrc, *numsrc); i++, psu++) { + if (psu->ss.ss_family != AF_INET) + continue; + *pina++ = psu->sin.sin_addr; + } + free(tmpslist); + } + + return (err); +} + +/* + * Set protocol-independent source filter list in use on socket. + */ +int +setsourcefilter(int s, uint32_t interface, struct sockaddr *group, + socklen_t grouplen, uint32_t fmode, uint32_t numsrc, + struct sockaddr_storage *slist) +{ + struct __msfilterreq msfr; + sockunion_t *psu; + int level, optname; + + if (fmode != MCAST_INCLUDE && fmode != MCAST_EXCLUDE) { + errno = EINVAL; + return (-1); + } + + psu = (sockunion_t *)group; + switch (psu->ss.ss_family) { +#ifdef INET + case AF_INET: + if ((grouplen != sizeof(struct sockaddr_in) || + !IN_MULTICAST(ntohl(psu->sin.sin_addr.s_addr)))) { + errno = EINVAL; + return (-1); + } + level = IPPROTO_IP; + optname = IP_MSFILTER; + break; +#endif +#ifdef INET6 + case AF_INET6: + if (grouplen != sizeof(struct sockaddr_in6) || + !IN6_IS_ADDR_MULTICAST(&psu->sin6.sin6_addr)) { + errno = EINVAL; + return (-1); + } + level = IPPROTO_IPV6; + optname = IPV6_MSFILTER; + break; +#endif + default: + errno = EAFNOSUPPORT; + return (-1); + } + + memset(&msfr, 0, sizeof(msfr)); + msfr.msfr_ifindex = interface; + msfr.msfr_fmode = fmode; + msfr.msfr_nsrcs = numsrc; + memcpy(&msfr.msfr_group, &psu->ss, psu->ss.ss_len); + msfr.msfr_srcs = slist; /* pointer */ + + return (_setsockopt(s, level, optname, &msfr, sizeof(msfr))); +} + +/* + * Get protocol-independent source filter list in use on socket. + * An slist of NULL may be used for guessing the required buffer size. + */ +int +getsourcefilter(int s, uint32_t interface, struct sockaddr *group, + socklen_t grouplen, uint32_t *fmode, uint32_t *numsrc, + struct sockaddr_storage *slist) +{ + struct __msfilterreq msfr; + sockunion_t *psu; + int err, level, nsrcs, optname; + unsigned int optlen; + + if (interface == 0 || group == NULL || numsrc == NULL || + fmode == NULL) { + errno = EINVAL; + return (-1); + } + + nsrcs = *numsrc; + *numsrc = 0; + *fmode = 0; + + psu = (sockunion_t *)group; + switch (psu->ss.ss_family) { +#ifdef INET + case AF_INET: + if ((grouplen != sizeof(struct sockaddr_in) || + !IN_MULTICAST(ntohl(psu->sin.sin_addr.s_addr)))) { + errno = EINVAL; + return (-1); + } + level = IPPROTO_IP; + optname = IP_MSFILTER; + break; +#endif +#ifdef INET6 + case AF_INET6: + if (grouplen != sizeof(struct sockaddr_in6) || + !IN6_IS_ADDR_MULTICAST(&psu->sin6.sin6_addr)) { + errno = EINVAL; + return (-1); + } + level = IPPROTO_IPV6; + optname = IPV6_MSFILTER; + break; +#endif + default: + errno = EAFNOSUPPORT; + return (-1); + break; + } + + optlen = sizeof(struct __msfilterreq); + memset(&msfr, 0, optlen); + msfr.msfr_ifindex = interface; + msfr.msfr_fmode = 0; + msfr.msfr_nsrcs = nsrcs; + memcpy(&msfr.msfr_group, &psu->ss, psu->ss.ss_len); + + /* + * msfr_srcs is a pointer to a vector of sockaddr_storage. It + * may be NULL. The kernel will always return the total number + * of filter entries for the group in msfr.msfr_nsrcs. + */ + msfr.msfr_srcs = slist; + err = _getsockopt(s, level, optname, &msfr, &optlen); + if (err == 0) { + *numsrc = msfr.msfr_nsrcs; + *fmode = msfr.msfr_fmode; + } + + return (err); +} diff --git a/net/byteorder.3 b/net/byteorder.3 new file mode 100644 index 0000000..ce4eef2 --- /dev/null +++ b/net/byteorder.3 @@ -0,0 +1,85 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)byteorder.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/net/byteorder.3,v 1.8 2001/10/01 16:08:55 ru Exp $ +.\" +.Dd June 4, 1993 +.Dt BYTEORDER 3 +.Os +.Sh NAME +.Nm htonl , +.Nm htons , +.Nm ntohl , +.Nm ntohs +.Nd convert values between host and network byte order +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In arpa/inet.h +.Ft uint32_t +.Fn htonl "uint32_t hostlong" +.Ft uint16_t +.Fn htons "uint16_t hostshort" +.Ft uint32_t +.Fn ntohl "uint32_t netlong" +.Ft uint16_t +.Fn ntohs "uint16_t netshort" +.Sh DESCRIPTION +These routines convert 16 and 32 bit quantities between network +byte order and host byte order. +(Network byte order is big endian, or most significant byte first.) +On machines which have a byte order which is the same as the network +order, routines are defined as null macros. +.Pp +These routines are most often used in conjunction with Internet +addresses and ports as returned by +.Xr gethostbyname 3 +and +.Xr getservent 3 . +.Sh SEE ALSO +.Xr gethostbyname 3 , +.Xr getservent 3 +.Sh STANDARDS +The +.Nm byteorder +functions are expected to conform with IEEE Std POSIX.1-200x +.Pq Dq POSIX.1 . +.Sh HISTORY +The +.Nm byteorder +functions appeared in +.Bx 4.2 . +.Sh BUGS +On the +.Tn VAX +bytes are handled backwards from most everyone else in +the world. This is not expected to be fixed in the near future. diff --git a/net/ethers.3 b/net/ethers.3 new file mode 100644 index 0000000..fd38d87 --- /dev/null +++ b/net/ethers.3 @@ -0,0 +1,197 @@ +.\" Copyright (c) 1995 +.\" Bill Paul . All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Bill Paul. +.\" 4. Neither the name of the author nor the names of any co-contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/net/ethers.3,v 1.18 2001/10/01 16:08:55 ru Exp $ +.\" +.Dd April 12, 1995 +.Dt ETHERS 3 +.Os +.Sh NAME +.Nm ethers , +.Nm ether_line , +.Nm ether_aton , +.Nm ether_ntoa , +.Nm ether_ntohost , +.Nm ether_hostton +.Nd Ethernet address conversion and lookup routines +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.In net/ethernet.h +.Ft int +.Fn ether_line "const char *l" "struct ether_addr *e" "char *hostname" +.Ft struct ether_addr * +.Fn ether_aton "const char *a" +.Ft char * +.Fn ether_ntoa "const struct ether_addr *n" +.Ft int +.Fn ether_ntohost "char *hostname" "const struct ether_addr *e" +.Ft int +.Fn ether_hostton "const char *hostname" "struct ether_addr *e" +.Sh DESCRIPTION +These functions operate on ethernet addresses using an +.Ar ether_addr +structure, which is defined in the header file +.Aq Pa netinet/if_ether.h : +.Bd -literal -offset indent +/* + * The number of bytes in an ethernet (MAC) address. + */ +#define ETHER_ADDR_LEN 6 + +/* + * Structure of a 48-bit Ethernet address. + */ +struct ether_addr { + u_char octet[ETHER_ADDR_LEN]; +}; +.Ed +.Pp +The function +.Fn ether_line +scans +.Ar l , +an +.Tn ASCII +string in +.Xr ethers 5 +format and sets +.Ar e +to the ethernet address specified in the string and +.Ar h +to the hostname. +This function is used to parse lines from +.Pa /etc/ethers +into their component parts. +.Pp +The +.Fn ether_aton +function converts an +.Tn ASCII +representation of an ethernet address into an +.Ar ether_addr +structure. +Likewise, +.Fn ether_ntoa +converts an ethernet address specified as an +.Ar ether_addr +structure into an +.Tn ASCII +string. +.Pp +The +.Fn ether_ntohost +and +.Fn ether_hostton +functions map ethernet addresses to their corresponding hostnames +as specified in the +.Pa /etc/ethers +database. +.Fn ether_ntohost +converts from ethernet address to hostname, and +.Fn ether_hostton +converts from hostname to ethernet address. +.Sh RETURN VALUES +.Fn ether_line +returns zero on success and non-zero if it was unable to parse +any part of the supplied line +.Ar l . +It returns the extracted ethernet address in the supplied +.Ar ether_addr +structure +.Ar e +and the hostname in the supplied string +.Ar h . +.Pp +On success, +.Fn ether_ntoa +returns a pointer to a string containing an +.Tn ASCII +representation of an ethernet address. +If it is unable to convert +the supplied +.Ar ether_addr +structure, it returns a +.Dv NULL +pointer. +Likewise, +.Fn ether_aton +returns a pointer to an +.Ar ether_addr +structure on success and a +.Dv NULL +pointer on failure. +.Pp +The +.Fn ether_ntohost +and +.Fn ether_hostton +functions both return zero on success or non-zero if they were +unable to find a match in the +.Pa /etc/ethers +database. +.Sh NOTES +The user must insure that the hostname strings passed to the +.Fn ether_line , +.Fn ether_ntohost +and +.Fn ether_hostton +functions are large enough to contain the returned hostnames. +.Sh NIS INTERACTION +If the +.Pa /etc/ethers +contains a line with a single + in it, the +.Fn ether_ntohost +and +.Fn ether_hostton +functions will attempt to consult the NIS +.Pa ethers.byname +and +.Pa ethers.byaddr +maps in addition to the data in the +.Pa /etc/ethers +file. +.Sh SEE ALSO +.Xr yp 8 , +.Xr ethers 5 +.Sh BUGS +The +.Fn ether_aton +and +.Fn ether_ntoa +functions returns values that are stored in static memory areas +which may be overwritten the next time they are called. +.Sh HISTORY +This particular implementation of the +.Nm +library functions were written for and first appeared in +.Fx 2.1 . diff --git a/net/inet_ntop.c b/net/inet_ntop.c new file mode 100644 index 0000000..aa6ffe4 --- /dev/null +++ b/net/inet_ntop.c @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2003,2005,2006,2011,2012 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 1996-1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_V4_ADDR_LEN 16 + +const char * inet_ntop6(const struct in6_addr *addr, char *dst, socklen_t size); +const char * inet_ntop4(const struct in_addr *addr, char *dst, socklen_t size); + +const char * +inet_ntop(int af, const void *addr, char *buf, socklen_t len) +{ + if (addr && af == AF_INET6) return inet_ntop6(addr, buf, len); + if (addr && af == AF_INET) return inet_ntop4(addr, buf, len); + + errno = EAFNOSUPPORT; + return NULL; +} + +/* const char * + * inet_ntop6(src, dst, size) + * convert IPv6 binary address into presentation (printable) format + * author: + * Paul Vixie, 1996. + */ +const char * +inet_ntop6(const struct in6_addr *addr, char *dst, socklen_t size) +{ + const u_char *src = addr->__u6_addr.__u6_addr8; + /* + * Note that int32_t and int16_t need only be "at least" large enough + * to contain a value of the specified size. On some systems, like + * Crays, there is no such thing as an integer variable with 16 bits. + * Keep this in mind if you think this function should have been coded + * to use pointer overlays. All the world's not a VAX. + */ + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; + struct { int base, len; } best, cur; + u_int words[NS_IN6ADDRSZ / NS_INT16SZ]; + int i; + + /* + * Preprocess: + * Copy the input (bytewise) array into a wordwise array. + * Find the longest run of 0x00's in src[] for :: shorthanding. + */ + memset(words, '\0', sizeof words); + for (i = 0; i < NS_IN6ADDRSZ; i++) + words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); + best.base = -1; + best.len = 0; + cur.base = -1; + cur.len = 0; + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { + if (words[i] == 0) { + if (cur.base == -1) { + cur.base = i; + cur.len = 1; + } else { + cur.len++; + } + } else { + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) + best = cur; + cur.base = -1; + } + } + } + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) + best = cur; + } + if (best.base != -1 && best.len < 2) + best.base = -1; + + /* + * Format the result. + */ + tp = tmp; + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { + /* Are we inside the best run of 0x00's? */ + if (best.base != -1 && i >= best.base && + i < (best.base + best.len)) { + if (i == best.base) + *tp++ = ':'; + continue; + } + /* Are we following an initial run of 0x00s or any real hex? */ + if (i != 0) + *tp++ = ':'; + /* Is this address an encapsulated IPv4? */ + if (i == 6 && best.base == 0 && (best.len == 6 || + (best.len == 7 && words[7] != 0x0001) || + (best.len == 5 && words[5] == 0xffff))) { + struct in_addr ipv4_addr; + memcpy(&ipv4_addr, src+12, sizeof(ipv4_addr)); + if (!inet_ntop4(&ipv4_addr, tp, (socklen_t)sizeof(tmp) - (socklen_t)(tp - tmp))) { + errno = ENOSPC; + return (NULL); + } + tp += strlen(tp); + break; + } + tp += sprintf(tp, "%x", words[i]); + } + /* Was it a trailing run of 0x00's? */ + if (best.base != -1 && (best.base + best.len) == + (NS_IN6ADDRSZ / NS_INT16SZ)) + *tp++ = ':'; + *tp++ = '\0'; + + /* + * Check for overflow, copy, and we're done. + */ + if ((socklen_t)(tp - tmp) > size) { + errno = ENOSPC; + return (NULL); + } + strcpy(dst, tmp); + return (dst); +} + +const char * +inet_ntop4(const struct in_addr *addr, char *dst, socklen_t size) +{ + char tmp[MAX_V4_ADDR_LEN], *p; + const u_int8_t *ap = (u_int8_t *)&addr->s_addr; + int i; + size_t ql, len; + + if (addr == NULL) { + errno = EAFNOSUPPORT; + return NULL; + } + + if (dst == NULL) { + errno = ENOSPC; + return NULL; + } + + memset(tmp, 0, MAX_V4_ADDR_LEN); + + /* 3 dots, trailing nul */ + len = 4; + + p = tmp; + + for (i = 0; i < 4; i++, ap++) { + snprintf(p, 4, "%d", *ap); + ql = strlen(p); + len += ql; + p += ql; + if (i < 3) *p++ = '.'; + } + + if (len > size) { + errno = ENOSPC; + return NULL; + } + + memcpy(dst, tmp, len); + return dst; +} diff --git a/net/inet_pton.c b/net/inet_pton.c new file mode 100644 index 0000000..9989548 --- /dev/null +++ b/net/inet_pton.c @@ -0,0 +1,292 @@ +/* + * Copyright (c) 1996,1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char rcsid[] = "$Id: inet_pton.c,v 1.3 2003/04/10 18:53:29 majka Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define INET6 1 + +#define IN6ADDRSZ 16 + +#if 0 +#ifndef HAVE_PORTABLE_PROTOTYPE +#include "cdecl_ext.h" +#endif + +#ifndef HAVE_U_INT16_T +#include "bittypes.h" +#endif +#if !(defined(HAVE_INADDRSZ) && defined(HAVE_IN6ADDRSZ)) +#include "addrsize.h" +#endif +#endif +#ifndef NS_INADDRSZ +#define NS_INADDRSZ INADDRSZ +#endif +#ifndef NS_IN6ADDRSZ +#define NS_IN6ADDRSZ IN6ADDRSZ +#endif +#ifndef NS_INT16SZ +#define NS_INT16SZ sizeof(u_int16_t) +#endif + +/* + * WARNING: Don't even consider trying to compile this on a system where + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. + */ + +static int inet_pton4 __P((const char *src, u_char *dst)); +#ifdef INET6 +static int inet_pton6 __P((const char *src, u_char *dst)); +#endif + +/* int + * inet_pton(af, src, dst) + * convert from presentation format (which usually means ASCII printable) + * to network format (which is usually some kind of binary format). + * return: + * 1 if the address was valid for the specified address family + * 0 if the address wasn't valid (`dst' is untouched in this case) + * -1 if some other error occurred (`dst' is untouched in this case, too) + * author: + * Paul Vixie, 1996. + */ +int +inet_pton(int af, const char *src, void *dst) +{ + int status; + unsigned short ifnum; + char *p, *s; + + switch (af) + { + case AF_INET: + { + return (inet_pton4(src, dst)); + } + +#ifdef INET6 + case AF_INET6: + { + ifnum = 0; + p = NULL; + s = (char *)src; + + if (src != NULL) p = strrchr(src, '%'); + if (p != NULL) + { + s = strdup(src); + if (s == NULL) + { + errno = ENOMEM; + return -1; + } + + s[p - src] = '\0'; + } + + status = inet_pton6(s, dst); + if (p != NULL) free(s); + if (status != 1) return status; + + if ((p != NULL) && IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)dst)) + { + ifnum = if_nametoindex(++p); + ifnum = htons(ifnum); + ((struct in6_addr *)dst)->__u6_addr.__u6_addr16[1] = ifnum; + } + + return 1; + } +#endif + + default: + { + errno = EAFNOSUPPORT; + return -1; + } + } + + /* NOTREACHED */ + return -1; +} + +/* int + * inet_pton4(src, dst) + * like inet_aton() but without all the hexadecimal and shorthand. + * return: + * 1 if `src' is a valid dotted quad, else 0. + * notice: + * does not touch `dst' unless it's returning 1. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton4(const char *src, u_char *dst) +{ + static const char digits[] = "0123456789"; + int saw_digit, octets, ch; + u_char tmp[NS_INADDRSZ], *tp; + + saw_digit = 0; + octets = 0; + *(tp = tmp) = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr(digits, ch)) != NULL) { + u_int new = *tp * 10 + (pch - digits); + + if (new > 255) + return (0); + *tp = new; + if (! saw_digit) { + if (++octets > 4) + return (0); + saw_digit = 1; + } + } else if (ch == '.' && saw_digit) { + if (octets == 4) + return (0); + *++tp = 0; + saw_digit = 0; + } else + return (0); + } + if (octets < 4) + return (0); + memcpy(dst, tmp, NS_INADDRSZ); + return (1); +} + +#ifdef INET6 +/* int + * inet_pton6(src, dst) + * convert presentation level address to network order binary form. + * return: + * 1 if `src' is a valid [RFC1884 2.2] address, else 0. + * notice: + * (1) does not touch `dst' unless it's returning 1. + * (2) :: in a full address is silently ignored. + * credit: + * inspired by Mark Andrews. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton6(const char *src, u_char *dst) +{ + static const char xdigits_l[] = "0123456789abcdef", + xdigits_u[] = "0123456789ABCDEF"; + u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; + const char *xdigits, *curtok; + int ch, saw_xdigit; + u_int val; + + memset((tp = tmp), '\0', NS_IN6ADDRSZ); + endp = tp + NS_IN6ADDRSZ; + colonp = NULL; + /* Leading :: requires some special handling. */ + if (*src == ':') + if (*++src != ':') + return (0); + curtok = src; + saw_xdigit = 0; + val = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) + pch = strchr((xdigits = xdigits_u), ch); + if (pch != NULL) { + val <<= 4; + val |= (pch - xdigits); + if (val > 0xffff) + return (0); + saw_xdigit = 1; + continue; + } + if (ch == ':') { + curtok = src; + if (!saw_xdigit) { + if (colonp) + return (0); + colonp = tp; + continue; + } else if (*src == '\0') { + return (0); + } + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + saw_xdigit = 0; + val = 0; + continue; + } + if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && + inet_pton4(curtok, tp) > 0) { + tp += NS_INADDRSZ; + saw_xdigit = 0; + break; /* '\0' was seen by inet_pton4(). */ + } + return (0); + } + if (saw_xdigit) { + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + } + if (colonp != NULL) { + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + int i; + + if (tp == endp) + return (0); + for (i = 1; i <= n; i++) { + endp[- i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + if (tp != endp) + return (0); + memcpy(dst, tmp, NS_IN6ADDRSZ); + return (1); +} +#endif /*INET6*/ diff --git a/nls/CMakeLists.txt b/nls/CMakeLists.txt new file mode 100644 index 0000000..7338f50 --- /dev/null +++ b/nls/CMakeLists.txt @@ -0,0 +1,11 @@ +project(libc-nls) + +cmake_minimum_required(VERSION 3.10) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include/FreeBSD) + +set(nls_sources + FreeBSD/msgcat.c +) + +add_darling_object_library(libc-nls ${nls_sources}) diff --git a/nls/FreeBSD/catclose.3 b/nls/FreeBSD/catclose.3 new file mode 100644 index 0000000..cf238b5 --- /dev/null +++ b/nls/FreeBSD/catclose.3 @@ -0,0 +1,64 @@ +.\" Copyright (c) 1994 Winning Strategies, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Winning Strategies, Inc. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/nls/catclose.3,v 1.15 2005/02/27 16:30:16 phantom Exp $ +.Dd February 12, 2005 +.Dt CATCLOSE 3 +.Os +.Sh NAME +.Nm catclose +.Nd close message catalog +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In nl_types.h +.Ft int +.Fn catclose "nl_catd catd" +.Sh DESCRIPTION +The +.Fn catclose +function closes the message catalog specified by the argument +.Fa catd . +.Sh RETURN VALUES +.Rv -std catclose +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EBADF +An invalid message catalog descriptor was passed by the +.Fa catd +argument. +.El +.Sh SEE ALSO +.Xr gencat 1 , +.Xr catgets 3 , +.Xr catopen 3 +.Sh STANDARDS +The +.Fn catclose +function conforms to +.St -p1003.1-2001 . diff --git a/nls/FreeBSD/catgets.3 b/nls/FreeBSD/catgets.3 new file mode 100644 index 0000000..ba23033 --- /dev/null +++ b/nls/FreeBSD/catgets.3 @@ -0,0 +1,82 @@ +.\" Copyright (c) 1994 Winning Strategies, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Winning Strategies, Inc. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/nls/catgets.3,v 1.13 2005/06/15 19:04:04 ru Exp $ +.Dd February 12, 2005 +.Dt CATGETS 3 +.Os +.Sh NAME +.Nm catgets +.Nd retrieve string from message catalog +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In nl_types.h +.Ft char * +.Fn catgets "nl_catd catd" "int set_id" "int msg_id" "const char *s" +.Sh DESCRIPTION +The +.Fn catgets +function attempts to retrieve message +.Fa msg_id +of set +.Fa set_id +from the message catalog referenced by the descriptor +.Fa catd . +The argument +.Fa s +points to a default message which is returned if the function +is unable to retrieve the specified message. +.Sh RETURN VALUES +If the specified message was retrieved successfully, +.Fn catgets +returns a pointer to an internal buffer containing the message string; +otherwise it returns +.Fa s . +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa catd +argument is not a valid message catalog descriptor. +.It Bq Er EBADMSG +The message identified by +.Fa set_id +and +.Fa msg_id +is not in the message catalog. +.El +.Sh SEE ALSO +.Xr gencat 1 , +.Xr catclose 3 , +.Xr catopen 3 +.Sh STANDARDS +The +.Fn catgets +function conforms to +.St -p1003.1-2001 . diff --git a/nls/FreeBSD/catopen.3 b/nls/FreeBSD/catopen.3 new file mode 100644 index 0000000..dad21ae --- /dev/null +++ b/nls/FreeBSD/catopen.3 @@ -0,0 +1,157 @@ +.\" Copyright (c) 1994 Winning Strategies, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Winning Strategies, Inc. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/nls/catopen.3,v 1.17 2005/02/27 16:30:16 phantom Exp $ +.Dd February 12, 2005 +.Dt CATOPEN 3 +.Os +.Sh NAME +.Nm catopen +.Nd open message catalog +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In nl_types.h +.Ft nl_catd +.Fn catopen "const char *name" "int oflag" +.Sh DESCRIPTION +The +.Fn catopen +function opens the message catalog specified by +.Fa name +and returns a message catalog descriptor. +If +.Fa name +contains a +.Sq / +then +.Fa name +specifies the full pathname for the message catalog, otherwise the value +of the environment variable +.Ev NLSPATH +is used with +the following substitutions: +.Bl -tag -width XXX +.It \&%N +The value of the +.Fa name +argument. +.It \&%L +The value of the +.Ev LANG +environment variable or the +.Dv LC_MESSAGES +category (see below). +.It \&%l +The language element from the +.Ev LANG +environment variable or from the +.Dv LC_MESSAGES +category. +.It \&%t +The territory element from the +.Ev LANG +environment variable or from the +.Dv LC_MESSAGES +category. +.It \&%c +The codeset element from the +.Ev LANG +environment variable or from the +.Dv LC_MESSAGES +category. +.It \&%% +A single % character. +.El +.Pp +An empty string is substituted for undefined values. +.Pp +Path names templates defined in +.Ev NLSPATH +are separated by colons +.No ( Sq \&: ) . +A leading or two adjacent colons +is equivalent to specifying %N. +.Pp +If the +.Fa oflag +argument is set to the +.Dv NL_CAT_LOCALE +constant, +.Dv LC_MESSAGES +locale category used to open the message catalog; using +.Dv NL_CAT_LOCALE +conforms to the +.St -xpg4 +standard. +You can specify 0 for compatibility with +.St -xpg3 ; +when +.Fa oflag +is set to 0, the +.Ev LANG +environment variable +determines the message catalog locale. +.Pp +A message catalog descriptor +remains valid in a process until that process closes it, or +until a successful call to one of the +.Xr exec 3 +function. +.Sh RETURN VALUES +Upon successful completion, +.Fn catopen +returns a message catalog descriptor. +Otherwise, (nl_catd) -1 is returned and +.Va errno +is set to indicate the error. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa name +does not point to a valid message catalog, or catalog is corrupt. +.It Bq Er ENAMETOOLONG +An entire path to the message catalog exceeded 1024 characters. +.It Bq Er ENOENT +The named message catalog does not exists, or the +.Fa name +argument points to an empty string. +.It Bq Er ENOMEM +Insufficient memory is available. +.El +.Sh SEE ALSO +.Xr gencat 1 , +.Xr catclose 3 , +.Xr catgets 3 , +.Xr setlocale 3 +.Sh STANDARDS +The +.Fn catopen +function conforms to +.St -p1003.1-2001 . diff --git a/nls/FreeBSD/msgcat.c b/nls/FreeBSD/msgcat.c new file mode 100644 index 0000000..542368e --- /dev/null +++ b/nls/FreeBSD/msgcat.c @@ -0,0 +1,478 @@ +/*********************************************************** +Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that Alfalfa's name not be used in +advertising or publicity pertaining to distribution of the software +without specific, written prior permission. + +ALPHALPHA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +ALPHALPHA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +If you make any modifications, bugfixes or other changes to this software +we'd appreciate it if you could send a copy to us so we can keep things +up-to-date. Many thanks. + Kee Hinckley + Alfalfa Software, Inc. + 267 Allston St., #3 + Cambridge, MA 02139 USA + nazgul@alfalfa.com + +******************************************************************/ + +#include +__FBSDID("$FreeBSD: src/lib/libc/nls/msgcat.c,v 1.49 2005/02/01 16:04:55 phantom Exp $"); + +/* + * We need a better way of handling errors than printing text. I need + * to add an error handling routine. + */ + +#include "namespace.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "msgcat.h" +#include "setlocale.h" /* for ENCODING_LEN */ + +#ifndef ntohll +#define ntohll(x) OSSwapBigToHostInt64(x) +#endif + +#define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L" + +#define TRUE 1 +#define FALSE 0 + +#define NLERR ((nl_catd) -1) +#define NLRETERR(errc) { errno = errc; return (NLERR); } + +static nl_catd loadCat(__const char *); +static int loadSet(MCCatT *, MCSetT *); +static void __nls_free_resources(MCCatT *, int); + +nl_catd +catopen(__const char *name, int type) +{ + int spcleft, saverr; + char path[PATH_MAX]; + char *nlspath, *lang, *base, *cptr, *pathP, *tmpptr; + char *cptr1, *plang, *pter, *pcode; + struct stat sbuf; + + if (name == NULL || *name == '\0') + NLRETERR(EINVAL); + + /* is it absolute path ? if yes, load immediately */ + if (strchr(name, '/') != NULL) + return (loadCat(name)); + + if (type == NL_CAT_LOCALE) + lang = (char *)querylocale(LC_MESSAGES_MASK, NULL); + else + lang = getenv("LANG"); + + if (lang == NULL || *lang == '\0' || strlen(lang) > ENCODING_LEN || + (lang[0] == '.' && + (lang[1] == '\0' || (lang[1] == '.' && lang[2] == '\0'))) || + strchr(lang, '/') != NULL) + lang = "C"; + + if ((plang = cptr1 = strdup(lang)) == NULL) + return (NLERR); + if ((cptr = strchr(cptr1, '@')) != NULL) + *cptr = '\0'; + pter = pcode = ""; + if ((cptr = strchr(cptr1, '_')) != NULL) { + *cptr++ = '\0'; + pter = cptr1 = cptr; + } + if ((cptr = strchr(cptr1, '.')) != NULL) { + *cptr++ = '\0'; + pcode = cptr; + } + + if ((nlspath = getenv("NLSPATH")) == NULL || issetugid()) + nlspath = _DEFAULT_NLS_PATH; + + if ((base = cptr = strdup(nlspath)) == NULL) { + saverr = errno; + free(plang); + errno = saverr; + return (NLERR); + } + + while ((nlspath = strsep(&cptr, ":")) != NULL) { + pathP = path; + if (*nlspath) { + for (; *nlspath; ++nlspath) { + if (*nlspath == '%') { + switch (*(nlspath + 1)) { + case 'l': + tmpptr = plang; + break; + case 't': + tmpptr = pter; + break; + case 'c': + tmpptr = pcode; + break; + case 'L': + tmpptr = lang; + break; + case 'N': + tmpptr = (char *)name; + break; + case '%': + ++nlspath; + /* fallthrough */ + default: + if (pathP - path >= + sizeof(path) - 1) + goto too_long; + *(pathP++) = *nlspath; + continue; + } + ++nlspath; + put_tmpptr: + spcleft = sizeof(path) - + (pathP - path) - 1; + if (strlcpy(pathP, tmpptr, spcleft) >= + spcleft) { + too_long: + free(plang); + free(base); + NLRETERR(ENAMETOOLONG); + } + pathP += strlen(tmpptr); + } else { + if (pathP - path >= sizeof(path) - 1) + goto too_long; + *(pathP++) = *nlspath; + } + } + *pathP = '\0'; + if (stat(path, &sbuf) == 0) { + free(plang); + free(base); + return (loadCat(path)); + } + } else { + tmpptr = (char *)name; + --nlspath; + goto put_tmpptr; + } + } + free(plang); + free(base); + NLRETERR(ENOENT); +} + +/* + * We've got an odd situation here. The odds are real good that the + * number we are looking for is almost the same as the index. We could + * use the index, check the difference and do something intelligent, but + * I haven't quite figured out what's intelligent. + * + * Here's a start. + * Take an id N. If there are > N items in the list, then N cannot + * be more than N items from the start, since otherwise there would + * have to be duplicate items. So we can safely set the top to N+1 + * (after taking into account that ids start at 1, and arrays at 0) + * + * Let's say we are at position P, and we are looking for N, but have + * V. If N > V, then the furthest away that N could be is + * P + (N-V). So we can safely set hi to P+(N-V)+1. For example: + * We are looking for 10, but have 8 + * 8 ? ? ? ? + * >=9 >=10 >=11 + * + */ + +#define LOOKUP(PARENT, CHILD, ID, NUM, SET) { \ + lo = 0; \ + if (ID - 1 < NUM) { \ + cur = ID - 1; \ + hi = ID; \ + } else { \ + hi = NUM; \ + cur = (hi - lo) / 2; \ + } \ + while (TRUE) { \ + CHILD = PARENT->SET + cur; \ + if (ntohl(CHILD->ID) == ID) \ + break; \ + if (ntohl(CHILD->ID) < ID) { \ + lo = cur + 1; \ + if (hi > cur + (ID - ntohl(CHILD->ID)) + 1) \ + hi = cur + (ID - ntohl(CHILD->ID)) + 1; \ + dir = 1; \ + } else { \ + hi = cur; \ + dir = -1; \ + } \ + if (lo >= hi) \ + return (NULL); \ + if (hi - lo == 1) \ + cur += dir; \ + else \ + cur += ((hi - lo) / 2) * dir; \ + } \ +} + +static MCSetT * +MCGetSet(MCCatT *cat, int setId) +{ + MCSetT *set; + int32_t lo, hi, cur, dir; + + if (cat == NULL || setId <= 0) + return (NULL); + LOOKUP(cat, set, setId, cat->numSets, sets); + if (set->invalid && loadSet(cat, set) <= 0) + return (NULL); + return (set); +} + +static MCMsgT * +MCGetMsg(MCSetT *set, int msgId) +{ + MCMsgT *msg; + int32_t lo, hi, cur, dir; + + if (set == NULL || set->invalid || msgId <= 0) + return (NULL); + LOOKUP(set, msg, msgId, ntohl(set->numMsgs), u.msgs); + return (msg); +} + +char * +catgets(nl_catd catd, int setId, int msgId, __const char *dflt) +{ + MCMsgT *msg; + MCCatT *cat = (MCCatT *)catd; + __const char *cptr; + + if (catd == NULL || catd == NLERR) + return ((char *)dflt); + msg = MCGetMsg(MCGetSet(cat, setId), msgId); + if (msg != NULL) + cptr = msg->msg.str; + else + cptr = dflt; + return ((char *)cptr); +} + +int +catclose(nl_catd catd) +{ + MCCatT *cat = (MCCatT *)catd; + + if (catd == NULL || catd == NLERR) { + errno = EBADF; + return (-1); + } + + (void)fclose(cat->fp); + __nls_free_resources(cat, cat->numSets); + free(cat); + return (0); +} + +/* + * Internal routines + */ + +/* Note that only malloc failures are allowed to return an error */ +static char *_errowner = "Message Catalog System"; + +#define CORRUPT() { \ + (void)fclose(cat->fp); \ + (void)fprintf(stderr, "%s: corrupt file.", _errowner); \ + free(cat); \ + NLRETERR(EFTYPE); \ +} + +#define NOSPACE() { \ + saverr = errno; \ + (void)fclose(cat->fp); \ + (void)fprintf(stderr, "%s: no more memory.", _errowner); \ + free(cat); \ + errno = saverr; \ + return (NLERR); \ +} + +static void +__nls_free_resources(MCCatT *cat, int i) +{ + MCSetT *set; + int j; + + for (j = 0; j < i; j++) { + set = cat->sets + j; + if (!set->invalid) { + free(set->data.str); + free(set->u.msgs); + } + } + free(cat->sets); +} + +static nl_catd +loadCat(__const char *catpath) +{ + MCHeaderT header; + MCCatT *cat; + MCSetT *set; + int32_t i; + off_t nextSet; + int saverr; + int fd; + + if ((cat = (MCCatT *)malloc(sizeof(MCCatT))) == NULL) + return (NLERR); + + if ((fd = open(catpath, O_RDONLY | O_CLOEXEC)) == -1) { + saverr = errno; + free(cat); + errno = saverr; + return (NLERR); + } + + if ((cat->fp = fdopen(fd, "r")) == NULL) { + saverr = errno; + close(fd); + free(cat); + errno = saverr; + return (NLERR); + } + + if (fread(&header, sizeof(header), 1, cat->fp) != 1 || + strncmp(header.magic, MCMagic, MCMagicLen) != 0) + CORRUPT(); + + if (ntohl(header.majorVer) != MCMajorVer) { + (void)fclose(cat->fp); + free(cat); + if (OSSwapInt32(ntohl(header.majorVer)) == MCMajorVer) { + (void)fprintf(stderr, "%s: %s is the wrong byte ordering.\n", _errowner, catpath); + } else { + (void)fprintf(stderr, "%s: %s is version %d, we need %d.\n", _errowner, catpath, (int)ntohl(header.majorVer), MCMajorVer); + } + NLRETERR(EFTYPE); + } + if (ntohl(header.numSets) <= 0) { + (void)fclose(cat->fp); + free(cat); + (void)fprintf(stderr, "%s: %s has %d sets!\n", + _errowner, catpath, (int)ntohl(header.numSets)); + NLRETERR(EFTYPE); + } + + cat->numSets = ntohl(header.numSets); + if ((cat->sets = (MCSetT *)malloc(sizeof(MCSetT) * cat->numSets)) == + NULL) + NOSPACE(); + + nextSet = ntohll(header.firstSet); + for (i = 0; i < cat->numSets; ++i) { + if (fseeko(cat->fp, nextSet, SEEK_SET) == -1) { + __nls_free_resources(cat, i); + CORRUPT(); + } + + /* read in the set header */ + set = cat->sets + i; + if (fread(set, sizeof(*set), 1, cat->fp) != 1) { + __nls_free_resources(cat, i); + CORRUPT(); + } + + /* if it's invalid, skip over it (and backup 'i') */ + if (set->invalid) { + --i; + nextSet = ntohll(set->nextSet); + continue; + } + set->invalid = TRUE; + nextSet = ntohll(set->nextSet); + } + + return ((nl_catd) cat); +} + +static int +loadSet(MCCatT *cat, MCSetT *set) +{ + MCMsgT *msg; + int i; + int saverr; + + /* Get the data */ + if (fseeko(cat->fp, ntohll(set->data.off), SEEK_SET) == -1) + return (0); + if ((set->data.str = malloc(ntohl(set->dataLen))) == NULL) + return (-1); + if (fread(set->data.str, ntohl(set->dataLen), 1, cat->fp) != 1) { + saverr = errno; + free(set->data.str); + errno = saverr; + return (0); + } + + /* Get the messages */ + if (fseeko(cat->fp, ntohll(set->u.firstMsg), SEEK_SET) == -1) { + saverr = errno; + free(set->data.str); + errno = saverr; + return (0); + } + if ((set->u.msgs = (MCMsgT *)malloc(sizeof(MCMsgT) * ntohl(set->numMsgs))) == + NULL) { + saverr = errno; + free(set->data.str); + errno = saverr; + return (-1); + } + + for (i = 0; i < ntohl(set->numMsgs); ++i) { + msg = set->u.msgs + i; + if (fread(msg, sizeof(*msg), 1, cat->fp) != 1) { + saverr = errno; + free(set->u.msgs); + free(set->data.str); + errno = saverr; + return (0); + } + if (msg->invalid) { + --i; + continue; + } + msg->msg.str = (char *)(set->data.str + ntohll(msg->msg.off)); + } + set->invalid = FALSE; + return (1); +} diff --git a/nls/FreeBSD/msgcat.h b/nls/FreeBSD/msgcat.h new file mode 100644 index 0000000..d14d139 --- /dev/null +++ b/nls/FreeBSD/msgcat.h @@ -0,0 +1,152 @@ +/* $FreeBSD: src/lib/libc/nls/msgcat.h,v 1.9 2005/02/01 16:04:55 phantom Exp $ */ + +#ifndef _MSGCAT_H_ +#define _MSGCAT_H_ + + +/*********************************************************** +Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that Alfalfa's name not be used in +advertising or publicity pertaining to distribution of the software +without specific, written prior permission. + +ALPHALPHA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +ALPHALPHA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +If you make any modifications, bugfixes or other changes to this software +we'd appreciate it if you could send a copy to us so we can keep things +up-to-date. Many thanks. + Kee Hinckley + Alfalfa Software, Inc. + 267 Allston St., #3 + Cambridge, MA 02139 USA + nazgul@alfalfa.com + +******************************************************************/ + +#include <_stdio.h> +#include + +/* + * Magic definitions + */ + +#define MCMagicLen 8 +#define MCMagic "*nazgul*" + +#define MCMajorVer 1 +#define MCMinorVer 0 + +/* For or'd constants */ +#define MCMakeId(s,m) (u_int32_t) ( ((unsigned short)s << (sizeof(short)*8)) \ + | (unsigned short)m ) + + +/* + * Critical note here. Sets and Messages *MUST* be stored in ascending + * order. There are stored that way (by specification) in the original + * data file, however in the process of merging in new stuff you might + * mix that up. Don't! The catget stuff does a binary search and will + * totally lose it if these aren't in order (not contiguous mind you, just + * in order. If this turns out to be a major problem this could be enhanced + * by adding a 'sorted' flag to the db, and sorting msgs and sets at load + * time if things aren't sorted, but I'd like not to have to do that. + */ + +/* + * I have tried here to define data structures which can be used + * while the catalog is on disk, and at runtime. + * This is rather dangerous of course, but I think it can be done without + * overly increasing the memory usage, and it makes loading and storing + * somewhat simpler and less prone to accidents. I have also tried to + * define on disk data structures which can be updated in place, so that + * with a very large catalog (e.g. all system errors) you don't have to + * load everything in memory in order to add or update one set. With + * this in mind there are "invalid" flags which allow items to be + * invalidated and thus not loaded at runtime. Note however that although + * I pay attention to these when I load the DB, I do not currently use + * them in gencat (it just reads everything into memory), so there is + * no guarantee that this will all work. + */ + +/* + * MCOffsetT - Union to handle both disk and runtime pointers + */ +typedef union { + off_t off; + char *str; + void *ptr; + struct _MCMsgT *msg; + struct _MCSetT *set; +} MCOffsetT; + +#ifdef __LP64__ +#pragma pack(4) +#endif /* __LP64__ */ +/* + * MCMsgT - Message structure (disk and runtime) + */ +typedef struct _MCMsgT { + int32_t msgId; /* Id of this message */ + MCOffsetT msg; /* Relative offset on disk or pointer in memory */ + int32_t invalid; /* Valid on disk, loaded in memory */ +} MCMsgT; + +/* + * MCSetT - Set structure (disk and runtime) + */ +typedef struct _MCSetT { + int32_t setId; /* Id of this set */ + off_t nextSet; /* Offset of next set on disk */ + union { + off_t firstMsg; /* Offset to first Msg (while on disk) */ + MCMsgT *msgs; /* Pointer to array of msgs (in mem, loaded) */ + } u; + MCOffsetT data; /* Offset to data, or pointer to data */ + int32_t dataLen; /* Length of data area on disk */ + int32_t numMsgs; /* Number of messages */ + int32_t invalid; /* Valid on disk, loaded in memory */ +} MCSetT; +#ifdef __LP64__ +#pragma pack() +#endif /* __LP64__ */ + +/* + * MCCatT - Runtime catalog pointer + */ +typedef struct { + FILE *fp; /* File descriptor of catalog (if load-on-demand) */ + int32_t numSets; /* Number of sets */ + MCSetT *sets; /* Pointer to the sets */ + off_t firstSet; /* Offset of first set on disk */ +} MCCatT; + +/* + * MCHeaderT - Disk file header + */ +typedef struct { + char magic[MCMagicLen]; /* Magic cookie "*nazgul*" */ + int32_t majorVer; /* ++ on incompatible changes */ + int32_t minorVer; /* ++ on compatible changes */ + int32_t flags; /* Informational flags */ + int32_t numSets; /* Number of valid Sets */ + off_t firstSet; /* Offset of first set on disk */ +} MCHeaderT; + +/* Some flags */ +#define MC68KByteOrder 0x01 +#define MCn86ByteOrder 0x02 + +#endif /* !_MSGCAT_H_ */ diff --git a/os/CMakeLists.txt b/os/CMakeLists.txt new file mode 100644 index 0000000..01a65a8 --- /dev/null +++ b/os/CMakeLists.txt @@ -0,0 +1,8 @@ +project(libc-os) + +cmake_minimum_required(VERSION 3.10) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) +set(os_sources assumes.c debug_private.c) + +add_darling_object_library(libc-os ${os_sources}) diff --git a/os/api.h b/os/api.h new file mode 100644 index 0000000..43a37d0 --- /dev/null +++ b/os/api.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header + * API macros. libdarwin provides APIs for low-level userspace projects in the + * Darwin operating system. + * + * - C language additions + * - POSIX and BSD API additions + * - POSIX and BSD convenience wrappers + * - Mach API additions and wrappers with clearer semantics + * + * Additions which extend the C language are not prefixed and are therefore not + * included by default when including this header. + * + * Additions to API families conforming to ANSI C carry the "os_" prefix. + * + * Additions to API families conforming to POSIX carry the "_np" ("Not POSIX") + * suffix. + * + * Additions to API families conforming to both POSIX and ANSI C carry the "_np" + * suffix. + * + * Convenience wrappers for POSIX and BSD APIs carry the "os_" prefix. + * + * New APIs formalizing Darwin workflows carry the "os_" prefix. + */ +#ifndef __DARWIN_API_H +#define __DARWIN_API_H + +#include +#include + +/*! + * @const DARWIN_API_VERSION + * The API version of the library. This version will be changed in accordance + * with new API introductions so that callers may submit code to the build that + * adopts those new APIs before the APIs land by using the following pattern: + * + * #if DARWIN_API_VERSION >= 20180424 + * darwin_new_api(); + * #endif + * + * In this example, the libdarwin maintainer and API adopter agree on an API + * version of 20180424 ahead of time for the introduction of + * darwin_new_api_call(). When a libdarwin with that API version is submitted, + * the project is rebuilt, and the new API becomes active. + * + * Breaking API changes will be both covered under this mechanism as well as + * individual preprocessor macros in this header that declare new behavior as + * required. + */ +#define DARWIN_API_VERSION 20191015u + +#if !DARWIN_BUILDING_LIBSYSTEM_DARWIN +#define DARWIN_API_AVAILABLE_20170407 \ + API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +#define DARWIN_API_AVAILABLE_20180727 \ + API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0)) +#define DARWIN_API_AVAILABLE_20181020 \ + API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0)) +#define DARWIN_API_AVAILABLE_20181020 \ + API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0)) +#define DARWIN_API_AVAILABLE_20190830 \ + API_AVAILABLE(macos(10.15.2), ios(13.3), tvos(13.3), watchos(6.1.1)) +#define DARWIN_API_AVAILABLE_20191015 \ + API_AVAILABLE(macos(10.15.2), ios(13.3), tvos(13.3), watchos(6.1.1)) +#else +#define DARWIN_API_AVAILABLE_20170407 +#define DARWIN_API_AVAILABLE_20180727 +#define DARWIN_API_AVAILABLE_20181020 +#define DARWIN_API_AVAILABLE_20190830 +#define DARWIN_API_AVAILABLE_20191015 +#endif + +/*! + * @typedef os_struct_magic_t + * A type representing the magic number of a transparent structure. + */ +typedef uint32_t os_struct_magic_t; + +/*! + * @typedef os_struct_version_t + * A type representing the version of a transparent structure. + */ +typedef uint32_t os_struct_version_t; + +#endif // __DARWIN_API_H diff --git a/os/assumes.c b/os/assumes.c new file mode 100644 index 0000000..389fe17 --- /dev/null +++ b/os/assumes.c @@ -0,0 +1,408 @@ +/* + * Copyright (c) 2011, 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include <_simple.h> +#include +#include +#include +#include "os/assumes.h" + +#if !TARGET_OS_DRIVERKIT +#include +#include +#include +#include +#include +#else +#define _os_debug_log_error_str(...) +// placeholder to disable usage of dlfcn.h +typedef struct dl_info { + void *dli_fbase; +} Dl_info; +#endif +#if __has_include() +#include +#define os_set_crash_message(arg) CRSetCrashLogMessage(arg) +#else +#define os_set_crash_message(arg) +#endif + +#define OSX_ASSUMES_LOG_REDIRECT_SECT_NAME "__osx_log_func" +#define os_atomic_cmpxchg(p, o, n) __sync_bool_compare_and_swap((p), (o), (n)) + +#if !TARGET_OS_DRIVERKIT +static const char * +_os_basename(const char *p) +{ + return ((strrchr(p, '/') ? : p - 1) + 1); +} +#endif + +static void +_os_get_build(char *build, size_t sz) +{ + /* Get the build every time. We used to cache it, but if PID 1 experiences + * an assumes() failure before the build has been set, that would mean that + * all future failures would get bad build info. So we fetch it every time. + * Since assumes() failures are on the slow path anyway, not a huge deal. + */ + int mib[] = { CTL_KERN, KERN_OSVERSION }; + + size_t oldsz = sz; + int r = sysctl(mib, 2, build, &sz, NULL, 0); + if (r == 0 && sz == 1) { + (void)strlcpy(build, "99Z999", oldsz); + } +#if TARGET_IPHONE_SIMULATOR + char *simVersion = getenv("SIMULATOR_RUNTIME_BUILD_VERSION"); + if (simVersion) { + strlcat(build, " ", oldsz); + strlcat(build, simVersion, oldsz); + } +#endif +} + +#if !TARGET_OS_DRIVERKIT +static void +_os_get_image_uuid(void *hdr, uuid_t uuid) +{ +#if __LP64__ + struct mach_header_64 *hdr32or64 = (struct mach_header_64 *)hdr; +#else + struct mach_header *hdr32or64 = (struct mach_header *)hdr; +#endif /* __LP64__ */ + + size_t i = 0; + size_t next = sizeof(*hdr32or64); + struct load_command *cur = NULL; + for (i = 0; i < hdr32or64->ncmds; i++) { + cur = (struct load_command *)((uintptr_t)hdr32or64 + next); + if (cur->cmd == LC_UUID) { + struct uuid_command *cmd = (struct uuid_command *)cur; + uuid_copy(uuid, cmd->uuid); + break; + } + + next += cur->cmdsize; + } + + if (i == hdr32or64->ncmds) { + uuid_clear(uuid); + } +} +#endif + +static bool +_os_abort_on_assumes(void) +{ + bool result = false; + + if (getpid() != 1) { + if (getenv("OS_ASSUMES_FATAL")) { + result = true; + } + } else { + if (getenv("OS_ASSUMES_FATAL_PID1")) { + result = true; + } + } + + return result; +} + +#if __LP64__ +typedef struct mach_header_64 os_mach_header; +#else +typedef struct mach_header os_mach_header; +#endif + +static os_redirect_t +_os_find_log_redirect_func(os_mach_header *hdr) +{ + os_redirect_t result = NULL; + +#if !TARGET_OS_DRIVERKIT + char name[128]; + unsigned long size = 0; + uint8_t *data = getsectiondata(hdr, OS_ASSUMES_REDIRECT_SEG, OS_ASSUMES_REDIRECT_SECT, &size); + if (!data) { + data = getsectiondata(hdr, "__TEXT", OSX_ASSUMES_LOG_REDIRECT_SECT_NAME, &size); + + if (data && size < sizeof(name) - 2) { + (void)strlcpy(name, (const char *)data, size + 1); + result = dlsym(RTLD_DEFAULT, name); + } + } else if (size == sizeof(struct _os_redirect_assumes_s)) { + struct _os_redirect_assumes_s *redirect = (struct _os_redirect_assumes_s *)data; + result = redirect->redirect; + } +#endif + + return result; +} + +static bool +_os_log_redirect(void *hdr, const char *msg) +{ + bool result = false; + + os_redirect_t redirect_func = _os_find_log_redirect_func(hdr); + if (redirect_func) { + result = redirect_func(msg); + } + + return result; +} + +__attribute__((always_inline)) +static void +_os_construct_message(uint64_t code, _SIMPLE_STRING asl_message, Dl_info *info, char *buff, size_t sz) +{ + const char *image_name = NULL; + uintptr_t offset = 0; + uuid_string_t uuid_str; + +#if !TARGET_OS_DRIVERKIT + void *ret = __builtin_return_address(0); + if (dladdr(ret, info)) { + uuid_t uuid; + _os_get_image_uuid(info->dli_fbase, uuid); + + uuid_unparse(uuid, uuid_str); + image_name = _os_basename(info->dli_fname); + + offset = ret - info->dli_fbase; + } +#else + info->dli_fbase = NULL; +#endif + + char sig[64]; + (void)snprintf(sig, sizeof(sig), "%s:%lu", uuid_str, offset); + + char result[24]; + (void)snprintf(result, sizeof(result), "0x%llx", code); + + char build[32]; + size_t bsz = sizeof(build); + _os_get_build(build, bsz); + + (void)snprintf(buff, sz, "assertion failed: %s: %s + %lu [%s]: %s", build, image_name, offset, uuid_str, result); + + _simple_asl_msg_set(asl_message, "com.apple.message.domain", "com.apple.assumes.failure"); + _simple_asl_msg_set(asl_message, "com.apple.message.signature", sig); + _simple_asl_msg_set(asl_message, "com.apple.message.signature2", result); + _simple_asl_msg_set(asl_message, "com.apple.message.signature3", image_name); + _simple_asl_msg_set(asl_message, "com.apple.message.summarize", "YES"); +} + +#pragma mark Internal Implementations + +os_crash_callback_t _os_crash_callback = NULL; + +__attribute__((always_inline)) +static inline void +_os_crash_impl(const char *message) { + os_set_crash_message(message); +#if !TARGET_OS_DRIVERKIT + if (!_os_crash_callback) { + _os_crash_callback = dlsym(RTLD_MAIN_ONLY, "os_crash_function"); + } + if (_os_crash_callback) { + _os_crash_callback(message); + } +#endif +} + +#if !TARGET_OS_DRIVERKIT +__attribute__((always_inline)) +static inline bool +_os_crash_fmt_impl(os_log_pack_t pack, size_t pack_size) +{ + /* + * We put just the format string into the CrashReporter buffer so that we + * can get at least that on customer builds. + */ + const char *message = pack->olp_format; + _os_crash_impl(message); + + char *(*_os_log_pack_send_and_compose)(os_log_pack_t, os_log_t, + os_log_type_t, char *, size_t) = NULL; + _os_log_pack_send_and_compose = dlsym(RTLD_DEFAULT, "os_log_pack_send_and_compose"); + if (!_os_log_pack_send_and_compose) return false; + + os_log_t __os_log_default = NULL; + __os_log_default = dlsym(RTLD_DEFAULT, "_os_log_default"); + if (!__os_log_default) return false; + + char *composed = _os_log_pack_send_and_compose(pack, __os_log_default, + OS_LOG_TYPE_ERROR, NULL, 0); + + abort_with_payload(OS_REASON_LIBSYSTEM, OS_REASON_LIBSYSTEM_CODE_FAULT, pack, pack_size, composed, 0); +} +#endif + +__attribute__((always_inline)) +static inline void +_os_assumes_log_impl(uint64_t code) +{ + char message[256] = ""; + + _SIMPLE_STRING asl_message = _simple_asl_msg_new(); + if (asl_message) { + Dl_info info; + _os_construct_message(code, asl_message, &info, message, sizeof(message)); + if (!_os_log_redirect(info.dli_fbase, message)) { + _os_debug_log_error_str(message); + _simple_asl_msg_set(asl_message, "Level", "Error"); + _simple_asl_msg_set(asl_message, "Message", ""); + _simple_asl_send(asl_message); + } + + _simple_sfree(asl_message); + } + + if (_os_abort_on_assumes()) { + os_crash(message); + } +} + +__attribute__((always_inline)) +static inline char * +_os_assert_log_impl(uint64_t code) +{ + char *result = NULL; + + _SIMPLE_STRING asl_message = _simple_asl_msg_new(); + if (asl_message) { + Dl_info info; + char message[256]; + _os_construct_message(code, asl_message, &info, message, sizeof(message)); + if (!_os_log_redirect(info.dli_fbase, message)) { + _os_debug_log_error_str(message); + _simple_asl_msg_set(asl_message, "Level", "Error"); + _simple_asl_msg_set(asl_message, "Message", ""); + _simple_asl_send(asl_message); + } + + _simple_sfree(asl_message); + result = strdup(message); + } + + return result; +} + +__attribute__((always_inline)) +static inline void +_os_assumes_log_ctx_impl(os_log_callout_t callout, void *ctx, uint64_t code) +{ + char message[256] = ""; + + _SIMPLE_STRING asl_message = _simple_asl_msg_new(); + if (asl_message) { + Dl_info info; + _os_construct_message(code, asl_message, &info, message, sizeof(message)); + + (void)callout(asl_message, ctx, message); + _simple_sfree(asl_message); + } + + if (_os_abort_on_assumes()) { + os_crash(message); + } +} + +__attribute__((always_inline)) +static inline char * +_os_assert_log_ctx_impl(os_log_callout_t callout, void *ctx, uint64_t code) +{ + char *result = NULL; + + _SIMPLE_STRING asl_message = _simple_asl_msg_new(); + if (asl_message) { + Dl_info info; + char message[256]; + _os_construct_message(code, asl_message, &info, message, sizeof(message)); + + (void)callout(asl_message, ctx, message); + _simple_sfree(asl_message); + result = strdup(message); + } + return result; +} + +#pragma mark Public Interfaces +void _os_crash(const char *message) +{ + _os_crash_impl(message); +} + +#if !TARGET_OS_DRIVERKIT +void _os_crash_fmt(os_log_pack_t pack, size_t pack_size) +{ + _os_crash_fmt_impl(pack, pack_size); +} +#endif + +void +_os_assumes_log(uint64_t code) +{ + _os_assumes_log_impl(code); +} + +char * +_os_assert_log(uint64_t code) +{ + return _os_assert_log_impl(code); +} + +void +_os_assumes_log_ctx(os_log_callout_t callout, void *ctx, uint64_t code) +{ + _os_assumes_log_ctx_impl(callout, ctx, code); +} + +char * +_os_assert_log_ctx(os_log_callout_t callout, void *ctx, uint64_t code) +{ + return _os_assert_log_ctx_impl(callout, ctx, code); +} + +void +_os_avoid_tail_call(void) +{ + // no-op +} diff --git a/os/assumes.h b/os/assumes.h new file mode 100644 index 0000000..c2c2afc --- /dev/null +++ b/os/assumes.h @@ -0,0 +1,559 @@ +/* Copyright (c) 2012, 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __OS_ASSUMES_H__ +#define __OS_ASSUMES_H__ + +#include +#include + +__BEGIN_DECLS + +#include +#include +#include +#include +#include +#include +#include <_simple.h> +#include +#include +#include + +#ifdef DARLING + #include +#endif + +#if __GNUC__ +#define os_constant(x) __builtin_constant_p((x)) +#define os_hardware_trap() __asm__ __volatile__ (""); __builtin_trap() +#define __OS_COMPILETIME_ASSERT__(e) __extension__({ \ + char __compile_time_assert__[(e) ? 1 : -1]; \ + (void)__compile_time_assert__; \ +}) +#else /* __GNUC__ */ +#define os_constant(x) ((long)0) +#define os_hardware_trap() abort() +#define __OS_COMPILETIME_ASSERT__(e) (e) +#endif /* __GNUC__ */ + +#pragma mark os_crash + +/* + * os_crash() is like os_hardware_trap(), except you get to pass in a crash + * message, and it can be redirected to a callback function using + * os_set_crash_callback() + */ + +#define __os_crash_simple(msg) \ + ({ \ + _os_crash(msg); \ + os_hardware_trap(); \ + }) + +#if defined(OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE) +#include + +#define __os_crash_fmt(...) \ + ({ \ + const size_t size = os_log_pack_size(__VA_ARGS__); \ + uint8_t buf[size] __attribute__((aligned(alignof(os_log_pack_s)))); \ + os_log_pack_t pack = (os_log_pack_t)&buf; \ + os_log_pack_fill(pack, size, errno, __VA_ARGS__); \ + _os_crash_fmt(pack, size); \ + os_hardware_trap(); \ + }) + +#define __os_crash_N(msg) __os_crash_simple(msg) +#define __os_crash_Y(...) __os_crash_fmt(__VA_ARGS__) + +// Returns Y if >1 argument, N if just one argument. +#define __thirty_second_argument(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, \ + _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, \ + _26, _27, _28, _29, _30, _31, _32, ...) _32 +#define __has_more_than_one_argument(...) __thirty_second_argument(__VA_ARGS__, \ + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, \ + Y, Y, Y, Y, Y, Y, Y, N, EXTRA) + +#define __os_crash_invoke(variant, ...) \ + OS_CONCAT(__os_crash_, variant)(__VA_ARGS__) + +#define os_crash(...) \ + __os_crash_invoke(__has_more_than_one_argument(__VA_ARGS__), __VA_ARGS__) + +OS_COLD +extern void +_os_crash_fmt(os_log_pack_t, size_t); + +/*! + * @function os_assert_sprintf + * A routine to assert the result of a call to snprintf(3) or vsnprintf(3). + * + * @param ret + * The return value from {v}snprintf(3). + * + * @param buff_size + * The size of the buffer given to {v}snprintf(3). + * + * @discussion + * If ret is less than zero or greater than size, the routine will abort the + * caller with a message indicating the nature of the failure in the Application + * Specific Information section of the resulting crash log. + * + * This routine is useful for printing paths that are expected to succeed with a + * statically-sized buffer. + */ +API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +OS_ALWAYS_INLINE OS_COLD +static inline void +os_assert_sprintf(int ret, size_t buff_size) +{ + if (ret < 0) { + os_crash("error printing buffer: %s", strerror(errno)); + } + + if ((size_t)ret > buff_size) { + os_crash("buffer too small: needed = %d, actual = %lu", + ret, buff_size); + } +} + +/*! + * @function os_assert_asprintf + * A routine to assert the result of a call to {v}asprintf(3). + * + * @param ret + * The return value from {v}asnprintf(3). + * + * @discussion + * If ret is less than zero, the routine will abort the caller with a message + * indicating the nature of the failure in the Application Specific Information + * section of the resulting crash log. + */ +API_AVAILABLE(macos(10.15.2), ios(13.3), tvos(13.3), watchos(6.1.1)) +OS_ALWAYS_INLINE OS_COLD +static inline void +os_assert_asprintf(int ret) +{ + if (ret < 0) { + os_crash("error printing buffer: %s", strerror(errno)); + } +} + +/*! + * @function os_assert_malloc + * A routine to assert the result of allocations which may fail. + * + * @param desc + * A string describing the object whose allocation was attempted. + * + * @param p + * The result of a call to malloc(3), calloc(3), et al. + * + * @param alloc_size + * The size of the attempted allocation. + * + * @discussion + * If {@link p} is NULL, the routine will abort the caller with a message + * indicating the nature of the failure in the Application Specific Information + * section of the resulting crash log. + */ +API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +OS_ALWAYS_INLINE +static inline void +os_assert_malloc(const char *desc, const void *const p, size_t alloc_size) +{ + if (!p) { + os_crash("allocation failed: obj = %s, size = %lu, error = %s", + desc, alloc_size, strerror(errno)); + } +} + +/*! + * @function os_assert_mach + * A routine to assert the result of a Mach kernel routine. + * + * @param op + * A human-readable description of the operation. + * + * @param kr + * The return code. + * + * @discsussion + * If {@link kr} is non-zero, this routine will abort the caller with a message + * indicating the nature of the failure in the Application Specific Information + * section of the resulting crash log. + */ +API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +OS_EXPORT OS_NONNULL1 OS_COLD +void +os_assert_mach(const char *op, kern_return_t kr); + +#define os_assert_mach(op, kr) ({ \ + kern_return_t __kr = (kr); \ + if (os_unlikely(__kr != KERN_SUCCESS)) os_assert_mach(op, kr); \ +}) + +/*! + * @function os_assert_mach_port_status + * A routine to assert the status of a Mach port. + * + * @param desc + * A human-readable description of the port's purpose. + * + * @param p + * The port. + * + * @param expected + * A pointer to a mach_port_status_t describing the expected attributes of the + * port. If no particular value is expected for a given field in the structure, + * a sentinel value may be provided for each expected field to indicate that its + * check should be elided. The sentival values are: + * + * mps_pset => UINT32_MAX + * mps_seqno => UINT32_MAX + * mps_mscount => UINT32_MAX + * mps_qlimit => UINT32_MAX + * mps_msgcount => UINT32_MAX + * mps_sorights => UINT32_MAX + * mps_srights => INT32_MAX + * mps_pdrequest => INT32_MAX + * mps_nsrequest => INT32_MAX + * mps_flags => 0 + * + * @discussion + * If there are any mismatches in the expected and actual status of the port, + * the implementation will abort the caller. If status cannot be obtained for + * the given port, the implementation will abort the caller. + */ +API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) +OS_EXPORT +void +os_assert_mach_port_status(const char *desc, mach_port_t p, + mach_port_status_t *expected); + +#else // OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE + +#define os_crash(msg) __os_crash_simple(msg) + +#endif // OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE + +/* + * An executable can register a callback to be made upon a crash using the + * os_set_crash_callback function. If a crash callback is not set, the symbol + * `os_crash_function` will be called in the main binary, if it exists. + */ + +typedef void (*os_crash_callback_t) (const char *); + +/* private: use accessors below */ +extern os_crash_callback_t _os_crash_callback; + +static inline os_crash_callback_t +os_get_crash_callback() { + return _os_crash_callback; +} + +static inline void +os_set_crash_callback(os_crash_callback_t callback) { + _os_crash_callback = callback; +} + +#pragma mark os_assert + +#if defined(OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE) + +#define _os_assert_crash(value, expression) ({ \ + os_crash("assertion failure: \"" expression "\" -> %lld", value); \ +}) + +#define _os_assert_crash_errno(value, expression) ({ \ + os_crash("assertion failure: \"" expression "\" -> %{errno}d", value); \ +}) + +#else // OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE + +#define _os_assert_crash(e, ...) ({ \ + char *_fail_message = _os_assert_log(e); \ + os_crash(_fail_message); \ + free(_fail_message); \ +}) + +#define _os_assert_crash_errno(...) _os_assert_crash(__VA_ARGS__) + +#endif // OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE + +#define __os_assert(e) __extension__({ \ + __typeof__(e) _e = (e); \ + if (os_unlikely(!_e)) { \ + if (os_constant(e)) { __OS_COMPILETIME_ASSERT__((e)); } \ + _os_assert_crash((uint64_t)(uintptr_t)_e, #e); \ + } \ +}) + +#define __os_assert_zero(e) __extension__({ \ + __typeof__(e) _e = (e); \ + if (os_unlikely(_e)) { \ + if (os_constant(e)) { __OS_COMPILETIME_ASSERT__(!(e)); } \ + _os_assert_crash((uint64_t)(uintptr_t)_e, #e); \ + } \ +}) + +/* + * This variant is for use with old-style POSIX APIs that return -1 on failure + * and set errno. If the return code is -1, the value logged will be as though + * os_assert_zero(errno) was used. It encapsulates the following pattern: + * + * int tubes[2]; + * if (pipe(tubes) == -1) { + * (void)os_assert_zero(errno); + * } + */ +#define __posix_assert_zero(e) __extension__({ \ + __typeof__(e) _e = (e); \ + if (os_unlikely(_e == (__typeof__(e))-1)) { \ + _os_assert_crash_errno(errno, #e); \ + } \ +}) + +#if defined(OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE) + +#define __os_assert_msg(e, fmt, ...) __extension__({ \ + __typeof__(e) _e = (e); \ + if (os_unlikely(!_e)) { \ + os_crash("assertion failure: " fmt, ##__VA_ARGS__); \ + } \ +}) + +#define __os_assert_zero_msg(e, fmt, ...) __extension__({ \ + __typeof__(e) _e = (e); \ + if (os_unlikely(_e)) { \ + os_crash("assertion failure (%lld): " fmt, value, ##__VA_ARGS__); \ + } \ +}) + +#define __posix_assert_zero_msg(e, fmt, ...) __extension__({ \ + __typeof__(e) _e = (e); \ + if (os_unlikely(_e == (__typeof__(e))-1)) { \ + os_crash("assertion failure (%{errno}d): " fmt, errno, ##__VA_ARGS__); \ + } \ +}) + +#define __os_assert_N(e) __os_assert(e) +#define __os_assert_Y(...) __os_assert_msg(__VA_ARGS__) +#define __os_assert_zero_N(e) __os_assert_zero(e) +#define __os_assert_zero_Y(...) __os_assert_zero_msg(__VA_ARGS__) +#define __posix_assert_zero_N(e) __posix_assert_zero(e) +#define __posix_assert_zero_Y(...) __posix_assert_zero_msg(__VA_ARGS__) + +#define __os_assert_invoke(function, variant, ...) \ + OS_CONCAT(function, variant)(__VA_ARGS__) + +#define os_assert(...) \ + __os_assert_invoke(__os_assert_, \ + __has_more_than_one_argument(__VA_ARGS__), __VA_ARGS__) +#define os_assert_zero(...) \ + __os_assert_invoke(__os_assert_zero_, \ + __has_more_than_one_argument(__VA_ARGS__), __VA_ARGS__) +#define posix_assert_zero(...) \ + __os_assert_invoke(__posix_assert_zero_, \ + __has_more_than_one_argument(__VA_ARGS__), __VA_ARGS__) + +#else // OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE + +#define os_assert(e) __os_assert(e) +#define os_assert_zero(e) __os_assert_zero(e) +#define posix_assert_zero(e) __posix_assert_zero(e) + +#endif + +#pragma mark os_assumes + + +#define os_assumes(e) __extension__({ \ + __typeof__(e) _e = os_fastpath(e); \ + if (!_e) { \ + if (os_constant(e)) { \ + __OS_COMPILETIME_ASSERT__(e); \ + } \ + _os_assumes_log((uint64_t)(uintptr_t)_e); \ + } \ + _e; \ +}) + +#define os_assumes_zero(e) __extension__({ \ + __typeof__(e) _e = os_slowpath(e); \ + if (_e) { \ + if (os_constant(e)) { \ + __OS_COMPILETIME_ASSERT__(!(e)); \ + } \ + _os_assumes_log((uint64_t)(uintptr_t)_e); \ + } \ + _e; \ +}) + +#define posix_assumes_zero(e) __extension__({ \ + __typeof__(e) _e = os_slowpath(e); \ + if (_e == (__typeof__(e))-1) { \ + _os_assumes_log((uint64_t)(uintptr_t)errno); \ + } \ + _e; \ +}) + +#pragma mark assumes redirection + +/* This is useful for clients who wish for the messages generated by assumes() + * failures to go somewhere other than (or in addition to) the system log. If + * you don't wish for the message to be logged to the system log, then return + * true (to indicate that the message has been handled). If you want the default + * behavior, return false. + */ +typedef bool (*os_redirect_t)(const char *); +struct _os_redirect_assumes_s { + os_redirect_t redirect; +}; + +#define OS_ASSUMES_REDIRECT_SEG "__DATA" +#define OS_ASSUMES_REDIRECT_SECT "__os_assumes_log" + +#define os_redirect_assumes(func) \ + __attribute__((__used__)) \ + __attribute__((__section__(OS_ASSUMES_REDIRECT_SEG "," OS_ASSUMES_REDIRECT_SECT))) \ + static struct _os_redirect_assumes_s _os_redirect_##func = { \ + .redirect = &func, \ + }; + +#pragma mark _ctx variants + +/* + * These are for defining your own assumes()-like wrapper calls so that you can + * log additional information, such as the about-PID, sender, etc. They're + * generally not useful for direct inclusion in your code. + */ + +/* + * The asl_message argument is a _SIMPLE_STRING that, when given to _simple_asl_send(), will + * direct the message to the MessageTracer diagnostic messages store rather than + * the default system log store. + */ +typedef bool (*os_log_callout_t)(_SIMPLE_STRING asl_message, void *ctx, const char *); + + +#define os_assumes_ctx(f, ctx, e) __extension__({ \ + __typeof__(e) _e = os_fastpath(e); \ + if (!_e) { \ + if (os_constant(e)) { \ + __OS_COMPILETIME_ASSERT__(e); \ + } \ + _os_assumes_log_ctx(f, ctx, (uintptr_t)_e); \ + } \ + _e; \ +}) + +#define os_assumes_zero_ctx(f, ctx, e) __extension__({ \ + __typeof__(e) _e = os_slowpath(e); \ + if (_e) { \ + if (os_constant(e)) { \ + __OS_COMPILETIME_ASSERT__(!(e)); \ + } \ + _os_assumes_log_ctx((f), (ctx), (uintptr_t)_e); \ + } \ + _e; \ +}) + +#define posix_assumes_zero_ctx(f, ctx, e) __extension__({ \ + __typeof__(e) _e = os_slowpath(e); \ + if (_e == (__typeof__(e))-1) { \ + _os_assumes_log_ctx((f), (ctx), (uintptr_t)errno); \ + } \ + _e; \ +}) + +#define os_assert_ctx(f, ctx, e) __extension__({ \ + __typeof__(e) _e = os_fastpath(e); \ + if (!_e) { \ + if (os_constant(e)) { \ + __OS_COMPILETIME_ASSERT__(e); \ + } \ + \ + char *_fail_message = _os_assert_log_ctx((f), (ctx), (uint64_t)(uintptr_t)_e); \ + os_crash(_fail_message); \ + free(_fail_message); \ + } \ +}) + +#define os_assert_zero_ctx(f, ctx, e) __extension__({ \ + __typeof__(e) _e = os_slowpath(e); \ + if (_e) { \ + if (os_constant(e)) { \ + __OS_COMPILETIME_ASSERT__(!(e)); \ + } \ +\ + char *_fail_message = _os_assert_log_ctx((f), (ctx), (uint64_t)(uintptr_t)_e); \ + os_crash(_fail_message); \ + free(_fail_message); \ + } \ +}) + +#define posix_assert_zero_ctx(f, ctx, e) __extension__({ \ + __typeof__(e) _e = os_slowpath(e); \ + if (_e == (__typeof__(e))-1) { \ + char *_fail_message = _os_assert_log_ctx((f), (ctx), (uint64_t)(uintptr_t)errno); \ + os_crash(_fail_message); \ + free(_fail_message); \ + } \ +}) + +#pragma mark internal symbols + +__OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0) +OS_COLD OS_NOT_TAIL_CALLED +extern void +_os_crash(const char *); + +__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_6_0) +OS_COLD OS_NOT_TAIL_CALLED +extern void +_os_assumes_log(uint64_t code); + +__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_6_0) +OS_COLD OS_NOT_TAIL_CALLED +extern char * +_os_assert_log(uint64_t code); + +__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_6_0) +OS_COLD OS_NOT_TAIL_CALLED +extern void +_os_assumes_log_ctx(os_log_callout_t callout, void *ctx, uint64_t code); + +__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_6_0) +OS_COLD OS_NOT_TAIL_CALLED +extern char * +_os_assert_log_ctx(os_log_callout_t callout, void *ctx, uint64_t code); + +__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_6_0) +extern void +_os_avoid_tail_call(void); + +__END_DECLS + +#endif /* __OS_ASSUMES_H__ */ diff --git a/os/debug_private.c b/os/debug_private.c new file mode 100644 index 0000000..d38a9a2 --- /dev/null +++ b/os/debug_private.c @@ -0,0 +1,304 @@ +/* Copyright (c) 2012-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include <_simple.h> +#include +#include +#include +#include +#include +#include +#include +#include + +struct os_debug_log_globals_s { + uint64_t start; + os_redirect_t redirect; + int logfd; + bool prepend_timestamp : 1; + bool errors_only : 1; +}; + +// If user picked a filename, use it and only it. +// Otherwise, first try /var/tmp, then $TMPDIR, then give up. +static inline +int +_os_debug_log_open_file(const char *suggestion) +{ + if (suggestion) { + return open(suggestion, O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW | + O_EXCL | O_CLOEXEC, 0644); + } + + int fd; + char filename[PATH_MAX]; + char path[PATH_MAX]; + + snprintf(filename, sizeof(filename), "os_debug_log.%s.%d.log", getprogname(), + getpid()); + + strlcpy(path, "/var/tmp/", sizeof(path)); + if (access(path, W_OK) == 0) { + strlcat(path, filename, sizeof(path)); + fd = open(path, O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW | O_EXCL | + O_CLOEXEC, 0644); + if (fd >= 0) { + return fd; + } + } + + const char *tmpdir = getenv("TMPDIR"); + if (tmpdir) { + strlcpy(path, tmpdir, sizeof(path)); + if (access(path, W_OK) == 0) { + strlcat(path, filename, sizeof(path)); + fd = open(path, O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW | + O_EXCL | O_CLOEXEC, 0644); + if (fd >= 0) { + return fd; + } + } + } + + return -1; +} + +static +void +_os_debug_log_init(void *globals) +{ + struct os_debug_log_globals_s *g = globals; + + g->errors_only = false; + + g->redirect = dlsym(RTLD_MAIN_ONLY, "_os_debug_log_redirect_func"); + + // This is a bit of a hack. LIBDISPATCH_LOG is part of dispatch's API. + // But now all dispatch logging goes through os_debug_log. So we have to + // recognize this env var here in Libc. + // rdar://problem/11685359 tracks deprecating LIBDISPATCH_LOG from dispatch. + char *e = getenv("LIBDISPATCH_LOG"); + if (!e) { + e = getenv("OS_DEBUG_LOG"); + } + + // Default log destination + if (!e || strcmp(e, "YES") == 0) { +#if DEBUG + e = "file"; +#else + e = "syslog"; +#endif + } + + if (strcmp(e, "NO") == 0) { + g->logfd = -1; + g->errors_only = true; + } else if (strcmp(e, "syslog") == 0) { + g->logfd = -1; + } else if (strcmp(e, "stderr") == 0) { + g->logfd = STDERR_FILENO; + } else if (strcmp(e, "stdout") == 0) { + g->logfd = STDOUT_FILENO; + } else if (strcmp(e, "file") == 0) { + g->logfd = _os_debug_log_open_file(NULL); + if (g->logfd == -1) { + g->errors_only = true; + } + } else { + g->logfd = _os_debug_log_open_file(e); + if (g->logfd == -1) { + g->errors_only = true; + } + } + + // From now on, g->logfd == -1 means syslog; anything >= 0 is the + // fd to use. Remember that file descriptor 0 is a perfectly valid + // value for open() to return if you closed (or never had) stdin. + + // Timestamp every log message if logging directly to file and no + // redirector is set up. + if (g->logfd >= 0 && !g->redirect) { + g->prepend_timestamp = true; + + struct timeval tv; + gettimeofday(&tv, NULL); + + g->start = mach_absolute_time(); + + dprintf(g->logfd, + "=== os_debug_log log file opened for %s[%u] at %ld.%06u", + getprogname(), getpid(), + tv.tv_sec, tv.tv_usec); + if (g->prepend_timestamp) { + mach_timebase_info_data_t tbi; + if (mach_timebase_info(&tbi) == 0) { + dprintf(g->logfd, " [ns=ticks*%u/%u]", + tbi.numer, tbi.denom); + } + } + dprintf(g->logfd, " ===\n"); + } +} + +#ifndef OS_ALLOC_ONCE_KEY_OS_DEBUG_LOG +#define OS_ALLOC_ONCE_KEY_OS_DEBUG_LOG OS_ALLOC_ONCE_KEY_OS_TRACE +#endif + +static inline OS_CONST +struct os_debug_log_globals_s * +os_debug_log_globals(void) +{ + return (struct os_debug_log_globals_s *) + os_alloc_once(OS_ALLOC_ONCE_KEY_OS_DEBUG_LOG, + sizeof(struct os_debug_log_globals_s), + _os_debug_log_init); +} + +static __attribute__((always_inline)) +uint64_t +_os_debug_log_ticks_since_start(void) +{ + return mach_absolute_time() - os_debug_log_globals()->start; +} + +// False on error writing to file +static inline +bool +_os_debug_log_write_fd(int level __attribute__((__unused__)), + char *str, int fd) +{ + size_t len = strlen(str); + + str[len++] = '\n'; // overwrite null - don't use str*() anymore + + ssize_t rc, wlen = 0; + do { + rc = write(fd, &str[wlen], len - wlen); + if (os_slowpath(rc == -1)) { + if(errno == EINTR) { + rc = 0; + } else { + return false; + } + } + wlen += rc; + } while (wlen < len); + + return true; +} + +static __attribute__((__noinline__)) +void +_os_debug_log_write_error(void) +{ + char err_str[256]; + const char *pfx = "os_debug_log() :"; + size_t pfxlen = strlen(pfx); + + strlcpy(err_str, pfx, sizeof(err_str)); + strerror_r(errno, err_str+pfxlen, sizeof(err_str)-pfxlen); + _simple_asl_log(LOG_ERR, "com.apple.os_debug_log", err_str); +} + +static inline +void +_os_debug_log_write(int level, char *str) +{ + int fd = os_debug_log_globals()->logfd; + os_redirect_t rdr = os_debug_log_globals()->redirect; + // true = redirect has fully handled, don't log + if (os_slowpath(rdr) && os_fastpath(rdr(str))) { + return; + } + if (os_slowpath(fd >= 0)) { + if (os_fastpath(_os_debug_log_write_fd(level, str, fd))) { + return; + } else { + _os_debug_log_write_error(); + os_debug_log_globals()->logfd = -1; + // Don't return, fall out to syslog(). + } + } + _simple_asl_log(level, "com.apple.os_debug_log", str); +} + +static __attribute__((always_inline)) +void +_os_debug_logv(int level, const char *msg, va_list ap) +{ + if (os_slowpath((bool)os_debug_log_globals()->errors_only) && level > LOG_ERR) { + // more important = lower integer + return; + } + char *buf, *freebuf; + size_t len; + + len = vasprintf(&buf, msg, ap); + if (!buf) { + return; + } + freebuf = buf; + + // The os_debug_log macros prepend many spaces to the format string. + // Overwrite them with a timestamp, *or* skip them. + const size_t pfxlen = strlen(_OS_DEBUG_LOG_PREFIX); + const size_t timelen = 16; + __OS_COMPILETIME_ASSERT__(pfxlen >= timelen); + + if (os_fastpath(len > pfxlen)) { + if (os_slowpath((bool)os_debug_log_globals()->prepend_timestamp)) { + char tmp = buf[timelen]; + snprintf(buf, timelen + 1, "%16llu", _os_debug_log_ticks_since_start()); + buf[timelen] = tmp; // snprintf's null + } else { + buf += pfxlen; + } + } + + _os_debug_log_write(level, buf); + free(freebuf); +} + +void +_os_debug_log_error_str(char *msg) +{ + _os_debug_log_write(LOG_ERR, msg); +} + +OS_FORMAT_PRINTF(1, 2) +void +_os_debug_log(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + _os_debug_logv(LOG_DEBUG, msg, ap); + va_end(ap); +} diff --git a/os/debug_private.h b/os/debug_private.h new file mode 100644 index 0000000..c4b1ced --- /dev/null +++ b/os/debug_private.h @@ -0,0 +1,79 @@ +/* Copyright (c) 2012-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __OS_DEBUG_LOG_H__ +#define __OS_DEBUG_LOG_H__ + +#include +#include + +#include +#include + +__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_6_0) +OS_FORMAT_PRINTF(1, 2) OS_COLD +extern void +_os_debug_log(const char *msg, ...); + +/* The os_debug_log macros insert spaces before the message. If logging to a file, + * the spaces will be replaced by a timestamp. If logging to syslog, they will + * be skipped (syslog knows what time it is). There are 20 spaces because the + * timestamp is printed as %16llu + 4 spaces before the next column. + * 10^16 ns = 3.8 months. Don't run your process in _debug for that long. This + * isn't syslog. + */ +#define _OS_DEBUG_LOG_PREFIX " " + +#define os_debug_log(tag, fmt, ...) __extension__({\ + _os_debug_log(_OS_DEBUG_LOG_PREFIX "%s: " fmt, tag, ## __VA_ARGS__); \ +}) + +#define os_debug_log_ctx(tag, ctx, fmt, ...) __extension__({\ + _os_debug_log(_OS_DEBUG_LOG_PREFIX "[%p] %s: " fmt, ctx, tag, ## __VA_ARGS__); \ +}) + +/* This is useful for clients who wish for the messages generated by os_debug_log() + * or os_assumes() failures to go somewhere other than (or in addition to) the + * system log, for example launchd or syslogd itself. If you don't wish for the + * message to be logged to the system log, then return true (to indicate that + * the message has been handled). If you want the default behavior, return + * false. Please use this macro, rather than directly declaring a function, + * since the declaration magic may change in the future. + */ +#define os_debug_log_redirect(func) \ + __attribute__((__used__)) \ + __attribute__((__cold__)) \ + __attribute__((__visibility__("default"))) \ + bool _os_debug_log_redirect_func(const char *msg) { \ + return func(msg); \ + } + +# pragma mark - +# pragma mark Private To Libc + +// str must be modifiable (non-const)! +__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_6_0) +OS_COLD +extern void +_os_debug_log_error_str(char *str); + +#endif /* __OS_DEBUG_LOG_H__ */ diff --git a/os/linker_set.h b/os/linker_set.h new file mode 100644 index 0000000..2bf02a2 --- /dev/null +++ b/os/linker_set.h @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2006-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + * + * + * Copyright (c) 1999 John D. Polstra + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#ifndef _SYS_LINKER_SET_H_ +#define _SYS_LINKER_SET_H_ + +#include +#if !defined(KERNEL) || defined(__APPLE_API_PRIVATE) + +/* + * The following macros are used to declare global sets of objects, which + * are collected by the linker into a `linker set' as defined below. + * For Mach-O, this is done by constructing a separate segment inside the + * __DATA section for each set. The contents of this segment are an array + * of pointers to the objects in the set. + * + * Note that due to limitations of the Mach-O format, there cannot + * be more than 255 sections in a segment, so linker set usage should be + * conserved. Set names may not exceed 16 characters. + */ + +#ifdef KERNEL +# include +# include + +# define MACH_HEADER_TYPE kernel_mach_header_t +# define GETSECTIONDATA_VARIANT getsectdatafromheader +# define SECTDATA_SIZE_TYPE unsigned long +# define MH_EXECUTE_HEADER &_mh_execute_header +# define IMAGE_SLIDE_CORRECT 0 +#else +# include +# include +# include +# include + +# if __LP64__ +# define MACH_HEADER_TYPE struct mach_header_64 +# define GETSECTIONDATA_VARIANT getsectdatafromheader_64 +# define SECTDATA_SIZE_TYPE uint64_t +# define MH_EXECUTE_HEADER _NSGetMachExecuteHeader() +# else +# define MACH_HEADER_TYPE struct mach_header +# define GETSECTIONDATA_VARIANT getsectdatafromheader +# define SECTDATA_SIZE_TYPE uint32_t +# define MH_EXECUTE_HEADER _NSGetMachExecuteHeader() +# endif +#endif + + +/* + * Private macros, not to be used outside this header file. + * + * The objective of this macro stack is to produce the following output, + * given SET and SYM as arguments: + * + * void const * __set_SET_sym_SYM __attribute__((section("__DATA,SET"))) = & SYM + */ + +/* Wrap entries in a type that can be blacklisted from KASAN */ +struct linker_set_entry { + void *ptr; +} __attribute__((packed)); + +#ifdef __LS_VA_STRINGIFY__ +# undef __LS_VA_STRINGIFY__ +#endif +#ifdef __LS_VA_STRCONCAT__ +# undef __LS_VA_STRCONCAT__ +#endif +#define __LS_VA_STRINGIFY(_x ...) #_x +#define __LS_VA_STRCONCAT(_x, _y) __LS_VA_STRINGIFY(_x,_y) +#define __LINKER_MAKE_SET(_set, _sym) \ + /*__unused*/ /*static*/ const struct linker_set_entry /*const*/ __set_##_set##_sym_##_sym \ + __attribute__ ((section(__LS_VA_STRCONCAT(__DATA,_set)),used)) = { (void *)&_sym } +/* the line above is very fragile - if your compiler breaks linker sets, + * just play around with "static", "const", "used" etc. :-) */ + +/* + * Public macros. + */ +#define LINKER_SET_ENTRY(_set, _sym) __LINKER_MAKE_SET(_set, _sym) + +/* + * FreeBSD compatibility. + */ +#ifdef __APPLE_API_OBSOLETE +# define TEXT_SET(_set, _sym) __LINKER_MAKE_SET(_set, _sym) +# define DATA_SET(_set, _sym) __LINKER_MAKE_SET(_set, _sym) +# define BSS_SET(_set, _sym) __LINKER_MAKE_SET(_set, _sym) +# define ABS_SET(_set, _sym) __LINKER_MAKE_SET(_set, _sym) +# define SET_ENTRY(_set, _sym) __LINKER_MAKE_SET(_set, _sym) +#endif /* __APPLE_API_OBSOLETE */ + +/* + * Extended linker set API. + * + * Since linker sets are per-object-file, and we may have multiple + * object files, we need to be able to specify which object's set + * to scan. + * + * The set itself is a contiguous array of pointers to the objects + * within the set. + */ + +/* + * Public interface. + * + * void **LINKER_SET_OBJECT_BEGIN(_object, _set) + * Preferred interface to linker_set_object_begin(), takes set name unquoted. + * void **LINKER_SET_OBJECT_LIMIT(_object, _set) + * Preferred interface to linker_set_object_begin(), takes set name unquoted. + * LINKER_SET_OBJECT_FOREACH(_object, (set_member_type **)_pvar, _cast, _set) + * Iterates over the members of _set within _object. Since the set contains + * pointers to its elements, for a set of elements of type etyp, _pvar must + * be (etyp **). + * LINKER_SET_FOREACH((set_member_type **)_pvar, _cast, _set) + * + * Example of _cast: For the _pvar "struct sysctl_oid **oidpp", _cast would be + * "struct sysctl_oid **" + * + */ + +#define LINKER_SET_OBJECT_BEGIN(_object, _set) __linker_set_object_begin(_object, _set) +#define LINKER_SET_OBJECT_LIMIT(_object, _set) __linker_set_object_limit(_object, _set) + +#define LINKER_SET_OBJECT_FOREACH(_object, _pvar, _cast, _set) \ + for (_pvar = (_cast) LINKER_SET_OBJECT_BEGIN(_object, _set); \ + _pvar < (_cast) LINKER_SET_OBJECT_LIMIT(_object, _set); \ + _pvar++) + +#define LINKER_SET_OBJECT_ITEM(_object, _cast, _set, _i) \ + (((_cast)(LINKER_SET_OBJECT_BEGIN(_object, _set)))[_i]) + +#define LINKER_SET_FOREACH(_pvar, _cast, _set) \ + LINKER_SET_OBJECT_FOREACH((MACH_HEADER_TYPE *)MH_EXECUTE_HEADER, _pvar, _cast, _set) + +/* + * Implementation. + * + * void **__linker_set_object_begin(_header, _set) + * Returns a pointer to the first pointer in the linker set. + * void **__linker_set_object_limi(_header, _set) + * Returns an upper bound to the linker set (base + size). + */ + +static __inline intptr_t +__linker_get_slide(struct mach_header *_header) +{ +#ifndef KERNEL + /* + * Gross. + * + * We cannot get the image slide directly from the header, so we need to + * determine the image's index and ask for the slide of that index. + */ + uint32_t i = 0; + for (i = 0; i < _dyld_image_count(); i++) { + const struct mach_header *hdr = _dyld_get_image_header(i); + if (_header == hdr) { + return _dyld_get_image_vmaddr_slide(i); + } + } + return 0; +#else + return 0; +#endif +} + +static __inline void ** +__linker_set_object_begin(MACH_HEADER_TYPE *_header, const char *_set) +__attribute__((__const__)); +static __inline void ** +__linker_set_object_begin(MACH_HEADER_TYPE *_header, const char *_set) +{ + void *_set_begin; + SECTDATA_SIZE_TYPE _size; + + _set_begin = GETSECTIONDATA_VARIANT(_header, "__DATA", _set, &_size); + _set_begin += __linker_get_slide((struct mach_header *)_header); + return (void **) _set_begin; +} + +static __inline void ** +__linker_set_object_limit(MACH_HEADER_TYPE *_header, const char *_set) +__attribute__((__const__)); +static __inline void ** +__linker_set_object_limit(MACH_HEADER_TYPE *_header, const char *_set) +{ + void *_set_begin; + SECTDATA_SIZE_TYPE _size; + + _set_begin = GETSECTIONDATA_VARIANT(_header, "__DATA", _set, &_size); + _set_begin += __linker_get_slide((struct mach_header *)_header); + + return (void **) ((uintptr_t) _set_begin + _size); +} + +#endif /* !KERNEL || __APPLE_API_PRIVATE */ + +#endif /* _SYS_LINKER_SET_H_ */ diff --git a/os/variant_private.h b/os/variant_private.h new file mode 100644 index 0000000..5d6113e --- /dev/null +++ b/os/variant_private.h @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2017 Apple Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ + +#ifndef __OS_VARIANT_H__ +#define __OS_VARIANT_H__ + +#include + +#include +#include + +/*! @header + * OS Variant SPI + * + * Provides a mechanism to determine the currently running OS variant. + * + * Any of these APIs may be overridden to its non-internal behavior on a + * device by creating on override file. On macOS, the path of this file + * is: + * /var/db/os_variant_override + * On embedded platforms, the path of the override file is: + * /usr/share/misc/os_variant_override + * + * Individual internal behaviors can be selectively disabled (ie. + * individual os_variant_has_internal_*() predicates can be overriden to + * false) by writing the file with a comma- or newline-delimited list of + * behaviors to disable. To disable all internal behaviors, empty the file. + * + * There is currently no support for configuring per-subsystem overrides. + * + * Examples: + * This will disable internal diagnostics and UI on macOS: + * sudo sh -c 'echo "diagnostics,ui" > /var/db/os_variant_override' + * This will disable internal UI on iOS (assuming logged in as root): + * echo "ui" > /usr/share/misc/os_variant_override + * This will disable all internal behaviors on macOS: + * sudo sh -c '/bin/echo -n > /var/db/os_variant_override' + * + * Note that the values returned by these APIs are cached in the kernel at + * system boot. A reboot will be required after changing the overrides + * before the new settings will take effect. + * + * Each of these functions takes a constant string argument for the requesting + * subsystem. This should be a reverse-DNS string describing the subsystem + * performing the check. This may be used in the future for auditing and + * selective overriding of checks. + * + */ + +__BEGIN_DECLS + +/*! + * @function os_variant_has_internal_content + * + * @abstract returns whether this system variant has internal content installed + * ("content") + * + * @result + * Returns true if this build has this property. False otherwise or upon error. + */ +API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0)) +OS_EXPORT OS_WARN_RESULT +bool +os_variant_has_internal_content(const char *subsystem); + +/*! + * @function os_variant_has_internal_diagnostics + * + * @abstract returns whether this system variant has internal diagnostics + * enabled ("diagnostics") + * + * @description + * + * Internal diagnostics include behaviors that emit extra diagnostic or + * debugging information when an error occurs. + * + * On macOS, this check will look for presence of AppleInternal content or the + * AppleInternalDiagnostics profile to be installed. + * + * On embedded platforms, this check will look for an internal install variant + * in a manner similar to the MobileGestalt check for InternalBuild. + * + * @result + * Returns true if this build has this property. False otherwise or upon error. + */ +API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0)) +OS_EXPORT OS_WARN_RESULT +bool +os_variant_has_internal_diagnostics(const char *subsystem); + +/*! + * @function os_variant_has_internal_ui + * + * @abstract returns whether this system variant has internal UI visible ("ui") + * + * @description + * + * Internal UI includes debug menus and internal settings. + * + * On macOS, this will check for the presence of AppleInternal content. On + * embedded platforms, this check will look for an internal install variant in + * a manner similar to the MobileGestalt check for InternalBuild. + * + * @result + * Returns true if this build has this property. False otherwise or upon error. + */ +API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0)) +OS_EXPORT OS_WARN_RESULT +bool +os_variant_has_internal_ui(const char *subsystem); + +/*! + * @function os_variant_allows_internal_security_policies + * + * @abstract returns whether this system variant allows internal security policies + * ("security") + * + * @description + * + * On macOS, this will check the CSR status for whether AppleInternal policies + * are enabled. + * + * On embedded platforms, this will check for a build/device combination that + * allows for removal of codesigning and debugging restrictions. This usually + * returns whether the hardware is development fused and may return true on + * such hardware even if a customer build is installed. + * + * n.b. The result of this API should /not/ be used to automatically enable + * relaxed security policies, only to signal that other mechanisms to enable + * them are allowed, e.g. a "defaults write". + * + * @result + * Returns true if this build has this property. False otherwise or upon error. + */ +API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0)) +OS_EXPORT OS_WARN_RESULT +bool +os_variant_allows_internal_security_policies(const char *subsystem); + +/*! + * @function os_variant_has_factory_content + * + * @abstract returns whether this system has factory diagnostics content + * + * @description + * + * On macOS, this checks for a AppleFactoryVariant.plist that is present in the + * factory diagnostics image. + * + * On embedded platforms, this will check for the NonUI variant. + * + * @result + * Returns true if this build has this property. False otherwise or upon error. + */ +API_AVAILABLE(macosx(10.14.4), ios(12.2), tvos(12.2), watchos(5.2)) +OS_EXPORT OS_WARN_RESULT +bool +os_variant_has_factory_content(const char *subsystem); + +/*! + * @function os_variant_is_darwinos + * + * @abstract returns whether this system variant is a darwinOS variant + * + * @result + * Returns true if this variant is a darwinOS variant. + */ +API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0)) +OS_EXPORT OS_WARN_RESULT +bool +os_variant_is_darwinos(const char *subsystem); + +/*! + * @function os_variant_uses_ephemeral_storage + * + * @abstract returns whether the system is booted from an ephermeral volume + * + * @result + * Returns true if the system is booted with ephemeral storage for the data volume. + */ +API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0)) +OS_EXPORT OS_WARN_RESULT +bool +os_variant_uses_ephemeral_storage(const char *subsystem); + +/*! + * @function os_variant_is_recovery + * + * @abstract returns whether this system variant is the recovery OS. + * + * @description + * On macOS, this returns whether the running environment is the BaseSystem. + * This will be true in the installer and recovery environments. On embedded + * platforms, this returns whether this is the NeRD (Network Recovery on + * Device) OS. + * + * @result + * Returns true if this variant is a recoveryOS + */ +API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0)) +OS_EXPORT OS_WARN_RESULT +bool +os_variant_is_recovery(const char *subsystem); + +/*! + * @function os_variant_check + * + * @abstract returns whether the system is of the specified variant + * + * @description + * This check checks against below known variants. False is returned if the + * variant passed in is not in the list. + * + * HasInternalContent + * HasInternalDiagnostics + * HasInternalUI + * AllowsInternalSecurityPolicies + * HasFactoryContent + * IsDarwinOS + * UsesEphemeralStorage + * IsRecovery + * + * @result + * Returns true if the system is of the specified variant. + */ +API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0)) +OS_EXPORT OS_WARN_RESULT +bool +os_variant_check(const char *subsystem, const char *variant); + +__END_DECLS + +#endif // __os_variant_H__ diff --git a/posix1e/CMakeLists.txt b/posix1e/CMakeLists.txt new file mode 100644 index 0000000..a8911f0 --- /dev/null +++ b/posix1e/CMakeLists.txt @@ -0,0 +1,14 @@ +project(libc-posix1e) + +cmake_minimum_required(VERSION 3.10) + +set(posix1e_sources + acl.c + acl_entry.c + acl_file.c + acl_flag.c + acl_perm.c + acl_translate.c # doesn't build, ducted +) + +add_library(libc-posix1e OBJECT ${posix1e_sources}) diff --git a/posix1e/acl.3 b/posix1e/acl.3 new file mode 100644 index 0000000..039669a --- /dev/null +++ b/posix1e/acl.3 @@ -0,0 +1,215 @@ +.\"- +.\" Copyright (c) 2000, 2001, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl.3,v 1.22 2003/02/06 11:04:46 charnier Exp $ +.\" +.Dd December 18, 2002 +.Dt ACL 3 +.Os +.Sh NAME +.Nm acl +.Nd introduction to the POSIX.1e ACL security API +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Sh DESCRIPTION +The system permits file systems to export Access Control Lists via the VFS, and +provides a library for userland access to and manipulation of these ACLs. +Not all file systems provide support for ACLs, and some may require that +ACL support be explicitly enabled by the administrator. +The library calls include routines to allocate, duplicate, retrieve, set, +and validate ACLs associated with file objects. +.Pp +This implementation of the POSIX.1e library differs from the standard +in a number of non-portable ways in order to support the MacOS/Darwin +ACL semantic. Where possible, these differences are implemented using +the mechanisms provided in the standard for such extensions. +Where routines are non-standard, they are suffixed with _np to indicate that +they are not portable. +.Pp +POSIX.1e describes a set of ACL manipulation routines to manage the +contents of ACLs, as well as their relationships with files; almost +all of these support routines are implemented. +.Pp +Available functions, sorted by behavior, include: +.Bl -tag -width indent +.It Fn acl_add_perm +This function is described in +.Xr acl_add_perm 3 , +and may be used to add permissions to a permission set. +.It Fn acl_clear_perms +This function is described in +.Xr acl_clear_perms 3 , +and may be used to clear all permissions from a permission set. +.It Fn acl_copy_entry +This function is described in +.Xr acl_copy_entry 3 , +and may be used to copy the contents of an ACL entry. +.It Fn acl_create_entry +This function is described in +.Xr acl_create_entry 3 , +and may be used to create an empty entry in an ACL. +.It Fn acl_delete_entry +This function is described in +.Xr acl_delete_entry 3 , +and may be used to delete an entry from an ACL. +.It Fn acl_delete_perm +This function is described in +.Xr acl_delete_perm 3 , +and may be used to delete permissions from a permset. +.It Fn acl_dup +This function is described in +.Xr acl_dup 3 , +and may be used to duplicate an ACL structure. +.It Fn acl_free +This function is described in +.Xr acl_free 3 , +and may be used to free userland working ACL storage. +.It Fn acl_from_text +This function is described in +.Xr acl_from_text 3 , +and may be used to convert a text-form ACL into working ACL state, if +the ACL has POSIX.1e semantics. +.It Fn acl_get_entry +This function is described in +.Xr acl_get_entry 3 , +and may be used to retrieve a designated ACL entry from an ACL. +.It Xo +.Fn acl_get_fd , +.Fn acl_get_fd_np , +.Fn acl_get_file , +.Fn acl_get_link_np +.Xc +These functions are described in +.Xr acl_get 3 , +and may be used to retrieve ACLs from file system objects. +.It Fn acl_get_permset +This function is described in +.Xr acl_get_permset 3 , +and may be used to retrieve a permset from an ACL entry. +.It Fn acl_get_qualifier +This function is described in +.Xr acl_get_qualifier 3 , +and may be used to retrieve the qualifier from an ACL entry. +.It Fn acl_get_tag_type +This function is described in +.Xr acl_get_tag_type 3 , +and may be used to retrieve the tag type from an ACL entry. +.It Fn acl_init +This function is described in +.Xr acl_init 3 , +and may be used to allocate a fresh (empty) ACL structure. +.It Xo +.Fn acl_set_fd , +.Fn acl_set_fd_np , +.Fn acl_set_file , +.Fn acl_set_link_np +.Xc +These functions are described in +.Xr acl_set 3 , +and may be used to assign an ACL to a file system object. +.It Fn acl_set_permset +This function is described in +.Xr acl_set_permset 3 , +and may be used to set the permissions of an ACL entry from a permset. +.It Fn acl_set_qualifier +This function is described in +.Xr acl_set_qualifier 3 , +and may be used to set the qualifier of an ACL. +.It Fn acl_set_tag_type +This function is described in +.Xr acl_set_tag_type 3 , +and may be used to set the tag type of an ACL. +.It Fn acl_to_text +This function is described in +.Xr acl_to_text 3 , +and may be used to generate a text-form of a POSIX.1e semantics ACL. +.It Xo +.Fn acl_valid , +.Fn acl_valid_fd_np , +.Fn acl_valid_file_np , +.Fn acl_valid_link_np +.Xc +These functions are described in +.Xr acl_valid 3 , +and may be used to validate an ACL as correct POSIX.1e-semantics, or +as appropriate for a particular file system object regardless of semantics. +.El +.Pp +The syscalls between the internal interfaces and the public library +routines may change over time, and as such are not documented. +They are not intended to be called directly without going through the +library. +.Sh SEE ALSO +.\".Xr getfacl 1 , +.\".Xr setfacl 1 , +.Xr ls 1 , +.Xr chmod 1 , +.Xr acl_add_perm 3 , +.Xr acl_clear_perms 3 , +.Xr acl_copy_entry 3 , +.Xr acl_create_entry 3 , +.Xr acl_delete_entry 3 , +.Xr acl_delete_perm 3 , +.Xr acl_dup 3 , +.Xr acl_free 3 , +.Xr acl_from_text 3 , +.Xr acl_get 3 , +.Xr acl_get_permset 3 , +.Xr acl_get_qualifier 3 , +.Xr acl_get_tag_type 3 , +.Xr acl_init 3 , +.Xr acl_set 3 , +.Xr acl_set_permset 3 , +.Xr acl_set_qualifier 3 , +.Xr acl_set_tag_type 3 , +.Xr acl_to_text 3 , +.Xr acl_valid 3 , +.Xr posix1e 3 +.Sh UNSUPPORTED FUNCTIONS +.Xr acl_calc_mask 3 , +.Fn acl_delete_def_file +.Sh STANDARDS +POSIX.1e assigns security labels to all objects, extending the security +functionality described in POSIX.1. +These additional labels provide fine-grained discretionary access control, +fine-grained capabilities, and labels necessary for mandatory access +control. +POSIX.2c describes a set of userland utilities for manipulating these +labels. +.Pp +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh HISTORY +This manpage is closely derived from the +.Fx +manpage by +.An Robert N M Watson +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl.c b/posix1e/acl.c new file mode 100644 index 0000000..8314de7 --- /dev/null +++ b/posix1e/acl.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "aclvar.h" + +acl_t +acl_dup(acl_t acl) +{ + struct _acl *ap; + + if (!_ACL_VALID_ACL(acl)) { + errno = EINVAL; + return(NULL); + } + + if ((ap = malloc(sizeof(*ap))) != NULL) + bcopy(acl, ap, sizeof(*ap)); + return(ap); +} + +int +acl_free(void *obj) +{ + /* + * Without tracking the addresses of text buffers and qualifiers, + * we can't validate the obj argument here at all. + */ + if(obj != _FILESEC_REMOVE_ACL) + free(obj); + return(0); +} + +acl_t +acl_init(int count) +{ + struct _acl *ap; + + /* validate count */ + if (count < 0) { + errno = EINVAL; + return(NULL); + } + if (count > ACL_MAX_ENTRIES) { + errno = ENOMEM; + return(NULL); + } + + if ((ap = malloc(sizeof (*ap))) != NULL) { + bzero(ap, sizeof(*ap)); + ap->a_magic = _ACL_ACL_MAGIC; + ap->a_last_get = -1; + } + return(ap); +} + +int +acl_valid(acl_t acl) +{ + _ACL_VALIDATE_ACL(acl); + + /* XXX */ + return(0); +} + +int +acl_valid_fd_np(int fd, acl_type_t type, acl_t acl) +{ + errno = ENOTSUP; /* XXX */ + return(-1); +} + +int +acl_valid_file_np(const char *path, acl_type_t type, acl_t acl) +{ + errno = ENOTSUP; /* XXX */ + return(-1); +} + +int +acl_valid_link(const char *path, acl_type_t type, acl_t acl) +{ + errno = ENOTSUP; /* XXX */ + return(-1); +} + +/* + * Not applicable; not supportedl + */ +int +acl_calc_mask(__unused acl_t *acl_p) +{ + errno = ENOTSUP; + return(-1); +} diff --git a/posix1e/acl_add_flag_np.3 b/posix1e/acl_add_flag_np.3 new file mode 100644 index 0000000..556e659 --- /dev/null +++ b/posix1e/acl_add_flag_np.3 @@ -0,0 +1,79 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_add_perm.3,v 1.6 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_ADD_FLAG_NP 3 +.Os +.Sh NAME +.Nm acl_add_flag_np +.Nd add flags to an flag set +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_add_flag_np "acl_flagset_t flagset_d" "acl_flag_t flag" +.Sh DESCRIPTION +The +.Fn acl_add_flag_np +function +is a nonstandard extension that adds the flag contained in +.Fa flag +to the flag set +.Fa flagset_d . +.Pp +Note: it is not considered an error to attempt to add flags +that already exist in the flag set. +.Sh RETURN VALUES +.Rv -std acl_add_flags_np +.Sh ERRORS +The +.Fn acl_add_flags_np +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa flagset_d +is not a valid descriptor for a flag set. +Argument +.Fa flag +does not contain an +.Vt acl_flag_t +value valid for the flagset +.Fa flagset_d . +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_clear_entry_flagset_np 3 , +.Xr acl_delete_entry_flag_np 3 , +.Xr acl_get_entry_flagset_np 3 , +.Xr acl_set_entry_permset_np 3 , +.Xr posix1e 3 +.Sh AUTHORS +.An Michael Smith +.An Chris D Fulhaber diff --git a/posix1e/acl_add_perm.3 b/posix1e/acl_add_perm.3 new file mode 100644 index 0000000..aeccc92 --- /dev/null +++ b/posix1e/acl_add_perm.3 @@ -0,0 +1,80 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_add_perm.3,v 1.6 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_ADD_PERM 3 +.Os +.Sh NAME +.Nm acl_add_perm +.Nd add permissions to a permission set +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_add_perm "acl_permset_t permset_d" "acl_perm_t perm" +.Sh DESCRIPTION +The +.Fn acl_add_perm +function +is a POSIX.1e call that adds the permission contained in +.Fa perm +to the permission set +.Fa permset_d . +.Pp +Note: it is not considered an error to attempt to add permissions +that already exist in the permission set. +.Sh RETURN VALUES +.Rv -std acl_add_perm +.Sh ERRORS +The +.Fn acl_add_perm +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa permset_d +is not a valid descriptor for a permission set within an ACL entry. +Argument +.Fa perm +does not contain a valid +.Vt acl_perm_t +value. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_clear_perms 3 , +.Xr acl_delete_perm 3 , +.Xr acl_get_permset 3 , +.Xr acl_set_permset 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D Fulhaber diff --git a/posix1e/acl_clear_flags_np.3 b/posix1e/acl_clear_flags_np.3 new file mode 100644 index 0000000..04bbb1b --- /dev/null +++ b/posix1e/acl_clear_flags_np.3 @@ -0,0 +1,67 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_clear_perms.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_CLEAR_FLAGS_NP 3 +.Os +.Sh NAME +.Nm acl_clear_flags_np +.Nd clear flags from a flag set +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_clear_flags_np "acl_flagset_t flagset_d" +.Sh DESCRIPTION +The +.Fn acl_clear_flags_np +function +is a nonstandard extension that clears all flags from flag set +.Fa flagset_d . +.Sh RETURN VALUES +.Rv -std acl_clear_flags_np +.Sh ERRORS +The +.Fn acl_clear_flags_np +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa flagset_d +is not a valid descriptor for a flag set. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_flag_np 3 , +.Xr acl_delete_flag_np 3 , +.Xr acl_get_flagset_np 3 , +.Xr acl_set_flagset_np 3 +.Sh AUTHORS +.An Michael Smith +.An Chris D Fulhaber diff --git a/posix1e/acl_clear_perms.3 b/posix1e/acl_clear_perms.3 new file mode 100644 index 0000000..ab82e9d --- /dev/null +++ b/posix1e/acl_clear_perms.3 @@ -0,0 +1,70 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_clear_perms.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_CLEAR_PERMS 3 +.Os +.Sh NAME +.Nm acl_clear_perms +.Nd clear permissions from a permission set +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_clear_perms "acl_permset_t permset_d" +.Sh DESCRIPTION +The +.Fn acl_clear_perms +function +is a POSIX.1e call that clears all permissions from permissions set +.Fa permset_d . +.Sh RETURN VALUES +.Rv -std acl_clear_perms +.Sh ERRORS +The +.Fn acl_clear_perms +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa permset_d +is not a valid descriptor for a permission set. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_perm 3 , +.Xr acl_delete_perm 3 , +.Xr acl_get_permset 3 , +.Xr acl_set_permset 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D Fulhaber diff --git a/posix1e/acl_copy_entry.3 b/posix1e/acl_copy_entry.3 new file mode 100644 index 0000000..efc4433 --- /dev/null +++ b/posix1e/acl_copy_entry.3 @@ -0,0 +1,76 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_copy_entry.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_COPY_ENTRY 3 +.Os +.Sh NAME +.Nm acl_copy_entry +.Nd copy an ACL entry to another ACL entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_copy_entry "acl_entry_t dest_d" "acl_entry_t src_d" +.Sh DESCRIPTION +The +.Fn acl_copy_entry +function +is a POSIX.1e call that copies the contents of ACL entry +.Fa src_d +to ACL entry +.Fa dest_d . +.Sh RETURN VALUES +.Rv -std acl_copy_entry +.Sh ERRORS +The +.Fn acl_copy_entry +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa src_d +or +.Fa dest_d +is not a valid descriptor for an ACL entry, or +arguments +.Fa src_d +and +.Fa dest_d +reference the same ACL entry. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_get_entry 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D Fulhaber diff --git a/posix1e/acl_copy_ext.3 b/posix1e/acl_copy_ext.3 new file mode 100644 index 0000000..9ac17fe --- /dev/null +++ b/posix1e/acl_copy_ext.3 @@ -0,0 +1,174 @@ +.Dd February 3, 2011 +.Dt ACL_COPY_EXT 3 +.Sh NAME +.Nm acl_copy_ext , +.Nm acl_copy_ext_native , +.Nm acl_copy_int , +.Nm acl_copy_int_native, +.Nm acl_size +.Nd convert an ACL to and from an external representation +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft ssize_t +.Fo acl_copy_ext +.Fa "void *buf" +.Fa "acl_t acl" +.Fa "ssize_t size" +.Fc +.Ft ssize_t +.Fo acl_copy_ext_native +.Fa "void *buf" +.Fa "acl_t acl" +.Fa "ssize_t size" +.Fc +.Ft acl_t +.Fo acl_copy_int +.Fa "const void *buf" +.Fc +.Ft acl_t +.Fo acl_copy_int_native +.Fa "const void *buf" +.Fc +.Ft ssize_t +.Fo acl_size +.Fa "acl_t acl" +.Fc +.Sh DESCRIPTION +The +.Fn acl_copy_ext +and +.Fn acl_copy_ext_native +functions convert the ACL given by the argument +.Fa acl +into a binary external representation that can be saved to a file, +passed to another program, etc. +This external representation is written to the buffer pointed to by the argument +.Fa buf , +which is assumed to have at least the number of contiguous bytes passed in the +.Fa size +argument. +The number of bytes actually written is returned. +.Pp +The +.Fn acl_copy_ext +function writes data in big-endian byte-order, and so is portable across +machines with different byte-order. +To the contrary, the +.Fn acl_copy_ext_native +function uses the machine's native byte-order, and so is only portable to +machines of like byte-order. +.Pp +The +.Fn acl_copy_int +and +.Fn acl_copy_int_native +functions do the reverse conversion; the ACL represented by the external +representation passed in the argument +.Fa buf , +is returned. +The +.Fn acl_copy_int +function expects an external representation in big-endian byte-order (as +returned by +.Fn acl_copy_ext ) , +while +.Fn acl_copy_int_native +expects an external representation in native byte-order (as returned by +.Fn acl_copy_ext_native ) . +.Pp +The +.Fn acl_size +function returns the corresponding external representation size, in bytes, for +the given ACL passed in the argument +.Fa acl . +This size can be used to allocate sufficient memory for the buffer in +subsequent calls to +.Fn acl_copy_ext +and +.Fn acl_copy_ext_native . +.Sh RETURN VALUES +Upon successful completion, the +.Fn acl_copy_ext +and +.Fn acl_copy_ext_native +functions shall return the number of bytes actually written to the buffer. +Otherwise, a value of +.Va -1 +shall be returned and +.Va errno +shall be set to indicate the error. +.Pp +Upon successful completion, the +.Fn acl_copy_int +and +.Fn acl_copy_int_native +functions shall return the ACL represented by the external representation +passed in the buffer. +Otherwise, a value of +.Va (acl_t)NULL +shall be returned and +.Va errno +shall be set to indicate the error. +.Pp +Upon successful completion, the +.Fn acl_size +function shall return the size of the external representation. +Otherwise, a value of +.Va -1 +shall be returned and +.Va errno +shall be set to indicate the error. +.Sh ERRORS +The +.Fn acl_copy_ext +and +.Fn acl_copy_ext_native +functions fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa acl +does not point to a valid ACL. +.It Bq Er ERANGE +The given buffer is too small to contain the converted external representation. +.El +.Pp +The +.Fn acl_copy_int +and +.Fn acl_copy_int_native +functions fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The buffer does not contain a valid external representation. +.El +.Pp +The +.Fn acl_size +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa acl +does not point to a valid ACL. +.El +.Sh NOTE +While the external representation may use pre-existing data structures, +no assumptions on the internal structure should be made. +.Pp +The +.Xr acl_to_text 3 +and +.Xr acl_from_text 3 +functions also convert to and from a different external representation, +a human-readable string. +Neither of these representations are cross-platform, lacking a cross-platform +standard. +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_from_text 3 , +.Xr acl_to_text 3 +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_create_entry.3 b/posix1e/acl_create_entry.3 new file mode 100644 index 0000000..60e34ff --- /dev/null +++ b/posix1e/acl_create_entry.3 @@ -0,0 +1,109 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_create_entry.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 16, 2001 +.Dt ACL_CREATE_ENTRY 3 +.Os +.Sh NAME +.Nm acl_create_entry , +.Nm acl_create_entry_np +.Nd create a new ACL entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_create_entry "acl_t *acl_p" "acl_entry_t *entry_p" +.Ft int +.Fn acl_create_entry_np "acl_t *acl_p" "acl_entry_t *entry_p" "int entry_index" +.Sh DESCRIPTION +The +.Fn acl_create_entry +function +is a POSIX.1e call that creates a new ACL entry in the ACL +pointed to by +.Fa acl_p . +The function will return in +.Fa entry_p +a descriptor for this ACL entry. +.Pp +The +.Fn acl_create_entry_np +function is a non-portable extension which allows the caller to specify the +position of the created entry within the ACL. If +.Fa entry_index +is +.Dv ACL_FIRST_ENTRY +the entry will be created at the head of the ACL. If +.Fa entry_index +is +.Dv ACL_LAST_ENTRY +the entry will be created at the end of the ACL. After inserting an ACL entry with an +.Fa entry_index +other than +.Dv ACL_LAST_ENTRY +the behaviour of any acl_entry_t's previously obtained from the ACL +by +.Fn acl_create_entry +or +.Fn acl_get_entry +is undefined. +.Sh RETURN VALUES +.Rv -std acl_create_entry +.Sh ERRORS +The +.Fn acl_create_entry +and +.Fn acl_create_entry_np +functions fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa acl_p +does not point to a pointer to a valid ACL. +.It Bq Er ENOMEM +The ACL working storage requires more memory than is +allowed by the hardware or system-imposed memory +management constraints. +.It Bq Er ERANGE +The +.Fa entry_index +argument to +.Fn acl_create_entry_np +is greater than the number of entries in the ACL. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_delete_entry 3 , +.Xr acl_get_entry 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D Fulhaber diff --git a/posix1e/acl_delete.3 b/posix1e/acl_delete.3 new file mode 100644 index 0000000..6b5cef8 --- /dev/null +++ b/posix1e/acl_delete.3 @@ -0,0 +1,114 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_delete.3,v 1.16 2003/02/23 01:44:37 ru Exp $ +.\" +.Dd December 29, 2002 +.Dt ACL_DELETE 3 +.Os +.Sh NAME +.Nm acl_delete_fd_np , +.Nm acl_delete_file_np +.Nm acl_delete_link_np +.Nd delete an ACL from a file +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_delete_fd_np "int filedes" "acl_type_t type" +.Ft int +.Fn acl_delete_file_np "const char *path_p" "acl_type_t type" +.Ft int +.Fn acl_delete_link_np "const char *path_p" "acl_type_t type" +.Sh DESCRIPTION +The +.Fn acl_delete_fd_np , +.Fn acl_delete_file_np , +and +.Fn acl_delete_link_np +each allow the deletion of an ACL from a file. +These functions are non-portable extensions +that permit the deletion of arbitrary ACL types from a file/directory +either by path name or file descriptor. +The +.Fn _file +variations follow a symlink if it occurs in the last segment of the +path name; the +.Fn _link +variations operate on the symlink itself. +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +If any of the following conditions occur, these functions shall return -1 +and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for a component of the path prefix, or the +object exists and the process does not have appropriate access rights. +.It Bq Er EBADF +The +.Va fd +argument is not a valid file descriptor. +.It Bq Er EINVAL +The ACL type passed is invalid for this file object. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded 255 characters, or an +entire path name exceeded 1023 characters. +.It Bq Er ENOENT +The named object does not exist, or the +.Va path_p +argument points to an empty string. +.It Bq Er ENOMEM +Insufficient memory available to fulfill request. +.It Bq Er ENOTDIR +A component of the path prefix is not a directory. +.Pp +Argument +.Va path_p +must be a directory, and is not. +.It Bq Er EOPNOTSUPP +The file system does not support ACL deletion. +.It Bq Er EPERM +The process does not have appropriate privilege to perform the operation +to delete an ACL. +.It Bq Er EROFS +The file system is read-only. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_get 3 , +.Xr acl_set 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_delete_entry.3 b/posix1e/acl_delete_entry.3 new file mode 100644 index 0000000..d291d12 --- /dev/null +++ b/posix1e/acl_delete_entry.3 @@ -0,0 +1,73 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_delete_entry.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_DELETE_ENTRY 3 +.Os +.Sh NAME +.Nm acl_delete_entry +.Nd delete an ACL entry from an ACL +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_delete_entry "acl_t acl" "acl_entry_t entry_d" +.Sh DESCRIPTION +The +.Fn acl_delete_entry +function +is a POSIX.1e call that removes the ACL entry +.Fa entry_d +from ACL +.Fa acl . +.Sh RETURN VALUES +.Rv -std acl_delete_entry +.Sh ERRORS +The +.Fn acl_delete_entry +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa acl +does not point to a valid ACL. Argument +.Fa entry_d +is not a valid descriptor for an ACL entry in +.Fa acl . +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_copy_entry 3 , +.Xr acl_get_entry 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D Fulhaber diff --git a/posix1e/acl_delete_flag_np.3 b/posix1e/acl_delete_flag_np.3 new file mode 100644 index 0000000..ee5f0c5 --- /dev/null +++ b/posix1e/acl_delete_flag_np.3 @@ -0,0 +1,75 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_delete_entry_flag_np.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_DELETE_FLAG_NP 3 +.Os +.Sh NAME +.Nm acl_delete_flag_np +.Nd delete flags from a flag set +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_delete_flag_np "acl_flagset_t flagset_d" "acl_flag_t flag" +.Sh DESCRIPTION +The +.Fn acl_delete_flag_np +function +is a nonstandard extension that removes the specific flag +.Fa flag +from the flag set +.Fa flagset_d . +.Sh RETURN VALUES +.Rv -std acl_delete_flag_np +.Sh ERRORS +The +.Fn acl_delete_flag_np +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa flagset_d +is not a valid descriptor for a flag set. Argument +.Fa flag +does not contain an +.Vt acl_flag_t +value that is valid for the +.Fa flagset_d +flagset. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_flag_np 3 , +.Xr acl_clear_flags_np 3 , +.Xr acl_get_flagset_np 3 , +.Xr acl_set_flagset_np 3 +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_delete_perm.3 b/posix1e/acl_delete_perm.3 new file mode 100644 index 0000000..b8a2ba0 --- /dev/null +++ b/posix1e/acl_delete_perm.3 @@ -0,0 +1,83 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_delete_perm.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_DELETE_PERM 3 +.Os +.Sh NAME +.Nm acl_delete_perm +.Nd delete permissions from a permission set +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_delete_perm "acl_permset_t permset_d" "acl_perm_t perm" +.Sh DESCRIPTION +The +.Fn acl_delete_perm +function +is a POSIX.1e call that removes specific permissions from permissions set +.Fa perm . +.Sh RETURN VALUES +.Rv -std acl_delete_perm +.Sh ERRORS +The +.Fn acl_delete_perm +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa permset_d +is not a valid descriptor for a permission set. Argument +.Fa perm +does not contain a valid +.Vt acl_perm_t +value. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_perm 3 , +.Xr acl_clear_perms 3 , +.Xr acl_get_permset 3 , +.Xr acl_set_permset 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh HISTORY +POSIX.1e support was introduced in +.Fx 4.0 . +The +.Fn acl_delete_perm +function was added in +.Fx 5.0 . +.Sh AUTHORS +The +.Fn acl_delete_perm +function was written by +.An Chris D. Faulhaber Aq jedgar@fxp.org . diff --git a/posix1e/acl_dup.3 b/posix1e/acl_dup.3 new file mode 100644 index 0000000..6aeb55c --- /dev/null +++ b/posix1e/acl_dup.3 @@ -0,0 +1,94 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_dup.3,v 1.12 2002/12/29 20:52:42 rwatson Exp $ +.\" +.Dd January 28, 2000 +.Dt ACL_DUP 3 +.Os +.Sh NAME +.Nm acl_dup +.Nd duplicate an ACL +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft acl_t +.Fn acl_dup "acl_t acl" +.Sh DESCRIPTION +The +.Fn acl_dup +function returns a pointer to a copy of the ACL pointed to by the argument +.Va acl . +.Pp +This function may cause memory to be allocated. The caller should free any +releasable memory, when the new ACL is no longer required, by calling +.Xr acl_free 3 +with the +.Va (void*)acl_t +as an argument. +.Pp +Any existing ACL pointers that refer to the ACL referred to by +.Va acl +shall continue to refer to the ACL. +.Sh RETURN VALUES +Upon successful completion, this function shall return a pointer to the +duplicate ACL. Otherwise, a value of +.Va (acl_t)NULL +shall be returned, and +.Va errno +shall be set to indicate the error. +.Sh ERRORS +If any of the following conditions occur, the +.Fn acl_init +function shall return a value of +.Va (acl_t)NULL +and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Va acl +does not point to a valid ACL. +.It Bq Er ENOMEM +The +.Va acl_t +to be returned requires more memory than is allowed by the hardware or +system-imposed memory management constraints. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_free 3 , +.Xr acl_get 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_entry.c b/posix1e/acl_entry.c new file mode 100644 index 0000000..a690c00 --- /dev/null +++ b/posix1e/acl_entry.c @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2004, 2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include + +#include "aclvar.h" + +#if __DARWIN_ACL_EXTENDED_ALLOW != KAUTH_ACE_PERMIT +# error __DARWIN_ACL_EXTENDED_ALLOW != KAUTH_ACE_PERMIT +#endif +#if __DARWIN_ACL_EXTENDED_DENY != KAUTH_ACE_DENY +# error __DARWIN_ACL_EXTENDED_DENY != KAUTH_ACE_DENY +#endif + +int +acl_copy_entry(acl_entry_t dest, acl_entry_t src) +{ + /* validate arguments */ + _ACL_VALIDATE_ENTRY(dest); + _ACL_VALIDATE_ENTRY(src); + if (dest == src) { + errno = EINVAL; + return(-1); + } + bcopy(src, dest, sizeof(*src)); + return(0); +} + +int +acl_create_entry_np(acl_t *acl_p, acl_entry_t *entry_p, int index) +{ + struct _acl *ap = *acl_p; + int i; + + /* validate arguments */ + _ACL_VALIDATE_ACL(ap); + if (ap->a_entries >= ACL_MAX_ENTRIES) { + errno = ENOMEM; + return(-1); + } + if (index == ACL_LAST_ENTRY) + index = ap->a_entries; + if (index > ap->a_entries) { + errno = ERANGE; + return(-1); + } + + /* move following entries out of the way */ + for (i = ap->a_entries; i > index; i--) + ap->a_ace[i] = ap->a_ace[i - 1]; + ap->a_entries++; + + /* initialise new entry */ + memset(&ap->a_ace[index], 0, sizeof(ap->a_ace[index])); + ap->a_ace[index].ae_magic = _ACL_ENTRY_MAGIC; + ap->a_ace[index].ae_tag = ACL_UNDEFINED_TAG; + + *entry_p = &ap->a_ace[index]; + return(0); +} + +int +acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p) +{ + return(acl_create_entry_np(acl_p, entry_p, ACL_LAST_ENTRY)); +} + +int +acl_delete_entry(acl_t acl, acl_entry_t entry) +{ + int i; + + _ACL_VALIDATE_ACL(acl); + _ACL_VALIDATE_ENTRY(entry); + _ACL_VALIDATE_ENTRY_CONTAINED(acl, entry); + + /* copy following entries down & invalidate last slot */ + acl->a_entries--; + for (i = entry - &acl->a_ace[0]; i < acl->a_entries; i++) + acl->a_ace[i] = acl->a_ace[i + 1]; + acl->a_ace[acl->a_entries].ae_magic = 0; + /* Sync up the iterator's position if necessary */ + if (acl->a_last_get >= (entry - &acl->a_ace[0])) + acl->a_last_get--; + + return(0); +} + +int +acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p) +{ + + _ACL_VALIDATE_ACL(acl); + if ((entry_id != ACL_FIRST_ENTRY) && + (entry_id != ACL_NEXT_ENTRY) && + (entry_id != ACL_LAST_ENTRY) && + ((entry_id < 0) || (entry_id >= acl->a_entries))) { + errno = EINVAL; + return(-1); + } + if (entry_id == ACL_FIRST_ENTRY) + entry_id = 0; + else + if (entry_id == ACL_NEXT_ENTRY) { + entry_id = acl->a_last_get + 1; + } + else + if (entry_id == ACL_LAST_ENTRY) + entry_id = acl->a_entries - 1; + + if (entry_id >= acl->a_entries) { + errno = EINVAL; + return (-1); + } + + *entry_p = &acl->a_ace[entry_id]; + acl->a_last_get = entry_id; + + return(0); +} + +void * +acl_get_qualifier(acl_entry_t entry) +{ + acl_tag_t tag_type; + void *result; + int error; + + result = NULL; + if (!_ACL_VALID_ENTRY(entry)) { + errno = EINVAL; + } else if ((error = acl_get_tag_type(entry, &tag_type)) != 0) { + /* errno is set by acl_get_tag_type */ + } else { + switch(tag_type) { + case ACL_EXTENDED_ALLOW: + case ACL_EXTENDED_DENY: + if ((result = malloc(sizeof(guid_t))) != NULL) + bcopy(&entry->ae_applicable, result, sizeof(guid_t)); + break; + default: + errno = EINVAL; + break; + } + } + return(result); +} + +int +acl_get_tag_type(acl_entry_t entry, acl_tag_t *tag_type_p) +{ + _ACL_VALIDATE_ENTRY(entry); + + *tag_type_p = entry->ae_tag; + return(0); +} + +int +acl_set_qualifier(acl_entry_t entry, const void *tag_qualifier_p) +{ + acl_tag_t tag_type; + + _ACL_VALIDATE_ENTRY(entry); + if (acl_get_tag_type(entry, &tag_type) != 0) + return(-1); + + switch(tag_type) { + case ACL_EXTENDED_ALLOW: + case ACL_EXTENDED_DENY: + bcopy(tag_qualifier_p, &entry->ae_applicable, sizeof(guid_t)); + break; + default: + errno = EINVAL; + return(-1); + } + return(0); +} + +int +acl_set_tag_type(acl_entry_t entry, acl_tag_t tag_type) +{ + _ACL_VALIDATE_ENTRY(entry); + + switch(tag_type) { + case ACL_EXTENDED_ALLOW: + case ACL_EXTENDED_DENY: + entry->ae_tag = tag_type; + break; + default: + errno = EINVAL; + return(-1); + } + return(0); +} diff --git a/posix1e/acl_file.c b/posix1e/acl_file.c new file mode 100644 index 0000000..6b62d13 --- /dev/null +++ b/posix1e/acl_file.c @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* XXX temporary implementation using __acl__ file */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "aclvar.h" + +static acl_t acl_get_file1(const char *path, acl_type_t acl_type, int follow); + +int acl_delete_fd_np(int filedes, acl_type_t type); +int +acl_delete_fd_np(int filedes, acl_type_t type) +{ + errno = ENOTSUP; + return(-1); +} + +int acl_delete_file_np(const char *path, acl_type_t type); +int +acl_delete_file_np(const char *path, acl_type_t type) +{ + errno = ENOTSUP; + return(-1); +} + +int acl_delete_link_np(const char *path, acl_type_t type); +int +acl_delete_link_np(const char *path, acl_type_t type) +{ + errno = ENOTSUP; + return(-1); +} + +acl_t +acl_get_fd(int fd) +{ + return(acl_get_fd_np(fd, ACL_TYPE_EXTENDED)); +} + +acl_t +acl_get_fd_np(int fd, acl_type_t type) +{ + filesec_t fsec; + acl_t acl; + struct stat sb; + + if (type != ACL_TYPE_EXTENDED) { + errno = EINVAL; + return(NULL); + } + if ((fsec = filesec_init()) == NULL) + return(NULL); + + acl = NULL; + if (fstatx_np(fd, &sb, fsec) == 0) + filesec_get_property(fsec, FILESEC_ACL, &acl); + filesec_free(fsec); + return(acl); +} + +static acl_t +acl_get_file1(const char *path, acl_type_t acl_type, int follow) +{ + filesec_t fsec; + acl_t acl; + struct stat sb; + + if (acl_type != ACL_TYPE_EXTENDED) { + errno = EINVAL; + return(NULL); + } + if ((fsec = filesec_init()) == NULL) + return(NULL); + + acl = NULL; + if ((follow ? statx_np(path, &sb, fsec) : lstatx_np(path, &sb, fsec)) == 0) + filesec_get_property(fsec, FILESEC_ACL, &acl); + filesec_free(fsec); + return(acl); +} + +acl_t +acl_get_file(const char *path, acl_type_t type) +{ + return(acl_get_file1(path, type, 1 /* follow */)); +} + +acl_t +acl_get_link_np(const char *path, acl_type_t type) +{ + return(acl_get_file1(path, type, 0 /* no follow */)); +} + +int +acl_set_fd_np(int fd, acl_t acl, acl_type_t type) +{ + filesec_t fsec; + int error; + + if ((fsec = filesec_init()) == NULL) + return(-1); + if ((filesec_set_property(fsec, FILESEC_ACL, &acl)) != 0) { + filesec_free(fsec); + return(-1); + } + error = fchmodx_np(fd, fsec); + filesec_free(fsec); + return((error == 0) ? 0 : -1); +} + +int +acl_set_fd(int fd, acl_t acl) +{ + return(acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED)); +} + +int +acl_set_file(const char *path, acl_type_t acl_type, acl_t acl) +{ + filesec_t fsec; + int error; + + if ((fsec = filesec_init()) == NULL) + return(-1); + if (filesec_set_property(fsec, FILESEC_ACL, &acl) != 0) { + filesec_free(fsec); + return(-1); + } + error = chmodx_np(path, fsec); + filesec_free(fsec); + return((error == 0) ? 0 : -1); +} + +int +acl_set_link_np(const char *path, acl_type_t acl_type, acl_t acl) +{ + struct stat s; + + if(lstat(path, &s) < 0) + return(-1); + if(S_ISLNK(s.st_mode)) { + errno = ENOTSUP; + return(-1); + } + return(acl_set_file(path, acl_type, acl)); +} + +/* + * Not applicable; not supported. + */ +int +acl_delete_def_file(__unused const char *path) +{ + errno = ENOTSUP; + return(-1); +} diff --git a/posix1e/acl_flag.c b/posix1e/acl_flag.c new file mode 100644 index 0000000..190bed9 --- /dev/null +++ b/posix1e/acl_flag.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2004, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include + +#include "aclvar.h" + +#if __DARWIN_ACL_ENTRY_INHERITED != KAUTH_ACE_INHERITED +# error __DARWIN_ACL_ENTRY_INHERITED != KAUTH_ACE_INHERITED +#endif +#if __DARWIN_ACL_ENTRY_FILE_INHERIT != KAUTH_ACE_FILE_INHERIT +# error __DARWIN_ACL_ENTRY_FILE_INHERIT != KAUTH_ACE_FILE_INHERIT +#endif +#if __DARWIN_ACL_ENTRY_DIRECTORY_INHERIT != KAUTH_ACE_DIRECTORY_INHERIT +# error __DARWIN_ACL_ENTRY_DIRECTORY_INHERIT != KAUTH_ACE_DIRECTORY_INHERIT +#endif +#if __DARWIN_ACL_ENTRY_LIMIT_INHERIT != KAUTH_ACE_LIMIT_INHERIT +# error __DARWIN_ACL_ENTRY_LIMIT_INHERIT != KAUTH_ACE_LIMIT_INHERIT +#endif +#if __DARWIN_ACL_ENTRY_ONLY_INHERIT != KAUTH_ACE_ONLY_INHERIT +# error __DARWIN_ACL_ENTRY_ONLY_INHERIT != KAUTH_ACE_ONLY_INHERIT +#endif +#if __DARWIN_ACL_FLAG_NO_INHERIT != KAUTH_ACL_NO_INHERIT +# error __DARWIN_ACL_FLAG_NO_INHERIT != KAUTH_ACL_NO_INHERIT +#endif + +int +acl_add_flag_np(acl_flagset_t flags, acl_flag_t flag) +{ + /* XXX validate flags */ + /* XXX validate flag */ + + flags->af_flags |= flag; + return(0); +} + +int +acl_clear_flags_np(acl_flagset_t flags) +{ + /* XXX validate flags */ + + flags->af_flags = 0; + return(0); +} + +int +acl_delete_flag_np(acl_flagset_t flags, acl_flag_t flag) +{ + /* XXX validate flags */ + /* XXX validate flag */ + + flags->af_flags &= ~flag; + return(0); +} + +int +acl_get_flag_np(acl_flagset_t flagset, acl_flag_t flag) +{ + /* XXX validate flags */ + /* XXX validate flag */ + + return((flag & flagset->af_flags) ? 1 : 0); +} + +int +acl_get_flagset_np(void *obj, acl_flagset_t *flagset_p) +{ + struct _acl *ap = (struct _acl *)obj; + struct _acl_entry *ep = (struct _acl_entry *)obj; + + if (_ACL_VALID_ACL(ap)) { + *flagset_p = (acl_flagset_t)&ap->a_flags; + } else if (_ACL_VALID_ENTRY(ep)) { + *flagset_p = (acl_flagset_t)&ep->ae_flags; + } else { + errno = EINVAL; + return(-1); + } + return(0); +} + +int +acl_set_flagset_np(void *obj, acl_flagset_t flagset) +{ + struct _acl *ap = (struct _acl *)obj; + struct _acl_entry *ep = (struct _acl_entry *)obj; + + if (_ACL_VALID_ACL(ap)) { + ap->a_flags = flagset->af_flags; + } else if (_ACL_VALID_ENTRY(ep)) { + ep->ae_flags = flagset->af_flags; + } else { + errno = EINVAL; + return(-1); + } + + return(0); +} diff --git a/posix1e/acl_free.3 b/posix1e/acl_free.3 new file mode 100644 index 0000000..85894ed --- /dev/null +++ b/posix1e/acl_free.3 @@ -0,0 +1,75 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_free.3,v 1.12 2002/12/29 20:52:42 rwatson Exp $ +.\" +.Dd January 28, 2000 +.Dt ACL_FREE 3 +.Os +.Sh NAME +.Nm acl_free +.Nd free ACL working state +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_free "void *obj_p" +.Sh DESCRIPTION +The +.Fn acl_free +call allows the freeing of ACL working space, such as is allocated by +.Xr acl_dup 3 , +or +.Xr acl_from_text 3 . +.Sh RETURN VALUES +.Rv -std acl_free +.Sh ERRORS +If any of the following conditions occur, the +.Fn acl_free +function shall return -1 and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EINVAL +The value of the +.Va obj_p +argument is invalid. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_dup 3 , +.Xr acl_from_text 3 , +.Xr acl_get 3 , +.Xr acl_init 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_from_text.3 b/posix1e/acl_from_text.3 new file mode 100644 index 0000000..61e1ea3 --- /dev/null +++ b/posix1e/acl_from_text.3 @@ -0,0 +1,95 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_from_text.3,v 1.15 2002/12/29 20:52:42 rwatson Exp $ +.\" +.Dd January 28, 2000 +.Dt ACL_FROM_TEXT 3 +.Os +.Sh NAME +.Nm acl_from_text +.Nd create an ACL from text +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft acl_t +.Fn acl_from_text "const char *buf_p" +.Sh DESCRIPTION +The +.Fn acl_from_text +function converts the text form of an ACL referred to by +.Va buf_p +into the internal working structure for ACLs, appropriate for applying to +files or manipulating. +.Pp +This function may cause memory to be allocated. The caller should free any +releasable memory, when the new ACL is no longer required, by calling +.Xr acl_free 3 +with the +.Va (void *)acl_t +as an argument. +.Sh IMPLEMENTATION NOTES +The ACL_TYPE_EXTENDE text format differs from the POSIX.1e format, and this +function will not translate between formats. +.Sh RETURN VALUES +Upon successful completion, the function shall return a pointer to the +internal representation of the ACL in working storage. Otherwise, a value +of +.Va (acl_t)NULL +shall be returned, and +.Va errno +shall be set to indicate the error. +.Sh ERRORS +If any of the following conditions occur, the +.Fn acl_from_text +function shall return a value of +.Va (acl_t)NULL +and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Va buf_p +cannot be translated into an ACL. +.It Bq Er ENOMEM +The ACL working storage requires more memory than is allowed by the +hardware or system-imposed memory management constraints. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_free 3 , +.Xr acl_get 3 , +.Xr acl_to_text 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_get.3 b/posix1e/acl_get.3 new file mode 100644 index 0000000..5f797de --- /dev/null +++ b/posix1e/acl_get.3 @@ -0,0 +1,140 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_get.3,v 1.17 2003/02/23 01:43:45 ru Exp $ +.\" +.Dd December 29, 2002 +.Dt ACL_GET 3 +.Os +.Sh NAME +.Nm acl_get_fd , +.Nm acl_get_fd_np , +.Nm acl_get_file , +.Nm acl_get_link_np +.Nd get an ACL for a file +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft acl_t +.Fn acl_get_fd "int fd" +.Ft acl_t +.Fn acl_get_fd_np "int fd" "acl_type_t type" +.Ft acl_t +.Fn acl_get_file "const char *path_p" "acl_type_t type" +.Ft acl_t +.Fn acl_get_link_np "const char *path_p" "acl_type_t type" +.Sh DESCRIPTION +The +.Fn acl_get_fd , +.Fn acl_get_file , +.Fn acl_get_link_np , +and +.Fn acl_get_fd_np +each allow the retrieval of an ACL from a file. +The +.Fn acl_get_fd +is a POSIX.1e call that allows the retrieval of an ACL of type +ACL_TYPE_ACCESS +from a file descriptor. +The +.Fn acl_get_fd_np +function +is a non-portable form of +.Fn acl_get_fd +that allows the retrieval of any type of ACL from a file descriptor. +The +.Fn acl_get_file +function is a POSIX.1e call that allows the retrieval of a +specified type of ACL from a file by name; +.Fn acl_get_link_np +is a non-portable variation on +.Fn acl_get_file +which does not follow a symlink if the target of the call is a +symlink. +.Pp +These functions may cause memory to be allocated. The caller should free +any releasable memory, when the new ACL is no longer required, by calling +.Xr acl_free 3 +with the +.Va (void *)acl_t +as an argument. +.Pp +The ACL in the working storage is an independent copy of the ACL associated +with the object referred to by +.Va fd . +The ACL in the working storage shall not participate in any access control +decisions. +.Sh RETURN VALUES +Upon successful completion, the function shall return a pointer to the ACL +that was retrieved. Otherwise, a value of +.Va (acl_t)NULL +shall be returned, and +.Va errno +shall be set to indicate the error. +.Sh ERRORS +If any of the following conditions occur, the +.Fn acl_get_fd +function shall return a value of +.Va (acl_t)NULL +and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for a component of the path prefix, or the +object exists and the process does not have appropriate access rights. +.It Bq Er EBADF +The +.Va fd +argument is not a valid file descriptor. +.It Bq Er EINVAL +The ACL type passed is invalid for this file object. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded 255 characters, or an +entire path name exceeded 1023 characters. +.It Bq Er ENOENT +The named object does not exist, or the +.Va path_p +argument points to an empty string. +.It Bq Er ENOMEM +Insufficient memory available to fulfill request. +.It Bq Er EOPNOTSUPP +The file system does not support ACL retrieval. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_free 3 , +.Xr acl_get 3 , +.Xr acl_set 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_get_entry.3 b/posix1e/acl_get_entry.3 new file mode 100644 index 0000000..0171fb3 --- /dev/null +++ b/posix1e/acl_get_entry.3 @@ -0,0 +1,137 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_get_entry.3,v 1.6 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd April 13, 2001 +.Dt ACL_GET_ENTRY 3 +.Os +.Sh NAME +.Nm acl_get_entry +.Nd retrieve an ACL entry from an ACL +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_get_entry "acl_t acl" "int entry_id" "acl_entry_t *entry_p" +.Sh DESCRIPTION +The +.Fn acl_get_entry +function +is a POSIX.1e call that retrieves a descriptor for an ACL entry +specified by the argument +.Fa entry_d +within the ACL indicated by the argument +.Fa acl . +.Pp +If the value of +.Fa entry_id +is +.Dv ACL_FIRST_ENTRY , +then the function will return in +.Fa entry_p +a descriptor for the first ACL entry within +.Fa acl . +If a call is made to +.Fn acl_get_entry +with +.Fa entry_id +set to +.Dv ACL_NEXT_ENTRY +when there has not been either an initial successful call to +.Fn acl_get_entry , +or a previous successfull call to +.Fn acl_create_entry , +.Fn acl_delete_entry , +.Fn acl_dup , +.Fn acl_from_text , +.Fn acl_get_fd , +.Fn acl_get_file , +.Fn acl_set_fd , +.Fn acl_set_file , +or +.Fn acl_valid , +then the result is unspecified. +.Pp +The caller may also set +.Fa entry_id +to the index of the desired entry within the ACL. This is a non-portable +extension. A subsequent call with +.Fa entry_id +set to +.Dv ACL_NEXT_ENTRY +will return the entry following the previously nominated entry and so forth. +.Sh RETURN VALUES +If the +.Fn acl_get_entry +function successfully obtains an ACL entry, a value of 0 is returned. +Otherwise, a value of -1 will be returned and +the global variable +.Va errno +will be set to indicate the error. +.Sh ERRORS +The +.Fn acl_get_entry +fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa acl +does not point to a valid ACL. Argument +.Fa entry_id +is neither +.Dv ACL_FIRST_ENTRY , +.Dv ACL_NEXT_ENTRY +or a valid entry index. +.It Bq Er EINVAL +The value of +.Fa entry_id +is +.Dv ACL_NEXT_ENTRY +and the last ACL entry in the ACL has already been returned by a +previous call to +.Fn acl_get_entry . +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_calc_mask 3 , +.Xr acl_create_entry 3 , +.Xr acl_delete_entry 3 , +.Xr acl_dup 3 , +.Xr acl_from_text 3 , +.Xr acl_get_fd 3 , +.Xr acl_get_file 3 , +.Xr acl_init 3 , +.Xr acl_set_fd 3 , +.Xr acl_set_file 3 , +.Xr acl_valid 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_get_fd.3 b/posix1e/acl_get_fd.3 new file mode 100644 index 0000000..d483a82 --- /dev/null +++ b/posix1e/acl_get_fd.3 @@ -0,0 +1,141 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_get.3,v 1.17 2003/02/23 01:43:45 ru Exp $ +.\" +.Dd December 29, 2002 +.Dt ACL_GET 3 +.Os +.Sh NAME +.Nm acl_get_fd , +.Nm acl_get_fd_np , +.Nm acl_get_file , +.Nm acl_get_link_np +.Nd get an ACL for a file +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft acl_t +.Fn acl_get_fd "int fd" +.Ft acl_t +.Fn acl_get_fd_np "int fd" "acl_type_t type" +.Ft acl_t +.Fn acl_get_file "const char *path_p" "acl_type_t type" +.Ft acl_t +.Fn acl_get_link_np "const char *path_p" "acl_type_t type" +.Sh DESCRIPTION +The +.Fn acl_get_fd , +.Fn acl_get_file , +.Fn acl_get_link_np , +and +.Fn acl_get_fd_np +each allow the retrieval of an ACL from a file. +The +.Fn acl_get_fd +is a POSIX.1e call that allows the retrieval of an ACL of type +ACL_TYPE_ACCESS +from a file descriptor. +The +.Fn acl_get_fd_np +function +is a non-portable form of +.Fn acl_get_fd +that allows the retrieval of any type of ACL from a file descriptor. +The +.Fn acl_get_file +function is a POSIX.1e call that allows the retrieval of a +specified type of ACL from a file by name; +.Fn acl_get_link_np +is a non-portable variation on +.Fn acl_get_file +which does not follow a symlink if the target of the call is a +symlink. +.Pp +These functions may cause memory to be allocated. The caller should free +any releasable memory, when the new ACL is no longer required, by calling +.Xr acl_free 3 +with the +.Va (void *)acl_t +as an argument. +.Pp +The ACL in the working storage is an independent copy of the ACL associated +with the object referred to by +.Va fd . +The ACL in the working storage shall not participate in any access control +decisions. +.Sh RETURN VALUES +Upon successful completion, the function shall return a pointer to the ACL +that was retrieved. Otherwise, a value of +.Va (acl_t)NULL +shall be returned, and +.Va errno +shall be set to indicate the error. +.Sh ERRORS +If any of the following conditions occur, the +.Fn acl_get_fd +function shall return a value of +.Va (acl_t)NULL +and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for a component of the path prefix, or the +object exists and the process does not have appropriate access rights. +.It Bq Er EBADF +The +.Va fd +argument is not a valid file descriptor. +.It Bq Er EINVAL +The ACL type passed is invalid for this file object. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded 255 characters, or an +entire path name exceeded 1023 characters. +.It Bq Er ENOENT +The named object does not exist, or the +.Va path_p +argument points to an empty string. +.It Bq Er ENOMEM +Insufficient memory available to fulfill request. +.It Bq Er EOPNOTSUPP +The file system does not support ACL retrieval. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_free 3 , +.Xr acl_get 3 , +.Xr acl_set 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +and development continues. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_get_flagset_np.3 b/posix1e/acl_get_flagset_np.3 new file mode 100644 index 0000000..0ceb80b --- /dev/null +++ b/posix1e/acl_get_flagset_np.3 @@ -0,0 +1,71 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_get_permset.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_GET_FLAGSET_NP 3 +.Os +.Sh NAME +.Nm acl_get_flagset_np +.Nd retrieve flag set from an ACL or ACL entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_get_flagset_np "void *obj" "acl_flagset_t *flagset_p" +.Sh DESCRIPTION +The +.Fn acl_get_flagset_np +function +is a nonstandard extension that returns via +.Fa flagset_p +a descriptor to the flag set in the ACL or ACL entry +.Fa obj . +Subsequent operations using the returned flag set operate +on the permission set within the ACL or ACL entry. +.Sh RETURN VALUES +.Rv -std acl_get_flagset +.Sh ERRORS +The +.Fn acl_get_flagset +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa obj +is not a valid descriptor for an ACL or ACL entry. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_flag_np 3 , +.Xr acl_clear_flags_np 3 , +.Xr acl_delete_flag_np 3 , +.Xr acl_set_flagset_np 3 +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_get_perm_np.3 b/posix1e/acl_get_perm_np.3 new file mode 100644 index 0000000..3b4a056 --- /dev/null +++ b/posix1e/acl_get_perm_np.3 @@ -0,0 +1,85 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_get_perm_np.3,v 1.4 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd April 10, 2001 +.Dt ACL_GET_PERM_NP 3 +.Os +.Sh NAME +.Nm acl_get_perm_np +.Nd "check if a permission is set in a permission set" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_get_perm_np "acl_permset_t permset_d" "acl_perm_t perm" +.Sh DESCRIPTION +The +.Fn acl_get_perm_np +function +is a non-portable function that checks if a permission is set in +a permission set. +.Sh RETURN VALUES +If the permission in +.Fa perm +is set in the permission set +.Fa permset_d , +a value of +1 +is returned, otherwise a value of +0 +is returned. +.Sh ERRORS +If any of the following conditions occur, the +.Fn acl_get_perm_np +function will return a value of +\-1 +and set global variable +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa perm +does not contain a valid ACL permission or argument +.Fa permset_d +is not a valid ACL permset. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_perm 3 , +.Xr acl_clear_perms 3 , +.Xr acl_delete_perm 3 , +.Xr acl_get_permset 3 , +.Xr acl_set_permset 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_get_permset.3 b/posix1e/acl_get_permset.3 new file mode 100644 index 0000000..8aef934 --- /dev/null +++ b/posix1e/acl_get_permset.3 @@ -0,0 +1,74 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_get_permset.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_GET_PERMSET 3 +.Os +.Sh NAME +.Nm acl_get_permset +.Nd retrieve permission set from an ACL entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_get_permset "acl_entry_t entry_d" "acl_permset_t *permset_p" +.Sh DESCRIPTION +The +.Fn acl_get_permset +function +is a POSIX.1e call that returns via +.Fa permset_p +a descriptor to the permission set in the ACL entry +.Fa entry_d . +Subsequent operations using the returned permission set operate +on the permission set within the ACL entry. +.Sh RETURN VALUES +.Rv -std acl_get_permset +.Sh ERRORS +The +.Fn acl_get_permset +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa entry_d +is not a valid descriptor for an ACL entry. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_perm 3 , +.Xr acl_clear_perms 3 , +.Xr acl_delete_perm 3 , +.Xr acl_set_permset 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_get_permset_mask_np.3 b/posix1e/acl_get_permset_mask_np.3 new file mode 100644 index 0000000..a47ac7c --- /dev/null +++ b/posix1e/acl_get_permset_mask_np.3 @@ -0,0 +1,93 @@ +.Dd August 24, 2010 +.Os Darwin +.Dt ACL_PERMSET_MASK 3 +.Sh NAME +.Nm acl_permset_mask +.Nd Manipulate ACL permissions using bitmasks +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_maximal_permset_mask_np "acl_permset_mask_t * mask_p" +.Ft int +.Fn acl_get_permset_mask_np "acl_entry_t entry_d" "acl_permset_mask_t * mask_p" +.Ft int +.Fn acl_set_permset_mask_np "acl_entry_t entry_d" "acl_permset_mask_t mask" +.Sh DESCRIPTION +The +.Fa acl_permset_mask_t +functions are a Darwin extension to the POSIX.1e ACL standard which allow +manipulation of permissions in an +.Fa acl_entry_t +using a bitmask of type +.Fa acl_permset_mask_t +rather than a constructed acl_permset_t (as done by +.Xr acl_get_permset 3 +and +.Xr acl_set_permset 3 ) . +.Pp +.Fa acl_permset_mask_t +values may be constructed using bitwise operations over +.Fa acl_perm_t +values. +.Pp +.Fn acl_maximal_permset_mask_np +sets the value pointed to by +.Fa mask_p +to a bitmask of all valid +.Fa acl_perm_t +values. +.Pp +.Fn acl_get_permset_mask_np +returns via +.Fa mask_p +a bitmask of permissions set on the ACL entry +.Fa entry_d . +.Pp +.Fn acl_set_permset_mask_np +sets the permissions of ACL entry +.Fa entry_d +to match the permission bitmask provided by +.Fa mask . +.Sh RETURN VALUES +.Rv -std acl_maximal_permset_mask_np +.Pp +.Rv -std acl_get_permset_mask_np +.Pp +.Rv -std acl_set_permset_mask_np +.Sh ERRORS +The +.Fn acl_get_permset_mask_np +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa entry_d +is not a valid descriptor for an ACL entry. +.El +.Pp +The +.Fn acl_set_permset_mask_np +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa entry_d +is not a valid descriptor for an ACL entry. +.It Bq Er EINVAL +Argument +.Fa mask +is not a valid bitmask of ACL permissions. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_perm 3 , +.Xr acl_clear_perms 3 , +.Xr acl_delete_perm 3 , +.Xr acl_get_permset 3 , +.Xr acl_set_permset 3 , +.Xr posix1e 3 +.Sh AUTHORS +.An Jeremy Huddleston diff --git a/posix1e/acl_get_qualifier.3 b/posix1e/acl_get_qualifier.3 new file mode 100644 index 0000000..85cdc8d --- /dev/null +++ b/posix1e/acl_get_qualifier.3 @@ -0,0 +1,121 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_get_qualifier.3,v 1.6 2002/12/27 12:15:28 schweikh Exp $ +.\" +.Dd March 13, 2001 +.Dt ACL_GET_QUALIFIER 3 +.Os +.Sh NAME +.Nm acl_get_qualifier +.Nd retrieve the qualifier from an ACL entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft void * +.Fn acl_get_qualifier "acl_entry_t entry_d" +.Sh DESCRIPTION +The +.Fn acl_get_qualifier +function +is a POSIX.1e call that retrieves the qualifier of the tag for +the ACL entry indicated by the argument +.Fa entry_d +into working storage and returns a pointer to that storage. +.Pp +If the value of the tag type in the ACL entry referred to by +.Fa entry_d +is +.Dv ACL_EXTENDED_ALLOW +or +.Dv ACL_EXTENDED_DENY +The value returned by +.Fn acl_get_qualifier +will be a pointer to type +.Vt guid_t . +.Pp +If the value of the tag type in the ACL entry referred to by +.Fa entry_d +is +.Dv ACL_UNDEFINED_TAG , +a tag type specified by POSIX.1e but not supported +or an implementation-defined value for which a qualifier +is not supported, then +.Fn acl_get_qualifier +will return a value of +.Vt ( void * ) Ns Dv NULL +and the function will fail. +.Pp +This function may cause memory to be allocated. The caller should +free any releasable memory, when the new qualifier is no longer +required, by calling +.Fn acl_free +with +.Vt void * +as the argument. +.Sh RETURN VALUES +The +.Fn acl_get_qualifier +function returns a pointer to the allocated storage if successful; +otherwise a +.Dv NULL +pointer is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn acl_get_qualifier +fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa entry_d +does not point to a valid descriptor for an ACL entry. The +value of the tag type in the ACL entry referenced by argument +.Fa entry_d +is not +.Dv ACL_EXTENDED_ALLOW +or +.Dv ACL_EXTENDED_DENY . +.It Bq Er ENOMEM +The value to be returned requires more memory than is allowed +by the hardware or system-imposed memory management constraints. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_create_entry 3 , +.Xr acl_free 3 , +.Xr acl_get_entry 3 , +.Xr acl_get_tag_type 3 , +.Xr acl_set_qualifier 3 , +.Xr acl_set_tag_type 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_get_tag_type.3 b/posix1e/acl_get_tag_type.3 new file mode 100644 index 0000000..0404808 --- /dev/null +++ b/posix1e/acl_get_tag_type.3 @@ -0,0 +1,76 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_get_tag_type.3,v 1.7 2002/12/27 12:15:28 schweikh Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_GET_TAG_TYPE 3 +.Os +.Sh NAME +.Nm acl_get_tag_type +.Nd retrieve the tag type from an ACL entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_get_tag_type "acl_entry_t entry_d" "acl_tag_t *tag_type_p" +.Sh DESCRIPTION +The +.Fn acl_get_tag_type +function +is a POSIX.1e call that returns the tag type for the ACL entry +.Fa entry_d . +Upon successful completion, the location referred to by the argument +.Fa tag_type_p +will be set to the tag type of the ACL entry +.Fa entry_d . +.Sh RETURN VALUES +.Rv -std acl_get_tag_type +.Sh ERRORS +The +.Fn acl_get_tag_type +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa entry_d +is not a valid descriptor for an ACL entry; +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_create_entry 3 , +.Xr acl_get_entry 3 , +.Xr acl_get_qualifier 3 , +.Xr acl_init 3 , +.Xr acl_set_qualifier 3 , +.Xr acl_set_tag_type 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_init.3 b/posix1e/acl_init.3 new file mode 100644 index 0000000..9e0feef --- /dev/null +++ b/posix1e/acl_init.3 @@ -0,0 +1,93 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_init.3,v 1.13 2002/12/29 20:52:42 rwatson Exp $ +.\" +.Dd January 28, 2000 +.Dt ACL_INIT 3 +.Os +.Sh NAME +.Nm acl_init +.Nd initialize ACL working storage +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft acl_t +.Fn acl_init "int count" +.Sh DESCRIPTION +The +.Fn acl_init +function allocates and initializes the working storage for an ACL of at +least +.Va count +ACL entries. A pointer to the working storage is returned. The working +storage allocated to contain the ACL is freed by a call to +.Xr acl_free 3 . +When the area is first allocated, it shall contain an ACL that contains +no ACL entries. +.Pp +This function may cause memory to be allocated. The caller should free any +releasable memory, when the new ACL is no longer required, by calling +.Xr acl_free 3 +with the +.Va (void*)acl_t +as an argument. +.Sh RETURN VALUES +Upon successful completion, this function shall return a pointer to the +working storage. Otherwise, a value of +.Va (acl_t)NULL +shall be returned, and +.Va errno +shall be set to indicate the error. +.Sh ERRORS +If any of the following conditions occur, the +.Fn acl_init +function shall return a value of +.Va (acl_t)NULL +and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EINVAL +The value of count is less than zero. +.It Bq Er ENOMEM +The +.Va acl_t +to be returned requires more memory than is allowed by the hardware or +system-imposed memory management constraints. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_free 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_perm.c b/posix1e/acl_perm.c new file mode 100644 index 0000000..d19e056 --- /dev/null +++ b/posix1e/acl_perm.c @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2004-2010 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include + +#include "aclvar.h" + +#if __DARWIN_ACL_READ_DATA != KAUTH_VNODE_READ_DATA +# error __DARWIN_ACL_READ_DATA != KAUTH_VNODE_READ_DATA +#endif +#if __DARWIN_ACL_LIST_DIRECTORY != KAUTH_VNODE_LIST_DIRECTORY +# error __DARWIN_ACL_LIST_DIRECTORY != KAUTH_VNODE_LIST_DIRECTORY +#endif +#if __DARWIN_ACL_WRITE_DATA != KAUTH_VNODE_WRITE_DATA +# error __DARWIN_ACL_WRITE_DATA != KAUTH_VNODE_WRITE_DATA +#endif +#if __DARWIN_ACL_ADD_FILE != KAUTH_VNODE_ADD_FILE +# error __DARWIN_ACL_ADD_FILE != KAUTH_VNODE_ADD_FILE +#endif +#if __DARWIN_ACL_EXECUTE != KAUTH_VNODE_EXECUTE +# error __DARWIN_ACL_EXECUTE != KAUTH_VNODE_EXECUTE +#endif +#if __DARWIN_ACL_SEARCH != KAUTH_VNODE_SEARCH +# error __DARWIN_ACL_SEARCH != KAUTH_VNODE_SEARCH +#endif +#if __DARWIN_ACL_DELETE != KAUTH_VNODE_DELETE +# error __DARWIN_ACL_DELETE != KAUTH_VNODE_DELETE +#endif +#if __DARWIN_ACL_APPEND_DATA != KAUTH_VNODE_APPEND_DATA +# error __DARWIN_ACL_APPEND_DATA != KAUTH_VNODE_APPEND_DATA +#endif +#if __DARWIN_ACL_ADD_SUBDIRECTORY != KAUTH_VNODE_ADD_SUBDIRECTORY +# error __DARWIN_ACL_ADD_SUBDIRECTORY != KAUTH_VNODE_ADD_SUBDIRECTORY +#endif +#if __DARWIN_ACL_DELETE_CHILD != KAUTH_VNODE_DELETE_CHILD +# error __DARWIN_ACL_DELETE_CHILD != KAUTH_VNODE_DELETE_CHILD +#endif +#if __DARWIN_ACL_READ_ATTRIBUTES != KAUTH_VNODE_READ_ATTRIBUTES +# error __DARWIN_ACL_READ_ATTRIBUTES != KAUTH_VNODE_READ_ATTRIBUTES +#endif +#if __DARWIN_ACL_WRITE_ATTRIBUTES != KAUTH_VNODE_WRITE_ATTRIBUTES +# error __DARWIN_ACL_WRITE_ATTRIBUTES != KAUTH_VNODE_WRITE_ATTRIBUTES +#endif +#if __DARWIN_ACL_READ_EXTATTRIBUTES != KAUTH_VNODE_READ_EXTATTRIBUTES +# error __DARWIN_ACL_READ_EXTATTRIBUTES != KAUTH_VNODE_READ_EXTATTRIBUTES +#endif +#if __DARWIN_ACL_WRITE_EXTATTRIBUTES != KAUTH_VNODE_WRITE_EXTATTRIBUTES +# error __DARWIN_ACL_WRITE_EXTATTRIBUTES != KAUTH_VNODE_WRITE_EXTATTRIBUTES +#endif +#if __DARWIN_ACL_READ_SECURITY != KAUTH_VNODE_READ_SECURITY +# error __DARWIN_ACL_READ_SECURITY != KAUTH_VNODE_READ_SECURITY +#endif +#if __DARWIN_ACL_WRITE_SECURITY != KAUTH_VNODE_WRITE_SECURITY +# error __DARWIN_ACL_WRITE_SECURITY != KAUTH_VNODE_WRITE_SECURITY +#endif +#if __DARWIN_ACL_CHANGE_OWNER != KAUTH_VNODE_CHANGE_OWNER +# error __DARWIN_ACL_CHANGE_OWNER != KAUTH_VNODE_CHANGE_OWNER +#endif +#if __DARWIN_ACL_SYNCHRONIZE != KAUTH_VNODE_SYNCHRONIZE +# error __DARWIN_ACL_SYNCHRONIZE != KAUTH_VNODE_SYNCHRONIZE +#endif + +int +acl_add_perm(acl_permset_t permset, acl_perm_t perm) +{ + /* XXX validate perms */ + _ACL_VALIDATE_PERM(perm); + + permset->ap_perms |= perm; + return(0); +} + +int +acl_clear_perms(acl_permset_t permset) +{ + /* XXX validate perms */ + + permset->ap_perms = 0; + return(0); +} + +int +acl_delete_perm(acl_permset_t permset, acl_perm_t perm) +{ + /* XXX validate perms */ + _ACL_VALIDATE_PERM(perm); + + permset->ap_perms &= ~perm; + return(0); +} + +int +acl_get_perm_np(acl_permset_t permset, acl_perm_t perm) +{ + _ACL_VALIDATE_PERM(perm); + + return((perm & permset->ap_perms) ? 1 : 0); +} + +int +acl_get_permset(acl_entry_t entry, acl_permset_t *permset_p) +{ + _ACL_VALIDATE_ENTRY(entry); + + *permset_p = (acl_permset_t)&entry->ae_perms; + return(0); +} + +int +acl_set_permset(acl_entry_t entry, acl_permset_t permset) +{ + _ACL_VALIDATE_ENTRY(entry); + + entry->ae_perms = permset->ap_perms; + return(0); +} + +int +acl_maximal_permset_mask_np(acl_permset_mask_t * mask_p) +{ + /* Bitwise or of all possible acl_perm_t values */ + *mask_p = _ACL_PERMS_MASK; + return (0); +} + +int +acl_get_permset_mask_np(acl_entry_t entry, acl_permset_mask_t * mask_p) +{ + _ACL_VALIDATE_ENTRY(entry); + + *mask_p = (acl_permset_mask_t)entry->ae_perms; + return (0); +} + +int +acl_set_permset_mask_np(acl_entry_t entry, acl_permset_mask_t mask) +{ + _ACL_VALIDATE_ENTRY(entry); + _ACL_VALIDATE_PERM(mask); + + entry->ae_perms = mask; + return (0); +} diff --git a/posix1e/acl_set.3 b/posix1e/acl_set.3 new file mode 100644 index 0000000..de9992c --- /dev/null +++ b/posix1e/acl_set.3 @@ -0,0 +1,134 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_set.3,v 1.16 2003/02/23 01:44:59 ru Exp $ +.\" +.Dd December 29, 2002 +.Dt ACL_SET 3 +.Os +.Sh NAME +.Nm acl_set_fd , +.Nm acl_set_fd_np , +.Nm acl_set_file , +.Nm acl_set_link_np +.Nd set an ACL for a file +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_set_fd "int fd" "acl_t acl" +.Ft int +.Fn acl_set_fd_np "int fd" "acl_t acl" "acl_type_t type" +.Ft int +.Fn acl_set_file "const char *path_p" "acl_type_t type" "acl_t acl" +.Ft int +.Fn acl_set_link_np "const char *path_p" "acl_type_t type" "acl_t acl" +.Sh DESCRIPTION +The +.Fn acl_set_fd , +.Fn acl_set_fd_np , +.Fn acl_set_file , +and +.Fn acl_set_link_np +each associate an ACL with an object referred to by +.Va fd +or +.Va path_p . +The +.Fn acl_set_fd_np +and +.Fn acl_set_link_np +functions are not POSIX.1e calls. +The +.Fn acl_set_fd +function allows only the setting of ACLs of type ACL_TYPE_EXTENDED +where as +.Fn acl_set_fd_np +allows the setting of ACLs of any type. +.Pp +The +.Fn acl_set_link_np +function acts on a symlink rather than its target, if the target of the +path is a symlink. +In the case of a symlink, this function will return an error +because ACLs are not currently supported on symlinks. +Note that the implementation is not atomic, and so the target could change +between the time it is checked as not being a symlink, and the +time the ACL is set. +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +If any of the following conditions occur, these functions shall return +-1 and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for a component of the path prefix, or the +object exists and the process does not have appropriate access rights. +.It Bq Er EBADF +The +.Va fd +argument is not a valid file descriptor. +.It Bq Er EINVAL +Argument +.Va acl +does not point to a valid ACL for this object, or the ACL type +specified in +.Va type +is invalid for this object, or both. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded 255 characters, or an +entire path name exceeded 1023 characters. +.It Bq Er ENOENT +The named object does not exist, or the +.Va path_p +argument points to an empty string. +.It Bq Er ENOMEM +Insufficient memory available to fulfill request. +.It Bq Er ENOSPC +The directory or file system that would contain the new ACL cannot be +extended, or the file system is out of file allocation resources. +.It Bq Er EOPNOTSUPP +The file system does not support ACL retrieval. +.It Bq Er EROFS +This function requires modification of a file system which is currently +read-only. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_delete 3 , +.Xr acl_get 3 , +.Xr acl_valid 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_set_flagset_np.3 b/posix1e/acl_set_flagset_np.3 new file mode 100644 index 0000000..8666f07 --- /dev/null +++ b/posix1e/acl_set_flagset_np.3 @@ -0,0 +1,72 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_set_permset.3,v 1.6 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_SET_FLAGSET_NP 3 +.Os +.Sh NAME +.Nm acl_set_flagset_np +.Nd set the flags of an ACL or ACL entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_set_flagset_np "void *obj" "acl_flagset_t flagset_d" +.Sh DESCRIPTION +The +.Fn acl_set_flagset_np +function +is a nonstandard extension that sets the permissions of the ACL or ACL entry +.Fa obj +with the flags contained in +.Fa flagset_d . +.Sh RETURN VALUES +.Rv -std acl_set_flagset_np +.Sh ERRORS +The +.Fn acl_set_flagset_np +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa obj +is not a valid descriptor for an ACL or ACL entry. Argument +.Fa flagset_d +is not a valid flagset for +.Fa obj . +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_flag_np 3 , +.Xr acl_clear_flags_np 3 , +.Xr acl_delete_flag_np 3 , +.Xr acl_get_flagset_np 3 +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_set_permset.3 b/posix1e/acl_set_permset.3 new file mode 100644 index 0000000..51dfbe6 --- /dev/null +++ b/posix1e/acl_set_permset.3 @@ -0,0 +1,72 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_set_permset.3,v 1.6 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_SET_PERMSET 3 +.Os +.Sh NAME +.Nm acl_set_permset +.Nd set the permissions of an ACL entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_set_permset "acl_entry_t entry_d" "acl_permset_t permset_d" +.Sh DESCRIPTION +The +.Fn acl_set_permset +function +is a POSIX.1e call that sets the permissions of ACL entry +.Fa entry_d +with the permissions contained in +.Fa permset_d . +.Sh RETURN VALUES +.Rv -std acl_set_permset +.Sh ERRORS +The +.Fn acl_set_permset +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa entry_d +is not a valid descriptor for an ACL entry. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_perm 3 , +.Xr acl_clear_perms 3 , +.Xr acl_delete_perm 3 , +.Xr acl_get_permset 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_set_qualifier.3 b/posix1e/acl_set_qualifier.3 new file mode 100644 index 0000000..3953b5f --- /dev/null +++ b/posix1e/acl_set_qualifier.3 @@ -0,0 +1,93 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_set_qualifier.3,v 1.5 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd Sept 2, 2008 +.Dt ACL_SET_QUALIFIER 3 +.Os +.Sh NAME +.Nm acl_set_qualifier +.Nd set ACL tag qualifier +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_set_qualifier "acl_entry_t entry_d" "const void *tag_qualifier_p" +.Sh DESCRIPTION +The +.Fn acl_set_qualifier +function +is a POSIX.1e call that sets the qualifier of the tag for the ACL entry +.Fa entry_d +to the value referred to by +.Fa tag_qualifier_p . +.Pp +The tag type of the ACL entry, as previously set with +.Xr acl_set_tag_type 3 , +must be either +.Dv ACL_EXTENDED_ALLOW +or +.Dv ACL_EXTENDED_DENY , +and +.Fa tag_qualifier_p +should be a pointer to a global unique identifier (of type +.Ft guid_t ) . +.Sh RETURN VALUES +.Rv -std acl_set_qualifier +.Sh ERRORS +The +.Fn acl_set_qualifier +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa entry_d +is not a valid descriptor for an ACL entry. The tag type of the +ACL entry +.Fa entry_d +is not +.Dv ACL_EXTENDED_ALLOW +or +.Dv ACL_EXTENDED_DENY . +The value pointed to by +.Fa tag_qualifier_p +is not valid. +.It Bq Er ENOMEM +The value to be returned requires more memory than is allowed +by the hardware or system-imposed memory management constraints. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_get_qualifier 3 , +.Xr acl_set_tag_type 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_set_tag_type.3 b/posix1e/acl_set_tag_type.3 new file mode 100644 index 0000000..c09d084 --- /dev/null +++ b/posix1e/acl_set_tag_type.3 @@ -0,0 +1,71 @@ +.\"- +.\" Copyright (c) 2001 Chris D. Faulhaber +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_set_tag_type.3,v 1.6 2002/12/18 12:45:09 ru Exp $ +.\" +.Dd March 10, 2001 +.Dt ACL_SET_TAG_TYPE 3 +.Os +.Sh NAME +.Nm acl_set_tag_type +.Nd set the tag type of an ACL entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_set_tag_type "acl_entry_t entry_d" "acl_tag_t tag_type" +.Sh DESCRIPTION +The +.Fn acl_set_tag_type +function +is a POSIX.1e call that sets the ACL tag type of ACL entry +.Fa entry_d +to the value of +.Fa tag_type . +.Sh RETURN VALUES +.Rv -std acl_set_tag_type +.Sh ERRORS +The +.Fn acl_set_tag_type +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa entry_d +is not a valid descriptor for an ACL entry. Argument +.Fa tag_type +is not a valid ACL tag type. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_get_tag_type 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Chris D. Faulhaber diff --git a/posix1e/acl_to_text.3 b/posix1e/acl_to_text.3 new file mode 100644 index 0000000..c291490 --- /dev/null +++ b/posix1e/acl_to_text.3 @@ -0,0 +1,103 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_to_text.3,v 1.15 2002/12/29 20:52:42 rwatson Exp $ +.\" +.Dd January 28, 2000 +.Dt ACL_TO_TEXT 3 +.Os +.Sh NAME +.Nm acl_to_text +.Nd convert an ACL to text +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft char * +.Fn acl_to_text "acl_t acl" "ssize_t *len_p" +.Sh DESCRIPTION +The +.Fn acl_to_text +function translates the ACL pointed to by argument +.Va acl +into a NULL terminated character string. If the pointer +.Va len_p +is not NULL, then the function shall return the length of the string (not +including the NULL terminator) in the location pointed to by +.Va len_p . +The format of the text string returned by +.Fn acl_to_text +for an ACL of type ACL_TYPE_EXTENDED differs from that specified by the +POSIX.1e standard, and this function cannot translate between formats. +.Pp +This function allocates any memory necessary to contain the string and +returns a pointer to the string. The caller should free any releasable +memory, when the new string is no longer required, by calling +.Xr acl_free 3 +with the +.Va (void*)char +as an argument. +.Sh RETURN VALUES +Upon successful completion, the function shall return a pointer to the +long text form of an ACL. Otherwise, a value of +.Va (char*)NULL +shall be returned and +.Va errno +shall be set to indicate the error. +.Sh ERRORS +If any of the following conditions occur, the +.Fn acl_to_text +function shall return a value of +.Va (acl_t)NULL +and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Va acl +does not point to a valid ACL. +.Pp +The ACL denoted by +.Va acl +contains one or more improperly formed ACL entries, or for some other +reason cannot be translated into a text form of an ACL. +.It Bq Er ENOMEM +The character string to be returned requires more memory than is allowed +by the hardware or software-imposed memory management constraints. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_free 3 , +.Xr acl_from_text 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/acl_translate.c b/posix1e/acl_translate.c new file mode 100644 index 0000000..57cb01f --- /dev/null +++ b/posix1e/acl_translate.c @@ -0,0 +1,723 @@ +/* + * Copyright (c) 2004, 2010, 2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "aclvar.h" + +/* + * NOTE: the copy_int/copy_ext functions are duplicated here, one version of each for + * each of native and portable endianity. A more elegant solution might be called for + * if the functions become much more complicated. + */ + +/* + * acl_t -> external representation, portable endianity + */ +ssize_t +acl_copy_ext(void *buf, acl_t acl, ssize_t size) +{ + struct kauth_filesec *ext = (struct kauth_filesec *)buf; + ssize_t reqsize; + int i; + + /* validate arguments, compute required size */ + reqsize = acl_size(acl); + if (reqsize < 0) + return(-1); + if (reqsize > size) { + errno = ERANGE; + return(-1); + } + + bzero(ext, reqsize); + ext->fsec_magic = OSSwapHostToBigInt32(KAUTH_FILESEC_MAGIC); + + /* special case for _FILESEC_REMOVE_ACL */ + if (acl == (acl_t)_FILESEC_REMOVE_ACL) { + ext->fsec_entrycount = OSSwapHostToBigInt32(KAUTH_FILESEC_NOACL); + return(reqsize); + } + + /* export the header */ + ext->fsec_entrycount = OSSwapHostToBigInt32(acl->a_entries); + ext->fsec_flags = OSSwapHostToBigInt32(acl->a_flags); + + /* copy ACEs */ + for (i = 0; i < acl->a_entries; i++) { + /* ACE contents are almost identical */ + ext->fsec_ace[i].ace_applicable = acl->a_ace[i].ae_applicable; + ext->fsec_ace[i].ace_flags = + OSSwapHostToBigInt32((acl->a_ace[i].ae_tag & KAUTH_ACE_KINDMASK) | (acl->a_ace[i].ae_flags & ~KAUTH_ACE_KINDMASK)); + ext->fsec_ace[i].ace_rights = OSSwapHostToBigInt32(acl->a_ace[i].ae_perms); + } + + return(reqsize); +} + +/* + * acl_t -> external representation, native system endianity + */ +ssize_t +acl_copy_ext_native(void *buf, acl_t acl, ssize_t size) +{ + struct kauth_filesec *ext = (struct kauth_filesec *)buf; + ssize_t reqsize; + int i; + + /* validate arguments, compute required size */ + reqsize = acl_size(acl); + if (reqsize < 0) + return(-1); + if (reqsize > size) { + errno = ERANGE; + return(-1); + } + + bzero(ext, reqsize); + ext->fsec_magic = KAUTH_FILESEC_MAGIC; + + /* special case for _FILESEC_REMOVE_ACL */ + if (acl == (acl_t)_FILESEC_REMOVE_ACL) { + ext->fsec_entrycount = KAUTH_FILESEC_NOACL; + return(reqsize); + } + + /* export the header */ + ext->fsec_entrycount = acl->a_entries; + ext->fsec_flags = acl->a_flags; + + /* copy ACEs */ + for (i = 0; i < acl->a_entries; i++) { + /* ACE contents are almost identical */ + ext->fsec_ace[i].ace_applicable = acl->a_ace[i].ae_applicable; + ext->fsec_ace[i].ace_flags = + (acl->a_ace[i].ae_tag & KAUTH_ACE_KINDMASK) | + (acl->a_ace[i].ae_flags & ~KAUTH_ACE_KINDMASK); + ext->fsec_ace[i].ace_rights = acl->a_ace[i].ae_perms; + } + + return(reqsize); +} + +/* + * external representation, portable system endianity -> acl_t + * + * Unlike acl_copy_ext, we can't mung the buffer as it doesn't belong to us. + */ +acl_t +acl_copy_int(const void *buf) +{ + struct kauth_filesec *ext = (struct kauth_filesec *)buf; + acl_t ap; + int i; + + if (ext->fsec_magic != OSSwapHostToBigInt32(KAUTH_FILESEC_MAGIC)) { + errno = EINVAL; + return(NULL); + } + + if ((ap = acl_init(OSSwapBigToHostInt32(ext->fsec_entrycount))) != NULL) { + /* copy useful header fields */ + ap->a_flags = OSSwapBigToHostInt32(ext->fsec_flags); + ap->a_entries = OSSwapBigToHostInt32(ext->fsec_entrycount); + /* copy ACEs */ + for (i = 0; i < ap->a_entries; i++) { + /* ACE contents are literally identical */ + ap->a_ace[i].ae_magic = _ACL_ENTRY_MAGIC; + ap->a_ace[i].ae_applicable = ext->fsec_ace[i].ace_applicable; + ap->a_ace[i].ae_flags = OSSwapBigToHostInt32(ext->fsec_ace[i].ace_flags) & ~KAUTH_ACE_KINDMASK; + ap->a_ace[i].ae_tag = OSSwapBigToHostInt32(ext->fsec_ace[i].ace_flags) & KAUTH_ACE_KINDMASK; + ap->a_ace[i].ae_perms = OSSwapBigToHostInt32(ext->fsec_ace[i].ace_rights); + } + } + return(ap); +} + +/* + * external representation, native system endianity -> acl_t + */ +acl_t +acl_copy_int_native(const void *buf) +{ + struct kauth_filesec *ext = (struct kauth_filesec *)buf; + acl_t ap; + int i; + + if (ext->fsec_magic != KAUTH_FILESEC_MAGIC) { + errno = EINVAL; + return(NULL); + } + + if ((ap = acl_init(ext->fsec_entrycount)) != NULL) { + /* copy useful header fields */ + ap->a_flags = ext->fsec_flags; + ap->a_entries = ext->fsec_entrycount; + /* copy ACEs */ + for (i = 0; i < ap->a_entries; i++) { + /* ACE contents are literally identical */ + ap->a_ace[i].ae_magic = _ACL_ENTRY_MAGIC; + ap->a_ace[i].ae_applicable = ext->fsec_ace[i].ace_applicable; + ap->a_ace[i].ae_flags = ext->fsec_ace[i].ace_flags & ~KAUTH_ACE_KINDMASK; + ap->a_ace[i].ae_tag = ext->fsec_ace[i].ace_flags & KAUTH_ACE_KINDMASK; + ap->a_ace[i].ae_perms = ext->fsec_ace[i].ace_rights; + } + } + return(ap); +} + +#define ACL_TYPE_DIR (1<<0) +#define ACL_TYPE_FILE (1<<1) +#define ACL_TYPE_ACL (1<<2) + +static struct { + acl_perm_t perm; + char *name; + int type; +} acl_perms[] = { + {ACL_READ_DATA, "read", ACL_TYPE_FILE}, +// {ACL_LIST_DIRECTORY, "list", ACL_TYPE_DIR}, + {ACL_WRITE_DATA, "write", ACL_TYPE_FILE}, +// {ACL_ADD_FILE, "add_file", ACL_TYPE_DIR}, + {ACL_EXECUTE, "execute", ACL_TYPE_FILE}, +// {ACL_SEARCH, "search", ACL_TYPE_DIR}, + {ACL_DELETE, "delete", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_APPEND_DATA, "append", ACL_TYPE_FILE}, +// {ACL_ADD_SUBDIRECTORY, "add_subdirectory", ACL_TYPE_DIR}, + {ACL_DELETE_CHILD, "delete_child", ACL_TYPE_DIR}, + {ACL_READ_ATTRIBUTES, "readattr", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_WRITE_ATTRIBUTES, "writeattr", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_READ_EXTATTRIBUTES, "readextattr", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_WRITE_EXTATTRIBUTES, "writeextattr", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_READ_SECURITY, "readsecurity", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_WRITE_SECURITY, "writesecurity", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_CHANGE_OWNER, "chown", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_SYNCHRONIZE, "synchronize", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {0, NULL, 0} +}; + +static struct { + acl_flag_t flag; + char *name; + int type; +} acl_flags[] = { + {ACL_ENTRY_INHERITED, "inherited", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_FLAG_DEFER_INHERIT, "defer_inherit", ACL_TYPE_ACL}, + {ACL_ENTRY_FILE_INHERIT, "file_inherit", ACL_TYPE_DIR}, + {ACL_ENTRY_DIRECTORY_INHERIT, "directory_inherit", ACL_TYPE_DIR}, + {ACL_ENTRY_LIMIT_INHERIT, "limit_inherit", ACL_TYPE_FILE | ACL_TYPE_DIR}, + {ACL_ENTRY_ONLY_INHERIT, "only_inherit", ACL_TYPE_DIR}, + {ACL_FLAG_NO_INHERIT, "no_inherit", ACL_TYPE_ACL}, + {0, NULL, 0} +}; + +/* + * reallocing snprintf with offset + */ +static int +raosnprintf(char **buf, size_t *size, ssize_t *offset, char *fmt, ...) +{ + va_list ap; + int ret; + + do + { + if (*offset < *size) + { + va_start(ap, fmt); + ret = vsnprintf(*buf + *offset, *size - *offset, fmt, ap); + va_end(ap); + if (ret < (*size - *offset)) + { + *offset += ret; + return ret; + } + } + *buf = reallocf(*buf, (*size *= 2)); + } while (*buf); + + //warn("reallocf failure"); + return 0; +} + +static char * +uuid_to_name(uuid_t *uu, uid_t *id, int *isgid) +{ + struct group *tgrp = NULL; + struct passwd *tpass = NULL; + + if (0 == mbr_uuid_to_id(*uu, id, isgid)) + { + switch (*isgid) + { + case ID_TYPE_UID: + if (!(tpass = getpwuid(*id))) + goto errout; + return strdup(tpass->pw_name); + break; + case ID_TYPE_GID: + if (!(tgrp = getgrgid((gid_t) *id))) + goto errout; + return strdup(tgrp->gr_name); + break; + default: +errout: ; //warn("Unable to translate qualifier on ACL\n"); + } + } + return NULL; +} + +acl_t +acl_from_text(const char *buf_p) +{ + int i, error = 0, need_tag, ug_tag; + char *buf, *orig_buf; + char *entry, *field, *sub; + uuid_t *uu = NULL; + struct passwd *tpass = NULL; + struct group *tgrp = NULL; + acl_entry_t acl_entry; + acl_flagset_t flags = NULL; + acl_permset_t perms = NULL; + acl_tag_t tag; + acl_t acl_ret; + + if (buf_p == NULL) + { + errno = EINVAL; + return NULL; + } + + if ((buf = strdup(buf_p)) == NULL) + return NULL; + + if ((acl_ret = acl_init(1)) == NULL) + return NULL; + + orig_buf = buf; + + /* global acl flags + * format: !#acl [] + */ + if ((entry = strsep(&buf, "\n")) != NULL && *entry) + { + /* field 1: !#acl */ + field = strsep(&entry, " "); + if (*field && strncmp(field, "!#acl", strlen("!#acl"))) + { + error = EINVAL; + goto exit; + } + + /* field 2: + * currently only accepts 1 + */ + field = strsep(&entry, " "); + errno = 0; + if (field == NULL || !*field || strtol(field, NULL, 0) != 1) + { + error = EINVAL; + goto exit; + } + + /* field 3: + * optional + */ + if((field = strsep(&entry, " ")) != NULL && *field) + { + acl_get_flagset_np(acl_ret, &flags); + while ((sub = strsep(&field, ",")) && *sub) + { + for (i = 0; acl_flags[i].name != NULL; ++i) + { + if (acl_flags[i].type & ACL_TYPE_ACL + && !strcmp(acl_flags[i].name, sub)) + { + acl_add_flag_np(flags, acl_flags[i].flag); + break; + } + } + if (acl_flags[i].name == NULL) + { + /* couldn't find flag */ + error = EINVAL; + goto exit; + } + } + } + } else { + error = EINVAL; + goto exit; + } + + /* parse each acl line + * format: : + * []: + * []: + * []: + * [,] + * [:[,]] + * + * only one of the user/group identifies is required + * the first one found is used + */ + while ((entry = strsep(&buf, "\n")) && *entry) + { + need_tag = 1; + ug_tag = -1; + + /* field 1: */ + field = strsep(&entry, ":"); + + if(uu) + bzero(uu, sizeof(uuid_t)); + else if((uu = calloc(1, sizeof(uuid_t))) == NULL) + { + error = errno; + goto exit; + } + + if(acl_create_entry(&acl_ret, &acl_entry)) + { + error = errno; + goto exit; + } + + if (-1 == acl_get_flagset_np(acl_entry, &flags) + || -1 == acl_get_permset(acl_entry, &perms)) + { + error = errno; + goto exit; + } + + switch(*field) + { + case 'u': + if(!strcmp(field, "user")) + ug_tag = ID_TYPE_UID; + break; + case 'g': + if(!strcmp(field, "group")) + ug_tag = ID_TYPE_GID; + break; + default: + error = EINVAL; + goto exit; + } + + /* field 2: */ + if ((field = strsep(&entry, ":")) != NULL && *field) + { + uuid_parse(field, *uu); + need_tag = 0; + } + + /* field 3: */ + if ((field = strsep(&entry, ":")) != NULL && *field && need_tag) + { + switch(ug_tag) + { + case ID_TYPE_UID: + if((tpass = getpwnam(field)) != NULL) + if (mbr_uid_to_uuid(tpass->pw_uid, *uu) != 0) + { + error = EINVAL; + goto exit; + } + break; + case ID_TYPE_GID: + if ((tgrp = getgrnam(field)) != NULL) + if (mbr_gid_to_uuid(tgrp->gr_gid, *uu) != 0) + { + error = EINVAL; + goto exit; + } + break; + default: + error = EINVAL; + goto exit; + } + need_tag = 0; + } + + /* field 4: */ + if ((field = strsep(&entry, ":")) != NULL && *field && need_tag) + { + uid_t id; + error = 0; + + if((id = strtol(field, NULL, 10)) == 0 && error) + { + error = EINVAL; + goto exit; + } + + switch(ug_tag) + { + case ID_TYPE_UID: + if((tpass = getpwuid((uid_t)id)) != NULL) + if (mbr_uid_to_uuid(tpass->pw_uid, *uu) != 0) + { + error = EINVAL; + goto exit; + } + break; + case ID_TYPE_GID: + if ((tgrp = getgrgid((gid_t)id)) != NULL) + if (mbr_gid_to_uuid(tgrp->gr_gid, *uu) != 0) + { + error = EINVAL; + goto exit; + } + break; + } + need_tag = 0; + } + + /* sanity check: nothing set as qualifier */ + if (need_tag) + { + error = EINVAL; + goto exit; + } + + /* field 5: */ + if((field = strsep(&entry, ":")) == NULL || !*field) + { + error = EINVAL; + goto exit; + } + + for (tag = 0; (sub = strsep(&field, ",")) && *sub;) + { + if (!tag) + { + if (!strcmp(sub, "allow")) + tag = ACL_EXTENDED_ALLOW; + else if (!strcmp(sub, "deny")) + tag = ACL_EXTENDED_DENY; + else { + error = EINVAL; + goto exit; + } + continue; + } + + for (i = 0; acl_flags[i].name != NULL; ++i) + { + if (acl_flags[i].type & (ACL_TYPE_FILE | ACL_TYPE_DIR) + && !strcmp(acl_flags[i].name, sub)) + { + acl_add_flag_np(flags, acl_flags[i].flag); + break; + } + } + if (acl_flags[i].name == NULL) + { + /* couldn't find perm */ + error = EINVAL; + goto exit; + } + } + + /* field 6: (can be empty) */ + if((field = strsep(&entry, ":")) != NULL && *field) + { + while ((sub = strsep(&field, ",")) && *sub) + { + for (i = 0; acl_perms[i].name != NULL; i++) + { + if (acl_perms[i].type & (ACL_TYPE_FILE | ACL_TYPE_DIR) + && !strcmp(acl_perms[i].name, sub)) + { + acl_add_perm(perms, acl_perms[i].perm); + break; + } + } + if (acl_perms[i].name == NULL) + { + /* couldn't find perm */ + error = EINVAL; + goto exit; + } + } + } + acl_set_tag_type(acl_entry, tag); + acl_set_qualifier(acl_entry, *uu); + } +exit: + if(uu) + free(uu); + free(orig_buf); + if (error) + { + acl_free(acl_ret); + acl_ret = NULL; + errno = error; + } + return acl_ret; +} + +char * +acl_to_text(acl_t acl, ssize_t *len_p) +{ + acl_tag_t tag; + acl_entry_t entry = NULL; + acl_flagset_t flags; + acl_permset_t perms; + uid_t id; + int i, first; + int isgid; + size_t bufsize = 1024; + char *buf = NULL; + + if (!_ACL_VALID_ACL(acl)) { + errno = EINVAL; + return NULL; + } + + if (len_p == NULL) + if ((len_p = alloca(sizeof(ssize_t))) == NULL) + goto err_nomem; + + *len_p = 0; + + if ((buf = malloc(bufsize)) == NULL) + goto err_nomem; + + if (!raosnprintf(&buf, &bufsize, len_p, "!#acl %d", 1)) + goto err_nomem; + + if (acl_get_flagset_np(acl, &flags) == 0) + { + for (i = 0, first = 0; acl_flags[i].name != NULL; ++i) + { + if (acl_flags[i].type & ACL_TYPE_ACL + && acl_get_flag_np(flags, acl_flags[i].flag) != 0) + { + if(!raosnprintf(&buf, &bufsize, len_p, "%s%s", + first++ ? "," : " ", acl_flags[i].name)) + goto err_nomem; + } + } + } + for (;acl_get_entry(acl, + entry == NULL ? ACL_FIRST_ENTRY : ACL_NEXT_ENTRY, &entry) == 0;) + { + int valid; + uuid_t *uu; + char *str, uu_str[37]; + + if (((uu = (uuid_t *) acl_get_qualifier(entry)) == NULL) + || (acl_get_tag_type(entry, &tag) != 0) + || (acl_get_flagset_np(entry, &flags) != 0) + || (acl_get_permset(entry, &perms) != 0)) { + if (uu != NULL) acl_free(uu); + continue; + } + + uuid_unparse_upper(*uu, uu_str); + + if ((str = uuid_to_name(uu, &id, &isgid)) != NULL) { + valid = raosnprintf(&buf, &bufsize, len_p, "\n%s:%s:%s:%d:%s", + isgid ? "group" : "user", + uu_str, + str, + id, + (tag == ACL_EXTENDED_ALLOW) ? "allow" : "deny"); + } else { + valid = raosnprintf(&buf, &bufsize, len_p, "\nuser:%s:::%s", + uu_str, + (tag == ACL_EXTENDED_ALLOW) ? "allow" : "deny"); + } + + free(str); + acl_free(uu); + + if (!valid) + goto err_nomem; + + for (i = 0; acl_flags[i].name != NULL; ++i) + { + if (acl_flags[i].type & (ACL_TYPE_DIR | ACL_TYPE_FILE)) + { + if(acl_get_flag_np(flags, acl_flags[i].flag) != 0) + { + if(!raosnprintf(&buf, &bufsize, len_p, ",%s", + acl_flags[i].name)) + goto err_nomem; + } + } + } + + for (i = 0, first = 0; acl_perms[i].name != NULL; ++i) + { + if (acl_perms[i].type & (ACL_TYPE_DIR | ACL_TYPE_FILE)) + { + if(acl_get_perm_np(perms, acl_perms[i].perm) != 0) + { + if(!raosnprintf(&buf, &bufsize, len_p, "%s%s", + first++ ? "," : ":", acl_perms[i].name)) + goto err_nomem; + } + } + } + } + + if(!raosnprintf(&buf, &bufsize, len_p, "\n")) goto err_nomem; + return buf; + +err_nomem: + if (buf != NULL) + free(buf); + + errno = ENOMEM; + return NULL; +} + +ssize_t +acl_size(acl_t acl) +{ + /* special case for _FILESEC_REMOVE_ACL */ + if (acl == (acl_t)_FILESEC_REMOVE_ACL) + return KAUTH_FILESEC_SIZE(0); + + _ACL_VALIDATE_ACL(acl); + + return(KAUTH_FILESEC_SIZE(acl->a_entries)); +} diff --git a/posix1e/acl_valid.3 b/posix1e/acl_valid.3 new file mode 100644 index 0000000..a9eae88 --- /dev/null +++ b/posix1e/acl_valid.3 @@ -0,0 +1,132 @@ +.\"- +.\" Copyright (c) 2000, 2002 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by Robert Watson for the TrustedBSD Project. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/posix1e/acl_valid.3,v 1.14 2002/12/29 20:47:05 rwatson Exp $ +.\" +.Dd December 29, 2002 +.Dt ACL_VALID 3 +.Os +.Sh NAME +.Nm acl_valid , +.Nm acl_valid_fd_np , +.Nm acl_valid_file_np , +.Nm acl_valid_link_np +.Nd validate an ACL +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_valid "acl_t acl" +.Ft int +.Fn acl_valid_fd_np "int fd" "acl_type_t type" "acl_t acl" +.Ft int +.Fn acl_valid_file_np "const char *path_p" "acl_type_t type" "acl_t acl" +.Ft int +.Fn acl_valid_link_np "const char *path_p" "acl_type_t type" "acl_t acl" +.Sh DESCRIPTION +These functions check that the ACL referred to by the argument +.Va acl +is valid. The POSIX.1e routine, +.Fn acl_valid , +checks assumes ACL_TYPE_EXTENDED, and disregard +of the context in which the ACL is to be used. The non-portable forms, +.Fn acl_valid_fd_np , +.Fn acl_valid_file_np , +and +.Fn acl_valid_link_np +allow an ACL to be checked in the context of a specific acl type, +.Va type , +and file system object. +In environments where additional ACL types are +supported than just POSIX.1e, this makes more sense. +Whereas +.Fn acl_valid_file_np +will follow the symlink if the specified path is to a symlink, +.Fn acl_valid_link_np +will not. +.Pp +The qualifier field shall be unique among all entries of +the same POSIX.1e ACL facility defined tag type. The +tag type field shall contain valid values including any +implementation-defined values. Validation of the values +of the qualifier field is implementation-defined. +.Pp +The POSIX.1e +.Fn acl_valid +function may reorder the ACL for the purposes of verification; the +non-portable validation functions will not. +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +If any of the following conditions occur, these functions shall return +-1 and set +.Va errno +to the corresponding value: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for a component of the path prefix, or the +object exists and the process does not have appropriate access rights. +.It Bq Er EBADF +The +.Va fd +argument is not a valid file descriptor. +.It Bq Er EINVAL +Argument +.Va acl +does not point to a valid ACL. +.Pp +One or more of the required ACL entries is not present in +.Va acl . +.Pp +The ACL contains entries that are not unique. +.Pp +The file system rejects the ACL based on fs-specific semantics issues. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded 255 characters, or an +entire path name exceeded 1023 characters. +.It Bq Er ENOENT +The named object does not exist, or the +.Va path_p +argument points to an empty string. +.It Bq Er ENOMEM +Insufficient memory available to fulfill request. +.It Bq Er EOPNOTSUPP +The file system does not support ACL retrieval. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_get 3 , +.Xr acl_init 3 , +.Xr acl_set 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh AUTHORS +.An Michael Smith +.An Robert N M Watson diff --git a/posix1e/aclvar.h b/posix1e/aclvar.h new file mode 100644 index 0000000..4480037 --- /dev/null +++ b/posix1e/aclvar.h @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2004, 2008, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _ACLVAR_H +#define _ACLVAR_H + +#include + +/* + * Internal access control list entry representation. + */ +struct _acl_entry { + u_int32_t ae_magic; +#define _ACL_ENTRY_MAGIC 0xac1ac101 + u_int32_t ae_tag; + guid_t ae_applicable; + u_int32_t ae_flags; + u_int32_t ae_perms; +}; + +/* + * Internal representation of an ACL. + * XXX static allocation is wasteful. + */ +struct _acl { + u_int32_t a_magic; +#define _ACL_ACL_MAGIC 0xac1ac102 + unsigned a_entries; + int a_last_get; + u_int32_t a_flags; + struct _acl_entry a_ace[ACL_MAX_ENTRIES]; +}; + +/* + * ACL/entry flags. + */ +struct _acl_flagset { + u_int32_t af_flags; +}; + +/* + * ACL entry permissions. + */ +struct _acl_permset { + u_int32_t ap_perms; +}; + +/* + * Argument validation. + */ +/* + * Because of the use of special values for structure pointer (like + * _FILESEC_REMOVE_ACL), dereferences causes crashes. Rather than try to + * enumerate all such special values, we will assume there are a small + * number of these values, centered about zero, so we can just check the + * values are in this range. We have to do the check for both ACLs and + * ACEs, because the API uses the same routines on ACLs and ACEs. + */ + +#define _ACL_SPECIAL_RANGE 16 + +#define _ACL_VALID_ENTRY(_e) ((((intptr_t)(_e)) > _ACL_SPECIAL_RANGE || ((intptr_t)(_e)) < -(_ACL_SPECIAL_RANGE)) && (_e)->ae_magic == _ACL_ENTRY_MAGIC) + +#define _ACL_VALID_ACL(_a) ((((intptr_t)(_a)) > _ACL_SPECIAL_RANGE || ((intptr_t)(_a)) < -(_ACL_SPECIAL_RANGE)) && (_a)->a_magic == _ACL_ACL_MAGIC) + +#define _ACL_ENTRY_CONTAINED(_a, _e) \ + ((_e) >= &(_a)->a_ace[0]) && ((_e) < &(_a)->a_ace[ACL_MAX_ENTRIES]) + +#define _ACL_VALID_FLAG(_f) (((_f) & _ACL_FLAGS_MASK) == (_f)) + +#define _ACL_VALID_ENTRY_FLAG(_f) (((_f) & _ACL_ENTRY_FLAGS_MASK) == (_f)) + +#define _ACL_PERMS_MASK (ACL_READ_DATA | \ + ACL_LIST_DIRECTORY | \ + ACL_WRITE_DATA | \ + ACL_ADD_FILE | \ + ACL_EXECUTE | \ + ACL_SEARCH | \ + ACL_DELETE | \ + ACL_APPEND_DATA | \ + ACL_ADD_SUBDIRECTORY | \ + ACL_DELETE_CHILD | \ + ACL_READ_ATTRIBUTES | \ + ACL_WRITE_ATTRIBUTES | \ + ACL_READ_EXTATTRIBUTES | \ + ACL_WRITE_EXTATTRIBUTES | \ + ACL_READ_SECURITY | \ + ACL_WRITE_SECURITY | \ + ACL_CHANGE_OWNER | \ + ACL_SYNCHRONIZE) + +#define _ACL_VALID_PERM(_f) (((_f) & ~_ACL_PERMS_MASK) == 0) + +#define _ACL_VALIDATE_ACL(_a) \ +do { \ + if (!_ACL_VALID_ACL((_a))) { \ + errno = EINVAL; \ + return(-1); \ + } \ +} while (0) + +#define _ACL_VALIDATE_ENTRY(_e) \ +do { \ + if (!_ACL_VALID_ENTRY((_e))) { \ + errno = EINVAL; \ + return(-1); \ + } \ +} while (0) + +#define _ACL_VALIDATE_ENTRY_CONTAINED(_a, _e) \ +do { \ + if (!_ACL_ENTRY_CONTAINED((_a), (_e))) { \ + errno = EINVAL; \ + return(-1); \ + } \ +} while (0) + +#define _ACL_VALIDATE_FLAG(_f) \ +do { \ + if (!_ACL_VALID_FLAG((_f))) { \ + errno = EINVAL; \ + return(-1); \ + } \ +} while (0) + +#define _ACL_VALIDATE_ENTRY_FLAG(_f) \ +do { \ + if (!_ACL_VALID_ENTRY_FLAG((_f))) { \ + errno = EINVAL; \ + return(-1); \ + } \ +} while (0) + +#define _ACL_VALIDATE_PERM(_f) \ +do { \ + if (!_ACL_VALID_PERM((_f))) { \ + errno = EINVAL; \ + return(-1); \ + } \ +} while (0) + +#endif /* _ACLVAR_H */ diff --git a/private-include/_ctype.h b/private-include/_ctype.h new file mode 100644 index 0000000..ba38603 --- /dev/null +++ b/private-include/_ctype.h @@ -0,0 +1,452 @@ +/* + * Copyright (c) 2000, 2005, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ctype.h 8.4 (Berkeley) 1/21/94 + */ + +//Begin-Libc +#include "xlocale_private.h" +//End-Libc +#ifndef __CTYPE_H_ +#define __CTYPE_H_ + +#include +#include + +#define _CTYPE_A 0x00000100L /* Alpha */ +#define _CTYPE_C 0x00000200L /* Control */ +#define _CTYPE_D 0x00000400L /* Digit */ +#define _CTYPE_G 0x00000800L /* Graph */ +#define _CTYPE_L 0x00001000L /* Lower */ +#define _CTYPE_P 0x00002000L /* Punct */ +#define _CTYPE_S 0x00004000L /* Space */ +#define _CTYPE_U 0x00008000L /* Upper */ +#define _CTYPE_X 0x00010000L /* X digit */ +#define _CTYPE_B 0x00020000L /* Blank */ +#define _CTYPE_R 0x00040000L /* Print */ +#define _CTYPE_I 0x00080000L /* Ideogram */ +#define _CTYPE_T 0x00100000L /* Special */ +#define _CTYPE_Q 0x00200000L /* Phonogram */ +#define _CTYPE_SW0 0x20000000L /* 0 width character */ +#define _CTYPE_SW1 0x40000000L /* 1 width character */ +#define _CTYPE_SW2 0x80000000L /* 2 width character */ +#define _CTYPE_SW3 0xc0000000L /* 3 width character */ +#define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */ +#define _CTYPE_SWS 30 /* Bits to shift to get width */ + +#ifdef _NONSTD_SOURCE +/* + * Backward compatibility + */ +#define _A _CTYPE_A /* Alpha */ +#define _C _CTYPE_C /* Control */ +#define _D _CTYPE_D /* Digit */ +#define _G _CTYPE_G /* Graph */ +#define _L _CTYPE_L /* Lower */ +#define _P _CTYPE_P /* Punct */ +#define _S _CTYPE_S /* Space */ +#define _U _CTYPE_U /* Upper */ +#define _X _CTYPE_X /* X digit */ +#define _B _CTYPE_B /* Blank */ +#define _R _CTYPE_R /* Print */ +#define _I _CTYPE_I /* Ideogram */ +#define _T _CTYPE_T /* Special */ +#define _Q _CTYPE_Q /* Phonogram */ +#define _SW0 _CTYPE_SW0 /* 0 width character */ +#define _SW1 _CTYPE_SW1 /* 1 width character */ +#define _SW2 _CTYPE_SW2 /* 2 width character */ +#define _SW3 _CTYPE_SW3 /* 3 width character */ +#endif /* _NONSTD_SOURCE */ + +//Begin-Libc +/* + * _EXTERNALIZE_CTYPE_INLINES_ is defined in locale/nomacros.c to tell us + * to generate code for extern versions of all intermediate inline functions. + */ +#ifdef _EXTERNALIZE_CTYPE_INLINES_ +#define _USE_CTYPE_INLINE_ +#define __DARWIN_CTYPE_inline +#else /* !_EXTERNALIZE_CTYPE_INLINES_ */ +//End-Libc +#define __DARWIN_CTYPE_inline __header_inline +//Begin-Libc +#endif /* !_EXTERNALIZE_CTYPE_INLINES_ */ +//End-Libc + +//Begin-Libc +/* + * _EXTERNALIZE_CTYPE_INLINES_TOP_ is defined in locale/isctype.c to tell us + * to generate code for extern versions of all top-level inline functions. + */ +#ifdef _EXTERNALIZE_CTYPE_INLINES_TOP_ +#define _USE_CTYPE_INLINE_ +#define __DARWIN_CTYPE_TOP_inline +#else /* !_EXTERNALIZE_CTYPE_INLINES_TOP_ */ +//End-Libc +#define __DARWIN_CTYPE_TOP_inline __header_inline +//Begin-Libc +#endif /* _EXTERNALIZE_CTYPE_INLINES_TOP_ */ +//End-Libc + +/* + * Use inline functions if we are allowed to and the compiler supports them. + */ +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +/* See comments in about __darwin_ct_rune_t. */ +__BEGIN_DECLS +unsigned long ___runetype(__darwin_ct_rune_t); +__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t); +__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t); +__END_DECLS + +__DARWIN_CTYPE_TOP_inline int +isascii(int _c) +{ + return ((_c & ~0x7F) == 0); +} + +#ifdef USE_ASCII +__DARWIN_CTYPE_inline int +__maskrune(__darwin_ct_rune_t _c, unsigned long _f) +{ + return (int)_DefaultRuneLocale.__runetype[_c & 0xff] & (__uint32_t)_f; +} +//Begin-Libc +#elif defined(__LIBC__) +__DARWIN_CTYPE_inline int +__maskrune(__darwin_ct_rune_t _c, unsigned long _f) +{ + /* _CurrentRuneLocale.__runetype[_c] is __uint32_t + * _f is unsigned long + * ___runetype(_c) is unsigned long + * retval is int + */ + return (int)((_c < 0 || _c >= _CACHED_RUNES) ? (__uint32_t)___runetype(_c) : + __current_locale()->__lc_ctype->_CurrentRuneLocale.__runetype[_c]) & (__uint32_t)_f; +} +//End-Libc +#else /* !USE_ASCII */ +__BEGIN_DECLS +int __maskrune(__darwin_ct_rune_t, unsigned long); +__END_DECLS +#endif /* USE_ASCII */ + +__DARWIN_CTYPE_inline int +__istype(__darwin_ct_rune_t _c, unsigned long _f) +{ +#ifdef USE_ASCII + return !!(__maskrune(_c, _f)); +#else /* USE_ASCII */ + return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f) + : !!__maskrune(_c, _f)); +#endif /* USE_ASCII */ +} + +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__isctype(__darwin_ct_rune_t _c, unsigned long _f) +{ +#ifdef USE_ASCII + return !!(__maskrune(_c, _f)); +#else /* USE_ASCII */ + return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : + !!(_DefaultRuneLocale.__runetype[_c] & _f); +#endif /* USE_ASCII */ +} + +#ifdef USE_ASCII +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__toupper(__darwin_ct_rune_t _c) +{ + return _DefaultRuneLocale.__mapupper[_c & 0xff]; +} + +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__tolower(__darwin_ct_rune_t _c) +{ + return _DefaultRuneLocale.__maplower[_c & 0xff]; +} +//Begin-Libc +#elif defined(__LIBC__) +/* + * We can't do what we do for __toupper_l() (check for ASCII first, then call + * ___toupper_l() otherwise) because versions of ___toupper() before Tiger + * assume c >= _CACHED_RUNES. So we are stuck making __toupper() a routine + * to hide the extended locale details, outside of Libc. + */ +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__toupper(__darwin_ct_rune_t _c) +{ + return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : + __current_locale()->__lc_ctype->_CurrentRuneLocale.__mapupper[_c]; +} + +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__tolower(__darwin_ct_rune_t _c) +{ + return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : + __current_locale()->__lc_ctype->_CurrentRuneLocale.__maplower[_c]; +} +//End-Libc +#else /* !USE_ASCII */ +__BEGIN_DECLS +__darwin_ct_rune_t __toupper(__darwin_ct_rune_t); +__darwin_ct_rune_t __tolower(__darwin_ct_rune_t); +__END_DECLS +#endif /* USE_ASCII */ + +__DARWIN_CTYPE_inline int +__wcwidth(__darwin_ct_rune_t _c) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R); + if ((_x & _CTYPE_SWM) != 0) + return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); + return ((_x & _CTYPE_R) != 0 ? 1 : -1); +} + +#ifndef _EXTERNALIZE_CTYPE_INLINES_ + +#define _tolower(c) __tolower(c) +#define _toupper(c) __toupper(c) + +__DARWIN_CTYPE_TOP_inline int +isalnum(int _c) +{ + return (__istype(_c, _CTYPE_A|_CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_inline int +isalpha(int _c) +{ + return (__istype(_c, _CTYPE_A)); +} + +__DARWIN_CTYPE_TOP_inline int +isblank(int _c) +{ + return (__istype(_c, _CTYPE_B)); +} + +__DARWIN_CTYPE_TOP_inline int +iscntrl(int _c) +{ + return (__istype(_c, _CTYPE_C)); +} + +/* ANSI -- locale independent */ +__DARWIN_CTYPE_TOP_inline int +isdigit(int _c) +{ + return (__isctype(_c, _CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_inline int +isgraph(int _c) +{ + return (__istype(_c, _CTYPE_G)); +} + +__DARWIN_CTYPE_TOP_inline int +islower(int _c) +{ + return (__istype(_c, _CTYPE_L)); +} + +__DARWIN_CTYPE_TOP_inline int +isprint(int _c) +{ + return (__istype(_c, _CTYPE_R)); +} + +__DARWIN_CTYPE_TOP_inline int +ispunct(int _c) +{ + return (__istype(_c, _CTYPE_P)); +} + +__DARWIN_CTYPE_TOP_inline int +isspace(int _c) +{ + return (__istype(_c, _CTYPE_S)); +} + +__DARWIN_CTYPE_TOP_inline int +isupper(int _c) +{ + return (__istype(_c, _CTYPE_U)); +} + +/* ANSI -- locale independent */ +__DARWIN_CTYPE_TOP_inline int +isxdigit(int _c) +{ + return (__isctype(_c, _CTYPE_X)); +} + +__DARWIN_CTYPE_TOP_inline int +toascii(int _c) +{ + return (_c & 0x7F); +} + +__DARWIN_CTYPE_TOP_inline int +tolower(int _c) +{ + return (__tolower(_c)); +} + +__DARWIN_CTYPE_TOP_inline int +toupper(int _c) +{ + return (__toupper(_c)); +} + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +__DARWIN_CTYPE_TOP_inline int +digittoint(int _c) +{ + return (__maskrune(_c, 0x0F)); +} + +__DARWIN_CTYPE_TOP_inline int +ishexnumber(int _c) +{ + return (__istype(_c, _CTYPE_X)); +} + +__DARWIN_CTYPE_TOP_inline int +isideogram(int _c) +{ + return (__istype(_c, _CTYPE_I)); +} + +__DARWIN_CTYPE_TOP_inline int +isnumber(int _c) +{ + return (__istype(_c, _CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_inline int +isphonogram(int _c) +{ + return (__istype(_c, _CTYPE_Q)); +} + +__DARWIN_CTYPE_TOP_inline int +isrune(int _c) +{ + return (__istype(_c, 0xFFFFFFF0L)); +} + +__DARWIN_CTYPE_TOP_inline int +isspecial(int _c) +{ + return (__istype(_c, _CTYPE_T)); +} +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* _EXTERNALIZE_CTYPE_INLINES_ */ + +#else /* not using inlines */ + +__BEGIN_DECLS +int isalnum(int); +int isalpha(int); +int isblank(int); +int iscntrl(int); +int isdigit(int); +int isgraph(int); +int islower(int); +int isprint(int); +int ispunct(int); +int isspace(int); +int isupper(int); +int isxdigit(int); +int tolower(int); +int toupper(int); +int isascii(int); +int toascii(int); + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int _tolower(int); +int _toupper(int); +int digittoint(int); +int ishexnumber(int); +int isideogram(int); +int isnumber(int); +int isphonogram(int); +int isrune(int); +int isspecial(int); +#endif +__END_DECLS + +#endif /* using inlines */ + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_CTYPE_H_ */ diff --git a/private-include/dirent.h b/private-include/dirent.h new file mode 100644 index 0000000..c8e0e0c --- /dev/null +++ b/private-include/dirent.h @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2000, 2002-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)dirent.h 8.2 (Berkeley) 7/28/94 + */ + +#ifndef _DIRENT_H_ +#define _DIRENT_H_ + +/* + * The kernel defines the format of directory entries + */ +#include <_types.h> +#include +#include +#include +#include /* __darwin_pthread_mutex_t */ + +struct _telldir; /* forward reference */ + +/* structure describing an open directory. */ +typedef struct { + int __dd_fd; /* file descriptor associated with directory */ + long __dd_loc; /* offset in current buffer */ + long __dd_size; /* amount of data returned */ + char *__dd_buf; /* data buffer */ + int __dd_len; /* size of data buffer */ + long __dd_seek; /* magic cookie returned */ + __unused long __padding; /* (__dd_rewind space left for bincompat) */ + int __dd_flags; /* flags for readdir */ + __darwin_pthread_mutex_t __dd_lock; /* for thread locking */ + struct _telldir *__dd_td; /* telldir position recording */ +} DIR; + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL + +/* definitions for library routines operating on directories. */ +#define DIRBLKSIZ 1024 + +/* flags for opendir2 */ +#define DTF_HIDEW 0x0001 /* hide whiteout entries */ +#define DTF_NODUP 0x0002 /* don't return duplicate names */ +#define DTF_REWIND 0x0004 /* rewind after reading union stack */ +#define __DTF_READALL 0x0008 /* everything has been read */ +#define __DTF_SKIPREAD 0x0010 /* assume internal buffer is populated */ +#define __DTF_ATEND 0x0020 /* there's nothing more to read in the kernel */ + +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#ifndef KERNEL + +__BEGIN_DECLS + +//Begin-Libc +#ifndef LIBC_ALIAS_CLOSEDIR +//End-Libc +int closedir(DIR *) __DARWIN_ALIAS(closedir); +//Begin-Libc +#else /* LIBC_ALIAS_CLOSEDIR */ +int closedir(DIR *) LIBC_ALIAS(closedir); +#endif /* !LIBC_ALIAS_CLOSEDIR */ +//End-Libc + +//Begin-Libc +#ifndef LIBC_ALIAS_OPENDIR +//End-Libc +DIR *opendir(const char *) __DARWIN_ALIAS_I(opendir); +//Begin-Libc +#else /* LIBC_ALIAS_OPENDIR */ +DIR *opendir(const char *) LIBC_ALIAS_I(opendir); +#endif /* !LIBC_ALIAS_OPENDIR */ +//End-Libc + +struct dirent *readdir(DIR *) __DARWIN_INODE64(readdir); +int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r); + +//Begin-Libc +#ifndef LIBC_ALIAS_REWINDDIR +//End-Libc +void rewinddir(DIR *) __DARWIN_ALIAS_I(rewinddir); +//Begin-Libc +#else /* LIBC_ALIAS_REWINDDIR */ +void rewinddir(DIR *) LIBC_ALIAS_I(rewinddir); +#endif /* !LIBC_ALIAS_REWINDDIR */ +//End-Libc + +//Begin-Libc +#ifndef LIBC_ALIAS_SEEKDIR +//End-Libc +void seekdir(DIR *, long) __DARWIN_ALIAS_I(seekdir); +//Begin-Libc +#else /* LIBC_ALIAS_SEEKDIR */ +void seekdir(DIR *, long) LIBC_ALIAS_I(seekdir); +#endif /* !LIBC_ALIAS_SEEKDIR */ +//End-Libc + +//Begin-Libc +#ifndef LIBC_ALIAS_TELLDIR +//End-Libc +long telldir(DIR *) __DARWIN_ALIAS_I(telldir); +//Begin-Libc +#else /* LIBC_ALIAS_TELLDIR */ +long telldir(DIR *) LIBC_ALIAS_I(telldir); +#endif /* !LIBC_ALIAS_TELLDIR */ +//End-Libc + +__END_DECLS + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +__BEGIN_DECLS + +//Begin-Libc +#ifndef LIBC_ALIAS_OPENDIR +//End-Libc +__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) +DIR *fdopendir(int) __DARWIN_ALIAS_I(fdopendir); +//Begin-Libc +#else /* LIBC_ALIAS_OPENDIR */ +DIR *fdopendir(int) LIBC_ALIAS_I(fdopendir); +#endif /* !LIBC_ALIAS_OPENDIR */ +//End-Libc + +int alphasort(const struct dirent **, const struct dirent **) __DARWIN_INODE64(alphasort); + +#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0) +#include +#include +#define dirfd(dirp) ({ \ + DIR *_dirp = (dirp); \ + int ret = -1; \ + if (_dirp == NULL || _dirp->__dd_fd < 0) \ + errno = EINVAL; \ + else \ + ret = _dirp->__dd_fd; \ + ret; \ +}) +#else +int dirfd(DIR *dirp) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +#endif + +int scandir(const char *, struct dirent ***, + int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)) __DARWIN_INODE64(scandir); +#ifdef __BLOCKS__ +#if __has_attribute(noescape) +#define __scandir_noescape __attribute__((__noescape__)) +#else +#define __scandir_noescape +#endif + +int scandir_b(const char *, struct dirent ***, + int (^)(const struct dirent *) __scandir_noescape, + int (^)(const struct dirent **, const struct dirent **) __scandir_noescape) + __DARWIN_INODE64(scandir_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ + +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +__BEGIN_DECLS + +int getdirentries(int, char *, int, long *) + +//Begin-Libc +#ifndef __LIBC__ +//End-Libc +#if __DARWIN_64_BIT_INO_T +/* + * getdirentries() doesn't work when 64-bit inodes is in effect, so we + * generate a link error. + */ + __asm("_getdirentries_is_not_available_when_64_bit_inodes_are_in_effect") +#else /* !__DARWIN_64_BIT_INO_T */ + __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_6, __IPHONE_2_0,__IPHONE_2_0) +#endif /* __DARWIN_64_BIT_INO_T */ +//Begin-Libc +#endif /* !__LIBC__ */ +//End-Libc +; + +//Begin-Libc +#ifndef LIBC_ALIAS___OPENDIR2 +//End-Libc +DIR *__opendir2(const char *, int) __DARWIN_ALIAS_I(__opendir2); +//Begin-Libc +#else /* LIBC_ALIAS___OPENDIR2 */ +DIR *__opendir2(const char *, int) LIBC_ALIAS_I(__opendir2); +#endif /* !LIBC_ALIAS___OPENDIR2 */ +//End-Libc + +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#endif /* !KERNEL */ + +#endif /* !_DIRENT_H_ */ diff --git a/private-include/fnmatch.h b/private-include/fnmatch.h new file mode 100644 index 0000000..f2e44e5 --- /dev/null +++ b/private-include/fnmatch.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _FNMATCH_H_ +#define _FNMATCH_H_ + +#include + +#define FNM_NOMATCH 1 /* Match failed. */ + +#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ +#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ +#define FNM_PERIOD 0x04 /* Period must be matched by period. */ + +#define FNM_NOSYS (-1) /* Reserved. */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define FNM_LEADING_DIR 0x08 /* Ignore / after Imatch. */ +#define FNM_CASEFOLD 0x10 /* Case insensitive search. */ +#define FNM_IGNORECASE FNM_CASEFOLD +#define FNM_FILE_NAME FNM_PATHNAME +#endif + +__BEGIN_DECLS +//Begin-Libc +#ifndef LIBC_ALIAS_FNMATCH +//End-Libc +int fnmatch(const char *, const char *, int) __DARWIN_ALIAS(fnmatch); +//Begin-Libc +#else /* LIBC_ALIAS_FNMATCH */ +int fnmatch(const char *, const char *, int) LIBC_ALIAS(fnmatch); +#endif /* !LIBC_ALIAS_FNMATCH */ +//End-Libc +__END_DECLS + +#endif /* !_FNMATCH_H_ */ diff --git a/private-include/fts.h b/private-include/fts.h new file mode 100644 index 0000000..3256137 --- /dev/null +++ b/private-include/fts.h @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2000, 2003-2006, 2008, 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)fts.h 8.3 (Berkeley) 8/14/94 + */ + +#ifndef _FTS_H_ +#define _FTS_H_ + +#include +#include +#include +#include + +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +typedef struct { + struct _ftsent *fts_cur; /* current node */ + struct _ftsent *fts_child; /* linked list of children */ + struct _ftsent **fts_array; /* sort array */ + dev_t fts_dev; /* starting device # */ + char *fts_path; /* path for this descent */ + int fts_rfd; /* fd for root */ + int fts_pathlen; /* sizeof(path) */ + int fts_nitems; /* elements in the sort array */ +#ifdef __BLOCKS__ + union { +#endif /* __BLOCKS__ */ + int (*fts_compar)(); /* compare function */ +#ifdef __BLOCKS__ + int (^fts_compar_b)(); /* compare block */ + }; +#endif /* __BLOCKS__ */ + +#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */ +#define FTS_LOGICAL 0x002 /* logical walk */ +#define FTS_NOCHDIR 0x004 /* don't change directories */ +#define FTS_NOSTAT 0x008 /* don't get stat info */ +#define FTS_PHYSICAL 0x010 /* physical walk */ +#define FTS_SEEDOT 0x020 /* return dot and dot-dot */ +#define FTS_XDEV 0x040 /* don't cross devices */ +#define FTS_WHITEOUT 0x080 /* (no longer supported) return whiteout information */ +#define FTS_COMFOLLOWDIR 0x400 /* (non-std) follow command line symlinks for directories only */ +#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000) +#define FTS_OPTIONMASK 0x4ff /* valid user option mask */ +#else +#define FTS_NOSTAT_TYPE 0x800 /* (non-std) no stat, but use d_type in struct dirent when available */ +#define FTS_OPTIONMASK 0xcff /* valid user option mask */ +#endif + +#define FTS_NAMEONLY 0x100 /* (private) child names only */ +#define FTS_STOP 0x200 /* (private) unrecoverable error */ +#ifdef __BLOCKS__ +#define FTS_BLOCK_COMPAR 0x80000000 /* fts_compar is a block */ +#endif /* __BLOCKS__ */ + int fts_options; /* fts_open options, global flags */ +} FTS; + +typedef struct _ftsent { + struct _ftsent *fts_cycle; /* cycle node */ + struct _ftsent *fts_parent; /* parent directory */ + struct _ftsent *fts_link; /* next file in directory */ + long fts_number; /* local numeric value */ + void *fts_pointer; /* local address value */ + char *fts_accpath; /* access path */ + char *fts_path; /* root path */ + int fts_errno; /* errno for this node */ + int fts_symfd; /* fd for symlink */ + unsigned short fts_pathlen; /* strlen(fts_path) */ + unsigned short fts_namelen; /* strlen(fts_name) */ + + ino_t fts_ino; /* inode */ + dev_t fts_dev; /* device */ + nlink_t fts_nlink; /* link count */ + +#define FTS_ROOTPARENTLEVEL -1 +#define FTS_ROOTLEVEL 0 +#define FTS_MAXLEVEL 0x7fffffff + short fts_level; /* depth (-1 to N) */ + +#define FTS_D 1 /* preorder directory */ +#define FTS_DC 2 /* directory that causes cycles */ +#define FTS_DEFAULT 3 /* none of the above */ +#define FTS_DNR 4 /* unreadable directory */ +#define FTS_DOT 5 /* dot or dot-dot */ +#define FTS_DP 6 /* postorder directory */ +#define FTS_ERR 7 /* error; errno is set */ +#define FTS_F 8 /* regular file */ +#define FTS_INIT 9 /* initialized only */ +#define FTS_NS 10 /* stat(2) failed */ +#define FTS_NSOK 11 /* no stat(2) requested */ +#define FTS_SL 12 /* symbolic link */ +#define FTS_SLNONE 13 /* symbolic link without target */ +#define FTS_W 14 /* whiteout object */ + unsigned short fts_info; /* user flags for FTSENT structure */ + +#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */ +#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */ +#define FTS_ISW 0x04 /* this is a whiteout object */ + unsigned short fts_flags; /* private flags for FTSENT structure */ + +#define FTS_AGAIN 1 /* read node again */ +#define FTS_FOLLOW 2 /* follow symbolic link */ +#define FTS_NOINSTR 3 /* no instructions */ +#define FTS_SKIP 4 /* discard node */ + unsigned short fts_instr; /* fts_set() instructions */ + + struct stat *fts_statp; /* stat(2) information */ + char fts_name[1]; /* file name */ +} FTSENT; + +#include +#include + +__BEGIN_DECLS +//Begin-Libc +#ifndef LIBC_ALIAS_FTS_CHILDREN +//End-Libc +FTSENT *fts_children(FTS *, int) __DARWIN_INODE64(fts_children); +//Begin-Libc +#else /* LIBC_ALIAS_FTS_CHILDREN */ +FTSENT *fts_children(FTS *, int) LIBC_INODE64(fts_children); +#endif /* !LIBC_ALIAS_FTS_CHILDREN */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_FTS_CLOSE +//End-Libc +int fts_close(FTS *) __DARWIN_INODE64(fts_close); +//Begin-Libc +#else /* LIBC_ALIAS_FTS_CLOSE */ +int fts_close(FTS *) LIBC_INODE64(fts_close); +#endif /* !LIBC_ALIAS_FTS_CLOSE */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_FTS_OPEN +//End-Libc +FTS *fts_open(char * const *, int, + int (*)(const FTSENT **, const FTSENT **)) __DARWIN_INODE64(fts_open); +//Begin-Libc +#else /* LIBC_ALIAS_FTS_OPEN */ +FTS *fts_open(char * const *, int, + int (*)(const FTSENT **, const FTSENT **)) LIBC_INODE64(fts_open); +#endif /* !LIBC_ALIAS_FTS_OPEN */ +//End-Libc +#ifdef __BLOCKS__ +#if __has_attribute(noescape) +#define __fts_noescape __attribute__((__noescape__)) +#else +#define __fts_noescape +#endif +//Begin-Libc +#ifndef LIBC_ALIAS_FTS_OPEN_B +//End-Libc +FTS *fts_open_b(char * const *, int, + int (^)(const FTSENT **, const FTSENT **) __fts_noescape) + __DARWIN_INODE64(fts_open_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +//Begin-Libc +#else /* LIBC_ALIAS_FTS_OPEN */ +FTS *fts_open_b(char * const *, int, + int (^)(const FTSENT **, const FTSENT **) __fts_noescape) + LIBC_INODE64(fts_open_b); +#endif /* !LIBC_ALIAS_FTS_OPEN */ +//End-Libc +#endif /* __BLOCKS__ */ +//Begin-Libc +#ifndef LIBC_ALIAS_FTS_READ +//End-Libc +FTSENT *fts_read(FTS *) __DARWIN_INODE64(fts_read); +//Begin-Libc +#else /* LIBC_ALIAS_FTS_READ */ +FTSENT *fts_read(FTS *) LIBC_INODE64(fts_read); +#endif /* !LIBC_ALIAS_FTS_READ */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_FTS_SET +//End-Libc +int fts_set(FTS *, FTSENT *, int) __DARWIN_INODE64(fts_set); +//Begin-Libc +#else /* LIBC_ALIAS_FTS_SET */ +int fts_set(FTS *, FTSENT *, int) LIBC_INODE64(fts_set); +#endif /* !LIBC_ALIAS_FTS_SET */ +//End-Libc +__END_DECLS + +#pragma clang diagnostic pop +#endif /* !_FTS_H_ */ + diff --git a/private-include/ftw.h b/private-include/ftw.h new file mode 100644 index 0000000..f1c6db8 --- /dev/null +++ b/private-include/ftw.h @@ -0,0 +1,78 @@ +/* $OpenBSD: ftw.h,v 1.1 2003/07/21 21:13:18 millert Exp $ */ + +/* + * Copyright (c) 2003 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ + +#ifndef _FTW_H +#define _FTW_H + +#include + +/* + * Valid flags for the 3rd argument to the function that is passed as the + * second argument to ftw(3) and nftw(3). Say it three times fast! + */ +#define FTW_F 0 /* File. */ +#define FTW_D 1 /* Directory. */ +#define FTW_DNR 2 /* Directory without read permission. */ +#define FTW_DP 3 /* Directory with subdirectories visited. */ +#define FTW_NS 4 /* Unknown type; stat() failed. */ +#define FTW_SL 5 /* Symbolic link. */ +#define FTW_SLN 6 /* Sym link that names a nonexistent file. */ + +/* + * Flags for use as the 4th argument to nftw(3). These may be ORed together. + */ +#define FTW_PHYS 0x01 /* Physical walk, don't follow sym links. */ +#define FTW_MOUNT 0x02 /* The walk does not cross a mount point. */ +#define FTW_DEPTH 0x04 /* Subdirs visited before the dir itself. */ +#define FTW_CHDIR 0x08 /* Change to a directory before reading it. */ + +struct FTW { + int base; + int level; +}; + +__BEGIN_DECLS +//Begin-Libc +#ifndef LIBC_ALIAS_FTW +//End-Libc +int ftw(const char *, int (*)(const char *, const struct stat *, int), int) + __DARWIN_ALIAS_I(ftw); +//Begin-Libc +#else /* LIBC_ALIAS_FTW */ +int ftw(const char *, int (*)(const char *, const struct stat *, int), int) + LIBC_ALIAS_I(ftw); +#endif /* !LIBC_ALIAS_FTW */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_NFTW +//End-Libc +int nftw(const char *, int (*)(const char *, const struct stat *, int, + struct FTW *), int, int) __DARWIN_ALIAS_I(nftw); +//Begin-Libc +#else /* LIBC_ALIAS_NFTW */ +int nftw(const char *, int (*)(const char *, const struct stat *, int, + struct FTW *), int, int) LIBC_ALIAS_I(nftw); +#endif /* !LIBC_ALIAS_NFTW */ +//End-Libc +__END_DECLS + +#endif /* !_FTW_H */ diff --git a/private-include/glob.h b/private-include/glob.h new file mode 100644 index 0000000..c602c8e --- /dev/null +++ b/private-include/glob.h @@ -0,0 +1,148 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Guido van Rossum. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)glob.h 8.1 (Berkeley) 6/2/93 + * $FreeBSD: /repoman/r/ncvs/src/include/glob.h,v 1.7 2002/07/17 04:58:09 mikeh Exp $ + */ + +#ifndef _GLOB_H_ +#define _GLOB_H_ + +#include <_types.h> +#include +#include +#include + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +struct dirent; +struct stat; +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +typedef struct { + size_t gl_pathc; /* Count of total paths so far. */ + int gl_matchc; /* Count of paths matching pattern. */ + size_t gl_offs; /* Reserved at beginning of gl_pathv. */ + int gl_flags; /* Copy of flags parameter to glob. */ + char **gl_pathv; /* List of paths matching pattern. */ + /* Copy of errfunc parameter to glob. */ +#ifdef __BLOCKS__ + union { +#endif /* __BLOCKS__ */ + int (*gl_errfunc)(const char *, int); +#ifdef __BLOCKS__ + int (^gl_errblk)(const char *, int); + }; +#endif /* __BLOCKS__ */ + + /* + * Alternate filesystem access methods for glob; replacement + * versions of closedir(3), readdir(3), opendir(3), stat(2) + * and lstat(2). + */ + void (*gl_closedir)(void *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + struct dirent *(*gl_readdir)(void *); +#else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + void *(*gl_readdir)(void *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + void *(*gl_opendir)(const char *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + int (*gl_lstat)(const char *, struct stat *); + int (*gl_stat)(const char *, struct stat *); +#else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + int (*gl_lstat)(const char *, void *); + int (*gl_stat)(const char *, void *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +} glob_t; + +/* Believed to have been introduced in 1003.2-1992 */ +#define GLOB_APPEND 0x0001 /* Append to output from previous call. */ +#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */ +#define GLOB_ERR 0x0004 /* Return on error. */ +#define GLOB_MARK 0x0008 /* Append / to matching directories. */ +#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */ +#define GLOB_NOSORT 0x0020 /* Don't sort. */ +#define GLOB_NOESCAPE 0x2000 /* Disable backslash escaping. */ + +/* Error values returned by glob(3) */ +#define GLOB_NOSPACE (-1) /* Malloc call failed. */ +#define GLOB_ABORTED (-2) /* Unignored error. */ +#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */ +#define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */ + +#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ +#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ +#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ +#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ +#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ +#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ +#define GLOB_LIMIT 0x1000 /* limit number of returned paths */ +#ifdef __BLOCKS__ +#define _GLOB_ERR_BLOCK 0x80000000 /* (internal) error callback is a block */ +#endif /* __BLOCKS__ */ + +/* source compatibility, these are the old names */ +#define GLOB_MAXPATH GLOB_LIMIT +#define GLOB_ABEND GLOB_ABORTED + +__BEGIN_DECLS +//Begin-Libc +#ifndef LIBC_ALIAS_GLOB +//End-Libc +int glob(const char * __restrict, int, int (*)(const char *, int), + glob_t * __restrict) __DARWIN_INODE64(glob); +//Begin-Libc +#else /* LIBC_ALIAS_GLOB */ +int glob(const char * __restrict, int, int (*)(const char *, int), + glob_t * __restrict) LIBC_INODE64(glob); +#endif /* !LIBC_ALIAS_GLOB */ +//End-Libc +#ifdef __BLOCKS__ +#if __has_attribute(noescape) +#define __glob_noescape __attribute__((__noescape__)) +#else +#define __glob_noescape +#endif +//Begin-Libc +#ifndef LIBC_ALIAS_GLOB_B +//End-Libc +int glob_b(const char * __restrict, int, int (^)(const char *, int) __glob_noescape, + glob_t * __restrict) __DARWIN_INODE64(glob_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +//Begin-Libc +#else /* LIBC_ALIAS_GLOB_B */ +int glob_b(const char * __restrict, int, int (^)(const char *, int) __glob_noescape, + glob_t * __restrict) LIBC_INODE64(glob_b); +#endif /* !LIBC_ALIAS_GLOB_B */ +//End-Libc +#endif /* __BLOCKS__ */ +void globfree(glob_t *); +__END_DECLS + +#endif /* !_GLOB_H_ */ diff --git a/private-include/regex.h b/private-include/regex.h new file mode 100644 index 0000000..7ef9b35 --- /dev/null +++ b/private-include/regex.h @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2000, 2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 2001-2009 Ville Laurikari + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/*- + * Copyright (c) 1992 Henry Spencer. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer of the University of Toronto. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)regex.h 8.2 (Berkeley) 1/3/94 + */ + +#ifndef _REGEX_H_ +#define _REGEX_H_ + +#include <_regex.h> + +/*******************/ +/* regcomp() flags */ +/*******************/ +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define REG_BASIC 0000 /* Basic regular expressions (synonym for 0) */ +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#define REG_EXTENDED 0001 /* Extended regular expressions */ +#define REG_ICASE 0002 /* Compile ignoring upper/lower case */ +#define REG_NOSUB 0004 /* Compile only reporting success/failure */ +#define REG_NEWLINE 0010 /* Compile for newline-sensitive matching */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define REG_NOSPEC 0020 /* Compile turning off all special characters */ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ + || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ + || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#define REG_LITERAL REG_NOSPEC +#endif + +#define REG_PEND 0040 /* Use re_endp as end pointer */ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ + || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ + || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#define REG_MINIMAL 0100 /* Compile using minimal repetition */ +#define REG_UNGREEDY REG_MINIMAL +#endif + +#define REG_DUMP 0200 /* Unused */ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ + || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ + || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#define REG_ENHANCED 0400 /* Additional (non-POSIX) features */ +#endif +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +/********************/ +/* regerror() flags */ +/********************/ +#define REG_ENOSYS (-1) /* Reserved */ +#define REG_NOMATCH 1 /* regexec() function failed to match */ +#define REG_BADPAT 2 /* invalid regular expression */ +#define REG_ECOLLATE 3 /* invalid collating element */ +#define REG_ECTYPE 4 /* invalid character class */ +#define REG_EESCAPE 5 /* trailing backslash (\) */ +#define REG_ESUBREG 6 /* invalid backreference number */ +#define REG_EBRACK 7 /* brackets ([ ]) not balanced */ +#define REG_EPAREN 8 /* parentheses not balanced */ +#define REG_EBRACE 9 /* braces not balanced */ +#define REG_BADBR 10 /* invalid repetition count(s) */ +#define REG_ERANGE 11 /* invalid character range */ +#define REG_ESPACE 12 /* out of memory */ +#define REG_BADRPT 13 /* repetition-operator operand invalid */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define REG_EMPTY 14 /* Unused */ +#define REG_ASSERT 15 /* Unused */ +#define REG_INVARG 16 /* invalid argument to regex routine */ +#define REG_ILLSEQ 17 /* illegal byte sequence */ + +#define REG_ATOI 255 /* convert name to number (!) */ +#define REG_ITOA 0400 /* convert number to name (!) */ +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +/*******************/ +/* regexec() flags */ +/*******************/ +#define REG_NOTBOL 00001 /* First character not at beginning of line */ +#define REG_NOTEOL 00002 /* Last character not at end of line */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define REG_STARTEND 00004 /* String start/end in pmatch[0] */ +#define REG_TRACE 00400 /* Unused */ +#define REG_LARGE 01000 /* Unused */ +#define REG_BACKR 02000 /* force use of backref code */ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ + || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ + || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) +#define REG_BACKTRACKING_MATCHER REG_BACKR +#endif +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +__BEGIN_DECLS +//Begin-Libc +#ifndef LIBC_ALIAS_REGCOMP +//End-Libc +int regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(regcomp); +//Begin-Libc +#else /* LIBC_ALIAS_REGCOMP */ +int regcomp(regex_t * __restrict, const char * __restrict, int) LIBC_ALIAS(regcomp); +#endif /* !LIBC_ALIAS_REGCOMP */ +//End-Libc +size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t) __cold; +/* + * gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround, + * a dummy argument name is added. + */ +int regexec(const regex_t * __restrict, const char * __restrict, size_t, + regmatch_t __pmatch[ __restrict], int); +void regfree(regex_t *); + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL + +/* Darwin extensions */ +int regncomp(regex_t * __restrict, const char * __restrict, size_t, int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regnexec(const regex_t * __restrict, const char * __restrict, size_t, + size_t, regmatch_t __pmatch[ __restrict], int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regwcomp(regex_t * __restrict, const wchar_t * __restrict, int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regwexec(const regex_t * __restrict, const wchar_t * __restrict, size_t, + regmatch_t __pmatch[ __restrict], int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regwncomp(regex_t * __restrict, const wchar_t * __restrict, size_t, int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int regwnexec(const regex_t * __restrict, const wchar_t * __restrict, + size_t, size_t, regmatch_t __pmatch[ __restrict], int) + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); + +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_REGEX_H_ */ diff --git a/private-include/signal.h b/private-include/signal.h new file mode 100644 index 0000000..a07abff --- /dev/null +++ b/private-include/signal.h @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)signal.h 8.3 (Berkeley) 3/30/94 + */ + +#ifndef _USER_SIGNAL_H +#define _USER_SIGNAL_H + +#include +#include <_types.h> +#include + +#include +#include + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +extern __const char *__const sys_signame[NSIG]; +extern __const char *__const sys_siglist[NSIG]; +#endif + +__BEGIN_DECLS +int raise(int); +__END_DECLS + +#ifndef _ANSI_SOURCE +__BEGIN_DECLS +void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int); +//Begin-Libc +#ifndef LIBC_ALIAS_KILL +//End-Libc +int kill(pid_t, int) __DARWIN_ALIAS(kill); +//Begin-Libc +#else /* LIBC_ALIAS_KILL */ +int kill(pid_t, int) LIBC_ALIAS(kill); +#endif /* !LIBC_ALIAS_KILL */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_KILLPG +//End-Libc +int killpg(pid_t, int) __DARWIN_ALIAS(killpg); +//Begin-Libc +#else /* LIBC_ALIAS_KILLPG */ +int killpg(pid_t, int) LIBC_ALIAS(killpg); +#endif /* !LIBC_ALIAS_KILLPG */ +//End-Libc +int pthread_kill(pthread_t, int); +//Begin-Libc +#ifndef LIBC_ALIAS_PTHREAD_SIGMASK +//End-Libc +int pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask); +//Begin-Libc +#else /* LIBC_ALIAS_PTHREAD_SIGMASK */ +int pthread_sigmask(int, const sigset_t *, sigset_t *) LIBC_ALIAS(pthread_sigmask); +#endif /* !LIBC_ALIAS_PTHREAD_SIGMASK */ +//End-Libc +int sigaction(int, const struct sigaction * __restrict, + struct sigaction * __restrict); +int sigaddset(sigset_t *, int); +//Begin-Libc +#ifndef LIBC_ALIAS_SIGALTSTACK +//End-Libc +int sigaltstack(const stack_t * __restrict, stack_t * __restrict) __DARWIN_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +//Begin-Libc +#else /* LIBC_ALIAS_SIGALTSTACK */ +int sigaltstack(const stack_t * __restrict, stack_t * __restrict) LIBC_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +#endif /* !LIBC_ALIAS_SIGALTSTACK */ +//End-Libc +int sigdelset(sigset_t *, int); +int sigemptyset(sigset_t *); +int sigfillset(sigset_t *); +int sighold(int); +int sigignore(int); +int siginterrupt(int, int); +int sigismember(const sigset_t *, int); +//Begin-Libc +#ifndef LIBC_ALIAS_SIGPAUSE +//End-Libc +int sigpause(int) __DARWIN_ALIAS_C(sigpause); +//Begin-Libc +#else /* LIBC_ALIAS_SIGPAUSE */ +int sigpause(int) LIBC_ALIAS_C(sigpause); +#endif /* !LIBC_ALIAS_SIGPAUSE */ +//End-Libc +int sigpending(sigset_t *); +int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); +int sigrelse(int); +void (* _Nullable sigset(int, void (* _Nullable)(int)))(int); +//Begin-Libc +#ifndef LIBC_ALIAS_SIGSUSPEND +//End-Libc +int sigsuspend(const sigset_t *) __DARWIN_ALIAS_C(sigsuspend); +//Begin-Libc +#else /* LIBC_ALIAS_SIGSUSPEND */ +int sigsuspend(const sigset_t *) LIBC_ALIAS_C(sigsuspend); +#endif /* !LIBC_ALIAS_SIGSUSPEND */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_SIGWAIT +//End-Libc +int sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait); +//Begin-Libc +#else /* LIBC_ALIAS_SIGWAIT */ +int sigwait(const sigset_t * __restrict, int * __restrict) LIBC_ALIAS_C(sigwait); +#endif /* !LIBC_ALIAS_SIGWAIT */ +//End-Libc +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +void psignal(unsigned int, const char *); +int sigblock(int); +int sigsetmask(int); +int sigvec(int, struct sigvec *, struct sigvec *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +__END_DECLS + +/* List definitions after function declarations, or Reiser cpp gets upset. */ +#if defined(__i386__) || defined(__x86_64__) +/* The left shift operator on intel is modulo 32 */ +__header_always_inline int +__sigbits(int __signo) +{ + return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1)); +} +#else /* !__i386__ && !__x86_64__ */ +#define __sigbits(signo) (1 << ((signo) - 1)) +#endif /* __i386__ || __x86_64__ */ + +#define sigaddset(set, signo) (*(set) |= __sigbits(signo), 0) +#define sigdelset(set, signo) (*(set) &= ~__sigbits(signo), 0) +#define sigismember(set, signo) ((*(set) & __sigbits(signo)) != 0) +#define sigemptyset(set) (*(set) = 0, 0) +#define sigfillset(set) (*(set) = ~(sigset_t)0, 0) +#endif /* !_ANSI_SOURCE */ + +#endif /* !_USER_SIGNAL_H */ diff --git a/private-include/stdio.h b/private-include/stdio.h new file mode 100644 index 0000000..07730d4 --- /dev/null +++ b/private-include/stdio.h @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2000, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdio.h 8.5 (Berkeley) 4/29/95 + */ + +#ifndef _STDIO_H_ +#define _STDIO_H_ + +#include <_stdio.h> + +#ifndef UNIFDEF_DRIVERKIT +__BEGIN_DECLS +extern FILE *__stdinp; +extern FILE *__stdoutp; +extern FILE *__stderrp; +__END_DECLS + +#define __SLBF 0x0001 /* line buffered */ +#define __SNBF 0x0002 /* unbuffered */ +#define __SRD 0x0004 /* OK to read */ +#define __SWR 0x0008 /* OK to write */ + /* RD and WR are never simultaneously asserted */ +#define __SRW 0x0010 /* open for reading & writing */ +#define __SEOF 0x0020 /* found EOF */ +#define __SERR 0x0040 /* found error */ +#define __SMBF 0x0080 /* _buf is from malloc */ +#define __SAPP 0x0100 /* fdopen()ed in append mode */ +#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ +#define __SOPT 0x0400 /* do fseek() optimisation */ +#define __SNPT 0x0800 /* do not do fseek() optimisation */ +#define __SOFF 0x1000 /* set iff _offset is in fact correct */ +#define __SMOD 0x2000 /* true => fgetln modified _p text */ +#define __SALC 0x4000 /* allocate string space dynamically */ +#define __SIGN 0x8000 /* ignore this file in _fwalk */ + +/* + * The following three definitions are for ANSI C, which took them + * from System V, which brilliantly took internal interface macros and + * made them official arguments to setvbuf(), without renaming them. + * Hence, these ugly _IOxxx names are *supposed* to appear in user code. + * + * Although numbered as their counterparts above, the implementation + * does not rely on this. + */ +#define _IOFBF 0 /* setvbuf should set fully buffered */ +#define _IOLBF 1 /* setvbuf should set line buffered */ +#define _IONBF 2 /* setvbuf should set unbuffered */ + +#define BUFSIZ 1024 /* size of buffer used by setbuf */ +#define EOF (-1) + + /* must be == _POSIX_STREAM_MAX */ +#define FOPEN_MAX 20 /* must be <= OPEN_MAX */ +#define FILENAME_MAX 1024 /* must be <= PATH_MAX */ + +/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ +#ifndef _ANSI_SOURCE +#define P_tmpdir "/var/tmp/" +#endif +#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ +#define TMP_MAX 308915776 + +#ifndef SEEK_SET +#define SEEK_SET 0 /* set file offset to offset */ +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#endif +#ifndef SEEK_END +#define SEEK_END 2 /* set file offset to EOF plus offset */ +#endif + +#define stdin __stdinp +#define stdout __stdoutp +#define stderr __stderrp + +#ifdef _DARWIN_UNLIMITED_STREAMS +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 +#error "_DARWIN_UNLIMITED_STREAMS specified, but -miphoneos-version-min version does not support it." +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6 +#error "_DARWIN_UNLIMITED_STREAMS specified, but -mmacosx-version-min version does not support it." +#endif +#endif + +/* ANSI-C */ + +__BEGIN_DECLS +void clearerr(FILE *); +int fclose(FILE *); +int feof(FILE *); +int ferror(FILE *); +int fflush(FILE *); +int fgetc(FILE *); +int fgetpos(FILE * __restrict, fpos_t *); +char *fgets(char * __restrict, int, FILE *); +#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE) +FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fopen)); +#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +//Begin-Libc +#ifndef LIBC_ALIAS_FOPEN +//End-Libc +FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fopen)); +//Begin-Libc +#else /* LIBC_ALIAS_FOPEN */ +FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) LIBC_ALIAS(fopen); +#endif /* !LIBC_ALIAS_FOPEN */ +//End-Libc +#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3); +int fputc(int, FILE *); +//Begin-Libc +#ifndef LIBC_ALIAS_FPUTS +//End-Libc +int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs); +//Begin-Libc +#else /* LIBC_ALIAS_FPUTS */ +int fputs(const char * __restrict, FILE * __restrict) LIBC_ALIAS(fputs); +#endif /* !LIBC_ALIAS_FPUTS */ +//End-Libc +size_t fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream); +//Begin-Libc +#ifndef LIBC_ALIAS_FREOPEN +//End-Libc +FILE *freopen(const char * __restrict, const char * __restrict, + FILE * __restrict) __DARWIN_ALIAS(freopen); +//Begin-Libc +#else /* LIBC_ALIAS_FREOPEN */ +FILE *freopen(const char * __restrict, const char * __restrict, + FILE * __restrict) LIBC_ALIAS(freopen); +#endif /* !LIBC_ALIAS_FREOPEN */ +//End-Libc +int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3); +int fseek(FILE *, long, int); +int fsetpos(FILE *, const fpos_t *); +long ftell(FILE *); +//Begin-Libc +#ifndef LIBC_ALIAS_FWRITE +//End-Libc +size_t fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite); +//Begin-Libc +#else /* LIBC_ALIAS_FWRITE */ +size_t fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) LIBC_ALIAS(fwrite); +#endif /* !LIBC_ALIAS_FWRITE */ +//End-Libc +int getc(FILE *); +int getchar(void); +char *gets(char *); +void perror(const char *) __cold; +int printf(const char * __restrict, ...) __printflike(1, 2); +int putc(int, FILE *); +int putchar(int); +int puts(const char *); +int remove(const char *); +int rename (const char *__old, const char *__new); +void rewind(FILE *); +int scanf(const char * __restrict, ...) __scanflike(1, 2); +void setbuf(FILE * __restrict, char * __restrict); +int setvbuf(FILE * __restrict, char * __restrict, int, size_t); +int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3) __swift_unavailable("Use snprintf instead."); +int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3); +FILE *tmpfile(void); + +__swift_unavailable("Use mkstemp(3) instead.") +#if !defined(_POSIX_C_SOURCE) +__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.") +#endif +char *tmpnam(char *); +int ungetc(int, FILE *); +int vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0); +int vprintf(const char * __restrict, va_list) __printflike(1, 0); +int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0) __swift_unavailable("Use vsnprintf instead."); +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.1-1988 + */ + +#if __DARWIN_C_LEVEL >= 198808L +#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */ + +__BEGIN_DECLS +#include <_ctermid.h> + +#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE) +FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen)); +#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +//Begin-Libc +#ifndef LIBC_ALIAS_FDOPEN +//End-Libc +FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen)); +//Begin-Libc +#else /* LIBC_ALIAS_FDOPEN */ +FILE *fdopen(int, const char *) LIBC_ALIAS(fdopen); +#endif /* !LIBC_ALIAS_FDOPEN */ +//End-Libc +#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +int fileno(FILE *); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 198808L */ + + +/* Additional functionality provided by: + * POSIX.2-1992 C Language Binding Option + */ +#if TARGET_OS_EMBEDDED +#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) +#else +#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) +#endif + +#if __DARWIN_C_LEVEL >= 199209L +__BEGIN_DECLS +int pclose(FILE *) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable."); +#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE) +FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable."); +#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +//Begin-Libc +#ifndef LIBC_ALIAS_POPEN +//End-Libc +FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable."); +//Begin-Libc +#else /* LIBC_ALIAS_POPEN */ +FILE *popen(const char *, const char *) LIBC_ALIAS(popen); +#endif /* !LIBC_ALIAS_POPEN */ +//End-Libc +#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 199209L */ + +#undef __swift_unavailable_on + +/* Additional functionality provided by: + * POSIX.1c-1995, + * POSIX.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + */ + +#if __DARWIN_C_LEVEL >= 199506L + +/* Functions internal to the implementation. */ +__BEGIN_DECLS +int __srget(FILE *); +int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0); +int __swbuf(int, FILE *); +__END_DECLS + +/* + * The __sfoo macros are here so that we can + * define function versions in the C library. + */ +#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) +#if defined(__GNUC__) && defined(__STDC__) +__header_always_inline int __sputc(int _c, FILE *_p) { + if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) + return (*_p->_p++ = _c); + else + return (__swbuf(_c, _p)); +} +#else +/* + * This has been tuned to generate reasonable code on the vax using pcc. + */ +#define __sputc(c, p) \ + (--(p)->_w < 0 ? \ + (p)->_w >= (p)->_lbfsize ? \ + (*(p)->_p = (c)), *(p)->_p != '\n' ? \ + (int)*(p)->_p++ : \ + __swbuf('\n', p) : \ + __swbuf((int)(c), p) : \ + (*(p)->_p = (c), (int)*(p)->_p++)) +#endif + +#define __sfeof(p) (((p)->_flags & __SEOF) != 0) +#define __sferror(p) (((p)->_flags & __SERR) != 0) +#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) +#define __sfileno(p) ((p)->_file) + +__BEGIN_DECLS +void flockfile(FILE *); +int ftrylockfile(FILE *); +void funlockfile(FILE *); +int getc_unlocked(FILE *); +int getchar_unlocked(void); +int putc_unlocked(int, FILE *); +int putchar_unlocked(int); + +/* Removed in Issue 6 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L +int getw(FILE *); +int putw(int, FILE *); +#endif + +__swift_unavailable("Use mkstemp(3) instead.") +#if !defined(_POSIX_C_SOURCE) +__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.") +#endif +//Begin-Libc +#ifndef LIBC_ALIAS_TEMPNAM +//End-Libc +char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam); +//Begin-Libc +#else /* LIBC_ALIAS_TEMPNAM */ +char *tempnam(const char *__dir, const char *__prefix) LIBC_ALIAS(tempnam); +#endif /* !LIBC_ALIAS_TEMPNAM */ +//End-Libc +__END_DECLS + +#ifndef lint +#define getc_unlocked(fp) __sgetc(fp) +#define putc_unlocked(x, fp) __sputc(x, fp) +#endif /* lint */ + +#define getchar_unlocked() getc_unlocked(stdin) +#define putchar_unlocked(x) putc_unlocked(x, stdout) +#endif /* __DARWIN_C_LEVEL >= 199506L */ + + + +/* Additional functionality provided by: + * POSIX.1-2001 + * ISO C99 + */ + +#if __DARWIN_C_LEVEL >= 200112L +#include + +__BEGIN_DECLS +int fseeko(FILE * __stream, off_t __offset, int __whence); +off_t ftello(FILE * __stream); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L */ + +#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) +__BEGIN_DECLS +int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4); +int vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0); +int vscanf(const char * __restrict __format, va_list) __scanflike(1, 0); +int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0); +int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */ + + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +#include + +__BEGIN_DECLS +int dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +int vdprintf(int, const char * __restrict, va_list) __printflike(2, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +ssize_t getdelim(char ** __restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +ssize_t getline(char ** __restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); +FILE *open_memstream(char **__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + + + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +__BEGIN_DECLS +extern __const int sys_nerr; /* perror(3) external variables */ +extern __const char *__const sys_errlist[]; + +int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3); +char *ctermid_r(char *); +char *fgetln(FILE *, size_t *); +__const char *fmtcheck(const char *, const char *); +int fpurge(FILE *); +void setbuffer(FILE *, char *, int); +int setlinebuf(FILE *); +int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0); +FILE *zopen(const char *, const char *, int); + + +/* + * Stdio function-access interface. + */ +FILE *funopen(const void *, + int (* _Nullable)(void *, char *, int), + int (* _Nullable)(void *, const char *, int), + fpos_t (* _Nullable)(void *, fpos_t, int), + int (* _Nullable)(void *)); +__END_DECLS +#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) +#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) + +#define feof_unlocked(p) __sfeof(p) +#define ferror_unlocked(p) __sferror(p) +#define clearerr_unlocked(p) __sclearerr(p) +#define fileno_unlocked(p) __sfileno(p) + +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#else /* UNIFDEF_DRIVERKIT */ +#define EOF (-1) + +__BEGIN_DECLS +int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3); +#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) +int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4); +int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0); +int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0); +#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */ +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3); +int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0); +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ +__END_DECLS +#endif /* UNIFDEF_DRIVERKIT */ + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus) +/* Security checking functions. */ +#include +#endif + +#endif /* _STDIO_H_ */ diff --git a/private-include/stdlib.h b/private-include/stdlib.h new file mode 100644 index 0000000..7979ffa --- /dev/null +++ b/private-include/stdlib.h @@ -0,0 +1,467 @@ +/* + * Copyright (c) 2000, 2002 - 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdlib.h 8.5 (Berkeley) 5/19/95 + */ + +#ifndef _STDLIB_H_ +#define _STDLIB_H_ + +#include +#include + +#include <_types.h> +#if !defined(_ANSI_SOURCE) +#ifndef UNIFDEF_DRIVERKIT +#include +#endif /* UNIFDEF_DRIVERKIT */ +#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#include +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE */ + +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +#include + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#include +#include +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#include + +typedef struct { + int quot; /* quotient */ + int rem; /* remainder */ +} div_t; + +typedef struct { + long quot; /* quotient */ + long rem; /* remainder */ +} ldiv_t; + +#if !__DARWIN_NO_LONG_LONG +typedef struct { + long long quot; + long long rem; +} lldiv_t; +#endif /* !__DARWIN_NO_LONG_LONG */ + +#include + +#ifndef UNIFDEF_DRIVERKIT +#define EXIT_FAILURE 1 +#define EXIT_SUCCESS 0 +#endif /* UNIFDEF_DRIVERKIT */ + +#define RAND_MAX 0x7fffffff + +#ifdef _USE_EXTENDED_LOCALES_ +#include <_xlocale.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +#ifndef MB_CUR_MAX +#ifdef _USE_EXTENDED_LOCALES_ +#define MB_CUR_MAX (___mb_cur_max()) +#ifndef MB_CUR_MAX_L +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif /* !MB_CUR_MAX_L */ +#else /* !_USE_EXTENDED_LOCALES_ */ +extern int __mb_cur_max; +#define MB_CUR_MAX __mb_cur_max +#endif /* _USE_EXTENDED_LOCALES_ */ +#endif /* MB_CUR_MAX */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) \ + && defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L) +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif +//Begin-Libc +#include "libc_private.h" +/* f must be a literal string */ +#define LIBC_ABORT(f,...) abort_report_np("%s:%s:%u: " f, __FILE__, __func__, __LINE__, ## __VA_ARGS__) +//End-Libc + +#ifndef UNIFDEF_DRIVERKIT +#include +#endif /* UNIFDEF_DRIVERKIT */ + +__BEGIN_DECLS +void abort(void) __cold __dead2; +int abs(int) __pure2; +#ifndef UNIFDEF_DRIVERKIT +int atexit(void (* _Nonnull)(void)); +#endif /* UNIFDEF_DRIVERKIT */ +double atof(const char *); +int atoi(const char *); +long atol(const char *); +#if !__DARWIN_NO_LONG_LONG +long long + atoll(const char *); +#endif /* !__DARWIN_NO_LONG_LONG */ +void *bsearch(const void *__key, const void *__base, size_t __nel, + size_t __width, int (* _Nonnull __compar)(const void *, const void *)); +#ifndef UNIFDEF_DRIVERKIT +/* calloc is now declared in _malloc.h */ +#endif /* UNIFDEF_DRIVERKIT */ +div_t div(int, int) __pure2; +#ifndef UNIFDEF_DRIVERKIT +void exit(int) __dead2; +/* free is now declared in _malloc.h */ +char *getenv(const char *); +#endif /* UNIFDEF_DRIVERKIT */ +long labs(long) __pure2; +ldiv_t ldiv(long, long) __pure2; +#if !__DARWIN_NO_LONG_LONG +long long + llabs(long long); +lldiv_t lldiv(long long, long long); +#endif /* !__DARWIN_NO_LONG_LONG */ +#ifndef UNIFDEF_DRIVERKIT +/* malloc is now declared in _malloc.h */ +#endif /* UNIFDEF_DRIVERKIT */ +int mblen(const char *__s, size_t __n); +size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t); +int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); +#ifndef UNIFDEF_DRIVERKIT +/* posix_memalign is now declared in _malloc.h */ +#endif /* UNIFDEF_DRIVERKIT */ +void qsort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)); +#ifndef UNIFDEF_DRIVERKIT +int rand(void) __swift_unavailable("Use arc4random instead."); +/* realloc is now declared in _malloc.h */ +void srand(unsigned) __swift_unavailable("Use arc4random instead."); +#endif /* UNIFDEF_DRIVERKIT */ +double strtod(const char *, char **) __DARWIN_ALIAS(strtod); +float strtof(const char *, char **) __DARWIN_ALIAS(strtof); +long strtol(const char *__str, char **__endptr, int __base); +long double + strtold(const char *, char **); +#if !__DARWIN_NO_LONG_LONG +long long + strtoll(const char *__str, char **__endptr, int __base); +#endif /* !__DARWIN_NO_LONG_LONG */ +unsigned long + strtoul(const char *__str, char **__endptr, int __base); +#if !__DARWIN_NO_LONG_LONG +unsigned long long + strtoull(const char *__str, char **__endptr, int __base); +#endif /* !__DARWIN_NO_LONG_LONG */ +#ifndef UNIFDEF_DRIVERKIT +//Begin-Libc +#ifndef LIBC_ALIAS_SYSTEM +//End-Libc + +#if TARGET_OS_EMBEDDED +#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) +#else +#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) +#endif + +__swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable") +__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED +__WATCHOS_PROHIBITED __TVOS_PROHIBITED +int system(const char *) __DARWIN_ALIAS_C(system); +//Begin-Libc +#else /* LIBC_ALIAS_SYSTEM */ +int system(const char *) LIBC_ALIAS_C(system); +#endif /* !LIBC_ALIAS_SYSTEM */ +//End-Libc + +#undef __swift_unavailable_on +#endif /* UNIFDEF_DRIVERKIT */ + +size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t); +int wctomb(char *, wchar_t); + +#ifndef UNIFDEF_DRIVERKIT +#ifndef _ANSI_SOURCE +void _Exit(int) __dead2; +long a64l(const char *); +double drand48(void); +char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */ +double erand48(unsigned short[3]); +char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */ +char *gcvt(double, int, char *); /* LEGACY */ +int getsubopt(char **, char * const *, char **); +int grantpt(int); +#if __DARWIN_UNIX03 +char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */ +#else /* !__DARWIN_UNIX03 */ +char *initstate(unsigned long, char *, long); +#endif /* __DARWIN_UNIX03 */ +long jrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead."); +char *l64a(long); +void lcong48(unsigned short[7]); +long lrand48(void) __swift_unavailable("Use arc4random instead."); +char *mktemp(char *); +int mkstemp(char *); +long mrand48(void) __swift_unavailable("Use arc4random instead."); +long nrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead."); +int posix_openpt(int); +char *ptsname(int); + +#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3)); +#endif + +//Begin-Libc +#ifndef LIBC_ALIAS_PUTENV +//End-Libc +int putenv(char *) __DARWIN_ALIAS(putenv); +//Begin-Libc +#else /* LIBC_ALIAS_PUTENV */ +int putenv(char *) LIBC_ALIAS(putenv); +#endif /* !LIBC_ALIAS_PUTENV */ +//End-Libc +long random(void) __swift_unavailable("Use arc4random instead."); +int rand_r(unsigned *) __swift_unavailable("Use arc4random instead."); +//Begin-Libc +#ifdef __LIBC__ +#ifndef LIBC_ALIAS_REALPATH +char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath); +#else /* LIBC_ALIAS_REALPATH */ +#ifdef VARIANT_DARWINEXTSN +char *realpath(const char * __restrict, char * __restrict) LIBC_EXTSN(realpath); +#else /* !VARIANT_DARWINEXTSN */ +char *realpath(const char * __restrict, char * __restrict) LIBC_ALIAS(realpath); +#endif /* VARIANT_DARWINEXTSN */ +#endif /* !LIBC_ALIAS_REALPATH */ +#else /* !__LIBC__ */ +//End-Libc +#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH) +char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath); +#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */ +char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath); +#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */ +//Begin-Libc +#endif /* __LIBC__ */ +//End-Libc +unsigned short + *seed48(unsigned short[3]); +//Begin-Libc +#ifndef LIBC_ALIAS_SETENV +//End-Libc +int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv); +//Begin-Libc +#else /* LIBC_ALIAS_SETENV */ +int setenv(const char * __name, const char * __value, int __overwrite) LIBC_ALIAS(setenv); +#endif /* !LIBC_ALIAS_SETENV */ +//End-Libc +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_SETKEY +//End-Libc +void setkey(const char *) __DARWIN_ALIAS(setkey); +//Begin-Libc +#else /* LIBC_ALIAS_SETKEY */ +void setkey(const char *) LIBC_ALIAS(setkey); +#endif /* !LIBC_ALIAS_SETKEY */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +int setkey(const char *); +#endif /* __DARWIN_UNIX03 */ +char *setstate(const char *); +void srand48(long); +#if __DARWIN_UNIX03 +void srandom(unsigned); +#else /* !__DARWIN_UNIX03 */ +void srandom(unsigned long); +#endif /* __DARWIN_UNIX03 */ +int unlockpt(int); +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_UNSETENV +//End-Libc +int unsetenv(const char *) __DARWIN_ALIAS(unsetenv); +//Begin-Libc +#else /* LIBC_ALIAS_UNSETENV */ +int unsetenv(const char *) LIBC_ALIAS(unsetenv); +#endif /* !LIBC_ALIAS_UNSETENV */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +void unsetenv(const char *); +#endif /* __DARWIN_UNIX03 */ +#endif /* !_ANSI_SOURCE */ +#endif /* UNIFDEF_DRIVERKIT */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#include +#ifndef UNIFDEF_DRIVERKIT +#include +#include +#endif /* UNIFDEF_DRIVERKIT */ +#include <_types/_uint32_t.h> + +uint32_t arc4random(void); +#ifndef UNIFDEF_DRIVERKIT +void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/) + __OSX_DEPRECATED(10.0, 10.12, "use arc4random_stir") + __IOS_DEPRECATED(2.0, 10.0, "use arc4random_stir") + __TVOS_DEPRECATED(2.0, 10.0, "use arc4random_stir") + __WATCHOS_DEPRECATED(1.0, 3.0, "use arc4random_stir"); +#endif /* UNIFDEF_DRIVERKIT */ +void arc4random_buf(void * __buf, size_t __nbytes) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +void arc4random_stir(void); +uint32_t + arc4random_uniform(uint32_t __upper_bound) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +#ifdef __BLOCKS__ +#ifndef UNIFDEF_DRIVERKIT +int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* UNIFDEF_DRIVERKIT */ +void *bsearch_b(const void *__key, const void *__base, size_t __nel, + size_t __width, int (^ _Nonnull __compar)(const void *, const void *)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ + +#ifndef UNIFDEF_DRIVERKIT + /* getcap(3) functions */ +char *cgetcap(char *, const char *, int); +int cgetclose(void); +int cgetent(char **, char **, const char *); +int cgetfirst(char **, char **); +int cgetmatch(const char *, const char *); +int cgetnext(char **, char **); +int cgetnum(char *, const char *, long *); +int cgetset(const char *); +int cgetstr(char *, const char *, char **); +int cgetustr(char *, const char *, char **); + +int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +char *devname(dev_t, mode_t); +char *devname_r(dev_t, mode_t, char *buf, int len); +char *getbsize(int *, long *); +int getloadavg(double [], int); +const char + *getprogname(void); +void setprogname(const char *); +#endif /* UNIFDEF_DRIVERKIT */ + +#ifdef __BLOCKS__ +#if __has_attribute(noescape) +#define __sort_noescape __attribute__((__noescape__)) +#else +#define __sort_noescape +#endif +#endif /* __BLOCKS__ */ + +int heapsort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)); +#ifdef __BLOCKS__ +int heapsort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +int mergesort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)); +#ifdef __BLOCKS__ +int mergesort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +#ifndef UNIFDEF_DRIVERKIT +void psort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#ifdef __BLOCKS__ +void psort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +void psort_r(void *__base, size_t __nel, size_t __width, void *, + int (* _Nonnull __compar)(void *, const void *, const void *)) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* UNIFDEF_DRIVERKIT */ +#ifdef __BLOCKS__ +void qsort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape) + __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +#endif /* __BLOCKS__ */ +void qsort_r(void *__base, size_t __nel, size_t __width, void *, + int (* _Nonnull __compar)(void *, const void *, const void *)); +int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table, + unsigned __endbyte); +int rpmatch(const char *) + __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0)); +int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table, + unsigned __endbyte); +#ifndef UNIFDEF_DRIVERKIT +void sranddev(void); +void srandomdev(void); +void *reallocf(void *__ptr, size_t __size) __alloc_size(2); +#endif /* UNIFDEF_DRIVERKIT */ +#if !__DARWIN_NO_LONG_LONG +long long + strtoq(const char *__str, char **__endptr, int __base); +unsigned long long + strtouq(const char *__str, char **__endptr, int __base); +#endif /* !__DARWIN_NO_LONG_LONG */ +#ifndef UNIFDEF_DRIVERKIT +extern char *suboptarg; /* getsubopt(3) external variable */ +/* valloc is now declared in _malloc.h */ +#endif /* UNIFDEF_DRIVERKIT */ +#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison mbstowcs mbtowc wcstombs wctomb +#endif +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* _STDLIB_H_ */ diff --git a/private-include/string.h b/private-include/string.h new file mode 100644 index 0000000..a166d36 --- /dev/null +++ b/private-include/string.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)string.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _STRING_H_ +#define _STRING_H_ + +#include <_types.h> +#include +#include +#include +#include + +/* ANSI-C */ + +__BEGIN_DECLS +void *memchr(const void *__s, int __c, size_t __n); +int memcmp(const void *__s1, const void *__s2, size_t __n); +void *memcpy(void *__dst, const void *__src, size_t __n); +void *memmove(void *__dst, const void *__src, size_t __len); +void *memset(void *__b, int __c, size_t __len); +#ifndef UNIFDEF_DRIVERKIT +char *strcat(char *__s1, const char *__s2); +#endif /* UNIFDEF_DRIVERKIT */ +char *strchr(const char *__s, int __c); +int strcmp(const char *__s1, const char *__s2); +int strcoll(const char *__s1, const char *__s2); +#ifndef UNIFDEF_DRIVERKIT +char *strcpy(char *__dst, const char *__src); +#endif /* UNIFDEF_DRIVERKIT */ +size_t strcspn(const char *__s, const char *__charset); +//Begin-Libc +#ifndef LIBC_ALIAS_STRERROR +//End-Libc +char *strerror(int __errnum) __DARWIN_ALIAS(strerror); +//Begin-Libc +#else /* LIBC_ALIAS_STRERROR */ +char *strerror(int __errnum) LIBC_ALIAS(strerror); +#endif /* !LIBC_ALIAS_STRERROR */ +//End-Libc +size_t strlen(const char *__s); +char *strncat(char *__s1, const char *__s2, size_t __n); +int strncmp(const char *__s1, const char *__s2, size_t __n); +char *strncpy(char *__dst, const char *__src, size_t __n); +char *strpbrk(const char *__s, const char *__charset); +char *strrchr(const char *__s, int __c); +size_t strspn(const char *__s, const char *__charset); +char *strstr(const char *__big, const char *__little); +char *strtok(char *__str, const char *__sep); +size_t strxfrm(char *__s1, const char *__s2, size_t __n); +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.1c-1995, + * POSIX.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + */ + +#if __DARWIN_C_LEVEL >= 199506L +__BEGIN_DECLS +char *strtok_r(char *__str, const char *__sep, char **__lasts); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 199506L */ + + + +/* Additional functionality provided by: + * POSIX.1-2001 + */ + +#if __DARWIN_C_LEVEL >= 200112L +__BEGIN_DECLS +int strerror_r(int __errnum, char *__strerrbuf, size_t __buflen); +char *strdup(const char *__s1); +void *memccpy(void *__dst, const void *__src, int __c, size_t __n); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L */ + + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +__BEGIN_DECLS +#ifndef UNIFDEF_DRIVERKIT +char *stpcpy(char *__dst, const char *__src); +#endif /* UNIFDEF_DRIVERKIT */ +char *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +char *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +size_t strnlen(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +char *strsignal(int __sig); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + +/* C11 Annex K */ + +#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 +#include +#include + +__BEGIN_DECLS +errno_t memset_s(void *__s, rsize_t __smax, int __c, rsize_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); +__END_DECLS +#endif + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#include + +__BEGIN_DECLS +void *memmem(const void *__big, size_t __big_len, const void *__little, size_t __little_len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +void memset_pattern4(void *__b, const void *__pattern4, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0); +void memset_pattern8(void *__b, const void *__pattern8, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0); +void memset_pattern16(void *__b, const void *__pattern16, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0); + +char *strcasestr(const char *__big, const char *__little); +char *strnstr(const char *__big, const char *__little, size_t __len); +size_t strlcat(char *__dst, const char *__source, size_t __size); +size_t strlcpy(char *__dst, const char *__source, size_t __size); +void strmode(int __mode, char *__bp); +char *strsep(char **__stringp, const char *__delim); + +/* SUS places swab() in unistd.h. It is listed here for source compatibility */ +void swab(const void * __restrict, void * __restrict, ssize_t); + +__OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) +__TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1) +int timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len); +__END_DECLS + +/* Some functions historically defined in string.h were placed in strings.h + * by SUS. We are using "strings.h" instead of to avoid an issue + * where /Developer/Headers/FlatCarbon/Strings.h could be included instead on + * case-insensitive file systems. + */ +#include "strings.h" +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus) +/* Security checking functions. */ +#include +#endif + +#endif /* _STRING_H_ */ diff --git a/private-include/sys/rbtree.h b/private-include/sys/rbtree.h new file mode 100644 index 0000000..87988f2 --- /dev/null +++ b/private-include/sys/rbtree.h @@ -0,0 +1,113 @@ +/* $NetBSD: rbtree.h,v 1.2 2012/02/17 08:20:55 yamt Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Portions Copyright (c) 2012 Apple Inc. All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYS_RBTREE_H_ +#define _SYS_RBTREE_H_ + +#include + +#include +#include +#include +#include + +__BEGIN_DECLS + + +#define RB_DIR_LEFT 0 +#define RB_DIR_RIGHT 1 + +#define RB_TREE_MIN(T) rb_tree_iterate((T), NULL, RB_DIR_RIGHT) +#define RB_TREE_MAX(T) rb_tree_iterate((T), NULL, RB_DIR_LEFT) +#define RB_TREE_FOREACH(N, T) \ + for ((N) = RB_TREE_MIN(T); (N); \ + (N) = rb_tree_iterate((T), (N), RB_DIR_RIGHT)) +#define RB_TREE_FOREACH_SAFE(N, T, TVAR) \ + for ((N) = RB_TREE_MIN(T); (N) && ((TVAR) = rb_tree_iterate((T), (N), RB_DIR_RIGHT), 1); \ + (N) = (TVAR)) +#define RB_TREE_FOREACH_REVERSE(N, T) \ + for ((N) = RB_TREE_MAX(T); (N); \ + (N) = rb_tree_iterate((T), (N), RB_DIR_LEFT)) +#define RB_TREE_FOREACH_REVERSE_SAFE(N, T, TVAR) \ + for ((N) = RB_TREE_MAX(T); (N) && ((TVAR) = rb_tree_iterate((T), (N), RB_DIR_LEFT), 1); \ + (N) = (TVAR)) + + +/* + * rbto_compare_nodes_fn: + * return a positive value if the first node > the second node. + * return a negative value if the first node < the second node. + * return 0 if they are considered same. + * + * rbto_compare_key_fn: + * return a positive value if the node > the key. + * return a negative value if the node < the key. + * return 0 if they are considered same. + */ + +typedef signed int (*rbto_compare_nodes_fn)(void *, const void *, const void *); +typedef signed int (*rbto_compare_key_fn)(void *, const void *, const void *); + +typedef struct { + rbto_compare_nodes_fn rbto_compare_nodes; + rbto_compare_key_fn rbto_compare_key; + size_t rbto_node_offset; + void *rbto_context; +} rb_tree_ops_t; + +//Begin-Libc +#ifdef _RBTREE_NO_OPAQUE_STRUCTS_ +typedef struct rb_node rb_node_t; +typedef struct rb_tree rb_tree_t; +#else +//End-Libc +typedef struct rb_node { void * opaque[3]; } rb_node_t; +typedef struct rb_tree { void *opaque[8]; } rb_tree_t; +//Begin-Libc +#endif +//End-Libc + +#define _rb_availability __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0); +void rb_tree_init(rb_tree_t *, const rb_tree_ops_t *) _rb_availability; +void * rb_tree_insert_node(rb_tree_t *, void *) _rb_availability; +void * rb_tree_find_node(rb_tree_t *, const void *) _rb_availability; +void * rb_tree_find_node_geq(rb_tree_t *, const void *) _rb_availability; +void * rb_tree_find_node_leq(rb_tree_t *, const void *) _rb_availability; +void rb_tree_remove_node(rb_tree_t *, void *) _rb_availability; +void * rb_tree_iterate(rb_tree_t *, void *, const unsigned int) _rb_availability; +size_t rb_tree_count(rb_tree_t *) _rb_availability; +#undef _rb_availability + +__END_DECLS + +#endif /* _SYS_RBTREE_H_*/ diff --git a/private-include/time.h b/private-include/time.h new file mode 100644 index 0000000..3024c87 --- /dev/null +++ b/private-include/time.h @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)time.h 8.3 (Berkeley) 1/21/94 + */ + +#ifndef _TIME_H_ +#define _TIME_H_ + +#include <_types.h> +#include +#include +#ifndef UNIFDEF_DRIVERKIT +#include +#include +#include +#include +#include + +struct tm { + int tm_sec; /* seconds after the minute [0-60] */ + int tm_min; /* minutes after the hour [0-59] */ + int tm_hour; /* hours since midnight [0-23] */ + int tm_mday; /* day of the month [1-31] */ + int tm_mon; /* months since January [0-11] */ + int tm_year; /* years since 1900 */ + int tm_wday; /* days since Sunday [0-6] */ + int tm_yday; /* days since January 1 [0-365] */ + int tm_isdst; /* Daylight Savings Time flag */ + long tm_gmtoff; /* offset from UTC in seconds */ + char *tm_zone; /* timezone abbreviation */ +}; + +#if __DARWIN_UNIX03 +#define CLOCKS_PER_SEC 1000000 /* [XSI] */ +#else /* !__DARWIN_UNIX03 */ +#include /* Include file containing CLK_TCK. */ + +#define CLOCKS_PER_SEC (__DARWIN_CLK_TCK) +#endif /* __DARWIN_UNIX03 */ + +#ifndef _ANSI_SOURCE +extern char *tzname[]; +#endif + +extern int getdate_err; +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_TIMEZONE +//End-Libc +extern long timezone __DARWIN_ALIAS(timezone); +//Begin-Libc +#else /* LIBC_ALIAS_TIMEZONE */ +extern long timezone LIBC_ALIAS(timezone); +#endif /* !LIBC_ALIAS_TIMEZONE */ +//End-Libc +#endif /* __DARWIN_UNIX03 */ +extern int daylight; +#endif /* UNIFDEF_DRIVERKIT */ + +__BEGIN_DECLS +#ifndef UNIFDEF_DRIVERKIT +char *asctime(const struct tm *); +//Begin-Libc +#ifndef LIBC_ALIAS_CLOCK +//End-Libc +clock_t clock(void) __DARWIN_ALIAS(clock); +//Begin-Libc +#else /* LIBC_ALIAS_CLOCK */ +clock_t clock(void) LIBC_ALIAS(clock); +#endif /* !LIBC_ALIAS_CLOCK */ +//End-Libc +char *ctime(const time_t *); +double difftime(time_t, time_t); +struct tm *getdate(const char *); +struct tm *gmtime(const time_t *); +struct tm *localtime(const time_t *); +//Begin-Libc +#ifndef LIBC_ALIAS_MKTIME +//End-Libc +time_t mktime(struct tm *) __DARWIN_ALIAS(mktime); +//Begin-Libc +#else /* LIBC_ALIAS_MKTIME */ +time_t mktime(struct tm *) LIBC_ALIAS(mktime); +#endif /* !LIBC_ALIAS_MKTIME */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_STRFTIME +//End-Libc +size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime); +//Begin-Libc +#else /* LIBC_ALIAS_STRFTIME */ +size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) LIBC_ALIAS(strftime); +#endif /* !LIBC_ALIAS_STRFTIME */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_STRPTIME +//End-Libc +char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime); +//Begin-Libc +#else /* LIBC_ALIAS_STRPTIME */ +char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) LIBC_ALIAS(strptime); +#endif /* !LIBC_ALIAS_STRPTIME */ +//End-Libc +time_t time(time_t *); + +#ifndef _ANSI_SOURCE +void tzset(void); +#endif /* not ANSI */ + +/* [TSF] Thread safe functions */ +char *asctime_r(const struct tm * __restrict, char * __restrict); +char *ctime_r(const time_t *, char *); +struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict); +struct tm *localtime_r(const time_t * __restrict, struct tm * __restrict); + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +time_t posix2time(time_t); +#if !__DARWIN_UNIX03 +char *timezone(int, int); +#endif /* !__DARWIN_UNIX03 */ +void tzsetwall(void); +time_t time2posix(time_t); +time_t timelocal(struct tm * const); +time_t timegm(struct tm * const); +#endif /* neither ANSI nor POSIX */ + +#if !defined(_ANSI_SOURCE) +//Begin-Libc +#ifndef LIBC_ALIAS_NANOSLEEP +//End-Libc +int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __DARWIN_ALIAS_C(nanosleep); +//Begin-Libc +#else /* LIBC_ALIAS_NANOSLEEP */ +int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) LIBC_ALIAS_C(nanosleep); +#endif /* !LIBC_ALIAS_NANOSLEEP */ +//End-Libc +#endif +#endif /* UNIFDEF_DRIVERKIT */ + +#if !defined(_DARWIN_FEATURE_CLOCK_GETTIME) || _DARWIN_FEATURE_CLOCK_GETTIME != 0 +#if __DARWIN_C_LEVEL >= 199309L +#if __has_feature(enumerator_attributes) +#define __CLOCK_AVAILABILITY __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) +#else +#define __CLOCK_AVAILABILITY +#endif + +typedef enum { +_CLOCK_REALTIME __CLOCK_AVAILABILITY = 0, +#define CLOCK_REALTIME _CLOCK_REALTIME +_CLOCK_MONOTONIC __CLOCK_AVAILABILITY = 6, +#define CLOCK_MONOTONIC _CLOCK_MONOTONIC +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +_CLOCK_MONOTONIC_RAW __CLOCK_AVAILABILITY = 4, +#define CLOCK_MONOTONIC_RAW _CLOCK_MONOTONIC_RAW +_CLOCK_MONOTONIC_RAW_APPROX __CLOCK_AVAILABILITY = 5, +#define CLOCK_MONOTONIC_RAW_APPROX _CLOCK_MONOTONIC_RAW_APPROX +_CLOCK_UPTIME_RAW __CLOCK_AVAILABILITY = 8, +#define CLOCK_UPTIME_RAW _CLOCK_UPTIME_RAW +_CLOCK_UPTIME_RAW_APPROX __CLOCK_AVAILABILITY = 9, +#define CLOCK_UPTIME_RAW_APPROX _CLOCK_UPTIME_RAW_APPROX +#endif +_CLOCK_PROCESS_CPUTIME_ID __CLOCK_AVAILABILITY = 12, +#define CLOCK_PROCESS_CPUTIME_ID _CLOCK_PROCESS_CPUTIME_ID +_CLOCK_THREAD_CPUTIME_ID __CLOCK_AVAILABILITY = 16 +#define CLOCK_THREAD_CPUTIME_ID _CLOCK_THREAD_CPUTIME_ID +} clockid_t; + +#ifndef UNIFDEF_DRIVERKIT +__CLOCK_AVAILABILITY +int clock_getres(clockid_t __clock_id, struct timespec *__res); + +__CLOCK_AVAILABILITY +int clock_gettime(clockid_t __clock_id, struct timespec *__tp); + +#endif /* UNIFDEF_DRIVERKIT */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +__CLOCK_AVAILABILITY +__uint64_t clock_gettime_nsec_np(clockid_t __clock_id); +#endif + +#ifndef UNIFDEF_DRIVERKIT +__OSX_AVAILABLE(10.12) __IOS_PROHIBITED +__TVOS_PROHIBITED __WATCHOS_PROHIBITED +int clock_settime(clockid_t __clock_id, const struct timespec *__tp); + +#endif /* UNIFDEF_DRIVERKIT */ +#undef __CLOCK_AVAILABILITY +#endif /* __DARWIN_C_LEVEL */ +#endif /* _DARWIN_FEATURE_CLOCK_GETTIME */ + +#ifndef UNIFDEF_DRIVERKIT +#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) && \ + ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ + (defined(__cplusplus) && __cplusplus >= 201703L)) +/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ +#define TIME_UTC 1 /* time elapsed since epoch */ +__API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0)) +int timespec_get(struct timespec *ts, int base); +#endif + +#endif /* UNIFDEF_DRIVERKIT */ +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_TIME_H_ */ diff --git a/private-include/unistd.h b/private-include/unistd.h new file mode 100644 index 0000000..01b7166 --- /dev/null +++ b/private-include/unistd.h @@ -0,0 +1,992 @@ +/* + * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)unistd.h 8.12 (Berkeley) 4/27/95 + * + * Copyright (c) 1998 Apple Compter, Inc. + * All Rights Reserved + */ + +/* History: + 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr + 3/26/98 CHW at Apple added real interface to searchfs call + 3/5/98 CHW at Apple added hfs semantic system calls headers +*/ + +#ifndef _UNISTD_H_ +#define _UNISTD_H_ + +#include <_types.h> +#include +#include +#include +#include +#include +#include +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +#include +#include +#include +#include +#include + +#define STDIN_FILENO 0 /* standard input file descriptor */ +#define STDOUT_FILENO 1 /* standard output file descriptor */ +#define STDERR_FILENO 2 /* standard error file descriptor */ + + +/* Version test macros */ +/* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */ +#define _XOPEN_VERSION 600 /* [XSI] */ +#define _XOPEN_XCU_VERSION 4 /* Older standard */ + + +/* Please keep this list in the same order as the applicable standard */ +#define _POSIX_ADVISORY_INFO (-1) /* [ADV] */ +#define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */ +#define _POSIX_BARRIERS (-1) /* [BAR] */ +#define _POSIX_CHOWN_RESTRICTED 200112L +#define _POSIX_CLOCK_SELECTION (-1) /* [CS] */ +#define _POSIX_CPUTIME (-1) /* [CPT] */ +#define _POSIX_FSYNC 200112L /* [FSC] */ +#define _POSIX_IPV6 200112L +#define _POSIX_JOB_CONTROL 200112L +#define _POSIX_MAPPED_FILES 200112L /* [MF] */ +#define _POSIX_MEMLOCK (-1) /* [ML] */ +#define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */ +#define _POSIX_MEMORY_PROTECTION 200112L /* [MPR] */ +#define _POSIX_MESSAGE_PASSING (-1) /* [MSG] */ +#define _POSIX_MONOTONIC_CLOCK (-1) /* [MON] */ +#define _POSIX_NO_TRUNC 200112L +#define _POSIX_PRIORITIZED_IO (-1) /* [PIO] */ +#define _POSIX_PRIORITY_SCHEDULING (-1) /* [PS] */ +#define _POSIX_RAW_SOCKETS (-1) /* [RS] */ +#define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */ +#define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */ +#define _POSIX_REGEXP 200112L +#define _POSIX_SAVED_IDS 200112L /* XXX required */ +#define _POSIX_SEMAPHORES (-1) /* [SEM] */ +#define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */ +#define _POSIX_SHELL 200112L +#define _POSIX_SPAWN (-1) /* [SPN] */ +#define _POSIX_SPIN_LOCKS (-1) /* [SPI] */ +#define _POSIX_SPORADIC_SERVER (-1) /* [SS] */ +#define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */ +#define _POSIX_THREAD_ATTR_STACKADDR 200112L /* [TSA] */ +#define _POSIX_THREAD_ATTR_STACKSIZE 200112L /* [TSS] */ +#define _POSIX_THREAD_CPUTIME (-1) /* [TCT] */ +#define _POSIX_THREAD_PRIO_INHERIT (-1) /* [TPI] */ +#define _POSIX_THREAD_PRIO_PROTECT (-1) /* [TPP] */ +#define _POSIX_THREAD_PRIORITY_SCHEDULING (-1) /* [TPS] */ +#define _POSIX_THREAD_PROCESS_SHARED 200112L /* [TSH] */ +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L /* [TSF] */ +#define _POSIX_THREAD_SPORADIC_SERVER (-1) /* [TSP] */ +#define _POSIX_THREADS 200112L /* [THR] */ +#define _POSIX_TIMEOUTS (-1) /* [TMO] */ +#define _POSIX_TIMERS (-1) /* [TMR] */ +#define _POSIX_TRACE (-1) /* [TRC] */ +#define _POSIX_TRACE_EVENT_FILTER (-1) /* [TEF] */ +#define _POSIX_TRACE_INHERIT (-1) /* [TRI] */ +#define _POSIX_TRACE_LOG (-1) /* [TRL] */ +#define _POSIX_TYPED_MEMORY_OBJECTS (-1) /* [TYM] */ +#ifndef _POSIX_VDISABLE +#define _POSIX_VDISABLE 0xff /* same as sys/termios.h */ +#endif /* _POSIX_VDISABLE */ + +#if __DARWIN_C_LEVEL >= 199209L +#define _POSIX2_C_BIND 200112L +#define _POSIX2_C_DEV 200112L /* c99 command */ +#define _POSIX2_CHAR_TERM 200112L +#define _POSIX2_FORT_DEV (-1) /* fort77 command */ +#define _POSIX2_FORT_RUN 200112L +#define _POSIX2_LOCALEDEF 200112L /* localedef command */ +#define _POSIX2_PBS (-1) +#define _POSIX2_PBS_ACCOUNTING (-1) +#define _POSIX2_PBS_CHECKPOINT (-1) +#define _POSIX2_PBS_LOCATE (-1) +#define _POSIX2_PBS_MESSAGE (-1) +#define _POSIX2_PBS_TRACK (-1) +#define _POSIX2_SW_DEV 200112L +#define _POSIX2_UPE 200112L /* XXXX no fc, newgrp, tabs */ +#endif /* __DARWIN_C_LEVEL */ + +#define __ILP32_OFF32 (-1) +#ifdef UNIFDEF_POSIX_ILP32_ALLOW +#define __ILP32_OFFBIG (1) +#else // UNIFDEF_POSIX_ILP32_ALLOW +#define __ILP32_OFFBIG (-1) +#endif // UNIFDEF_POSIX_ILP32_ALLOW + +#define __LP64_OFF64 (1) +#define __LPBIG_OFFBIG (1) + +#if __DARWIN_C_LEVEL >= 200112L +#define _POSIX_V6_ILP32_OFF32 __ILP32_OFF32 +#define _POSIX_V6_ILP32_OFFBIG __ILP32_OFFBIG +#define _POSIX_V6_LP64_OFF64 __LP64_OFF64 +#define _POSIX_V6_LPBIG_OFFBIG __LPBIG_OFFBIG +#endif /* __DARWIN_C_LEVEL >= 200112L */ + +#if __DARWIN_C_LEVEL >= 200809L +#define _POSIX_V7_ILP32_OFF32 __ILP32_OFF32 +#define _POSIX_V7_ILP32_OFFBIG __ILP32_OFFBIG +#define _POSIX_V7_LP64_OFF64 __LP64_OFF64 +#define _POSIX_V7_LPBIG_OFFBIG __LPBIG_OFFBIG +#endif /* __DARWIN_C_LEVEL >= 200809L */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define _V6_ILP32_OFF32 __ILP32_OFF32 +#define _V6_ILP32_OFFBIG __ILP32_OFFBIG +#define _V6_LP64_OFF64 __LP64_OFF64 +#define _V6_LPBIG_OFFBIG __LPBIG_OFFBIG +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL +/* Removed in Issue 7 */ +#define _XBS5_ILP32_OFF32 __ILP32_OFF32 +#define _XBS5_ILP32_OFFBIG __ILP32_OFFBIG +#define _XBS5_LP64_OFF64 __LP64_OFF64 +#define _XBS5_LPBIG_OFFBIG __LPBIG_OFFBIG +#endif /* __DARWIN_C_LEVEL < 200809L */ + +#if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */ +#define _XOPEN_CRYPT (1) +#define _XOPEN_ENH_I18N (1) /* XXX required */ +#define _XOPEN_LEGACY (-1) /* no ftime gcvt, wcswcs */ +#define _XOPEN_REALTIME (-1) /* no q'ed signals, mq_* */ +#define _XOPEN_REALTIME_THREADS (-1) /* no posix_spawn, et. al. */ +#define _XOPEN_SHM (1) +#define _XOPEN_STREAMS (-1) /* Issue 6 */ +#define _XOPEN_UNIX (1) +#endif /* XSI */ + +/* configurable system variables */ +#define _SC_ARG_MAX 1 +#define _SC_CHILD_MAX 2 +#define _SC_CLK_TCK 3 +#define _SC_NGROUPS_MAX 4 +#define _SC_OPEN_MAX 5 +#define _SC_JOB_CONTROL 6 +#define _SC_SAVED_IDS 7 +#define _SC_VERSION 8 +#define _SC_BC_BASE_MAX 9 +#define _SC_BC_DIM_MAX 10 +#define _SC_BC_SCALE_MAX 11 +#define _SC_BC_STRING_MAX 12 +#define _SC_COLL_WEIGHTS_MAX 13 +#define _SC_EXPR_NEST_MAX 14 +#define _SC_LINE_MAX 15 +#define _SC_RE_DUP_MAX 16 +#define _SC_2_VERSION 17 +#define _SC_2_C_BIND 18 +#define _SC_2_C_DEV 19 +#define _SC_2_CHAR_TERM 20 +#define _SC_2_FORT_DEV 21 +#define _SC_2_FORT_RUN 22 +#define _SC_2_LOCALEDEF 23 +#define _SC_2_SW_DEV 24 +#define _SC_2_UPE 25 +#define _SC_STREAM_MAX 26 +#define _SC_TZNAME_MAX 27 + +#if __DARWIN_C_LEVEL >= 199309L +#define _SC_ASYNCHRONOUS_IO 28 +#define _SC_PAGESIZE 29 +#define _SC_MEMLOCK 30 +#define _SC_MEMLOCK_RANGE 31 +#define _SC_MEMORY_PROTECTION 32 +#define _SC_MESSAGE_PASSING 33 +#define _SC_PRIORITIZED_IO 34 +#define _SC_PRIORITY_SCHEDULING 35 +#define _SC_REALTIME_SIGNALS 36 +#define _SC_SEMAPHORES 37 +#define _SC_FSYNC 38 +#define _SC_SHARED_MEMORY_OBJECTS 39 +#define _SC_SYNCHRONIZED_IO 40 +#define _SC_TIMERS 41 +#define _SC_AIO_LISTIO_MAX 42 +#define _SC_AIO_MAX 43 +#define _SC_AIO_PRIO_DELTA_MAX 44 +#define _SC_DELAYTIMER_MAX 45 +#define _SC_MQ_OPEN_MAX 46 +#define _SC_MAPPED_FILES 47 /* swap _SC_PAGESIZE vs. BSD */ +#define _SC_RTSIG_MAX 48 +#define _SC_SEM_NSEMS_MAX 49 +#define _SC_SEM_VALUE_MAX 50 +#define _SC_SIGQUEUE_MAX 51 +#define _SC_TIMER_MAX 52 +#endif /* __DARWIN_C_LEVEL >= 199309L */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define _SC_NPROCESSORS_CONF 57 +#define _SC_NPROCESSORS_ONLN 58 +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#if __DARWIN_C_LEVEL >= 200112L +#define _SC_2_PBS 59 +#define _SC_2_PBS_ACCOUNTING 60 +#define _SC_2_PBS_CHECKPOINT 61 +#define _SC_2_PBS_LOCATE 62 +#define _SC_2_PBS_MESSAGE 63 +#define _SC_2_PBS_TRACK 64 +#define _SC_ADVISORY_INFO 65 +#define _SC_BARRIERS 66 +#define _SC_CLOCK_SELECTION 67 +#define _SC_CPUTIME 68 +#define _SC_FILE_LOCKING 69 +#define _SC_GETGR_R_SIZE_MAX 70 +#define _SC_GETPW_R_SIZE_MAX 71 +#define _SC_HOST_NAME_MAX 72 +#define _SC_LOGIN_NAME_MAX 73 +#define _SC_MONOTONIC_CLOCK 74 +#define _SC_MQ_PRIO_MAX 75 +#define _SC_READER_WRITER_LOCKS 76 +#define _SC_REGEXP 77 +#define _SC_SHELL 78 +#define _SC_SPAWN 79 +#define _SC_SPIN_LOCKS 80 +#define _SC_SPORADIC_SERVER 81 +#define _SC_THREAD_ATTR_STACKADDR 82 +#define _SC_THREAD_ATTR_STACKSIZE 83 +#define _SC_THREAD_CPUTIME 84 +#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 +#define _SC_THREAD_KEYS_MAX 86 +#define _SC_THREAD_PRIO_INHERIT 87 +#define _SC_THREAD_PRIO_PROTECT 88 +#define _SC_THREAD_PRIORITY_SCHEDULING 89 +#define _SC_THREAD_PROCESS_SHARED 90 +#define _SC_THREAD_SAFE_FUNCTIONS 91 +#define _SC_THREAD_SPORADIC_SERVER 92 +#define _SC_THREAD_STACK_MIN 93 +#define _SC_THREAD_THREADS_MAX 94 +#define _SC_TIMEOUTS 95 +#define _SC_THREADS 96 +#define _SC_TRACE 97 +#define _SC_TRACE_EVENT_FILTER 98 +#define _SC_TRACE_INHERIT 99 +#define _SC_TRACE_LOG 100 +#define _SC_TTY_NAME_MAX 101 +#define _SC_TYPED_MEMORY_OBJECTS 102 +#define _SC_V6_ILP32_OFF32 103 +#define _SC_V6_ILP32_OFFBIG 104 +#define _SC_V6_LP64_OFF64 105 +#define _SC_V6_LPBIG_OFFBIG 106 +#define _SC_IPV6 118 +#define _SC_RAW_SOCKETS 119 +#define _SC_SYMLOOP_MAX 120 +#endif /* __DARWIN_C_LEVEL >= 200112L */ + +#if __DARWIN_C_LEVEL >= 199506L /* Really XSI */ +#define _SC_ATEXIT_MAX 107 +#define _SC_IOV_MAX 56 +#define _SC_PAGE_SIZE _SC_PAGESIZE +#define _SC_XOPEN_CRYPT 108 +#define _SC_XOPEN_ENH_I18N 109 +#define _SC_XOPEN_LEGACY 110 /* Issue 6 */ +#define _SC_XOPEN_REALTIME 111 /* Issue 6 */ +#define _SC_XOPEN_REALTIME_THREADS 112 /* Issue 6 */ +#define _SC_XOPEN_SHM 113 +#define _SC_XOPEN_STREAMS 114 /* Issue 6 */ +#define _SC_XOPEN_UNIX 115 +#define _SC_XOPEN_VERSION 116 +#define _SC_XOPEN_XCU_VERSION 121 +#endif /* XSI */ + +#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL +/* Removed in Issue 7 */ +#define _SC_XBS5_ILP32_OFF32 122 +#define _SC_XBS5_ILP32_OFFBIG 123 +#define _SC_XBS5_LP64_OFF64 124 +#define _SC_XBS5_LPBIG_OFFBIG 125 +#endif /* __DARWIN_C_LEVEL <= 200809L */ + +#if __DARWIN_C_LEVEL >= 200112L +#define _SC_SS_REPL_MAX 126 +#define _SC_TRACE_EVENT_NAME_MAX 127 +#define _SC_TRACE_NAME_MAX 128 +#define _SC_TRACE_SYS_MAX 129 +#define _SC_TRACE_USER_EVENT_MAX 130 +#endif + +#if __DARWIN_C_LEVEL < 200112L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL +/* Removed in Issue 6 */ +#define _SC_PASS_MAX 131 +#endif + +/* 132-199 available for future use */ +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define _SC_PHYS_PAGES 200 +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#if __DARWIN_C_LEVEL >= 199209L +#ifndef _CS_PATH /* Defined in */ +#define _CS_PATH 1 +#endif +#endif + +#if __DARWIN_C_LEVEL >= 200112 +#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2 +#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3 +#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4 +#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5 +#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6 +#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7 +#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8 +#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9 +#define _CS_POSIX_V6_LP64_OFF64_LIBS 10 +#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13 +#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14 +#endif + +#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL +/* Removed in Issue 7 */ +#define _CS_XBS5_ILP32_OFF32_CFLAGS 20 +#define _CS_XBS5_ILP32_OFF32_LDFLAGS 21 +#define _CS_XBS5_ILP32_OFF32_LIBS 22 +#define _CS_XBS5_ILP32_OFF32_LINTFLAGS 23 +#define _CS_XBS5_ILP32_OFFBIG_CFLAGS 24 +#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 25 +#define _CS_XBS5_ILP32_OFFBIG_LIBS 26 +#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 27 +#define _CS_XBS5_LP64_OFF64_CFLAGS 28 +#define _CS_XBS5_LP64_OFF64_LDFLAGS 29 +#define _CS_XBS5_LP64_OFF64_LIBS 30 +#define _CS_XBS5_LP64_OFF64_LINTFLAGS 31 +#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 32 +#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 33 +#define _CS_XBS5_LPBIG_OFFBIG_LIBS 34 +#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 35 +#endif + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#define _CS_DARWIN_USER_DIR 65536 +#define _CS_DARWIN_USER_TEMP_DIR 65537 +#define _CS_DARWIN_USER_CACHE_DIR 65538 +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + + +#ifdef _DARWIN_UNLIMITED_GETGROUPS +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 +#error "_DARWIN_UNLIMITED_GETGROUPS specified, but -miphoneos-version-min version does not support it." +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6 +#error "_DARWIN_UNLIMITED_GETGROUPS specified, but -mmacosx-version-min version does not support it." +#endif +#endif + +/* POSIX.1-1990 */ + +__BEGIN_DECLS +void _exit(int) __dead2; +int access(const char *, int); +unsigned int + alarm(unsigned int); +int chdir(const char *); +int chown(const char *, uid_t, gid_t); + +//Begin-Libc +#ifndef LIBC_ALIAS_CLOSE +//End-Libc +int close(int) __DARWIN_ALIAS_C(close); +//Begin-Libc +#else /* LIBC_ALIAS_CLOSE */ +int close(int) LIBC_ALIAS_C(close); +#endif /* !LIBC_ALIAS_CLOSE */ +//End-Libc + +int dup(int); +int dup2(int, int); +int execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execle(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execlp(const char * __file, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execv(const char * __path, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execve(const char * __file, char * const * __argv, char * const * __envp) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +pid_t fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +long fpathconf(int, int); +char *getcwd(char *, size_t); +gid_t getegid(void); +uid_t geteuid(void); +gid_t getgid(void); +#if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE) +int getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups)); +#else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */ +int getgroups(int, gid_t []); +#endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */ +char *getlogin(void); +pid_t getpgrp(void); +pid_t getpid(void); +pid_t getppid(void); +uid_t getuid(void); +int isatty(int); +int link(const char *, const char *); +off_t lseek(int, off_t, int); +long pathconf(const char *, int); + +//Begin-Libc +#ifndef LIBC_ALIAS_PAUSE +//End-Libc +int pause(void) __DARWIN_ALIAS_C(pause); +//Begin-Libc +#else /* LIBC_ALIAS_PAUSE */ +int pause(void) LIBC_ALIAS_C(pause); +#endif /* !LIBC_ALIAS_PAUSE */ +//End-Libc + +int pipe(int [2]); + +//Begin-Libc +#ifndef LIBC_ALIAS_READ +//End-Libc +ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read); +//Begin-Libc +#else /* LIBC_ALIAS_READ */ +ssize_t read(int, void *, size_t) LIBC_ALIAS_C(read); +#endif /* !LIBC_ALIAS_READ */ +//End-Libc + +int rmdir(const char *); +int setgid(gid_t); +int setpgid(pid_t, pid_t); +pid_t setsid(void); +int setuid(uid_t); + +//Begin-Libc +#ifndef LIBC_ALIAS_SLEEP +//End-Libc +unsigned int + sleep(unsigned int) __DARWIN_ALIAS_C(sleep); +//Begin-Libc +#else /* LIBC_ALIAS_SLEEP */ +unsigned int + sleep(unsigned int) LIBC_ALIAS_C(sleep); +#endif /* !LIBC_ALIAS_SLEEP */ +//End-Libc + +long sysconf(int); +pid_t tcgetpgrp(int); +int tcsetpgrp(int, pid_t); +char *ttyname(int); + +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_TTYNAME_R +//End-Libc +int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r); +//Begin-Libc +#else /* LIBC_ALIAS_TTYNAME_R */ +int ttyname_r(int, char *, size_t) LIBC_ALIAS(ttyname_r); +#endif /* !LIBC_ALIAS_TTYNAME_R */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +char *ttyname_r(int, char *, size_t); +#endif /* __DARWIN_UNIX03 */ + +int unlink(const char *); + +//Begin-Libc +#ifndef LIBC_ALIAS_WRITE +//End-Libc +ssize_t write(int __fd, const void * __buf, size_t __nbyte) __DARWIN_ALIAS_C(write); +//Begin-Libc +#else /* LIBC_ALIAS_WRITE */ +ssize_t write(int __fd, const void * __buf, size_t __nbyte) LIBC_ALIAS_C(write); +#endif /* !LIBC_ALIAS_WRITE */ +//End-Libc +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.2-1992 C Language Binding Option + */ + +#if __DARWIN_C_LEVEL >= 199209L +__BEGIN_DECLS +//Begin-Libc +#ifndef LIBC_ALIAS_CONFSTR +//End-Libc +size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr); +//Begin-Libc +#else /* LIBC_ALIAS_CONFSTR */ +size_t confstr(int, char *, size_t) LIBC_ALIAS(confstr); +#endif /* !LIBC_ALIAS_CONFSTR */ +//End-Libc + +//Begin-Libc +#ifndef LIBC_ALIAS_GETOPT +//End-Libc +int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); +//Begin-Libc +#else /* LIBC_ALIAS_GETOPT */ +int getopt(int, char * const [], const char *) LIBC_ALIAS(getopt); +#endif /* !LIBC_ALIAS_GETOPT */ +//End-Libc + +extern char *optarg; /* getopt(3) external variables */ +extern int optind, opterr, optopt; +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 199209L */ + + + +/* Additional functionality provided by: + * POSIX.1c-1995, + * POSIX.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + */ + +#if __DARWIN_C_LEVEL >= 199506L +#include <_ctermid.h> + /* These F_* are really XSI or Issue 6 */ +#define F_ULOCK 0 /* unlock locked section */ +#define F_LOCK 1 /* lock a section for exclusive use */ +#define F_TLOCK 2 /* test and lock a section for exclusive use */ +#define F_TEST 3 /* test a section for locks by other procs */ + + __BEGIN_DECLS + +/* Begin XSI */ +/* Removed in Issue 6 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L +#if !defined(_POSIX_C_SOURCE) +__deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED +#endif +void *brk(const void *); +int chroot(const char *) __POSIX_C_DEPRECATED(199506L); +#endif + +char *crypt(const char *, const char *); +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_ENCRYPT +//End-Libc +void encrypt(char *, int) __DARWIN_ALIAS(encrypt); +//Begin-Libc +#else /* LIBC_ALIAS_ENCRYPT */ +void encrypt(char *, int) LIBC_ALIAS(encrypt); +#endif /* !LIBC_ALIAS_ENCRYPT */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +int encrypt(char *, int); +#endif /* __DARWIN_UNIX03 */ +int fchdir(int); +long gethostid(void); +pid_t getpgid(pid_t); +pid_t getsid(pid_t); + +/* Removed in Issue 6 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L +int getdtablesize(void) __POSIX_C_DEPRECATED(199506L); +int getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L); +char *getpass(const char *) __POSIX_C_DEPRECATED(199506L); +#endif + +/* Removed in Issue 7 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L +char *getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */ +#endif + +//Begin-Libc +#ifndef LIBC_ALIAS_LCHOWN +//End-Libc +int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown); +//Begin-Libc +#else /* LIBC_ALIAS_LCHOWN */ +int lchown(const char *, uid_t, gid_t) LIBC_ALIAS(lchown); +#endif /* !LIBC_ALIAS_LCHOWN */ +//End-Libc + +//Begin-Libc +#ifndef LIBC_ALIAS_LOCKF +//End-Libc +int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); +//Begin-Libc +#else /* LIBC_ALIAS_LOCKF */ +int lockf(int, int, off_t) LIBC_ALIAS_C(lockf); +#endif /* !LIBC_ALIAS_LOCKF */ +//End-Libc + +//Begin-Libc +#ifndef LIBC_ALIAS_NICE +//End-Libc +int nice(int) __DARWIN_ALIAS(nice); +//Begin-Libc +#else /* LIBC_ALIAS_NICE */ +int nice(int) LIBC_ALIAS(nice); +#endif /* !LIBC_ALIAS_NICE */ +//End-Libc + +//Begin-Libc +#ifndef LIBC_ALIAS_PREAD +//End-Libc +ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread); +//Begin-Libc +#else /* LIBC_ALIAS_PREAD */ +ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) LIBC_ALIAS_C(pread); +#endif /* !LIBC_ALIAS_PREAD */ +//End-Libc + +//Begin-Libc +#ifndef LIBC_ALIAS_PWRITE +//End-Libc +ssize_t pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pwrite); +//Begin-Libc +#else /* LIBC_ALIAS_PWRITE */ +ssize_t pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) LIBC_ALIAS_C(pwrite); +#endif /* !LIBC_ALIAS_PWRITE */ +//End-Libc + +/* Removed in Issue 6 */ +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L +/* Note that Issue 5 changed the argument as intprt_t, + * but we keep it as int for binary compatability. */ +#if !defined(_POSIX_C_SOURCE) +__deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED +#endif +void *sbrk(int); +#endif + +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_SETPGRP +//End-Libc +pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp); +//Begin-Libc +#else /* LIBC_ALIAS_SETPGRP */ +pid_t setpgrp(void) LIBC_ALIAS(setpgrp); +#endif /* !LIBC_ALIAS_SETPGRP */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */ +#endif /* __DARWIN_UNIX03 */ + +//Begin-Libc +#ifndef LIBC_ALIAS_SETREGID +//End-Libc +int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); +//Begin-Libc +#else /* LIBC_ALIAS_SETREGID */ +int setregid(gid_t, gid_t) LIBC_ALIAS(setregid); +#endif /* !LIBC_ALIAS_SETREGID */ +//End-Libc + +//Begin-Libc +#ifndef LIBC_ALIAS_SETREUID +//End-Libc +int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid); +//Begin-Libc +#else /* LIBC_ALIAS_SETREUID */ +int setreuid(uid_t, uid_t) LIBC_ALIAS(setreuid); +#endif /* !LIBC_ALIAS_SETREUID */ +//End-Libc + +void swab(const void * __restrict, void * __restrict, ssize_t); +void sync(void); +int truncate(const char *, off_t); +useconds_t ualarm(useconds_t, useconds_t); +//Begin-Libc +#ifndef LIBC_ALIAS_USLEEP +//End-Libc +int usleep(useconds_t) __DARWIN_ALIAS_C(usleep); +//Begin-Libc +#else /* LIBC_ALIAS_USLEEP */ +int usleep(useconds_t) LIBC_ALIAS_C(usleep); +#endif /* !LIBC_ALIAS_USLEEP */ +//End-Libc +pid_t vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +/* End XSI */ + +//Begin-Libc +#ifndef LIBC_ALIAS_FSYNC +//End-Libc +int fsync(int) __DARWIN_ALIAS_C(fsync); +//Begin-Libc +#else /* LIBC_ALIAS_FSYNC */ +int fsync(int) LIBC_ALIAS_C(fsync); +#endif /* !LIBC_ALIAS_FSYNC */ +//End-Libc + +int ftruncate(int, off_t); +int getlogin_r(char *, size_t); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 199506L */ + + + +/* Additional functionality provided by: + * POSIX.1-2001 + * ISO C99 + */ + +#if __DARWIN_C_LEVEL >= 200112L +__BEGIN_DECLS +int fchown(int, uid_t, gid_t); +int gethostname(char *, size_t); +ssize_t readlink(const char * __restrict, char * __restrict, size_t); +int setegid(gid_t); +int seteuid(uid_t); +int symlink(const char *, const char *); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L */ + + + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +#include + +#include +#include +#include + +__BEGIN_DECLS +void _Exit(int) __dead2; +int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); +int acct(const char *); +int add_profil(char *, size_t, unsigned long, unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +void endusershell(void); +int execvP(const char * __file, const char * __searchpath, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +char *fflagstostr(unsigned long); +int getdomainname(char *, int); +int getgrouplist(const char *, int, int *, int *); +#if defined(__has_include) +#if __has_include() +#include +#else +#include +#endif +#else +#include +#endif +mode_t getmode(const void *, mode_t); +int getpeereid(int, uid_t *, gid_t *); +int getsgroups_np(int *, uuid_t); +char *getusershell(void); +int getwgroups_np(int *, uuid_t); +int initgroups(const char *, int); +int issetugid(void); +char *mkdtemp(char *); +int mknod(const char *, mode_t, dev_t); +int mkpath_np(const char *path, mode_t omode) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_0); /* returns errno */ +int mkpathat_np(int dfd, const char *path, mode_t omode) /* returns errno */ + __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); +int mkstemp(char *); +int mkstemps(char *, int); +char *mktemp(char *); +int mkostemp(char *path, int oflags) + __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); +int mkostemps(char *path, int slen, int oflags) + __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); +/* Non-portable mkstemp that uses open_dprotected_np */ +int mkstemp_dprotected_np(char *path, int dpclass, int dpflags) + __OSX_UNAVAILABLE __IOS_AVAILABLE(10.0) + __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); +char *mkdtempat_np(int dfd, char *path) + __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) + __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); +int mkstempsat_np(int dfd, char *path, int slen) + __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) + __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); +int mkostempsat_np(int dfd, char *path, int slen, int oflags) + __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) + __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); +int nfssvc(int, void *); +int profil(char *, size_t, unsigned long, unsigned int); + +__deprecated_msg("Use of per-thread security contexts is error-prone and discouraged.") +int pthread_setugid_np(uid_t, gid_t); +int pthread_getugid_np( uid_t *, gid_t *); + +int reboot(int); +int revoke(const char *); + +__deprecated int rcmd(char **, int, const char *, const char *, const char *, int *); +__deprecated int rcmd_af(char **, int, const char *, const char *, const char *, int *, + int); +__deprecated int rresvport(int *); +__deprecated int rresvport_af(int *, int); +__deprecated int iruserok(unsigned long, int, const char *, const char *); +__deprecated int iruserok_sa(const void *, int, int, const char *, const char *); +__deprecated int ruserok(const char *, int, const char *, const char *); + +int setdomainname(const char *, int); +int setgroups(int, const gid_t *); +void sethostid(long); +int sethostname(const char *, int); +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_SETKEY +//End-Libc +void setkey(const char *) __DARWIN_ALIAS(setkey); +//Begin-Libc +#else /* LIBC_ALIAS_SETKEY */ +void setkey(const char *) LIBC_ALIAS(setkey); +#endif /* !LIBC_ALIAS_SETKEY */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +int setkey(const char *); +#endif /* __DARWIN_UNIX03 */ +int setlogin(const char *); +//Begin-Libc +#ifndef LIBC_ALIAS_SETMODE +//End-Libc +void *setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode)); +//Begin-Libc +#else /* LIBC_ALIAS_SETMODE */ +void *setmode(const char *) LIBC_ALIAS(setmode); +#endif /* !LIBC_ALIAS_SETMODE */ +//End-Libc +int setrgid(gid_t); +int setruid(uid_t); +int setsgroups_np(int, const uuid_t); +void setusershell(void); +int setwgroups_np(int, const uuid_t); +int strtofflags(char **, unsigned long *, unsigned long *); +int swapon(const char *); +int ttyslot(void); +int undelete(const char *); +int unwhiteout(const char *); +void *valloc(size_t); + +__WATCHOS_PROHIBITED __TVOS_PROHIBITED +__OS_AVAILABILITY_MSG(ios,deprecated=10.0,"syscall(2) is unsupported; " + "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") +__OS_AVAILABILITY_MSG(macosx,deprecated=10.12,"syscall(2) is unsupported; " + "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") +int syscall(int, ...); + +extern char *suboptarg; /* getsubopt(3) external variable */ +int getsubopt(char **, char * const *, char **); + +/* HFS & HFS Plus semantics system calls go here */ +#ifdef __LP64__ +int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); +int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); +//Begin-Libc +#ifndef LIBC_ALIAS_GETATTRLIST +//End-Libc +int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist); +//Begin-Libc +#else /* LIBC_ALIAS_GETATTRLIST */ +int getattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(getattrlist); +#endif /* !LIBC_ALIAS_GETATTRLIST */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_SETATTRLIST +//End-Libc +int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist); +//Begin-Libc +#else /* LIBC_ALIAS_SETATTRLIST */ +int setattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(setattrlist); +#endif /* !LIBC_ALIAS_SETATTRLIST */ +//End-Libc +int exchangedata(const char*,const char*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; + +#else /* __LP64__ */ +int fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); +int fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); +//Begin-Libc +#ifndef LIBC_ALIAS_GETATTRLIST +//End-Libc +int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist); +//Begin-Libc +#else /* LIBC_ALIAS_GETATTRLIST */ +int getattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(getattrlist); +#endif /* !LIBC_ALIAS_GETATTRLIST */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_SETATTRLIST +//End-Libc +int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist); +//Begin-Libc +#else /* LIBC_ALIAS_SETATTRLIST */ +int setattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(setattrlist); +#endif /* !LIBC_ALIAS_SETATTRLIST */ +//End-Libc +int exchangedata(const char*,const char*,unsigned long) + __OSX_DEPRECATED(10.0, 10.13, "use renamex_np with the RENAME_SWAP flag") + __IOS_DEPRECATED(2.0, 11.0, "use renamex_np with the RENAME_SWAP flag") + __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; + +#endif /* __LP64__ */ + +struct fssearchblock; +struct searchstate; + +int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; +int fsctl(const char *,unsigned long,void*,unsigned int); +int ffsctl(int,unsigned long,void*,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); + +#define SYNC_VOLUME_FULLSYNC 0x01 /* Flush data and metadata to platter, not just to disk cache */ +#define SYNC_VOLUME_WAIT 0x02 /* Wait for sync to complete */ + +int fsync_volume_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); +int sync_volume_np(const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); + +extern int optreset; + +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +#endif /* _UNISTD_H_ */ diff --git a/private-include/wchar.h b/private-include/wchar.h new file mode 100644 index 0000000..f68ce8f --- /dev/null +++ b/private-include/wchar.h @@ -0,0 +1,262 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: /repoman/r/ncvs/src/include/wchar.h,v 1.34 2003/03/13 06:29:53 tjr Exp $ + */ + +/*- + * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Julian Coleman. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $ + */ + +#ifndef _WCHAR_H_ +#define _WCHAR_H_ + +#include <_types.h> +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifndef WCHAR_MIN +#define WCHAR_MIN __DARWIN_WCHAR_MIN +#endif + +#ifndef WCHAR_MAX +#define WCHAR_MAX __DARWIN_WCHAR_MAX +#endif + +#include +#include +#ifndef UNIFDEF_DRIVERKIT +#include +#endif /* UNIFDEF_DRIVERKIT */ +#include <_wctype.h> + + +/* Initially added in Issue 4 */ +__BEGIN_DECLS +wint_t btowc(int); +#ifndef UNIFDEF_DRIVERKIT +wint_t fgetwc(FILE *); +wchar_t *fgetws(wchar_t * __restrict, int, FILE * __restrict); +wint_t fputwc(wchar_t, FILE *); +int fputws(const wchar_t * __restrict, FILE * __restrict); +int fwide(FILE *, int); +int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...); +int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...); +wint_t getwc(FILE *); +wint_t getwchar(void); +#endif /* UNIFDEF_DRIVERKIT */ +size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict); +size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict); +int mbsinit(const mbstate_t *); +size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, + mbstate_t * __restrict); +#ifndef UNIFDEF_DRIVERKIT +wint_t putwc(wchar_t, FILE *); +wint_t putwchar(wchar_t); +#endif /* UNIFDEF_DRIVERKIT */ +int swprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict, ...); +int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...); +#ifndef UNIFDEF_DRIVERKIT +wint_t ungetwc(wint_t, FILE *); +int vfwprintf(FILE * __restrict, const wchar_t * __restrict, + __darwin_va_list); +#endif /* UNIFDEF_DRIVERKIT */ +int vswprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict, + __darwin_va_list); +#ifndef UNIFDEF_DRIVERKIT +int vwprintf(const wchar_t * __restrict, __darwin_va_list); +#endif /* UNIFDEF_DRIVERKIT */ +size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); +wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict); +wchar_t *wcschr(const wchar_t *, wchar_t); +int wcscmp(const wchar_t *, const wchar_t *); +int wcscoll(const wchar_t *, const wchar_t *); +wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict); +size_t wcscspn(const wchar_t *, const wchar_t *); +#ifndef UNIFDEF_DRIVERKIT +//Begin-Libc +#ifndef LIBC_ALIAS_WCSFTIME +//End-Libc +size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict, + const struct tm * __restrict) __DARWIN_ALIAS(wcsftime); +//Begin-Libc +#else /* LIBC_ALIAS_WCSFTIME */ +size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict, + const struct tm * __restrict) LIBC_ALIAS(wcsftime); +#endif /* !LIBC_ALIAS_WCSFTIME */ +//End-Libc +#endif /* UNIFDEF_DRIVERKIT */ +size_t wcslen(const wchar_t *); +wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t); +int wcsncmp(const wchar_t *, const wchar_t *, size_t); +wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t); +wchar_t *wcspbrk(const wchar_t *, const wchar_t *); +wchar_t *wcsrchr(const wchar_t *, wchar_t); +size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t, + mbstate_t * __restrict); +size_t wcsspn(const wchar_t *, const wchar_t *); +wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict); +size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t); +int wctob(wint_t); +double wcstod(const wchar_t * __restrict, wchar_t ** __restrict); +wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict, + wchar_t ** __restrict); +long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int); +unsigned long + wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int); +wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); +int wmemcmp(const wchar_t *, const wchar_t *, size_t); +wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t); +wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); +wchar_t *wmemset(wchar_t *, wchar_t, size_t); +#ifndef UNIFDEF_DRIVERKIT +int wprintf(const wchar_t * __restrict, ...); +int wscanf(const wchar_t * __restrict, ...); +#endif /* UNIFDEF_DRIVERKIT */ +int wcswidth(const wchar_t *, size_t); +int wcwidth(wchar_t); +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.1-2001 + * ISO C99 + */ + +#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) +__BEGIN_DECLS +#ifndef UNIFDEF_DRIVERKIT +int vfwscanf(FILE * __restrict, const wchar_t * __restrict, + __darwin_va_list); +#endif /* UNIFDEF_DRIVERKIT */ +int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict, + __darwin_va_list); +#ifndef UNIFDEF_DRIVERKIT +int vwscanf(const wchar_t * __restrict, __darwin_va_list); +#endif /* UNIFDEF_DRIVERKIT */ +float wcstof(const wchar_t * __restrict, wchar_t ** __restrict); +long double + wcstold(const wchar_t * __restrict, wchar_t ** __restrict); +#if !__DARWIN_NO_LONG_LONG +long long + wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int); +unsigned long long + wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int); +#endif /* !__DARWIN_NO_LONG_LONG */ +__END_DECLS +#endif + + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +__BEGIN_DECLS +size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, + size_t, mbstate_t * __restrict); +wchar_t *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +wchar_t *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +wchar_t *wcsdup(const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +int wcscasecmp(const wchar_t *, const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +size_t wcsnlen(const wchar_t *, size_t) __pure __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t, + size_t, mbstate_t * __restrict); +#ifndef UNIFDEF_DRIVERKIT +FILE *open_wmemstream(wchar_t ** __bufp, size_t * __sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); +#endif /* UNIFDEF_DRIVERKIT */ +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + + + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +__BEGIN_DECLS +#ifndef UNIFDEF_DRIVERKIT +wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +#endif /* UNIFDEF_DRIVERKIT */ +size_t wcslcat(wchar_t *, const wchar_t *, size_t); +size_t wcslcpy(wchar_t *, const wchar_t *, size_t); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison fgetwln fgetws fputwc fputws fwprintf fwscanf mbrtowc mbsnrtowcs mbsrtowcs putwc putwchar swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf vwprintf vwscanf wcrtomb wcscat wcschr wcscmp wcscoll wcscpy wcscspn wcsftime wcsftime wcslcat wcslcpy wcslen wcsncat wcsncmp wcsncpy wcsnrtombs wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcswidth wcsxfrm wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf +#endif + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_WCHAR_H_ */ diff --git a/private-include/wctype.h b/private-include/wctype.h new file mode 100644 index 0000000..bebb2bf --- /dev/null +++ b/private-include/wctype.h @@ -0,0 +1,143 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp + * $NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $ + * $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $ + */ + +#ifndef _WCTYPE_H_ +#define _WCTYPE_H_ + +#include +#include <_types.h> +#include <_types/_wctrans_t.h> + +//Begin-Libc +/* + * _EXTERNALIZE_WCTYPE_INLINES_TOP_ is defined in locale/iswctype.c to tell us + * to generate code for extern versions of all top-level inline functions. + */ +#ifdef _EXTERNALIZE_WCTYPE_INLINES_TOP_ +#define _USE_CTYPE_INLINE_ +#define __DARWIN_WCTYPE_TOP_inline +#else /* !_EXTERNALIZE_WCTYPE_INLINES_TOP_ */ +//End-Libc +#define __DARWIN_WCTYPE_TOP_inline __header_inline +//Begin-Libc +#endif /* _EXTERNALIZE_WCTYPE_INLINES_TOP_ */ +//End-Libc + +#include <_wctype.h> +#include + +/* + * Use inline functions if we are allowed to and the compiler supports them. + */ +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +__DARWIN_WCTYPE_TOP_inline int +iswblank(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_B)); +} + +#if !defined(_ANSI_SOURCE) +__DARWIN_WCTYPE_TOP_inline int +iswascii(wint_t _wc) +{ + return ((_wc & ~0x7F) == 0); +} + +__DARWIN_WCTYPE_TOP_inline int +iswhexnumber(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_X)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswideogram(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_I)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswnumber(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_D)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswphonogram(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_Q)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswrune(wint_t _wc) +{ + return (__istype(_wc, 0xFFFFFFF0L)); +} + +__DARWIN_WCTYPE_TOP_inline int +iswspecial(wint_t _wc) +{ + return (__istype(_wc, _CTYPE_T)); +} +#endif /* !_ANSI_SOURCE */ + +#else /* not using inlines */ + +__BEGIN_DECLS +int iswblank(wint_t); + +#if !defined(_ANSI_SOURCE) +wint_t iswascii(wint_t); +wint_t iswhexnumber(wint_t); +wint_t iswideogram(wint_t); +wint_t iswnumber(wint_t); +wint_t iswphonogram(wint_t); +wint_t iswrune(wint_t); +wint_t iswspecial(wint_t); +#endif +__END_DECLS + +#endif /* using inlines */ + +__BEGIN_DECLS +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +wint_t nextwctype(wint_t, wctype_t); +#endif +wint_t towctrans(wint_t, wctrans_t); +wctrans_t + wctrans(const char *); +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* _WCTYPE_H_ */ diff --git a/private-include/xlocale.h b/private-include/xlocale.h new file mode 100644 index 0000000..5375138 --- /dev/null +++ b/private-include/xlocale.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE_H_ +#define _XLOCALE_H_ + +#include + +#ifndef _USE_EXTENDED_LOCALES_ +#define _USE_EXTENDED_LOCALES_ +#endif /* _USE_EXTENDED_LOCALES_ */ + +#include <_locale.h> +#include <_xlocale.h> + +#define LC_ALL_MASK ( LC_COLLATE_MASK \ + | LC_CTYPE_MASK \ + | LC_MESSAGES_MASK \ + | LC_MONETARY_MASK \ + | LC_NUMERIC_MASK \ + | LC_TIME_MASK ) +#define LC_COLLATE_MASK (1 << 0) +#define LC_CTYPE_MASK (1 << 1) +#define LC_MESSAGES_MASK (1 << 2) +#define LC_MONETARY_MASK (1 << 3) +#define LC_NUMERIC_MASK (1 << 4) +#define LC_TIME_MASK (1 << 5) + +#define _LC_NUM_MASK 6 +#define _LC_LAST_MASK (1 << (_LC_NUM_MASK - 1)) + +#define LC_GLOBAL_LOCALE ((locale_t)-1) +#define LC_C_LOCALE ((locale_t)NULL) + +#ifdef MB_CUR_MAX +#undef MB_CUR_MAX +#define MB_CUR_MAX (___mb_cur_max()) +#ifndef MB_CUR_MAX_L +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif /* !MB_CUR_MAX_L */ +#endif /* MB_CUR_MAX */ + +__BEGIN_DECLS +extern const locale_t _c_locale; + +locale_t duplocale(locale_t); +int freelocale(locale_t); +struct lconv * localeconv_l(locale_t); +locale_t newlocale(int, __const char *, locale_t); +__const char * querylocale(int, locale_t); +locale_t uselocale(locale_t); +__END_DECLS + +//Begin-Libc +#ifndef __DARWIN_XLOCALE_PRIVATE +//End-Libc +#ifdef _CTYPE_H_ +#include +#endif /* _CTYPE_H_ */ +#ifdef __WCTYPE_H_ +#include +#endif /* __WCTYPE_H_ */ +#ifdef _INTTYPES_H_ +#include +#endif /* _INTTYPES_H_ */ +#ifdef _LANGINFO_H_ +#include +#endif /* _LANGINFO_H_ */ +#ifdef _MONETARY_H_ +#include +#endif /* _MONETARY_H_ */ +#ifdef _REGEX_H_ +#include +#endif /* _REGEX_H_ */ +#ifdef _STDIO_H_ +#include +#endif /* _STDIO_H_ */ +#ifdef _STDLIB_H_ +#include +#endif /* _STDLIB_H_ */ +#ifdef _STRING_H_ +#include +#endif /*STRING_CTYPE_H_ */ +#ifdef _TIME_H_ +#include +#endif /* _TIME_H_ */ +#ifdef _WCHAR_H_ +#include +#endif /*WCHAR_CTYPE_H_ */ +#ifdef _WCTYPE_H_ +#include +#endif /* _WCTYPE_H_ */ +//Begin-Libc +#endif /* __DARWIN_XLOCALE_PRIVATE */ +//End-Libc + +#endif /* _XLOCALE_H_ */ diff --git a/private-include/xlocale/_ctype.h b/private-include/xlocale/_ctype.h new file mode 100644 index 0000000..4b481b2 --- /dev/null +++ b/private-include/xlocale/_ctype.h @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__CTYPE_H_ +#define _XLOCALE__CTYPE_H_ + +#include <_ctype.h> +#include <_xlocale.h> + +/* + * Use inline functions if we are allowed to and the compiler supports them. + */ +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +/* See comments in about __darwin_ct_rune_t. */ +__BEGIN_DECLS +unsigned long ___runetype_l(__darwin_ct_rune_t, locale_t); +__darwin_ct_rune_t ___tolower_l(__darwin_ct_rune_t, locale_t); +__darwin_ct_rune_t ___toupper_l(__darwin_ct_rune_t, locale_t); +__END_DECLS + +//Begin-Libc +#ifdef __LIBC__ +__DARWIN_CTYPE_inline int +__maskrune_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l) +{ + /* _CurrentRuneLocale.__runetype is __uint32_t + * _f is unsigned long + * ___runetype_l(_c, _l) is unsigned long + * retval is int + */ + return (int)((_c < 0 || _c >= _CACHED_RUNES) ? (__uint32_t)___runetype_l(_c, _l) : + __locale_ptr(_l)->__lc_ctype->_CurrentRuneLocale.__runetype[_c]) & (__uint32_t)_f; +} +#else /* !__LIBC__ */ +//End-Libc +__BEGIN_DECLS +int __maskrune_l(__darwin_ct_rune_t, unsigned long, locale_t); +__END_DECLS +//Begin-Libc +#endif /* __LIBC__ */ +//End-Libc + +__DARWIN_CTYPE_inline int +__istype_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l) +{ + return !!(isascii(_c) ? (_DefaultRuneLocale.__runetype[_c] & _f) + : __maskrune_l(_c, _f, _l)); +} + +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__toupper_l(__darwin_ct_rune_t _c, locale_t _l) +{ + return isascii(_c) ? _DefaultRuneLocale.__mapupper[_c] + : ___toupper_l(_c, _l); +} + +__DARWIN_CTYPE_inline __darwin_ct_rune_t +__tolower_l(__darwin_ct_rune_t _c, locale_t _l) +{ + return isascii(_c) ? _DefaultRuneLocale.__maplower[_c] + : ___tolower_l(_c, _l); +} + +__DARWIN_CTYPE_inline int +__wcwidth_l(__darwin_ct_rune_t _c, locale_t _l) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, _l); + if ((_x & _CTYPE_SWM) != 0) + return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); + return ((_x & _CTYPE_R) != 0 ? 1 : -1); +} + +#ifndef _EXTERNALIZE_CTYPE_INLINES_ + +__DARWIN_CTYPE_TOP_inline int +digittoint_l(int c, locale_t l) +{ + return (__maskrune_l(c, 0x0F, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isalnum_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_A|_CTYPE_D, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isalpha_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_A, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isblank_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_B, l)); +} + +__DARWIN_CTYPE_TOP_inline int +iscntrl_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_C, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isdigit_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_D, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isgraph_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_G, l)); +} + +__DARWIN_CTYPE_TOP_inline int +ishexnumber_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_X, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isideogram_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_I, l)); +} + +__DARWIN_CTYPE_TOP_inline int +islower_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_L, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isnumber_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_D, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isphonogram_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_Q, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isprint_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_R, l)); +} + +__DARWIN_CTYPE_TOP_inline int +ispunct_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_P, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isrune_l(int c, locale_t l) +{ + return (__istype_l(c, 0xFFFFFFF0L, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isspace_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_S, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isspecial_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_T, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isupper_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_U, l)); +} + +__DARWIN_CTYPE_TOP_inline int +isxdigit_l(int c, locale_t l) +{ + return (__istype_l(c, _CTYPE_X, l)); +} + +__DARWIN_CTYPE_TOP_inline int +tolower_l(int c, locale_t l) +{ + return (__tolower_l(c, l)); +} + +__DARWIN_CTYPE_TOP_inline int +toupper_l(int c, locale_t l) +{ + return (__toupper_l(c, l)); +} +#endif /* _EXTERNALIZE_CTYPE_INLINES_ */ + +#else /* not using inlines */ + +__BEGIN_DECLS +int digittoint_l(int, locale_t); +int isalnum_l(int, locale_t); +int isalpha_l(int, locale_t); +int isblank_l(int, locale_t); +int iscntrl_l(int, locale_t); +int isdigit_l(int, locale_t); +int isgraph_l(int, locale_t); +int ishexnumber_l(int, locale_t); +int isideogram_l(int, locale_t); +int islower_l(int, locale_t); +int isnumber_l(int, locale_t); +int isphonogram_l(int, locale_t); +int isprint_l(int, locale_t); +int ispunct_l(int, locale_t); +int isrune_l(int, locale_t); +int isspace_l(int, locale_t); +int isspecial_l(int, locale_t); +int isupper_l(int, locale_t); +int isxdigit_l(int, locale_t); +int tolower_l(int, locale_t); +int toupper_l(int, locale_t); +__END_DECLS +#endif /* using inlines */ + +#endif /* _XLOCALE__CTYPE_H_ */ diff --git a/private-include/xlocale/_time.h b/private-include/xlocale/_time.h new file mode 100644 index 0000000..0809bee --- /dev/null +++ b/private-include/xlocale/_time.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2005, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__TIME_H_ +#define _XLOCALE__TIME_H_ + +#include +#include +#include <_types.h> +#include <_xlocale.h> + +__BEGIN_DECLS +//Begin-Libc +#ifndef LIBC_ALIAS_STRFTIME_L +//End-Libc +size_t strftime_l(char * __restrict, size_t, const char * __restrict, + const struct tm * __restrict, locale_t) + __DARWIN_ALIAS(strftime_l) __strftimelike(3); +//Begin-Libc +#else /* LIBC_ALIAS_STRFTIME_L */ +size_t strftime_l(char * __restrict, size_t, const char * __restrict, + const struct tm * __restrict, locale_t) + LIBC_ALIAS(strftime_l) __strftimelike(3); +#endif /* !LIBC_ALIAS_STRFTIME_L */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_STRPTIME_L +//End-Libc +char *strptime_l(const char * __restrict, const char * __restrict, + struct tm * __restrict, locale_t) + __DARWIN_ALIAS(strptime_l) __strftimelike(2); +//Begin-Libc +#else /* LIBC_ALIAS_STRPTIME_L */ +char *strptime_l(const char * __restrict, const char * __restrict, + struct tm * __restrict, locale_t) + LIBC_ALIAS(strptime_l) __strftimelike(2); +#endif /* !LIBC_ALIAS_STRPTIME_L */ +//End-Libc +__END_DECLS + +#endif /* _XLOCALE__TIME_H_ */ diff --git a/private-include/xlocale/_wchar.h b/private-include/xlocale/_wchar.h new file mode 100644 index 0000000..45daf4b --- /dev/null +++ b/private-include/xlocale/_wchar.h @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _XLOCALE__WCHAR_H_ +#define _XLOCALE__WCHAR_H_ + +#include <_stdio.h> +#include <_xlocale.h> +#include + +/* Initially added in Issue 4 */ +__BEGIN_DECLS +wint_t btowc_l(int, locale_t); +wint_t fgetwc_l(FILE *, locale_t); +wchar_t *fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t); +wint_t fputwc_l(wchar_t, FILE *, locale_t); +int fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t); +int fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); +int fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); +wint_t getwc_l(FILE *, locale_t); +wint_t getwchar_l(locale_t); +size_t mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict, + locale_t); +size_t mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict, locale_t); +int mbsinit_l(const mbstate_t *, locale_t); +size_t mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, + mbstate_t * __restrict, locale_t); +wint_t putwc_l(wchar_t, FILE *, locale_t); +wint_t putwchar_l(wchar_t, locale_t); +int swprintf_l(wchar_t * __restrict, size_t n, locale_t, + const wchar_t * __restrict, ...); +int swscanf_l(const wchar_t * __restrict, locale_t, + const wchar_t * __restrict, ...); +wint_t ungetwc_l(wint_t, FILE *, locale_t); +int vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + __darwin_va_list); +int vswprintf_l(wchar_t * __restrict, size_t n, locale_t, + const wchar_t * __restrict, __darwin_va_list); +int vwprintf_l(locale_t, const wchar_t * __restrict, __darwin_va_list); +size_t wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict, + locale_t); +int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); +//Begin-Libc +#ifndef LIBC_ALIAS_WCSFTIME_L +//End-Libc +size_t wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict, + const struct tm * __restrict, locale_t) + __DARWIN_ALIAS(wcsftime_l); +//Begin-Libc +#else /* LIBC_ALIAS_WCSFTIME_L */ +size_t wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict, + const struct tm * __restrict, locale_t) + LIBC_ALIAS(wcsftime_l); +#endif /* !LIBC_ALIAS_WCSFTIME_L */ +//End-Libc +size_t wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, + mbstate_t * __restrict, locale_t); +double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int, + locale_t); +unsigned long + wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int, + locale_t); +int wcswidth_l(const wchar_t *, size_t, locale_t); +size_t wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t, + locale_t); +int wctob_l(wint_t, locale_t); +int wcwidth_l(wchar_t, locale_t); +int wprintf_l(locale_t, const wchar_t * __restrict, ...); +int wscanf_l(locale_t, const wchar_t * __restrict, ...); +__END_DECLS + + + +/* Additional functionality provided by: + * POSIX.1-2001 + */ + +#if __DARWIN_C_LEVEL >= 200112L +__BEGIN_DECLS +int vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + __darwin_va_list); +int vswscanf_l(const wchar_t * __restrict, locale_t, + const wchar_t * __restrict, __darwin_va_list); +int vwscanf_l(locale_t, const wchar_t * __restrict, __darwin_va_list); +float wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long double + wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +#if !__DARWIN_NO_LONG_LONG +long long + wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int, + locale_t); +unsigned long long + wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int, + locale_t); +#endif /* !__DARWIN_NO_LONG_LONG */ +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200112L */ + + + +/* Additional functionality provided by: + * POSIX.1-2008 + */ + +#if __DARWIN_C_LEVEL >= 200809L +__BEGIN_DECLS +size_t mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, + size_t, mbstate_t * __restrict, locale_t); +int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t n, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +size_t wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, + size_t, mbstate_t * __restrict, locale_t); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= 200809L */ + + + +/* Darwin extensions */ + +#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL +__BEGIN_DECLS +wchar_t *fgetwln_l(FILE * __restrict, size_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +__END_DECLS +#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + + + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison fgetwln_l fgetws_l fputwc_l fputws_l fwprintf_l fwscanf_l mbrtowc_l mbsnrtowcs_l mbsrtowcs_l putwc_l putwchar_l swprintf_l swscanf_l vfwprintf_l vfwscanf_l vswprintf_l vswscanf_l vwprintf_l vwscanf_l wcrtomb_l wcscoll_l wcsftime_l wcsftime_l wcsnrtombs_l wcsrtombs_l wcstod_l wcstof_l wcstol_l wcstold_l wcstoll_l wcstoul_l wcstoull_l wcswidth_l wcsxfrm_l wcwidth_l wprintf_l wscanf_l +#endif + +#endif /* _XLOCALE__WCHAR_H_ */ diff --git a/regex/CMakeLists.txt b/regex/CMakeLists.txt new file mode 100644 index 0000000..d29ac74 --- /dev/null +++ b/regex/CMakeLists.txt @@ -0,0 +1,33 @@ +project(libc-regex) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_C99_SOURCE -D_FORTIFY_SOURCE=0 -D__va_list=__builtin_va_list -DHAVE_CONFIG_H") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/TRE") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/FreeBSD") + +set(regex_sources + FreeBSD/regerror.c + TRE/lib/regcomp.c + TRE/lib/regexec.c + TRE/lib/tre-ast.c + TRE/lib/tre-compile.c + TRE/lib/tre-match-backtrack.c + TRE/lib/tre-match-parallel.c + TRE/lib/tre-mem.c + TRE/lib/tre-parse.c + TRE/lib/tre-stack.c +) + +SET_SOURCE_FILES_PROPERTIES(TRE/lib/regcomp.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_REGCOMP") + +add_darling_object_library(libc-regex ${regex_sources}) + +# Legacy variant +if (TARGET_i386) + set(regex-legacy_sources + TRE/lib/regcomp.c) + add_library(libc-regex_legacy OBJECT ${regex-legacy_sources}) + SET_TARGET_PROPERTIES(libc-regex_legacy PROPERTIES COMPILE_FLAGS + "-DBUILDING_VARIANT -DVARIANT_LEGACY -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0") +endif (TARGET_i386) diff --git a/regex/FreeBSD/COPYRIGHT b/regex/FreeBSD/COPYRIGHT new file mode 100644 index 0000000..574f6bc --- /dev/null +++ b/regex/FreeBSD/COPYRIGHT @@ -0,0 +1,56 @@ +Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. +This software is not subject to any license of the American Telephone +and Telegraph Company or of the Regents of the University of California. + +Permission is granted to anyone to use this software for any purpose on +any computer system, and to alter it and redistribute it, subject +to the following restrictions: + +1. The author is not responsible for the consequences of use of this + software, no matter how awful, even if they arise from flaws in it. + +2. The origin of this software must not be misrepresented, either by + explicit claim or by omission. Since few users ever read sources, + credits must appear in the documentation. + +3. Altered versions must be plainly marked as such, and must not be + misrepresented as being the original software. Since few users + ever read sources, credits must appear in the documentation. + +4. This notice may not be removed or altered. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +/*- + * Copyright (c) 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)COPYRIGHT 8.1 (Berkeley) 3/16/94 + */ diff --git a/regex/FreeBSD/WHATSNEW b/regex/FreeBSD/WHATSNEW new file mode 100644 index 0000000..f4301d3 --- /dev/null +++ b/regex/FreeBSD/WHATSNEW @@ -0,0 +1,94 @@ +# @(#)WHATSNEW 8.3 (Berkeley) 3/18/94 + +New in alpha3.4: The complex bug alluded to below has been fixed (in a +slightly kludgey temporary way that may hurt efficiency a bit; this is +another "get it out the door for 4.4" release). The tests at the end of +the tests file have accordingly been uncommented. The primary sign of +the bug was that something like a?b matching ab matched b rather than ab. +(The bug was essentially specific to this exact situation, else it would +have shown up earlier.) + +New in alpha3.3: The definition of word boundaries has been altered +slightly, to more closely match the usual programming notion that "_" +is an alphabetic. Stuff used for pre-ANSI systems is now in a subdir, +and the makefile no longer alludes to it in mysterious ways. The +makefile has generally been cleaned up some. Fixes have been made +(again!) so that the regression test will run without -DREDEBUG, at +the cost of weaker checking. A workaround for a bug in some folks' + has been added. And some more things have been added to +tests, including a couple right at the end which are commented out +because the code currently flunks them (complex bug; fix coming). +Plus the usual minor cleanup. + +New in alpha3.2: Assorted bits of cleanup and portability improvement +(the development base is now a BSDI system using GCC instead of an ancient +Sun system, and the newer compiler exposed some glitches). Fix for a +serious bug that affected REs using many [] (including REG_ICASE REs +because of the way they are implemented), *sometimes*, depending on +memory-allocation patterns. The header-file prototypes no longer name +the parameters, avoiding possible name conflicts. The possibility that +some clot has defined CHAR_MIN as (say) `-128' instead of `(-128)' is +now handled gracefully. "uchar" is no longer used as an internal type +name (too many people have the same idea). Still the same old lousy +performance, alas. + +New in alpha3.1: Basically nothing, this release is just a bookkeeping +convenience. Stay tuned. + +New in alpha3.0: Performance is no better, alas, but some fixes have been +made and some functionality has been added. (This is basically the "get +it out the door in time for 4.4" release.) One bug fix: regfree() didn't +free the main internal structure (how embarrassing). It is now possible +to put NULs in either the RE or the target string, using (resp.) a new +REG_PEND flag and the old REG_STARTEND flag. The REG_NOSPEC flag to +regcomp() makes all characters ordinary, so you can match a literal +string easily (this will become more useful when performance improves!). +There are now primitives to match beginnings and ends of words, although +the syntax is disgusting and so is the implementation. The REG_ATOI +debugging interface has changed a bit. And there has been considerable +internal cleanup of various kinds. + +New in alpha2.3: Split change list out of README, and moved flags notes +into Makefile. Macro-ized the name of regex(7) in regex(3), since it has +to change for 4.4BSD. Cleanup work in engine.c, and some new regression +tests to catch tricky cases thereof. + +New in alpha2.2: Out-of-date manpages updated. Regerror() acquires two +small extensions -- REG_ITOA and REG_ATOI -- which avoid debugging kludges +in my own test program and might be useful to others for similar purposes. +The regression test will now compile (and run) without REDEBUG. The +BRE \$ bug is fixed. Most uses of "uchar" are gone; it's all chars now. +Char/uchar parameters are now written int/unsigned, to avoid possible +portability problems with unpromoted parameters. Some unsigned casts have +been introduced to minimize portability problems with shifting into sign +bits. + +New in alpha2.1: Lots of little stuff, cleanup and fixes. The one big +thing is that regex.h is now generated, using mkh, rather than being +supplied in the distribution; due to circularities in dependencies, +you have to build regex.h explicitly by "make h". The two known bugs +have been fixed (and the regression test now checks for them), as has a +problem with assertions not being suppressed in the absence of REDEBUG. +No performance work yet. + +New in alpha2: Backslash-anything is an ordinary character, not an +error (except, of course, for the handful of backslashed metacharacters +in BREs), which should reduce script breakage. The regression test +checks *where* null strings are supposed to match, and has generally +been tightened up somewhat. Small bug fixes in parameter passing (not +harmful, but technically errors) and some other areas. Debugging +invoked by defining REDEBUG rather than not defining NDEBUG. + +New in alpha+3: full prototyping for internal routines, using a little +helper program, mkh, which extracts prototypes given in stylized comments. +More minor cleanup. Buglet fix: it's CHAR_BIT, not CHAR_BITS. Simple +pre-screening of input when a literal string is known to be part of the +RE; this does wonders for performance. + +New in alpha+2: minor bits of cleanup. Notably, the number "32" for the +word width isn't hardwired into regexec.c any more, the public header +file prototypes the functions if __STDC__ is defined, and some small typos +in the manpages have been fixed. + +New in alpha+1: improvements to the manual pages, and an important +extension, the REG_STARTEND option to regexec(). diff --git a/regex/FreeBSD/cname.h b/regex/FreeBSD/cname.h new file mode 100644 index 0000000..26355e8 --- /dev/null +++ b/regex/FreeBSD/cname.h @@ -0,0 +1,140 @@ +/*- + * Copyright (c) 1992, 1993, 1994 Henry Spencer. + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)cname.h 8.3 (Berkeley) 3/20/94 + * $FreeBSD: src/lib/libc/regex/cname.h,v 1.4 2007/01/09 00:28:04 imp Exp $ + */ + +/* character-name table */ +static const struct cname { + const wchar_t *name; + wchar_t code; +} cnames[] = { + {L"", (wchar_t)-1}, /* sentinel */ + {L"ACK", L'\006'}, + {L"BEL", L'\007'}, + {L"BS", L'\010'}, + {L"CAN", L'\030'}, + {L"CR", L'\015'}, + {L"DC1", L'\021'}, + {L"DC2", L'\022'}, + {L"DC3", L'\023'}, + {L"DC4", L'\024'}, + {L"DEL", L'\177'}, + {L"DLE", L'\020'}, + {L"EM", L'\031'}, + {L"ENQ", L'\005'}, + {L"EOT", L'\004'}, + {L"ESC", L'\033'}, + {L"ETB", L'\027'}, + {L"ETX", L'\003'}, + {L"FF", L'\014'}, + {L"FS", L'\034'}, + {L"GS", L'\035'}, + {L"HT", L'\011'}, + {L"IS1", L'\037'}, + {L"IS2", L'\036'}, + {L"IS3", L'\035'}, + {L"IS4", L'\034'}, + {L"LF", L'\012'}, + {L"NAK", L'\025'}, + {L"NUL", L'\0'}, + {L"RS", L'\036'}, + {L"SI", L'\017'}, + {L"SO", L'\016'}, + {L"SOH", L'\001'}, + {L"STX", L'\002'}, + {L"SUB", L'\032'}, + {L"SYN", L'\026'}, + {L"US", L'\037'}, + {L"VT", L'\013'}, + {L"alert", L'\007'}, + {L"ampersand", L'&'}, + {L"apostrophe", L'\''}, + {L"asterisk", L'*'}, + {L"backslash", L'\\'}, + {L"backspace", L'\b'}, + {L"carriage-return", L'\r'}, + {L"circumflex", L'^'}, + {L"circumflex-accent", L'^'}, + {L"colon", L':'}, + {L"comma", L','}, + {L"commercial-at", L'@'}, + {L"dollar-sign", L'$'}, + {L"eight", L'8'}, + {L"equals-sign", L'='}, + {L"exclamation-mark", L'!'}, + {L"five", L'5'}, + {L"form-feed", L'\f'}, + {L"four", L'4'}, + {L"full-stop", L'.'}, + {L"grave-accent", L'`'}, + {L"greater-than-sign", L'>'}, + {L"hyphen", L'-'}, + {L"hyphen-minus", L'-'}, + {L"left-brace", L'{'}, + {L"left-curly-bracket", L'{'}, + {L"left-parenthesis", L'('}, + {L"left-square-bracket", L'['}, + {L"less-than-sign", L'<'}, + {L"low-line", L'_'}, + {L"newline", L'\n'}, + {L"nine", L'9'}, + {L"number-sign", L'#'}, + {L"one", L'1'}, + {L"percent-sign", L'%'}, + {L"period", L'.'}, + {L"plus-sign", L'+'}, + {L"question-mark", L'?'}, + {L"quotation-mark", L'"'}, + {L"reverse-solidus", L'\\'}, + {L"right-brace", L'}'}, + {L"right-curly-bracket", L'}'}, + {L"right-parenthesis", L')'}, + {L"right-square-bracket", L']'}, + {L"semicolon", L';'}, + {L"seven", L'7'}, + {L"six", L'6'}, + {L"slash", L'/'}, + {L"solidus", L'/'}, + {L"space", L' '}, + {L"tab", L'\t'}, + {L"three", L'3'}, + {L"tilde", L'~'}, + {L"two", L'2'}, + {L"underscore", L'_'}, + {L"vertical-line", L'|'}, + {L"vertical-tab", L'\v'}, + {L"zero", L'0'}, +}; + +#define NCNAMES (sizeof(cnames) / sizeof(*cnames)) diff --git a/regex/FreeBSD/re_format.7 b/regex/FreeBSD/re_format.7 new file mode 100644 index 0000000..cf3cbc0 --- /dev/null +++ b/regex/FreeBSD/re_format.7 @@ -0,0 +1,826 @@ +.\" Copyright (c) 1992, 1993, 1994 Henry Spencer. +.\" Copyright (c) 1992, 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Henry Spencer. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)re_format.7 8.3 (Berkeley) 3/20/94 +.\" $FreeBSD: src/lib/libc/regex/re_format.7,v 1.12 2008/09/05 17:41:20 keramida Exp $ +.\" +.Dd Sept 29, 2011 +.Dt RE_FORMAT 7 +.Os +.Sh NAME +.Nm re_format +.Nd POSIX 1003.2 regular expressions +.Sh DESCRIPTION +Regular expressions +.Pq Dq RE Ns s , +as defined in +.St -p1003.2 , +come in two forms: +modern REs (roughly those of +.Xr egrep 1 ; +1003.2 calls these +.Dq extended +REs) +and obsolete REs (roughly those of +.Xr ed 1 ; +1003.2 +.Dq basic +REs). +Obsolete REs mostly exist for backward compatibility in some old programs; +they will be discussed at the end. +.St -p1003.2 +leaves some aspects of RE syntax and semantics open; +`\(dd' marks decisions on these aspects that +may not be fully portable to other +.St -p1003.2 +implementations. +.Pp +A (modern) RE is one\(dd or more non-empty\(dd +.Em branches , +separated by +.Ql \&| . +It matches anything that matches one of the branches. +.Pp +A branch is one\(dd or more +.Em pieces , +concatenated. +It matches a match for the first, followed by a match for the second, etc. +.Pp +A piece is an +.Em atom +possibly followed +by a single\(dd +.Ql \&* , +.Ql \&+ , +.Ql \&? , +or +.Em bound . +An atom followed by +.Ql \&* +matches a sequence of 0 or more matches of the atom. +An atom followed by +.Ql \&+ +matches a sequence of 1 or more matches of the atom. +An atom followed by +.Ql ?\& +matches a sequence of 0 or 1 matches of the atom. +.Pp +A +.Em bound +is +.Ql \&{ +followed by an unsigned decimal integer, +possibly followed by +.Ql \&, +possibly followed by another unsigned decimal integer, +always followed by +.Ql \&} . +The integers must lie between 0 and +.Dv RE_DUP_MAX +(255\(dd) inclusive, +and if there are two of them, the first may not exceed the second. +An atom followed by a bound containing one integer +.Em i +and no comma matches +a sequence of exactly +.Em i +matches of the atom. +An atom followed by a bound +containing one integer +.Em i +and a comma matches +a sequence of +.Em i +or more matches of the atom. +An atom followed by a bound +containing two integers +.Em i +and +.Em j +matches +a sequence of +.Em i +through +.Em j +(inclusive) matches of the atom. +.Pp +An atom is a regular expression enclosed in +.Ql () +(matching a match for the +regular expression), +an empty set of +.Ql () +(matching the null string)\(dd, +a +.Em bracket expression +(see below), +.Ql .\& +(matching any single character), +.Ql \&^ +(matching the null string at the beginning of a line), +.Ql \&$ +(matching the null string at the end of a line), a +.Ql \e +followed by one of the characters +.Ql ^.[$()|*+?{\e +(matching that character taken as an ordinary character), +a +.Ql \e +followed by any other character\(dd +(matching that character taken as an ordinary character, +as if the +.Ql \e +had not been present\(dd), +or a single character with no other significance (matching that character). +A +.Ql \&{ +followed by a character other than a digit is an ordinary +character, not the beginning of a bound\(dd. +It is illegal to end an RE with +.Ql \e . +.Pp +A +.Em bracket expression +is a list of characters enclosed in +.Ql [] . +It normally matches any single character from the list (but see below). +If the list begins with +.Ql \&^ , +it matches any single character +(but see below) +.Em not +from the rest of the list. +If two characters in the list are separated by +.Ql \&- , +this is shorthand +for the full +.Em range +of characters between those two (inclusive) in the +collating sequence, +.No e.g. Ql [0-9] +in ASCII matches any decimal digit. +It is illegal\(dd for two ranges to share an +endpoint, +.No e.g. Ql a-c-e . +Ranges are very collating-sequence-dependent, +and portable programs should avoid relying on them. +.Pp +To include a literal +.Ql \&] +in the list, make it the first character +(following a possible +.Ql \&^ ) . +To include a literal +.Ql \&- , +make it the first or last character, +or the second endpoint of a range. +To use a literal +.Ql \&- +as the first endpoint of a range, +enclose it in +.Ql [.\& +and +.Ql .]\& +to make it a collating element (see below). +With the exception of these and some combinations using +.Ql \&[ +(see next paragraphs), all other special characters, including +.Ql \e , +lose their special significance within a bracket expression. +.Pp +Within a bracket expression, a collating element (a character, +a multi-character sequence that collates as if it were a single character, +or a collating-sequence name for either) +enclosed in +.Ql [.\& +and +.Ql .]\& +stands for the +sequence of characters of that collating element. +The sequence is a single element of the bracket expression's list. +A bracket expression containing a multi-character collating element +can thus match more than one character, +e.g.\& if the collating sequence includes a +.Ql ch +collating element, +then the RE +.Ql [[.ch.]]*c +matches the first five characters +of +.Ql chchcc . +.Pp +Within a bracket expression, a collating element enclosed in +.Ql [= +and +.Ql =] +is an equivalence class, standing for the sequences of characters +of all collating elements equivalent to that one, including itself. +(If there are no other equivalent collating elements, +the treatment is as if the enclosing delimiters were +.Ql [.\& +and +.Ql .] . ) +For example, if +.Ql x +and +.Ql y +are the members of an equivalence class, +then +.Ql [[=x=]] , +.Ql [[=y=]] , +and +.Ql [xy] +are all synonymous. +An equivalence class may not\(dd be an endpoint +of a range. +.Pp +Within a bracket expression, the name of a +.Em character class +enclosed in +.Ql [: +and +.Ql :] +stands for the list of all characters belonging to that +class. +Standard character class names are: +.Pp +.Bl -column "alnum" "digit" "xdigit" -offset indent +.It Em "alnum digit punct" +.It Em "alpha graph space" +.It Em "blank lower upper" +.It Em "cntrl print xdigit" +.El +.Pp +These stand for the character classes defined in +.Xr ctype 3 . +A locale may provide others. +A character class may not be used as an endpoint of a range. +.Pp +A bracketed expression like +.Ql [[:class:]] +can be used to match a single character that belongs to a character +class. +The reverse, matching any character that does not belong to a specific +class, the negation operator of bracket expressions may be used: +.Ql [^[:class:]] . +.Pp +There are two special cases\(dd of bracket expressions: +the bracket expressions +.Ql [[:<:]] +and +.Ql [[:>:]] +match the null string at the beginning and end of a word respectively. +A word is defined as a sequence of word characters +which is neither preceded nor followed by +word characters. +A word character is an +.Em alnum +character (as defined by +.Xr ctype 3 ) +or an underscore. +This is an extension, +compatible with but not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +.Pp +In the event that an RE could match more than one substring of a given +string, +the RE matches the one starting earliest in the string. +If the RE could match more than one substring starting at that point, +it matches the longest. +Subexpressions also match the longest possible substrings, subject to +the constraint that the whole match be as long as possible, +with subexpressions starting earlier in the RE taking priority over +ones starting later. +Note that higher-level subexpressions thus take priority over +their lower-level component subexpressions. +.Pp +Match lengths are measured in characters, not collating elements. +A null string is considered longer than no match at all. +For example, +.Ql bb* +matches the three middle characters of +.Ql abbbc , +.Ql (wee|week)(knights|nights) +matches all ten characters of +.Ql weeknights , +when +.Ql (.*).*\& +is matched against +.Ql abc +the parenthesized subexpression +matches all three characters, and +when +.Ql (a*)* +is matched against +.Ql bc +both the whole RE and the parenthesized +subexpression match the null string. +.Pp +If case-independent matching is specified, +the effect is much as if all case distinctions had vanished from the +alphabet. +When an alphabetic that exists in multiple cases appears as an +ordinary character outside a bracket expression, it is effectively +transformed into a bracket expression containing both cases, +.No e.g. Ql x +becomes +.Ql [xX] . +When it appears inside a bracket expression, all case counterparts +of it are added to the bracket expression, so that (e.g.) +.Ql [x] +becomes +.Ql [xX] +and +.Ql [^x] +becomes +.Ql [^xX] . +.Pp +No particular limit is imposed on the length of REs\(dd. +Programs intended to be portable should not employ REs longer +than 256 bytes, +as an implementation can refuse to accept such REs and remain +POSIX-compliant. +.Pp +Obsolete +.Pq Dq basic +regular expressions differ in several respects. +.Ql \&| +is an ordinary character and there is no equivalent +for its functionality. +.Ql \&+ +and +.Ql ?\& +are ordinary characters, and their functionality +can be expressed using bounds +.No ( Ql {1,} +or +.Ql {0,1} +respectively). +Also note that +.Ql x+ +in modern REs is equivalent to +.Ql xx* . +The delimiters for bounds are +.Ql \e{ +and +.Ql \e} , +with +.Ql \&{ +and +.Ql \&} +by themselves ordinary characters. +The parentheses for nested subexpressions are +.Ql \e( +and +.Ql \e) , +with +.Ql \&( +and +.Ql \&) +by themselves ordinary characters. +.Ql \&^ +is an ordinary character except at the beginning of the +RE or\(dd the beginning of a parenthesized subexpression, +.Ql \&$ +is an ordinary character except at the end of the +RE or\(dd the end of a parenthesized subexpression, +and +.Ql \&* +is an ordinary character if it appears at the beginning of the +RE or the beginning of a parenthesized subexpression +(after a possible leading +.Ql \&^ ) . +Finally, there is one new type of atom, a +.Em back reference : +.Ql \e +followed by a non-zero decimal digit +.Em d +matches the same sequence of characters +matched by the +.Em d Ns th +parenthesized subexpression +(numbering subexpressions by the positions of their opening parentheses, +left to right), +so that (e.g.) +.Ql \e([bc]\e)\e1 +matches +.Ql bb +or +.Ql cc +but not +.Ql bc . +.Sh ENHANCED FEATURES +When the +.Dv REG_ENHANCED +flag is passed to one of the +.Fn regcomp +variants, additional features are activated. +Like the enhanced +.Nm regex +implementations in scripting languages such as +.Xr perl 1 +and +.Xr python 1 , +these additional features may conflict with the +.St -p1003.2 +standards in some ways. +Use this with care in situations which require portability +(including to past versions of the Mac OS X using the previous +.Nm regex +implementation). +.Pp +For enhanced basic REs, +.Ql \&+ , +.Ql \&? +and +.Ql \&| +remain regular characters, but +.Ql \e+ , +.Ql \e? +and +.Ql \e| +have the same special meaning as the unescaped characters do for +extended REs, i.e., one or more matches, zero or one matches and alteration, +respectively. +For enhanced extended REs, +back references are available. +Additional enhanced features are listed below. +.Pp +Within a bracket expression, most characters lose their magic. +This also applies to the additional enhanced features, which don't operate +inside a bracket expression. +.Ss Assertions (available for both enhanced basic and enhanced extended REs) +In addition to +.Ql \&^ +and +.Ql \&$ +(the assertions that match the null string at the beginning and end of line, +respectively), the following assertions become available: +.Bl -tag -width ".Sy \eB" -offset indent +.It Sy \e< +Matches the null string at the beginning of a word. +This is equivalent to +.Ql [[:<:]] . +.It Sy \e> +Matches the null string at the end of a word. +This is equivalent to +.Ql [[:>:]] . +.It Sy \eb +Matches the null string at a word boundary (either the beginning or end of +a word). +.It Sy \eB +Matches the null string where there is no word boundary. +This is the opposite of +.Ql \eb . +.El +.Ss Shortcuts (available for both enhanced basic and enhanced extended REs) +The following shortcuts can be used to replace more complicated +bracket expressions. +.Bl -tag -width ".Sy \eD" -offset indent +.It Sy \ed +Matches a digit character. +This is equivalent to +.Ql [[:digit:]] . +.It Sy \eD +Matches a non-digit character. +This is equivalent to +.Ql [^[:digit:]] . +.It Sy \es +Matches a space character. +This is equivalent to +.Ql [[:space:]] . +.It Sy \eS +Matches a non-space character. +This is equivalent to +.Ql [^[:space:]] . +.It Sy \ew +Matches a word character. +This is equivalent to +.Ql [[:alnum:]_] . +.It Sy \eW +Matches a non-word character. +This is equivalent to +.Ql [^[:alnum:]_] . +.El +.Ss Literal Sequences (available for both enhanced basic and enhanced extended REs) +.Pp +Literals are normally just ordinary characters that are matched directly. +Under enhanced mode, certain character sequences are +converted to specific literals. +.Bl -tag -width ".Sy \ea" -offset indent +.It Sy \ea +The +.Dq bell +character (ASCII code 7). +.It Sy \ee +The +.Dq escape +character (ASCII code 27). +.It Sy \ef +The +.Dq form-feed +character (ASCII code 12). +.It Sy \en +The +.Dq new-line/line-feed +character (ASCII code 10). +.It Sy \er +The +.Dq carriage-return +character (ASCII code 13). +.It Sy \et +The +.Dq horizontal-tab +character (ASCII code 9). +.El +.Pp +Literals can also be specified directly, using their wide character values. +Note that when matching a multibyte character string, the string's bytes +are converted to wide character before comparing. +This means that a single literal wide character value may match more than +one string byte, depending on the locale's wide character encoding. +.Bl -tag -width ".Sy \ex{ Ns Em x.. Ns Sy \&}" -offset indent +.It Sy \ex Ns Em x.. +An arbitray eight-bit value. +The +.Em x.. +sequence represents zero, one or two hexadecimal digits. +(Note: if +.Em x.. +is less than two hexadecimal digits, and the character following this sequence +happens to be a hexadecimal digit, use the (following) brace form to avoid +confusion.) +.It Sy \ex{ Ns Em x.. Ns Sy \&} +An arbitrary, up to 32-bit value. +The +.Em x.. +sequence is an arbitrary sequence of hexadecimal digits that is long enough +to represent the necessary value. +.El +.Ss Inline Literal Mode (available for both enhanced basic and enhanced extended REs) +A +.Ql \eQ +sequence causes literal +.Pq Dq quote +mode to be entered, +while +.Ql \eE +ends literal mode, and returns to normal regular expression processing. +This is similar to specifying the +.Dv REG_NOSPEC +(or +.Dv REG_LITERAL ) +option to +.Fn regcomp , +except that rather than applying to the whole RE string, it only applies to +the part between the +.Ql \eQ +and +.Ql \eE . +Note that it is not possible to have a +.Ql \eE +in the middle of an inline literal range, as that would terminate literal mode +prematurely. +.Ss Minimal Repetitions (available for enhanced extended REs only) +By default, the repetition operators, +.Ql \&* , +.Em bound , +.Ql \&? +and +.Ql \&+ +are +.Em greedy ; +they try to match as many times as possible. +In enhanced mode, appending a +.Ql \&? +to a repetition operator makes it minimal (or +.Em ungreedy ) ; +it tries to match the fewest number of times (including zero times, as +appropriate). +.Pp +For example, against the string +.Ql aaa , +the RE +.Ql a* +would match the entire string, +while +.Ql a*? +would match the null string at the beginning of the line +(matches zero times). +Likewise, against the string +.Ql ababab , +the RE +.Ql .*b , +would also match the entire string, +while +.Ql .*?b +would only match the first two characters. +.Pp +The +.Fn regcomp +flag +.Dv REG_UNGREEDY +will make the regular +.Pq greedy +repetition operators ungreedy by default. +Appending +.Ql \&? +makes them greedy again. +.Pp +Note that minimal repetitions are not specified by an official +standard, so there may be differences between different implementations. +In the current implementation, minimal repetitions have a high precedence, +and can cause other standards requirements to be violated. +For instance, on the string +.Ql aaaaa , +the RE +.Ql (aaa??)* +will only match the first four characters, violating the rules that the longest +possible match is made and the longest subexpressions are matched. +Using +.Ql (aaa??)*$ +forces the entire string to be matched. +.Ss Non-capturing Parenthesized Subexpressions (available for enhanced extended REs only) +Normally, the match offsets to parenthesized subexpressions are +recorded in the +.Fa pmatch +array (that is, when +.Dv REG_NOSUB +is not specified, and +.Fa nmatch +is large enough to encompass the parenthesized subexpression in question). +In enhanced mode, if the first two characters following the left parenthesis +are +.Ql ?: , +grouping of the remaining contents is done, but the corresponding offsets are +not recorded in the +.Fa pmatch +array. +For example, against the string +.Ql fubar , +the RE +.Ql (fu)(bar) +would have two subexpression matches in +.Fa pmatch ; +the first for +.Ql fu +and the second for +.Ql bar . +But with the RE +.Ql (?:fu)(bar) , +there would only be one subexpression match, that of +.Ql bar . +Furthermore, +against the string +.Ql fufubar , +the RE +.Ql (?fu)*(bar) +would again match the entire string, but only +.Ql bar +would be recorded in +.Fa pmatch . +.Ss Inline Options (available for enhanced extended REs only) +Like the inline literal mode mentioned above, other options can be switched +on and off for part of a RE. +.Ql (? Ns Em o.. Ns \&) +will turn on the options specified in +.Em o.. +(one or more options characters; see below), while +.Ql (?- Ns Em o.. Ns \&) +will turn off the specified options, and +.Ql (? Ns Em o1.. Ns \&- Ns Em o2.. Ns \&) +will turn on the first set of options, and turn off the second set. +.Pp +The available options are: +.Bl -tag -width ".Sy \&U" -offset indent +.It Sy \&i +Turning on this option will ignore case during matching, while turning off +will restore case-sensitive matching. +If +.Dv REG_ICASE +was specified to +.Fn regcomp , +this option can be use to turn that off. +.It Sy \&n +Turn on or off special handling of the newline character. +If +.Dv REG_NEWLINE +was specified to +.Fn regcomp , +this option can be use to turn that off. +.It Sy \&U +Turning on this option will make ungreedy repetitions the default, while +turning off will make greedy repetitions the default. +If +.Dv REG_UNGREEDY +was specified to +.Fn regcomp , +this option can be use to turn that off. +.El +.Pp +The scope of the option change begins immediately following the right +parenthesis, +but up to the end of the enclosing subexpression (if any). +Thus, for example, given the RE +.Ql (fu(?i)bar)baz , +the +.Ql fu +portion matches case sensitively, +.Ql bar +matches case insensitively, and +.Ql baz +matches case sensitively again (since is it outside the scope of the +subexpression in which the inline option was specified). +.Pp +The inline options syntax can be combined with the non-capturing parenthesized +subexpression to limit the option scope to just that of the subexpression. +Then, for example, +.Ql fu(?i:bar)baz +is similar to the previous example, except for the parenthesize subexpression +around +.Ql fu(?i)bar +in the previous example. +.Ss Inline Comments (available for enhanced extended REs only) +The syntax +.Ql (?# Ns Em comment Ns \&) +can be used to embed comments within a RE. +Note that +.Em comment +can not contain a right parenthesis. +Also note that while syntactically, option characters can be added before +the +.Ql \&# +character, they will be ignored. +.Sh SEE ALSO +.Xr regex 3 +.Rs +.%T Regular Expression Notation +.%R IEEE Std +.%N 1003.2 +.%P section 2.8 +.Re +.Sh BUGS +Having two kinds of REs is a botch. +.Pp +The current +.St -p1003.2 +spec says that +.Ql \&) +is an ordinary character in +the absence of an unmatched +.Ql \&( ; +this was an unintentional result of a wording error, +and change is likely. +Avoid relying on it. +.Pp +Back references are a dreadful botch, +posing major problems for efficient implementations. +They are also somewhat vaguely defined +(does +.Ql a\e(\e(b\e)*\e2\e)*d +match +.Ql abbbd ? ) . +Avoid using them. +.Pp +.St -p1003.2 +specification of case-independent matching is vague. +The +.Dq one case implies all cases +definition given above +is current consensus among implementors as to the right interpretation. +.Pp +The bracket syntax for word boundaries is incredibly ugly. diff --git a/regex/FreeBSD/regerror.c b/regex/FreeBSD/regerror.c new file mode 100644 index 0000000..a22066c --- /dev/null +++ b/regex/FreeBSD/regerror.c @@ -0,0 +1,174 @@ +/*- + * Copyright (c) 1992, 1993, 1994 Henry Spencer. + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)regerror.c 8.4 (Berkeley) 3/20/94 + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/regex/regerror.c,v 1.11 2007/06/11 03:05:54 delphij Exp $"); + +#include +#include +#include +#include +#include +#include + +#include "utils.h" + +/* ========= begin header generated by ./mkh ========= */ +#ifdef __cplusplus +extern "C" { +#endif + +/* === regerror.c === */ +static char *regatoi(const regex_t *preg, char *localbuf); + +#ifdef __cplusplus +} +#endif +/* ========= end header generated by ./mkh ========= */ +/* + = #define REG_NOMATCH 1 + = #define REG_BADPAT 2 + = #define REG_ECOLLATE 3 + = #define REG_ECTYPE 4 + = #define REG_EESCAPE 5 + = #define REG_ESUBREG 6 + = #define REG_EBRACK 7 + = #define REG_EPAREN 8 + = #define REG_EBRACE 9 + = #define REG_BADBR 10 + = #define REG_ERANGE 11 + = #define REG_ESPACE 12 + = #define REG_BADRPT 13 + = #define REG_EMPTY 14 + = #define REG_ASSERT 15 + = #define REG_INVARG 16 + = #define REG_ILLSEQ 17 + = #define REG_ATOI 255 // convert name to number (!) + = #define REG_ITOA 0400 // convert number to name (!) + */ +static const struct rerr { + int code; + const char *name; + const char *explain; +} rerrs[] = { + {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"}, + {REG_BADPAT, "REG_BADPAT", "invalid regular expression"}, + {REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"}, + {REG_ECTYPE, "REG_ECTYPE", "invalid character class"}, + {REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"}, + {REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"}, + {REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"}, + {REG_EPAREN, "REG_EPAREN", "parentheses not balanced"}, + {REG_EBRACE, "REG_EBRACE", "braces not balanced"}, + {REG_BADBR, "REG_BADBR", "invalid repetition count(s)"}, + {REG_ERANGE, "REG_ERANGE", "invalid character range"}, + {REG_ESPACE, "REG_ESPACE", "out of memory"}, + {REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"}, + {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"}, + {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"}, + {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"}, + {REG_ILLSEQ, "REG_ILLSEQ", "illegal byte sequence"}, + {0, "", "*** unknown regexp error code ***"} +}; + +/* + - regerror - the interface to error numbers + = extern size_t regerror(int, const regex_t *, char *, size_t); + */ +/* ARGSUSED */ +size_t +regerror(int errcode, + const regex_t * __restrict preg, + char * __restrict errbuf, + size_t errbuf_size) +{ + const struct rerr *r; + size_t len; + int target = errcode &~ REG_ITOA; + const char *s; + char convbuf[50]; + + if (errcode == REG_ATOI) + s = regatoi(preg, convbuf); + else { + for (r = rerrs; r->code != 0; r++) + if (r->code == target) + break; + + if (errcode®_ITOA) { + if (r->code != 0) + (void) strcpy(convbuf, r->name); + else + sprintf(convbuf, "REG_0x%x", target); + assert(strlen(convbuf) < sizeof(convbuf)); + s = convbuf; + } else + s = r->explain; + } + + len = strlen(s) + 1; + if (errbuf_size > 0) { + if (errbuf_size > len) + (void) strcpy(errbuf, s); + else { + (void) strncpy(errbuf, s, errbuf_size-1); + errbuf[errbuf_size-1] = '\0'; + } + } + + return(len); +} + +/* + - regatoi - internal routine to implement REG_ATOI + == static char *regatoi(const regex_t *preg, char *localbuf); + */ +static char * +regatoi(const regex_t *preg, char *localbuf) +{ + const struct rerr *r; + + for (r = rerrs; r->code != 0; r++) + if (strcmp(r->name, preg->re_endp) == 0) + break; + if (r->code == 0) + return("0"); + + sprintf(localbuf, "%d", r->code); + return(localbuf); +} diff --git a/regex/FreeBSD/regex.3 b/regex/FreeBSD/regex.3 new file mode 100644 index 0000000..e0a0321 --- /dev/null +++ b/regex/FreeBSD/regex.3 @@ -0,0 +1,943 @@ +.\" Copyright (c) 1992, 1993, 1994 Henry Spencer. +.\" Copyright (c) 1992, 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Henry Spencer. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)regex.3 8.4 (Berkeley) 3/20/94 +.\" $FreeBSD: src/lib/libc/regex/regex.3,v 1.21 2007/01/09 00:28:04 imp Exp $ +.\" +.Dd Sept 29, 2011 +.Dt REGEX 3 +.Os +.Sh NAME +.Nm regcomp , +.Nm regcomp_l , +.Nm regerror , +.Nm regexec , +.Nm regfree , +.Nm regncomp , +.Nm regncomp_l , +.Nm regnexec , +.Nm regnwcomp , +.Nm regnwcomp_l , +.Nm regnwexec , +.Nm regwcomp , +.Nm regwcomp_l , +.Nm regwexec +.Nd regular-expression library +.Sh SYNOPSIS +.Sy (Standards-compliant APIs) +.Pp +.In regex.h +.Ft int +.Fo regcomp +.Fa "regex_t *restrict preg" +.Fa "const char *restrict pattern" +.Fa "int cflags" +.Fc +.Ft size_t +.Fo regerror +.Fa "int errcode" +.Fa "const regex_t *restrict preg" +.Fa "char *restrict errbuf" +.Fa "size_t errbuf_size" +.Fc +.Ft int +.Fo regexec +.Fa "const regex_t *restrict preg" +.Fa "const char *restrict string" +.Fa "size_t nmatch" +.Fa "regmatch_t pmatch[restrict]" +.Fa "int eflags" +.Fc +.Ft void +.Fo regfree +.Fa "regex_t *preg" +.Fc +.Pp +.Sy (Non-portable extensions) +.Ft int +.Fo regncomp +.Fa "regex_t *restrict preg" +.Fa "const char *restrict pattern" +.Fa "size_t len" +.Fa "int cflags" +.Fc +.Ft int +.Fo regnexec +.Fa "const regex_t *restrict preg" +.Fa "const char *restrict string" +.Fa "size_t len" +.Fa "size_t nmatch" +.Fa "regmatch_t pmatch[restrict]" +.Fa "int eflags" +.Fc +.Ft int +.Fo regwcomp +.Fa "regex_t *restrict preg" +.Fa "const wchar_t *restrict widepat" +.Fa "int cflags" +.Fc +.Ft int +.Fo regwexec +.Fa "const regex_t *restrict preg" +.Fa "const wchar_t *restrict widestr" +.Fa "size_t nmatch" +.Fa "regmatch_t pmatch[restrict]" +.Fa "int eflags" +.Fc +.Ft int +.Fo regwncomp +.Fa "regex_t *restrict preg" +.Fa "const wchar_t *restrict widepat" +.Fa "size_t len" +.Fa "int cflags" +.Fc +.Ft int +.Fo regwnexec +.Fa "const regex_t *restrict preg" +.Fa "const wchar_t *restrict widestr" +.Fa "size_t len" +.Fa "size_t nmatch" +.Fa "regmatch_t pmatch[restrict]" +.Fa "int eflags" +.Fc +.In regex.h +.In xlocale.h +.Ft int +.Fo regcomp_l +.Fa "regex_t *restrict preg" +.Fa "const char *restrict pattern" +.Fa "int cflags" +.Fa "locale_t restrict" +.Fc +.Ft int +.Fo regncomp_l +.Fa "regex_t *restrict preg" +.Fa "const char *restrict pattern" +.Fa "size_t len" +.Fa "int cflags" +.Fa "locale_t restrict" +.Fc +.Ft int +.Fo regwcomp_l +.Fa "regex_t *restrict preg" +.Fa "const wchar_t *restrict widepat" +.Fa "int cflags" +.Fa "locale_t restrict" +.Fc +.Ft int +.Fo regwncomp_l +.Fa "regex_t *restrict preg" +.Fa "const wchar_t *restrict widepat" +.Fa "size_t len" +.Fa "int cflags" +.Fa "locale_t restrict" +.Fc +.Sh DESCRIPTION +These routines implement +.St -p1003.2 +regular expressions +.Pq Do RE Dc Ns s ; +see +.Xr re_format 7 . +The +.Fn regcomp +function +compiles an RE, written as a string, into an internal form. +.Fn regexec +matches that internal form against a string and reports results. +.Fn regerror +transforms error codes from either into human-readable messages. +.Fn regfree +frees any dynamically-allocated storage used by the internal form +of an RE. +.Pp +The header +.In regex.h +declares two structure types, +.Ft regex_t +and +.Ft regmatch_t , +the former for compiled internal forms and the latter for match reporting. +It also declares the four functions, +a type +.Ft regoff_t , +and a number of constants with names starting with +.Dq Dv REG_ . +.Pp +The +.Fn regcomp +function +compiles the regular expression contained in the +.Fa pattern +string, +subject to the flags in +.Fa cflags , +and places the results in the +.Ft regex_t +structure pointed to by +.Fa preg . +The +.Fa cflags +argument +is the bitwise OR of zero or more of the following flags: +.Bl -tag -width REG_EXTENDED +.It Dv REG_EXTENDED +Compile modern +.Pq Dq extended +REs, +rather than the obsolete +.Pq Dq basic +REs that +are the default. +.It Dv REG_BASIC +This is a synonym for 0, +provided as a counterpart to +.Dv REG_EXTENDED +to improve readability. +.It Dv REG_NOSPEC +Compile with recognition of all special characters turned off. +All characters are thus considered ordinary, +so the +.Dq RE +is a literal string. +This is an extension, +compatible with but not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +.Dv REG_EXTENDED +and +.Dv REG_NOSPEC +may not be used +in the same call to +.Fn regcomp . +.It Dv REG_LITERAL +An alias of +.Dv REG_NOSPEC . +.It Dv REG_ICASE +Compile for matching that ignores upper/lower case distinctions. +See +.Xr re_format 7 . +.It Dv REG_NOSUB +Compile for matching that need only report success or failure, +not what was matched. +.It Dv REG_NEWLINE +Compile for newline-sensitive matching. +By default, newline is a completely ordinary character with no special +meaning in either REs or strings. +With this flag, +.Ql [^ +bracket expressions and +.Ql .\& +never match newline, +a +.Ql ^\& +anchor matches the null string after any newline in the string +in addition to its normal function, +and the +.Ql $\& +anchor matches the null string before any newline in the +string in addition to its normal function. +.It Dv REG_PEND +(Note that +.Dv REG_PEND +is not recognized by any of the wide character or +.Dq Nm n +variants. +Besides, the +.Dq Nm n +variants can be used instead of +.Dv REG_PEND ; +see EXTENDED APIS below.) +The regular expression ends, +not at the first NUL, +but just before the character pointed to by the +.Va re_endp +member of the structure pointed to by +.Fa preg . +The +.Va re_endp +member is of type +.Ft "const char *" . +This flag permits inclusion of NULs in the RE; +they are considered ordinary characters. +This is an extension, +compatible with but not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +.It Dv REG_ENHANCED +Recognized enhanced regular expression features; see +.Xr re_format 7 +for details. +This is an extension not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +.It Dv REG_MINIMAL +Use minimal (non-greedy) repetitions instead of the normal greedy ones; see +.Xr re_format 7 +for details. +(This only applies when both +.Dv REG_ENHANCED +and +.Dv REG_EXTENDED +are also set.) +This is an extension not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +.It Dv REG_UNGREEDY +Alias of +.Dv REG_MINIMAL . +.El +.Pp +When successful, +.Fn regcomp +returns 0 and fills in the structure pointed to by +.Fa preg . +One member of that structure +(other than +.Va re_endp ) +is publicized: +.Va re_nsub , +of type +.Ft size_t , +contains the number of parenthesized subexpressions within the RE +(except that the value of this member is undefined if the +.Dv REG_NOSUB +flag was used). +If +.Fn regcomp +fails, it returns a non-zero error code; +see +.Sx DIAGNOSTICS . +.Pp +The +.Fn regexec +function +matches the compiled RE pointed to by +.Fa preg +against the +.Fa string , +subject to the flags in +.Fa eflags , +and reports results using +.Fa nmatch , +.Fa pmatch , +and the returned value. +The RE must have been compiled by a previous invocation of +.Fn regcomp . +The compiled form is not altered during execution of +.Fn regexec , +so a single compiled RE can be used simultaneously by multiple threads. +.Pp +By default, +the NUL-terminated string pointed to by +.Fa string +is considered to be the text of an entire line, minus any terminating +newline. +The +.Fa eflags +argument is the bitwise OR of zero or more of the following flags: +.Bl -tag -width REG_STARTEND +.It Dv REG_NOTBOL +The first character of +the string +is not the beginning of a line, so the +.Ql ^\& +anchor should not match before it. +This does not affect the behavior of newlines under +.Dv REG_NEWLINE . +.It Dv REG_NOTEOL +The NUL terminating +the string +does not end a line, so the +.Ql $\& +anchor should not match before it. +This does not affect the behavior of newlines under +.Dv REG_NEWLINE . +.It Dv REG_STARTEND +The string is considered to start at +.Fa string ++ +.Fa pmatch Ns [0]. Ns Va rm_so +and to have a terminating NUL located at +.Fa string ++ +.Fa pmatch Ns [0]. Ns Va rm_eo +(there need not actually be a NUL at that location), +regardless of the value of +.Fa nmatch . +See below for the definition of +.Fa pmatch +and +.Fa nmatch . +This is an extension, +compatible with but not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +Note that a non-zero +.Va rm_so +does not imply +.Dv REG_NOTBOL ; +.Dv REG_STARTEND +affects only the location of the string, +not how it is matched. +.El +.Pp +See +.Xr re_format 7 +for a discussion of what is matched in situations where an RE or a +portion thereof could match any of several substrings of +.Fa string . +.Pp +Normally, +.Fn regexec +returns 0 for success and the non-zero code +.Dv REG_NOMATCH +for failure. +Other non-zero error codes may be returned in exceptional situations; +see +.Sx DIAGNOSTICS . +.Pp +If +.Dv REG_NOSUB +was specified in the compilation of the RE, +or if +.Fa nmatch +is 0, +.Fn regexec +ignores the +.Fa pmatch +argument (but see below for the case where +.Dv REG_STARTEND +is specified). +Otherwise, +.Fa pmatch +points to an array of +.Fa nmatch +structures of type +.Ft regmatch_t . +Such a structure has at least the members +.Va rm_so +and +.Va rm_eo , +both of type +.Ft regoff_t +(a signed arithmetic type at least as large as an +.Ft off_t +and a +.Ft ssize_t ) , +containing respectively the offset of the first character of a substring +and the offset of the first character after the end of the substring. +Offsets are measured from the beginning of the +.Fa string +argument given to +.Fn regexec . +An empty substring is denoted by equal offsets, +both indicating the character following the empty substring. +.Pp +The 0th member of the +.Fa pmatch +array is filled in to indicate what substring of +.Fa string +was matched by the entire RE. +Remaining members report what substring was matched by parenthesized +subexpressions within the RE; +member +.Va i +reports subexpression +.Va i , +with subexpressions counted (starting at 1) by the order of their opening +parentheses in the RE, left to right. +Unused entries in the array (corresponding either to subexpressions that +did not participate in the match at all, or to subexpressions that do not +exist in the RE (that is, +.Va i +> +.Fa preg Ns -> Ns Va re_nsub ) ) +have both +.Va rm_so +and +.Va rm_eo +set to -1. +If a subexpression participated in the match several times, +the reported substring is the last one it matched. +(Note, as an example in particular, that when the RE +.Ql "(b*)+" +matches +.Ql bbb , +the parenthesized subexpression matches each of the three +.So Li b Sc Ns s +and then +an infinite number of empty strings following the last +.Ql b , +so the reported substring is one of the empties.) +.Pp +If +.Dv REG_STARTEND +is specified, +.Fa pmatch +must point to at least one +.Ft regmatch_t +(even if +.Fa nmatch +is 0 or +.Dv REG_NOSUB +was specified), +to hold the input offsets for +.Dv REG_STARTEND . +Use for output is still entirely controlled by +.Fa nmatch ; +if +.Fa nmatch +is 0 or +.Dv REG_NOSUB +was specified, +the value of +.Fa pmatch Ns [0] +will not be changed by a successful +.Fn regexec . +.Pp +The +.Fn regerror +function +maps a non-zero +.Fa errcode +from either +.Fn regcomp +or +.Fn regexec +to a human-readable, printable message. +If +.Fa preg +is +.No non\- Ns Dv NULL , +the error code should have arisen from use of +the +.Ft regex_t +pointed to by +.Fa preg , +and if the error code came from +.Fn regcomp , +it should have been the result from the most recent +.Fn regcomp +using that +.Ft regex_t . +The +.Fn ( regerror +may be able to supply a more detailed message using information +from the +.Ft regex_t . ) +The +.Fn regerror +function +places the NUL-terminated message into the buffer pointed to by +.Fa errbuf , +limiting the length (including the NUL) to at most +.Fa errbuf_size +bytes. +If the whole message will not fit, +as much of it as will fit before the terminating NUL is supplied. +In any case, +the returned value is the size of buffer needed to hold the whole +message (including terminating NUL). +If +.Fa errbuf_size +is 0, +.Fa errbuf +is ignored but the return value is still correct. +.Pp +If the +.Fa errcode +given to +.Fn regerror +is first ORed with +.Dv REG_ITOA , +the +.Dq message +that results is the printable name of the error code, +e.g.\& +.Dq Dv REG_NOMATCH , +rather than an explanation thereof. +If +.Fa errcode +is +.Dv REG_ATOI , +then +.Fa preg +shall be +.No non\- Ns Dv NULL +and the +.Va re_endp +member of the structure it points to +must point to the printable name of an error code; +in this case, the result in +.Fa errbuf +is the decimal digits of +the numeric value of the error code +(0 if the name is not recognized). +.Dv REG_ITOA +and +.Dv REG_ATOI +are intended primarily as debugging facilities; +they are extensions, +compatible with but not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +Be warned also that they are considered experimental and changes are possible. +.Pp +The +.Fn regfree +function +frees any dynamically-allocated storage associated with the compiled RE +pointed to by +.Fa preg . +The remaining +.Ft regex_t +is no longer a valid compiled RE +and the effect of supplying it to +.Fn regexec +or +.Fn regerror +is undefined. +.Pp +None of these functions references global variables except for tables +of constants; +all are safe for use from multiple threads if the arguments are safe. +.Sh EXTENDED APIS +These extended APIs are available in Mac OS X 10.8 and beyond, when the +deployment target is 10.8 or later. +It should also be noted that any of the +.Fn regcomp +variants may be used to initialize a +.Ft regex_t +structure, that can then be passed to any of the +.Fn regexec +variants. +So it is quite legal to compile a wide character RE and use it to match a +multibyte character string, or vice versa. +.Pp +The +.Fn regncomp +routine compiles regular expressions like +.Fn regcomp , +but the length of the regular expression string is specified, allowing a string +that is not NUL terminated and/or contains NUL characters. +This is a modern replacement for using +.Fn regcomp +with the +.Dv REG_PEND +option. +.Pp +Similarly, the +.Fn regnexec +routine is like +.Fn regexec , +but the length of the string to match is specified, allowing a string +that is not NUL terminated and/or contains NUL characters. +.Pp +The +.Fn regwcomp +and +.Fn regwexec +variants take a wide-character +.Vt ( wchar_t ) +string for the regular expression and string to match. +And +.Fn regwncomp +and +.Fn regwnexec +are variants that allow specifying the wide character string length, and +so allows wide character strings that are not NUL terminated and/or +contains NUL characters. +.Sh INTERACTION WITH THE LOCALE +When +.Fn regcomp +or one of its variants is run, the regular expression is compiled into an +internal form, which may include specific information about the locale currently +in effect, such as equivalence classes or multi-character collation symbols. +So a reference to the current locale is also stored with the internal form, +so that when +.Fn regexec +is run, it can use the same locale (even if the locale is changed in-between +the calls to +.Fn regcomp +and +.Fn regexec ) . +.Pp +To provide more direct control over which locale is used, +routines with +.Dq Nm _l +appended to their names are provided that work just like the variants +without the +.Dq Nm _l , +except that a locale (via a +.Vt locale_t +variable type) is specified directly. +Note that only variants of +.Fn regcomp +have +.Dq Nm _l +variants, since the +.Fn regexec +variants just use the reference to the locale stored in the internal form. +.Sh IMPLEMENTATION CHOICES +The +.Nm regex +implementation in Mac OS X 10.8 and later is based on a heavily modified subset +of TRE (http://laurikari.net/tre/). +This provides improved performance, better conformance and additional features. +However, both API and binary compatibility have been maintained with previous +releases, so binaries +built on previous releases should work on 10.8 and later, and binaries built on +10.8 and later should be able to run on previous releases (as long as none of +the new variants or new features are used. +.Pp +There are a number of decisions that +.St -p1003.2 +leaves up to the implementor, +either by explicitly saying +.Dq undefined +or by virtue of them being +forbidden by the RE grammar. +This implementation treats them as follows. +.Pp +See +.Xr re_format 7 +for a discussion of the definition of case-independent matching. +.Pp +There is no particular limit on the length of REs, +except insofar as memory is limited. +Memory usage is approximately linear in RE size, and largely insensitive +to RE complexity, except for bounded repetitions. +See +.Sx BUGS +for one short RE using them +that will run almost any system out of memory. +.Pp +A backslashed character other than one specifically given a magic meaning +by +.St -p1003.2 +(such magic meanings occur only in obsolete +.Bq Dq basic +REs) +is taken as an ordinary character. +.Pp +Any unmatched +.Ql [\& +is a +.Dv REG_EBRACK +error. +.Pp +Equivalence classes cannot begin or end bracket-expression ranges. +The endpoint of one range cannot begin another. +.Pp +.Dv RE_DUP_MAX , +the limit on repetition counts in bounded repetitions, is 255. +.Pp +A repetition operator +.Ql ( ?\& , +.Ql *\& , +.Ql +\& , +or bounds) +cannot follow another +repetition operator, except for the use of +.Ql ?\& +for minimal repetition (for enhanced extended REs; see +.Xr re_format 7 +for details). +A repetition operator cannot begin an expression or subexpression +or follow +.Ql ^\& +or +.Ql |\& . +.Pp +.Ql |\& +cannot appear first or last in a (sub)expression or after another +.Ql |\& , +i.e., an operand of +.Ql |\& +cannot be an empty subexpression. +An empty parenthesized subexpression, +.Ql "()" , +is legal and matches an +empty (sub)string. +An empty string is not a legal RE. +.Pp +A +.Ql {\& +followed by a digit is considered the beginning of bounds for a +bounded repetition, which must then follow the syntax for bounds. +A +.Ql {\& +.Em not +followed by a digit is considered an ordinary character. +.Pp +.Ql ^\& +and +.Ql $\& +beginning and ending subexpressions in obsolete +.Pq Dq basic +REs are anchors, not ordinary characters. +.Sh DIAGNOSTICS +Non-zero error codes from +.Fn regcomp +and +.Fn regexec +include the following: +.Pp +.Bl -tag -width REG_ECOLLATE -compact +.It Dv REG_NOMATCH +The +.Fn regexec +function +failed to match +.It Dv REG_BADPAT +invalid regular expression +.It Dv REG_ECOLLATE +invalid collating element +.It Dv REG_ECTYPE +invalid character class +.It Dv REG_EESCAPE +.Ql \e +applied to unescapable character +.It Dv REG_ESUBREG +invalid backreference number +.It Dv REG_EBRACK +brackets +.Ql "[ ]" +not balanced +.It Dv REG_EPAREN +parentheses +.Ql "( )" +not balanced +.It Dv REG_EBRACE +braces +.Ql "{ }" +not balanced +.It Dv REG_BADBR +invalid repetition count(s) in +.Ql "{ }" +.It Dv REG_ERANGE +invalid character range in +.Ql "[ ]" +.It Dv REG_ESPACE +ran out of memory +.It Dv REG_BADRPT +.Ql ?\& , +.Ql *\& , +or +.Ql +\& +operand invalid +.It Dv REG_EMPTY +empty (sub)expression +.It Dv REG_ASSERT +cannot happen - you found a bug +.It Dv REG_INVARG +invalid argument, e.g.\& negative-length string +.It Dv REG_ILLSEQ +illegal byte sequence (bad multibyte character) +.El +.Sh SEE ALSO +.Xr grep 1 , +.Xr re_format 7 +.Pp +.St -p1003.2 , +sections 2.8 (Regular Expression Notation) +and +B.5 (C Binding for Regular Expression Matching). +.Sh HISTORY +The +.Nm regex +implementation is based on a heavily modified subset of TRE +(http://laurikari.net/tre/), originally written by Ville Laurikari. +Previous releases used an implementation originally written by +.An Henry Spencer , +and altered for inclusion in the +.Bx 4.4 +distribution. +.Sh BUGS +The beginning-of-line and end-of-line anchors ( +.Dq ^\& +and +.Dq $\& ) +are currently implemented so that repetitions can not be applied to them. +The standards are unclear about whether this is legal, but other +.Nm regex +packages do support this case. +It is best to avoid this non-portable (and not really very useful) case. +.Pp +The back-reference code is subtle and doubts linger about its correctness +in complex cases. +.Pp +The +.Fn regexec +variants use one of two internal matching engines. +The normal one is linear worst-case time in the length of the text being +searched, and quadratic worst-case time in the length of the used regular +expression. +When back-references are used, a slower, backtracking engine is used. +While all backtracking matching engines suffer from extreme slowness for certain +pathological cases, the normal engines doesn't suffer from these cases. +It is advised to avoid back-references whenever possible. +.Pp +The +.Fn regcomp +variants +implements bounded repetitions by macro expansion, +which is costly in time and space if counts are large +or bounded repetitions are nested. +An RE like, say, +.Ql "((((a{1,100}){1,100}){1,100}){1,100}){1,100}" +will (eventually) run almost any existing machine out of swap space. +.Pp +Due to a mistake in +.St -p1003.2 , +things like +.Ql "a)b" +are legal REs because +.Ql )\& +is +a special character only in the presence of a previous unmatched +.Ql (\& . +This cannot be fixed until the spec is fixed. +.Pp +The standard's definition of back references is vague. +For example, does +.Ql "a\e(\e(b\e)*\e2\e)*d" +match +.Ql "abbbd" ? +Until the standard is clarified, +behavior in such cases should not be relied on. diff --git a/regex/FreeBSD/utils.h b/regex/FreeBSD/utils.h new file mode 100644 index 0000000..2a2ed96 --- /dev/null +++ b/regex/FreeBSD/utils.h @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 1992, 1993, 1994 Henry Spencer. + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)utils.h 8.3 (Berkeley) 3/20/94 + * $FreeBSD: src/lib/libc/regex/utils.h,v 1.3 2007/01/09 00:28:04 imp Exp $ + */ + +/* utility definitions */ +#define DUPMAX _POSIX2_RE_DUP_MAX /* xxx is this right? */ +#define INFINITY (DUPMAX + 1) +#define NC (CHAR_MAX - CHAR_MIN + 1) +typedef unsigned char uch; + +/* switch off assertions (if not already off) if no REDEBUG */ +#ifndef REDEBUG +#ifndef NDEBUG +#define NDEBUG /* no assertions please */ +#endif +#endif +#include + +/* for old systems with bcopy() but no memmove() */ +#ifdef USEBCOPY +#define memmove(d, s, c) bcopy(s, d, c) +#endif diff --git a/regex/TRE/config.h b/regex/TRE/config.h new file mode 100644 index 0000000..6ea54fe --- /dev/null +++ b/regex/TRE/config.h @@ -0,0 +1,262 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#define HAVE_ALLOCA_H 1 + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#define HAVE_CFLOCALECOPYCURRENT 1 + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#define HAVE_CFPREFERENCESCOPYAPPVALUE 1 + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GETOPT_H 1 + +/* Define to 1 if you have the `getopt_long' function. */ +#define HAVE_GETOPT_LONG 1 + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 + +/* Define to 1 if you have the `isblank' function. */ +#define HAVE_ISBLANK 1 + +/* Define to 1 if you have the `iswascii' function or macro. */ +#define HAVE_ISWASCII 1 + +/* Define to 1 if you have the `iswblank' function or macro. */ +#define HAVE_ISWBLANK 1 + +/* Define to 1 if you have the `iswctype' function or macro. */ +#define HAVE_ISWCTYPE 1 + +/* Define to 1 if you have the `iswlower' function or macro. */ +#define HAVE_ISWLOWER 1 + +/* Define to 1 if you have the `iswupper' function or macro. */ +#define HAVE_ISWUPPER 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBUTF8_H */ + +/* Define to 1 if you have the `mbrtowc' function or macro. */ +#define HAVE_MBRTOWC 1 + +/* Define to 1 if the system has the type `mbstate_t'. */ +#define HAVE_MBSTATE_T 1 + +/* Define to 1 if you have the `mbtowc' function or macro. */ +/* #undef HAVE_MBTOWC */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_REGEX_H */ + +/* Define to 1 if the system has the type `reg_errcode_t'. */ +/* #undef HAVE_REG_ERRCODE_T */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `towlower' function or macro. */ +#define HAVE_TOWLOWER 1 + +/* Define to 1 if you have the `towupper' function or macro. */ +#define HAVE_TOWUPPER 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if the system has the type `wchar_t'. */ +#define HAVE_WCHAR_T 1 + +/* Define to 1 if you have the `wcschr' function or macro. */ +#define HAVE_WCSCHR 1 + +/* Define to 1 if you have the `wcscpy' function or macro. */ +#define HAVE_WCSCPY 1 + +/* Define to 1 if you have the `wcslen' function or macro. */ +#define HAVE_WCSLEN 1 + +/* Define to 1 if you have the `wcsncpy' function or macro. */ +#define HAVE_WCSNCPY 1 + +/* Define to 1 if you have the `wcsrtombs' function or macro. */ +#define HAVE_WCSRTOMBS 1 + +/* Define to 1 if you have the `wcstombs' function or macro. */ +/* #undef HAVE_WCSTOMBS */ + +/* Define to 1 if you have the `wctype' function or macro. */ +#define HAVE_WCTYPE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + +/* Define to 1 if the system has the type `wint_t'. */ +#define HAVE_WINT_T 1 + +/* Define if you want to disable debug assertions. */ +#define NDEBUG 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "tre" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "tre-general@lists.laurikari.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "TRE" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "TRE 0.8.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "tre" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.8.0" + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you want to enable approximate matching functionality. */ +/* #undef TRE_APPROX */ + +/* Define if you want TRE to print debug messages to stdout. */ +/* #undef TRE_DEBUG */ + +/* Define to enable multibyte character set support. */ +#define TRE_MULTIBYTE 1 + +/* Define to a field in the regex_t struct where TRE should store a pointer to + the internal tre_tnfa_t structure */ +#define TRE_REGEX_T_FIELD re_g + +/* Define to the absolute path to the system regex.h */ +#define TRE_SYSTEM_REGEX_H_PATH + +/* Define if you want TRE to use alloca() instead of malloc() when allocating + memory needed for regexec operations. */ +#define TRE_USE_ALLOCA 1 + +/* Define if you want user-defined string support */ +/* #undef TRE_STR_USER */ + +/* Define to include the system regex.h from TRE regex.h */ +#define TRE_USE_SYSTEM_REGEX_H 1 + +/* TRE version string. */ +#define TRE_VERSION "0.8.0" + +/* TRE version level 1. */ +#define TRE_VERSION_1 0 + +/* TRE version level 2. */ +#define TRE_VERSION_2 8 + +/* TRE version level 3. */ +#define TRE_VERSION_3 0 + +/* Define to enable wide character (wchar_t) support. */ +#define TRE_WCHAR 1 + +/* Version number of package */ +#define VERSION "0.8.0" + +/* Define to the maximum value of wchar_t if not already defined elsewhere */ +/* #undef WCHAR_MAX */ + +/* Define if wchar_t is signed */ +/* #undef WCHAR_T_SIGNED */ + +/* Define if wchar_t is unsigned */ +/* #undef WCHAR_T_UNSIGNED */ + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to enable GNU extensions in glibc */ +#define _GNU_SOURCE 1 + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define on IRIX */ +/* #undef _REGCOMP_INTERNAL */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif diff --git a/regex/TRE/lib/regcomp.c b/regex/TRE/lib/regcomp.c new file mode 100644 index 0000000..7860277 --- /dev/null +++ b/regex/TRE/lib/regcomp.c @@ -0,0 +1,203 @@ +/* + tre_regcomp.c - TRE POSIX compatible regex compilation functions. + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + +#include +#include +#include + +#include "tre.h" +#include "tre-internal.h" +#include "xmalloc.h" + +#ifndef BUILDING_VARIANT +int +tre_regncomp_l(regex_t *preg, const char *regex, size_t n, int cflags, locale_t loc) +{ + int ret; +#if TRE_WCHAR + tre_char_t *wregex; + size_t wlen; + + wregex = xmalloc(sizeof(tre_char_t) * (n + 1)); + if (wregex == NULL) + return REG_ESPACE; +#ifdef __LIBC__ + NORMALIZE_LOCALE(loc); +#endif /* __LIBC__ */ + + /* If the current locale uses the standard single byte encoding of + characters, we don't do a multibyte string conversion. If we did, + many applications which use the default locale would break since + the default "C" locale uses the 7-bit ASCII character set, and + all characters with the eighth bit set would be considered invalid. */ +#if TRE_MULTIBYTE + if (TRE_MB_CUR_MAX_L(loc) == 1) +#endif /* TRE_MULTIBYTE */ + { + unsigned int i; + const unsigned char *str = (const unsigned char *)regex; + tre_char_t *wstr = wregex; + + for (i = 0; i < n; i++) + *(wstr++) = *(str++); + wlen = n; + } +#if TRE_MULTIBYTE + else + { + size_t consumed; + tre_char_t *wcptr = wregex; +#ifdef HAVE_MBSTATE_T + mbstate_t state; + memset(&state, '\0', sizeof(state)); +#endif /* HAVE_MBSTATE_T */ + while (n > 0) + { + consumed = tre_mbrtowc_l(wcptr, regex, n, &state, loc); + + switch (consumed) + { + case 0: + if (*regex == '\0') + consumed = 1; + else + { + xfree(wregex); + return REG_BADPAT; + } + break; + case (size_t)-1: + case (size_t)-2: + DPRINT(("mbrtowc: error %d: %s.\n", errno, strerror(errno))); + xfree(wregex); + return REG_ILLSEQ; + } + regex += consumed; + n -= consumed; + wcptr++; + } + wlen = wcptr - wregex; + } +#endif /* TRE_MULTIBYTE */ + + wregex[wlen] = L'\0'; + ret = tre_compile(preg, wregex, wlen, cflags, loc); + xfree(wregex); +#else /* !TRE_WCHAR */ +#ifdef __LIBC__ + NORMALIZE_LOCALE(loc); +#endif /* __LIBC__ */ + + ret = tre_compile(preg, (const tre_char_t *)regex, n, cflags, loc); +#endif /* !TRE_WCHAR */ + + return ret; +} + +int +tre_regncomp(regex_t *preg, const char *regex, size_t n, int cflags) +{ + locale_t loc; + +#ifdef __LIBC__ + loc = __current_locale(); +#else /* !__LIBC__ */ + loc = duplocale(NULL); + if (!loc) return REG_ESPACE; +#endif /* !__LIBC__ */ + + return tre_regncomp_l(preg, regex, n, cflags, loc); +} + +int +tre_regcomp_l(regex_t *preg, const char *regex, int cflags, locale_t loc) +{ + size_t len; + + if (cflags & REG_PEND) + { + if ((const char *)(preg->re_endp) < regex) + return REG_INVARG; + len = (const char *)(preg->re_endp) - regex; + } + else + len = strlen(regex); + return tre_regncomp_l(preg, regex, len, cflags, loc); +} +#endif /* !BUILDING_VARIANT */ + +int +tre_regcomp(regex_t *preg, const char *regex, int cflags) +{ + locale_t loc; + +#ifdef __LIBC__ + loc = __current_locale(); +#else /* !__LIBC__ */ + loc = duplocale(NULL); + if (!loc) return REG_ESPACE; +#endif /* !__LIBC__ */ + + return tre_regcomp_l(preg, regex, cflags, loc); +} + + +#ifndef BUILDING_VARIANT +#ifdef TRE_WCHAR +int +tre_regwncomp_l(regex_t *preg, const wchar_t *regex, size_t n, int cflags, locale_t loc) +{ +#ifdef __LIBC__ + NORMALIZE_LOCALE(loc); +#endif /* __LIBC__ */ + return tre_compile(preg, regex, n, cflags, loc); +} + +int +tre_regwncomp(regex_t *preg, const wchar_t *regex, size_t n, int cflags) +{ + locale_t loc; + +#ifdef __LIBC__ + loc = __current_locale(); +#else /* !__LIBC__ */ + loc = duplocale(NULL); + if (!loc) return REG_ESPACE; +#endif /* !__LIBC__ */ + + return tre_compile(preg, regex, n, cflags, loc); +} + +int +tre_regwcomp_l(regex_t *preg, const wchar_t *regex, int cflags, locale_t loc) +{ +#ifdef __LIBC__ + NORMALIZE_LOCALE(loc); +#endif /* __LIBC__ */ + return tre_compile(preg, regex, wcslen(regex), cflags, loc); +} + +int +tre_regwcomp(regex_t *preg, const wchar_t *regex, int cflags) +{ + return tre_regwncomp(preg, regex, wcslen(regex), cflags); +} +#endif /* TRE_WCHAR */ + +void +tre_regfree(regex_t *preg) +{ + tre_free(preg); +} +#endif /* !BUILDING_VARIANT */ + +/* EOF */ diff --git a/regex/TRE/lib/regexec.c b/regex/TRE/lib/regexec.c new file mode 100644 index 0000000..174f6b6 --- /dev/null +++ b/regex/TRE/lib/regexec.c @@ -0,0 +1,563 @@ +/* + tre_regexec.c - TRE POSIX compatible matching functions (and more). + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + +/* Unset TRE_USE_ALLOCA to avoid using the stack to hold all the state + info while running */ +#undef TRE_USE_ALLOCA + +#ifdef TRE_USE_ALLOCA +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif +#endif /* TRE_USE_ALLOCA */ + +#include +#include +#include +#ifdef HAVE_WCHAR_H +#include +#endif /* HAVE_WCHAR_H */ +#ifdef HAVE_WCTYPE_H +#include +#endif /* HAVE_WCTYPE_H */ +#ifndef TRE_WCHAR +#include +#endif /* !TRE_WCHAR */ +#ifdef HAVE_MALLOC_H +#include +#endif /* HAVE_MALLOC_H */ +#include + +#include "tre-internal.h" +#include "tre-match-utils.h" +#include "tre.h" +#include "xmalloc.h" + + +/* For each tre_last_matched_t in the lm array, find the last matched branch by + comparing the touch value of the cmp_tag's. For all other branches, reset + the corresponding tags. If reset_all is non-zero, reset all tags in all + branches. Recurse into the nested last matched structures, clearing tags as + apprpriate. */ +static void +tre_reset_last_matched_branches(tre_tag_t *tags, const tre_last_matched_t *lm, + int n, int start_tag, int reset_all) +{ + int max, i, reset; + tre_last_matched_branch_t *b; + + DPRINT(("tre_reset_last_matched_branches: n=%d start_tag=%d reset_all=%d\n", + n, start_tag, reset_all)); + for (; n-- > 0; lm++) + { + if (lm->n_branches == 1) + { + b = lm->branches; + if (start_tag > 0) + { + DPRINT((" b->cmp_tag=%d %d cmp_tag, + tre_tag_touch_get(tags, b->cmp_tag), + tre_tag_touch_get(tags, start_tag))); + reset = (reset_all || tre_tag_touch_get(tags, b->cmp_tag) < + tre_tag_touch_get(tags, start_tag)); + } + else + reset = 0; + + if (reset) + { + int *t; + + for (i = b->n_tags, t = b->tags; i > 0; i--, t++) + { + DPRINT((" Resetting t%d\n", *t)); + tre_tag_reset(tags, *t); + } + } + if (b->n_last_matched > 0) + tre_reset_last_matched_branches(tags, b->last_matched, + b->n_last_matched, + lm->start_tag, reset); + } + else + { + if (!reset_all) + { +#ifdef TRE_DEBUG + int last; +#endif /* TRE_DEBUG */ + max = 0; + for (i = lm->n_branches, b = lm->branches; i > 0; i--, b++) + { + int t = b->cmp_tag; + int touch = tre_tag_touch_get(tags, t); + if (touch > max) + { + max = touch; +#ifdef TRE_DEBUG + last = t; +#endif /* TRE_DEBUG */ + } + } + DPRINT((" Last touched end tag t%d=%d\n", last, max)); + } + + for (i = lm->n_branches, b = lm->branches; i > 0; i--, b++) + { + reset = (reset_all || tre_tag_touch_get(tags, b->cmp_tag) < max); + if (reset) + { + int j; + int *t; + + for (j = b->n_tags, t = b->tags; j > 0; j--, t++) + { + DPRINT((" Resetting t%d\n", *t)); + tre_tag_reset(tags, *t); + } + } + if (b->n_last_matched > 0) + tre_reset_last_matched_branches(tags, b->last_matched, + b->n_last_matched, + lm->start_tag, reset); + } + } + } +} + + +/* Fills the POSIX.2 regmatch_t array according to the TNFA tag and match + endpoint values. */ +reg_errcode_t +tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags, + const tre_tnfa_t *tnfa, const tre_tag_t *intags, int match_eo) +{ + unsigned int i; + + if (cflags & REG_NOSUB) return REG_OK; + + i = 0; + if (match_eo >= 0 && intags) + { + const tre_tag_t *tags = intags; + tre_submatch_data_t *submatch_data; + + if (tnfa->last_matched_branch && + tnfa->last_matched_branch->n_last_matched > 0) + { + tre_tag_t *t; +#ifdef TRE_USE_ALLOCA + t = alloca(sizeof(*t) * tnfa->num_tags); +#else /* !TRE_USE_ALLOCA */ + t = xmalloc(sizeof(*t) * tnfa->num_tags); +#endif /* !TRE_USE_ALLOCA */ + if (!t) return REG_ESPACE; + memcpy(t, intags, tnfa->num_tags * sizeof(tre_tag_t)); + tre_reset_last_matched_branches(t, + tnfa->last_matched_branch->last_matched, + tnfa->last_matched_branch->n_last_matched, + 0, 0); + tags = t; + } + /* Construct submatch offsets from the tags. */ + DPRINT(("end tag = t%d = %d\n", tnfa->end_tag, match_eo)); + submatch_data = tnfa->submatch_data; + while (i < tnfa->num_submatches && i < nmatch) + { + if (submatch_data[i].so_tag == tnfa->end_tag) + pmatch[i].rm_so = match_eo; + else + pmatch[i].rm_so = tre_tag_get(tags, submatch_data[i].so_tag); + + if (submatch_data[i].eo_tag == tnfa->end_tag) + pmatch[i].rm_eo = match_eo; + else + pmatch[i].rm_eo = tre_tag_get(tags, submatch_data[i].eo_tag); + + /* If either of the endpoints were not used, this submatch + was not part of the match. */ + if (pmatch[i].rm_so == -1 || pmatch[i].rm_eo == -1) + pmatch[i].rm_so = pmatch[i].rm_eo = -1; + + DPRINT(("pmatch[%d] = {t%d = %qd, t%d = %qd}\n", i, + submatch_data[i].so_tag, pmatch[i].rm_so, + submatch_data[i].eo_tag, pmatch[i].rm_eo)); + i++; + } +#ifndef TRE_USE_ALLOCA + if (tags != intags) xfree((void*)tags); +#endif /* !TRE_USE_ALLOCA */ + } + + while (i < nmatch) + { + pmatch[i].rm_so = -1; + pmatch[i].rm_eo = -1; + i++; + } + + return REG_OK; +} + + +/* + Wrapper functions for POSIX compatible regexp matching. +*/ + +#ifndef __LIBC__ +int +tre_have_backrefs(const regex_t *preg) +{ + tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; + return tnfa->have_backrefs; +} + +#ifdef TRE_APPROX +int +tre_have_approx(const regex_t *preg) +{ + tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; + return tnfa->have_approx; +} +#endif /* TRE_APPROX */ +#endif /* !__LIBC__ */ + +static int +tre_match(const tre_tnfa_t *tnfa, const void *string, size_t len, + tre_str_type_t type, size_t nmatch, regmatch_t pmatch[], + int eflags) +{ + reg_errcode_t status; + tre_tag_t *tags = NULL; + int eo; + size_t offset = 0, count = 0; + + if ( +#ifdef TRE_STR_USER + type != STR_USER && +#endif /* TRE_STR_USER */ + (eflags & REG_STARTEND) && pmatch) + { + if (pmatch->rm_so < 0) + return REG_INVARG; + if (len == (size_t)-1) + { + if (pmatch->rm_eo < 0 || pmatch->rm_so > pmatch->rm_eo) + return REG_INVARG; + len = pmatch->rm_eo - pmatch->rm_so; + } + count = offset = pmatch->rm_so; + if (type == STR_WIDE) offset *= sizeof(wchar_t); + } + + if (tnfa->num_tags > 0 && nmatch > 0) + { +#ifdef TRE_USE_ALLOCA + tags = alloca(sizeof(*tags) * tnfa->num_tags); +#else /* !TRE_USE_ALLOCA */ + tags = xmalloc(sizeof(*tags) * tnfa->num_tags); +#endif /* !TRE_USE_ALLOCA */ + if (tags == NULL) + return REG_ESPACE; + } + + /* Dispatch to the appropriate matcher. */ + if (tnfa->have_backrefs || eflags & REG_BACKTRACKING_MATCHER) + { + /* The regex has back references, use the backtracking matcher. */ +#ifdef TRE_STR_USER + if (type == STR_USER) + { + const tre_str_source *source = string; + if (source->rewind == NULL || source->compare == NULL) + /* The backtracking matcher requires rewind and compare + capabilities from the input stream. */ + status = REG_BADPAT; + } else +#endif /* TRE_STR_USER */ + status = tre_tnfa_run_backtrack(tnfa, string + offset, (int)len, type, + tags, eflags, &eo); + } +#ifdef TRE_APPROX + else if (tnfa->have_approx || eflags & REG_APPROX_MATCHER) + { + /* The regex uses approximate matching, use the approximate matcher. */ + regamatch_t match; + regaparams_t params; + tre_regaparams_default(¶ms); + params.max_err = 0; + params.max_cost = 0; + status = tre_tnfa_run_approx(tnfa, string + offset, (int)len, type, tags, + &match, params, eflags, &eo); + } +#endif /* TRE_APPROX */ + else + { + /* Exact matching, no back references, use the parallel matcher. */ + status = tre_tnfa_run_parallel(tnfa, string + offset, (int)len, type, + tags, eflags, &eo); + } + + if (status == REG_OK) + { + /* A match was found, so fill the submatch registers. */ + status = tre_fill_pmatch(nmatch, pmatch, tnfa->cflags, tnfa, tags, eo); + /* If doing REG_STARTEND, adjust the pmatch array (we can't build + this into tre_fill_pmatch, because tre_tnfa_run_backtrack calls + tre_fill_pmatch itself). */ + if (status == REG_OK && !(tnfa->cflags & REG_NOSUB) && +#ifdef TRE_STR_USER + type != STR_USER && +#endif /* TRE_STR_USER */ + (eflags & REG_STARTEND) && pmatch && nmatch > 0) + { + size_t i; + regmatch_t *p; + for (i = nmatch, p = pmatch; i > 0; p++, i--) + { + if (p->rm_so >= 0) p->rm_so += count; + if (p->rm_eo >= 0) p->rm_eo += count; + } + } + } +#ifndef TRE_USE_ALLOCA + if (tags) + xfree(tags); +#endif /* !TRE_USE_ALLOCA */ + return status; +} + +int +tre_regnexec(const regex_t *preg, const char *str, size_t len, + size_t nmatch, regmatch_t pmatch[], int eflags) +{ + tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; + tre_str_type_t type = (TRE_MB_CUR_MAX_L(tnfa->loc) == 1) ? STR_BYTE : STR_MBS; + +#ifdef TRE_USE_SYSTEM_REGEX_H + if (preg->re_magic != RE_MAGIC) return REG_BADPAT; +#endif /* TRE_USE_SYSTEM_REGEX_H */ + + return tre_match(tnfa, str, len, type, nmatch, pmatch, eflags); +} + +int +tre_regexec(const regex_t *preg, const char *str, + size_t nmatch, regmatch_t pmatch[], int eflags) +{ + return tre_regnexec(preg, str, (size_t)-1, nmatch, pmatch, eflags); +} + + +#ifdef TRE_WCHAR + +int +tre_regwnexec(const regex_t *preg, const wchar_t *str, size_t len, + size_t nmatch, regmatch_t pmatch[], int eflags) +{ + tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; + +#ifdef TRE_USE_SYSTEM_REGEX_H + if (preg->re_magic != RE_MAGIC) return REG_BADPAT; +#endif /* TRE_USE_SYSTEM_REGEX_H */ + + return tre_match(tnfa, str, len, STR_WIDE, nmatch, pmatch, eflags); +} + +int +tre_regwexec(const regex_t *preg, const wchar_t *str, + size_t nmatch, regmatch_t pmatch[], int eflags) +{ + return tre_regwnexec(preg, str, (size_t)-1, nmatch, pmatch, eflags); +} + +#endif /* TRE_WCHAR */ + +#ifdef TRE_STR_USER +int +tre_reguexec(const regex_t *preg, const tre_str_source *str, + size_t nmatch, regmatch_t pmatch[], int eflags) +{ + tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; + +#ifdef TRE_USE_SYSTEM_REGEX_H + if (preg->re_magic != RE_MAGIC) return REG_BADPAT; +#endif /* TRE_USE_SYSTEM_REGEX_H */ + + return tre_match(tnfa, str, (size_t)-1, STR_USER, nmatch, pmatch, eflags); +} +#endif /* TRE_STR_USER */ + + +#ifdef TRE_APPROX + +/* + Wrapper functions for approximate regexp matching. +*/ + +static int +tre_match_approx(const tre_tnfa_t *tnfa, const void *string, size_t len, + tre_str_type_t type, regamatch_t *match, regaparams_t params, + int eflags) +{ + reg_errcode_t status; + tre_tag_t *tags = NULL; + int eo; + size_t offset = 0, count = 0; + + /* If the regexp does not use approximate matching features, the + maximum cost is zero, and the approximate matcher isn't forced, + use the exact matcher instead. */ + if (params.max_cost == 0 && !tnfa->have_approx + && !(eflags & REG_APPROX_MATCHER)) + return tre_match(tnfa, string, len, type, match->nmatch, match->pmatch, + eflags); + + /* Back references are not supported by the approximate matcher. */ + if (tnfa->have_backrefs) + return REG_BADPAT; + + if (tnfa->num_tags > 0 && match->nmatch > 0) + { +#if TRE_USE_ALLOCA + tags = alloca(sizeof(*tags) * tnfa->num_tags); +#else /* !TRE_USE_ALLOCA */ + tags = xmalloc(sizeof(*tags) * tnfa->num_tags); +#endif /* !TRE_USE_ALLOCA */ + if (tags == NULL) + return REG_ESPACE; + } + + if ( +#ifdef TRE_STR_USER + type != STR_USER && +#endif /* TRE_STR_USER */ + (eflags & REG_STARTEND) && match->pmatch) + { + if (match->pmatch->rm_so < 0) + return REG_INVARG; + if (len == (size_t)-1) + { + if (match->pmatch->rm_eo < 0 || match->pmatch->rm_so > + match->pmatch->rm_eo) + return REG_INVARG; + len = match->pmatch->rm_eo - match->pmatch->rm_so; + } + count = offset = match->pmatch->rm_so; + if (type == STR_WIDE) offset *= sizeof(wchar_t); + } + + status = tre_tnfa_run_approx(tnfa, string, (int)len, type, tags, + match, params, eflags, &eo); + if (status == REG_OK) + { + status = tre_fill_pmatch(match->nmatch, match->pmatch, tnfa->cflags, + tnfa, tags, eo); + /* If doing REG_STARTEND, adjust the pmatch array (we can't build + this into tre_fill_pmatch, because tre_tnfa_run_backtrack call + tre_fill_pmatch itself). */ + if (status == REG_OK && !(tnfa->cflags & REG_NOSUB) && +#ifdef TRE_STR_USER + type != STR_USER && +#endif /* TRE_STR_USER */ + (eflags & REG_STARTEND) && match->pmatch && match->nmatch > 0) + { + size_t i; + regmatch_t *p; + for (i = match->nmatch, p = match->pmatch; i > 0; p++, i--) + { + if (p->rm_so >= 0) p->rm_so += count; + if (p->rm_eo >= 0) p->rm_eo += count; + } + } + } +#ifndef TRE_USE_ALLOCA + if (tags) + xfree(tags); +#endif /* !TRE_USE_ALLOCA */ + return status; +} + +int +tre_reganexec(const regex_t *preg, const char *str, size_t len, + regamatch_t *match, regaparams_t params, int eflags) +{ + tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; + tre_str_type_t type = (TRE_MB_CUR_MAX_L(tnfa->loc) == 1) ? STR_BYTE : STR_MBS; + +#ifdef TRE_USE_SYSTEM_REGEX_H + if (preg->re_magic != RE_MAGIC) return REG_BADPAT; +#endif /* TRE_USE_SYSTEM_REGEX_H */ + + return tre_match_approx(tnfa, str, len, type, match, params, eflags); +} + +int +tre_regaexec(const regex_t *preg, const char *str, + regamatch_t *match, regaparams_t params, int eflags) +{ + return tre_reganexec(preg, str, (size_t)-1, match, params, eflags); +} + +#ifdef TRE_WCHAR + +int +tre_regawnexec(const regex_t *preg, const wchar_t *str, size_t len, + regamatch_t *match, regaparams_t params, int eflags) +{ + tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; + +#ifdef TRE_USE_SYSTEM_REGEX_H + if (preg->re_magic != RE_MAGIC) return REG_BADPAT; +#endif /* TRE_USE_SYSTEM_REGEX_H */ + + return tre_match_approx(tnfa, str, len, STR_WIDE, + match, params, eflags); +} + +int +tre_regawexec(const regex_t *preg, const wchar_t *str, + regamatch_t *match, regaparams_t params, int eflags) +{ + return tre_regawnexec(preg, str, (size_t)-1, match, params, eflags); +} + +#endif /* TRE_WCHAR */ + +void +tre_regaparams_default(regaparams_t *params) +{ + memset(params, 0, sizeof(*params)); + params->cost_ins = 1; + params->cost_del = 1; + params->cost_subst = 1; + params->max_cost = INT_MAX; + params->max_ins = INT_MAX; + params->max_del = INT_MAX; + params->max_subst = INT_MAX; + params->max_err = INT_MAX; +} + +#endif /* TRE_APPROX */ + +/* EOF */ diff --git a/regex/TRE/lib/tre-ast.c b/regex/TRE/lib/tre-ast.c new file mode 100644 index 0000000..12f8cdc --- /dev/null +++ b/regex/TRE/lib/tre-ast.c @@ -0,0 +1,226 @@ +/* + tre-ast.c - Abstract syntax tree (AST) routines + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ +#include + +#include "tre-ast.h" +#include "tre-mem.h" + +tre_ast_node_t * +tre_ast_new_node(tre_mem_t mem, tre_ast_type_t type, size_t size) +{ + tre_ast_node_t *node; + + node = tre_mem_calloc(mem, sizeof(*node)); + if (!node) + return NULL; + node->obj = tre_mem_calloc(mem, size); + if (!node->obj) + return NULL; + node->type = type; + node->nullable = -1; + node->submatch_id = -1; + + return node; +} + +tre_ast_node_t * +tre_ast_new_literal(tre_mem_t mem, int code_min, int code_max, int position) +{ + tre_ast_node_t *node; + tre_literal_t *lit; + + node = tre_ast_new_node(mem, LITERAL, sizeof(tre_literal_t)); + if (!node) + return NULL; + lit = node->obj; + lit->code_min = code_min; + lit->code_max = code_max; + lit->position = position; + + return node; +} + +tre_ast_node_t * +tre_ast_new_iter(tre_mem_t mem, tre_ast_node_t *arg, int min, int max, + int minimal) +{ + tre_ast_node_t *node; + tre_iteration_t *iter; + + node = tre_ast_new_node(mem, ITERATION, sizeof(tre_iteration_t)); + if (!node) + return NULL; + iter = node->obj; + iter->arg = arg; + iter->min = min; + iter->max = max; + iter->minimal = minimal; + node->num_submatches = arg->num_submatches; + + return node; +} + +tre_ast_node_t * +tre_ast_new_union(tre_mem_t mem, tre_ast_node_t *left, tre_ast_node_t *right) +{ + tre_ast_node_t *node; + + node = tre_ast_new_node(mem, UNION, sizeof(tre_union_t)); + if (node == NULL) + return NULL; + ((tre_union_t *)node->obj)->left = left; + ((tre_union_t *)node->obj)->right = right; + node->num_submatches = left->num_submatches + right->num_submatches; + + return node; +} + +tre_ast_node_t * +tre_ast_new_catenation(tre_mem_t mem, tre_ast_node_t *left, + tre_ast_node_t *right) +{ + tre_ast_node_t *node; + + node = tre_ast_new_node(mem, CATENATION, sizeof(tre_catenation_t)); + if (node == NULL) + return NULL; + ((tre_catenation_t *)node->obj)->left = left; + ((tre_catenation_t *)node->obj)->right = right; + node->num_submatches = left->num_submatches + right->num_submatches; + + return node; +} + +#ifdef TRE_DEBUG + +static void +tre_findent(FILE *stream, int i) +{ + while (i-- > 0) + fputc(' ', stream); +} + +void +tre_print_params(int *params) +{ + int i; + if (params) + { + DPRINT(("params [")); + for (i = 0; i < TRE_PARAM_LAST; i++) + { + if (params[i] == TRE_PARAM_UNSET) + DPRINT(("unset")); + else if (params[i] == TRE_PARAM_DEFAULT) + DPRINT(("default")); + else + DPRINT(("%d", params[i])); + if (i < TRE_PARAM_LAST - 1) + DPRINT((", ")); + } + DPRINT(("]")); + } +} + +static void +tre_do_print(FILE *stream, tre_ast_node_t *ast, int indent) +{ + int code_min, code_max, pos; + int num_tags = ast->num_tags; + tre_literal_t *lit; + tre_iteration_t *iter; + + tre_findent(stream, indent); + switch (ast->type) + { + case LITERAL: + lit = ast->obj; + code_min = lit->code_min; + code_max = lit->code_max; + pos = lit->position; + if (IS_EMPTY(lit)) + { + fprintf(stream, "literal empty\n"); + } + else if (IS_ASSERTION(lit)) + { + int i; + char *assertions[] = { "bol", "eol", "bracket", + "bow", "eow", "wb", "!wb", "backref" }; + if (code_max >= ASSERT_LAST << 1) + assert(0); + fprintf(stream, "assertions: "); + for (i = 0; (1 << i) <= ASSERT_LAST; i++) + if (code_max & (1 << i)) + fprintf(stream, "%s ", assertions[i]); + fprintf(stream, "\n"); + } + else if (IS_TAG(lit)) + { + fprintf(stream, "tag %d\n", code_max); + } + else if (IS_BACKREF(lit)) + { + fprintf(stream, "backref %d, pos %d\n", code_max, pos); + } + else if (IS_PARAMETER(lit)) + { + tre_print_params(lit->u.params); + fprintf(stream, "\n"); + } + else + { + fprintf(stream, "literal (%c, %c) (%d, %d), pos %d, sub %d, " + "%d tags\n", code_min, code_max, code_min, code_max, pos, + ast->submatch_id, num_tags); + } + break; + case ITERATION: + iter = ast->obj; + fprintf(stream, "iteration {%d, %d}, sub %d, %d tags, %s\n", + iter->min, iter->max, ast->submatch_id, num_tags, + iter->minimal ? "minimal" : "greedy"); + tre_do_print(stream, iter->arg, indent + 2); + break; + case UNION: + fprintf(stream, "union, sub %d, %d tags\n", ast->submatch_id, num_tags); + tre_do_print(stream, ((tre_union_t *)ast->obj)->left, indent + 2); + tre_do_print(stream, ((tre_union_t *)ast->obj)->right, indent + 2); + break; + case CATENATION: + fprintf(stream, "catenation, sub %d, %d tags\n", ast->submatch_id, + num_tags); + tre_do_print(stream, ((tre_catenation_t *)ast->obj)->left, indent + 2); + tre_do_print(stream, ((tre_catenation_t *)ast->obj)->right, indent + 2); + break; + default: + assert(0); + break; + } +} + +static void +tre_ast_fprint(FILE *stream, tre_ast_node_t *ast) +{ + tre_do_print(stream, ast, 0); +} + +void +tre_ast_print(tre_ast_node_t *tree) +{ + printf("AST:\n"); + tre_ast_fprint(stdout, tree); +} + +#endif /* TRE_DEBUG */ + +/* EOF */ diff --git a/regex/TRE/lib/tre-ast.h b/regex/TRE/lib/tre-ast.h new file mode 100644 index 0000000..3c10b0b --- /dev/null +++ b/regex/TRE/lib/tre-ast.h @@ -0,0 +1,141 @@ +/* + tre-ast.h - Abstract syntax tree (AST) definitions + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + + +#ifndef TRE_AST_H +#define TRE_AST_H 1 + +#include + +#include "tre-mem.h" +#include "tre-internal.h" +#include "tre-compile.h" +#include "tre-last-matched.h" + +/* The different AST node types. */ +typedef enum { + LITERAL, + CATENATION, + ITERATION, + UNION +} tre_ast_type_t; + +/* Special subtypes of TRE_LITERAL. */ +#define EMPTY -1 /* Empty leaf (denotes empty string). */ +#define ASSERTION -2 /* Assertion leaf. */ +#define TAG -3 /* Tag leaf. */ +#define BACKREF -4 /* Back reference leaf. */ +#define PARAMETER -5 /* Parameter. */ + +#define IS_SPECIAL(x) ((x)->code_min < 0) +#define IS_EMPTY(x) ((x)->code_min == EMPTY) +#define IS_ASSERTION(x) ((x)->code_min == ASSERTION) +#define IS_TAG(x) ((x)->code_min == TAG) +#define IS_BACKREF(x) ((x)->code_min == BACKREF) +#define IS_PARAMETER(x) ((x)->code_min == PARAMETER) + +#define SUBMATCH_ID_INVISIBLE_START (INT_MAX / 2 + 1) + + +/* A generic AST node. All AST nodes consist of this node on the top + level with `obj' pointing to the actual content. */ +typedef struct _tre_ast_node { + void *obj; /* Pointer to actual node. */ + tre_last_matched_branch_pre_t *last_matched_branch; + tre_last_matched_pre_t *last_matched_in_progress; + tre_pos_and_tags_t *firstpos; + tre_pos_and_tags_t *lastpos; + /* The original pointer is used to point to the original node, when a + * CATENATION and tag are added. If NULL, this is node is the original */ + struct _tre_ast_node *original; + tre_ast_type_t type; /* Type of the node. */ + int submatch_id; + int num_submatches; + int num_tags; + short nullable; + short make_branches; +} tre_ast_node_t; + + +/* A "literal" node. These are created for assertions, back references, + tags, matching parameter settings, and all expressions that match one + character. */ +typedef struct { + tre_cint_t code_min; + tre_cint_t code_max; + int position; + union { + tre_bracket_match_list_t *bracket_match_list; + int *params; + } u; +} tre_literal_t; + +/* A "catenation" node. These are created when two regexps are concatenated. + If there are more than one subexpressions in sequence, the `left' part + holds all but the last, and `right' part holds the last subexpression + (catenation is left associative). */ +typedef struct { + tre_ast_node_t *left; + tre_ast_node_t *right; +} tre_catenation_t; + +/* An "iteration" node. These are created for the "*", "+", "?", and "{m,n}" + operators. */ +typedef struct { + /* Subexpression to match. */ + tre_ast_node_t *arg; + /* Minimum number of consecutive matches. */ + int min; + /* Maximum number of consecutive matches. */ + int max; + /* If 0, match as many characters as possible, if 1 match as few as + possible. Note that this does not always mean the same thing as + matching as many/few repetitions as possible. */ + unsigned int minimal:1; + /* Approximate matching parameters (or NULL). */ + int *params; +} tre_iteration_t; + +/* An "union" node. These are created for the "|" operator. */ +typedef struct { + tre_ast_node_t *left; + tre_ast_node_t *right; + /* The left end right end tags if non-zero */ + int left_tag; + int right_tag; +} tre_union_t; + +__private_extern__ tre_ast_node_t * +tre_ast_new_node(tre_mem_t mem, tre_ast_type_t type, size_t size); + +__private_extern__ tre_ast_node_t * +tre_ast_new_literal(tre_mem_t mem, int code_min, int code_max, int position); + +__private_extern__ tre_ast_node_t * +tre_ast_new_iter(tre_mem_t mem, tre_ast_node_t *arg, int min, int max, + int minimal); + +__private_extern__ tre_ast_node_t * +tre_ast_new_union(tre_mem_t mem, tre_ast_node_t *left, tre_ast_node_t *right); + +__private_extern__ tre_ast_node_t * +tre_ast_new_catenation(tre_mem_t mem, tre_ast_node_t *left, + tre_ast_node_t *right); + +#ifdef TRE_DEBUG +void +tre_ast_print(tre_ast_node_t *tree); + +/* XXX - rethink AST printing API */ +void +tre_print_params(int *params); +#endif /* TRE_DEBUG */ + +#endif /* TRE_AST_H */ + +/* EOF */ diff --git a/regex/TRE/lib/tre-compile.c b/regex/TRE/lib/tre-compile.c new file mode 100644 index 0000000..8d7a453 --- /dev/null +++ b/regex/TRE/lib/tre-compile.c @@ -0,0 +1,3482 @@ +/* + tre-compile.c - TRE regex compiler + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +/* + TODO: + - Fix tre_ast_to_tnfa() to recurse using a stack instead of recursive + function calls. +*/ + + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ +#include +#include +#include +#include + +#include "tre-internal.h" +#include "tre-mem.h" +#include "tre-stack.h" +#include "tre-ast.h" +#include "tre-parse.h" +#include "tre-compile.h" +#include "tre.h" +#include "tre-last-matched.h" +#include "xmalloc.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" + +/* + The bit_ffs() macro in bitstring.h is flawed. Replace it with a working one. +*/ +#undef bit_ffs +#define bit_ffs(name, nbits, value) { \ + register bitstr_t *_name = name; \ + register int _byte, _nbits = nbits; \ + register int _stopbyte = _bit_byte(_nbits), _value = -1; \ + for (_byte = 0; _byte <= _stopbyte; ++_byte) \ + if (_name[_byte]) { \ + _value = _byte << 3; \ + for (_stopbyte = _name[_byte]; !(_stopbyte&0x1); \ + ++_value, _stopbyte >>= 1); \ + break; \ + } \ + *(value) = _value; \ +} + +/* + Algorithms to setup tags so that submatch addressing can be done. +*/ + + +#ifdef TRE_DEBUG +static const char *tag_dir_str[] = { + "minimize", + "maximize", + "left-maximize" +}; + +static const char _indent[] = " "; + +static void +print_indent(int indent) +{ + while (indent-- > 0) + DPRINT((_indent)); +} + +static void print_last_matched_pre(tre_last_matched_pre_t *lm, int indent, + int num_tags); +static void +print_last_match_branch_pre(tre_last_matched_branch_pre_t *branch, int indent, + int num_tags) +{ + tre_last_matched_pre_t *u = branch->last_matched; + int n_last_matched = 0; + + while (u) + { + n_last_matched++; + u = u->next; + } + + print_indent(indent); + DPRINT(("BRANCH: tot_branches=%d tot_last_matched=%d tot_tags=%d\n", + branch->tot_branches, branch->tot_last_matched, branch->tot_tags)); + print_indent(indent); + DPRINT(("..n_last_matched=%d last_matched=%d\n", branch->n_last_matched, + n_last_matched)); + if (branch->n_last_matched != n_last_matched) + DPRINT(("*** mismatch between n_last_matched and unions ***\n")); + if (branch->cmp_tag > 0) + { + int i; + const char *sep = " tags="; + print_indent(indent); + DPRINT(("..cmp_tag=%d n_tags=%d", branch->cmp_tag, branch->n_tags)); + for (i = 0; i < num_tags; i++) + if (bit_test(branch->tags, i)) + { + DPRINT(("%s%d", sep, i)); + sep = ","; + } + DPRINT(("\n")); + } + + u = branch->last_matched; + indent++; + while (u) + { + print_last_matched_pre(u, indent, num_tags); + u = u->next; + } +} + +static void +print_last_matched_pre(tre_last_matched_pre_t *lm, int indent, int num_tags) +{ + tre_last_matched_branch_pre_t *b = lm->branches; + int n_branches = 0; + + while (b) + { + n_branches++; + b = b->next; + } + + print_indent(indent); + DPRINT(("LAST_MATCHED: tot_branches=%d tot_last_matched=%d tot_tags=%d\n", + lm->tot_branches, lm->tot_last_matched, lm->tot_tags)); + print_indent(indent); + DPRINT(("..start_tag=%d n_branches=%d branches=%d\n", lm->start_tag, + lm->n_branches, n_branches)); + if (lm->n_branches != n_branches) + DPRINT(("*** mismatch between n and branches ***\n")); + + b = lm->branches; + indent++; + while (b) + { + print_last_match_branch_pre(b, indent, num_tags); + b = b->next; + } +} + +static void print_last_matched(tre_last_matched_t *lm, int indent); +static void +print_last_match_branch(tre_last_matched_branch_t *branch, int indent) +{ + tre_last_matched_t *u; + int i; + + print_indent(indent); + DPRINT(("BRANCH: n_last_matched=%d\n", branch->n_last_matched)); + if (branch->cmp_tag > 0) + { + print_indent(indent); + DPRINT(("..cmp_tag=%d n_tags=%d", branch->cmp_tag, branch->n_tags)); + if (branch->n_tags > 0) + { + const char *sep = " tags="; + for (i = 0; i < branch->n_tags; i++) + { + DPRINT(("%s%d", sep, branch->tags[i])); + sep = ","; + } + } + DPRINT(("\n")); + } + + u = branch->last_matched; + indent++; + for (i = branch->n_last_matched; i > 0; i--, u++) + print_last_matched(u, indent); +} + +static void +print_last_matched(tre_last_matched_t *lm, int indent) +{ + int i; + tre_last_matched_branch_t *b; + + print_indent(indent); + DPRINT(("LAST_MATCHED: n_branches=%d start_tag=%d\n", lm->n_branches, + lm->start_tag)); + + b = lm->branches; + indent++; + for (i = lm->n_branches; i > 0; i--, b++) + print_last_match_branch(b, indent); +} +#endif /* TRE_DEBUG */ + + +/* Merge the tre_last_matched_branch_pre_t of src into dst, creating a new + one if needed. If tag_id > 0, add that tag as well (a negative tag_id will + create an unset tre_last_matched_branch_pre_t. */ +static reg_errcode_t +tre_merge_branches(tre_mem_t mem, tre_ast_node_t *dst, tre_ast_node_t *src, + int tag_id, int num_tags) +{ + tre_last_matched_branch_pre_t *db = dst->last_matched_branch; + tre_last_matched_branch_pre_t *sb = (src ? src->last_matched_branch : NULL); + + if (db) + { + if (sb) + { + bitstr_t *l = db->tags; + bitstr_t *r = sb->tags; + int i = bitstr_size(num_tags); + + while(i-- > 0) + *l++ |= *r++; + /* db and sb are the info from two parallel sub-trees, so the tags + must be mutually exclusive, and we can just add their numbers */ + db->n_tags += sb->n_tags; + db->tot_tags += sb->tot_tags; + if (db->last_matched) + { + if (sb->last_matched) + { + tre_last_matched_pre_t *u = db->last_matched; + + while(u->next) + u = u->next; + u->next = sb->last_matched; + db->n_last_matched += sb->n_last_matched; + db->tot_branches += sb->tot_branches; + db->tot_last_matched += sb->tot_last_matched; + } + } + else if (sb->last_matched) + { + db->last_matched = sb->last_matched; + db->n_last_matched = sb->n_last_matched; + db->tot_branches = sb->tot_branches; + db->tot_last_matched = sb->tot_last_matched; + } + } + } + else + db = sb; + + if (tag_id != 0) + { + if (!db) + { + db = tre_mem_calloc(mem, sizeof(tre_last_matched_branch_pre_t) + + bitstr_size(num_tags)); + if (db == NULL) + return REG_ESPACE; + db->tot_branches = 1; + } + if (tag_id > 0) + { + /* tag_id is a new tag, and shouldn't exist in db's tags, + so we can always increment n_tags */ + bit_set(db->tags, tag_id); + db->n_tags++; + db->tot_tags++; + } + } + dst->last_matched_branch = db; + return REG_OK; +} + + +/* Inserts a catenation node to the root of the tree given in `node'. + As the left child a new tag with number `tag_id' to `node' is added, + and the right child is the old root. */ +static reg_errcode_t +tre_add_tag_left(tre_mem_t mem, tre_ast_node_t *node, int tag_id) +{ + tre_catenation_t *c; + + DPRINT(("add_tag_left: tag %d\n", tag_id)); + + c = tre_mem_alloc(mem, sizeof(*c)); + if (c == NULL) + return REG_ESPACE; + c->left = tre_ast_new_literal(mem, TAG, tag_id, -1); + if (c->left == NULL) + return REG_ESPACE; + c->right = tre_mem_calloc(mem, sizeof(tre_ast_node_t)); + if (c->right == NULL) + return REG_ESPACE; + + c->right->obj = node->obj; + c->right->type = node->type; + c->right->last_matched_branch = node->last_matched_branch; + c->right->nullable = -1; + c->right->submatch_id = -1; + node->obj = c; + node->type = CATENATION; + node->original = c->right; + return REG_OK; +} + +/* Inserts a catenation node to the root of the tree given in `node'. + As the right child a new tag with number `tag_id' to `node' is added, + and the left child is the old root. */ +static reg_errcode_t +tre_add_tag_right(tre_mem_t mem, tre_ast_node_t *node, int tag_id) +{ + tre_catenation_t *c; + + DPRINT(("tre_add_tag_right: tag %d\n", tag_id)); + + c = tre_mem_alloc(mem, sizeof(*c)); + if (c == NULL) + return REG_ESPACE; + c->right = tre_ast_new_literal(mem, TAG, tag_id, -1); + if (c->right == NULL) + return REG_ESPACE; + c->left = tre_mem_calloc(mem, sizeof(tre_ast_node_t)); + if (c->left == NULL) + return REG_ESPACE; + + c->left->obj = node->obj; + c->left->type = node->type; + c->left->last_matched_branch = node->last_matched_branch; + c->left->nullable = -1; + c->left->submatch_id = -1; + node->obj = c; + node->type = CATENATION; + node->original = c->left; + return REG_OK; +} + +typedef enum { + ADDTAGS_RECURSE, + ADDTAGS_RECURSE_NOT_TOP_UNION, + ADDTAGS_AFTER_ITERATION, + ADDTAGS_AFTER_UNION_LEFT, + ADDTAGS_AFTER_UNION_RIGHT, + ADDTAGS_AFTER_CAT_LEFT, + ADDTAGS_AFTER_CAT_RIGHT, + ADDTAGS_SET_SUBMATCH_END, + ADDTAGS_UNION_RECURSE, + ADDTAGS_UNION_RIGHT_RECURSE, + ADDTAGS_AFTER_UNION_TOP, +} tre_addtags_symbol_t; + +enum { + COPY_LAST_MATCHED_BRANCH, + COPY_LAST_MATCHED_BRANCH_NEXT, + COPY_LAST_MATCHED, + COPY_LAST_MATCHED_NEXT, +}; + + +#define REGSET_UNSET ((unsigned)-1) + +/* Go through `regset' and set submatch data for submatches that are + using this tag. */ +static void +tre_purge_regset(unsigned *regset, tre_tnfa_t *tnfa, int tag) +{ + int i; + + for (i = 0; regset[i] != REGSET_UNSET; i++) + { + int id = regset[i] / 2; + int start = !(regset[i] % 2); + if (id >= SUBMATCH_ID_INVISIBLE_START) + continue; + DPRINT((" Using tag %d for %s offset of " + "submatch %d\n", tag, + start ? "start" : "end", id)); + if (start) + tnfa->submatch_data[id].so_tag = tag; + else + tnfa->submatch_data[id].eo_tag = tag; + } + regset[0] = -1; +} + + +#define REGSET_HAS_STARTS 0x1 +#define REGSET_HAS_ENDS 0x2 + + +/* Adds tags to appropriate locations in the parse tree in `tree', so that + subexpressions marked for submatch addressing can be traced. */ +static reg_errcode_t +tre_add_tags(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *tree, + tre_tnfa_t *tnfa) +{ + reg_errcode_t status = REG_OK; + tre_addtags_symbol_t symbol; + tre_ast_node_t *node = tree; /* Tree node we are currently looking at. */ + int bottom = tre_stack_num_objects(stack); + /* True for first pass (counting number of needed tags) */ + int first_pass = (mem == NULL || tnfa == NULL); + unsigned *regset, *orig_regset; + int regset_contains = 0; + int num_tags = 0; /* Total number of tags. */ + int num_minimals = 0; /* Number of special minimal tags. */ + int tag = 0; /* The tag that is to be added next. */ + int next_tag = 1; /* Next tag to use after this one. */ + int minimal_tag = -1; /* Tag that marks the beginning of a minimal match. */ + int *reorder_tags = NULL; /* Tag reorder array: a pair for each reorder, + * the first is the tag to reorder, the second + * is the tag after which the first is reordered */ + int *rtp; /* Pointer used to fill in reorder_tags and + * tag_order */ + int *to_reorder; /* Transform array converting sequential order to + * that specified by reorder_tags */ + int id; + + tre_tag_direction_t direction = TRE_TAG_LEFT_MAXIMIZE; + if (!first_pass) + { + DPRINT(("Initializing direction to %s\n", tag_dir_str[direction])); + tnfa->end_tag = 0; + tnfa->minimal_tags[0] = -1; + } + + regset = xmalloc(sizeof(*regset) * ((tnfa->num_submatches + + tnfa->num_submatches_invisible + 1) * 2)); + if (regset == NULL) + { + status = REG_ESPACE; + goto error_regset; + } + regset[0] = REGSET_UNSET; + orig_regset = regset; + + if (!first_pass) + { + /* Allocate all memory for reorder_tags, tag_order, to_seq_order and + * to_reorder in one batch (assuming all are the same type) */ + rtp = reorder_tags = xmalloc(sizeof(*reorder_tags) * + ((2 * tnfa->num_reorder_tags + 1) + + tnfa->num_tags)); + if (reorder_tags == NULL) + { + status = REG_ESPACE; + goto error_reorder_tags; + } + to_reorder = reorder_tags + (2 * tnfa->num_reorder_tags + 1); + } + + STACK_PUSH(stack, voidptr, node); + STACK_PUSH(stack, int, ADDTAGS_RECURSE); + + while (tre_stack_num_objects(stack) > bottom) + { + if (status != REG_OK) + break; + + symbol = (tre_addtags_symbol_t)tre_stack_pop_int(stack); + switch (symbol) + { + int top_union; + + case ADDTAGS_SET_SUBMATCH_END: + { + int i; + + id = tre_stack_pop_int(stack); + node = tre_stack_pop_voidptr(stack); + /* Add end of this submatch to regset. */ + for (i = 0; regset[i] != REGSET_UNSET; i++); + regset[i] = id * 2 + 1; + regset[i + 1] = -1; + regset_contains |= REGSET_HAS_ENDS; + + /* Always put a tag after a minimal iterator. */ + if (minimal_tag >= 0) + { + if (first_pass) + { + node->num_tags++; + DPRINT((" ADDTAGS_SET_SUBMATCH_END: node->num_tags = %d\n", + node->num_tags)); + } + else + { + int i; + status = tre_merge_branches(mem, node, NULL, tag, + tnfa->num_tags); + if (status != REG_OK) + break; + status = tre_add_tag_right(mem, node, tag); + if (status != REG_OK) + break; + tnfa->tag_directions[tag] = TRE_TAG_MINIMIZE; + DPRINT(("Setting t%d direction to %s\n", tag, + tag_dir_str[tnfa->tag_directions[tag]])); + DPRINT(("Minimal %d, %d\n", minimal_tag, tag)); + for (i = 0; tnfa->minimal_tags[i] >= 0; i++); + tnfa->minimal_tags[i] = tag; + tnfa->minimal_tags[i + 1] = minimal_tag; + tnfa->minimal_tags[i + 2] = -1; + + DPRINT((" Minimal end: t%d reordered to " + "after t%d\n", tag, minimal_tag)); + /* Append to tag_order, move "tag" after + * "minimal_tag" */ + *rtp++ = tag; + *rtp++ = minimal_tag; + + num_minimals++; + tre_purge_regset(regset, tnfa, tag); + } + + minimal_tag = -1; + DPRINT((" ADDTAGS_SET_SUBMATCH_END num_tags++ tag=%d\n", tag)); + regset[0] = REGSET_UNSET; + regset_contains = 0; + tag = next_tag; + num_tags++; + next_tag++; + } + break; + } + + case ADDTAGS_RECURSE_NOT_TOP_UNION: + /* Like ADDTAGS_RECURSE, except that top_union is set to zero, + * indicating that if a union is being processed, it is not the + * top-most of a series */ + top_union = 0; + goto do_addtags_recurse; + + case ADDTAGS_RECURSE: + /* Setting top_union to 1 means that if a union is begin processed, + * it is the top-most of a series, and should recurse through the + * series to set the left_tag and right_tag values */ + top_union = 1; + +do_addtags_recurse: + node = tre_stack_pop_voidptr(stack); + + id = node->submatch_id; + if (id >= 0) + { + int i; + + + /* Add start of this submatch to regset. */ + for (i = 0; regset[i] != REGSET_UNSET; i++); + regset[i] = id * 2; + regset[i + 1] = -1; + regset_contains |= REGSET_HAS_STARTS; + + /* Add end of this submatch to regset after processing this + node. */ + STACK_PUSH(stack, voidptr, node); + STACK_PUSHX(stack, int, id); + STACK_PUSHX(stack, int, ADDTAGS_SET_SUBMATCH_END); + } + + switch (node->type) + { + case LITERAL: + { + tre_literal_t *lit = node->obj; + + if (!IS_SPECIAL(lit) || IS_BACKREF(lit) || IS_EMPTY(lit) || IS_ASSERTION(lit)) + { + DPRINT(("Literal %d-%d\n", + (int)lit->code_min, (int)lit->code_max)); + if (regset_contains) + { + /* Regset is not empty, so add a tag before the + literal or backref. */ + if (first_pass) + { + DPRINT((" ADDTAGS_RECURSE:LITERAL node->num_tags = 1\n")); + node->num_tags = 1; + } + else + { + status = tre_merge_branches(mem, node, NULL, tag, + tnfa->num_tags); + if (status != REG_OK) + break; + status = tre_add_tag_left(mem, node, tag); + if (status != REG_OK) + break; + if (regset_contains == REGSET_HAS_STARTS) + tnfa->tag_directions[tag] = TRE_TAG_LEFT_MAXIMIZE; + else + tnfa->tag_directions[tag] = direction; + DPRINT(("Setting t%d direction to %s\n", tag, + tag_dir_str[tnfa->tag_directions[tag]])); + tre_purge_regset(regset, tnfa, tag); + + if (IS_BACKREF(lit)) + { + int b = lit->code_max; + int t = tnfa->submatch_data[b].so_tag; + /* Fail if the referenced submatch hasn't been + * completed yet */ + if (tnfa->submatch_data[b].eo_tag < 0) + { + status = REG_ESUBREG; + break; + } + if (t < tag) + { + DPRINT((" Backref %d start: " + "t%d reordered to before t%d\n", + b, tag, t)); + if(t > 0) + t--; + /* Append to tag_order, move "tag" after + * "t" */ + *rtp++ = tag; + *rtp++ = t; + } +#if TRE_DEBUG + else + DPRINT((" Backref %d start: " + "(t%d already before t%d)\n", + b, tag, t)); +#endif /* TRE_DEBUG */ + } + } + + DPRINT((" ADDTAGS_RECURSE:LITERAL num_tags++ tag=%d\n", + tag)); + regset[0] = REGSET_UNSET; + regset_contains = 0; + tag = next_tag; + num_tags++; + next_tag++; + } + } + else + { + assert(!IS_TAG(lit)); + } + break; + } + case CATENATION: + { + tre_catenation_t *cat = node->obj; + tre_ast_node_t *left = cat->left; + tre_ast_node_t *right = cat->right; + int reserved_tag = -1; + DPRINT(("Catenation, next_tag = %d\n", next_tag)); + + + /* After processing right child. */ + STACK_PUSHX(stack, voidptr, node); + STACK_PUSHX(stack, int, ADDTAGS_AFTER_CAT_RIGHT); + + /* Process right child. */ + STACK_PUSHX(stack, voidptr, right); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE); + + /* After processing left child. */ + STACK_PUSHX(stack, int, next_tag + left->num_tags); + DPRINT((" Pushing %d for after left\n", + next_tag + left->num_tags)); + if (left->num_tags > 0 && right->num_tags > 0) + { + /* Reserve the next tag to the right child. */ + DPRINT((" ADDTAGS_RECURSE:CATENATION num_tags++ " + "Reserving next_tag %d to right child\n", + next_tag)); + reserved_tag = next_tag; + next_tag++; + } + STACK_PUSHX(stack, int, reserved_tag); + STACK_PUSHX(stack, int, ADDTAGS_AFTER_CAT_LEFT); + + /* Process left child. */ + STACK_PUSHX(stack, voidptr, left); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE); + + } + break; + case ITERATION: + { + tre_iteration_t *iter = node->obj; + DPRINT(("Iteration\n")); + + if (first_pass) + STACK_PUSHX(stack, int, regset_contains != 0); + STACK_PUSHX(stack, int, tag); + STACK_PUSHX(stack, voidptr, node); + STACK_PUSHX(stack, int, ADDTAGS_AFTER_ITERATION); + + STACK_PUSHX(stack, voidptr, iter->arg); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE); + + /* Regset is not empty, so add a tag here (this always happens + because iterators always get submatch id, even if in the + invisible range) */ + if (regset_contains) + { + if (!first_pass) + { + status = tre_merge_branches(mem, node, NULL, tag, + tnfa->num_tags); + if (status != REG_OK) + break; + status = tre_add_tag_left(mem, node, tag); + if (status != REG_OK) + break; + if (regset_contains == REGSET_HAS_STARTS && tag != 0) + tnfa->tag_directions[tag] = iter->minimal ? + TRE_TAG_MINIMIZE : + TRE_TAG_LEFT_MAXIMIZE; + else + tnfa->tag_directions[tag] = direction; + DPRINT(("Setting t%d direction to %s\n", tag, + tag_dir_str[tnfa->tag_directions[tag]])); + tre_purge_regset(regset, tnfa, tag); + } + + DPRINT((" ADDTAGS_RECURSE:ITERATION num_tags++ tag=%d\n", + tag)); + regset[0] = REGSET_UNSET; + regset_contains = 0; + tag = next_tag; + num_tags++; + next_tag++; + } + direction = TRE_TAG_LEFT_MAXIMIZE; + DPRINT((" Setting direction to %s\n", tag_dir_str[direction])); + } + break; + case UNION: + { + tre_union_t *uni; + tre_ast_node_t *left; + tre_ast_node_t *right; + int front_tag = -1; + + DPRINT(("Union\n")); + + if (regset_contains) + { + DPRINT((" UNION num_tags++ tag=%d\n", tag)); + front_tag = tag; + tag = next_tag; + num_tags++; + next_tag++; + } + + /* For the top union, walk the tree of consecutive unions, + * setting the left_tag and right_tag values in increasing + * order (left to right priority) */ + if (top_union && + (node->num_submatches - + (node->submatch_id >= 0 && + node->submatch_id < SUBMATCH_ID_INVISIBLE_START)) > 0) + { + tre_ast_node_t *n; + int last = tre_stack_num_objects(stack); + + STACK_PUSH(stack, voidptr, node); + STACK_PUSH(stack, int, ADDTAGS_UNION_RECURSE); + + while (tre_stack_num_objects(stack) > last) + { + symbol = (tre_addtags_symbol_t)tre_stack_pop_int(stack); + switch (symbol) + { + case ADDTAGS_UNION_RECURSE: + n = tre_stack_pop_voidptr(stack); + uni = n->obj; + left = uni->left; + + /* Since the top union has num_submatches > 0, + * we set all the consecutive union's + * make_branches to 1 to force the generation + * of end tags for each union branch. */ + n->make_branches = 1; + + STACK_PUSH(stack, voidptr, n); + STACK_PUSH(stack, int, + ADDTAGS_UNION_RIGHT_RECURSE); + + if (left->type == UNION) + { + STACK_PUSH(stack, voidptr, left); + STACK_PUSH(stack, int, + ADDTAGS_UNION_RECURSE); + } + else + { + DPRINT((" ADDTAGS_UNION_RECURSE " + "num_tags++ tag=%d\n", tag)); + uni->left_tag = tag; + tag = next_tag; + num_tags++; + next_tag++; + } + break; + + case ADDTAGS_UNION_RIGHT_RECURSE: + n = tre_stack_pop_voidptr(stack); + uni = n->obj; + right = uni->right; + + if (right->type == UNION) + { + STACK_PUSH(stack, voidptr, right); + STACK_PUSH(stack, int, + ADDTAGS_UNION_RECURSE); + } + else + { + DPRINT((" ADDTAGS_UNION_RIGHT_RECURSE " + "num_tags++ tag=%d\n", tag)); + uni->right_tag = tag; + tag = next_tag; + num_tags++; + next_tag++; + } + + break; + + default: + assert(0); + break; + + } /* end switch(symbol) */ + } /* end while(tre_stack_num_objects(stack) > last */ + if (!first_pass) + { + STACK_PUSHX(stack, int, front_tag); + STACK_PUSHX(stack, voidptr, node); + STACK_PUSHX(stack, int, ADDTAGS_AFTER_UNION_TOP); + } + } /* end if (top_union && ...) */ + + uni = node->obj; + left = uni->left; + right = uni->right; + + /* After processing right child. */ + STACK_PUSHX(stack, voidptr, regset); + STACK_PUSHX(stack, int, regset_contains != 0); + STACK_PUSHX(stack, voidptr, node); + STACK_PUSHX(stack, int, ADDTAGS_AFTER_UNION_RIGHT); + + /* Process right child. */ + STACK_PUSHX(stack, voidptr, right); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE_NOT_TOP_UNION); + + /* After processing left child. */ + STACK_PUSHX(stack, int, ADDTAGS_AFTER_UNION_LEFT); + + /* Process left child. */ + STACK_PUSHX(stack, voidptr, left); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE_NOT_TOP_UNION); + + /* Regset is not empty, so add a tag here. */ + if (regset_contains) + { + if (!first_pass) + { + status = tre_merge_branches(mem, node, NULL, front_tag, + tnfa->num_tags); + if (status != REG_OK) + break; + status = tre_add_tag_left(mem, node, front_tag); + if (status != REG_OK) + break; + if (regset_contains == REGSET_HAS_STARTS) + tnfa->tag_directions[front_tag] = TRE_TAG_LEFT_MAXIMIZE; + else + tnfa->tag_directions[front_tag] = direction; + DPRINT(("Setting t%d direction to %s\n", front_tag, + tag_dir_str[tnfa->tag_directions[front_tag]])); + tre_purge_regset(regset, tnfa, front_tag); + } + + regset[0] = REGSET_UNSET; + regset_contains = 0; + } + + break; + } + } /* end switch (node->type) */ + + break; /* end case: ADDTAGS_RECURSE */ + + case ADDTAGS_AFTER_ITERATION: + { + tre_iteration_t *iter; + tre_ast_node_t *orig; + int enter_tag; + + node = tre_stack_pop_voidptr(stack); + orig = node->original ? node->original : node; + iter = (tre_iteration_t *)orig->obj; + enter_tag = tre_stack_pop_int(stack); + if (iter->minimal) + minimal_tag = enter_tag; + + DPRINT(("After iteration\n")); + if (first_pass) + { + node->num_tags = iter->arg->num_tags + tre_stack_pop_int(stack); + DPRINT((" ADDTAGS_AFTER_ITERATION: node->num_tags = %d\n", + node->num_tags)); + } + else + { + /* node->last_matched_branch will have the start tag (the tag + just *before* the iteration). iter->arg->last_matched_branch + will have the tag(s) inside the iteration, the ones that + may need to be reset if the iteration doesn't match. So + before we merge iter->arg into node, we need to set up + a new tre_last_matched_t and tre_last_matched_branch_t, + using any of the inside tags as cmp_tag (we choose the first + tag found by bit_ffs). If there are no inside tags, we + don't bother creating the extra structures. */ + tre_last_matched_branch_pre_t *b = + iter->arg->last_matched_branch; + + if (b && b->n_tags > 0) + { + tre_last_matched_pre_t *u; + + bit_ffs(b->tags, num_tags, &b->cmp_tag); + DPRINT((" ADDTAGS_AFTER_ITERATION: n_tags=%d " + "cmp_tag = %d\n", b->n_tags, b->cmp_tag)); + + u = tre_mem_calloc(mem, sizeof(tre_last_matched_pre_t) + + sizeof(tre_last_matched_branch_pre_t) + + bitstr_size(tnfa->num_tags)); + if (!u) + { + status = REG_ESPACE; + break; + } + u->branches = b; + u->n_branches = 1; + u->start_tag = b->cmp_tag; + u->tot_branches = b->tot_branches; + u->tot_last_matched = 1 + b->tot_last_matched; + u->tot_tags = b->tot_tags; + + b = (tre_last_matched_branch_pre_t *)(u + 1); + b->last_matched = u; + b->n_last_matched = 1; + b->tot_branches = 1 + u->tot_branches; + b->tot_last_matched = u->tot_last_matched; + b->tot_tags = u->tot_tags; + + iter->arg->last_matched_branch = b; + } + status = tre_merge_branches(mem, node, iter->arg, 0, + tnfa->num_tags); + if (status != REG_OK) + break; + + if (iter->minimal) + { + /* Add a union with a left EMPTY literal and the right + being iter->arg. This should force the tags inside + the minimal iteration to prefer being unset */ + if (iter->min == 0 && iter->max <= 1) + { + tre_ast_node_t *u, *e; + + e = tre_ast_new_literal(mem, EMPTY, -1, -1); + if (e == NULL) + { + status = REG_ESPACE; + break; + } + u = tre_ast_new_union(mem, e, iter->arg); + if (u == NULL) + { + status = REG_ESPACE; + break; + } + iter->arg = u; + } + + direction = TRE_TAG_MINIMIZE; + } + else + direction = TRE_TAG_MAXIMIZE; + DPRINT((" Setting direction to %s\n", tag_dir_str[direction])); + } + break; + } + + case ADDTAGS_AFTER_CAT_LEFT: + { + int new_tag = tre_stack_pop_int(stack); + next_tag = tre_stack_pop_int(stack); + DPRINT(("After cat left, tag = %d, next_tag = %d\n", + tag, next_tag)); + if (new_tag >= 0) + { + DPRINT((" Setting tag to %d\n", new_tag)); + tag = new_tag; + } + break; + } + + case ADDTAGS_AFTER_CAT_RIGHT: + { + tre_catenation_t *cat; + + DPRINT(("After cat right\n")); + node = tre_stack_pop_voidptr(stack); + cat = node->obj; + if (first_pass) + { + node->num_tags = cat->left->num_tags + cat->right->num_tags; + DPRINT((" ADDTAGS_AFTER_CAT_RIGHT: node->num_tags = %d\n", + node->num_tags)); + } + else + { + status = tre_merge_branches(mem, cat->left, cat->right, 0, + tnfa->num_tags); + if (status != REG_OK) + break; + status = tre_merge_branches(mem, node, cat->left, 0, + tnfa->num_tags); + } + break; + } + + case ADDTAGS_AFTER_UNION_LEFT: + DPRINT(("After union left\n")); + /* Lift the bottom of the `regset' array so that when processing + the right operand the items currently in the array are + invisible. The original bottom was saved at ADDTAGS_UNION and + will be restored at ADDTAGS_AFTER_UNION_RIGHT below. */ + while (*regset != REGSET_UNSET) + regset++; + regset_contains = 0; + break; + + case ADDTAGS_AFTER_UNION_RIGHT: + { + int added_tags; + tre_ast_node_t *orig; + tre_union_t *uni; + /* Note: node may not be a UNION, but a CATENATION with a left + * tag. So that is why we pass the original node->obj on the + * stack, to get the union's true values. */ + + DPRINT(("After union right\n")); + node = tre_stack_pop_voidptr(stack); + orig = node->original ? node->original : node; + uni = (tre_union_t *)orig->obj; + added_tags = tre_stack_pop_int(stack); + if (first_pass) + { + node->num_tags = uni->left->num_tags + uni->right->num_tags + + added_tags; + if (uni->left_tag > 0) + node->num_tags++; + if (uni->right_tag > 0) + node->num_tags++; + DPRINT((" ADDTAGS_AFTER_UNION_RIGHT: node->num_tags = %d\n", + node->num_tags)); + } + regset = tre_stack_pop_voidptr(stack); + + /* Add tags after both children, the left child gets a smaller + tag than the right child. This guarantees that we prefer + the left child over the right child. */ + /* XXX - This is not always necessary (if the children have + tags which must be seen for every match of that child). */ + if (!first_pass && node->make_branches) + { + tre_last_matched_branch_pre_t *lb = + uni->left->last_matched_branch; + tre_last_matched_branch_pre_t *rb = + uni->right->last_matched_branch; + tre_last_matched_pre_t *lu = + uni->left->last_matched_in_progress; + tre_last_matched_pre_t *ru = + uni->right->last_matched_in_progress; + tre_last_matched_pre_t *u; + /* We don't need to call tre_merge_branches because these + * tags don't participate in submatch ranges, so don't need + * to be recorded. But we do set the cmp_tag entry of the + * tre_last_matched_branch_pre_t, so we might call + * tre_merge_branches if we need to create an empty + * tre_last_matched_branch_pre_t. */ + if (uni->left_tag > 0) + { + DPRINT(("Setting t%d direction to maximize\n", + uni->left_tag)); + status = tre_add_tag_right(mem, uni->left, uni->left_tag); + if (status != REG_OK) + break; + tnfa->tag_directions[uni->left_tag] = TRE_TAG_MAXIMIZE; + if (!lb) + { + status = tre_merge_branches(mem, uni->left, NULL, -1, + tnfa->num_tags); + if (status != REG_OK) + break; + lb = uni->left->last_matched_branch; + } + lb->cmp_tag = uni->left_tag; + } + if (uni->right_tag > 0) + { + DPRINT(("Setting t%d direction to maximize\n", + uni->right_tag)); + status = tre_add_tag_right(mem, uni->right, uni->right_tag); + if (status != REG_OK) + break; + tnfa->tag_directions[uni->right_tag] = TRE_TAG_MAXIMIZE; + if (!rb) + { + status = tre_merge_branches(mem, uni->right, NULL, -1, + tnfa->num_tags); + if (status != REG_OK) + break; + rb = uni->right->last_matched_branch; + } + rb->cmp_tag = uni->right_tag; + } + /* Now merge the tre_last_matched_branch_pre_t into a + tre_last_matched_pre_t */ + if (lu == NULL) + { + if (ru == NULL) + { + /* Create a new tre_last_matched_pre_t */ + u = tre_mem_calloc(mem, sizeof(tre_last_matched_pre_t)); + if (!u) + { + status = REG_ESPACE; + break; + } + u->tot_last_matched = 1; + + if (lb) + { + u->branches = lb; + u->n_branches = 1; + u->tot_branches += lb->tot_branches; + u->tot_last_matched += lb->tot_last_matched; + u->tot_tags += lb->tot_tags; + if (rb) + { + lb->next = rb; + u->n_branches++; + u->tot_branches += rb->tot_branches; + u->tot_last_matched += rb->tot_last_matched; + u->tot_tags += rb->tot_tags; + } + } + else if (rb) + { + u->branches = rb; + u->n_branches = 1; + u->tot_branches += rb->tot_branches; + u->tot_last_matched += rb->tot_last_matched; + u->tot_tags += rb->tot_tags; + } + } + else + { + /* Use ru, and add lb */ + u = ru; + if (lb) + { + lb->next = u->branches; + u->branches = lb; + u->n_branches++; + u->tot_branches += lb->tot_branches; + u->tot_last_matched += lb->tot_last_matched; + u->tot_tags += lb->tot_tags; + } + } + } + else if (ru == NULL) + { + /* Use lu, and add rb */ + u = lu; + if (rb) + { + rb->next = u->branches; + u->branches = rb; + u->n_branches++; + u->tot_branches += rb->tot_branches; + u->tot_last_matched += rb->tot_last_matched; + u->tot_tags += rb->tot_tags; + } + } + else + { + /* Merge lu and ru into lu */ + if (lu->branches) + { + if (ru->branches) + { + tre_last_matched_branch_pre_t *b = lu->branches; + while (b->next) b = b->next; + b->next = ru->branches; + lu->n_branches += ru->n_branches; + } + } + else if (ru->branches) + { + lu->branches = ru->branches; + lu->n_branches = ru->n_branches; + } + lu->tot_branches += ru->tot_branches; + lu->tot_last_matched += ru->tot_last_matched - 1; + lu->tot_tags += ru->tot_tags; + u = lu; + } + node->last_matched_in_progress = u; + } + direction = TRE_TAG_MAXIMIZE; + break; + } + + case ADDTAGS_AFTER_UNION_TOP: /* only called when not first_pass */ + { + tre_last_matched_branch_pre_t *b; + tre_last_matched_pre_t *u; + int start_tag; + + DPRINT(("After union top\n")); + node = tre_stack_pop_voidptr(stack); + start_tag = tre_stack_pop_int(stack); + b = tre_mem_calloc(mem, sizeof(tre_last_matched_branch_pre_t) + + bitstr_size(tnfa->num_tags)); + if (!b) + { + status = REG_ESPACE; + break; + } + + u = node->last_matched_in_progress; + u->start_tag = start_tag; + b->tot_branches = 1 + u->tot_branches; + b->tot_last_matched = u->tot_last_matched; + b->tot_tags = u->tot_tags; + b->last_matched = u; + b->n_last_matched = 1; + node->last_matched_branch = b; + node->last_matched_in_progress = NULL; + break; + } + + default: + assert(0); + break; + + } /* end switch(symbol) */ + } /* end while(tre_stack_num_objects(stack) > bottom) */ + + if (status != REG_OK) + { + DPRINT(("Error during %s pass\n", first_pass ? "first" : "second")); + goto error_post_compile; + } + + if (!first_pass) + { + int i; + if (num_tags != tnfa->num_tags) + { + DPRINT(("num_tags(%d) != tnfa->num_tags(%d)\n", num_tags, + tnfa->num_tags)); + status = REG_BADPAT; + goto error_post_compile; + } + + tre_purge_regset(regset, tnfa, tag); + DPRINT(("Setting t%d to %s\n", num_tags, + tag_dir_str[direction])); + tnfa->tag_directions[num_tags] = direction; + + if (rtp > reorder_tags + 2 * tnfa->num_reorder_tags) + { + DPRINT(("Processed %d reorder tags instead of %d\n", + (int)(rtp - reorder_tags) / 2, tnfa->num_reorder_tags)); + status = REG_BADPAT; + goto error_post_compile; + } + *rtp = -1; +#if TRE_DEBUG + if (reorder_tags[0] >= 0) + { + DPRINT(("reorder_tags:\n")); + for (rtp = reorder_tags; *rtp >= 0;) + { + DPRINT(("%d after ", *rtp++)); + DPRINT(("%d\n", *rtp++)); + } + } + else + DPRINT(("No reorder_tags\n")); +#endif /* TRE_DEBUG */ + + /* Initialize to_reorder */ + for (i = 0; i < num_tags; i++) + to_reorder[i] = i; + /* Use to_seq_order to convert reorder_tags values, and use those to + * reorder to_reorder */ + for (rtp = reorder_tags; *rtp >= 0;) + { + int j, high, low; + int ti = *rtp++; + + /* Skip reordering the final tag */ + if (ti >= num_tags) + { + DPRINT(("Skipping reorder of %d\n", ti)); + rtp++; + continue; + } + /* The number of the tag to reorder */ + high = to_reorder[ti]; + /* Reorder after this tag */ + low = to_reorder[*rtp++]; + + DPRINT(("ti=%d high=%d low=%d\n", ti, high, low)); + if (low > high) + { + DPRINT(("Tag %d already before %d\n", high, low)); + continue; + } + for (j = 0; j < num_tags; j++) + if (to_reorder[j] > low && to_reorder[j] < high) + to_reorder[j]++; + to_reorder[ti] = low + 1; +#ifdef TRE_DEBUG + DPRINT(("to_reorder=(")); + for (j = 0; j < num_tags; j++) + { + DPRINT(("%d", to_reorder[j])); + if (j < num_tags - 1) + DPRINT((",")); + } + DPRINT((")\n")); +#endif /* TRE_DEBUG */ + } + /* Determine if reordering in really necessary */ + { + int need_reorder = 0; + for (i = 0; i < num_tags; i++) + if(to_reorder[i] != i) + { + need_reorder = 1; + break; + } + /* If need_reorder is not set, free reorder_tags, and set to NULL, + * indicating no reordering is needed */ + if (!need_reorder) + { + DPRINT(("Don't need to reorder\n")); + xfree(reorder_tags); + reorder_tags = NULL; + } + } + } + + if (reorder_tags) + { + int i; + tre_tag_direction_t *new_tag_directions; +#if TRE_DEBUG + DPRINT(("to_reorder:")); + for (i = 0; i < num_tags; i++) + DPRINT((" %d->%d", i, to_reorder[i])); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + + DPRINT(("Reordering submatch_data\n")); + for (i = 0; i < (int)tnfa->num_submatches; i++) + { +#if TRE_DEBUG + int so = tnfa->submatch_data[i].so_tag; + int eo = tnfa->submatch_data[i].eo_tag; +#endif /* TRE_DEBUG */ + tnfa->submatch_data[i].so_tag = + to_reorder[tnfa->submatch_data[i].so_tag]; + tnfa->submatch_data[i].eo_tag = + tnfa->submatch_data[i].eo_tag < num_tags ? + to_reorder[tnfa->submatch_data[i].eo_tag] : + tnfa->submatch_data[i].eo_tag; + DPRINT(("pmatch[%d]: {%d, %d}->{%d, %d}\n", i, so, eo, + tnfa->submatch_data[i].so_tag, + tnfa->submatch_data[i].eo_tag)); + } + + DPRINT(("Reordering tag_directions\n")); + /* We only allocate num_tags directions and reorder them. The + * num_tags-th direction (end tag) is left unchanged. */ + new_tag_directions = xmalloc(sizeof(*new_tag_directions) * num_tags); + if (new_tag_directions == NULL) + { + status = REG_ESPACE; + goto error_post_compile; + } + for (i = 0; i < num_tags; i++) + { + new_tag_directions[to_reorder[i]] = tnfa->tag_directions[i]; + } +#if TRE_DEBUG + for (i = 0; i < num_tags; i++) + { + DPRINT(("t%d %s->%s\n", i, + tag_dir_str[tnfa->tag_directions[i]], + tag_dir_str[new_tag_directions[i]])); + } + DPRINT(("t%d %s->%s\n", num_tags, + tag_dir_str[tnfa->tag_directions[num_tags]], + tag_dir_str[tnfa->tag_directions[num_tags]])); +#endif /* TRE_DEBUG */ + memcpy(tnfa->tag_directions, new_tag_directions, sizeof(*new_tag_directions) * num_tags); + xfree(new_tag_directions); + + DPRINT(("Reordering minimal_tags\n")); + for (i = 0; tnfa->minimal_tags[i] >= 0; i++) + tnfa->minimal_tags[i] = tnfa->minimal_tags[i] < num_tags ? + to_reorder[tnfa->minimal_tags[i]] : + tnfa->minimal_tags[i]; + + DPRINT(("Reordering AST tags\n")); + STACK_PUSH(stack, voidptr, tree); + while (status == REG_OK && tre_stack_num_objects(stack) > bottom) + { + node = tre_stack_pop_voidptr(stack); + + switch (node->type) + { + case LITERAL: + { + tre_literal_t *lit = (tre_literal_t *)node->obj; + if (IS_TAG(lit)) + lit->code_max = to_reorder[lit->code_max]; + break; + } + + case UNION: + { + tre_union_t *uni = (tre_union_t *)node->obj; + STACK_PUSHX(stack, voidptr, uni->right); + STACK_PUSHX(stack, voidptr, uni->left); + break; + } + + case CATENATION: + { + tre_catenation_t *cat = (tre_catenation_t *)node->obj; + STACK_PUSHX(stack, voidptr, cat->right); + STACK_PUSHX(stack, voidptr, cat->left); + break; + } + + case ITERATION: + { + tre_iteration_t *iter = (tre_iteration_t *)node->obj; + STACK_PUSHX(stack, voidptr, iter->arg); + break; + } + + default: + assert(0); + break; + } + } + if (status != REG_OK) + { + DPRINT(("Error while reordering tags\n")); + goto error_post_compile; + } + } + + + if (!first_pass) + { + if (tree->last_matched_branch) + { + tre_last_matched_branch_t *buf, *b, *bb; + tre_last_matched_branch_pre_t *bp; + tre_last_matched_t *u, *uu; + tre_last_matched_pre_t *up; + int *t; + int i; +#ifdef TRE_DEBUG + tre_last_matched_branch_t *_b; + tre_last_matched_t *_u; + int *_t; + + DPRINT(("last_match_branch_pre:\n")); + print_last_match_branch_pre(tree->last_matched_branch, 0, num_tags); +#endif /* TRE_DEBUG */ + buf = (tre_last_matched_branch_t *)xcalloc(1, + tree->last_matched_branch->tot_branches + * sizeof(tre_last_matched_branch_t) + + tree->last_matched_branch->tot_last_matched + * sizeof(tre_last_matched_t) + + tree->last_matched_branch->tot_tags * + sizeof(int)); + if (!buf) + { + status = REG_ESPACE; + goto error_post_compile; + } + + b = buf; + u = (tre_last_matched_t *)(b + + tree->last_matched_branch->tot_branches); + t = (int *)(u + tree->last_matched_branch->tot_last_matched); +#ifdef TRE_DEBUG + _b = b; + _u = u; + _t = t; +#endif /* TRE_DEBUG */ + DPRINT(("Copying info_pre to info\n")); + STACK_PUSH(stack, voidptr, tree->last_matched_branch); + STACK_PUSH(stack, int, 1); + STACK_PUSH(stack, int, COPY_LAST_MATCHED_BRANCH); + + while (status == REG_OK && tre_stack_num_objects(stack) > bottom) + { + switch (tre_stack_pop_int(stack)) + { + case COPY_LAST_MATCHED_BRANCH: + i = tre_stack_pop_int(stack); + /* The tre_last_matched_branch_pre_t * is still on the + stack */ + STACK_PUSHX(stack, voidptr, b); + STACK_PUSHX(stack, int, COPY_LAST_MATCHED_BRANCH_NEXT); + b += i; + break; + + case COPY_LAST_MATCHED_BRANCH_NEXT: + bb = tre_stack_pop_voidptr(stack); + bp = tre_stack_pop_voidptr(stack); + bb->n_last_matched = bp->n_last_matched; + bb->cmp_tag = bp->cmp_tag; + if (bp->n_tags > 0) + { + int n; + n = bb->n_tags = bp->n_tags; + bb->tags = t; + for (i = 0; i < num_tags; i++) + if (bit_test(bp->tags, i)) + { + *t++ = i; + if (--n <= 0) + break; + } + } + if (bp->next) + { + STACK_PUSHX(stack, voidptr, bp->next); + STACK_PUSHX(stack, voidptr, bb + 1); + STACK_PUSHX(stack, int, COPY_LAST_MATCHED_BRANCH_NEXT); + } + if (bp->n_last_matched > 0) + { + bb->last_matched = u; + STACK_PUSHX(stack, voidptr, bp->last_matched); + STACK_PUSHX(stack, int, bp->n_last_matched); + STACK_PUSHX(stack, int, COPY_LAST_MATCHED); + } + break; + + case COPY_LAST_MATCHED: + i = tre_stack_pop_int(stack); + /* The tre_last_matched_pre_t * is still on the stack */ + STACK_PUSHX(stack, voidptr, u); + STACK_PUSHX(stack, int, COPY_LAST_MATCHED_NEXT); + u += i; + break; + + case COPY_LAST_MATCHED_NEXT: + uu = tre_stack_pop_voidptr(stack); + up = tre_stack_pop_voidptr(stack); + uu->n_branches = up->n_branches; + uu->branches = b; + uu->start_tag = up->start_tag; + if (up->next) + { + STACK_PUSHX(stack, voidptr, up->next); + STACK_PUSHX(stack, voidptr, uu + 1); + STACK_PUSHX(stack, int, COPY_LAST_MATCHED_NEXT); + } + STACK_PUSHX(stack, voidptr, up->branches); + STACK_PUSHX(stack, int, up->n_branches); + STACK_PUSHX(stack, int, COPY_LAST_MATCHED_BRANCH); + break; + } + } + if (status != REG_OK) + goto error_post_compile; +#ifdef TRE_DEBUG + DPRINT(("last_matched_branch:\n")); + print_last_match_branch(buf, 0); + if (b != _b + tree->last_matched_branch->tot_branches) + DPRINT(("b/%p != _b + tree->last_matched_branch->tot_branches/%p\n", + b, _b + tree->last_matched_branch->tot_branches)); + if (u != _u + tree->last_matched_branch->tot_last_matched) + DPRINT(("u/%p != _u + " + "tree->last_matched_branch->tot_last_matched/%p\n", + u, _u + tree->last_matched_branch->tot_last_matched)); + if (t != _t + tree->last_matched_branch->tot_tags) + DPRINT(("t/%p != _t + tree->last_matched_branch->tot_tags/%p\n", + t, _t + tree->last_matched_branch->tot_tags)); +#endif /* TRE_DEBUG */ + tnfa->last_matched_branch = buf; + } +#ifdef TRE_DEBUG + else + DPRINT(("No last_match_branch_pre\n")); +#endif /* TRE_DEBUG */ + } + + DPRINT(("tre_add_tags: %s complete. Number of tags %d.\n", + first_pass? "First pass" : "Second pass", num_tags)); +#ifdef TRE_DEBUG + tre_ast_print(tree); +#endif /* TRE_DEBUG */ + DPRINT(("tre_add_tags: tree->num_tags=%d num_tags=%d\n", tree->num_tags, + num_tags)); + assert(tree->num_tags == num_tags); + tnfa->end_tag = num_tags; + tnfa->num_tags = num_tags; + tnfa->num_minimals = num_minimals; +error_post_compile: + xfree(reorder_tags); +error_reorder_tags: + xfree(orig_regset); +error_regset: + return status; +} + + + +/* + AST to TNFA compilation routines. +*/ + +typedef enum { + COPY_RECURSE, + COPY_SET_RESULT_PTR +} tre_copyast_symbol_t; + +/* Flags for tre_copy_ast(). */ +#define COPY_REMOVE_TAGS 1 +#define COPY_MAXIMIZE_FIRST_TAG 2 + +static reg_errcode_t +tre_copy_ast(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *ast, + int flags, int *pos_add, tre_tag_direction_t *tag_directions, + tre_ast_node_t **copy, int *max_pos) +{ + reg_errcode_t status = REG_OK; + int bottom = tre_stack_num_objects(stack); + int num_copied = 0; + int first_tag = 1; + tre_ast_node_t **result = copy; + tre_copyast_symbol_t symbol; + + STACK_PUSH(stack, voidptr, ast); + STACK_PUSH(stack, int, COPY_RECURSE); + + while (status == REG_OK && tre_stack_num_objects(stack) > bottom) + { + tre_ast_node_t *node; + if (status != REG_OK) + break; + + symbol = (tre_copyast_symbol_t)tre_stack_pop_int(stack); + switch (symbol) + { + case COPY_SET_RESULT_PTR: + result = tre_stack_pop_voidptr(stack); + break; + case COPY_RECURSE: + node = tre_stack_pop_voidptr(stack); + switch (node->type) + { + case LITERAL: + { + tre_literal_t *lit = node->obj; + int pos = lit->position; + int min = lit->code_min; + int max = lit->code_max; + tre_bracket_match_list_t *list = !IS_SPECIAL(lit) ? + lit->u.bracket_match_list : + NULL; + if (!IS_SPECIAL(lit) || IS_BACKREF(lit)) + { + /* XXX - e.g. [ab] has only one position but two + nodes, so we are creating holes in the state space + here. Not fatal, just wastes memory. */ + pos += *pos_add; + num_copied++; + } + else if (IS_TAG(lit) && (flags & COPY_REMOVE_TAGS)) + { + /* Change this tag to empty. */ + min = EMPTY; + max = pos = -1; + } + else if (IS_TAG(lit) && (flags & COPY_MAXIMIZE_FIRST_TAG) + && first_tag) + { + /* Maximize the first tag. */ + if (tag_directions[max] == TRE_TAG_LEFT_MAXIMIZE) + tag_directions[max] = TRE_TAG_MAXIMIZE; + first_tag = 0; + } + *result = tre_ast_new_literal(mem, min, max, pos); + if (*result == NULL) + status = REG_ESPACE; + + if (pos > *max_pos) + *max_pos = pos; + + if (!IS_SPECIAL(lit)) + ((tre_literal_t *)(*result)->obj)->u.bracket_match_list + = list; + break; + } + case UNION: + { + tre_union_t *uni = node->obj; + tre_union_t *tmp; + *result = tre_ast_new_union(mem, uni->left, uni->right); + if (*result == NULL) + { + status = REG_ESPACE; + break; + } + tmp = (*result)->obj; + result = &tmp->left; + STACK_PUSHX(stack, voidptr, uni->right); + STACK_PUSHX(stack, int, COPY_RECURSE); + STACK_PUSHX(stack, voidptr, &tmp->right); + STACK_PUSHX(stack, int, COPY_SET_RESULT_PTR); + STACK_PUSHX(stack, voidptr, uni->left); + STACK_PUSHX(stack, int, COPY_RECURSE); + break; + } + case CATENATION: + { + tre_catenation_t *cat = node->obj; + tre_catenation_t *tmp; + *result = tre_ast_new_catenation(mem, cat->left, cat->right); + if (*result == NULL) + { + status = REG_ESPACE; + break; + } + tmp = (*result)->obj; + tmp->left = NULL; + tmp->right = NULL; + result = &tmp->left; + + STACK_PUSHX(stack, voidptr, cat->right); + STACK_PUSHX(stack, int, COPY_RECURSE); + STACK_PUSHX(stack, voidptr, &tmp->right); + STACK_PUSHX(stack, int, COPY_SET_RESULT_PTR); + STACK_PUSHX(stack, voidptr, cat->left); + STACK_PUSHX(stack, int, COPY_RECURSE); + break; + } + case ITERATION: + { + tre_iteration_t *iter = node->obj; + STACK_PUSHX(stack, voidptr, iter->arg); + STACK_PUSHX(stack, int, COPY_RECURSE); + *result = tre_ast_new_iter(mem, iter->arg, iter->min, + iter->max, iter->minimal); + if (*result == NULL) + { + status = REG_ESPACE; + break; + } + iter = (*result)->obj; + result = &iter->arg; + break; + } + default: + assert(0); + break; + } + break; + } + } + *pos_add += num_copied; + return status; +} + +typedef enum { + EXPAND_RECURSE, + EXPAND_AFTER_ITER +} tre_expand_ast_symbol_t; + +/* Expands each iteration node that has a finite nonzero minimum or maximum + iteration count to a catenated sequence of copies of the node. */ +static reg_errcode_t +tre_expand_ast(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *ast, + int *position, tre_tag_direction_t *tag_directions, + int __unused *max_depth) +{ + reg_errcode_t status = REG_OK; + int bottom = tre_stack_num_objects(stack); + int pos_add = 0; + int pos_add_total = 0; + int max_pos = 0; +#ifdef TRE_APPROX + /* Current approximate matching parameters. */ + int params[TRE_PARAM_LAST]; + /* Approximate parameter nesting level. */ + int params_depth = 0; +#endif /* TRE_APPROX */ + int iter_depth = 0; +#ifdef TRE_APPROX + int i; +#endif /* TRE_APPROX */ + +#ifdef TRE_APPROX + for (i = 0; i < TRE_PARAM_LAST; i++) + params[i] = TRE_PARAM_DEFAULT; +#endif /* TRE_APPROX */ + + STACK_PUSHR(stack, voidptr, ast); + STACK_PUSHR(stack, int, EXPAND_RECURSE); + while (status == REG_OK && tre_stack_num_objects(stack) > bottom) + { + tre_ast_node_t *node; + tre_expand_ast_symbol_t symbol; + + if (status != REG_OK) + break; + + DPRINT(("pos_add %d\n", pos_add)); + + symbol = (tre_expand_ast_symbol_t)tre_stack_pop_int(stack); + node = tre_stack_pop_voidptr(stack); + switch (symbol) + { + case EXPAND_RECURSE: + switch (node->type) + { + case LITERAL: + { + tre_literal_t *lit= node->obj; + if (!IS_SPECIAL(lit) || IS_BACKREF(lit)) + { + lit->position += pos_add; + if (lit->position > max_pos) + max_pos = lit->position; + } + break; + } + case UNION: + { + tre_union_t *uni = node->obj; + STACK_PUSHX(stack, voidptr, uni->right); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + STACK_PUSHX(stack, voidptr, uni->left); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + break; + } + case CATENATION: + { + tre_catenation_t *cat = node->obj; + STACK_PUSHX(stack, voidptr, cat->right); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + STACK_PUSHX(stack, voidptr, cat->left); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + break; + } + case ITERATION: + { + tre_iteration_t *iter = node->obj; + STACK_PUSHX(stack, int, pos_add); + STACK_PUSHX(stack, voidptr, node); + STACK_PUSHX(stack, int, EXPAND_AFTER_ITER); + STACK_PUSHX(stack, voidptr, iter->arg); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + /* If we are going to expand this node at EXPAND_AFTER_ITER + then don't increase the `pos' fields of the nodes now, it + will get done when expanding. */ + if (iter->min > 1 || iter->max > 1) + pos_add = 0; + iter_depth++; + DPRINT(("iter\n")); + break; + } + default: + assert(0); + break; + } + break; + case EXPAND_AFTER_ITER: + { + tre_iteration_t *iter = node->obj; + int pos_add_last; + pos_add = tre_stack_pop_int(stack); + pos_add_last = pos_add; + /* Originally (in tre_parse_bound), if min == 0 && max == 0, we + immediate replace the whole iteration with EMPTY. This + unfortunately drops any submatches, and messes up setting the + pmatch values (we can get tags of -1, and tag values in the + billions). So we left it there and replace with EMPTY here. */ + if (iter->min == 0 && iter->max == 0) + { + tre_ast_node_t *empty = tre_ast_new_literal(mem, EMPTY, -1, -1); + if (empty == NULL) + return REG_ESPACE; + node->obj = empty->obj; + node->type = empty->type; + } + else if (iter->min > 1 || iter->max > 1) + { + tre_ast_node_t *seq1 = NULL, *seq2 = NULL; + int j; + int pos_add_save = pos_add; + + /* Create a catenated sequence of copies of the node. */ + for (j = 0; j < iter->min; j++) + { + tre_ast_node_t *copy; + /* Remove tags from all but the last copy. */ + int flags = ((j + 1 < iter->min) + ? COPY_REMOVE_TAGS + : COPY_MAXIMIZE_FIRST_TAG); + DPRINT((" pos_add %d\n", pos_add)); + pos_add_save = pos_add; + status = tre_copy_ast(mem, stack, iter->arg, flags, + &pos_add, tag_directions, ©, + &max_pos); + if (status != REG_OK) + return status; + if (seq1 != NULL) + seq1 = tre_ast_new_catenation(mem, seq1, copy); + else + seq1 = copy; + if (seq1 == NULL) + return REG_ESPACE; + } + + if (iter->max == -1) + { + /* No upper limit. */ + pos_add_save = pos_add; + status = tre_copy_ast(mem, stack, iter->arg, 0, + &pos_add, NULL, &seq2, &max_pos); + if (status != REG_OK) + return status; + seq2 = tre_ast_new_iter(mem, seq2, 0, -1, 0); + if (seq2 == NULL) + return REG_ESPACE; + } + else + { + for (j = iter->min; j < iter->max; j++) + { + tre_ast_node_t *tmp, *copy; + pos_add_save = pos_add; + status = tre_copy_ast(mem, stack, iter->arg, 0, + &pos_add, NULL, ©, &max_pos); + if (status != REG_OK) + return status; + if (seq2 != NULL) + seq2 = tre_ast_new_catenation(mem, copy, seq2); + else + seq2 = copy; + if (seq2 == NULL) + return REG_ESPACE; + tmp = tre_ast_new_literal(mem, EMPTY, -1, -1); + if (tmp == NULL) + return REG_ESPACE; + seq2 = tre_ast_new_union(mem, tmp, seq2); + if (seq2 == NULL) + return REG_ESPACE; + } + } + + pos_add = pos_add_save; + if (seq1 == NULL) + seq1 = seq2; + else if (seq2 != NULL) + seq1 = tre_ast_new_catenation(mem, seq1, seq2); + if (seq1 == NULL) + return REG_ESPACE; + node->obj = seq1->obj; + node->type = seq1->type; + } + + iter_depth--; + pos_add_total += pos_add - pos_add_last; + if (iter_depth == 0) + pos_add = pos_add_total; + +#ifdef TRE_APPROX + /* If approximate parameters are specified, surround the result + with two parameter setting nodes. The one on the left sets + the specified parameters, and the one on the right restores + the old parameters. */ + if (iter->params) + { + tre_ast_node_t *tmp_l, *tmp_r, *tmp_node, *node_copy; + int *old_params; + + tmp_l = tre_ast_new_literal(mem, PARAMETER, 0, -1); + if (!tmp_l) + return REG_ESPACE; + ((tre_literal_t *)tmp_l->obj)->u.params = iter->params; + iter->params[TRE_PARAM_DEPTH] = params_depth + 1; + tmp_r = tre_ast_new_literal(mem, PARAMETER, 0, -1); + if (!tmp_r) + return REG_ESPACE; + old_params = tre_mem_alloc(mem, sizeof(*old_params) + * TRE_PARAM_LAST); + if (!old_params) + return REG_ESPACE; + for (i = 0; i < TRE_PARAM_LAST; i++) + old_params[i] = params[i]; + ((tre_literal_t *)tmp_r->obj)->u.params = old_params; + old_params[TRE_PARAM_DEPTH] = params_depth; + /* XXX - this is the only place where ast_new_node is + needed -- should be moved inside AST module. */ + node_copy = tre_ast_new_node(mem, ITERATION, + sizeof(tre_iteration_t)); + if (!node_copy) + return REG_ESPACE; + node_copy->obj = node->obj; + tmp_node = tre_ast_new_catenation(mem, tmp_l, node_copy); + if (!tmp_node) + return REG_ESPACE; + tmp_node = tre_ast_new_catenation(mem, tmp_node, tmp_r); + if (!tmp_node) + return REG_ESPACE; + /* Replace the contents of `node' with `tmp_node'. */ + memcpy(node, tmp_node, sizeof(*node)); + node->obj = tmp_node->obj; + node->type = tmp_node->type; + params_depth++; + if (params_depth > *max_depth) + *max_depth = params_depth; + } +#endif /* TRE_APPROX */ + break; + } + default: + assert(0); + break; + } + } + + *position += pos_add_total; + + /* `max_pos' should never be larger than `*position' if the above + code works, but just an extra safeguard let's make sure + `*position' is set large enough so enough memory will be + allocated for the transition table. */ + if (max_pos > *position) + *position = max_pos; + +#ifdef TRE_DEBUG + DPRINT(("Expanded AST:\n")); + tre_ast_print(ast); + DPRINT(("*position %d, max_pos %d\n", *position, max_pos)); +#endif + + return status; +} + +static tre_pos_and_tags_t * +tre_set_empty(tre_mem_t mem) +{ + tre_pos_and_tags_t *new_set; + + new_set = tre_mem_calloc(mem, sizeof(*new_set)); + if (new_set == NULL) + return NULL; + + new_set[0].position = -1; + new_set[0].code_min = -1; + new_set[0].code_max = -1; + + return new_set; +} + +static tre_pos_and_tags_t * +tre_set_one(tre_mem_t mem, int position, int code_min, int code_max, + tre_bracket_match_list_t *bracket_match_list, int backref) +{ + tre_pos_and_tags_t *new_set; + + new_set = tre_mem_calloc(mem, sizeof(*new_set) * 2); + if (new_set == NULL) + return NULL; + + new_set[0].position = position; + new_set[0].code_min = code_min; + new_set[0].code_max = code_max; + new_set[0].bracket_match_list = bracket_match_list; + new_set[0].backref = backref; + new_set[1].position = -1; + new_set[1].code_min = -1; + new_set[1].code_max = -1; + + return new_set; +} + +static tre_pos_and_tags_t * +tre_set_union(tre_mem_t mem, tre_pos_and_tags_t *set1, tre_pos_and_tags_t *set2, + int *tags, int assertions, int *params) +{ + int s1, s2, i, j; + tre_pos_and_tags_t *new_set; + int *new_tags; + int num_tags; + + for (num_tags = 0; tags != NULL && tags[num_tags] >= 0; num_tags++); + for (s1 = 0; set1[s1].position >= 0; s1++); + for (s2 = 0; set2[s2].position >= 0; s2++); + new_set = tre_mem_calloc(mem, sizeof(*new_set) * (s1 + s2 + 1)); + if (!new_set ) + return NULL; + + for (s1 = 0; set1[s1].position >= 0; s1++) + { + new_set[s1].position = set1[s1].position; + new_set[s1].code_min = set1[s1].code_min; + new_set[s1].code_max = set1[s1].code_max; + new_set[s1].assertions = set1[s1].assertions | assertions; + new_set[s1].bracket_match_list = set1[s1].bracket_match_list; + new_set[s1].backref = set1[s1].backref; + if (set1[s1].tags == NULL && tags == NULL) + new_set[s1].tags = NULL; + else + { + for (i = 0; set1[s1].tags != NULL && set1[s1].tags[i] >= 0; i++); + new_tags = tre_mem_alloc(mem, (sizeof(*new_tags) + * (i + num_tags + 1))); + if (new_tags == NULL) + return NULL; + for (j = 0; j < i; j++) + new_tags[j] = set1[s1].tags[j]; + for (i = 0; i < num_tags; i++) + new_tags[j + i] = tags[i]; + new_tags[j + i] = -1; + new_set[s1].tags = new_tags; + } + if (set1[s1].params) + new_set[s1].params = set1[s1].params; + if (params) + { + if (!new_set[s1].params) + new_set[s1].params = params; + else + { + new_set[s1].params = tre_mem_alloc(mem, sizeof(*params) * + TRE_PARAM_LAST); + if (!new_set[s1].params) + return NULL; + for (i = 0; i < TRE_PARAM_LAST; i++) + if (params[i] != TRE_PARAM_UNSET) + new_set[s1].params[i] = params[i]; + } + } + } + + for (s2 = 0; set2[s2].position >= 0; s2++) + { + new_set[s1 + s2].position = set2[s2].position; + new_set[s1 + s2].code_min = set2[s2].code_min; + new_set[s1 + s2].code_max = set2[s2].code_max; + /* XXX - why not | assertions here as well? */ + new_set[s1 + s2].assertions = set2[s2].assertions; + new_set[s1 + s2].bracket_match_list = set2[s2].bracket_match_list; + new_set[s1 + s2].backref = set2[s2].backref; + if (set2[s2].tags == NULL) + new_set[s1 + s2].tags = NULL; + else + { + for (i = 0; set2[s2].tags[i] >= 0; i++); + new_tags = tre_mem_alloc(mem, sizeof(*new_tags) * (i + 1)); + if (new_tags == NULL) + return NULL; + for (j = 0; j < i; j++) + new_tags[j] = set2[s2].tags[j]; + new_tags[j] = -1; + new_set[s1 + s2].tags = new_tags; + } + if (set2[s2].params) + new_set[s1 + s2].params = set2[s2].params; + if (params) + { + if (!new_set[s1 + s2].params) + new_set[s1 + s2].params = params; + else + { + new_set[s1 + s2].params = tre_mem_alloc(mem, sizeof(*params) * + TRE_PARAM_LAST); + if (!new_set[s1 + s2].params) + return NULL; + for (i = 0; i < TRE_PARAM_LAST; i++) + if (params[i] != TRE_PARAM_UNSET) + new_set[s1 + s2].params[i] = params[i]; + } + } + } + new_set[s1 + s2].position = -1; + return new_set; +} + +/* Finds the empty path through `node' which is the one that should be + taken according to POSIX.2 rules, and adds the tags on that path to + `tags'. `tags' may be NULL. If `num_tags_seen' is not NULL, it is + set to the number of tags seen on the path. */ +static reg_errcode_t +tre_match_empty(tre_stack_t *stack, tre_ast_node_t *node, int *tags, + int *assertions, int *params, int *num_tags_seen, + int *params_seen) +{ + tre_literal_t *lit; + tre_union_t *uni; + tre_catenation_t *cat; + tre_iteration_t *iter; + int i; + int bottom = tre_stack_num_objects(stack); + reg_errcode_t status = REG_OK; + if (num_tags_seen) + *num_tags_seen = 0; + if (params_seen) + *params_seen = 0; + + status = tre_stack_push_voidptr(stack, node); + + /* Walk through the tree recursively. */ + while (status == REG_OK && tre_stack_num_objects(stack) > bottom) + { + node = tre_stack_pop_voidptr(stack); + + switch (node->type) + { + case LITERAL: + lit = (tre_literal_t *)node->obj; + switch (lit->code_min) + { + case TAG: + if (lit->code_max >= 0) + { + if (tags != NULL) + { + /* Add the tag to `tags'. */ + for (i = 0; tags[i] >= 0; i++) + if (tags[i] == lit->code_max) + break; + if (tags[i] < 0) + { + tags[i] = lit->code_max; + tags[i + 1] = -1; + } + } + if (num_tags_seen) + (*num_tags_seen)++; + } + break; + case ASSERTION: + assert(lit->code_max >= 1 + || lit->code_max <= ASSERT_LAST); + if (assertions != NULL) + *assertions |= lit->code_max; + break; + case PARAMETER: + if (params != NULL) + for (i = 0; i < TRE_PARAM_LAST; i++) + params[i] = lit->u.params[i]; + if (params_seen != NULL) + *params_seen = 1; + break; + case EMPTY: + break; + default: + assert(0); + break; + } + break; + + case UNION: + /* Subexpressions starting earlier take priority over ones + starting later, so we prefer the left subexpression over the + right subexpression. */ + uni = (tre_union_t *)node->obj; + if (uni->left->nullable) + STACK_PUSHX(stack, voidptr, uni->left) + else if (uni->right->nullable) + STACK_PUSHX(stack, voidptr, uni->right) + else + assert(0); + break; + + case CATENATION: + /* The path must go through both children. */ + cat = (tre_catenation_t *)node->obj; + assert(cat->left->nullable); + assert(cat->right->nullable); + STACK_PUSHX(stack, voidptr, cat->left); + STACK_PUSHX(stack, voidptr, cat->right); + break; + + case ITERATION: + /* A match with an empty string is preferred over no match at + all, so we go through the argument if possible. */ + iter = (tre_iteration_t *)node->obj; + if (iter->arg->nullable) + STACK_PUSHX(stack, voidptr, iter->arg); + break; + + default: + assert(0); + break; + } + } + + return status; +} + + +typedef enum { + NFL_RECURSE, + NFL_POST_UNION, + NFL_POST_CATENATION, + NFL_POST_ITERATION +} tre_nfl_stack_symbol_t; + + +/* Computes and fills in the fields `nullable', `firstpos', and `lastpos' for + the nodes of the AST `tree'. */ +static reg_errcode_t +tre_compute_nfl(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *tree) +{ + int bottom = tre_stack_num_objects(stack); + + STACK_PUSHR(stack, voidptr, tree); + STACK_PUSHR(stack, int, NFL_RECURSE); + + while (tre_stack_num_objects(stack) > bottom) + { + tre_nfl_stack_symbol_t symbol; + tre_ast_node_t *node; + + symbol = (tre_nfl_stack_symbol_t)tre_stack_pop_int(stack); + node = tre_stack_pop_voidptr(stack); + switch (symbol) + { + case NFL_RECURSE: + switch (node->type) + { + case LITERAL: + { + tre_literal_t *lit = (tre_literal_t *)node->obj; + if (IS_BACKREF(lit)) + { + /* Back references: nullable = false, firstpos = {i}, + lastpos = {i}. */ + node->nullable = 0; + node->firstpos = tre_set_one(mem, lit->position, 0, + TRE_CHAR_MAX, NULL, -1); + if (!node->firstpos) + return REG_ESPACE; + node->lastpos = tre_set_one(mem, lit->position, 0, + TRE_CHAR_MAX, NULL, + (int)lit->code_max); + if (!node->lastpos) + return REG_ESPACE; + } + else if (lit->code_min < 0) + { + /* Tags, empty strings, params, and zero width assertions: + nullable = true, firstpos = {}, and lastpos = {}. */ + node->nullable = 1; + node->firstpos = tre_set_empty(mem); + if (!node->firstpos) + return REG_ESPACE; + node->lastpos = tre_set_empty(mem); + if (!node->lastpos) + return REG_ESPACE; + } + else + { + /* Literal at position i: nullable = false, firstpos = {i}, + lastpos = {i}. */ + node->nullable = 0; + node->firstpos = + tre_set_one(mem, lit->position, (int)lit->code_min, + (int)lit->code_max, NULL, -1); + if (!node->firstpos) + return REG_ESPACE; + node->lastpos = tre_set_one(mem, lit->position, + (int)lit->code_min, + (int)lit->code_max, + lit->u.bracket_match_list, + -1); + if (!node->lastpos) + return REG_ESPACE; + } + break; + } + + case UNION: + /* Compute the attributes for the two subtrees, and after that + for this node. */ + STACK_PUSHR(stack, voidptr, node); + STACK_PUSHR(stack, int, NFL_POST_UNION); + STACK_PUSHR(stack, voidptr, ((tre_union_t *)node->obj)->right); + STACK_PUSHR(stack, int, NFL_RECURSE); + STACK_PUSHR(stack, voidptr, ((tre_union_t *)node->obj)->left); + STACK_PUSHR(stack, int, NFL_RECURSE); + break; + + case CATENATION: + /* Compute the attributes for the two subtrees, and after that + for this node. */ + STACK_PUSHR(stack, voidptr, node); + STACK_PUSHR(stack, int, NFL_POST_CATENATION); + STACK_PUSHR(stack, voidptr, ((tre_catenation_t *)node->obj)->right); + STACK_PUSHR(stack, int, NFL_RECURSE); + STACK_PUSHR(stack, voidptr, ((tre_catenation_t *)node->obj)->left); + STACK_PUSHR(stack, int, NFL_RECURSE); + break; + + case ITERATION: + /* Compute the attributes for the subtree, and after that for + this node. */ + STACK_PUSHR(stack, voidptr, node); + STACK_PUSHR(stack, int, NFL_POST_ITERATION); + STACK_PUSHR(stack, voidptr, ((tre_iteration_t *)node->obj)->arg); + STACK_PUSHR(stack, int, NFL_RECURSE); + break; + } + break; /* end case: NFL_RECURSE */ + + case NFL_POST_UNION: + { + tre_union_t *uni = (tre_union_t *)node->obj; + node->nullable = uni->left->nullable || uni->right->nullable; + node->firstpos = tre_set_union(mem, uni->left->firstpos, + uni->right->firstpos, NULL, 0, NULL); + if (!node->firstpos) + return REG_ESPACE; + node->lastpos = tre_set_union(mem, uni->left->lastpos, + uni->right->lastpos, NULL, 0, NULL); + if (!node->lastpos) + return REG_ESPACE; + break; + } + + case NFL_POST_ITERATION: + { + int num_tags, *tags, assertions, params_seen; + int *params; + reg_errcode_t status; + tre_iteration_t *iter = (tre_iteration_t *)node->obj; + + /* From Ville Laurikari's original 2001 Master's thesis, the + firstpos(n) and lastpos(n) of an iteration is just the + corresponding values of the iteration's argument. Unfortunately, + this isn't sufficient for the following BRE: + + \(a*\)*b\(\1\) matched against ab + + The backreference wants to force the first subexpression to + be the empty string, but there is no transition for this. So + we need to modify the lastpos(n) of an iteration to be the + equivalent of that of catentation. Using the same notation as + in the thesis, lastpos(n) is redefined as: + + if nullable(c1) then + lastpos(c1) U + addtags(lastpos(c1), + emptymatch(c1)) + else + lastpos(c1) + + where c1 is the argument node. firstpos(n) remains the same. */ + + /* Compute lastpos. */ + if (iter->min == 0 || iter->arg->nullable) + { + node->nullable = 1; + if (iter->arg->nullable) + { + /* The arg matches the empty string. Make a first pass + with tre_match_empty() to get the number of tags and + parameters. */ + status = tre_match_empty(stack, iter->arg, + NULL, NULL, NULL, &num_tags, + ¶ms_seen); + if (status != REG_OK) + return status; + /* Allocate arrays for the tags and parameters. */ + tags = xmalloc(sizeof(int) * (num_tags + 1)); + if (!tags) + return REG_ESPACE; + tags[0] = -1; + assertions = 0; + params = NULL; + if (params_seen) + { + params = tre_mem_alloc(mem, sizeof(*params) + * TRE_PARAM_LAST); + if (!params) + { + xfree(tags); + return REG_ESPACE; + } + } + /* Second pass with tre_mach_empty() to get the list of + tags and parameters. */ + status = tre_match_empty(stack, iter->arg, tags, + &assertions, params, NULL, NULL); + if (status != REG_OK) + { + xfree(tags); + return status; + } + node->lastpos = + tre_set_union(mem, iter->arg->lastpos, iter->arg->lastpos, + tags, assertions, params); + xfree(tags); + if (!node->lastpos) + return REG_ESPACE; + } + else + node->lastpos = iter->arg->lastpos; + } + else + { + node->nullable = 0; + node->lastpos = iter->arg->lastpos; + } + node->firstpos = iter->arg->firstpos; + break; + } + + case NFL_POST_CATENATION: + { + int num_tags, *tags, assertions, params_seen; + int *params; + reg_errcode_t status; + tre_catenation_t *cat = node->obj; + node->nullable = cat->left->nullable && cat->right->nullable; + + /* Compute firstpos. */ + if (cat->left->nullable) + { + /* The left side matches the empty string. Make a first pass + with tre_match_empty() to get the number of tags and + parameters. */ + status = tre_match_empty(stack, cat->left, + NULL, NULL, NULL, &num_tags, + ¶ms_seen); + if (status != REG_OK) + return status; + /* Allocate arrays for the tags and parameters. */ + tags = xmalloc(sizeof(*tags) * (num_tags + 1)); + if (!tags) + return REG_ESPACE; + tags[0] = -1; + assertions = 0; + params = NULL; + if (params_seen) + { + params = tre_mem_alloc(mem, sizeof(*params) + * TRE_PARAM_LAST); + if (!params) + { + xfree(tags); + return REG_ESPACE; + } + } + /* Second pass with tre_mach_empty() to get the list of + tags and parameters. */ + status = tre_match_empty(stack, cat->left, tags, + &assertions, params, NULL, NULL); + if (status != REG_OK) + { + xfree(tags); + return status; + } + node->firstpos = + tre_set_union(mem, cat->right->firstpos, cat->left->firstpos, + tags, assertions, params); + xfree(tags); + if (!node->firstpos) + return REG_ESPACE; + } + else + { + node->firstpos = cat->left->firstpos; + } + + /* Compute lastpos. */ + if (cat->right->nullable) + { + /* The right side matches the empty string. Make a first pass + with tre_match_empty() to get the number of tags and + parameters. */ + status = tre_match_empty(stack, cat->right, + NULL, NULL, NULL, &num_tags, + ¶ms_seen); + if (status != REG_OK) + return status; + /* Allocate arrays for the tags and parameters. */ + tags = xmalloc(sizeof(int) * (num_tags + 1)); + if (!tags) + return REG_ESPACE; + tags[0] = -1; + assertions = 0; + params = NULL; + if (params_seen) + { + params = tre_mem_alloc(mem, sizeof(*params) + * TRE_PARAM_LAST); + if (!params) + { + xfree(tags); + return REG_ESPACE; + } + } + /* Second pass with tre_mach_empty() to get the list of + tags and parameters. */ + status = tre_match_empty(stack, cat->right, tags, + &assertions, params, NULL, NULL); + if (status != REG_OK) + { + xfree(tags); + return status; + } + node->lastpos = + tre_set_union(mem, cat->left->lastpos, cat->right->lastpos, + tags, assertions, params); + xfree(tags); + if (!node->lastpos) + return REG_ESPACE; + } + else + { + node->lastpos = cat->right->lastpos; + } + break; + } + + default: + assert(0); + break; + } + } + + return REG_OK; +} + + +/* Adds a transition from each position in `p1' to each position in `p2'. */ +static reg_errcode_t +tre_make_trans(tre_pos_and_tags_t *p1, tre_pos_and_tags_t *p2, + tre_tnfa_transition_t *transitions, + int *counts, int *offs) +{ + tre_pos_and_tags_t *orig_p2 = p2; + tre_tnfa_transition_t *trans; + int i, j, k, l, dup, prev_p2_pos; + + if (transitions != NULL) + while (p1->position >= 0) + { + p2 = orig_p2; + prev_p2_pos = -1; + while (p2->position >= 0) + { + /* Optimization: if this position was already handled, skip it. */ + if (p2->position == prev_p2_pos) + { + p2++; + continue; + } + prev_p2_pos = p2->position; + /* Set `trans' to point to the next unused transition from + position `p1->position'. */ + trans = transitions + offs[p1->position]; + while (trans->state != NULL) + { +#if 0 + /* If we find a previous transition from `p1->position' to + `p2->position', it is overwritten. This can happen only + if there are nested loops in the regexp, like in "((a)*)*". + In POSIX.2 repetition using the outer loop is always + preferred over using the inner loop. Therefore the + transition for the inner loop is useless and can be thrown + away. */ + /* XXX - The same position is used for all nodes in a bracket + expression, so this optimization cannot be used (it will + break bracket expressions) unless I figure out a way to + detect it here. */ + if (trans->state_id == p2->position) + { + DPRINT(("*")); + break; + } +#endif + trans++; + } + + if (trans->state == NULL) + (trans + 1)->state = NULL; + /* Use the character ranges, assertions, etc. from `p1' for + the transition from `p1' to `p2'. */ + trans->code_min = p1->code_min; + trans->code_max = p1->code_max; + trans->state = transitions + offs[p2->position]; + trans->state_id = p2->position; + trans->assertions = p1->assertions | p2->assertions + | (p1->bracket_match_list != NULL ? ASSERT_BRACKET_MATCH : 0); + if (p1->backref >= 0) + { + assert((trans->assertions & ASSERT_BRACKET_MATCH) == 0); + assert(p2->backref < 0); + trans->u.backref = p1->backref; + trans->assertions |= ASSERT_BACKREF; + } + if (p1->bracket_match_list != NULL) + { + trans->u.bracket_match_list = + xmalloc(SIZEOF_BRACKET_MATCH_LIST(p1->bracket_match_list)); + if (trans->u.bracket_match_list == NULL) + return REG_ESPACE; + memcpy(trans->u.bracket_match_list, p1->bracket_match_list, + SIZEOF_BRACKET_MATCH_LIST(p1->bracket_match_list)); + } + + /* Find out how many tags this transition has. */ + i = 0; + if (p1->tags != NULL) + while(p1->tags[i] >= 0) + i++; + j = 0; + if (p2->tags != NULL) + while(p2->tags[j] >= 0) + j++; + + /* If we are overwriting a transition, free the old tag array. */ + if (trans->tags != NULL) + xfree(trans->tags); + trans->tags = NULL; + + /* If there were any tags, allocate an array and fill it. */ + if (i + j > 0) + { + trans->tags = xmalloc(sizeof(*trans->tags) * (i + j + 1)); + if (!trans->tags) + return REG_ESPACE; + i = 0; + if (p1->tags != NULL) + while(p1->tags[i] >= 0) + { + trans->tags[i] = p1->tags[i]; + i++; + } + l = i; + j = 0; + if (p2->tags != NULL) + while (p2->tags[j] >= 0) + { + /* Don't add duplicates. */ + dup = 0; + for (k = 0; k < i; k++) + if (trans->tags[k] == p2->tags[j]) + { + dup = 1; + break; + } + if (!dup) + trans->tags[l++] = p2->tags[j]; + j++; + } + trans->tags[l] = -1; + } + + /* Set the parameter array. If both `p2' and `p1' have same + parameters, the values in `p2' override those in `p1'. */ + if (p1->params || p2->params) + { + if (!trans->params) + trans->params = xmalloc(sizeof(*trans->params) + * TRE_PARAM_LAST); + if (!trans->params) + return REG_ESPACE; + for (i = 0; i < TRE_PARAM_LAST; i++) + { + trans->params[i] = TRE_PARAM_UNSET; + if (p1->params && p1->params[i] != TRE_PARAM_UNSET) + trans->params[i] = p1->params[i]; + if (p2->params && p2->params[i] != TRE_PARAM_UNSET) + trans->params[i] = p2->params[i]; + } + } + else + { + if (trans->params) + xfree(trans->params); + trans->params = NULL; + } + + +#ifdef TRE_DEBUG + { + int *tags; + + DPRINT((" %2d -> %2d on %3d", p1->position, p2->position, + p1->code_min)); + if (p1->code_max != p1->code_min) + DPRINT(("-%3d", p1->code_max)); + tags = trans->tags; + if (tags) + { + DPRINT((", tags [")); + while (*tags >= 0) + { + DPRINT(("%d", *tags)); + tags++; + if (*tags >= 0) + DPRINT((",")); + } + DPRINT(("]")); + } + if (trans->assertions) + DPRINT((", assert %d", trans->assertions)); + if (trans->assertions & ASSERT_BACKREF) + DPRINT((", backref %d", trans->u.backref)); + else if (trans->assertions & ASSERT_BRACKET_MATCH) + DPRINT((", bracket_match_list %p", + trans->u.bracket_match_list)); + if (trans->params) + { + DPRINT((", ")); + tre_print_params(trans->params); + } + DPRINT(("\n")); + } +#endif /* TRE_DEBUG */ + p2++; + } + p1++; + } + else + /* Compute a maximum limit for the number of transitions leaving + from each state. */ + while (p1->position >= 0) + { + p2 = orig_p2; + while (p2->position >= 0) + { + counts[p1->position]++; + p2++; + } + p1++; + } + return REG_OK; +} + +/* Converts the syntax tree to a TNFA. All the transitions in the TNFA are + labelled with one character range (there are no transitions on empty + strings). The TNFA takes O(n^2) space in the worst case, `n' is size of + the regexp. */ +static reg_errcode_t +tre_ast_to_tnfa(tre_ast_node_t *node, tre_tnfa_transition_t *transitions, + int *counts, int *offs) +{ + tre_union_t *uni; + tre_catenation_t *cat; + tre_iteration_t *iter; + reg_errcode_t errcode = REG_OK; + + /* XXX - recurse using a stack!. */ + switch (node->type) + { + case LITERAL: + break; + case UNION: + uni = (tre_union_t *)node->obj; + errcode = tre_ast_to_tnfa(uni->left, transitions, counts, offs); + if (errcode != REG_OK) + return errcode; + errcode = tre_ast_to_tnfa(uni->right, transitions, counts, offs); + break; + + case CATENATION: + cat = (tre_catenation_t *)node->obj; + /* Add a transition from each position in cat->left->lastpos + to each position in cat->right->firstpos. */ + errcode = tre_make_trans(cat->left->lastpos, cat->right->firstpos, + transitions, counts, offs); + if (errcode != REG_OK) + return errcode; + errcode = tre_ast_to_tnfa(cat->left, transitions, counts, offs); + if (errcode != REG_OK) + return errcode; + errcode = tre_ast_to_tnfa(cat->right, transitions, counts, offs); + break; + + case ITERATION: + iter = (tre_iteration_t *)node->obj; + assert(iter->max == -1 || iter->max == 1); + + if (iter->max == -1) + { + assert(iter->min == 0 || iter->min == 1); + /* Add a transition from each last position in the iterated + expression to each first position. */ + errcode = tre_make_trans(iter->arg->lastpos, iter->arg->firstpos, + transitions, counts, offs); + if (errcode != REG_OK) + return errcode; + } + errcode = tre_ast_to_tnfa(iter->arg, transitions, counts, offs); + break; + } + return errcode; +} + + +#define ERROR_EXIT(err) \ + do \ + { \ + errcode = err; \ + if (/*CONSTCOND*/1) \ + goto error_exit; \ + } \ + while (/*CONSTCOND*/0) + + +int +tre_compile(regex_t *preg, const tre_char_t *regex, size_t n, int cflags, + locale_t loc) +{ + tre_stack_t *stack; + tre_ast_node_t *tree, *tmp_ast_l, *tmp_ast_r; + tre_pos_and_tags_t *p; + int *counts = NULL, *offs = NULL; + int i, add = 0; + tre_tnfa_transition_t *transitions, *initial; + tre_tnfa_t *tnfa = NULL; + tre_submatch_data_t *submatch_data = NULL; + tre_tag_direction_t *tag_directions = NULL; + reg_errcode_t errcode; + tre_mem_t mem; + + /* Parse context. */ + tre_parse_ctx_t parse_ctx; + + /* Allocate a stack used throughout the compilation process for various + purposes. */ + stack = tre_stack_new(512, 10240, 128); + if (!stack) + return REG_ESPACE; + /* Allocate a fast memory allocator. */ + mem = tre_mem_new(); + if (!mem) + { + tre_stack_destroy(stack); + return REG_ESPACE; + } + + /* Parse the regexp. */ + memset(&parse_ctx, 0, sizeof(parse_ctx)); + parse_ctx.mem = mem; + parse_ctx.stack = stack; + parse_ctx.re = regex; + parse_ctx.len = n; + /* Only allow REG_UNGREEDY to be set if both REG_ENHANCED and REG_EXTENDED + are also set */ + if ((cflags & (REG_ENHANCED | REG_EXTENDED)) != (REG_ENHANCED | REG_EXTENDED)) + cflags &= ~REG_UNGREEDY; + parse_ctx.cflags = cflags; + parse_ctx.max_backref = -1; + parse_ctx.loc = loc; + parse_ctx.submatch_id_invisible = SUBMATCH_ID_INVISIBLE_START; + + DPRINT(("tre_compile: parsing '%.*" STRF "'\n", (int)n, regex)); + errcode = tre_parse(&parse_ctx); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + preg->re_nsub = parse_ctx.submatch_id - 1; + tree = parse_ctx.result; + + /* Back references and approximate matching cannot currently be used + in the same regexp. */ + if (parse_ctx.max_backref >= 0 && parse_ctx.have_approx) + ERROR_EXIT(REG_BADPAT); + +#ifdef TRE_DEBUG + tre_ast_print(tree); +#endif /* TRE_DEBUG */ + + /* Referring to nonexistent subexpressions is illegal. */ + if (parse_ctx.max_backref > (int)preg->re_nsub) + ERROR_EXIT(REG_ESUBREG); + + /* Allocate the TNFA struct. */ + tnfa = xcalloc(1, sizeof(tre_tnfa_t)); + if (tnfa == NULL) + ERROR_EXIT(REG_ESPACE); + tnfa->have_backrefs = parse_ctx.max_backref >= 0; + tnfa->have_approx = parse_ctx.have_approx; + tnfa->num_submatches = parse_ctx.submatch_id; + tnfa->num_submatches_invisible = parse_ctx.submatch_id_invisible + - SUBMATCH_ID_INVISIBLE_START; + tnfa->num_reorder_tags = parse_ctx.num_reorder_tags; + tnfa->loc = parse_ctx.loc; + + /* Set up tags for submatch addressing. If REG_NOSUB is set and the + regexp does not have back references, this can be skipped. */ + if (tnfa->num_reorder_tags > 0 || !(cflags & REG_NOSUB)) + { + DPRINT(("tre_compile: setting up tags\n")); + + /* Figure out how many tags we will need. */ + errcode = tre_add_tags(NULL, stack, tree, tnfa); + if (errcode != REG_OK) + ERROR_EXIT(errcode); +#ifdef TRE_DEBUG + tre_ast_print(tree); +#endif /* TRE_DEBUG */ + + if (tnfa->num_tags > 0) + { + tag_directions = xmalloc(sizeof(*tag_directions) + * (tnfa->num_tags + 1)); + if (tag_directions == NULL) + ERROR_EXIT(REG_ESPACE); + tnfa->tag_directions = tag_directions; + memset(tag_directions, -1, + sizeof(*tag_directions) * (tnfa->num_tags + 1)); + } + tnfa->minimal_tags = xcalloc((unsigned)tnfa->num_tags * 2 + 3, + sizeof(*tnfa->minimal_tags)); + if (tnfa->minimal_tags == NULL) + ERROR_EXIT(REG_ESPACE); + + submatch_data = xcalloc((unsigned)parse_ctx.submatch_id, + sizeof(*submatch_data)); + if (submatch_data == NULL) + ERROR_EXIT(REG_ESPACE); + /* Set the eo_tag value to -1 to indicate that that corresponding + * submatch has not be completed yet */ + for (i = 0; i < parse_ctx.submatch_id; i++) + { + submatch_data[i].eo_tag = -1; + } + tnfa->submatch_data = submatch_data; + + errcode = tre_add_tags(mem, stack, tree, tnfa); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + +#ifdef TRE_DEBUG + for (i = 0; i < parse_ctx.submatch_id; i++) + DPRINT(("pmatch[%d] = {t%d, t%d}\n", + i, submatch_data[i].so_tag, submatch_data[i].eo_tag)); + for (i = 0; i <= tnfa->num_tags; i++) + DPRINT(("t%d is %s\n", i, tag_dir_str[tag_directions[i]])); +#endif /* TRE_DEBUG */ + } + + /* Expand iteration nodes. */ + errcode = tre_expand_ast(mem, stack, tree, &parse_ctx.position, + tag_directions, &tnfa->params_depth); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + + /* Add a dummy node for the final state. + XXX - For certain patterns this dummy node can be optimized away, + for example "a*" or "ab*". Figure out a simple way to detect + this possibility. */ + tmp_ast_l = tree; + tmp_ast_r = tre_ast_new_literal(mem, 0, 0, parse_ctx.position++); + if (tmp_ast_r == NULL) + ERROR_EXIT(REG_ESPACE); + + tree = tre_ast_new_catenation(mem, tmp_ast_l, tmp_ast_r); + if (tree == NULL) + ERROR_EXIT(REG_ESPACE); + +#ifdef TRE_DEBUG + tre_ast_print(tree); + DPRINT(("Number of states: %d\n", parse_ctx.position)); + if (submatch_data) + for (i = 0; i < parse_ctx.submatch_id; i++) + DPRINT(("pmatch[%d] = {t%d, t%d}\n", + i, submatch_data[i].so_tag, submatch_data[i].eo_tag)); + if (tag_directions) + for (i = 0; i <= tnfa->num_tags; i++) + DPRINT(("t%d is %s\n", i, tag_dir_str[tag_directions[i]])); +#endif /* TRE_DEBUG */ + + errcode = tre_compute_nfl(mem, stack, tree); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + + counts = xmalloc(sizeof(int) * parse_ctx.position); + if (counts == NULL) + ERROR_EXIT(REG_ESPACE); + + offs = xmalloc(sizeof(int) * parse_ctx.position); + if (offs == NULL) + ERROR_EXIT(REG_ESPACE); + + for (i = 0; i < parse_ctx.position; i++) + counts[i] = 0; + tre_ast_to_tnfa(tree, NULL, counts, NULL); + + add = 0; + for (i = 0; i < parse_ctx.position; i++) + { + offs[i] = add; + add += counts[i] + 1; + counts[i] = 0; + } + transitions = xcalloc((unsigned)add + 1, sizeof(*transitions)); + if (transitions == NULL) + ERROR_EXIT(REG_ESPACE); + tnfa->transitions = transitions; + tnfa->num_transitions = add; + + DPRINT(("Converting to TNFA:\n")); + errcode = tre_ast_to_tnfa(tree, transitions, counts, offs); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + +#ifdef USE_FIRSTPOS_CHARS /* not defined */ + /* If in eight bit mode, compute a table of characters that can be the + first character of a match. */ + tnfa->first_char = -1; + if (TRE_MB_CUR_MAX_L(tnfa->loc) == 1 && !tmp_ast_l->nullable) + { + int count = 0; + tre_cint_t k; + DPRINT(("Characters that can start a match:")); + tnfa->firstpos_chars = xcalloc(256, sizeof(char)); + if (tnfa->firstpos_chars == NULL) + ERROR_EXIT(REG_ESPACE); + for (p = tree->firstpos; p->position >= 0; p++) + { + tre_tnfa_transition_t *j = transitions + offs[p->position]; + while (j->state != NULL) + { + for (k = j->code_min; k <= j->code_max && k < 256; k++) + { + DPRINT((" %d", k)); + tnfa->firstpos_chars[k] = 1; + count++; + } + j++; + } + } + DPRINT(("\n")); +#define TRE_OPTIMIZE_FIRST_CHAR 1 +#if TRE_OPTIMIZE_FIRST_CHAR + if (count == 1) + { + for (k = 0; k < 256; k++) + if (tnfa->firstpos_chars[k]) + { + DPRINT(("first char must be %d\n", k)); + tnfa->first_char = k; + xfree(tnfa->firstpos_chars); + tnfa->firstpos_chars = NULL; + break; + } + } +#endif + + } + else + tnfa->firstpos_chars = NULL; +#else /* !USE_FIRSTPOS_CHARS */ + + /* Set first_char only if there is only one character that can be the + first character of a match */ + tnfa->first_char = -1; + if (!tmp_ast_l->nullable) + { + int scanning = 1; + for (p = tree->firstpos; scanning && p->position >= 0; p++) + { + tre_tnfa_transition_t *j = transitions + offs[p->position]; + while (j->state != NULL) + { + if (j->code_min <= j->code_max) + { + if (j->code_max != j->code_min || j->code_min == -1 || tnfa->first_char != -1) + { + tnfa->first_char = -1; + scanning = 0; + break; + } + tnfa->first_char = j->code_min; + } + j++; + } + } +#ifdef TRE_DEBUG + if (tnfa->first_char >= 0) + DPRINT(("first char must be %d\n", tnfa->first_char)); +#endif /* TRE_DEBUG */ + } +#endif /* !USE_FIRSTPOS_CHARS */ + + p = tree->firstpos; + i = 0; + while (p->position >= 0) + { + i++; + +#ifdef TRE_DEBUG + { + int *tags; + DPRINT(("initial: %d", p->position)); + tags = p->tags; + if (tags != NULL) + { + if (*tags >= 0) + DPRINT(("/")); + while (*tags >= 0) + { + DPRINT(("%d", *tags)); + tags++; + if (*tags >= 0) + DPRINT((",")); + } + } + DPRINT((", assert %d", p->assertions)); + if (p->params) + { + DPRINT((", ")); + tre_print_params(p->params); + } + DPRINT(("\n")); + } +#endif /* TRE_DEBUG */ + + p++; + } + + initial = xcalloc((unsigned)i + 1, sizeof(tre_tnfa_transition_t)); + if (initial == NULL) + ERROR_EXIT(REG_ESPACE); + tnfa->initial = initial; + + i = 0; + for (p = tree->firstpos; p->position >= 0; p++) + { + initial[i].state = transitions + offs[p->position]; + initial[i].state_id = p->position; + initial[i].tags = NULL; + /* Copy the arrays p->tags, and p->params, they are allocated + from a tre_mem object. */ + if (p->tags) + { + int j; + for (j = 0; p->tags[j] >= 0; j++); + initial[i].tags = xmalloc(sizeof(*p->tags) * (j + 1)); + if (!initial[i].tags) + ERROR_EXIT(REG_ESPACE); + memcpy(initial[i].tags, p->tags, sizeof(*p->tags) * (j + 1)); + } + initial[i].params = NULL; + if (p->params) + { + initial[i].params = xmalloc(sizeof(*p->params) * TRE_PARAM_LAST); + if (!initial[i].params) + ERROR_EXIT(REG_ESPACE); + memcpy(initial[i].params, p->params, + sizeof(*p->params) * TRE_PARAM_LAST); + } + initial[i].assertions = p->assertions; + i++; + } + initial[i].state = NULL; + + tnfa->num_transitions = add; + tnfa->final = transitions + offs[tree->lastpos[0].position]; + tnfa->num_states = parse_ctx.position; + tnfa->cflags = cflags; + + DPRINT(("final state %d (%p)\n", tree->lastpos[0].position, + (void *)tnfa->final)); + + tre_mem_destroy(mem); + tre_stack_destroy(stack); + xfree(counts); + xfree(offs); + +#ifdef TRE_USE_SYSTEM_REGEX_H + preg->re_magic = RE_MAGIC; +#endif /* TRE_USE_SYSTEM_REGEX_H */ + preg->TRE_REGEX_T_FIELD = (void *)tnfa; +#ifdef __LIBC__ + /* In Libc, we need to retain the locale. Outside Libc, we already called + duplocale() which does the retaining. */ + XL_RETAIN(tnfa->loc); +#endif /* __LIBC__ */ + return REG_OK; + + error_exit: + /* Free everything that was allocated and return the error code. */ + tre_mem_destroy(mem); + if (stack != NULL) + tre_stack_destroy(stack); + if (counts != NULL) + xfree(counts); + if (offs != NULL) + xfree(offs); + + /* Set tnfa into preg, so that calling tre_free() will free the contents + of tnfa. But in Libc, NULL out the loc field since we never retained + the locale. Outside Libc, we let tre_free() call freelocale(). */ + preg->TRE_REGEX_T_FIELD = (void *)tnfa; +#ifdef __LIBC__ + if(tnfa) tnfa->loc = NULL; +#endif /* __LIBC__ */ + + tre_free(preg); + return errcode; +} + + + + +void +tre_free(regex_t *preg) +{ + tre_tnfa_t *tnfa; + unsigned int i; + tre_tnfa_transition_t *trans; + +#ifdef TRE_USE_SYSTEM_REGEX_H + preg->re_magic = 0; +#endif /* TRE_USE_SYSTEM_REGEX_H */ + tnfa = (void *)preg->TRE_REGEX_T_FIELD; + if (!tnfa) + return; + preg->TRE_REGEX_T_FIELD = NULL; + + for (i = 0; i < tnfa->num_transitions; i++) + if (tnfa->transitions[i].state) + { + if (tnfa->transitions[i].tags) + xfree(tnfa->transitions[i].tags); + if (tnfa->transitions[i].assertions & ASSERT_BRACKET_MATCH) + xfree(tnfa->transitions[i].u.bracket_match_list); + if (tnfa->transitions[i].params) + xfree(tnfa->transitions[i].params); + } + if (tnfa->transitions) + xfree(tnfa->transitions); + + if (tnfa->initial) + { + for (trans = tnfa->initial; trans->state; trans++) + { + if (trans->tags) + xfree(trans->tags); + if (trans->params) + xfree(trans->params); + } + xfree(tnfa->initial); + } + + if (tnfa->submatch_data) + { + xfree(tnfa->submatch_data); + } + + if (tnfa->tag_directions) + xfree(tnfa->tag_directions); +#ifdef USE_FIRSTPOS_CHARS /* not defined */ + if (tnfa->firstpos_chars) + xfree(tnfa->firstpos_chars); +#endif /* USE_FIRSTPOS_CHARS */ + if (tnfa->minimal_tags) + xfree(tnfa->minimal_tags); + + if (tnfa->loc) +#ifdef __LIBC__ + XL_RELEASE(tnfa->loc); +#else /* !__LIBC__ */ + freelocale(tnfa->loc); +#endif /* !__LIBC__ */ + + if (tnfa->last_matched_branch) + xfree(tnfa->last_matched_branch); + + xfree(tnfa); +} + +#ifndef __LIBC__ +char * +tre_version(void) +{ + static char str[256]; + char *version; + + if (str[0] == 0) + { + (void) tre_config(TRE_CONFIG_VERSION, &version); + (void) snprintf(str, sizeof(str), "TRE %s (BSD)", version); + } + return str; +} + +int +tre_config(int query, void *result) +{ + int *int_result = result; + const char **string_result = result; + + switch (query) + { + case TRE_CONFIG_APPROX: +#ifdef TRE_APPROX + *int_result = 1; +#else /* !TRE_APPROX */ + *int_result = 0; +#endif /* !TRE_APPROX */ + return REG_OK; + + case TRE_CONFIG_WCHAR: +#ifdef TRE_WCHAR + *int_result = 1; +#else /* !TRE_WCHAR */ + *int_result = 0; +#endif /* !TRE_WCHAR */ + return REG_OK; + + case TRE_CONFIG_MULTIBYTE: +#ifdef TRE_MULTIBYTE + *int_result = 1; +#else /* !TRE_MULTIBYTE */ + *int_result = 0; +#endif /* !TRE_MULTIBYTE */ + return REG_OK; + + case TRE_CONFIG_SYSTEM_ABI: +#ifdef TRE_CONFIG_SYSTEM_ABI + *int_result = 1; +#else /* !TRE_CONFIG_SYSTEM_ABI */ + *int_result = 0; +#endif /* !TRE_CONFIG_SYSTEM_ABI */ + return REG_OK; + + case TRE_CONFIG_VERSION: + *string_result = TRE_VERSION; + return REG_OK; + } + + return REG_NOMATCH; +} +#endif /* !__LIBC__ */ + +#pragma clang diagnostic push +/* EOF */ diff --git a/regex/TRE/lib/tre-compile.h b/regex/TRE/lib/tre-compile.h new file mode 100644 index 0000000..355ec4d --- /dev/null +++ b/regex/TRE/lib/tre-compile.h @@ -0,0 +1,27 @@ +/* + tre-compile.h: Regex compilation definitions + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + + +#ifndef TRE_COMPILE_H +#define TRE_COMPILE_H 1 + +typedef struct { + int position; + int code_min; + int code_max; + int *tags; + int assertions; + tre_bracket_match_list_t *bracket_match_list; + int backref; + int *params; + locale_t loc; +} tre_pos_and_tags_t; + +#endif /* TRE_COMPILE_H */ + +/* EOF */ diff --git a/regex/TRE/lib/tre-internal.h b/regex/TRE/lib/tre-internal.h new file mode 100644 index 0000000..aa67484 --- /dev/null +++ b/regex/TRE/lib/tre-internal.h @@ -0,0 +1,356 @@ +/* + tre-internal.h - TRE internal definitions + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#ifndef TRE_INTERNAL_H +#define TRE_INTERNAL_H 1 + +#ifdef HAVE_WCHAR_H +#include +#endif /* HAVE_WCHAR_H */ + +#ifdef HAVE_WCTYPE_H +#include +#endif /* !HAVE_WCTYPE_H */ + +#include + +#ifdef __LIBC__ +#include +#else /* !__LIBC__ */ +#include +#endif /* !__LIBC__ */ + +#include "tre.h" +#include "tre-last-matched.h" + +#ifdef TRE_DEBUG +#include +#define DPRINT(msg) do {printf msg; fflush(stdout);} while(/*CONSTCOND*/0) +#else /* !TRE_DEBUG */ +#define DPRINT(msg) do { } while(/*CONSTCOND*/0) +#endif /* !TRE_DEBUG */ + +#define elementsof(x) ( sizeof(x) / sizeof(x[0]) ) + +#ifdef HAVE_MBRTOWC +#define tre_mbrtowc(pwc, s, n, ps) (mbrtowc((pwc), (s), (n), (ps))) +/* xlocale */ +#define tre_mbrtowc_l(pwc, s, n, ps, l) (mbrtowc_l((pwc), (s), (n), (ps), (l))) +#else /* !HAVE_MBRTOWC */ +#ifdef HAVE_MBTOWC +#define tre_mbrtowc(pwc, s, n, ps) (mbtowc((pwc), (s), (n))) +#endif /* HAVE_MBTOWC */ +#endif /* !HAVE_MBRTOWC */ + +#ifdef TRE_MULTIBYTE +#ifdef HAVE_MBSTATE_T +#define TRE_MBSTATE +#endif /* TRE_MULTIBYTE */ +#endif /* HAVE_MBSTATE_T */ + +/* Define the character types and functions. */ +#ifdef TRE_WCHAR + +/* Wide characters. */ +typedef wint_t tre_cint_t; +#define TRE_CHAR_MAX WCHAR_MAX + +#ifdef TRE_MULTIBYTE +#define TRE_MB_CUR_MAX MB_CUR_MAX +/* xlocale */ +#define TRE_MB_CUR_MAX_L MB_CUR_MAX_L +#else /* !TRE_MULTIBYTE */ +#define TRE_MB_CUR_MAX 1 +#endif /* !TRE_MULTIBYTE */ + +#define tre_isalnum iswalnum +#define tre_isalpha iswalpha +#ifdef HAVE_ISWBLANK +#define tre_isblank iswblank +#endif /* HAVE_ISWBLANK */ +#define tre_iscntrl iswcntrl +#define tre_isdigit iswdigit +#define tre_isgraph iswgraph +#define tre_islower iswlower +#define tre_isprint iswprint +#define tre_ispunct iswpunct +#define tre_isspace iswspace +#define tre_isupper iswupper +#define tre_isxdigit iswxdigit + +#define tre_tolower towlower +#define tre_toupper towupper +#define tre_strlen wcslen + +/* xlocale */ +#define tre_isalnum_l iswalnum_l +#define tre_isdigit_l iswdigit_l +#define tre_islower_l iswlower_l +#define tre_isupper_l iswupper_l +#define tre_isxdigit_l iswxdigit_l +#define tre_tolower_l towlower_l +#define tre_toupper_l towupper_l + +#else /* !TRE_WCHAR */ + +/* 8 bit characters. */ +typedef short tre_cint_t; +#define TRE_CHAR_MAX 255 +#define TRE_MB_CUR_MAX 1 + +#define tre_isalnum isalnum +#define tre_isalpha isalpha +#ifdef HAVE_ISASCII +#define tre_isascii isascii +#endif /* HAVE_ISASCII */ +#ifdef HAVE_ISBLANK +#define tre_isblank isblank +#endif /* HAVE_ISBLANK */ +#define tre_iscntrl iscntrl +#define tre_isdigit isdigit +#define tre_isgraph isgraph +#define tre_islower islower +#define tre_isprint isprint +#define tre_ispunct ispunct +#define tre_isspace isspace +#define tre_isupper isupper +#define tre_isxdigit isxdigit + +#define tre_tolower(c) (tre_cint_t)(tolower(c)) +#define tre_toupper(c) (tre_cint_t)(toupper(c)) +#define tre_strlen(s) (strlen((const char*)s)) + +#endif /* !TRE_WCHAR */ + +#if defined(TRE_WCHAR) && defined(HAVE_ISWCTYPE) && defined(HAVE_WCTYPE) +#define TRE_USE_SYSTEM_WCTYPE 1 +#endif + +#ifdef TRE_USE_SYSTEM_WCTYPE +/* Use system provided iswctype() and wctype(). */ +typedef wctype_t tre_ctype_t; +#define tre_isctype iswctype +#define tre_ctype wctype + +/* xlocale */ +#define tre_isctype_l iswctype_l +#define tre_ctype_l wctype_l + +#else /* !TRE_USE_SYSTEM_WCTYPE */ +/* Define our own versions of iswctype() and wctype(). */ +typedef int (*tre_ctype_t)(tre_cint_t); +#define tre_isctype(c, type) ( (type)(c) ) +tre_ctype_t tre_ctype(const char *name); +#endif /* !TRE_USE_SYSTEM_WCTYPE */ + +typedef enum { STR_WIDE, STR_BYTE, STR_MBS, +#ifdef TRE_STR_USER + STR_USER +#endif /* TRE_STR_USER */ + } tre_str_type_t; + +/* Returns number of bytes to add to (char *)ptr to make it + properly aligned for the type. */ +#define ALIGN(ptr, type) \ + ((((long)ptr) % sizeof(type)) \ + ? (sizeof(type) - (((long)ptr) % sizeof(type))) \ + : 0) + +#undef MAX +#undef MIN +#define MAX(a, b) (((a) >= (b)) ? (a) : (b)) +#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) + +/* Define STRF to the correct printf formatter for strings. */ +#ifdef TRE_WCHAR +#define STRF "ls" +#else /* !TRE_WCHAR */ +#define STRF "s" +#endif /* !TRE_WCHAR */ + +/* Types to handle bracket expressions. */ +typedef enum { + TRE_BRACKET_MATCH_TYPE_UNUSED = 0, + TRE_BRACKET_MATCH_TYPE_CHAR, /* Single character value */ + TRE_BRACKET_MATCH_TYPE_RANGE_BEGIN, /* Collation range begin */ + TRE_BRACKET_MATCH_TYPE_RANGE_END, /* Collation range end */ + TRE_BRACKET_MATCH_TYPE_CLASS, /* Character class */ + TRE_BRACKET_MATCH_TYPE_EQUIVALENCE, /* Collation equivalence value */ +} tre_bracket_match_type_t; + +typedef struct { + tre_bracket_match_type_t type; + tre_cint_t value; +} tre_bracket_match_t; + +#define TRE_BRACKET_MATCH_FLAG_NEGATE 1 + +typedef struct { + int num_bracket_matches; + int flags; + tre_bracket_match_t bracket_matches[0]; +} tre_bracket_match_list_t; + +#define SIZEOF_BRACKET_MATCH_LIST_N(n) (sizeof(tre_bracket_match_list_t) + \ + sizeof(tre_bracket_match_t) * (n)) +#define SIZEOF_BRACKET_MATCH_LIST(l) SIZEOF_BRACKET_MATCH_LIST_N( \ + (l)->num_bracket_matches) + +/* The "count" field is the number of time the tag was set, initially zero. + The "first" field contains the first set value (when "count" equals 1). + The "value" field contains the current value of the tag, if "count" is + greater than zero (the tag's current value is -1 if "count" is zero). + The "touch" field is the touch value, a montonically increasing value + (maintained by the caller) set each time the tag itself is set. */ +typedef struct { + int count; + int first; + int value; + int touch; +} tre_tag_t; + +/* TNFA transition type. A TNFA state is an array of transitions, + the terminator is a transition with NULL `state'. */ +typedef struct tnfa_transition tre_tnfa_transition_t; + +struct tnfa_transition { + /* Range of accepted characters. */ + tre_cint_t code_min; + tre_cint_t code_max; + /* Pointer to the destination state. */ + tre_tnfa_transition_t *state; + /* ID number of the destination state. */ + int state_id; + /* -1 terminated array of tags (or NULL). */ + int *tags; + /* Matching parameters settings (or NULL). */ + int *params; + /* Assertion bitmap. */ + int assertions; + /* Assertion parameters. */ + union { + /* Bracket matches. */ + tre_bracket_match_list_t *bracket_match_list; + /* Back reference assertion. */ + int backref; + } u; +}; + + +/* Assertions. */ +#define ASSERT_AT_BOL 1 /* Beginning of line. */ +#define ASSERT_AT_EOL 2 /* End of line. */ +#define ASSERT_BRACKET_MATCH 4 /* Matches in `bracket_match_list'. */ +#define ASSERT_AT_BOW 8 /* Beginning of word. */ +#define ASSERT_AT_EOW 16 /* End of word. */ +#define ASSERT_AT_WB 32 /* Word boundary. */ +#define ASSERT_AT_WB_NEG 64 /* Not a word boundary. */ +#define ASSERT_BACKREF 128 /* A back reference in `backref'. */ +#define ASSERT_LAST 128 + +/* Tag directions. */ +typedef enum { + TRE_TAG_MINIMIZE = 0, + TRE_TAG_MAXIMIZE, + TRE_TAG_LEFT_MAXIMIZE, +} tre_tag_direction_t; + +/* Parameters that can be changed dynamically while matching. */ +typedef enum { + TRE_PARAM_COST_INS = 0, + TRE_PARAM_COST_DEL = 1, + TRE_PARAM_COST_SUBST = 2, + TRE_PARAM_COST_MAX = 3, + TRE_PARAM_MAX_INS = 4, + TRE_PARAM_MAX_DEL = 5, + TRE_PARAM_MAX_SUBST = 6, + TRE_PARAM_MAX_ERR = 7, + TRE_PARAM_DEPTH = 8, + TRE_PARAM_LAST = 9 +} tre_param_t; + +/* Unset matching parameter */ +#define TRE_PARAM_UNSET -1 + +/* Signifies the default matching parameter value. */ +#define TRE_PARAM_DEFAULT -2 + +/* Instructions to compute submatch register values from tag values + after a successful match. */ +struct tre_submatch_data { + /* Tag that gives the value for rm_so (submatch start offset). */ + int so_tag; + /* Tag that gives the value for rm_eo (submatch end offset). */ + int eo_tag; +}; + +typedef struct tre_submatch_data tre_submatch_data_t; + + +/* TNFA definition. */ +typedef struct tnfa tre_tnfa_t; + +struct tnfa { + tre_tnfa_transition_t *transitions; + tre_tnfa_transition_t *initial; + tre_tnfa_transition_t *final; + tre_submatch_data_t *submatch_data; +#ifdef USE_FIRSTPOS_CHARS /* not defined */ + char *firstpos_chars; +#endif /* USE_FIRSTPOS_CHARS */ + tre_tag_direction_t *tag_directions; + int *minimal_tags; + tre_last_matched_branch_t *last_matched_branch; + locale_t loc; + unsigned int num_transitions; + int first_char; + unsigned int num_submatches; + unsigned int num_submatches_invisible; + int num_tags; + int num_minimals; + int end_tag; + int num_states; + int cflags; + int have_backrefs; + int num_reorder_tags; + int have_approx; + int params_depth; +}; + +__private_extern__ int +tre_compile(regex_t * __restrict preg, const tre_char_t * __restrict regex, size_t n, int cflags, + locale_t __restrict loc); + +__private_extern__ void +tre_free(regex_t *preg); + +__private_extern__ reg_errcode_t +tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[ __restrict ], int cflags, + const tre_tnfa_t * __restrict tnfa, const tre_tag_t * __restrict tags, int match_eo); + +__private_extern__ reg_errcode_t +tre_tnfa_run_parallel(const tre_tnfa_t * __restrict tnfa, const void * __restrict string, int len, + tre_str_type_t type, tre_tag_t * __restrict match_tags, int eflags, + int * __restrict match_end_ofs); + +__private_extern__ reg_errcode_t +tre_tnfa_run_backtrack(const tre_tnfa_t * __restrict tnfa, const void * __restrict string, + int len, tre_str_type_t type, tre_tag_t * __restrict match_tags, + int eflags, int * __restrict match_end_ofs); + +#ifdef TRE_APPROX +__private_extern__ reg_errcode_t +tre_tnfa_run_approx(const tre_tnfa_t * __restrict tnfa, const void * __restrict string, int len, + tre_str_type_t type, tre_tag_t * __restrict match_tags, + regamatch_t * __restrict match, regaparams_t params, + int eflags, int * __restrict match_end_ofs); +#endif /* TRE_APPROX */ + +#endif /* TRE_INTERNAL_H */ + +/* EOF */ diff --git a/regex/TRE/lib/tre-match-backtrack.c b/regex/TRE/lib/tre-match-backtrack.c new file mode 100644 index 0000000..a03d1c6 --- /dev/null +++ b/regex/TRE/lib/tre-match-backtrack.c @@ -0,0 +1,789 @@ +/* + tre-match-backtrack.c - TRE backtracking regex matching engine + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +/* + This matcher is for regexps that use back referencing. Regexp matching + with back referencing is an NP-complete problem on the number of back + references. The easiest way to match them is to use a backtracking + routine which basically goes through all possible paths in the TNFA + and chooses the one which results in the best (leftmost and longest) + match. This can be spectacularly expensive and may run out of stack + space, but there really is no better known generic algorithm. Quoting + Henry Spencer from comp.compilers: + + + POSIX.2 REs require longest match, which is really exciting to + implement since the obsolete ("basic") variant also includes + \. I haven't found a better way of tackling this than doing + a preliminary match using a DFA (or simulation) on a modified RE + that just replicates subREs for \, and then doing a + backtracking match to determine whether the subRE matches were + right. This can be rather slow, but I console myself with the + thought that people who use \ deserve very slow execution. + (Pun unintentional but very appropriate.) + +*/ + + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + +/* Unset TRE_USE_ALLOCA to avoid using the stack to hold all the state + info while running */ +#undef TRE_USE_ALLOCA + +#ifdef TRE_USE_ALLOCA +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif +#endif /* TRE_USE_ALLOCA */ + +#include +#include +#include +#ifdef HAVE_WCHAR_H +#include +#endif /* HAVE_WCHAR_H */ +#ifdef HAVE_WCTYPE_H +#include +#endif /* HAVE_WCTYPE_H */ +#ifndef TRE_WCHAR +#include +#endif /* !TRE_WCHAR */ +#ifdef HAVE_MALLOC_H +#include +#endif /* HAVE_MALLOC_H */ + +#include "tre-internal.h" +#include "tre-mem.h" +#include "tre-match-utils.h" +#include "tre.h" +#include "xmalloc.h" + +typedef struct { + int pos; + unsigned int pos_add_next; + const char *str_byte; +#ifdef TRE_WCHAR + const wchar_t *str_wide; +#endif /* TRE_WCHAR */ + tre_tnfa_transition_t *state; + int state_id; + int next_c; + tre_tag_t *tags; +#ifdef TRE_MBSTATE + mbstate_t mbstate; +#endif /* TRE_MBSTATE */ +} tre_backtrack_item_t; + +typedef struct tre_backtrack_struct { + tre_backtrack_item_t item; + struct tre_backtrack_struct *prev; + struct tre_backtrack_struct *next; +} *tre_backtrack_t; + +#ifdef TRE_WCHAR +#define BT_STACK_WIDE_IN(_str_wide) stack->item.str_wide = (_str_wide) +#define BT_STACK_WIDE_OUT (str_wide) = stack->item.str_wide +#else /* !TRE_WCHAR */ +#define BT_STACK_WIDE_IN(_str_wide) +#define BT_STACK_WIDE_OUT +#endif /* !TRE_WCHAR */ + +#ifdef TRE_MBSTATE +#define BT_STACK_MBSTATE_IN stack->item.mbstate = (mbstate) +#define BT_STACK_MBSTATE_OUT (mbstate) = stack->item.mbstate +#else /* !TRE_MBSTATE */ +#define BT_STACK_MBSTATE_IN +#define BT_STACK_MBSTATE_OUT +#endif /* !TRE_MBSTATE */ + + +#ifdef TRE_USE_ALLOCA +#define tre_bt_mem_new tre_mem_newa +#define tre_bt_mem_alloc tre_mem_alloca +#define tre_bt_mem_destroy(obj) do { } while (0) +#else /* !TRE_USE_ALLOCA */ +#define tre_bt_mem_new tre_mem_new +#define tre_bt_mem_alloc tre_mem_alloc +#define tre_bt_mem_destroy tre_mem_destroy +#endif /* !TRE_USE_ALLOCA */ + + +#define BT_STACK_PUSH(_pos, _pos_add_next, _str_byte, _str_wide, _state, _state_id, _next_c, _tags, _mbstate) \ + do \ + { \ + if (!stack->next) \ + { \ + tre_backtrack_t s; \ + s = tre_bt_mem_alloc(mem, sizeof(*s)); \ + if (!s) \ + { \ + tre_bt_mem_destroy(mem); \ + if (tags) \ + xfree(tags); \ + if (pmatch) \ + xfree(pmatch); \ + if (states_seen) \ + xfree(states_seen); \ + return REG_ESPACE; \ + } \ + s->prev = stack; \ + s->next = NULL; \ + s->item.tags = tre_bt_mem_alloc(mem, \ + num_tags * sizeof(*tags)); \ + if (!s->item.tags) \ + { \ + tre_bt_mem_destroy(mem); \ + if (tags) \ + xfree(tags); \ + if (pmatch) \ + xfree(pmatch); \ + if (states_seen) \ + xfree(states_seen); \ + return REG_ESPACE; \ + } \ + stack->next = s; \ + stack = s; \ + } \ + else \ + stack = stack->next; \ + stack->item.pos = (_pos); \ + stack->item.pos_add_next = (_pos_add_next); \ + stack->item.str_byte = (_str_byte); \ + BT_STACK_WIDE_IN(_str_wide); \ + stack->item.state = (_state); \ + stack->item.state_id = (_state_id); \ + stack->item.next_c = (_next_c); \ + memcpy(stack->item.tags, (_tags), num_tags * sizeof(*(_tags))); \ + BT_STACK_MBSTATE_IN; \ + } \ + while (/*CONSTCOND*/0) + +#ifdef TRE_STR_USER +#define BT_STACK_POP() \ + do \ + { \ + assert(stack->prev); \ + pos = stack->item.pos; \ + pos_add_next = stack->item.pos_add_next; \ + if (type == STR_USER) \ + str_source->rewind(pos + pos_add_next, str_source->context); \ + str_byte = stack->item.str_byte; \ + BT_STACK_WIDE_OUT; \ + state = stack->item.state; \ + next_c = stack->item.next_c; \ + memcpy(tags, stack->item.tags, num_tags * sizeof(*tags)); \ + BT_STACK_MBSTATE_OUT; \ + stack = stack->prev; \ + } \ + while (/*CONSTCOND*/0) +#else /* !TRE_STR_USER */ +#define BT_STACK_POP() \ + do \ + { \ + assert(stack->prev); \ + pos = stack->item.pos; \ + pos_add_next = stack->item.pos_add_next; \ + str_byte = stack->item.str_byte; \ + BT_STACK_WIDE_OUT; \ + state = stack->item.state; \ + next_c = stack->item.next_c; \ + memcpy(tags, stack->item.tags, num_tags * sizeof(*tags)); \ + BT_STACK_MBSTATE_OUT; \ + stack = stack->prev; \ + } \ + while (/*CONSTCOND*/0) +#endif /* !TRE_STR_USER */ + +#undef MIN +#define MIN(a, b) ((a) <= (b) ? (a) : (b)) + +reg_errcode_t +tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, + int len, tre_str_type_t type, tre_tag_t *match_tags, + int eflags, int *match_end_ofs) +{ + /* State variables required by GET_NEXT_WCHAR. */ + tre_char_t prev_c = 0, next_c = 0; + const char *str_byte = string; + int pos = 0; + unsigned int pos_add_next = 1; +#ifdef TRE_WCHAR + const wchar_t *str_wide = string; +#ifdef TRE_MBSTATE + mbstate_t mbstate; +#endif /* TRE_MBSTATE */ +#endif /* TRE_WCHAR */ + int reg_notbol = eflags & REG_NOTBOL; + int reg_noteol = eflags & REG_NOTEOL; + int reg_newline = tnfa->cflags & REG_NEWLINE; +#ifdef TRE_STR_USER + int str_user_end = 0; +#endif /* TRE_STR_USER */ + int i; + + /* These are used to remember the necessary values of the above + variables to return to the position where the current search + started from. */ + int next_c_start; + const char *str_byte_start; + int pos_start = -1; +#ifdef TRE_WCHAR + const wchar_t *str_wide_start; +#endif /* TRE_WCHAR */ +#ifdef TRE_MBSTATE + mbstate_t mbstate_start; +#endif /* TRE_MBSTATE */ + + /* End offset of best match so far, or -1 if no match found yet. */ + int match_eo = -1; + /* Tag arrays. */ + int *next_tags; + tre_tag_t *tags = NULL; + /* Current TNFA state. */ + tre_tnfa_transition_t *state; + int *states_seen = NULL; + + /* Memory allocator to for allocating the backtracking stack. */ + tre_mem_t mem = tre_bt_mem_new(); + + /* The backtracking stack. */ + tre_backtrack_t stack; + + tre_tnfa_transition_t *trans_i; + regmatch_t *pmatch = NULL; + reg_errcode_t ret; + + int num_tags = tnfa->num_tags; + int touch = 1; + char *buf = NULL; + int tbytes; + +#ifdef TRE_MBSTATE + memset(&mbstate, '\0', sizeof(mbstate)); +#endif /* TRE_MBSTATE */ + + if (!mem) + return REG_ESPACE; + stack = tre_bt_mem_alloc(mem, sizeof(*stack)); + if (!stack) + { + ret = REG_ESPACE; + goto error_exit; + } + stack->prev = NULL; + stack->next = NULL; + + DPRINT(("tnfa_execute_backtrack, input type %d\n", type)); + DPRINT(("len = %d\n", len)); + + { + int pbytes, sbytes, total_bytes; + char *tmp_buf; + /* Compute the length of the block we need. */ + tbytes = sizeof(*tags) * num_tags; + pbytes = sizeof(*pmatch) * tnfa->num_submatches; + sbytes = sizeof(*states_seen) * tnfa->num_states; + total_bytes = + (sizeof(long) - 1) * 2 /* for alignment paddings */ + + tbytes + pbytes + sbytes; + + DPRINT(("tre_tnfa_run_backtrack, allocate %d bytes\n", total_bytes)); + /* Allocate the memory. */ +#ifdef TRE_USE_ALLOCA + buf = alloca(total_bytes); +#else /* !TRE_USE_ALLOCA */ + buf = xmalloc((unsigned)total_bytes); +#endif /* !TRE_USE_ALLOCA */ + if (buf == NULL) + return REG_ESPACE; + + /* Get the various pointers within tmp_buf (properly aligned). */ + tags = (void *)buf; + tmp_buf = buf + tbytes; + tmp_buf += ALIGN(tmp_buf, long); + pmatch = (void *)tmp_buf; + tmp_buf += pbytes; + tmp_buf += ALIGN(tmp_buf, long); + states_seen = (void *)tmp_buf; + } + + retry: + { + memset(tags, 0, num_tags * sizeof(*tags)); + if (match_tags) + memset(match_tags, 0, num_tags * sizeof(*match_tags)); + for (i = 0; i < tnfa->num_states; i++) + states_seen[i] = 0; + } + + state = NULL; + pos = pos_start; +#ifdef TRE_STR_USER + if (type == STR_USER) + str_source->rewind(pos + pos_add_next, str_source->context); +#endif /* TRE_STR_USER */ + GET_NEXT_WCHAR(); + pos_start = pos; + next_c_start = next_c; + str_byte_start = str_byte; +#ifdef TRE_WCHAR + str_wide_start = str_wide; +#endif /* TRE_WCHAR */ +#ifdef TRE_MBSTATE + mbstate_start = mbstate; +#endif /* TRE_MBSTATE */ + + /* Handle initial states. */ + next_tags = NULL; + for (trans_i = tnfa->initial; trans_i->state; trans_i++) + { + DPRINT(("> init %p, prev_c %lc\n", trans_i->state, (tre_cint_t)prev_c)); + if (trans_i->assertions && CHECK_ASSERTIONS(trans_i->assertions)) + { + DPRINT(("assert failed\n")); + continue; + } + if (state == NULL) + { + /* Start from this state. */ + state = trans_i->state; + next_tags = trans_i->tags; + } + else + { + /* Backtrack to this state. */ + DPRINT(("saving state %d for backtracking\n", trans_i->state_id)); + BT_STACK_PUSH(pos, pos_add_next, str_byte, str_wide, trans_i->state, + trans_i->state_id, next_c, tags, mbstate); + { + int *tmp = trans_i->tags; + if (tmp) + { + while (*tmp >= 0) + tre_tag_set(stack->item.tags, *tmp++, pos, touch); + touch++; + } + } + } + } + + if (next_tags) + { + for (; *next_tags >= 0; next_tags++) + tre_tag_set(tags, *next_tags, pos, touch); + touch++; + } + + + DPRINT(("entering match loop, pos %d, str_byte %p\n", pos, str_byte)); + DPRINT(("pos:chr/code | state and tags\n")); + DPRINT(("-------------+------------------------------------------------\n")); + + if (state == NULL) + goto backtrack; + + while (/*CONSTCOND*/1) + { + tre_tnfa_transition_t *next_state; + int empty_br_match; + + DPRINT(("start loop\n")); + + if (match_eo >= 0 && tnfa->num_minimals) + { + int skip = 0; +#ifdef TRE_DEBUG + DPRINT(("Checking minimal conditions: match_eo=%d match_tags=", + match_eo)); + tre_print_tags(match_tags, tnfa->num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + for (i = 0; tnfa->minimal_tags[i] >= 0; i += 2) + { + int end = tnfa->minimal_tags[i]; + int start = tnfa->minimal_tags[i + 1]; + DPRINT((" Minimal start %d, end %d\n", start, end)); + if (tre_minimal_tag_order(start, end, match_tags, tags) > 0) + { + skip = 1; + break; + } + } + if (!skip) + { +#ifdef TRE_DEBUG + DPRINT((" Keeping tags=")); + tre_print_tags(tags, tnfa->num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + } + else + { +#ifdef TRE_DEBUG + DPRINT((" Throwing out tags=")); + tre_print_tags(tags, tnfa->num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + goto backtrack; + } + } + + if (state == tnfa->final) + { + DPRINT((" match found, match_eo=%d pos=%d\n", match_eo, pos)); + + if (match_eo >= 0 && tnfa->num_minimals) + { + int compare = 0; +#ifdef TRE_DEBUG + DPRINT(("Checking minimal conditions: match_eo=%d " + "match_tags=", match_eo)); + tre_print_tags(match_tags, tnfa->num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + for (i = 0; tnfa->minimal_tags[i] >= 0; i += 2) + { + int end = tnfa->minimal_tags[i]; + int start = tnfa->minimal_tags[i + 1]; + DPRINT((" Minimal start %d, end %d\n", start, end)); + if ((compare = tre_minimal_tag_order(start, end, + match_tags, tags)) != 0) + break; + } + if (compare > 0) + { +#ifdef TRE_DEBUG + DPRINT((" Throwing out new match, tags=")); + tre_print_tags(tags, tnfa->num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + goto backtrack; + } + else if (compare < 0) + { +#ifdef TRE_DEBUG + DPRINT((" Throwing out old match, tags=")); + tre_print_tags(match_tags, tnfa->num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + match_eo = -1; + } + } + + if (match_eo < pos + || (match_eo == pos + && match_tags + && tre_tag_order(tnfa->num_tags, tnfa->tag_directions, + tags, match_tags))) + { + /* This match wins the previous match. */ +#ifdef TRE_DEBUG + DPRINT((" win previous tags=")); + tre_print_tags(tags, tnfa->num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + match_eo = pos; + if (match_tags) + memcpy(match_tags, tags, num_tags * sizeof(*tags)); + } + /* Our TNFAs never have transitions leaving from the final state, + so we jump right to backtracking. */ + goto backtrack; + } + +#ifdef TRE_DEBUG + DPRINT(("%3d:%2lc/%05d | %p ", pos, (tre_cint_t)next_c, (int)next_c, + state)); + tre_print_tags(tags, tnfa->num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + + /* Go to the next character in the input string. */ + empty_br_match = 0; + trans_i = state; + if (trans_i->state && trans_i->assertions & ASSERT_BACKREF) + { + /* This is a back reference state. All transitions leaving from + this state have the same back reference "assertion". Instead + of reading the next character, we match the back reference. */ + int so, eo, bt = trans_i->u.backref; + int bt_len; + int result; + + DPRINT((" should match back reference %d\n", bt)); + /* Get the substring we need to match against. Remember to + turn off REG_NOSUB temporarily. */ + ret = tre_fill_pmatch(bt + 1, pmatch, tnfa->cflags & ~REG_NOSUB, + tnfa, tags, pos); + if (ret != REG_OK) goto error_exit; + so = pmatch[bt].rm_so; + eo = pmatch[bt].rm_eo; + bt_len = eo - so; + +#ifdef TRE_DEBUG + { + int slen; + if (len < 0) + slen = bt_len; + else + slen = MIN(bt_len, len - pos); + + if (type == STR_BYTE) + { + DPRINT((" substring (len %d) is [%d, %d]: '%.*s'\n", + bt_len, so, eo, bt_len, (char*)string + so)); + DPRINT((" current string is '%.*s'\n", slen, str_byte - 1)); + } +#ifdef TRE_WCHAR + else if (type == STR_WIDE) + { + DPRINT((" substring (len %d) is [%d, %d]: '%.*" STRF "'\n", + bt_len, so, eo, bt_len, (wchar_t*)string + so)); + DPRINT((" current string is '%.*" STRF "'\n", + slen, str_wide - 1)); + } +#endif /* TRE_WCHAR */ + } +#endif + + if (so < 0) + { + result = 1; /* Back reference of nomatch doesn't match */ + } + else if (len < 0) + { +#ifdef TRE_STR_USER + if (type == STR_USER) + result = str_source->compare((unsigned)so, (unsigned)pos, + (unsigned)bt_len, + str_source->context); + else +#endif /* TRE_STR_USER */ +#ifdef TRE_WCHAR + if (type == STR_WIDE) + result = wcsncmp((const wchar_t*)string + so, str_wide - 1, + (size_t)bt_len); + else +#endif /* TRE_WCHAR */ + result = strncmp((const char*)string + so, str_byte - 1, + (size_t)bt_len); + } + else if (len - pos < bt_len) + result = 1; +#ifdef TRE_WCHAR + else if (type == STR_WIDE) + result = wmemcmp((const wchar_t*)string + so, str_wide - 1, + (size_t)bt_len); +#endif /* TRE_WCHAR */ + else + result = memcmp((const char*)string + so, str_byte - 1, + (size_t)bt_len); + + if (result == 0) + { + /* Back reference matched. Check for infinite loop. */ + if (bt_len == 0) + empty_br_match = 1; + if (empty_br_match && states_seen[trans_i->state_id]) + { + DPRINT((" avoid loop\n")); + goto backtrack; + } + + states_seen[trans_i->state_id] = empty_br_match; + + /* Advance in input string and resync `prev_c', `next_c' + and pos. */ + DPRINT((" back reference matched\n")); + str_byte += bt_len - 1; +#ifdef TRE_WCHAR + str_wide += bt_len - 1; +#endif /* TRE_WCHAR */ + pos += bt_len - 1; + GET_NEXT_WCHAR(); + DPRINT((" pos now %d\n", pos)); + } + else + { + DPRINT((" back reference did not match\n")); + goto backtrack; + } + } + else + { + /* Check for end of string. */ + if (len < 0) + { +#ifdef TRE_STR_USER + if (type == STR_USER) + { + if (str_user_end) + goto backtrack; + } + else +#endif /* TRE_STR_USER */ + if (next_c == L'\0') + goto backtrack; + } + else + { + if (pos >= len) + goto backtrack; + } + + /* Read the next character. */ + GET_NEXT_WCHAR(); + } + + next_state = NULL; + for (trans_i = state; trans_i->state; trans_i++) + { + DPRINT((" transition %d-%d (%c-%c) %d to %d\n", + trans_i->code_min, trans_i->code_max, + trans_i->code_min, trans_i->code_max, + trans_i->assertions, trans_i->state_id)); + if (trans_i->code_min <= (tre_cint_t)prev_c + && trans_i->code_max >= (tre_cint_t)prev_c) + { + if (trans_i->assertions + && (CHECK_ASSERTIONS(trans_i->assertions) + || CHECK_CHAR_CLASSES(trans_i, tnfa, eflags))) + { + DPRINT((" assertion failed\n")); + continue; + } + + if (next_state == NULL) + { + /* First matching transition. */ + DPRINT((" Next state is %d\n", trans_i->state_id)); + next_state = trans_i->state; + next_tags = trans_i->tags; + } + else + { + /* Second matching transition. We may need to backtrack here + to take this transition instead of the first one, so we + push this transition in the backtracking stack so we can + jump back here if needed. */ + DPRINT((" saving state %d for backtracking\n", + trans_i->state_id)); + BT_STACK_PUSH(pos, pos_add_next, str_byte, str_wide, + trans_i->state, trans_i->state_id, next_c, + tags, mbstate); + { + int *tmp; + for (tmp = trans_i->tags; tmp && *tmp >= 0; tmp++) + tre_tag_set(stack->item.tags, *tmp, pos, touch); + touch++; + } +#if 0 /* XXX - it's important not to look at all transitions here to keep + the stack small! */ + break; +#endif + } + } + } + + if (next_state != NULL) + { + /* Matching transitions were found. Take the first one. */ + state = next_state; + + /* Update the tag values. */ + if (next_tags) + { + while (*next_tags >= 0) + tre_tag_set(tags, *next_tags++, pos, touch); + touch++; + } + } + else + { + backtrack: + /* A matching transition was not found. Try to backtrack. */ + if (stack->prev) + { + DPRINT((" backtracking\n")); + if (stack->item.state->assertions & ASSERT_BACKREF) + { + DPRINT((" states_seen[%d] = 0\n", + stack->item.state_id)); + states_seen[stack->item.state_id] = 0; + } + + BT_STACK_POP(); + } + else if (match_eo < 0) + { + /* Try starting from a later position in the input string. */ + /* Check for end of string. */ + if (pos == pos_start) + { + if (len < 0) + { + if (next_c == L'\0') + { + DPRINT(("end of string.\n")); + break; + } + } + else + { + if (pos >= len) + { + DPRINT(("end of string.\n")); + break; + } + } + } + DPRINT(("restarting from next start position\n")); + next_c = next_c_start; +#ifdef TRE_MBSTATE + mbstate = mbstate_start; +#endif /* TRE_MBSTATE */ + str_byte = str_byte_start; +#ifdef TRE_WCHAR + str_wide = str_wide_start; +#endif /* TRE_WCHAR */ + goto retry; + } + else + { + DPRINT(("finished\n")); + break; + } + } + } + + ret = match_eo >= 0 ? REG_OK : REG_NOMATCH; + *match_end_ofs = match_eo; + + error_exit: + tre_bt_mem_destroy(mem); +#ifndef TRE_USE_ALLOCA + if (buf) + xfree(buf); +#endif /* !TRE_USE_ALLOCA */ + + return ret; +} diff --git a/regex/TRE/lib/tre-match-parallel.c b/regex/TRE/lib/tre-match-parallel.c new file mode 100644 index 0000000..c6ce76f --- /dev/null +++ b/regex/TRE/lib/tre-match-parallel.c @@ -0,0 +1,631 @@ +/* + tre-match-parallel.c - TRE parallel regex matching engine + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +/* + This algorithm searches for matches basically by reading characters + in the searched string one by one, starting at the beginning. All + matching paths in the TNFA are traversed in parallel. When two or + more paths reach the same state, exactly one is chosen according to + tag ordering rules; if returning submatches is not required it does + not matter which path is chosen. + + The worst case time required for finding the leftmost and longest + match, or determining that there is no match, is always linearly + dependent on the length of the text being searched. + + This algorithm cannot handle TNFAs with back referencing nodes. + See `tre-match-backtrack.c'. +*/ + + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + +/* Unset TRE_USE_ALLOCA to avoid using the stack to hold all the state + info while running */ +#undef TRE_USE_ALLOCA + +#ifdef TRE_USE_ALLOCA +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif +#endif /* TRE_USE_ALLOCA */ + +#include +#include +#include +#ifdef HAVE_WCHAR_H +#include +#endif /* HAVE_WCHAR_H */ +#ifdef HAVE_WCTYPE_H +#include +#endif /* HAVE_WCTYPE_H */ +#ifndef TRE_WCHAR +#include +#endif /* !TRE_WCHAR */ +#ifdef HAVE_MALLOC_H +#include +#endif /* HAVE_MALLOC_H */ + +#include "tre-internal.h" +#include "tre-match-utils.h" +#include "tre.h" +#include "xmalloc.h" + + + +typedef struct { + tre_tnfa_transition_t *state; + tre_tag_t *tags; +} tre_tnfa_reach_t; + +typedef struct { + int pos; + tre_tag_t **tags; +} tre_reach_pos_t; + + +#ifdef TRE_DEBUG +static void +tre_print_reach1(tre_tnfa_transition_t *state, tre_tag_t *tags, int num_tags) +{ + DPRINT((" %p", (void *)state)); + if (num_tags > 0) + { + DPRINT(("/")); + tre_print_tags(tags, num_tags); + } +} + +static void +tre_print_reach(const tre_tnfa_t *tnfa, tre_tnfa_reach_t *reach, int num_tags) +{ + while (reach->state != NULL) + { + tre_print_reach1(reach->state, reach->tags, num_tags); + reach++; + } + DPRINT(("\n")); + +} +#endif /* TRE_DEBUG */ + +reg_errcode_t +tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len, + tre_str_type_t type, tre_tag_t *match_tags, int eflags, + int *match_end_ofs) +{ + /* State variables required by GET_NEXT_WCHAR. */ + tre_char_t prev_c = 0, next_c = 0; + const char *str_byte = string; + int pos = -1; + unsigned int pos_add_next = 1; +#ifdef TRE_WCHAR + const wchar_t *str_wide = string; +#ifdef TRE_MBSTATE + mbstate_t mbstate; +#endif /* TRE_MBSTATE */ +#endif /* TRE_WCHAR */ + int reg_notbol = eflags & REG_NOTBOL; + int reg_noteol = eflags & REG_NOTEOL; + int reg_newline = tnfa->cflags & REG_NEWLINE; +#ifdef TRE_STR_USER + int str_user_end = 0; +#endif /* TRE_STR_USER */ + + char *buf; + tre_tnfa_transition_t *trans_i; + tre_tnfa_reach_t *reach, *reach_next, *reach_i, *reach_next_i; + tre_reach_pos_t *reach_pos; + int *tag_i; + int num_tags, i; + + int match_eo = -1; /* end offset of match (-1 if no match found yet) */ +#ifdef TRE_DEBUG + int once; +#endif /* TRE_DEBUG */ + tre_tag_t *tmp_tags = NULL; + tre_tag_t *tmp_iptr; + size_t tbytes; + int touch = 1; + +#ifdef TRE_MBSTATE + memset(&mbstate, '\0', sizeof(mbstate)); +#endif /* TRE_MBSTATE */ + + DPRINT(("tre_tnfa_run_parallel, input type %d\n", type)); + + if (!match_tags) + num_tags = 0; + else + num_tags = tnfa->num_tags; + + /* Allocate memory for temporary data required for matching. This needs to + be done for every matching operation to be thread safe. This allocates + everything in a single large block from the stack frame using alloca() + or with malloc() if alloca is unavailable. */ + { + size_t rbytes, pbytes, total_bytes; + char *tmp_buf; + /* Compute the length of the block we need. */ + tbytes = sizeof(*tmp_tags) * num_tags; + rbytes = sizeof(*reach_next) * (tnfa->num_states + 1); + pbytes = sizeof(*reach_pos) * tnfa->num_states; + total_bytes = + (sizeof(long) - 1) * 4 /* for alignment paddings */ + + (rbytes + tbytes * tnfa->num_states) * 2 + tbytes + pbytes; + + DPRINT(("tre_tnfa_run_parallel, allocate %d bytes\n", total_bytes)); + /* Allocate the memory. */ +#ifdef TRE_USE_ALLOCA + buf = alloca(total_bytes); +#else /* !TRE_USE_ALLOCA */ + buf = xmalloc(total_bytes); +#endif /* !TRE_USE_ALLOCA */ + if (buf == NULL) + return REG_ESPACE; + memset(buf, 0, total_bytes); + + /* Get the various pointers within tmp_buf (properly aligned). */ + tmp_tags = (void *)buf; + tmp_buf = buf + tbytes; + tmp_buf += ALIGN(tmp_buf, long); + reach_next = (void *)tmp_buf; + tmp_buf += rbytes; + tmp_buf += ALIGN(tmp_buf, long); + reach = (void *)tmp_buf; + tmp_buf += rbytes; + tmp_buf += ALIGN(tmp_buf, long); + reach_pos = (void *)tmp_buf; + tmp_buf += pbytes; + tmp_buf += ALIGN(tmp_buf, long); + for (i = 0; i < tnfa->num_states; i++) + { + reach[i].tags = (void *)tmp_buf; + tmp_buf += tbytes; + reach_next[i].tags = (void *)tmp_buf; + tmp_buf += tbytes; + } + } + + for (i = 0; i < tnfa->num_states; i++) + reach_pos[i].pos = -1; + + /* If only one character can start a match, find it first. */ + if (tnfa->first_char >= 0 && str_byte) + { + const char *orig_str = str_byte; + int first = tnfa->first_char; + int found_high_bit = 0; + + + if (type == STR_BYTE) + { + if (len >= 0) + str_byte = memchr(orig_str, first, (size_t)len); + else + str_byte = strchr(orig_str, first); + } + else if (type == STR_MBS) + { + /* + * If the match character is ASCII, try to match the character + * directly, but if a high bit character is found, we stop there. + */ + if (first < 0x80) + { + if (len >= 0) + { + int i; + for (i = 0; ; str_byte++, i++) + { + if (i >= len) + { + str_byte = NULL; + break; + } + if (*str_byte == first) + break; + if (*str_byte & 0x80) + { + found_high_bit = 1; + break; + } + } + } + else + { + for (; ; str_byte++) + { + if (!*str_byte) + { + str_byte = NULL; + break; + } + if (*str_byte == first) + break; + if (*str_byte & 0x80) + { + found_high_bit = 1; + break; + } + } + } + } + else + { + if (len >= 0) + { + int i; + for (i = 0; ; str_byte++, i++) + { + if (i >= len) + { + str_byte = NULL; + break; + } + if (*str_byte & 0x80) + { + found_high_bit = 1; + break; + } + } + } + else + { + for (; ; str_byte++) + { + if (!*str_byte) + { + str_byte = NULL; + break; + } + if (*str_byte & 0x80) + { + found_high_bit = 1; + break; + } + } + } + } + } + if (str_byte == NULL) + { +#ifndef TRE_USE_ALLOCA + if (buf) + xfree(buf); +#endif /* !TRE_USE_ALLOCA */ + return REG_NOMATCH; + } + DPRINT(("skipped %lu chars\n", (unsigned long)(str_byte - orig_str))); + if (!found_high_bit) + { + if (str_byte >= orig_str + 1) + prev_c = (unsigned char)*(str_byte - 1); + next_c = (unsigned char)*str_byte; + pos = str_byte - orig_str; + if (len < 0 || pos < len) + str_byte++; + } + else + { + if (str_byte == orig_str) + goto no_first_optimization; + /* + * Back up one character, fix up the position, then call + * GET_NEXT_WCHAR() to process the multibyte character. + */ + /* no need to set prev_c, since GET_NEXT_WCHAR will overwrite */ + next_c = (unsigned char)*(str_byte - 1); + pos = (str_byte - 1) - orig_str; + GET_NEXT_WCHAR(); + } + } + else + { +no_first_optimization: + GET_NEXT_WCHAR(); + pos = 0; + } + +#ifdef USE_FIRSTPOS_CHARS /* not defined */ + /* Skip over characters that cannot possibly be the first character + of a match. */ + if (tnfa->firstpos_chars != NULL) + { + char *chars = tnfa->firstpos_chars; + + if (len < 0) + { + const char *orig_str = str_byte; + /* XXX - use strpbrk() and wcspbrk() because they might be + optimized for the target architecture. Try also strcspn() + and wcscspn() and compare the speeds. */ + while (next_c != L'\0' && !chars[next_c]) + { + next_c = *str_byte++; + } + prev_c = *(str_byte - 2); + pos += str_byte - orig_str; + DPRINT(("skipped %d chars\n", str_byte - orig_str)); + } + else + { + while (pos <= len && !chars[next_c]) + { + prev_c = next_c; + next_c = (unsigned char)(*str_byte++); + pos++; + } + } + } +#endif /* USE_FIRSTPOS_CHARS */ + + DPRINT(("length: %d\n", len)); + DPRINT(("pos:chr/code | states and tags\n")); + DPRINT(("-------------+------------------------------------------------\n")); + + reach_next_i = reach_next; + while (/*CONSTCOND*/1) + { + /* If no match found yet, add the initial states to `reach_next'. */ + if (match_eo < 0) + { + DPRINT((" init >")); + trans_i = tnfa->initial; + while (trans_i->state != NULL) + { + if (reach_pos[trans_i->state_id].pos < pos) + { + if (trans_i->assertions + && CHECK_ASSERTIONS(trans_i->assertions)) + { + DPRINT(("assertion failed\n")); + trans_i++; + continue; + } + + DPRINT((" %p", (void *)trans_i->state)); + reach_next_i->state = trans_i->state; + memset(reach_next_i->tags, 0, tbytes); + tag_i = trans_i->tags; + if (tag_i) + { + while (*tag_i >= 0) + { + if (*tag_i < num_tags) + tre_tag_set(reach_next_i->tags, *tag_i, pos, touch); + tag_i++; + } + touch++; + } + if (reach_next_i->state == tnfa->final) + { + DPRINT((" found empty match\n")); + match_eo = pos; + memcpy(match_tags, reach_next_i->tags, tbytes); + } + reach_pos[trans_i->state_id].pos = pos; + reach_pos[trans_i->state_id].tags = &reach_next_i->tags; + reach_next_i++; + } + trans_i++; + } + DPRINT(("\n")); + reach_next_i->state = NULL; + } + else + { + if (num_tags == 0 || reach_next_i == reach_next) + /* We have found a match. */ + break; + } + + /* Check for end of string. */ + if (len < 0) + { +#ifdef TRE_STR_USER + if (type == STR_USER) + { + if (str_user_end) + break; + } + else +#endif /* TRE_STR_USER */ + if (next_c == L'\0') + break; + } + else + { + if (pos >= len) + break; + } + + GET_NEXT_WCHAR(); + +#ifdef TRE_DEBUG + DPRINT(("%3d:%2lc/%05d |", pos - 1, (tre_cint_t)prev_c, (int)prev_c)); + tre_print_reach(tnfa, reach_next, num_tags); + //DPRINT(("%3d:%2lc/%05d |", pos, (tre_cint_t)next_c, (int)next_c)); + //tre_print_reach(tnfa, reach_next, num_tags); +#endif /* TRE_DEBUG */ + + /* Swap `reach' and `reach_next'. */ + reach_i = reach; + reach = reach_next; + reach_next = reach_i; + +#ifdef TRE_DEBUG + once = 0; +#endif /* TRE_DEBUG */ + + /* For each state in `reach' see if there is a transition leaving with + the current input symbol to a state not yet in `reach_next', and + add the destination states to `reach_next'. */ + reach_next_i = reach_next; + for (reach_i = reach; reach_i->state; reach_i++) + { + for (trans_i = reach_i->state; trans_i->state; trans_i++) + { + /* Does this transition match the input symbol? */ + if (trans_i->code_min <= (tre_cint_t)prev_c && + trans_i->code_max >= (tre_cint_t)prev_c) + { + if (trans_i->assertions + && (CHECK_ASSERTIONS(trans_i->assertions) + || CHECK_CHAR_CLASSES(trans_i, tnfa, eflags))) + { + DPRINT(("assertion failed\n")); + continue; + } + + /* Compute the tags after this transition. */ + memcpy(tmp_tags, reach_i->tags, tbytes); + tag_i = trans_i->tags; + if (tag_i != NULL) + { + while (*tag_i >= 0) + { + if (*tag_i < num_tags) + tre_tag_set(tmp_tags, *tag_i, pos, touch); + tag_i++; + } + touch++; + } + + /* For each new transition, weed out those that don't + fulfill the minimal matching conditions. */ + if (tnfa->num_minimals && match_eo >= 0) + { + int skip = 0; +#ifdef TRE_DEBUG + if (!once) + { + DPRINT(("Checking minimal conditions: match_eo=%d " + "match_tags=", match_eo)); + tre_print_tags(match_tags, num_tags); + DPRINT(("\n")); + once++; + } +#endif /* TRE_DEBUG */ + for (i = 0; tnfa->minimal_tags[i] >= 0; i += 2) + { + int end = tnfa->minimal_tags[i]; + int start = tnfa->minimal_tags[i + 1]; + DPRINT((" Minimal start %d, end %d\n", start, end)); + if (tre_minimal_tag_order(start, end, match_tags, + tmp_tags) > 0) + { + skip = 1; + break; + } + } + if (skip) + { +#ifdef TRE_DEBUG + DPRINT((" Throwing out")); + tre_print_reach1(reach_i->state, tmp_tags, + num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + continue; + } + } + + if (reach_pos[trans_i->state_id].pos < pos) + { + /* Found an unvisited node. */ + reach_next_i->state = trans_i->state; + tmp_iptr = reach_next_i->tags; + reach_next_i->tags = tmp_tags; + tmp_tags = tmp_iptr; + reach_pos[trans_i->state_id].pos = pos; + reach_pos[trans_i->state_id].tags = &reach_next_i->tags; + + if (reach_next_i->state == tnfa->final + && (match_eo == -1 + || (num_tags > 0 + && tre_tag_get(reach_next_i->tags, 0) <= + tre_tag_get(match_tags, 0)))) + { +#ifdef TRE_DEBUG + DPRINT((" found match")); + tre_print_reach1(trans_i->state, reach_next_i->tags, num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + match_eo = pos; + memcpy(match_tags, reach_next_i->tags, tbytes); + } + reach_next_i++; + + } + else + { + assert(reach_pos[trans_i->state_id].pos == pos); + /* Another path has also reached this state. We choose + the winner by examining the tag values for both + paths. */ + if (tre_tag_order(num_tags, tnfa->tag_directions, + tmp_tags, + *reach_pos[trans_i->state_id].tags)) + { + /* The new path wins. */ + tmp_iptr = *reach_pos[trans_i->state_id].tags; + *reach_pos[trans_i->state_id].tags = tmp_tags; + if (trans_i->state == tnfa->final) + { +#ifdef TRE_DEBUG + DPRINT((" found better match")); + tre_print_reach1(trans_i->state, tmp_tags, num_tags); + DPRINT(("\n")); +#endif /* TRE_DEBUG */ + match_eo = pos; + memcpy(match_tags, tmp_tags, tbytes); + } + tmp_tags = tmp_iptr; + } + } + } + } + } + reach_next_i->state = NULL; + } + + DPRINT(("match end offset = %d\n", match_eo)); + + *match_end_ofs = match_eo; +#ifdef TRE_DEBUG + if (match_tags) + { + DPRINT(("Winning tags=")); + tre_print_tags_all(match_tags, num_tags); + DPRINT((" touch=%d\n", touch)); + } +#endif /* TRE_DEBUG */ + +#ifndef TRE_USE_ALLOCA + if (buf) + xfree(buf); +#endif /* !TRE_USE_ALLOCA */ + + return match_eo >= 0 ? REG_OK : REG_NOMATCH; +} + +/* EOF */ diff --git a/regex/TRE/lib/tre-match-utils.h b/regex/TRE/lib/tre-match-utils.h new file mode 100644 index 0000000..5d4cd22 --- /dev/null +++ b/regex/TRE/lib/tre-match-utils.h @@ -0,0 +1,631 @@ +/* + tre-match-utils.h - TRE matcher helper definitions + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#include "tre-internal.h" + +#define str_source ((const tre_str_source*)string) + +#ifdef TRE_WCHAR + +#ifdef TRE_MULTIBYTE + +/* Wide character and multibyte support. */ + +#ifdef TRE_STR_USER +#error TRE_STR_USER defined +#define GET_NEXT_WCHAR() \ + do { \ + prev_c = next_c; \ + if (type == STR_BYTE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = '\0'; \ + else \ + next_c = (unsigned char)(*str_byte++); \ + } \ + else if (type == STR_WIDE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = L'\0'; \ + else \ + next_c = *str_wide++; \ + } \ + else if (type == STR_MBS) \ + { \ + pos += pos_add_next; \ + if (str_byte == NULL) \ + next_c = L'\0'; \ + else \ + { \ + size_t w; \ + int max; \ + if (len >= 0) \ + max = len - pos; \ + else \ + max = 32; \ + if (max <= 0) \ + { \ + next_c = L'\0'; \ + pos_add_next = 1; \ + } \ + else \ + { \ + w = tre_mbrtowc_l(&next_c, str_byte, (size_t)max, &mbstate, \ + tnfa->loc); \ + if (w == (size_t)-1 || w == (size_t)-2) \ + return REG_ILLSEQ; \ + if (w == 0 && len >= 0) \ + { \ + pos_add_next = 1; \ + next_c = 0; \ + str_byte++; \ + } \ + else \ + { \ + pos_add_next = w; \ + str_byte += w; \ + } \ + } \ + } \ + } \ + else if (type == STR_USER) \ + { \ + pos += pos_add_next; \ + str_user_end = str_source->get_next_char(&next_c, &pos_add_next, \ + str_source->context); \ + } \ + } while(/*CONSTCOND*/0) +#else /* !TRE_STR_USER */ +/* + * Because all multibyte encodings are exclusively single-shift encoding, + * with the shift codes having the high bit set, we can make an optimization + * for STR_MBS that only calls tre_mbrtowc_l() when a high-bit character + * is detected, and just do a direct copy for ASCII characters. + */ +#define GET_NEXT_WCHAR() \ + do { \ + prev_c = next_c; \ + switch (type) \ + { \ + case STR_BYTE: \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = '\0'; \ + else \ + next_c = (unsigned char)(*str_byte++); \ + break; \ + case STR_WIDE: \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = L'\0'; \ + else \ + next_c = *str_wide++; \ + break; \ + case STR_MBS: \ + pos += pos_add_next; \ + if (__builtin_expect(len >= 0 && pos >= len, 0)) \ + { \ + next_c = L'\0'; \ + pos_add_next = 1; \ + } \ + else if (__builtin_expect(!(*str_byte & 0x80), 1)) \ + { \ + next_c = (unsigned char)(*str_byte++); \ + pos_add_next = 1; \ + } \ + else \ + { \ + size_t w; \ + int max; \ + if (len >= 0) \ + max = len - pos; \ + else \ + max = 32; \ + w = tre_mbrtowc_l(&next_c, str_byte, (size_t)max, &mbstate, \ + tnfa->loc); \ + if (w == (size_t)-1 || w == (size_t)-2) \ + return REG_ILLSEQ; \ + if (w == 0 && len >= 0) \ + { \ + pos_add_next = 1; \ + next_c = 0; \ + str_byte++; \ + } \ + else \ + { \ + pos_add_next = w; \ + str_byte += w; \ + } \ + } \ + break; \ + } \ + } while(/*CONSTCOND*/0) +#endif /* !TRE_STR_USER */ + +#else /* !TRE_MULTIBYTE */ + +/* Wide character support, no multibyte support. */ +#error TRE_MULTIBYTE undefined + +#ifdef TRE_STR_USER +#define GET_NEXT_WCHAR() \ + do { \ + prev_c = next_c; \ + if (type == STR_BYTE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = '\0'; \ + else \ + next_c = (unsigned char)(*str_byte++); \ + } \ + else if (type == STR_WIDE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = L'\0'; \ + else \ + next_c = *str_wide++; \ + } \ + else if (type == STR_USER) \ + { \ + pos += pos_add_next; \ + str_user_end = str_source->get_next_char(&next_c, &pos_add_next, \ + str_source->context); \ + } \ + } while(/*CONSTCOND*/0) +#else /* !TRE_STR_USER */ +#define GET_NEXT_WCHAR() \ + do { \ + prev_c = next_c; \ + if (type == STR_BYTE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = '\0'; \ + else \ + next_c = (unsigned char)(*str_byte++); \ + } \ + else if (type == STR_WIDE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = L'\0'; \ + else \ + next_c = *str_wide++; \ + } \ + } while(/*CONSTCOND*/0) +#endif /* !TRE_STR_USER */ + +#endif /* !TRE_MULTIBYTE */ + +#else /* !TRE_WCHAR */ + +/* No wide character or multibyte support. */ +#error TRE_WCHAR undefined + +#ifdef TRE_STR_USER +#define GET_NEXT_WCHAR() \ + do { \ + prev_c = next_c; \ + if (type == STR_BYTE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = '\0'; \ + else \ + next_c = (unsigned char)(*str_byte++); \ + } \ + else if (type == STR_USER) \ + { \ + pos += pos_add_next; \ + str_user_end = str_source->get_next_char(&next_c, &pos_add_next, \ + str_source->context); \ + } \ + } while(/*CONSTCOND*/0) +#else /* !TRE_STR_USER */ +#define GET_NEXT_WCHAR() \ + do { \ + prev_c = next_c; \ + if (type == STR_BYTE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = '\0'; \ + else \ + next_c = (unsigned char)(*str_byte++); \ + } \ + } while(/*CONSTCOND*/0) +#endif /* !TRE_STR_USER */ + +#endif /* !TRE_WCHAR */ + + + +/* Assumes tre_tnfa_t *tnfa in scope */ +#define IS_WORD_CHAR(c) ((c) == L'_' || tre_isalnum_l(c, tnfa->loc)) + +#define CHECK_ASSERTIONS(assertions) \ + (((assertions & ASSERT_AT_BOL) \ + && (pos > 0 || reg_notbol) \ + && (prev_c != L'\n' || !reg_newline)) \ + || ((assertions & ASSERT_AT_EOL) \ + && (next_c != L'\0' || reg_noteol) \ + && (next_c != L'\n' || !reg_newline)) \ + || ((assertions & ASSERT_AT_BOW) \ + && (IS_WORD_CHAR(prev_c) || !IS_WORD_CHAR(next_c))) \ + || ((assertions & ASSERT_AT_EOW) \ + && (!IS_WORD_CHAR(prev_c) || IS_WORD_CHAR(next_c))) \ + || ((assertions & ASSERT_AT_WB) \ + && (pos != 0 && next_c != L'\0' \ + && IS_WORD_CHAR(prev_c) == IS_WORD_CHAR(next_c))) \ + || ((assertions & ASSERT_AT_WB_NEG) \ + && (pos == 0 || next_c == L'\0' \ + || IS_WORD_CHAR(prev_c) != IS_WORD_CHAR(next_c)))) + +#define CHECK_CHAR_CLASSES(trans_i, tnfa, eflags) \ + ((trans_i->assertions & ASSERT_BRACKET_MATCH) \ + && !tre_bracket_match(trans_i->u.bracket_match_list,(tre_cint_t)prev_c, \ + tnfa)) + + + + +inline static int +tre_tag_get(const tre_tag_t *tags, int i) +{ + tags += i; + return tags->count > 0 ? tags->value : -1; +} + +inline static void +tre_tag_set(tre_tag_t *tags, int i, int val, int touch) +{ + tags += i; + if (tags->count++ == 0) + tags->first = val; + tags->value = val; + tags->touch = touch; +} + +inline static void +tre_tag_reset(tre_tag_t *tags, int i) +{ + tags[i].count = 0; +} + +inline static int +tre_tag_touch_get(const tre_tag_t *tags, int i) +{ + return tags[i].touch; +} + +#ifdef TRE_DEBUG +inline static void +tre_print_tags(const tre_tag_t *tags, int num_tags) +{ + int i; + for (i = 0; i < num_tags; i++, tags++) + { + switch(tags->count) + { + case 0: + DPRINT(("%d:(0,-1)", i)); + break; + case 1: + DPRINT(("%d:(1,%d)", i, tags->first)); + break; + default: + DPRINT(("%d:(%d,%d,%d)", i, tags->count, tags->first, + tags->value)); + break; + } + if (i < (num_tags - 1)) + DPRINT((" ")); + } +} + +inline static void +tre_print_tags_all(const tre_tag_t *tags, int num_tags) +{ + int i; + for (i = 0; i < num_tags; i++, tags++) + { + switch(tags->count) + { + case 0: + DPRINT(("%d:(0,-1)/%d", i, tags->touch)); + break; + case 1: + DPRINT(("%d:(1,%d)/%d", i, tags->first, tags->touch)); + break; + default: + DPRINT(("%d:(%d,%d,%d)/%d", i, tags->count, tags->first, + tags->value, tags->touch)); + break; + } + if (i < (num_tags - 1)) + DPRINT((" ")); + } +} +#endif /* TRE_DEBUG */ + +/* Return < 0, = 0 or > 0 depending on how the start/end pairs of a minimal + * group between t1 and t2 compare (t1 loses if < 0, t1 wins if > 0) */ +inline static int +tre_minimal_tag_order(int start, int end, const tre_tag_t *tags1, + const tre_tag_t *tags2) +{ + const tre_tag_t *t1, *t2; + + t1 = tags1 + start; + t2 = tags2 + start; + /* We need both start tags to be set */ + if (t1->count == 0 || t2->count == 0) + return 0; + + /* The start tags must be equal */ + if (t1->value != t2->value) + return 0; + + t1 = tags1 + end; + t2 = tags2 + end; + /* For the end tags, we prefer set over unset, because unset means that + * the end tag is still growing */ + if (t1->count == 0) + { + /* if t2 is set, t1 loses since it is unset */ + if (t2->count != 0) + return -1; + } + /* if t2 not set, t1 wins since it is set */ + else if (t2->count == 0) + return 1; + + /* least current value wins */ + return t2->value - t1->value; +} + +/* Return < 0, = 0 or > 0 depending on how the i-th item of t1 and t2 compare + * (t1 loses if < 0, t1 wins if > 0) */ +inline static int +tre_tag_order_1(int i, tre_tag_direction_t dir, const tre_tag_t *t1, + const tre_tag_t *t2) +{ + int diff; + + t1 += i; + t2 += i; + switch (dir) + { + case TRE_TAG_MINIMIZE: + /* least current value wins (because tags are initialized to all zeros, + * unset wins over set; also, tre_minimal_tag_order() will have already + * been run, which checks for being unset) */ + return t2->value - t1->value; + + case TRE_TAG_MAXIMIZE: + /* prefer set */ + if (t1->count == 0) + { + /* if neither t1 and t2 are set, try next tag */ + if (t2->count == 0) + return 0; + /* t2 is set, t1 loses since it is unset */ + return -1; + } + /* if t2 not set, t1 wins since it is set */ + else if (t2->count == 0) + return 1; + /* greatest initial value wins */ + if ((diff = t1->first - t2->first) != 0) + return diff; + /* least number of times the tag was set, wins */ + if ((diff = t2->count - t1->count) != 0) + return diff; + /* if the tags were only set once, they only have initial values */ + if (t1->count == 1) + return 0; + /* greatest current value wins */ + return t1->value - t2->value; + + case TRE_TAG_LEFT_MAXIMIZE: + /* prefer set */ + if (t1->count == 0) + { + /* if neither t1 and t2 are set, try next tag */ + if (t2->count == 0) + return 0; + /* t2 is set, t1 loses since it is unset */ + return -1; + } + /* if t2 not set, t1 wins since it is set */ + else if (t2->count == 0) + return 1; + /* least initial value wins */ + if ((diff = t2->first - t1->first) != 0) + return diff; + /* least number of times the tag was set, wins */ + if ((diff = t2->count - t1->count) != 0) + return diff; + /* if the tags were only set once, they only have initial values */ + if (t1->count == 1) + return 0; + /* greatest current value wins */ + return t1->value - t2->value; + + default: + /* Shouldn't happen: only assert if TRE_DEBUG defined */ + assert(0); + break; + } + return 0; +} + +#ifdef TRE_DEBUG +#define _MORE_DEBUGGING +#endif /* TRE_DEBUG */ + +/* Returns 1 if `t1' wins `t2', 0 otherwise. */ +inline static int +#ifdef _MORE_DEBUGGING +_tre_tag_order(int num_tags, tre_tag_direction_t *tag_directions, + const tre_tag_t *t1, const tre_tag_t *t2) +#else /* !_MORE_DEBUGGING */ +tre_tag_order(int num_tags, tre_tag_direction_t *tag_directions, + const tre_tag_t *t1, const tre_tag_t *t2) +#endif /* !_MORE_DEBUGGING */ +{ + int i, ret; + + for (i = 0; i < num_tags; i++) + { + if ((ret = tre_tag_order_1(i, tag_directions[i], t1, t2)) != 0) + return (ret > 0); + } + /* assert(0);*/ + return 0; +} + +#ifdef _MORE_DEBUGGING +inline static int +tre_tag_order(int num_tags, tre_tag_direction_t *tag_directions, + const tre_tag_t *t1, const tre_tag_t *t2) +{ + int ret = _tre_tag_order(num_tags, tag_directions, t1, t2); + DPRINT(("tre_tag_order: ")); + tre_print_tags(t1, num_tags); + DPRINT((" %s ", ret ? "wins" : "doesn't win")); + tre_print_tags(t2, num_tags); + DPRINT(("\n")); + return ret; +} +#endif /* _MORE_DEBUGGING */ + +#ifdef __LIBC__ +#include +#else /* !__LIBC__ */ +#include +#endif /* !__LIBC__ */ + +int __collate_equiv_value(locale_t loc, const wchar_t *str, size_t len); + +inline static int +tre_bracket_match(tre_bracket_match_list_t * __restrict list, tre_cint_t wc, + const tre_tnfa_t * __restrict tnfa) +{ + int match = 0; + int i; + tre_bracket_match_t *b; + tre_cint_t uc, lc; + int we, ue, le, got_equiv = 0; + int icase = ((tnfa->cflags & REG_ICASE) != 0); + + DPRINT(("tre_bracket_match: %p, %d, %d\n", list, wc, icase)); + if (icase) + { + if (tre_islower_l(wc, tnfa->loc)) + { + lc = wc; + uc = tre_toupper_l(wc, tnfa->loc); + } + else if (tre_isupper_l(wc, tnfa->loc)) + { + uc = wc; + lc = tre_tolower_l(wc, tnfa->loc); + } + else + { + icase = 0; + } + } + for (i = 0, b = list->bracket_matches; i < list->num_bracket_matches; + i++, b++) + { + switch (b->type) + { + case TRE_BRACKET_MATCH_TYPE_CHAR: + if (icase) + match = (b->value == uc || b->value == lc); + else + match = (b->value == wc); + break; + case TRE_BRACKET_MATCH_TYPE_RANGE_BEGIN: + { + tre_cint_t start = b->value, end; + if (++i >= list->num_bracket_matches || + (++b)->type != TRE_BRACKET_MATCH_TYPE_RANGE_END) + { + DPRINT(("tre_bracket_match: no following range end\n")); + assert(0); + goto error; + } + end = b->value; + if (!got_equiv) + { + if (icase) + { + ue = __collate_equiv_value(tnfa->loc, &uc, 1); + le = __collate_equiv_value(tnfa->loc, &lc, 1); + } + else + we = __collate_equiv_value(tnfa->loc, &wc, 1); + got_equiv = 1; + } + if (icase) + match = ((start <= ue && ue <= end) || + (start <= le && le <= end)); + else + match = (start <= we && we <= end); + break; + } + case TRE_BRACKET_MATCH_TYPE_RANGE_END: + DPRINT(("tre_bracket_match: range end without preceeding start\n")); + assert(0); + break; + case TRE_BRACKET_MATCH_TYPE_CLASS: + if (icase) + match = (tre_isctype_l(uc, b->value, tnfa->loc) || + tre_isctype_l(lc, b->value, tnfa->loc)); + else + match = (tre_isctype_l(wc, b->value, tnfa->loc)); + break; + case TRE_BRACKET_MATCH_TYPE_EQUIVALENCE: + if (!got_equiv) + { + if (icase) + { + ue = __collate_equiv_value(tnfa->loc, &uc, 1); + le = __collate_equiv_value(tnfa->loc, &lc, 1); + } + else + we = __collate_equiv_value(tnfa->loc, &wc, 1); + got_equiv = 1; + } + if (icase) + match = (b->value == ue || b->value == le); + else + match = (b->value == we); + break; + default: + DPRINT(("tre_bracket_match: unknown type %d\n", b->type)); + assert(0); + break; + } + if (match) + break; + } +error: + if (list->flags & TRE_BRACKET_MATCH_FLAG_NEGATE) { + if ((tnfa->cflags & REG_NEWLINE) && wc == '\n') return 0; + match = !match; + } + return match; +} diff --git a/regex/TRE/lib/tre-mem.c b/regex/TRE/lib/tre-mem.c new file mode 100644 index 0000000..21aa793 --- /dev/null +++ b/regex/TRE/lib/tre-mem.c @@ -0,0 +1,155 @@ +/* + tre-mem.c - TRE memory allocator + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +/* + This memory allocator is for allocating small memory blocks efficiently + in terms of memory overhead and execution speed. The allocated blocks + cannot be freed individually, only all at once. There can be multiple + allocators, though. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ +#include +#include + +#include "tre-internal.h" +#include "tre-mem.h" +#include "xmalloc.h" + + +/* Returns a new memory allocator or NULL if out of memory. */ +tre_mem_t +tre_mem_new_impl(int provided, void *provided_block) +{ + tre_mem_t mem; + if (provided) + { + mem = provided_block; + memset(mem, 0, sizeof(*mem)); + } + else + mem = xcalloc(1, sizeof(*mem)); + if (mem == NULL) + return NULL; + return mem; +} + + +/* Frees the memory allocator and all memory allocated with it. */ +void +tre_mem_destroy(tre_mem_t mem) +{ + tre_list_t *tmp, *l = mem->blocks; + + while (l != NULL) + { + xfree(l->data); + tmp = l->next; + xfree(l); + l = tmp; + } + xfree(mem); +} + + +/* Allocates a block of `size' bytes from `mem'. Returns a pointer to the + allocated block or NULL if an underlying malloc() failed. */ +void * +tre_mem_alloc_impl(tre_mem_t mem, int provided, void *provided_block, + int zero, size_t size) +{ + void *ptr; + + if (mem->failed) + { + DPRINT(("tre_mem_alloc: oops, called after failure?!\n")); + return NULL; + } + +#ifdef MALLOC_DEBUGGING + if (!provided) + { + ptr = xmalloc(1); + if (ptr == NULL) + { + DPRINT(("tre_mem_alloc: xmalloc forced failure\n")); + mem->failed = 1; + return NULL; + } + xfree(ptr); + } +#endif /* MALLOC_DEBUGGING */ + + if (mem->n < size) + { + /* We need more memory than is available in the current block. + Allocate a new block. */ + tre_list_t *l; + if (provided) + { + DPRINT(("tre_mem_alloc: using provided block\n")); + if (provided_block == NULL) + { + DPRINT(("tre_mem_alloc: provided block was NULL\n")); + mem->failed = 1; + return NULL; + } + mem->ptr = provided_block; + mem->n = TRE_MEM_BLOCK_SIZE; + } + else + { + size_t block_size; + if (size * 8 > TRE_MEM_BLOCK_SIZE) + block_size = size * 8; + else + block_size = TRE_MEM_BLOCK_SIZE; + DPRINT(("tre_mem_alloc: allocating new %ld byte block\n", + block_size)); + l = xmalloc(sizeof(*l)); + if (l == NULL) + { + mem->failed = 1; + return NULL; + } + l->data = xmalloc(block_size); + if (l->data == NULL) + { + xfree(l); + mem->failed = 1; + return NULL; + } + l->next = NULL; + if (mem->current != NULL) + mem->current->next = l; + if (mem->blocks == NULL) + mem->blocks = l; + mem->current = l; + mem->ptr = l->data; + mem->n = block_size; + } + } + + /* Make sure the next pointer will be aligned. */ + size += ALIGN(mem->ptr + size, long); + + /* Allocate from current block. */ + ptr = mem->ptr; + mem->ptr += size; + mem->n -= size; + + /* Set to zero if needed. */ + if (zero) + memset(ptr, 0, size); + + return ptr; +} + +/* EOF */ diff --git a/regex/TRE/lib/tre-mem.h b/regex/TRE/lib/tre-mem.h new file mode 100644 index 0000000..b760394 --- /dev/null +++ b/regex/TRE/lib/tre-mem.h @@ -0,0 +1,68 @@ +/* + tre-mem.h - TRE memory allocator interface + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#ifndef TRE_MEM_H +#define TRE_MEM_H 1 + +#include + +#define TRE_MEM_BLOCK_SIZE 1024 + +typedef struct tre_list { + void *data; + struct tre_list *next; +} tre_list_t; + +typedef struct tre_mem_struct { + tre_list_t *blocks; + tre_list_t *current; + char *ptr; + size_t n; + int failed; + void **provided; +} *tre_mem_t; + + +__private_extern__ tre_mem_t tre_mem_new_impl(int provided, + void *provided_block); +__private_extern__ void *tre_mem_alloc_impl(tre_mem_t mem, int provided, + void *provided_block, + int zero, size_t size); + +/* Returns a new memory allocator or NULL if out of memory. */ +#define tre_mem_new() tre_mem_new_impl(0, NULL) + +/* Allocates a block of `size' bytes from `mem'. Returns a pointer to the + allocated block or NULL if an underlying malloc() failed. */ +#define tre_mem_alloc(mem, size) tre_mem_alloc_impl(mem, 0, NULL, 0, size) + +/* Allocates a block of `size' bytes from `mem'. Returns a pointer to the + allocated block or NULL if an underlying malloc() failed. The memory + is set to zero. */ +#define tre_mem_calloc(mem, size) tre_mem_alloc_impl(mem, 0, NULL, 1, size) + +#ifdef TRE_USE_ALLOCA +/* alloca() versions. Like above, but memory is allocated with alloca() + instead of malloc(). */ + +#define tre_mem_newa() \ + tre_mem_new_impl(1, alloca(sizeof(struct tre_mem_struct))) + +#define tre_mem_alloca(mem, size) \ + ((mem)->n >= (size) \ + ? tre_mem_alloc_impl((mem), 1, NULL, 0, (size)) \ + : tre_mem_alloc_impl((mem), 1, alloca(TRE_MEM_BLOCK_SIZE), 0, (size))) +#endif /* TRE_USE_ALLOCA */ + + +/* Frees the memory allocator and all memory allocated with it. */ +__private_extern__ void tre_mem_destroy(tre_mem_t mem); + +#endif /* TRE_MEM_H */ + +/* EOF */ diff --git a/regex/TRE/lib/tre-parse.c b/regex/TRE/lib/tre-parse.c new file mode 100644 index 0000000..fa0b34a --- /dev/null +++ b/regex/TRE/lib/tre-parse.c @@ -0,0 +1,2336 @@ +/* + tre-parse.c - Regexp parser + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +/* + This parser is just a simple recursive descent parser for POSIX.2 + regexps. The parser supports both the obsolete default syntax and + the "extended" syntax, and some nonstandard extensions. +*/ + + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ +#include +#include +#include +#include + +#include "xmalloc.h" +#include "tre-mem.h" +#include "tre-ast.h" +#include "tre-stack.h" +#include "tre-parse.h" + +/* BSD compatibility: + Before looking up a collating symbol, check if the name matches in + the character names (cnames) array; if so, use the corresponding + character. + + Also set ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND, which will preserve + the implementation choice that for ERE, a non-numeric character following + a left brace that would normally be a bound, causes the left brace to be + literal. */ +#define BSD_COMPATIBILITY +#ifdef BSD_COMPATIBILITY +#include "cname.h" +#define ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND +#endif /* BSD_COMPATIBILITY */ + +/* Characters with special meanings in regexp syntax. */ +#define CHAR_PIPE L'|' +#define CHAR_LPAREN L'(' +#define CHAR_RPAREN L')' +#define CHAR_LBRACE L'{' +#define CHAR_RBRACE L'}' +#define CHAR_LBRACKET L'[' +#define CHAR_RBRACKET L']' +#define CHAR_MINUS L'-' +#define CHAR_STAR L'*' +#define CHAR_QUESTIONMARK L'?' +#define CHAR_PLUS L'+' +#define CHAR_PERIOD L'.' +#define CHAR_COLON L':' +#define CHAR_EQUAL L'=' +#define CHAR_COMMA L',' +#define CHAR_CARET L'^' +#define CHAR_DOLLAR L'$' +#define CHAR_BACKSLASH L'\\' +#define CHAR_HASH L'#' +#define CHAR_TILDE L'~' + + +/* Some macros for expanding \w, \s, etc. */ +static const struct tre_macro_struct { + const char c; + const char *expansion; +} tre_macros[] = + { {'t', "\t"}, {'n', "\n"}, {'r', "\r"}, + {'f', "\f"}, {'a', "\a"}, {'e', "\033"}, + {'w', "[[:alnum:]_]"}, {'W', "[^[:alnum:]_]"}, {'s', "[[:space:]]"}, + {'S', "[^[:space:]]"}, {'d', "[[:digit:]]"}, {'D', "[^[:digit:]]"}, + { 0, NULL } + }; + + +/* Expands a macro delimited by `regex' and `regex_end' to `buf', which + must have at least `len' items. Sets buf[0] to zero if the there + is no match in `tre_macros'. */ +static void +tre_expand_macro(const tre_char_t *regex, const tre_char_t *regex_end, + tre_char_t *buf, size_t buf_len) +{ + int i; + + buf[0] = 0; + if (regex >= regex_end) + return; + + for (i = 0; tre_macros[i].expansion; i++) + { + if (tre_macros[i].c == *regex) + { + unsigned int j; + DPRINT(("Expanding macro '%c' => '%s'\n", + tre_macros[i].c, tre_macros[i].expansion)); + for (j = 0; tre_macros[i].expansion[j] && j < buf_len; j++) + buf[j] = tre_macros[i].expansion[j]; + buf[j] = 0; + break; + } + } +} + +static reg_errcode_t +tre_new_item(tre_mem_t __unused mem, int type, int val, int *max_i, + tre_bracket_match_list_t **items) +{ + reg_errcode_t status = REG_OK; + tre_bracket_match_list_t *array = *items; + int i = array->num_bracket_matches; + /* Allocate more space if necessary. */ + if (i >= *max_i) + { + tre_bracket_match_list_t *new_items; + DPRINT(("out of tre_bracket_match_list_t array space (%d)\n", i)); + /* If the array is already 1024 items large, give up -- there's + probably an error in the regexp (e.g. not a '\0' terminated + string and missing ']') */ + if (*max_i >= 1024) + return REG_ESPACE; + *max_i *= 2; + new_items = xrealloc(array, SIZEOF_BRACKET_MATCH_LIST_N(*max_i)); + if (new_items == NULL) + return REG_ESPACE; + *items = array = new_items; + } + array->bracket_matches[i].type = type; + array->bracket_matches[i].value = val; + array->num_bracket_matches++; + return status; +} + +#ifndef TRE_USE_SYSTEM_WCTYPE + +/* isalnum() and the rest may be macros, so wrap them to functions. */ +int tre_isalnum_func(tre_cint_t c) { return tre_isalnum(c); } +int tre_isalpha_func(tre_cint_t c) { return tre_isalpha(c); } + +#ifdef tre_isascii +int tre_isascii_func(tre_cint_t c) { return tre_isascii(c); } +#else /* !tre_isascii */ +int tre_isascii_func(tre_cint_t c) { return !(c >> 7); } +#endif /* !tre_isascii */ + +#ifdef tre_isblank +int tre_isblank_func(tre_cint_t c) { return tre_isblank(c); } +#else /* !tre_isblank */ +int tre_isblank_func(tre_cint_t c) { return ((c == ' ') || (c == '\t')); } +#endif /* !tre_isblank */ + +int tre_iscntrl_func(tre_cint_t c) { return tre_iscntrl(c); } +int tre_isdigit_func(tre_cint_t c) { return tre_isdigit(c); } +int tre_isgraph_func(tre_cint_t c) { return tre_isgraph(c); } +int tre_islower_func(tre_cint_t c) { return tre_islower(c); } +int tre_isprint_func(tre_cint_t c) { return tre_isprint(c); } +int tre_ispunct_func(tre_cint_t c) { return tre_ispunct(c); } +int tre_isspace_func(tre_cint_t c) { return tre_isspace(c); } +int tre_isupper_func(tre_cint_t c) { return tre_isupper(c); } +int tre_isxdigit_func(tre_cint_t c) { return tre_isxdigit(c); } + +struct { + char *name; + int (*func)(tre_cint_t); +} tre_ctype_map[] = { + { "alnum", &tre_isalnum_func }, + { "alpha", &tre_isalpha_func }, +#ifdef tre_isascii + { "ascii", &tre_isascii_func }, +#endif /* tre_isascii */ +#ifdef tre_isblank + { "blank", &tre_isblank_func }, +#endif /* tre_isblank */ + { "cntrl", &tre_iscntrl_func }, + { "digit", &tre_isdigit_func }, + { "graph", &tre_isgraph_func }, + { "lower", &tre_islower_func }, + { "print", &tre_isprint_func }, + { "punct", &tre_ispunct_func }, + { "space", &tre_isspace_func }, + { "upper", &tre_isupper_func }, + { "xdigit", &tre_isxdigit_func }, + { NULL, NULL} +}; + +tre_ctype_t tre_ctype(const char *name) +{ + int i; + for (i = 0; tre_ctype_map[i].name != NULL; i++) + { + if (strcmp(name, tre_ctype_map[i].name) == 0) + return tre_ctype_map[i].func; + } + return (tre_ctype_t)0; +} +#endif /* !TRE_USE_SYSTEM_WCTYPE */ + +#define REST(re) (int)(ctx->re_end - (re)), (re) + +#define START_COLLATING_SYMBOLS 16 +#define MAX_COLLATING_SYMBOL_LEN 4 + +typedef struct { + const tre_char_t *start; + int len; +} tre_collating_symbol; + +#include + +int __collate_equiv_value(locale_t loc, const wchar_t *str, size_t len); + +#ifdef BSD_COMPATIBILITY +static wchar_t +tre_search_cnames(const wchar_t *name, size_t len) +{ + size_t low = 0; + size_t high = NCNAMES - 1; + size_t cur; + int cmp; + + while(low <= high) + { + cur = (low + high) / 2; + cmp = wcsncmp(name, cnames[cur].name, len); + if (cmp == 0 && cnames[cur].name[len] == 0) return cnames[cur].code; + if (cmp > 0) low = cur + 1; + else high = cur - 1; + } + return (wchar_t)-1; +} +#endif /* BSD_COMPATIBILITY */ + +/* Scan the contents of a bracket expression, and create a + * tre_bracket_match_list_t encoding the bracket expression. If during + * the scan, multi-character collating symbols are detected, switch + * into a mode to collect those MCCSs into a tre_collating_symbol + * list and pass them back. tre_parse_bracket will use that to + * create a new string composed of a union of the bracket expression + * without the MCCSs and the MCCSs (e.g., [x[.ch.]] => [x]|ch), and + * call tre_parse (recursive) to parse that new string (which will + * call tre_parse_bracket and tre_parse_bracket_items again. */ +static reg_errcode_t +tre_parse_bracket_items(tre_parse_ctx_t *ctx, tre_bracket_match_list_t **items, + int *items_size, tre_collating_symbol **result) +{ + const tre_char_t *re = ctx->re; + const tre_char_t *re_end = ctx->re_end; + tre_collating_symbol *col_syms = NULL; + tre_collating_symbol *cp = NULL; + int n_col_syms = 0; + reg_errcode_t status; + int max_i = *items_size; + int other = 0; /* contains content other than multi-character collating + * symbols */ + int range = -1; /* -1 unset, 0 begin range set, +1 end range expected */ + tre_cint_t min, c; + int invert = ((*items)->flags & TRE_BRACKET_MATCH_FLAG_NEGATE); + int collect_MCCS = 0; + const tre_char_t *start; + + for ( ;re < re_end; re++) + { + switch (*re) + { + case CHAR_MINUS: + /* A first hyphen */ + if (re == ctx->re) + { + DPRINT(("tre_parse_bracket: char: '%.*" STRF "'\n", REST(re))); + min = CHAR_MINUS; + other++; + range = 0; + break; + } + /* The hyphen is the end range */ + if (range > 0) + { + DPRINT(("tre_parse_bracket: char: '%.*" STRF "'\n", REST(re))); + c = CHAR_MINUS; + goto process_end_range; + } + if (re + 1 >= re_end) + { + status = REG_EBRACK; + goto error; + } + /* The hyphen is at the end */ + if (re[1] == CHAR_RBRACKET) + { + DPRINT(("tre_parse_bracket: char: '%.*" STRF "'\n", REST(re))); + c = CHAR_MINUS; + goto process_begin_range; + } + /* Two ranges are not allowed to share an endpoint, or begin + * range is illegal. */ + if (range < 0) + { + status = REG_ERANGE; + goto error; + } + range = 1; /* Expect end range */ + DPRINT(("tre_parse_bracket: range: '%.*" STRF "'\n", REST(re))); + break; + + case CHAR_LBRACKET: + if (re + 1 >= re_end) + { + status = REG_EBRACK; + goto error; + } + switch (re[1]) + { + case CHAR_PERIOD: + { + re += 2; + start = re; + for (;; re++) + { + if (re >= re_end) + { + status = REG_ECOLLATE; + goto error; + } + if (*re == CHAR_PERIOD) + { + if (re + 1 >= re_end) + { + status = REG_ECOLLATE; + goto error; + } + /* Found end */ + if (re[1] == CHAR_RBRACKET) + { + DPRINT(("tre_parse_bracket: collating " + "symbol: '%.*" STRF "'\n", + REST(start - 2))); + /* Empty name */ + if (re == start) + { + status = REG_ECOLLATE; + goto error; + } +#ifdef BSD_COMPATIBILITY + /* Check if the name is in cnames; if so, use + the corresponding code */ + c = tre_search_cnames(start, re - start); + if (c != (wchar_t)-1) + { + re++; + goto process_single_character; + } +#endif /* BSD_COMPATIBILITY */ + /* Verify this is a known sequence */ + if (__collate_equiv_value(ctx->loc, start, + re - start) <= 0) + { + status = REG_ECOLLATE; + goto error; + } + /* Process single character collating symbols */ + if (re - start == 1) + { + c = *start; + re++; + goto process_single_character; + } + /* Inverted MCCSs are undefined */ + if (invert) + { + status = REG_ECOLLATE; + goto error; + } + /* Can't have MCCSs as an endpoint to a range */ + if (range > 0) + { + status = REG_ERANGE; + goto error; + } + range = -1; + /* Switch into MCCS collection mode (if not + * already there */ +#if TRE_DEBUG + if (!collect_MCCS) + { + collect_MCCS = 1; + DPRINT(("tre_parse_bracket: Detected MCCS\n")); + } +#else /* !TRE_DEBUG */ + collect_MCCS = 1; +#endif /* !TRE_DEBUG */ + /* Allocate a memory block the first time */ + if (!cp) + { + if ((col_syms = xmalloc(sizeof(*col_syms) * + (START_COLLATING_SYMBOLS + 2))) + == NULL) + return REG_ESPACE; + cp = col_syms + 1; + n_col_syms = START_COLLATING_SYMBOLS; + } + /* Enlarge the memory block is more is needed */ + if ((cp - col_syms) - 1 >= n_col_syms) + { + int i = n_col_syms; + tre_collating_symbol *tmp = + xrealloc(col_syms, sizeof(*col_syms) * + ((n_col_syms *= 2) + 2)); + if (tmp == NULL) + { + xfree(col_syms); + return REG_ESPACE; + } + DPRINT(("tre_list_collating_symbols: " + "Enlarging col_syms to %d\n", + n_col_syms)); + col_syms = tmp; + cp = col_syms + i + 1; + } + cp->start = start; + cp->len = re - start; + cp++; + re++; + break; + } + } + } + break; + } + + case CHAR_EQUAL: + case CHAR_COLON: + { + /* Process equivalence and character classes */ + tre_char_t kind = re[1]; + + /* Can't have a class as an endpoint to a range */ + if (range > 0) + { + status = REG_ERANGE; + goto error; + } + if (!collect_MCCS && range == 0) + { + status = tre_new_item(ctx->mem, TRE_BRACKET_MATCH_TYPE_CHAR, + min, &max_i, items); + if (status != REG_OK) + goto error; + } + range = -1; + re += 2; + start = re; + for (;; re++) + { + if (re >= re_end) + { + status = kind == CHAR_EQUAL ? REG_ECOLLATE : REG_ECTYPE; + goto error; + } + if (*re == kind) + { + if (re + 1 >= re_end) + { + status = kind == CHAR_EQUAL ? REG_ECOLLATE : + REG_ECTYPE; + goto error; + } + /* Found end */ + if (re[1] == CHAR_RBRACKET) + { + if (re == start) + { + /* Empty class name */ + status = kind == CHAR_EQUAL ? REG_ECOLLATE : + REG_ECTYPE; + goto error; + } + /* Process equivalence class */ + if (kind == CHAR_EQUAL) + { + int equiv; + + DPRINT(("tre_parse_bracket: equivalence: '%.*" + STRF "'\n", REST(start - 2))); + + /* While we find the collation value even for + multi-character collating elements , we + don't (yet) match any collation values + against multi-character sequences. We'd have + to enumerate those multi-character sequences + and like multi-character collating symbols, + create a union of those sequences with the + rest of the bracket expression. While + doable, a bracket expression matching + multiple characters, that doesn't explicitly + contain multi-character sequences, might + be unexpected, so we punt for now. */ + if ((equiv = __collate_equiv_value(ctx->loc, + start, re - start)) <= 0) + { + /* The standard says that if no collating + element if found, we use the collating + symbol itself. But __collate_equiv_value + doesn't make a distinction between + an element that is in a equvalence + class with others, or is the only member, + so we already know there is no collating + symbol. (Note that in the case of a + collating element whose collation value + is unique, matching against the + collating element itself, or against + its collation value, is equivalent.) */ +#ifdef BSD_COMPATIBILITY + /* Check if the name is in cnames; if so, + use the corresponding code */ + c = tre_search_cnames(start, re - start); + if (c != (wchar_t)-1) + { + re++; + goto process_single_character; + } +#endif /* BSD_COMPATIBILITY */ + status = REG_ECOLLATE; + goto error; + } + if (!collect_MCCS) + { + status = tre_new_item(ctx->mem, + TRE_BRACKET_MATCH_TYPE_EQUIVALENCE, + equiv, &max_i, items); + if (status != REG_OK) + goto error; + } + } + else + { + /* Process character class */ + DPRINT(("tre_parse_bracket: class: '%.*" STRF + "'\n", REST(start - 2))); + if (!collect_MCCS) + { + char tmp_str[64]; + tre_ctype_t class; + int len = MIN(re - start, 63); +#ifdef TRE_WCHAR + { + tre_char_t tmp_wcs[64]; + wcsncpy(tmp_wcs, start, (size_t)len); + tmp_wcs[len] = L'\0'; +#if defined HAVE_WCSRTOMBS + { + mbstate_t state; + const tre_char_t *src = tmp_wcs; + memset(&state, '\0', sizeof(state)); + len = wcsrtombs_l(tmp_str, &src, + sizeof(tmp_str), &state, + ctx->loc); + } +#elif defined HAVE_WCSTOMBS + len = wcstombs(tmp_str, tmp_wcs, 63); +#endif /* defined HAVE_WCSTOMBS */ + } +#else /* !TRE_WCHAR */ + strncpy(tmp_str, (const char*)start, len); +#endif /* !TRE_WCHAR */ + tmp_str[len] = '\0'; + DPRINT((" class name: %s\n", tmp_str)); + class = tre_ctype_l(tmp_str, ctx->loc); + if (!class) + { + status = REG_ECTYPE; + goto error; + } + status = tre_new_item(ctx->mem, + TRE_BRACKET_MATCH_TYPE_CLASS, + class, &max_i, items); + if (status != REG_OK) + goto error; + } + } + re++; + break; + } + } + } + other++; + break; + } + + default: + DPRINT(("tre_parse_bracket: char: '%.*" STRF "'\n", REST(re))); + c = CHAR_LBRACKET; + goto process_single_character; + break; + } + break; + + case CHAR_RBRACKET: + /* A first right bracket */ + if (re == ctx->re) + { + DPRINT(("tre_parse_bracket: char: '%.*" STRF "'\n", REST(re))); + min = CHAR_RBRACKET; + range = 0; + other++; + break; + } + /* Done */ + if (collect_MCCS) + { + DPRINT(("tre_parse_bracket: done: '%.*" STRF "'\n", + REST(re))); + if (col_syms) + { + /* Mark the character following the right bracket. Set len + * to whether there are other things besides the + * multi-character collating symbols */ + col_syms->start = re + 1; + col_syms->len = other; + /* Mark the end of the list */ + cp->start = NULL; + } + *result = col_syms; + return REG_OK; + } + /* range > 0 is not possible, since we did a lookahead after the + * hyphen */ + if (range == 0) + { + status = tre_new_item(ctx->mem, TRE_BRACKET_MATCH_TYPE_CHAR, + min, &max_i, items); + if (status != REG_OK) + goto error; + } + DPRINT(("tre_parse_bracket: done: '%.*" STRF "'\n", REST(re))); + *items_size = max_i; + ctx->re = re + 1; + return REG_OK; + + default: + DPRINT(("tre_parse_bracket: char: '%.*" STRF "'\n", REST(re))); + c = *re; +process_single_character: + /* Process single character */ + if (range > 0) + { + int mine, maxe; + +process_end_range: + /* Get collation equivalence values */ + mine = __collate_equiv_value(ctx->loc, &min, 1); + maxe = __collate_equiv_value(ctx->loc, &c, 1); + if (maxe < mine) + { + status = REG_ERANGE; + goto error; + } + if (!collect_MCCS) + { + status = tre_new_item(ctx->mem, + TRE_BRACKET_MATCH_TYPE_RANGE_BEGIN, + mine, &max_i, items); + if (status != REG_OK) + goto error; + status = tre_new_item(ctx->mem, + TRE_BRACKET_MATCH_TYPE_RANGE_END, + maxe, &max_i, items); + if (status != REG_OK) + goto error; + } + range = -1; + } + else + { +process_begin_range: + if (!collect_MCCS) + { + if (range == 0) + { + status = tre_new_item(ctx->mem, + TRE_BRACKET_MATCH_TYPE_CHAR, + min, &max_i, items); + if (status != REG_OK) + goto error; + } + min = c; + } + range = 0; + } + other++; + break; + } + } + status = REG_EBRACK; +error: + DPRINT(("tre_parse_bracket: error: '%.*" STRF "', status=%d\n", + REST(re), status)); + if (col_syms) + xfree(col_syms); + return status; +} + +#ifdef TRE_DEBUG +static const char *bracket_match_type_str[] = { + "unused", + "char", + "range begin", + "range end", + "class", + "equivalence value", +}; +#endif /* TRE_DEBUG */ + +static reg_errcode_t +tre_parse_bracket(tre_parse_ctx_t *ctx, tre_ast_node_t **result) +{ + tre_ast_node_t *node = NULL; + reg_errcode_t status = REG_OK; + tre_bracket_match_list_t *items; + int max_i = 32; + tre_collating_symbol *col_syms = NULL; + + /* Handle special cases [[:<:]] and [[:>:]] */ + if (ctx->re_end - ctx->re >= 6 && ctx->re[0] == CHAR_LBRACKET + && ctx->re[1] == CHAR_COLON && (ctx->re[2] == L'<' || ctx->re[2] == L'>') + && ctx->re[3] == CHAR_COLON && ctx->re[4] == CHAR_RBRACKET + && ctx->re[5] == CHAR_RBRACKET) + { + *result = tre_ast_new_literal(ctx->mem, ASSERTION, + (ctx->re[2] == L'<') ? ASSERT_AT_BOW : ASSERT_AT_EOW, + -1); + DPRINT(("tre_parse_bracket: special case %s\n", (ctx->re[2] == L'<') ? + "[[:<:]]" : "[[:>:]]")); + ctx->re += 6; + return *result ? REG_OK : REG_ESPACE; + } + + /* Start off with an array of `max_i' elements. */ + items = xcalloc(1, SIZEOF_BRACKET_MATCH_LIST_N(max_i)); + if (items == NULL) + return REG_ESPACE; + + if (*ctx->re == CHAR_CARET) + { + DPRINT(("tre_parse_bracket: negate: '%.*" STRF "'\n", REST(ctx->re))); + items->flags |= TRE_BRACKET_MATCH_FLAG_NEGATE; + ctx->re++; + } + + status = tre_parse_bracket_items(ctx, &items, &max_i, &col_syms); + + if (status != REG_OK) + goto parse_bracket_done; + + /* If there are collating symbols, split off the multi-character ones + * into a union of the bracket expression (without the collating symbols) + * and the multiple-character sequences. We create an equivalent input + * string and run tre_parse() recursively */ + if (col_syms) + { + tre_char_t *str, *sp; + tre_collating_symbol *cp; + tre_parse_ctx_t subctx; + + /* Allocate a new string. We start with the size of the original + * bracket expression (minus 1) and add 2 (for a leading "[" and + * a trailing nil; don't need a "^", since it is illegal to have + * inverted MCCSs). Since a multi-character collating symbols + * will be converted from "[.xx.]" to "|xx" (n+4 to n+1), we don't + * need to worry about the new string getting too long. */ + xfree(items); + str = xmalloc(sizeof(*str) * ((col_syms->start - ctx->re) + 2)); + if (str == NULL) + { + xfree(col_syms); + return REG_ESPACE; + } + sp = str; + if (col_syms->len > 0) + { + /* There are other items in the bracket expression besides the + * multi-character collating symbols, so create a new bracket + * expression with only those other itmes. */ + const tre_char_t *re; + ptrdiff_t i; + + *sp++ = '['; + re = ctx->re; + for (cp = col_syms + 1; cp->start; cp++) + { + /* The "- 2" is to account for the "[." */ + if ((i = ((cp->start - re) - 2)) > 0) + { + memcpy(sp, re, sizeof(*sp) * i); + sp += i; + } + /* The "+ 2" is to account for the ".]" */ + re = cp->start + cp->len + 2; + } + i = col_syms->start - re; /* Includes the trailing right bracket */ + memcpy(sp, re, sizeof(*sp) * i); + sp += i; + *sp++ = '|'; + } + for (cp = col_syms + 1; cp->start; cp++) + { + memcpy(sp, cp->start, sizeof(*sp) * cp->len); + sp += cp->len; + if (cp[1].start) + *sp++ = '|'; + } + *sp = 0; + DPRINT(("tre_parse_bracket: Reparsing bracket expression with '%ls'\n", + str)); + + memcpy(&subctx, ctx, sizeof(subctx)); + subctx.re = str; + subctx.len = sp - str; + subctx.nofirstsub = 1; + subctx.cflags |= REG_EXTENDED; /* Force extended mode for parsing */ + status = tre_parse(&subctx); + xfree(str); + if (status != REG_OK) + { + xfree(col_syms); + return status; + } + ctx->re = col_syms->start; + ctx->position = subctx.position; + xfree(col_syms); + *result = subctx.result; + DPRINT(("tre_parse_bracket: Returning to original string\n")); + return REG_OK; + } + + DPRINT(("tre_parse_bracket: creating bracket expression literal\n")); + node = tre_ast_new_literal(ctx->mem, 0, TRE_CHAR_MAX, ctx->position); + if (node == NULL) + { + status = REG_ESPACE; + goto parse_bracket_done; + } + else + { + tre_literal_t *l = node->obj; + l->u.bracket_match_list = tre_mem_alloc(ctx->mem, + SIZEOF_BRACKET_MATCH_LIST(items)); + if (l->u.bracket_match_list == NULL) + { + status = REG_ESPACE; + goto parse_bracket_done; + } + memcpy(l->u.bracket_match_list, items, SIZEOF_BRACKET_MATCH_LIST(items)); + } + +#ifdef TRE_DEBUG + { + int i; + tre_bracket_match_t *b; + DPRINT(("tre_parse_bracket: %d bracket match items, flags 0x%x\n", + items->num_bracket_matches, items->flags)); + for (i = 0, b = items->bracket_matches; + i < items->num_bracket_matches; i++, b++) + { + DPRINT((" %d: %s %d\n", i, bracket_match_type_str[b->type], + b->value)); + } + } +#endif /* TRE_DEBUG */ + + parse_bracket_done: + xfree(items); + ctx->position++; + *result = node; + return status; +} + + +/* Parses a positive decimal integer. Returns -1 if the string does not + contain a valid number. */ +static int +tre_parse_int(const tre_char_t **regex, const tre_char_t *regex_end) +{ + int num = -1; + const tre_char_t *r = *regex; + while (r < regex_end && *r >= L'0' && *r <= L'9') + { + if (num < 0) + num = 0; + num = num * 10 + *r - L'0'; + r++; + } + *regex = r; + return num; +} + + +static reg_errcode_t +tre_parse_bound(tre_parse_ctx_t *ctx, tre_ast_node_t **result) +{ + int min, max; +#ifdef TRE_APPROX + int i; + int cost_ins, cost_del, cost_subst, cost_max; + int limit_ins, limit_del, limit_subst, limit_err; + const tre_char_t *start; +#endif /* TRE_APPROX */ + const tre_char_t *r = ctx->re; + int minimal = (ctx->cflags & REG_UNGREEDY) ? 1 : 0; +#ifdef TRE_APPROX + int approx = 0; + int costs_set = 0; + int counts_set = 0; + + cost_ins = cost_del = cost_subst = cost_max = TRE_PARAM_UNSET; + limit_ins = limit_del = limit_subst = limit_err = TRE_PARAM_UNSET; +#endif /* TRE_APPROX */ + + /* Parse number (minimum repetition count). */ + min = -1; + if (r >= ctx->re_end) +#ifdef ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND + return (ctx->cflags & REG_EXTENDED) ? REG_NOMATCH : REG_EBRACE; +#else /* !ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND */ + return REG_EBRACE; +#endif /* !ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND */ + if (*r >= L'0' && *r <= L'9') { + DPRINT(("tre_parse: min count: '%.*" STRF "'\n", REST(r))); + min = tre_parse_int(&r, ctx->re_end); + } +#ifndef TRE_APPROX + else +#ifdef ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND + /* For ERE, return REG_NOMATCH to signal that the lbrace should + be treated as a literal */ + return (ctx->cflags & REG_EXTENDED) ? REG_NOMATCH : REG_BADBR; +#else /* !ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND */ + return REG_BADBR; +#endif /* !ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND */ +#endif /* !TRE_APPROX */ + + /* Parse comma and second number (maximum repetition count). */ + max = min; + if (r < ctx->re_end && *r == CHAR_COMMA) + { + r++; + DPRINT(("tre_parse: max count: '%.*" STRF "'\n", REST(r))); + max = tre_parse_int(&r, ctx->re_end); + } + + /* Check that the repeat counts are sane. */ + if ((max >= 0 && min > max) || min > RE_DUP_MAX || max > RE_DUP_MAX) + return REG_BADBR; + + +#ifdef TRE_APPROX + /* + '{' + optionally followed immediately by a number == minimum repcount + optionally followed by , then a number == maximum repcount + + then a number == maximum insertion count + - then a number == maximum deletion count + # then a number == maximum substitution count + ~ then a number == maximum number of errors + Any of +, -, # or ~ without followed by a number means that + the maximum count/number of errors is infinite. + + An equation of the form + Xi + Yd + Zs < C + can be specified to set costs and the cost limit to a value + different from the default value: + - X is the cost of an insertion + - Y is the cost of a deletion + - Z is the cost of a substitution + - C is the maximum cost + + If no count limit or cost is set for an operation, the operation + is not allowed at all. + */ + + + do { + int done; + start = r; + + /* Parse count limit settings */ + done = 0; + if (!counts_set) + while (r + 1 < ctx->re_end && !done) + { + switch (*r) + { + case CHAR_PLUS: /* Insert limit */ + DPRINT(("tre_parse: ins limit: '%.*" STRF "'\n", REST(r))); + r++; + limit_ins = tre_parse_int(&r, ctx->re_end); + if (limit_ins < 0) + limit_ins = INT_MAX; + counts_set = 1; + break; + case CHAR_MINUS: /* Delete limit */ + DPRINT(("tre_parse: del limit: '%.*" STRF "'\n", REST(r))); + r++; + limit_del = tre_parse_int(&r, ctx->re_end); + if (limit_del < 0) + limit_del = INT_MAX; + counts_set = 1; + break; + case CHAR_HASH: /* Substitute limit */ + DPRINT(("tre_parse: subst limit: '%.*" STRF "'\n", REST(r))); + r++; + limit_subst = tre_parse_int(&r, ctx->re_end); + if (limit_subst < 0) + limit_subst = INT_MAX; + counts_set = 1; + break; + case CHAR_TILDE: /* Maximum number of changes */ + DPRINT(("tre_parse: count limit: '%.*" STRF "'\n", REST(r))); + r++; + limit_err = tre_parse_int(&r, ctx->re_end); + if (limit_err < 0) + limit_err = INT_MAX; + approx = 1; + break; + case CHAR_COMMA: + r++; + break; + case L' ': + r++; + break; + case L'}': + done = 1; + break; + default: + done = 1; + break; + } + } + + /* Parse cost restriction equation. */ + done = 0; + if (!costs_set) + while (r + 1 < ctx->re_end && !done) + { + switch (*r) + { + case CHAR_PLUS: + case L' ': + r++; + break; + case L'<': + DPRINT(("tre_parse: max cost: '%.*" STRF "'\n", REST(r))); + r++; + while (*r == L' ') + r++; + cost_max = tre_parse_int(&r, ctx->re_end); + if (cost_max < 0) + cost_max = INT_MAX; + else + cost_max--; + approx = 1; + break; + case CHAR_COMMA: + r++; + done = 1; + break; + default: + if (*r >= L'0' && *r <= L'9') + { +#ifdef TRE_DEBUG + const tre_char_t *sr = r; +#endif /* TRE_DEBUG */ + int cost = tre_parse_int(&r, ctx->re_end); + /* XXX - make sure r is not past end. */ + switch (*r) + { + case L'i': /* Insert cost */ + DPRINT(("tre_parse: ins cost: '%.*" STRF "'\n", + REST(sr))); + r++; + cost_ins = cost; + costs_set = 1; + break; + case L'd': /* Delete cost */ + DPRINT(("tre_parse: del cost: '%.*" STRF "'\n", + REST(sr))); + r++; + cost_del = cost; + costs_set = 1; + break; + case L's': /* Substitute cost */ + DPRINT(("tre_parse: subst cost: '%.*" STRF "'\n", + REST(sr))); + r++; + cost_subst = cost; + costs_set = 1; + break; + default: + return REG_BADBR; + } + } + else + { + done = 1; + break; + } + } + } + } while (start != r); +#endif /* TRE_APPROX */ + + /*{*//* Missing }. */ + if (r >= ctx->re_end) + return REG_EBRACE; + + /* Empty contents of {}. */ + if (r == ctx->re) + return REG_BADBR; + + /* Parse the ending '}' or '\}'.*/ + if (ctx->cflags & REG_EXTENDED) + { + if (r >= ctx->re_end || *r != CHAR_RBRACE) + return REG_BADBR; + r++; + /* Parse trailing '?' marking minimal repetition. */ + if (r < ctx->re_end) + { + if (*r == CHAR_QUESTIONMARK) + { + /* Process the question mark only in enhanced mode. + Otherwise, the question mark is an error in ERE + or a literal in BRE */ + if (ctx->cflags & REG_ENHANCED) + { + minimal = !(ctx->cflags & REG_UNGREEDY); + r++; + } + else return REG_BADRPT; + } + else if (*r == CHAR_STAR || *r == CHAR_PLUS) + { + /* These are reserved for future extensions. */ + return REG_BADRPT; + } + } + } + else + { + if (r + 1 >= ctx->re_end + || *r != CHAR_BACKSLASH + || *(r + 1) != CHAR_RBRACE) + return REG_BADBR; + r += 2; + if (r < ctx->re_end && *r == CHAR_STAR) + { + /* This is reserved for future extensions. */ + return REG_BADRPT; + } + } + + if (minimal) + ctx->num_reorder_tags++; + + if (!result) goto parse_bound_exit; + /* Create the AST node(s). */ + /* Originally, if min == 0 && max == 0, we immediately replace the whole + iteration with EMPTY. This unfortunately drops any submatches, and + messes up setting the pmatch values (we can get tags of -1, and + tag values in the billions). So we leave it and process this case as + usual, and wait until tre_expand_ast() to replace with EMPTY */ +#ifdef TRE_APPROX + if (min < 0 && max < 0) + /* Only approximate parameters set, no repetitions. */ + min = max = 1; +#endif /* TRE_APPROX */ + + *result = tre_ast_new_iter(ctx->mem, *result, min, max, minimal); + if (!*result) + return REG_ESPACE; + +#ifdef TRE_APPROX + /* If approximate matching parameters are set, add them to the + iteration node. */ + if (approx || costs_set || counts_set) + { + int *params; + tre_iteration_t *iter = (*result)->obj; + + if (costs_set || counts_set) + { + if (limit_ins == TRE_PARAM_UNSET) + { + if (cost_ins == TRE_PARAM_UNSET) + limit_ins = 0; + else + limit_ins = INT_MAX; + } + + if (limit_del == TRE_PARAM_UNSET) + { + if (cost_del == TRE_PARAM_UNSET) + limit_del = 0; + else + limit_del = INT_MAX; + } + + if (limit_subst == TRE_PARAM_UNSET) + { + if (cost_subst == TRE_PARAM_UNSET) + limit_subst = 0; + else + limit_subst = INT_MAX; + } + } + + if (cost_max == TRE_PARAM_UNSET) + cost_max = INT_MAX; + if (limit_err == TRE_PARAM_UNSET) + limit_err = INT_MAX; + + ctx->have_approx = 1; + params = tre_mem_alloc(ctx->mem, sizeof(*params) * TRE_PARAM_LAST); + if (!params) + return REG_ESPACE; + for (i = 0; i < TRE_PARAM_LAST; i++) + params[i] = TRE_PARAM_UNSET; + params[TRE_PARAM_COST_INS] = cost_ins; + params[TRE_PARAM_COST_DEL] = cost_del; + params[TRE_PARAM_COST_SUBST] = cost_subst; + params[TRE_PARAM_COST_MAX] = cost_max; + params[TRE_PARAM_MAX_INS] = limit_ins; + params[TRE_PARAM_MAX_DEL] = limit_del; + params[TRE_PARAM_MAX_SUBST] = limit_subst; + params[TRE_PARAM_MAX_ERR] = limit_err; + iter->params = params; + } +#endif /* TRE_APPROX */ + +parse_bound_exit: +#ifdef TRE_APPROX + DPRINT(("tre_parse_bound: min %d, max %d, costs [%d,%d,%d, total %d], " + "limits [%d,%d,%d, total %d]\n", + min, max, cost_ins, cost_del, cost_subst, cost_max, + limit_ins, limit_del, limit_subst, limit_err)); +#else /* !TRE_APPROX */ + DPRINT(("tre_parse_bound: min %d, max %d\n", min, max)); +#endif /* !TRE_APPROX */ + + + ctx->re = r; + return REG_OK; +} + +/* Previously, we had PARSE_RESTORE_CFLAGS restore the cflags, but for + non-self-contained options, like (?i), this causes ((?i)fu)bar to be + treated more like ((?i)fu(?-i)bar), so the pmatch value is incorrect. + Because we now set up tags for even non-capturing parenthesized + subexpressions, we always call PARSE_MARK_FOR_SUBMATCH. So if we + pass the unmodified version of cflags to PARSE_MARK_FOR_SUBMATCH and + have it restore cflags after the subexpression, we don't need to have + a separate PARSE_RESTORE_CFLAGS, and then after processing the + non-self-contained option, we can call PARSE_ATOM instead of PARSE_RE. + This has the side-benefit of now matching the perl behavior: the RE + foo(?i)bar|zap is foo(?i)bar OR (?i)zap instead of TRE previous behavior + of foo AND (?i) (bar OR zap). */ +typedef enum { + PARSE_RE = 0, + PARSE_ATOM, + PARSE_MARK_FOR_SUBMATCH, + PARSE_BRANCH, + PARSE_PIECE, + PARSE_CATENATION, + PARSE_POST_CATENATION, + PARSE_UNION, + PARSE_POST_UNION, + PARSE_POSTFIX, +} tre_parse_re_stack_symbol_t; + + +reg_errcode_t +tre_parse(tre_parse_ctx_t *ctx) +{ + tre_ast_node_t *result = NULL; + tre_parse_re_stack_symbol_t symbol; + reg_errcode_t status = REG_OK; + tre_stack_t *stack = ctx->stack; + int bottom = tre_stack_num_objects(stack); + int depth = 0; + int temporary_cflags = 0; + int bre_branch_begin; +#ifdef TRE_DEBUG + const tre_char_t *tmp_re; +#endif + + DPRINT(("tre_parse: parsing '%.*" STRF "', len = %d cflags = 0%o\n", + ctx->len, ctx->re, ctx->len, ctx->cflags)); + + if (ctx->len <= 0) return REG_EMPTY; + if (!ctx->nofirstsub) + { + STACK_PUSH(stack, int, ctx->cflags); + STACK_PUSH(stack, int, ctx->submatch_id); + STACK_PUSH(stack, int, PARSE_MARK_FOR_SUBMATCH); + ctx->submatch_id++; + } + STACK_PUSH(stack, int, 0); // bre_branch_begin + STACK_PUSH(stack, int, PARSE_RE); + ctx->re_start = ctx->re; + ctx->re_end = ctx->re + ctx->len; + + + /* The following is basically just a recursive descent parser. I use + an explicit stack instead of recursive functions mostly because of + two reasons: compatibility with systems which have an overflowable + call stack, and efficiency (both in lines of code and speed). */ + while (tre_stack_num_objects(stack) > bottom) + { + symbol = tre_stack_pop_int(stack); + switch (symbol) + { + case PARSE_RE: + /* Parse a full regexp. A regexp is one or more branches, + separated by the union operator `|'. */ + bre_branch_begin = tre_stack_pop_int(stack); + if ( +#ifdef REG_LITERAL + !(ctx->cflags & REG_LITERAL) && +#endif /* REG_LITERAL */ + ctx->cflags & (REG_EXTENDED | REG_ENHANCED)) + STACK_PUSHX(stack, int, PARSE_UNION); + STACK_PUSHX(stack, int, bre_branch_begin); + STACK_PUSHX(stack, int, PARSE_BRANCH); + break; + + case PARSE_BRANCH: + /* Parse a branch. A branch is one or more pieces, concatenated. + A piece is an atom possibly followed by a postfix operator. */ + bre_branch_begin = tre_stack_pop_int(stack); + STACK_PUSHX(stack, int, PARSE_CATENATION); + STACK_PUSHX(stack, int, bre_branch_begin); + STACK_PUSHX(stack, int, PARSE_PIECE); + break; + + case PARSE_PIECE: + /* Parse a piece. A piece is an atom possibly followed by one + or more postfix operators. */ + bre_branch_begin = tre_stack_pop_int(stack); + STACK_PUSHX(stack, int, PARSE_POSTFIX); + STACK_PUSHX(stack, int, bre_branch_begin); + STACK_PUSHX(stack, int, PARSE_ATOM); + break; + + case PARSE_CATENATION: + /* If the expression has not ended, parse another piece. */ + { + tre_char_t c; + if (ctx->re >= ctx->re_end) + break; + c = *ctx->re; +#ifdef REG_LITERAL + if (!(ctx->cflags & REG_LITERAL)) + { +#endif /* REG_LITERAL */ + if ((ctx->cflags & REG_EXTENDED && c == CHAR_PIPE) || + ((ctx->cflags & (REG_EXTENDED | REG_ENHANCED)) == REG_ENHANCED + && ctx->re + 1 < ctx->re_end && c == CHAR_BACKSLASH && + *(ctx->re + 1) == CHAR_PIPE)) + break; + if ((ctx->cflags & REG_EXTENDED + && c == CHAR_RPAREN && depth > 0) + || (!(ctx->cflags & REG_EXTENDED) + && ctx->re + 1 < ctx->re_end && c == CHAR_BACKSLASH + && *(ctx->re + 1) == CHAR_RPAREN)) + { + if (!(ctx->cflags & REG_EXTENDED) && depth == 0) + return REG_EPAREN; + DPRINT(("tre_parse: group end: '%.*" STRF "'\n", + REST(ctx->re))); + depth--; + if (!(ctx->cflags & (REG_EXTENDED | REG_ENHANCED))) + ctx->re += 2; + break; + } +#ifdef REG_LITERAL + } +#endif /* REG_LITERAL */ + +#ifdef REG_LEFT_ASSOC + if (ctx->cflags & REG_LEFT_ASSOC) + { + /* Left associative concatenation. */ + STACK_PUSHX(stack, int, PARSE_CATENATION); + STACK_PUSHX(stack, voidptr, result); + STACK_PUSHX(stack, int, PARSE_POST_CATENATION); + STACK_PUSHX(stack, int, 0); // bre_branch_begin + STACK_PUSHX(stack, int, PARSE_PIECE); + } + else +#endif /* REG_LEFT_ASSOC */ + { + /* Default case, right associative concatenation. */ + STACK_PUSHX(stack, voidptr, result); + STACK_PUSHX(stack, int, PARSE_POST_CATENATION); + STACK_PUSHX(stack, int, PARSE_CATENATION); + STACK_PUSHX(stack, int, 0); // bre_branch_begin + STACK_PUSHX(stack, int, PARSE_PIECE); + } + break; + } + + case PARSE_POST_CATENATION: + { + tre_ast_node_t *tree = tre_stack_pop_voidptr(stack); + tre_ast_node_t *tmp_node; + tmp_node = tre_ast_new_catenation(ctx->mem, tree, result); + if (!tmp_node) + return REG_ESPACE; + result = tmp_node; + break; + } + + case PARSE_UNION: + if (ctx->re >= ctx->re_end) + break; +#ifdef REG_LITERAL + if (ctx->cflags & REG_LITERAL) + break; +#endif /* REG_LITERAL */ + if (!(ctx->cflags & REG_EXTENDED)) + { + if (*ctx->re != CHAR_BACKSLASH || ctx->re + 1 >= ctx->re_end) + break; + ctx->re++; + } + switch (*ctx->re) + { + case CHAR_PIPE: + DPRINT(("tre_parse: union: '%.*" STRF "'\n", + REST(ctx->re))); + STACK_PUSHX(stack, int, PARSE_UNION); + STACK_PUSHX(stack, voidptr, (void *)ctx->re); + STACK_PUSHX(stack, voidptr, result); + STACK_PUSHX(stack, int, PARSE_POST_UNION); + /* We need to pass a boolean (eventually) to PARSE_ATOM to + indicate if this is the beginning of a BRE extended branch. */ + STACK_PUSHX(stack, int, (ctx->cflags & (REG_EXTENDED | REG_ENHANCED)) == REG_ENHANCED); // bre_branch_begin + STACK_PUSHX(stack, int, PARSE_BRANCH); + ctx->re++; + break; + + case CHAR_RPAREN: + ctx->re++; + break; + + default: + if (!(ctx->cflags & REG_EXTENDED)) + ctx->re--; + break; + } + break; + + case PARSE_POST_UNION: + { + tre_ast_node_t *tmp_node; + tre_ast_node_t *tree = tre_stack_pop_voidptr(stack); + const tre_char_t *pipechar = tre_stack_pop_voidptr(stack); + /* error on empty expression at end of union */ + if (pipechar == ctx->re - 1) + { + return REG_EMPTY; + } + tmp_node = tre_ast_new_union(ctx->mem, tree, result); + if (!tmp_node) + return REG_ESPACE; + result = tmp_node; + break; + } + + case PARSE_POSTFIX: + /* Parse postfix operators. */ + if (ctx->re >= ctx->re_end) + break; +#ifdef REG_LITERAL + if (ctx->cflags & REG_LITERAL) + break; +#endif /* REG_LITERAL */ + int minimal = (ctx->cflags & REG_UNGREEDY) ? 1 : 0; + int rep_min = 0; + int rep_max = -1; +#ifdef TRE_DEBUG + int lbrace_off; +#endif + switch (*ctx->re) + { + case CHAR_PLUS: + case CHAR_QUESTIONMARK: + if (!(ctx->cflags & REG_EXTENDED)) + break; + /*FALLTHROUGH*/ + case CHAR_STAR: + { + tre_ast_node_t *tmp_node; +#ifdef TRE_DEBUG + const char *tstr = "star"; + tmp_re = ctx->re; +#endif + + handle_plus_or_question: + /* error on iteration of raw assertion (not in subexpression) */ + if (result->type == LITERAL && result->submatch_id < 0 && + IS_ASSERTION((tre_literal_t *)result->obj)) + { + if (!(ctx->cflags & REG_EXTENDED)) break; + return REG_BADRPT; + } + if (*ctx->re == CHAR_PLUS) + { + rep_min = 1; +#ifdef TRE_DEBUG + tstr = "plus"; +#endif + } + if (*ctx->re == CHAR_QUESTIONMARK) + { + rep_max = 1; +#ifdef TRE_DEBUG + tstr = "questionmark"; +#endif + } + + if (ctx->cflags & REG_EXTENDED) + { + if (ctx->re + 1 < ctx->re_end) + { + if (*(ctx->re + 1) == CHAR_QUESTIONMARK) + { + /* Process the question mark only in enhanced mode. + Otherwise, the question mark is an error in ERE */ + if (ctx->cflags & REG_ENHANCED) + { + minimal = !(ctx->cflags & REG_UNGREEDY); + ctx->re++; + } + else return REG_BADRPT; + } + else if (*(ctx->re + 1) == CHAR_STAR + || *(ctx->re + 1) == CHAR_PLUS) + { + /* These are reserved for future extensions. */ + return REG_BADRPT; + } + } + } + else + { + if (ctx->re + 1 < ctx->re_end && *(ctx->re + 1) == CHAR_STAR) + { + /* This is reserved for future extensions. */ + return REG_BADRPT; + } + if (ctx->re + 2 < ctx->re_end) + { + if (*(ctx->re + 1) == CHAR_BACKSLASH && *(ctx->re + 1) == CHAR_QUESTIONMARK) + { + /* Process the question mark only in enhanced mode. + Otherwise, the question mark is a literal in BRE */ + if (ctx->cflags & REG_ENHANCED) + { + minimal = !(ctx->cflags & REG_UNGREEDY); + ctx->re += 2; + } + } + else if (*(ctx->re + 1) == CHAR_BACKSLASH && *(ctx->re + 2) == CHAR_PLUS) + { + /* This is reserved for future extensions. */ + return REG_BADRPT; + } + } + } + + if (minimal) + ctx->num_reorder_tags++; + + DPRINT(("tre_parse: %s %s: '%.*" STRF "'\n", + minimal ? " minimal" : "greedy", tstr, REST(tmp_re))); + if (result == NULL) + { + if (ctx->cflags & REG_EXTENDED) return REG_BADRPT; + else goto parse_literal; + } + ctx->re++; + tmp_node = tre_ast_new_iter(ctx->mem, result, rep_min, rep_max, + minimal); + if (tmp_node == NULL) + return REG_ESPACE; + result = tmp_node; + + /* Set the iterator with a submatch id in the invisible range + * (which will be overridden if a real submatch is needed) */ + result->submatch_id = ctx->submatch_id_invisible++; + +#if 0 + /* We don't allow multiple postfixes, but this might be needed + to support approximate matching */ + STACK_PUSHX(stack, int, PARSE_POSTFIX); +#endif + } + break; + + case CHAR_BACKSLASH: + /* "\{" is special without REG_EXTENDED */ + /* "\+" and "\?" are special with REG_ENHANCED for BRE */ + if (!(ctx->cflags & REG_EXTENDED) + && ctx->re + 1 < ctx->re_end) + { + switch (*(ctx->re + 1)) + { + case CHAR_LBRACE: + ctx->re++; +#ifdef TRE_DEBUG + lbrace_off = 2; +#endif + goto parse_brace; + case CHAR_PLUS: + case CHAR_QUESTIONMARK: + if (ctx->cflags & REG_ENHANCED) + { +#ifdef TRE_DEBUG + tmp_re = ctx->re; +#endif + ctx->re++; + goto handle_plus_or_question; + } + break; + } + break; + } + else + break; + + case CHAR_LBRACE: + { + int raw_assertion; + + /* "{" is literal without REG_EXTENDED */ + if (!(ctx->cflags & REG_EXTENDED)) + break; +#ifdef TRE_DEBUG + lbrace_off = 1; +#endif + + parse_brace: + /* error on iteration of raw assertion (not in subexpression), + but wait until after parsing bounds */ + raw_assertion = (result->type == LITERAL + && result->submatch_id < 0 + && IS_ASSERTION((tre_literal_t *)result->obj)); + ctx->re++; + + status = tre_parse_bound(ctx, &result); +#ifdef ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND + /* For ERE, if status is REG_NOMATCH, this mean the lbrace + is to be treated as a literal. */ + if (status == REG_NOMATCH) + { + ctx->re--; + break; + } +#endif /* ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND */ + DPRINT(("tre_parse: bound: '%.*" STRF "'\n", + REST(ctx->re - lbrace_off))); + if (status != REG_OK) + return status; + if (raw_assertion) return REG_BADRPT; + + /* Set the iterator with a submatch id in the invisible range + * (which will be overridden if a real submatch is needed) */ + if (result->type == ITERATION) + result->submatch_id = ctx->submatch_id_invisible++; + +#if 0 + /* We don't allow multiple postfixes, but this might be needed + to support approximate matching */ + STACK_PUSHX(stack, int, PARSE_POSTFIX); +#endif + break; + } + } + break; + + case PARSE_ATOM: + { + /* Parse an atom. An atom is a regular expression enclosed in `()', + an empty set of `()', a bracket expression, `.', `^', `$', + a `\' followed by a character, or a single character. */ + + /* The stack contains a boolean value, whether PARSE_ATOM is + being called just after the start of a group (left paren) + in a BRE */ + bre_branch_begin = tre_stack_pop_int(stack); + + /* End of regexp? (empty string). */ + if (ctx->re >= ctx->re_end) + goto parse_literal; + +#ifdef REG_LITERAL + if (ctx->cflags & REG_LITERAL) + goto parse_literal; +#endif /* REG_LITERAL */ + + switch (*ctx->re) + { + case CHAR_LPAREN: /* parenthesized subexpression */ + + /* Handle "(?...)" extensions. They work in a way similar + to Perls corresponding extensions. */ + if ((ctx->cflags & (REG_EXTENDED|REG_ENHANCED)) == + (REG_EXTENDED|REG_ENHANCED) + && *(ctx->re + 1) == CHAR_QUESTIONMARK) + { + int new_cflags = ctx->cflags; + int bit = 1; + int invisible_submatch = 0; + DPRINT(("tre_parse: extension: '%.*" STRF "'\n", + REST(ctx->re))); + ctx->re += 2; + while (/*CONSTCOND*/1) + { + if (*ctx->re == L'i') + { + DPRINT(("tre_parse: icase: '%.*" STRF "'\n", + REST(ctx->re))); + if (bit) + new_cflags |= REG_ICASE; + else + new_cflags &= ~REG_ICASE; + ctx->re++; + } + else if (*ctx->re == L'n') + { + DPRINT(("tre_parse: newline: '%.*" STRF "'\n", + REST(ctx->re))); + if (bit) + new_cflags |= REG_NEWLINE; + else + new_cflags &= ~REG_NEWLINE; + ctx->re++; + } +#ifdef REG_LEFT_ASSOC + else if (*ctx->re == L'l') + { + DPRINT(("tre_parse: left assoc: '%.*" STRF "'\n", + REST(ctx->re))); + if (bit) + new_cflags |= REG_LEFT_ASSOC; + else + new_cflags &= ~REG_LEFT_ASSOC; + ctx->re++; + } +#endif /* REG_LEFT_ASSOC */ +#ifdef REG_UNGREEDY + else if (*ctx->re == L'U') + { + DPRINT(("tre_parse: ungreedy: '%.*" STRF "'\n", + REST(ctx->re))); + if (bit) + new_cflags |= REG_UNGREEDY; + else + new_cflags &= ~REG_UNGREEDY; + ctx->re++; + } +#endif /* REG_UNGREEDY */ + else if (*ctx->re == CHAR_MINUS) + { + DPRINT(("tre_parse: turn off: '%.*" STRF "'\n", + REST(ctx->re))); + ctx->re++; + bit = 0; + } + else if (*ctx->re == CHAR_COLON) + { + DPRINT(("tre_parse: no group: '%.*" STRF + "', (invisible submatch %d)\n", + REST(ctx->re), ctx->submatch_id_invisible)); + ctx->re++; + depth++; + invisible_submatch = 1; + break; + } + else if (*ctx->re == CHAR_HASH) + { + DPRINT(("tre_parse: comment: '%.*" STRF "'\n", + REST(ctx->re))); + /* A comment can contain any character except a + right parenthesis */ + while (*ctx->re != CHAR_RPAREN + && ctx->re < ctx->re_end) + ctx->re++; + if (*ctx->re == CHAR_RPAREN && ctx->re < ctx->re_end) + { + ctx->re++; + break; + } + else + return REG_BADPAT; + } + else if (*ctx->re == CHAR_RPAREN) + { + ctx->re++; + break; + } + else + return REG_BADRPT; + } + + /* Turn on the cflags changes for the rest of the + enclosing group. */ + if (invisible_submatch) + { + STACK_PUSHX(stack, int, ctx->cflags); + STACK_PUSHX(stack, int, ctx->submatch_id_invisible); + STACK_PUSHX(stack, int, PARSE_MARK_FOR_SUBMATCH); + ctx->submatch_id_invisible++; + STACK_PUSHX(stack, int, 0); // bre_branch_begin + STACK_PUSHX(stack, int, PARSE_RE); + } + else { + STACK_PUSHX(stack, int, 0); // bre_branch_begin + STACK_PUSHX(stack, int, PARSE_ATOM); + } + ctx->cflags = new_cflags; + break; + } + + if (ctx->cflags & REG_EXTENDED) + { + parse_bre_lparen: + DPRINT(("tre_parse: group begin: '%.*" STRF + "', submatch %d\n", REST(ctx->re), + ctx->submatch_id)); + ctx->re++; + /* First parse a whole RE, then mark the resulting tree + for submatching. */ + STACK_PUSHX(stack, int, ctx->cflags); + STACK_PUSHX(stack, int, ctx->submatch_id); + STACK_PUSHX(stack, int, PARSE_MARK_FOR_SUBMATCH); + /* We need to pass a boolean (eventually) to PARSE_ATOM to + indicate if this is the beginning of a BRE group. */ + STACK_PUSHX(stack, int, !(ctx->cflags & REG_EXTENDED)); + STACK_PUSHX(stack, int, PARSE_RE); + ctx->submatch_id++; + depth++; + } + else + goto parse_literal; + break; + + case CHAR_RPAREN: /* end of current subexpression */ + if (ctx->cflags & REG_EXTENDED && depth > 0) + { + parse_bre_rparen_empty: + if (!(ctx->cflags & REG_EXTENDED) && depth == 0) + return REG_EPAREN; + DPRINT(("tre_parse: empty: '%.*" STRF "'\n", + REST(ctx->re))); + /* We were expecting an atom, but instead the current + subexpression was closed. POSIX leaves the meaning of + this to be implementation-defined. We interpret this as + an empty expression (which matches an empty string). */ + result = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); + if (result == NULL) + return REG_ESPACE; + if (!(ctx->cflags & REG_EXTENDED)) + ctx->re--; + } + else + goto parse_literal; + break; + + case CHAR_LBRACKET: /* bracket expression */ + DPRINT(("tre_parse: bracket: '%.*" STRF "'\n", + REST(ctx->re))); + ctx->re++; + status = tre_parse_bracket(ctx, &result); + if (status != REG_OK) + return status; + break; + + case CHAR_BACKSLASH: + /* Deal with "\(", "\)" or "\{" for BREs */ + if (!(ctx->cflags & REG_EXTENDED) + && ctx->re + 1 < ctx->re_end) + { + if (*(ctx->re + 1) == CHAR_LPAREN) + { + ctx->re++; + goto parse_bre_lparen; + } + else if (*(ctx->re + 1) == CHAR_RPAREN) + { + ctx->re++; + goto parse_bre_rparen_empty; + } + if (*(ctx->re + 1) == CHAR_LBRACE) goto parse_literal; + } + + if (ctx->re + 1 >= ctx->re_end) + /* Trailing backslash. */ + return REG_EESCAPE; + + if (!(ctx->cflags & REG_ENHANCED)) + { + DPRINT(("tre_parse: unenhanced bleep: '%.*" STRF "'\n", REST(ctx->re))); + ctx->re++; + goto unenhanced_backslash; + } + + /* If a macro is used, parse the expanded macro recursively. */ + { + tre_char_t buf[64]; + tre_expand_macro(ctx->re + 1, ctx->re_end, + buf, elementsof(buf)); + if (buf[0] != 0) + { + tre_parse_ctx_t subctx; + memcpy(&subctx, ctx, sizeof(subctx)); + subctx.re = buf; + subctx.len = tre_strlen(buf); + subctx.nofirstsub = 1; + status = tre_parse(&subctx); + if (status != REG_OK) + return status; + ctx->re += 2; + ctx->position = subctx.position; + result = subctx.result; + break; + } + } + +#ifdef REG_LITERAL + if (*(ctx->re + 1) == L'Q') + { + DPRINT(("tre_parse: tmp literal: '%.*" STRF "'\n", + REST(ctx->re))); + ctx->cflags |= REG_LITERAL; + temporary_cflags |= REG_LITERAL; + ctx->re += 2; + STACK_PUSHX(stack, int, 0); + STACK_PUSHX(stack, int, PARSE_ATOM); + break; + } +#endif /* REG_LITERAL */ + + DPRINT(("tre_parse: bleep: '%.*" STRF "'\n", REST(ctx->re))); + ctx->re++; + switch (*ctx->re) + { + case L'b': + result = tre_ast_new_literal(ctx->mem, ASSERTION, + ASSERT_AT_WB, -1); + ctx->re++; + break; + case L'B': + result = tre_ast_new_literal(ctx->mem, ASSERTION, + ASSERT_AT_WB_NEG, -1); + ctx->re++; + break; + case L'<': + result = tre_ast_new_literal(ctx->mem, ASSERTION, + ASSERT_AT_BOW, -1); + ctx->re++; + break; + case L'>': + result = tre_ast_new_literal(ctx->mem, ASSERTION, + ASSERT_AT_EOW, -1); + ctx->re++; + break; + case L'x': + ctx->re++; + if (ctx->re[0] != CHAR_LBRACE && ctx->re < ctx->re_end) + { + /* 8 bit hex char. */ + char tmp[3] = {0, 0, 0}; + long val; + DPRINT(("tre_parse: 8 bit hex: '%.*" STRF "'\n", + REST(ctx->re - 2))); + + if (tre_isxdigit_l(ctx->re[0], ctx->loc) && + ctx->re < ctx->re_end) + { + tmp[0] = (char)ctx->re[0]; + ctx->re++; + } + if (tre_isxdigit_l(ctx->re[0], ctx->loc) && + ctx->re < ctx->re_end) + { + tmp[1] = (char)ctx->re[0]; + ctx->re++; + } + val = strtol(tmp, NULL, 16); + result = tre_ast_new_literal(ctx->mem, (int)val, + (int)val, ctx->position); + ctx->position++; + break; + } + else if (ctx->re < ctx->re_end) + { + /* Wide char. */ + char tmp[32]; + long val; + int i = 0; + ctx->re++; + while (ctx->re_end - ctx->re >= 0) + { + if (i == sizeof(tmp)) + return REG_EBRACE; + if (ctx->re[0] == CHAR_RBRACE) + break; + if (tre_isxdigit_l(ctx->re[0], ctx->loc)) + { + tmp[i] = (char)ctx->re[0]; + i++; + ctx->re++; + continue; + } + return REG_EBRACE; + } + ctx->re++; + tmp[i] = 0; + val = strtol(tmp, NULL, 16); + result = tre_ast_new_literal(ctx->mem, (int)val, (int)val, + ctx->position); + ctx->position++; + break; + } + /*FALLTHROUGH*/ + + default: + unenhanced_backslash: + if ((ctx->cflags & (REG_EXTENDED | REG_ENHANCED)) != + REG_EXTENDED && + tre_isdigit_l(*ctx->re, ctx->loc) && *ctx->re != L'0') + { + /* Back reference (only in BRE or enhanced). */ + int val = *ctx->re - L'0'; + DPRINT(("tre_parse: backref: '%.*" STRF "'\n", + REST(ctx->re - 1))); + result = tre_ast_new_literal(ctx->mem, BACKREF, val, + ctx->position); + if (result == NULL) + return REG_ESPACE; + + /* Set the backref with a submatch id in the invisible + * range (which will be overridden if a real submatch + * is needed) */ + result->submatch_id = ctx->submatch_id_invisible++; + + ctx->position++; + ctx->num_reorder_tags++; + ctx->max_backref = MAX(val, ctx->max_backref); + ctx->re++; + } + else + { + /* Escaped character. */ + DPRINT(("tre_parse: escaped: '%.*" STRF "'\n", + REST(ctx->re - 1))); + result = tre_ast_new_literal(ctx->mem, *ctx->re, *ctx->re, + ctx->position); + ctx->position++; + ctx->re++; + } + break; + } + if (result == NULL) + return REG_ESPACE; + break; + + case CHAR_PERIOD: /* the any-symbol */ + DPRINT(("tre_parse: any: '%.*" STRF "'\n", + REST(ctx->re))); + if (ctx->cflags & REG_NEWLINE) + { + tre_ast_node_t *tmp1; + tre_ast_node_t *tmp2; + tmp1 = tre_ast_new_literal(ctx->mem, 0, L'\n' - 1, + ctx->position); + if (!tmp1) + return REG_ESPACE; + tmp2 = tre_ast_new_literal(ctx->mem, L'\n' + 1, TRE_CHAR_MAX, + ctx->position + 1); + if (!tmp2) + return REG_ESPACE; + result = tre_ast_new_union(ctx->mem, tmp1, tmp2); + if (!result) + return REG_ESPACE; + ctx->position += 2; + } + else + { + result = tre_ast_new_literal(ctx->mem, 0, TRE_CHAR_MAX, + ctx->position); + if (!result) + return REG_ESPACE; + ctx->position++; + } + ctx->re++; + break; + + case CHAR_CARET: /* beginning of line assertion */ + /* '^' has a special meaning everywhere in EREs, at the + beginning of the RE and after \( is BREs. It is also + special in enhanced BREs at the beginning of each branches + of a union */ + if (ctx->cflags & REG_EXTENDED + || bre_branch_begin + || ctx->re == ctx->re_start) + { + DPRINT(("tre_parse: BOL: '%.*" STRF "'\n", + REST(ctx->re))); + result = tre_ast_new_literal(ctx->mem, ASSERTION, + ASSERT_AT_BOL, -1); + if (result == NULL) + return REG_ESPACE; + ctx->re++; + } + else + goto parse_literal; + break; + + case CHAR_DOLLAR: /* end of line assertion. */ + /* '$' is special everywhere in EREs, and in the end of the + string and before \) is BREs. */ + if (ctx->cflags & REG_EXTENDED + || (ctx->re + 2 < ctx->re_end + && *(ctx->re + 1) == CHAR_BACKSLASH + && *(ctx->re + 2) == CHAR_RPAREN) + || ctx->re + 1 == ctx->re_end) + { + DPRINT(("tre_parse: EOL: '%.*" STRF "'\n", + REST(ctx->re))); + result = tre_ast_new_literal(ctx->mem, ASSERTION, + ASSERT_AT_EOL, -1); + if (result == NULL) + return REG_ESPACE; + ctx->re++; + } + else + goto parse_literal; + break; + + default: + parse_literal: + + if (temporary_cflags && ctx->re + 1 < ctx->re_end + && *ctx->re == CHAR_BACKSLASH && *(ctx->re + 1) == L'E') + { + DPRINT(("tre_parse: end tmps: '%.*" STRF "'\n", + REST(ctx->re))); + ctx->cflags &= ~temporary_cflags; + temporary_cflags = 0; + ctx->re += 2; + if (ctx->re < ctx->re_end) + { + STACK_PUSHX(stack, int, 0); + STACK_PUSHX(stack, int, PARSE_ATOM); + } + else + { + result = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); + if (!result) return REG_ESPACE; + } + break; + } + + + /* We are expecting an atom. If the subexpression (or the whole + regexp ends here, we interpret it as an empty expression + (which matches an empty string), which is an error. + Iterations of an empty expression is also an error. */ +#ifdef REG_LITERAL + if (!(ctx->cflags & REG_LITERAL)) + { +#endif /* REG_LITERAL */ + /* error on end of string */ + if (ctx->re >= ctx->re_end) return depth > 0 ? REG_EPAREN + : REG_EMPTY; + /* error on unions and iterations of empty expressions */ + if (ctx->cflags & REG_EXTENDED) + { + if (ctx->re < ctx->re_end) + { + if (*ctx->re == CHAR_PIPE) return REG_EMPTY; + if (*ctx->re == CHAR_LBRACE) + { + ctx->re++; + empty_parse_bound: + /* We need to parse the bound first and return + any error, before returning REG_BADRPT */ + status = tre_parse_bound(ctx, NULL); +#ifdef ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND + /* For ERE, if REG_NOMATCH is returned, we + treat the lbrace as a literal. */ + if (status == REG_NOMATCH) + { + ctx->re--; + /* Drop down to literal-handling code */ + } + else + { +#endif /* ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND */ + if (status != REG_OK) + return status; + return REG_BADRPT; +#ifdef ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND + } +#endif /* ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND */ + } +#ifdef ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND + else +#endif /* ERE_LITERAL_LBRACE_ON_NON_NUMERIC_BOUND */ + if (*ctx->re == CHAR_STAR + || *ctx->re == CHAR_PLUS + || *ctx->re == CHAR_QUESTIONMARK) + { + return REG_BADRPT; + } + } + } + else if (ctx->re + 1 < ctx->re_end + && *ctx->re == CHAR_BACKSLASH + && *(ctx->re + 1) == CHAR_LBRACE) + { + ctx->re += 2; + goto empty_parse_bound; + } +#ifdef REG_LITERAL + } +#endif /* REG_LITERAL */ + + DPRINT(("tre_parse: literal: '%.*" STRF "'\n", + REST(ctx->re))); + /* Note that we can't use an tre_isalpha() test here, since there + may be characters which are alphabetic but neither upper or + lower case. */ + if (ctx->cflags & REG_ICASE + && (tre_isupper_l(*ctx->re, ctx->loc) || + tre_islower_l(*ctx->re, ctx->loc))) + { + tre_ast_node_t *tmp1; + tre_ast_node_t *tmp2; + + /* XXX - Can there be more than one opposite-case + counterpoints for some character in some locale? Or + more than two characters which all should be regarded + the same character if case is ignored? If yes, there + does not seem to be a portable way to detect it. I guess + that at least for multi-character collating elements there + could be several opposite-case counterpoints, but they + cannot be supported portably anyway. */ + tmp1 = tre_ast_new_literal(ctx->mem, + tre_toupper_l(*ctx->re, ctx->loc), + tre_toupper_l(*ctx->re, ctx->loc), + ctx->position); + if (!tmp1) + return REG_ESPACE; + tmp2 = tre_ast_new_literal(ctx->mem, + tre_tolower_l(*ctx->re, ctx->loc), + tre_tolower_l(*ctx->re, ctx->loc), + ctx->position); + if (!tmp2) + return REG_ESPACE; + result = tre_ast_new_union(ctx->mem, tmp1, tmp2); + if (!result) + return REG_ESPACE; + } + else + { + result = tre_ast_new_literal(ctx->mem, *ctx->re, *ctx->re, + ctx->position); + if (!result) + return REG_ESPACE; + } + ctx->position++; + ctx->re++; + break; + } + break; + } + + case PARSE_MARK_FOR_SUBMATCH: + { + int submatch_id = tre_stack_pop_int(stack); + + ctx->cflags = tre_stack_pop_int(stack); /* restore cflags */ + if (result->submatch_id >= 0 && + result->submatch_id < SUBMATCH_ID_INVISIBLE_START) + { + tre_ast_node_t *n, *tmp_node; + if (submatch_id >= SUBMATCH_ID_INVISIBLE_START) + break; + n = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); + if (n == NULL) + return REG_ESPACE; + tmp_node = tre_ast_new_catenation(ctx->mem, n, result); + if (tmp_node == NULL) + return REG_ESPACE; + tmp_node->num_submatches = result->num_submatches; + result = tmp_node; + } + result->submatch_id = submatch_id; + if (submatch_id < SUBMATCH_ID_INVISIBLE_START) + result->num_submatches++; + break; + } + + default: + assert(0); + break; + } + } + + /* Check for missing closing parentheses. */ + if (depth > 0) + return REG_EPAREN; + + ctx->result = result; + + return REG_OK; +} + +/* EOF */ diff --git a/regex/TRE/lib/tre-parse.h b/regex/TRE/lib/tre-parse.h new file mode 100644 index 0000000..431f407 --- /dev/null +++ b/regex/TRE/lib/tre-parse.h @@ -0,0 +1,62 @@ +/* + tre-parse.c - Regexp parser definitions + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#ifndef TRE_PARSE_H +#define TRE_PARSE_H 1 + +#ifdef __LIBC__ +#include +#else /* !__LIBC__ */ +#include +#endif /* !__LIBC__ */ + +/* Parse context. */ +typedef struct { + /* Memory allocator. The AST is allocated using this. */ + tre_mem_t mem; + /* Stack used for keeping track of regexp syntax. */ + tre_stack_t *stack; + /* The parse result. */ + tre_ast_node_t *result; + /* The regexp to parse and its length. */ + const tre_char_t *re; + /* The first character of the entire regexp. */ + const tre_char_t *re_start; + /* The first character after the end of the regexp. */ + const tre_char_t *re_end; + /* The current locale */ + locale_t loc; + int len; + /* Current submatch ID. */ + int submatch_id; + /* Current invisible submatch ID. */ + int submatch_id_invisible; + /* Current position (number of literal). */ + int position; + /* The highest back reference or -1 if none seen so far. */ + int max_backref; + /* Number of tags that need reordering. */ + int num_reorder_tags; + /* This flag is set if the regexp uses approximate matching. */ + int have_approx; + /* Compilation flags. */ + int cflags; + /* If this flag is set the top-level submatch is not captured. */ + int nofirstsub; + /* The currently set approximate matching parameters. */ + int params[TRE_PARAM_LAST]; +} tre_parse_ctx_t; + +/* Parses a wide character regexp pattern into a syntax tree. This parser + handles both syntaxes (BRE and ERE), including the TRE extensions. */ +__private_extern__ reg_errcode_t +tre_parse(tre_parse_ctx_t *ctx); + +#endif /* TRE_PARSE_H */ + +/* EOF */ diff --git a/regex/TRE/lib/tre-stack.c b/regex/TRE/lib/tre-stack.c new file mode 100644 index 0000000..8ad89c8 --- /dev/null +++ b/regex/TRE/lib/tre-stack.c @@ -0,0 +1,125 @@ +/* + tre-stack.c - Simple stack implementation + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ +#include +#include + +#include "tre-internal.h" +#include "tre-stack.h" +#include "xmalloc.h" + +union tre_stack_item { + void *voidptr_value; + int int_value; +}; + +struct tre_stack_rec { + int size; + int max_size; + int increment; + int ptr; + union tre_stack_item *stack; +}; + + +tre_stack_t * +tre_stack_new(int size, int max_size, int increment) +{ + tre_stack_t *s; + + s = xmalloc(sizeof(*s)); + if (s != NULL) + { + s->stack = xmalloc(sizeof(*s->stack) * size); + if (s->stack == NULL) + { + xfree(s); + return NULL; + } + s->size = size; + s->max_size = max_size; + s->increment = increment; + s->ptr = 0; + } + return s; +} + +void +tre_stack_destroy(tre_stack_t *s) +{ + xfree(s->stack); + xfree(s); +} + +int +tre_stack_num_objects(tre_stack_t *s) +{ + return s->ptr; +} + +static reg_errcode_t +tre_stack_push(tre_stack_t *s, union tre_stack_item value) +{ + if (s->ptr < s->size) + { + s->stack[s->ptr] = value; + s->ptr++; + } + else + { + if (s->size >= s->max_size) + { + DPRINT(("tre_stack_push: stack full\n")); + return REG_ESPACE; + } + else + { + union tre_stack_item *new_buffer; + int new_size; + DPRINT(("tre_stack_push: trying to realloc more space\n")); + new_size = s->size + s->increment; + if (new_size > s->max_size) + new_size = s->max_size; + new_buffer = xrealloc(s->stack, sizeof(*new_buffer) * new_size); + if (new_buffer == NULL) + { + DPRINT(("tre_stack_push: realloc failed.\n")); + return REG_ESPACE; + } + DPRINT(("tre_stack_push: realloc succeeded.\n")); + assert(new_size > s->size); + s->size = new_size; + s->stack = new_buffer; + tre_stack_push(s, value); + } + } + return REG_OK; +} + +#define define_pushf(typetag, type) \ + declare_pushf(typetag, type) { \ + union tre_stack_item item; \ + item.typetag ## _value = value; \ + return tre_stack_push(s, item); \ +} + +define_pushf(int, int) +define_pushf(voidptr, void *) + +#define define_popf(typetag, type) \ + declare_popf(typetag, type) { \ + return s->stack[--s->ptr].typetag ## _value; \ + } + +define_popf(int, int) +define_popf(voidptr, void *) + +/* EOF */ diff --git a/regex/TRE/lib/tre-stack.h b/regex/TRE/lib/tre-stack.h new file mode 100644 index 0000000..1002a1c --- /dev/null +++ b/regex/TRE/lib/tre-stack.h @@ -0,0 +1,77 @@ +/* + tre-stack.h: Stack definitions + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + + +#ifndef TRE_STACK_H +#define TRE_STACK_H 1 + +#include "tre.h" + +typedef struct tre_stack_rec tre_stack_t; + +/* Creates a new stack object. `size' is initial size in bytes, `max_size' + is maximum size, and `increment' specifies how much more space will be + allocated with realloc() if all space gets used up. Returns the stack + object or NULL if out of memory. */ +__private_extern__ tre_stack_t * +tre_stack_new(int size, int max_size, int increment); + +/* Frees the stack object. */ +__private_extern__ void +tre_stack_destroy(tre_stack_t *s); + +/* Returns the current number of objects in the stack. */ +__private_extern__ int +tre_stack_num_objects(tre_stack_t *s); + +/* Each tre_stack_push_*(tre_stack_t *s, value) function pushes + `value' on top of stack `s'. Returns REG_ESPACE if out of memory. + This tries to realloc() more space before failing if maximum size + has not yet been reached. Returns REG_OK if successful. */ +#define declare_pushf(typetag, type) \ + __private_extern__ reg_errcode_t tre_stack_push_ ## typetag(tre_stack_t *s, \ + type value) + +declare_pushf(voidptr, void *); +declare_pushf(int, int); + +/* Each tre_stack_pop_*(tre_stack_t *s) function pops the topmost + element off of stack `s' and returns it. The stack must not be + empty. */ +#define declare_popf(typetag, type) \ + __private_extern__ type tre_stack_pop_ ## typetag(tre_stack_t *s) + +declare_popf(voidptr, void *); +declare_popf(int, int); + +/* Just to save some typing. */ +#define STACK_PUSH(s, typetag, value) \ + do \ + { \ + status = tre_stack_push_ ## typetag(s, value); \ + } \ + while (/*CONSTCOND*/0) + +#define STACK_PUSHX(s, typetag, value) \ + { \ + status = tre_stack_push_ ## typetag(s, value); \ + if (status != REG_OK) \ + break; \ + } + +#define STACK_PUSHR(s, typetag, value) \ + { \ + reg_errcode_t _status; \ + _status = tre_stack_push_ ## typetag(s, value); \ + if (_status != REG_OK) \ + return _status; \ + } + +#endif /* TRE_STACK_H */ + +/* EOF */ diff --git a/regex/TRE/lib/tre.h b/regex/TRE/lib/tre.h new file mode 100644 index 0000000..7827ce4 --- /dev/null +++ b/regex/TRE/lib/tre.h @@ -0,0 +1,328 @@ +/* + tre.h - TRE public API definitions + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#ifndef TRE_H +#define TRE_H 1 + +#include "tre-config.h" + +#ifdef HAVE_SYS_TYPES_H +#include +#endif /* HAVE_SYS_TYPES_H */ + +#ifdef HAVE_LIBUTF8_H +#include +#endif /* HAVE_LIBUTF8_H */ + +#ifdef TRE_USE_SYSTEM_REGEX_H +/* Include the system regex.h to make TRE ABI compatible with the + system regex. */ +#include TRE_SYSTEM_REGEX_H_PATH +#define tre_regcomp regcomp +#define tre_regexec regexec +#define tre_regerror regerror +#define tre_regfree regfree + +#ifdef TRE_APPROX +#define tre_regaexec regaexec +#define tre_reganexec reganexec +#define tre_regawexec regawexec +#define tre_regawnexec regawnexec +#endif /* TRE_APPROX */ +#define tre_regncomp regncomp +#define tre_regnexec regnexec +#define tre_regwcomp regwcomp +#define tre_regwexec regwexec +#define tre_regwncomp regwncomp +#define tre_regwnexec regwnexec + +#define tre_regcomp_l regcomp_l +#define tre_regncomp_l regncomp_l +#define tre_regwcomp_l regwcomp_l +#define tre_regwncomp_l regwncomp_l +#endif /* TRE_USE_SYSTEM_REGEX_H */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef TRE_USE_SYSTEM_REGEX_H + +#ifndef REG_OK +#define REG_OK 0 +#endif /* !REG_OK */ + +#ifndef HAVE_REG_ERRCODE_T +typedef int reg_errcode_t; +#endif /* !HAVE_REG_ERRCODE_T */ + +#if !defined(REG_NOSPEC) && !defined(REG_LITERAL) +#define REG_LITERAL 0x1000 +#endif + +/* Extra tre_regcomp() flags. */ +#ifndef REG_BASIC +#define REG_BASIC 0 +#endif /* !REG_BASIC */ +#if 0 +#define REG_LEFT_ASSOC (REG_LITERAL << 1) +#define REG_UNGREEDY (REG_LEFT_ASSOC << 1) + +/* Extra tre_regexec() flags. */ +#define REG_APPROX_MATCHER 0x1000 +#define REG_BACKTRACKING_MATCHER (REG_APPROX_MATCHER << 1) +#endif + +#define RE_MAGIC ((('r'^0200)<<8) | 'e') + +#else /* !TRE_USE_SYSTEM_REGEX_H */ + +/* If the we're not using system regex.h, we need to define the + structs and enums ourselves. */ + +typedef int regoff_t; +typedef struct { + size_t re_nsub; /* Number of parenthesized subexpressions. */ + const void *re_endp; /* regex string end pointer (REG_PEND) */ + void *value; /* For internal use only. */ +} regex_t; + +typedef struct { + regoff_t rm_so; + regoff_t rm_eo; +} regmatch_t; + + +typedef enum { + REG_OK = 0, /* No error. */ + /* POSIX tre_regcomp() return error codes. (In the order listed in the + standard.) */ + REG_NOMATCH, /* No match. */ + REG_BADPAT, /* Invalid regexp. */ + REG_ECOLLATE, /* Unknown collating element. */ + REG_ECTYPE, /* Unknown character class name. */ + REG_EESCAPE, /* Trailing backslash. */ + REG_ESUBREG, /* Invalid back reference. */ + REG_EBRACK, /* "[]" imbalance */ + REG_EPAREN, /* "\(\)" or "()" imbalance */ + REG_EBRACE, /* "\{\}" or "{}" imbalance */ + REG_BADBR, /* Invalid content of {} */ + REG_ERANGE, /* Invalid use of range operator */ + REG_ESPACE, /* Out of memory. */ + REG_BADRPT, /* Invalid use of repetition operators. */ + REG_INVARG, /* Invalid argument, e.g. negative-length string */ + REG_ILLSEQ, /* illegal byte sequence (bad multibyte character) */ +} reg_errcode_t; + +/* POSIX tre_regcomp() flags. */ +#define REG_EXTENDED 1 +#define REG_ICASE (REG_EXTENDED << 1) +#define REG_NEWLINE (REG_ICASE << 1) +#define REG_NOSUB (REG_NEWLINE << 1) + +/* Extra tre_regcomp() flags. */ +#define REG_BASIC 0 +#define REG_LITERAL (REG_NOSUB << 1) +#define REG_LEFT_ASSOC (REG_LITERAL << 1) +#define REG_UNGREEDY (REG_LEFT_ASSOC << 1) +#define REG_PEND (REG_UNGREEDY << 1) + +/* POSIX tre_regexec() flags. */ +#define REG_NOTBOL 1 +#define REG_NOTEOL (REG_NOTBOL << 1) + +/* Extra tre_regexec() flags. */ +#define REG_APPROX_MATCHER (REG_NOTEOL << 1) +#define REG_BACKTRACKING_MATCHER (REG_APPROX_MATCHER << 1) +#define REG_STARTEND (REG_BACKTRACKING_MATCHER << 1) + +#endif /* !TRE_USE_SYSTEM_REGEX_H */ + +/* REG_NOSPEC and REG_LITERAL mean the same thing. */ +#if defined(REG_LITERAL) && !defined(REG_NOSPEC) +#define REG_NOSPEC REG_LITERAL +#elif defined(REG_NOSPEC) && !defined(REG_LITERAL) +#define REG_LITERAL REG_NOSPEC +#endif /* defined(REG_NOSPEC) */ + +/* The maximum number of iterations in a bound expression. */ +#undef RE_DUP_MAX +#define RE_DUP_MAX 255 + +/* The POSIX.2 regexp functions */ +extern int +tre_regcomp(regex_t * __restrict preg, const char * __restrict regex, int cflags); + +extern int +tre_regexec(const regex_t * __restrict preg, const char * __restrict string, size_t nmatch, + regmatch_t pmatch[ __restrict ], int eflags); + +extern size_t +tre_regerror(int errcode, const regex_t * __restrict preg, char * __restrict errbuf, + size_t errbuf_size); + +extern void +tre_regfree(regex_t *preg); + +#ifdef TRE_WCHAR +#ifdef HAVE_WCHAR_H +#include +#endif /* HAVE_WCHAR_H */ + +/* Wide character versions (not in POSIX.2). */ +extern int +tre_regwcomp(regex_t * __restrict preg, const wchar_t * __restrict regex, int cflags); + +extern int +tre_regwexec(const regex_t * __restrict preg, const wchar_t * __restrict string, + size_t nmatch, regmatch_t pmatch[ __restrict ], int eflags); +#endif /* TRE_WCHAR */ + +/* Versions with a maximum length argument and therefore the capability to + handle null characters in the middle of the strings (not in POSIX.2). */ +extern int +tre_regncomp(regex_t * __restrict preg, const char * __restrict regex, size_t len, int cflags); + +extern int +tre_regnexec(const regex_t * __restrict preg, const char * __restrict string, size_t len, + size_t nmatch, regmatch_t pmatch[ __restrict ], int eflags); + +#ifdef TRE_WCHAR +extern int +tre_regwncomp(regex_t * __restrict preg, const wchar_t * __restrict regex, size_t len, int cflags); + +extern int +tre_regwnexec(const regex_t * __restrict preg, const wchar_t * __restrict string, size_t len, + size_t nmatch, regmatch_t pmatch[ __restrict ], int eflags); +#endif /* TRE_WCHAR */ + +/* Extended locale versions */ +#include + +extern int +tre_regcomp_l(regex_t * __restrict preg, const char * __restrict regex, int cflags, locale_t __restrict loc); + +#ifdef TRE_WCHAR +extern int +tre_regwcomp_l(regex_t * __restrict preg, const wchar_t * __restrict regex, int cflags, locale_t __restrict loc); +#endif /* TRE_WCHAR */ + +extern int +tre_regncomp_l(regex_t * __restrict preg, const char * __restrict regex, size_t len, int cflags, locale_t __restrict loc); + +#ifdef TRE_WCHAR +extern int +tre_regwncomp_l(regex_t * __restrict preg, const wchar_t * __restrict regex, size_t len, int cflags, locale_t __restrict loc); +#endif /* TRE_WCHAR */ + +#ifdef TRE_APPROX + +/* Approximate matching parameter struct. */ +typedef struct { + int cost_ins; /* Default cost of an inserted character. */ + int cost_del; /* Default cost of a deleted character. */ + int cost_subst; /* Default cost of a substituted character. */ + int max_cost; /* Maximum allowed cost of a match. */ + + int max_ins; /* Maximum allowed number of inserts. */ + int max_del; /* Maximum allowed number of deletes. */ + int max_subst; /* Maximum allowed number of substitutes. */ + int max_err; /* Maximum allowed number of errors total. */ +} regaparams_t; + +/* Approximate matching result struct. */ +typedef struct { + size_t nmatch; /* Length of pmatch[] array. */ + regmatch_t *pmatch; /* Submatch data. */ + int cost; /* Cost of the match. */ + int num_ins; /* Number of inserts in the match. */ + int num_del; /* Number of deletes in the match. */ + int num_subst; /* Number of substitutes in the match. */ +} regamatch_t; + + +/* Approximate matching functions. */ +extern int +tre_regaexec(const regex_t * __restrict preg, const char * __restrict string, + regamatch_t * __restrict match, regaparams_t params, int eflags); + +extern int +tre_reganexec(const regex_t * __restrict preg, const char * __restrict string, size_t len, + regamatch_t * __restrict match, regaparams_t params, int eflags); +#ifdef TRE_WCHAR +/* Wide character approximate matching. */ +extern int +tre_regawexec(const regex_t * __restrict preg, const wchar_t * __restrict string, + regamatch_t * __restrict match, regaparams_t params, int eflags); + +extern int +tre_regawnexec(const regex_t * __restrict preg, const wchar_t * __restrict string, size_t len, + regamatch_t * __restrict match, regaparams_t params, int eflags); +#endif /* TRE_WCHAR */ + +/* Sets the parameters to default values. */ +extern void +tre_regaparams_default(regaparams_t *params); +#endif /* TRE_APPROX */ + +#ifdef TRE_WCHAR +typedef wchar_t tre_char_t; +#else /* !TRE_WCHAR */ +typedef unsigned char tre_char_t; +#endif /* !TRE_WCHAR */ + +#ifdef TRE_STR_USER +typedef struct { + int (*get_next_char)(tre_char_t *c, unsigned int *pos_add, void *context); + void (*rewind)(size_t pos, void *context); + int (*compare)(size_t pos1, size_t pos2, size_t len, void *context); + void *context; +} tre_str_source; + +extern int +tre_reguexec(const regex_t * __restrict preg, const tre_str_source * __restrict string, + size_t nmatch, regmatch_t pmatch[ __restrict ], int eflags); +#endif /* TRE_STR_USER */ + +#ifndef __LIBC__ +/* Returns the version string. The returned string is static. */ +extern char * +tre_version(void); + +/* Returns the value for a config parameter. The type to which `result' + must point to depends of the value of `query', see documentation for + more details. */ +extern int +tre_config(int query, void *result); + +enum { + TRE_CONFIG_APPROX, + TRE_CONFIG_WCHAR, + TRE_CONFIG_MULTIBYTE, + TRE_CONFIG_SYSTEM_ABI, + TRE_CONFIG_VERSION +}; + +/* Returns 1 if the compiled pattern has back references, 0 if not. */ +extern int +tre_have_backrefs(const regex_t *preg); + +#ifdef TRE_APPROX +/* Returns 1 if the compiled pattern uses approximate matching features, + 0 if not. */ +extern int +tre_have_approx(const regex_t *preg); +#endif /* TRE_APPROX */ +#endif /* !__LIBC__ */ + +#ifdef __cplusplus +} +#endif +#endif /* TRE_H */ + +/* EOF */ diff --git a/regex/TRE/lib/xmalloc.h b/regex/TRE/lib/xmalloc.h new file mode 100644 index 0000000..ce310af --- /dev/null +++ b/regex/TRE/lib/xmalloc.h @@ -0,0 +1,77 @@ +/* + xmalloc.h - Simple malloc debugging library API + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + +*/ + +#ifndef _XMALLOC_H +#define _XMALLOC_H 1 + +void *xmalloc_impl(size_t size, const char *file, int line, const char *func); +void *xcalloc_impl(size_t nmemb, size_t size, const char *file, int line, + const char *func); +void xfree_impl(void *ptr, const char *file, int line, const char *func); +void *xrealloc_impl(void *ptr, size_t new_size, const char *file, int line, + const char *func); +int xmalloc_dump_leaks(void); +void xmalloc_configure(int fail_after); + + +#ifndef XMALLOC_INTERNAL +#ifdef MALLOC_DEBUGGING + +/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' + which contains the name of the function currently being defined. +# define __XMALLOC_FUNCTION __PRETTY_FUNCTION__ + This is broken in G++ before version 2.6. + C9x has a similar variable called __func__, but prefer the GCC one since + it demangles C++ function names. */ +# ifdef __GNUC__ +# if __GNUC__ > 2 || (__GNUC__ == 2 \ + && __GNUC_MINOR__ >= (defined __cplusplus ? 6 : 4)) +# define __XMALLOC_FUNCTION __PRETTY_FUNCTION__ +# else +# define __XMALLOC_FUNCTION ((const char *) 0) +# endif +# else +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __XMALLOC_FUNCTION __func__ +# else +# define __XMALLOC_FUNCTION ((const char *) 0) +# endif +# endif + +#define xmalloc(size) xmalloc_impl(size, __FILE__, __LINE__, \ + __XMALLOC_FUNCTION) +#define xcalloc(nmemb, size) xcalloc_impl(nmemb, size, __FILE__, __LINE__, \ + __XMALLOC_FUNCTION) +#define xfree(ptr) xfree_impl(ptr, __FILE__, __LINE__, __XMALLOC_FUNCTION) +#define xrealloc(ptr, new_size) xrealloc_impl(ptr, new_size, __FILE__, \ + __LINE__, __XMALLOC_FUNCTION) +#undef malloc +#undef calloc +#undef free +#undef realloc + +#define malloc USE_XMALLOC_INSTEAD_OF_MALLOC +#define calloc USE_XCALLOC_INSTEAD_OF_CALLOC +#define free USE_XFREE_INSTEAD_OF_FREE +#define realloc USE_XREALLOC_INSTEAD_OF_REALLOC + +#else /* !MALLOC_DEBUGGING */ + +#include + +#define xmalloc(size) malloc(size) +#define xcalloc(nmemb, size) calloc(nmemb, size) +#define xfree(ptr) free(ptr) +#define xrealloc(ptr, new_size) realloc(ptr, new_size) + +#endif /* !MALLOC_DEBUGGING */ +#endif /* !XMALLOC_INTERNAL */ + +#endif /* _XMALLOC_H */ + +/* EOF */ diff --git a/regex/TRE/tre-0.8.0.tar.bz2 b/regex/TRE/tre-0.8.0.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..cfcde9e6b90a69d74c3e93414018899e352bc787 GIT binary patch literal 380714 zcmV)KK)Sy|T4*^jL0KkKSpd2xJ_d)=fB*mg|0@6g|NsC0|NsC0|Nj&mL<4_!dJSe* zqgOTn0Z3!Tdv~?>JomUBi&eb<00000000004X^{P0002_ci#04_O0w;UuUjKbkpgV z-(PpHrcDhZ``PZiH*T_tuH14;O_)SvJ*;sZ^EwsQk`El}r#)(3XkqTKdiSgkMFVyo z^M?SDHfM|nT>z#rfcgLp3&!>LW1;TnV{fKUyeDq-7GUT;Yi^eNWv+w1@x0vozyJ<_ zeLb1WIsgCw00Mvm;s5{uc)Q-<3IWgncVM6Z00M;>;-6oA)TetL-t$L&d%lO?P2BnO z?e=bpWHd+x7mxdw82_4a%3KD~3f>F=sv zH2W_G*kiZV_Vc?bzR^&s7uKr#*K(`IHmVrz`@Q#jij_)G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-%CQ5N=9dM8j1|>x}!3UfM*l~7=mjlotMSA*XomKYB&on3m(CiohT7iDd zif}pXYk6XCIt}$-m<1A)IsOpaT|=Jo6NNlrCS+b6geV~r&{@+$Ye2EKydTnIxN2++^mWIRu2&DF~3gtT>^Q8BDEWe`*J*>)0= z-L7P`qn8-&sZRP|?;2qOVc19q0xTlK&He$@JRCzEJ6S4K2Bm0x+(ag$ux84%R-m5)sp=sy^I&Lg!5Vjz z;DlitrW;Fh-1vB4$M&YI@`NNN{vP~QaXYBC$XVz%s!QO)0Nd#s18k*~)S?toDM`ej zJ1-V4ftui7v{XC2aT-{@vV5zLskhw}E(&KIgY>};^RHI@m2+up^8$Pb0R93fDb6YV z%tR|m*W>{B$)y0LPQIi1qNoJ%6w-%8nxK@3)KP>)d;_F*!;hP>QPw_jrGUl#a6F_S zfpQyVczt*Wyl>j2DO8CLK_m*J-Zp%!d_zG%hQ>Q-9WVg3hy(iKAtDNwrGSut9}oF|`2VN=S>u2IKlA^V?N9!>A(BwE6Dbrjf#iWq2_jG_T2&$v zLMUhp^M2Rs|FZkq;^p>#StWaZ|D^I0>@dR#F%Qan4G-S19^=)d2g4RbKMVu$$9Gq1 zVi%1-w3HOBYHYSkoA5l}0sfpXaEs658}*6QOY;`E6!x9~amC!B?hom$I6nnYao`&R zH>^UUkLmKVR#LaThl`&-uigrP2qK~f0LVr_Bw9X`u`DOy48f;++n3Z3_T6=uiv92S z5jj9=C%3}KXksY3f&hlZV5bN01N@K&+Lz header file. */ +/* #undef HAVE_LIBUTF8_H */ + +/* Define to 1 if the system has the type `reg_errcode_t'. */ +/* #undef HAVE_REG_ERRCODE_T */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define if you want to enable approximate matching functionality. */ +/* #undef TRE_APPROX */ + +/* Define to enable multibyte character set support. */ +#define TRE_MULTIBYTE 1 + +/* Define to the absolute path to the system tre.h */ +#define TRE_SYSTEM_REGEX_H_PATH + +/* Define to include the system regex.h from tre.h */ +#define TRE_USE_SYSTEM_REGEX_H 1 + +/* Define to enable wide character (wchar_t) support. */ +#define TRE_WCHAR 1 + +/* TRE version string. */ +#define TRE_VERSION "0.8.0" + +/* TRE version level 1. */ +#define TRE_VERSION_1 0 + +/* TRE version level 2. */ +#define TRE_VERSION_2 8 + +/* TRE version level 3. */ +#define TRE_VERSION_3 0 diff --git a/regex/TRE/tre-last-matched.h b/regex/TRE/tre-last-matched.h new file mode 100644 index 0000000..3801e2c --- /dev/null +++ b/regex/TRE/tre-last-matched.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2011 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#include + +#ifndef __TRE_LAST_MATCHED_H__ +#define __TRE_LAST_MATCHED_H__ + +#define __TRE_LAST_MATCHED_BRANCH_SHARED(_i) \ + struct _tre_ ## _i *last_matched; \ + int n_last_matched; \ + int cmp_tag; \ + int n_tags; +#define __TRE_LAST_MATCHED_SHARED(_i) \ + tre_ ## _i ## _t *branches; \ + int n_branches; \ + int start_tag; + +/* These structures record the relationship between each union branch and + * its tags. The end_tag is a special tag, created at the end of each branch + * that can be used to detect which branch was last matched. Then the tags + * of the other branches can be set to unmatched. For example: + * + * ((a)|(b))* + * + * when matched against "ab", the tags associated with the first branch, need + * to be unset, because the last match was in the second branch. + * + * There are two sets of two structures. The first structure records the + * branch info, while the second records union info; what branches form that + * union. Because a branch may have nested unions, we need to record that + * as well. The "n" field of the branch info structure records the number + * of unions at the top level of the branch (a union may itself have branches + * with nested unions, but those union are only counted with the immediate + * branch that contains them). The "n" field of the union info structure is + * the count of branches in that union. + * + * The "end_tag" field of a branch info structure is the number of the special + * tag that is created at the end of each branch. It can be used to determine + * which branch was last matched. + * + * The first set (the info_pre structures) are used during tre_add_tags() to + * record the tag info while tags are being added to the AST. They use link + * lists, and the total number of branch and union structures used are + * recorded in n_branches and n_unions. The second set (the info structures) + * are created from the first, leaving out the link pointers (these structures + * use arrays of structures, rather than link lists), and the n_branches and + * n_unions fields are no longer needed. The info_pre structures are allocated + * using the tre_mem mechanism, while the info structure are allocated in + * one chuck with xmalloc (so it can be easily deallocated). + * + * The above macro are used for the shared fields of the structures. */ + +struct _tre_last_matched_pre; /* forward reference */ + +typedef struct _tre_last_matched_branch_pre { + struct _tre_last_matched_branch_pre *next; + __TRE_LAST_MATCHED_BRANCH_SHARED(last_matched_pre) + int tot_branches; + int tot_last_matched; + int tot_tags; + bitstr_t tags[0]; +} tre_last_matched_branch_pre_t; + +typedef struct _tre_last_matched_pre { + struct _tre_last_matched_pre *next; + __TRE_LAST_MATCHED_SHARED(last_matched_branch_pre) + int tot_branches; + int tot_last_matched; + int tot_tags; +} tre_last_matched_pre_t; + +struct _tre_last_matched; /* forward reference */ + +typedef struct _tre_last_matched_branch { + int *tags; + __TRE_LAST_MATCHED_BRANCH_SHARED(last_matched) +} tre_last_matched_branch_t; + +typedef struct _tre_last_matched { + __TRE_LAST_MATCHED_SHARED(last_matched_branch) +} tre_last_matched_t; + +#endif /* __TRE_LAST_MATCHED_H__ */ diff --git a/secure/CMakeLists.txt b/secure/CMakeLists.txt new file mode 100755 index 0000000..9c2b0b7 --- /dev/null +++ b/secure/CMakeLists.txt @@ -0,0 +1,31 @@ +project(libc-secure) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_C99_SOURCE -D_FORTIFY_SOURCE=0 -D__va_list=__builtin_va_list") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../gdtoa/FreeBSD") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../gdtoa") + +set(secure_sources + chk_fail.c + memcpy_chk.c + memmove_chk.c + memset_chk.c + snprintf_chk.c + sprintf_chk.c + stpcpy_chk.c + stpncpy_chk.c + strcat_chk.c + strcpy_chk.c + strlcpy_chk.c + memccpy_chk.c + strlcat_chk.c + strncat_chk.c + strncpy_chk.c + vsnprintf_chk.c + vsprintf_chk.c +) + +#SET_SOURCE_FILES_PROPERTIES(FreeBSD/snprintf.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS}") + +add_darling_object_library(libc-secure ${secure_sources}) diff --git a/secure/chk_fail.c b/secure/chk_fail.c new file mode 100644 index 0000000..9dc6c00 --- /dev/null +++ b/secure/chk_fail.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include "crt_externs.h" + +#ifndef PR_13085474_CHECK +#define PR_13085474_CHECK TARGET_OS_OSX +#endif + +#if PR_13085474_CHECK +/* Some shipped applications fail this check and were tested against + * versions of these functions that supported overlapping buffers. + * + * We would rather let such applications run, using the old memmove + * implementation, than abort() because they can't use the new + * implementation. + */ + +#include +#include +#include +#if TARGET_OS_OSX +#define START_VERSION dyld_platform_version_macOS_10_9 +#else +#error "This platform should not build with PR_13085474_CHECK=1" +#endif +#endif /* !PR_13085474_CHECK */ + +/* For PR_13085474_CHECK set, we initialize __chk_assert_no_overlap to + * 1 initially and then reset it to 0 if the main image of the process + * was linked earlier than 10.9. + * + * If PR_13085474_CHECK is zero, then we never do any sdk version checking + * and always do overlap checks. + */ +__attribute__ ((visibility ("hidden"))) +uint32_t __chk_assert_no_overlap = 1; + +#if PR_13085474_CHECK +static bool +__chk_assert_sdk_pre_start(const struct mach_header *mh) { + return (dyld_get_active_platform() == PLATFORM_MACOS && + !dyld_sdk_at_least(mh, START_VERSION)); +} +#endif + +__attribute__ ((visibility ("hidden"))) +void __chk_init(void) { +#if PR_13085474_CHECK + if (__chk_assert_sdk_pre_start((const struct mach_header *) + _NSGetMachExecuteHeader())) { + __chk_assert_no_overlap = 0; + } +#endif +} + +__attribute__ ((visibility ("hidden"))) +__attribute__ ((noreturn)) +void +__chk_fail_overflow (void) { + os_crash("detected buffer overflow"); +} + +__attribute__ ((visibility ("hidden"))) +__attribute__ ((noreturn)) +void +__chk_fail_overlap (void) { + os_crash("detected source and destination buffer overlap"); +} + +__attribute__ ((visibility ("hidden"))) +void +__chk_overlap (const void *_a, size_t an, const void *_b, size_t bn) { + uintptr_t a = (uintptr_t)_a; + uintptr_t b = (uintptr_t)_b; + + if (__builtin_expect(an == 0 || bn == 0, 0)) { + return; + } else if (__builtin_expect(a == b, 0)) { + __chk_fail_overlap(); + } else if (a < b) { + if (__builtin_expect(a + an > b, 0)) + __chk_fail_overlap(); + } else { // b < a + if (__builtin_expect(b + bn > a, 0)) + __chk_fail_overlap(); + } +} diff --git a/secure/memccpy_chk.c b/secure/memccpy_chk.c new file mode 100644 index 0000000..5f472c0 --- /dev/null +++ b/secure/memccpy_chk.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2012-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +void * +__memccpy_chk (void *dest, const void *src, int c, size_t len, size_t dstlen) +{ + void *retval; + + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + /* retval is NULL if len was copied, otherwise retval is the + * byte *after* the last one written. + */ + retval = memccpy (dest, src, c, len); + + if (retval != NULL) { + len = (uintptr_t)retval - (uintptr_t)dest; + } + + __chk_overlap(dest, len, src, len); + + return retval; +} diff --git a/secure/memcpy_chk.c b/secure/memcpy_chk.c new file mode 100644 index 0000000..fcc5622 --- /dev/null +++ b/secure/memcpy_chk.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +void * +__memcpy_chk (void *dest, const void *src, size_t len, size_t dstlen) +{ + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + /* On OS X, memcpy has supported overlapping buffers for many years. + * While technically, this will catch buggy code, we should not abort. + * if (__builtin_expect (__chk_assert_no_overlap != 0, 1)) + * __chk_overlap(dest, len, src, len); + */ + + return memcpy (dest, src, len); +} diff --git a/secure/memmove_chk.c b/secure/memmove_chk.c new file mode 100644 index 0000000..a2ebdb2 --- /dev/null +++ b/secure/memmove_chk.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +void * +__memmove_chk (void *dest, const void *src, size_t len, size_t dstlen) +{ + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + return memmove (dest, src, len); +} diff --git a/secure/memset_chk.c b/secure/memset_chk.c new file mode 100644 index 0000000..364f3a0 --- /dev/null +++ b/secure/memset_chk.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +void * +__memset_chk (void *dest, int val, size_t len, size_t dstlen) +{ + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + return memset (dest, val, len); +} diff --git a/secure/secure.h b/secure/secure.h new file mode 100644 index 0000000..669b343 --- /dev/null +++ b/secure/secure.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _SECURE_H_ + +#include + +extern void __chk_fail_overflow (void) __attribute__((__noreturn__)); +extern void __chk_fail_overlap (void) __attribute__((__noreturn__)); + +/* Assert if a -> a+an and b -> b+bn overlap. + * 0-lengths don't overlap anything. + */ +extern void __chk_overlap (const void *a, size_t an, const void *b, size_t bn); + +/* Do we avoid the overlap check for older APIs? */ +extern uint32_t __chk_assert_no_overlap; + +#endif diff --git a/secure/snprintf_chk.c b/secure/snprintf_chk.c new file mode 100644 index 0000000..a30a473 --- /dev/null +++ b/secure/snprintf_chk.c @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include "secure.h" + +int +__snprintf_chk (char *dest, size_t len, int flags, size_t dstlen, + const char *format, ...) +{ + va_list arg; + int done; + + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + va_start (arg, format); + + done = vsnprintf (dest, len, format, arg); + + va_end (arg); + + return done; +} + +int +__snprintf_object_size_chk (char *dest, size_t dstlen, size_t len, +const char *format, ...) +{ + va_list arg; + int done; + + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + va_start (arg, format); + + done = vsnprintf (dest, len, format, arg); + + va_end (arg); + + return done; +} diff --git a/secure/sprintf_chk.c b/secure/sprintf_chk.c new file mode 100644 index 0000000..6163ce1 --- /dev/null +++ b/secure/sprintf_chk.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include "secure.h" + +int +__sprintf_chk (char *dest, int flags, size_t dstlen, const char *format, ...) +{ + va_list arg; + int done; + + va_start (arg, format); + + if (__builtin_expect (dstlen > (size_t) INT_MAX, 0)) + done = vsprintf (dest, format, arg); + else + { + done = vsnprintf (dest, dstlen, format, arg); + if (__builtin_expect(done >= 0 && (size_t) done >= dstlen, 0)) + __chk_fail_overflow (); + } + + va_end (arg); + + return done; +} + +int +__sprintf_object_size_chk (char *dest, size_t dstlen, const char *format, ...) +{ + va_list arg; + int done; + + va_start (arg, format); + + if (__builtin_expect (dstlen > (size_t) INT_MAX, 0)) + done = vsprintf (dest, format, arg); + else + { + done = vsnprintf (dest, dstlen, format, arg); + if (__builtin_expect(done >= 0 && (size_t) done >= dstlen, 0)) + __chk_fail_overflow (); + } + + va_end (arg); + + return done; +} diff --git a/secure/stpcpy_chk.c b/secure/stpcpy_chk.c new file mode 100644 index 0000000..c452721 --- /dev/null +++ b/secure/stpcpy_chk.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +char * +__stpcpy_chk (char *dest, const char *src, size_t dstlen) +{ + char *retval = stpcpy(dest, src); // Returns a pointer to the \0 + size_t len = retval - dest + 1; + + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + if (__builtin_expect (__chk_assert_no_overlap != 0, 1)) + __chk_overlap(dest, len, src, len); + + return retval; +} diff --git a/secure/stpncpy_chk.c b/secure/stpncpy_chk.c new file mode 100644 index 0000000..5ad321f --- /dev/null +++ b/secure/stpncpy_chk.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +char * +__stpncpy_chk (char *restrict dest, char *restrict src, + size_t len, size_t dstlen) +{ + size_t n; + char *retval; + + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + retval = stpncpy (dest, src, len); // Normally returns a pointer to the \0 + n = retval - dest + 1; + + // Check if it's pointing to the location after the buffer after not writing \0 + if (n == len + 1) + n--; + + if (__builtin_expect (__chk_assert_no_overlap != 0, 1)) + __chk_overlap(dest, n, src, n); + + return retval; +} diff --git a/secure/strcat_chk.c b/secure/strcat_chk.c new file mode 100644 index 0000000..7445ab3 --- /dev/null +++ b/secure/strcat_chk.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include "secure.h" + +char * +__strcat_chk (char *__restrict dest, const char *__restrict append, + size_t dstlen) +{ + size_t len1 = strlen(dest); + size_t len2 = strlen(append); + + if (__builtin_expect (dstlen < len1 + len2 + 1, 0)) + __chk_fail_overflow (); + + if (__builtin_expect (__chk_assert_no_overlap != 0, 1)) + __chk_overlap(dest, len1 + len2 + 1, append, len2 + 1); + + memcpy(dest + len1, append, len2 + 1); + return dest; +} diff --git a/secure/strcpy_chk.c b/secure/strcpy_chk.c new file mode 100644 index 0000000..9b15f22 --- /dev/null +++ b/secure/strcpy_chk.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +char * +__strcpy_chk (char *restrict dest, char *restrict src, size_t dstlen) +{ + // stpcpy returns a pointer to the \0 + size_t len = stpcpy(dest, src) - dest + 1; + + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + if (__builtin_expect (__chk_assert_no_overlap != 0, 1)) + __chk_overlap(dest, len, src, len); + + return dest; +} diff --git a/secure/strlcat_chk.c b/secure/strlcat_chk.c new file mode 100644 index 0000000..d7174a3 --- /dev/null +++ b/secure/strlcat_chk.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2012-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +size_t +__strlcat_chk(char *restrict dest, char *restrict src, + size_t len, size_t dstlen) +{ + size_t initial_srclen; + size_t initial_dstlen; + + if (__builtin_expect (dstlen < len, 0)) { + __chk_fail_overflow (); + } + + initial_srclen = strlen(src); + initial_dstlen = strnlen(dest, len); + + if (initial_dstlen == len) + return len+initial_srclen; + + if (initial_srclen < len - initial_dstlen) { + __chk_overlap(dest, initial_srclen + initial_dstlen + 1, src, initial_srclen + 1); + memcpy(dest+initial_dstlen, src, initial_srclen + 1); + } else { + __chk_overlap(dest, len, src, len - initial_dstlen - 1); + memcpy(dest+initial_dstlen, src, len - initial_dstlen - 1); + dest[len-1] = '\0'; + } + + return initial_srclen + initial_dstlen; +} diff --git a/secure/strlcpy_chk.c b/secure/strlcpy_chk.c new file mode 100644 index 0000000..504e766 --- /dev/null +++ b/secure/strlcpy_chk.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +size_t +__strlcpy_chk (char *restrict dest, char *restrict src, + size_t len, size_t dstlen) +{ + size_t retval; + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + retval = strlcpy (dest, src, len); + + if (retval < len) + len = retval + 1; + + __chk_overlap(dest, len, src, len); + + return retval; +} diff --git a/secure/strncat_chk.c b/secure/strncat_chk.c new file mode 100644 index 0000000..184023c --- /dev/null +++ b/secure/strncat_chk.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +char * +__strncat_chk (char *restrict dest, const char *restrict append, + size_t len, size_t dstlen) +{ + size_t len1 = strlen(dest); + size_t len2 = strnlen(append, len); + + if (__builtin_expect (dstlen < len1 + len2 + 1, 0)) + __chk_fail_overflow (); + + if (__builtin_expect (__chk_assert_no_overlap != 0, 1)) + __chk_overlap(dest, len1 + len2 + 1, append, len2 + 1); + + /* memmove() all but the NUL, since it might not actually be NUL */ + memcpy(dest + len1, append, len2); + dest[len1 + len2] = '\0'; + + return dest; +} diff --git a/secure/strncpy_chk.c b/secure/strncpy_chk.c new file mode 100644 index 0000000..e8f7005 --- /dev/null +++ b/secure/strncpy_chk.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include "secure.h" + +char * +__strncpy_chk (char *restrict dest, char *restrict src, + size_t len, size_t dstlen) +{ + size_t n; + + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + // stpncpy normally returns a pointer to the \0 + n = stpncpy (dest, src, len) - dest + 1; + + // Check if it's pointing to the location after the buffer after not writing \0 + if (n == len + 1) + n--; + + if (__builtin_expect (__chk_assert_no_overlap != 0, 1)) + __chk_overlap(dest, n, src, n); + + return dest; +} diff --git a/secure/vsnprintf_chk.c b/secure/vsnprintf_chk.c new file mode 100644 index 0000000..02a0e11 --- /dev/null +++ b/secure/vsnprintf_chk.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include "secure.h" + +int +__vsnprintf_chk (char *dest, size_t len, int flags, size_t dstlen, + const char *format, va_list arg) +{ + int done; + + if (__builtin_expect (dstlen < len, 0)) + __chk_fail_overflow (); + + done = vsnprintf (dest, len, format, arg); + + return done; +} diff --git a/secure/vsprintf_chk.c b/secure/vsprintf_chk.c new file mode 100644 index 0000000..9d321d4 --- /dev/null +++ b/secure/vsprintf_chk.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include "secure.h" + +int +__vsprintf_chk (char *dest, int flags, size_t dstlen, const char *format, + va_list arg) +{ + int done; + + if (__builtin_expect (dstlen > (size_t) INT_MAX, 0)) + done = vsprintf (dest, format, arg); + else + { + done = vsnprintf (dest, dstlen, format, arg); + if (__builtin_expect (done >= 0 && (size_t) done >= dstlen, 0)) + __chk_fail_overflow (); + } + + return done; +} diff --git a/stdio/CMakeLists.txt b/stdio/CMakeLists.txt new file mode 100644 index 0000000..493054e --- /dev/null +++ b/stdio/CMakeLists.txt @@ -0,0 +1,166 @@ +project(libc-stdio) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_C99_SOURCE -D_FORTIFY_SOURCE=0 -D__va_list=__builtin_va_list") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") + +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../gdtoa/FreeBSD") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../gdtoa") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/FreeBSD") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}") + +set(stdio_sources + xprintf_all_in_one.c + xprintf_comp.c + xprintf_domain.c + xprintf_exec.c + FreeBSD/asprintf.c + FreeBSD/clrerr.c + FreeBSD/dprintf.c + FreeBSD/fclose.c + FreeBSD/fdopen.c + FreeBSD/feof.c + FreeBSD/ferror.c + FreeBSD/fflush.c + FreeBSD/fgetc.c + FreeBSD/fgetln.c + FreeBSD/fgetpos.c + FreeBSD/fgets.c + FreeBSD/fgetwc.c + FreeBSD/fgetwln.c + FreeBSD/fgetws.c + FreeBSD/fileno.c + FreeBSD/findfp.c + FreeBSD/flags.c + FreeBSD/_flock_stub.c + FreeBSD/fopen.c + FreeBSD/fprintf.c + FreeBSD/fpurge.c + FreeBSD/fputc.c + FreeBSD/fputs.c + FreeBSD/fputwc.c + FreeBSD/fputws.c + FreeBSD/fread.c + FreeBSD/freopen.c + FreeBSD/fscanf.c + FreeBSD/fseek.c + FreeBSD/fsetpos.c + FreeBSD/ftell.c + FreeBSD/funopen.c + FreeBSD/fvwrite.c + FreeBSD/fwalk.c + FreeBSD/fwide.c + FreeBSD/fwprintf.c + FreeBSD/fwrite.c + FreeBSD/fwscanf.c + FreeBSD/getc.c + FreeBSD/getdelim.c + FreeBSD/getchar.c + FreeBSD/getline.c + FreeBSD/gets.c + FreeBSD/getw.c + FreeBSD/getwc.c + FreeBSD/getwchar.c + FreeBSD/makebuf.c + FreeBSD/mktemp.c + FreeBSD/open_memstream.c + FreeBSD/open_wmemstream.c + FreeBSD/perror.c + FreeBSD/printf.c + FreeBSD/printf-pos.c + FreeBSD/putc.c + FreeBSD/putchar.c + FreeBSD/puts.c + FreeBSD/putw.c + FreeBSD/putwc.c + FreeBSD/putwchar.c + FreeBSD/refill.c + FreeBSD/remove.c + FreeBSD/rewind.c + FreeBSD/rget.c + FreeBSD/scanf.c + FreeBSD/setbuf.c + FreeBSD/setbuffer.c + FreeBSD/setvbuf.c + FreeBSD/snprintf.c + FreeBSD/sprintf.c + FreeBSD/sscanf.c + FreeBSD/stdio.c + FreeBSD/swprintf.c + FreeBSD/swscanf.c + FreeBSD/tempnam.c + FreeBSD/tmpfile.c + FreeBSD/tmpnam.c + FreeBSD/ungetc.c + FreeBSD/ungetwc.c + FreeBSD/vasprintf.c + FreeBSD/vdprintf.c + FreeBSD/vfprintf.c + FreeBSD/vfscanf.c + FreeBSD/vfwprintf.c + FreeBSD/vfwscanf.c + FreeBSD/vprintf.c + FreeBSD/vscanf.c + FreeBSD/vsnprintf.c + FreeBSD/vsprintf.c + FreeBSD/vsscanf.c + FreeBSD/vswprintf.c + FreeBSD/vswscanf.c + FreeBSD/vwprintf.c + FreeBSD/vwscanf.c + FreeBSD/wbuf.c + FreeBSD/wprintf.c + FreeBSD/wscanf.c + FreeBSD/wsetup.c + FreeBSD/xprintf.c + FreeBSD/xprintf_errno.c + FreeBSD/xprintf_float.c + FreeBSD/xprintf_hexdump.c + FreeBSD/xprintf_int.c + FreeBSD/xprintf_quote.c + FreeBSD/xprintf_str.c + FreeBSD/xprintf_time.c + FreeBSD/xprintf_vis.c +) + +set_source_files_properties(FreeBSD/fopen.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_FOPEN") +set_source_files_properties(FreeBSD/fdopen.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_FDOPEN") +set_source_files_properties(FreeBSD/fputs.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_FPUTS") +set_source_files_properties(FreeBSD/freopen.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_FREOPEN") +set_source_files_properties(FreeBSD/fwrite.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_FWRITE") +set_source_files_properties(FreeBSD/tempnam.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_TEMPNAM") + +add_darling_object_library(libc-stdio ${stdio_sources}) +#SET_TARGET_PROPERTIES(libc-stdio PROPERTIES COMPILE_DEFINITIONS "VARIANT_DARWINEXTSN") + +# *** +# Legacy variants +# *** + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_DARWIN_C_SOURCE -U_POSIX_C_SOURCE") + +if (TARGET_i386) + set(stdio-legacy_sources + FreeBSD/fopen.c FreeBSD/fdopen.c + FreeBSD/fputs.c FreeBSD/tempnam.c + FreeBSD/freopen.c FreeBSD/fwrite.c) + + add_library(libc-stdio_legacy OBJECT ${stdio-legacy_sources}) + SET_TARGET_PROPERTIES(libc-stdio_legacy PROPERTIES COMPILE_DEFINITIONS "BUILDING_VARIANT;VARIANT_LEGACY") +endif (TARGET_i386) + +# *** +# DARWIN_EXTSN variants +# *** + +set(stdio-extsn_sources FreeBSD/fopen.c FreeBSD/fdopen.c) +add_library(libc-stdio_extsn OBJECT ${stdio-extsn_sources}) +SET_TARGET_PROPERTIES(libc-stdio_extsn PROPERTIES COMPILE_DEFINITIONS "BUILDING_VARIANT;VARIANT_DARWINEXTSN") + + +# *** +# DYLD variants +# *** +#add_library(libc-stdio_dyld OBJECT FreeBSD/sprintf.c FreeBSD/printf.c) +#SET_TARGET_PROPERTIES(libc-stdio_dyld PROPERTIES COMPILE_FLAGS "-UBUILDING_VARIANT -DVARIANT_DYLD -DVARIANT_CANCELABLE -DVARIANT_DARWINEXTSN") diff --git a/stdio/FreeBSD/_flock_stub.c b/stdio/FreeBSD/_flock_stub.c new file mode 100644 index 0000000..330830f --- /dev/null +++ b/stdio/FreeBSD/_flock_stub.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 1998 John Birrell . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * POSIX stdio FILE locking functions. These assume that the locking + * is only required at FILE structure level, not at file descriptor + * level too. + * + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/_flock_stub.c,v 1.16 2008/04/17 22:17:53 jhb Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "local.h" + +/* + * Weak symbols for externally visible functions in this file: + */ +__weak_reference(_flockfile, flockfile); +__weak_reference(_flockfile_debug_stub, _flockfile_debug); +__weak_reference(_ftrylockfile, ftrylockfile); +__weak_reference(_funlockfile, funlockfile); + +void +_flockfile(FILE *fp) +{ + // - preserve errno. + int save_errno = errno; + _pthread_mutex_lock(&fp->_fl_mutex); + errno = save_errno; +} + +/* + * This can be overriden by the threads library if it is linked in. + */ +void +_flockfile_debug_stub(FILE *fp, char *fname, int lineno) +{ + _flockfile(fp); +} + +int +_ftrylockfile(FILE *fp) +{ + int ret = 0; + + // - preserve errno. + int save_errno = errno; + if (_pthread_mutex_trylock(&fp->_fl_mutex) != 0) + ret = -1; + errno = save_errno; + + return (ret); +} + +void +_funlockfile(FILE *fp) +{ + // - preserve errno. + int save_errno = errno; + _pthread_mutex_unlock(&fp->_fl_mutex); + errno = save_errno; +} diff --git a/stdio/FreeBSD/asprintf.c b/stdio/FreeBSD/asprintf.c new file mode 100644 index 0000000..90c5617 --- /dev/null +++ b/stdio/FreeBSD/asprintf.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/asprintf.c,v 1.15 2009/03/02 04:11:42 das Exp $"); + +#include "xlocale_private.h" + +#include +#include + +int +asprintf(char ** __restrict s, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vasprintf_l(s, __current_locale(), fmt, ap); + va_end(ap); + return (ret); +} + +int +asprintf_l(char ** __restrict s, locale_t loc, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vasprintf_l(s, loc, fmt, ap); + va_end(ap); + return (ret); +} diff --git a/stdio/FreeBSD/clrerr.c b/stdio/FreeBSD/clrerr.c new file mode 100644 index 0000000..bebb155 --- /dev/null +++ b/stdio/FreeBSD/clrerr.c @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)clrerr.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/clrerr.c,v 1.12 2008/05/05 16:03:52 jhb Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" + +#undef clearerr +#undef clearerr_unlocked + +void +clearerr(fp) + FILE *fp; +{ + FLOCKFILE(fp); + __sclearerr(fp); + FUNLOCKFILE(fp); +} + +void +clearerr_unlocked(FILE *fp) +{ + + __sclearerr(fp); +} diff --git a/stdio/FreeBSD/dprintf.c b/stdio/FreeBSD/dprintf.c new file mode 100644 index 0000000..22115fa --- /dev/null +++ b/stdio/FreeBSD/dprintf.c @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2009 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/dprintf.c,v 1.1 2009/03/04 03:38:51 das Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include "un-namespace.h" + +int +dprintf(int fd, const char * __restrict fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = vdprintf_l(fd, __current_locale(), fmt, ap); + va_end(ap); + return (ret); +} + +int +dprintf_l(int fd, locale_t loc, const char * __restrict fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = vdprintf_l(fd, loc, fmt, ap); + va_end(ap); + return (ret); +} diff --git a/stdio/FreeBSD/fclose.3 b/stdio/FreeBSD/fclose.3 new file mode 100644 index 0000000..c3720bf --- /dev/null +++ b/stdio/FreeBSD/fclose.3 @@ -0,0 +1,111 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fclose.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/fclose.3,v 1.15 2007/01/09 00:28:06 imp Exp $ +.\" +.Dd April 22, 2006 +.Dt FCLOSE 3 +.Os +.Sh NAME +.Nm fclose , +.Nm fcloseall +.Nd close a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn fclose "FILE *stream" +.Ft void +.Fn fcloseall void +.Sh DESCRIPTION +The +.Fn fclose +function +dissociates the named +.Fa stream +from its underlying file or set of functions. +If the stream was being used for output, any buffered data is written +first, using +.Xr fflush 3 . +.Pp +The +.Fn fcloseall +function calls +.Fn fclose +on all open streams. +.Sh RETURN VALUES +Upon successful completion 0 is returned. +Otherwise, +.Dv EOF +is returned and the global variable +.Va errno +is set to indicate the error. +In either case no further access to the stream is possible. +.Sh ERRORS +The +.Fn fclose +function +may also fail and set +.Va errno +for any of the errors specified for the routines +.Xr close 2 +or +.Xr fflush 3 . +.Sh NOTES +The +.Fn fclose +function +does not handle NULL arguments; they will result in a segmentation +violation. +This is intentional - it makes it easier to make sure programs written +under +.Fx +are bug free. +This behaviour is an implementation detail, and programs should not +rely upon it. +.Sh SEE ALSO +.Xr close 2 , +.Xr fflush 3 , +.Xr fopen 3 , +.Xr setbuf 3 +.Sh STANDARDS +The +.Fn fclose +function +conforms to +.St -isoC . +.Pp +The +.Fn fcloseall +function first appeared in +.Fx 7.0 . diff --git a/stdio/FreeBSD/fclose.c b/stdio/FreeBSD/fclose.c new file mode 100644 index 0000000..5a6183c --- /dev/null +++ b/stdio/FreeBSD/fclose.c @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fclose.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fclose.c,v 1.12 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +int +fclose(FILE *fp) +{ + int r; + + pthread_once(&__sdidinit, __sinit); + + if (fp == NULL) { + errno = EFAULT; + return (EOF); + } + if (fp->_flags == 0) { /* not open! */ + errno = EBADF; + return (EOF); + } + FLOCKFILE(fp); + r = __sflush(fp); + if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0) + r = EOF; + if (fp->_flags & __SMBF) + free((char *)fp->_bf._base); + if (HASUB(fp)) + FREEUB(fp); + if (HASLB(fp)) + FREELB(fp); + fp->_file = -1; + fp->_r = fp->_w = 0; /* Mess up if reaccessed. */ + FUNLOCKFILE(fp); + __sfprelease(fp); /* Release this FILE for reuse. */ + return (r); +} diff --git a/stdio/FreeBSD/fdopen.c b/stdio/FreeBSD/fdopen.c new file mode 100644 index 0000000..c49e36e --- /dev/null +++ b/stdio/FreeBSD/fdopen.c @@ -0,0 +1,107 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifdef VARIANT_DARWINEXTSN +#define _DARWIN_UNLIMITED_STREAMS +#define COUNT 0 +#elif defined(VARIANT_LEGACY) +#define COUNT 0 +#else +#define COUNT 1 +#endif + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fdopen.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fdopen.c,v 1.11 2008/05/10 18:39:20 antoine Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "local.h" + +FILE * +fdopen(fd, mode) + int fd; + const char *mode; +{ + FILE *fp; + int flags, oflags, fdflags, tmp; + + /* + * File descriptors are a full int, but _file is only a short. + * If we get a valid file descriptor that is greater than + * SHRT_MAX, then the fd will get sign-extended into an + * invalid file descriptor. Handle this case by failing the + * open. + */ + if (fd > SHRT_MAX) { + errno = EMFILE; + return (NULL); + } + + if ((flags = __sflags(mode, &oflags)) == 0) + return (NULL); + + /* Make sure the mode the user wants is a subset of the actual mode. */ + if ((fdflags = _fcntl(fd, F_GETFL, 0)) < 0) + return (NULL); + tmp = fdflags & O_ACCMODE; + if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE))) { + errno = EINVAL; + return (NULL); + } + + if ((fp = __sfp(COUNT)) == NULL) + return (NULL); + fp->_flags = flags; + /* + * If opened for appending, but underlying descriptor does not have + * O_APPEND bit set, assert __SAPP so that __swrite() caller + * will _sseek() to the end before write. + */ + if ((oflags & O_APPEND) && !(fdflags & O_APPEND)) + fp->_flags |= __SAPP; + fp->_file = fd; + fp->_cookie = fp; + fp->_read = __sread; + fp->_write = __swrite; + fp->_seek = __sseek; + fp->_close = __sclose; + return (fp); +} diff --git a/stdio/FreeBSD/feof.c b/stdio/FreeBSD/feof.c new file mode 100644 index 0000000..51f54f7 --- /dev/null +++ b/stdio/FreeBSD/feof.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)feof.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/feof.c,v 1.12 2008/05/05 16:03:52 jhb Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" + +#undef feof +#undef feof_unlocked + +int +feof(FILE *fp) +{ + int ret; + + FLOCKFILE(fp); + ret= __sfeof(fp); + FUNLOCKFILE(fp); + return (ret); +} + +int +feof_unlocked(FILE *fp) +{ + + return (__sfeof(fp)); +} diff --git a/stdio/FreeBSD/ferror.3 b/stdio/FreeBSD/ferror.3 new file mode 100644 index 0000000..22bc13c --- /dev/null +++ b/stdio/FreeBSD/ferror.3 @@ -0,0 +1,131 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ferror.3 8.2 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/stdio/ferror.3,v 1.13 2009/01/28 14:38:41 trhodes Exp $ +.\" +.Dd January 28, 2009 +.Dt FERROR 3 +.Os +.Sh NAME +.Nm clearerr , +.Nm clearerr_unlocked , +.Nm feof , +.Nm feof_unlocked , +.Nm ferror , +.Nm ferror_unlocked , +.Nm fileno , +.Nm fileno_unlocked +.Nd check and reset stream status +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft void +.Fn clearerr "FILE *stream" +.Ft void +.Fn clearerr_unlocked "FILE *stream" +.Ft int +.Fn feof "FILE *stream" +.Ft int +.Fn feof_unlocked "FILE *stream" +.Ft int +.Fn ferror "FILE *stream" +.Ft int +.Fn ferror_unlocked "FILE *stream" +.Ft int +.Fn fileno "FILE *stream" +.Ft int +.Fn fileno_unlocked "FILE *stream" +.Sh DESCRIPTION +The function +.Fn clearerr +clears the end-of-file and error indicators for the stream pointed +to by +.Fa stream . +.Pp +The function +.Fn feof +tests the end-of-file indicator for the stream pointed to by +.Fa stream , +returning non-zero if it is set. +The end-of-file indicator may be cleared by explicitly calling +.Fn clearerr , +or as a side-effect of other operations, e.g.\& +.Fn fseek . +.Pp +The function +.Fn ferror +tests the error indicator for the stream pointed to by +.Fa stream , +returning non-zero if it is set. +.Pp +The function +.Fn fileno +examines the argument +.Fa stream +and returns its integer descriptor. +.Pp +The +.Fn clearerr_unlocked , +.Fn feof_unlocked , +.Fn ferror_unlocked , +and +.Fn fileno_unlocked +functions are equivalent to +.Fn clearerr , +.Fn feof , +.Fn ferror , +and +.Fn fileno +respectively, except that the caller is responsible for locking the stream +with +.Xr flockfile 3 +before calling them. +These functions may be used to avoid the overhead of locking the stream +and to prevent races when multiple threads are operating on the same stream. +.Sh ERRORS +These functions should not fail and do not set the external +variable +.Va errno . +.Sh SEE ALSO +.Xr open 2 , +.Xr fdopen 3 , +.Xr flockfile 3 , +.Xr stdio 3 +.Sh STANDARDS +The functions +.Fn clearerr , +.Fn feof , +and +.Fn ferror +conform to +.St -isoC . diff --git a/stdio/FreeBSD/ferror.c b/stdio/FreeBSD/ferror.c new file mode 100644 index 0000000..830fb9b --- /dev/null +++ b/stdio/FreeBSD/ferror.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ferror.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/ferror.c,v 1.12 2008/05/05 16:03:52 jhb Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" + +#undef ferror +#undef ferror_unlocked + +int +ferror(FILE *fp) +{ + int ret; + + FLOCKFILE(fp); + ret = __sferror(fp); + FUNLOCKFILE(fp); + return (ret); +} + +int +ferror_unlocked(FILE *fp) +{ + + return (__sferror(fp)); +} diff --git a/stdio/FreeBSD/fflush.3 b/stdio/FreeBSD/fflush.3 new file mode 100644 index 0000000..b4e9530 --- /dev/null +++ b/stdio/FreeBSD/fflush.3 @@ -0,0 +1,118 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fflush.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/fflush.3,v 1.11 2007/01/09 00:28:06 imp Exp $ +.\" +.Dd August 1, 2019 +.Dt FFLUSH 3 +.Os +.Sh NAME +.Nm fflush , +.Nm fpurge +.Nd flush a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn fflush "FILE *stream" +.Ft int +.Fn fpurge "FILE *stream" +.Sh DESCRIPTION +The function +.Fn fflush +synchronizes the state of the given +.Fa stream +in light of buffered I/O. +For output or update streams it writes all buffered data via the stream's +underlying write function. +For input streams it seeks to the current file position indicator via the +stream's underlying seek function. +The open status of the stream is unaffected. +.Pp +If the +.Fa stream +argument is +.Dv NULL , +.Fn fflush +flushes +.Em all +open streams. +.Pp +The function +.Fn fpurge +erases any input or output buffered in the given +.Fa stream . +For output streams this discards any unwritten output. +For input streams this discards any input read from the underlying object +but not yet obtained via +.Xr getc 3 ; +this includes any text pushed back via +.Xr ungetc 3 . +.Sh RETURN VALUES +Upon successful completion 0 is returned. +Otherwise, +.Dv EOF +is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa stream +argument +is not an open stream. +.El +.Pp +The function +.Fn fflush +may also fail and set +.Va errno +for any of the errors specified for the routines +.Xr write 2 +and +.Xr lseek 2 . +.Sh SEE ALSO +.Xr write 2 , +.Xr fclose 3 , +.Xr fopen 3 , +.Xr lseek 2 , +.Xr setbuf 3 +.Sh STANDARDS +The +.Fn fflush +function +conforms to +.St -isoC +and +.St -susv3 . diff --git a/stdio/FreeBSD/fflush.c b/stdio/FreeBSD/fflush.c new file mode 100644 index 0000000..db6761d --- /dev/null +++ b/stdio/FreeBSD/fflush.c @@ -0,0 +1,178 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fflush.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fflush.c,v 1.14 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +static int sflush_locked(FILE *); + +/* + * Flush a single file, or (if fp is NULL) all files. + * MT-safe version + */ +int +fflush(FILE *fp) +{ + int retval = 0; + + if (fp == NULL) { + return (_fwalk(sflush_locked)); + } + + FLOCKFILE(fp); + retval = __sflush(fp); + FUNLOCKFILE(fp); + return (retval); +} + +/* + * Flush a single file, or (if fp is NULL) all files. + * Non-MT-safe version + */ +int +__fflush(FILE *fp) +{ + int retval; + + if (fp == NULL) + return (_fwalk(sflush_locked)); + if ((fp->_flags & (__SWR | __SRW)) == 0) { + retval = 0; + } else + retval = __sflush(fp); + return (retval); +} + +int +__sflush(FILE *fp) +{ + unsigned char *p; + int n, t; + + t = fp->_flags; + + if ((p = fp->_bf._base) == NULL) + return (0); + + /* + * SUSv3 requires that fflush() on a seekable input stream updates the file + * position indicator with the underlying seek function. Use a dumb fseek + * for this (don't attempt to preserve the buffers). + */ + if ((t & __SRD) != 0) { + if (fp->_seek == NULL) { + /* + * No way to seek this file -- just return "success." + */ + return (0); + } + + n = fp->_r; + + if (n > 0) { + /* + * See _fseeko's dumb path. + */ + if (_sseek(fp, (fpos_t)-n, SEEK_CUR) == -1) { + if (errno == ESPIPE) { + /* + * Ignore ESPIPE errors, since there's no way to put the bytes + * back into the pipe. + */ + return (0); + } + return (EOF); + } + + if (HASUB(fp)) { + FREEUB(fp); + } + fp->_p = fp->_bf._base; + fp->_r = 0; + fp->_flags &= ~__SEOF; + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + } + return (0); + } + + if ((t & __SWR) != 0) { + n = fp->_p - p; /* write this much */ + + /* + * Set these immediately to avoid problems with longjmp and to allow + * exchange buffering (via setvbuf) in user write function. + */ + fp->_p = p; + fp->_w = t & (__SLBF|__SNBF) ? 0 : fp->_bf._size; + + for (; n > 0; n -= t, p += t) { + t = _swrite(fp, (char *)p, n); + if (t <= 0) { + /* 5340694: reset _p and _w on EAGAIN */ + if (t < 0 && errno == EAGAIN) { + if (p > fp->_p) { + /* some was written */ + memmove(fp->_p, p, n); + fp->_p += n; + if (!(fp->_flags & (__SLBF|__SNBF))) + fp->_w -= n; + } + } + fp->_flags |= __SERR; + return (EOF); + } + } + } + return (0); +} + +static int +sflush_locked(FILE *fp) +{ + int ret; + + FLOCKFILE(fp); + ret = __sflush(fp); + FUNLOCKFILE(fp); + return (ret); +} diff --git a/stdio/FreeBSD/fgetc.c b/stdio/FreeBSD/fgetc.c new file mode 100644 index 0000000..96cd999 --- /dev/null +++ b/stdio/FreeBSD/fgetc.c @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fgetc.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetc.c,v 1.13 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +int +fgetc(fp) + FILE *fp; +{ + int retval; + FLOCKFILE(fp); + /* Orientation set by __sgetc() when buffer is empty. */ + /* ORIENT(fp, -1); */ + retval = __sgetc(fp); + FUNLOCKFILE(fp); + return (retval); +} diff --git a/stdio/FreeBSD/fgetln.3 b/stdio/FreeBSD/fgetln.3 new file mode 100644 index 0000000..61a3391 --- /dev/null +++ b/stdio/FreeBSD/fgetln.3 @@ -0,0 +1,128 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fgetln.3 8.3 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/stdio/fgetln.3,v 1.10 2009/02/28 06:00:58 das Exp $ +.\" +.Dd April 19, 1994 +.Dt FGETLN 3 +.Os +.Sh NAME +.Nm fgetln +.Nd get a line from a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft char * +.Fn fgetln "FILE *stream" "size_t *len" +.Sh DESCRIPTION +The +.Fn fgetln +function +returns a pointer to the next line from the stream referenced by +.Fa stream . +This line is +.Em not +a C string as it does not end with a terminating +.Dv NUL +character. +The length of the line, including the final newline, +is stored in the memory location to which +.Fa len +points. +(Note, however, that if the line is the last +in a file that does not end in a newline, +the returned text will not contain a newline.) +.Sh RETURN VALUES +Upon successful completion a pointer is returned; +this pointer becomes invalid after the next +.Tn I/O +operation on +.Fa stream +(whether successful or not) +or as soon as the stream is closed. +Otherwise, +.Dv NULL +is returned. +The +.Fn fgetln +function +does not distinguish between end-of-file and error; the routines +.Xr feof 3 +and +.Xr ferror 3 +must be used +to determine which occurred. +If an error occurs, the global variable +.Va errno +is set to indicate the error. +The end-of-file condition is remembered, even on a terminal, and all +subsequent attempts to read will return +.Dv NULL +until the condition is +cleared with +.Xr clearerr 3 . +.Pp +The text to which the returned pointer points may be modified, +provided that no changes are made beyond the returned size. +These changes are lost as soon as the pointer becomes invalid. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EBADF +The argument +.Fa stream +is not a stream open for reading. +.It Bq Er ENOMEM +The internal line buffer could not be expanded due to lack of available memory, +or because it would need to expand beyond INT_MAX in size. +.El +.Pp +The +.Fn fgetln +function +may also fail and set +.Va errno +for any of the errors specified for the routines +.Xr fflush 3 , +.Xr malloc 3 , +.Xr read 2 , +.Xr stat 2 , +or +.Xr realloc 3 . +.Sh SEE ALSO +.Xr ferror 3 , +.Xr fgets 3 , +.Xr fgetwln 3 , +.Xr fopen 3 , +.Xr getline 3 , +.Xr putc 3 +.Sh HISTORY +The +.Fn fgetln +function first appeared in +.Bx 4.4 . diff --git a/stdio/FreeBSD/fgetln.c b/stdio/FreeBSD/fgetln.c new file mode 100644 index 0000000..8de4aa9 --- /dev/null +++ b/stdio/FreeBSD/fgetln.c @@ -0,0 +1,170 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fgetln.c 8.2 (Berkeley) 1/2/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetln.c,v 1.11 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +/* + * Expand the line buffer. Return -1 on error. +#ifdef notdef + * The `new size' does not account for a terminating '\0', + * so we add 1 here. +#endif + */ +int +__slbexpand(FILE *fp, size_t newsize) +{ + void *p; + +#ifdef notdef + ++newsize; +#endif + if (fp->_lb._size >= newsize) + return (0); + if (newsize > INT_MAX) { + errno = ENOMEM; + return (-1); + } + if ((p = realloc(fp->_lb._base, newsize)) == NULL) + return (-1); + fp->_lb._base = p; + fp->_lb._size = newsize; + return (0); +} + +/* + * Get an input line. The returned pointer often (but not always) + * points into a stdio buffer. Fgetln does not alter the text of + * the returned line (which is thus not a C string because it will + * not necessarily end with '\0'), but does allow callers to modify + * it if they wish. Thus, we set __SMOD in case the caller does. + */ +char * +fgetln(FILE *fp, size_t *lenp) +{ + unsigned char *p; + size_t len; + size_t off; + + FLOCKFILE(fp); + ORIENT(fp, -1); + /* make sure there is input */ + if (fp->_r <= 0 && __srefill(fp)) { + *lenp = 0; + FUNLOCKFILE(fp); + return (NULL); + } + + /* look for a newline in the input */ + if ((p = memchr((void *)fp->_p, '\n', (size_t)fp->_r)) != NULL) { + char *ret; + + /* + * Found one. Flag buffer as modified to keep fseek from + * `optimising' a backward seek, in case the user stomps on + * the text. + */ + p++; /* advance over it */ + ret = (char *)fp->_p; + *lenp = len = p - fp->_p; + fp->_flags |= __SMOD; + fp->_r -= len; + fp->_p = p; + FUNLOCKFILE(fp); + return (ret); + } + + /* + * We have to copy the current buffered data to the line buffer. + * As a bonus, though, we can leave off the __SMOD. + * + * OPTIMISTIC is length that we (optimistically) expect will + * accomodate the `rest' of the string, on each trip through the + * loop below. + */ +#define OPTIMISTIC 80 + + for (len = fp->_r, off = 0;; len += fp->_r) { + size_t diff; + + /* + * Make sure there is room for more bytes. Copy data from + * file buffer to line buffer, refill file and look for + * newline. The loop stops only when we find a newline. + */ + if (__slbexpand(fp, len + OPTIMISTIC)) + goto error; + (void)memcpy((void *)(fp->_lb._base + off), (void *)fp->_p, + len - off); + off = len; + if (__srefill(fp)) + break; /* EOF or error: return partial line */ + if ((p = memchr((void *)fp->_p, '\n', (size_t)fp->_r)) == NULL) + continue; + + /* got it: finish up the line (like code above) */ + p++; + diff = p - fp->_p; + len += diff; + if (__slbexpand(fp, len)) + goto error; + (void)memcpy((void *)(fp->_lb._base + off), (void *)fp->_p, + diff); + fp->_r -= diff; + fp->_p = p; + break; + } + *lenp = len; +#ifdef notdef + fp->_lb._base[len] = 0; +#endif + FUNLOCKFILE(fp); + return ((char *)fp->_lb._base); + +error: + *lenp = 0; /* ??? */ + fp->_flags |= __SERR; + FUNLOCKFILE(fp); + return (NULL); /* ??? */ +} diff --git a/stdio/FreeBSD/fgetpos.c b/stdio/FreeBSD/fgetpos.c new file mode 100644 index 0000000..40e134d --- /dev/null +++ b/stdio/FreeBSD/fgetpos.c @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fgetpos.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetpos.c,v 1.13 2007/01/09 00:28:06 imp Exp $"); + +#include + +int +fgetpos(FILE * __restrict fp, fpos_t * __restrict pos) +{ + /* + * ftello is thread-safe; no need to lock fp. + */ + if ((*pos = ftello(fp)) == (fpos_t)-1) + return (-1); + else + return (0); +} diff --git a/stdio/FreeBSD/fgets.3 b/stdio/FreeBSD/fgets.3 new file mode 100644 index 0000000..e8909d2 --- /dev/null +++ b/stdio/FreeBSD/fgets.3 @@ -0,0 +1,158 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fgets.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/fgets.3,v 1.22 2009/02/28 06:00:58 das Exp $ +.\" +.Dd June 4, 1993 +.Dt FGETS 3 +.Os +.Sh NAME +.Nm fgets , +.Nm gets +.Nd get a line from a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft char * +.Fn fgets "char * restrict str" "int size" "FILE * restrict stream" +.Ft char * +.Fn gets "char *str" +.Sh DESCRIPTION +The +.Fn fgets +function +reads at most one less than the number of characters specified by +.Fa size +from the given +.Fa stream +and stores them in the string +.Fa str . +Reading stops when a newline character is found, +at end-of-file or error. +The newline, if any, is retained. +If any characters are read and there is no error, a +.Ql \e0 +character is appended to end the string. +.Pp +The +.Fn gets +function +is equivalent to +.Fn fgets +with an infinite +.Fa size +and a +.Fa stream +of +.Dv stdin , +except that the newline character (if any) is not stored in the string. +It is the caller's responsibility to ensure that the input line, +if any, is sufficiently short to fit in the string. +.Sh RETURN VALUES +Upon successful completion, +.Fn fgets +and +.Fn gets +return +a pointer to the string. +If end-of-file occurs before any characters are read, +they return +.Dv NULL +and the buffer contents remain unchanged. +If an error occurs, +they return +.Dv NULL +and the buffer contents are indeterminate. +The +.Fn fgets +and +.Fn gets +functions +do not distinguish between end-of-file and error, and callers must use +.Xr feof 3 +and +.Xr ferror 3 +to determine which occurred. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EBADF +The given +.Fa stream +is not a readable stream. +.El +.Pp +The function +.Fn fgets +may also fail and set +.Va errno +for any of the errors specified for the routines +.Xr fflush 3 , +.Xr fstat 2 , +.Xr read 2 , +or +.Xr malloc 3 . +.Pp +The function +.Fn gets +may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr getchar 3 . +.Sh SECURITY CONSIDERATIONS +The +.Fn gets +function cannot be used securely. +Because of its lack of bounds checking, +and the inability for the calling program +to reliably determine the length of the next incoming line, +the use of this function enables malicious users +to arbitrarily change a running program's functionality through +a buffer overflow attack. +It is strongly suggested that the +.Fn fgets +function be used in all cases. +(See +the FSA.) +.Sh SEE ALSO +.Xr feof 3 , +.Xr ferror 3 , +.Xr fgetln 3 , +.Xr fgetws 3 , +.Xr getline 3 +.Sh STANDARDS +The functions +.Fn fgets +and +.Fn gets +conform to +.St -isoC-99 . diff --git a/stdio/FreeBSD/fgets.c b/stdio/FreeBSD/fgets.c new file mode 100644 index 0000000..c9efd57 --- /dev/null +++ b/stdio/FreeBSD/fgets.c @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fgets.c 8.2 (Berkeley) 12/22/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fgets.c,v 1.14 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +/* + * Read at most n-1 characters from the given file. + * Stop when a newline has been read, or the count runs out. + * Return first argument, or NULL if no characters were read. + */ +char * +fgets(buf, n, fp) + char *buf; + int n; + FILE *fp; +{ + size_t len; + char *s; + unsigned char *p, *t; + + if (n <= 0) /* sanity check */ + return (NULL); + + FLOCKFILE(fp); + ORIENT(fp, -1); + s = buf; + n--; /* leave space for NUL */ + while (n != 0) { + /* + * If the buffer is empty, refill it. + */ + if ((len = fp->_r) <= 0) { + if (__srefill(fp)) { + /* EOF/error: stop with partial or no line */ + if (s == buf) { + FUNLOCKFILE(fp); + return (NULL); + } + break; + } + len = fp->_r; + } + p = fp->_p; + + /* + * Scan through at most n bytes of the current buffer, + * looking for '\n'. If found, copy up to and including + * newline, and stop. Otherwise, copy entire chunk + * and loop. + */ + if (len > n) + len = n; + t = memchr((void *)p, '\n', len); + if (t != NULL) { + len = ++t - p; + fp->_r -= len; + fp->_p = t; + (void)memcpy((void *)s, (void *)p, len); + s[len] = 0; + FUNLOCKFILE(fp); + return (buf); + } + fp->_r -= len; + fp->_p += len; + (void)memcpy((void *)s, (void *)p, len); + s += len; + n -= len; + } + *s = 0; + FUNLOCKFILE(fp); + return (buf); +} diff --git a/stdio/FreeBSD/fgetwc.c b/stdio/FreeBSD/fgetwc.c new file mode 100644 index 0000000..709244f --- /dev/null +++ b/stdio/FreeBSD/fgetwc.c @@ -0,0 +1,114 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetwc.c,v 1.13 2008/04/17 22:17:53 jhb Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" +#include "mblocal.h" + +/* + * MT-safe version. + */ +wint_t +fgetwc(FILE *fp) +{ + wint_t r; + + FLOCKFILE(fp); + ORIENT(fp, 1); + r = __fgetwc(fp, __current_locale()); + FUNLOCKFILE(fp); + + return (r); +} + +wint_t +fgetwc_l(FILE *fp, locale_t loc) +{ + wint_t r; + + NORMALIZE_LOCALE(loc); + FLOCKFILE(fp); + ORIENT(fp, 1); + r = __fgetwc(fp, loc); + FUNLOCKFILE(fp); + + return (r); +} + +/* + * Non-MT-safe version. + */ +wint_t +__fgetwc(FILE *fp, locale_t loc) +{ + wchar_t wc; + size_t nconv; + struct __xlocale_st_runelocale *xrl = loc->__lc_ctype; + size_t (*__mbrtowc)(wchar_t * __restrict, const char * __restrict, size_t, mbstate_t * __restrict, locale_t) = xrl->__mbrtowc; + + if (fp->_r <= 0 && __srefill(fp)) + return (WEOF); + if (xrl->__mb_cur_max == 1) { + /* Fast path for single-byte encodings. */ + wc = *fp->_p++; + fp->_r--; + return (wc); + } + do { + nconv = __mbrtowc(&wc, (char*)fp->_p, fp->_r, &fp->_mbstate, loc); + if (nconv == (size_t)-1) + break; + else if (nconv == (size_t)-2) + continue; + else if (nconv == 0) { + /* + * Assume that the only valid representation of + * the null wide character is a single null byte. + */ + fp->_p++; + fp->_r--; + return (L'\0'); + } else { + fp->_p += nconv; + fp->_r -= nconv; + return (wc); + } + } while (__srefill(fp) == 0); + fp->_flags |= __SERR; + errno = EILSEQ; + return (WEOF); +} diff --git a/stdio/FreeBSD/fgetwln.3 b/stdio/FreeBSD/fgetwln.3 new file mode 100644 index 0000000..c38fb39 --- /dev/null +++ b/stdio/FreeBSD/fgetwln.3 @@ -0,0 +1,129 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fgetln.3 8.3 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/stdio/fgetwln.3,v 1.3 2007/01/09 00:28:06 imp Exp $ +.\" +.Dd July 16, 2004 +.Dt FGETWLN 3 +.Os +.Sh NAME +.Nm fgetwln , +.Nm fgetwln_l +.Nd get a line of wide characters from a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft wchar_t * +.Fn fgetwln "FILE * restrict stream" "size_t * restrict len" +.In xlocale.h +.Ft wchar_t * +.Fn fgetwln_l "FILE * restrict stream" "size_t * restrict len" "locale_t loc" +.Sh DESCRIPTION +The +.Fn fgetwln +function +returns a pointer to the next line from the stream referenced by +.Fa stream . +This line is +.Em not +a standard wide character string as it does not end with a terminating +null wide character. +The length of the line, including the final newline, +is stored in the memory location to which +.Fa len +points. +(Note, however, that if the line is the last +in a file that does not end in a newline, +the returned text will not contain a newline.) +.Pp +While the +.Fn fgetwln +function uses the current locale, the +.Fn fgetwln_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +Upon successful completion a pointer is returned; +this pointer becomes invalid after the next +.Tn I/O +operation on +.Fa stream +(whether successful or not) +or as soon as the stream is closed. +Otherwise, +.Dv NULL +is returned. +The +.Fn fgetwln +function +does not distinguish between end-of-file and error; the routines +.Xr feof 3 +and +.Xr ferror 3 +must be used +to determine which occurred. +If an error occurs, the global variable +.Va errno +is set to indicate the error. +The end-of-file condition is remembered, even on a terminal, and all +subsequent attempts to read will return +.Dv NULL +until the condition is +cleared with +.Xr clearerr 3 . +.Pp +The text to which the returned pointer points may be modified, +provided that no changes are made beyond the returned size. +These changes are lost as soon as the pointer becomes invalid. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EBADF +The argument +.Fa stream +is not a stream open for reading. +.El +.Pp +The +.Fn fgetwln +function +may also fail and set +.Va errno +for any of the errors specified for the routines +.Xr mbrtowc 3 , +.Xr realloc 3 , +or +.Xr read 2 . +.Sh SEE ALSO +.Xr ferror 3 , +.Xr fgetln 3 , +.Xr fgetws 3 , +.Xr fopen 3 , +.Xr xlocale 3 diff --git a/stdio/FreeBSD/fgetwln.c b/stdio/FreeBSD/fgetwln.c new file mode 100644 index 0000000..43485cb --- /dev/null +++ b/stdio/FreeBSD/fgetwln.c @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetwln.c,v 1.2 2004/08/06 17:00:09 tjr Exp $"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +wchar_t * +fgetwln_l(FILE * __restrict fp, size_t *lenp, locale_t loc) +{ + wint_t wc; + size_t len; + + FLOCKFILE(fp); + ORIENT(fp, 1); + + len = 0; + while ((wc = __fgetwc(fp, loc)) != WEOF) { +#define GROW 512 + if (len * sizeof(wchar_t) >= fp->_lb._size && + __slbexpand(fp, (len + GROW) * sizeof(wchar_t))) + goto error; + *((wchar_t *)fp->_lb._base + len++) = wc; + if (wc == L'\n') + break; + } + if (len == 0) + goto error; + + FUNLOCKFILE(fp); + *lenp = len; + return ((wchar_t *)fp->_lb._base); + +error: + FUNLOCKFILE(fp); + *lenp = 0; + return (NULL); +} + +wchar_t * +fgetwln(FILE * __restrict fp, size_t *lenp) +{ + return fgetwln_l(fp, lenp, __current_locale()); +} diff --git a/stdio/FreeBSD/fgetws.3 b/stdio/FreeBSD/fgetws.3 new file mode 100644 index 0000000..49c9d90 --- /dev/null +++ b/stdio/FreeBSD/fgetws.3 @@ -0,0 +1,146 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fgets.3 8.1 (Berkeley) 6/4/93 +.\" FreeBSD: src/lib/libc/stdio/fgets.3,v 1.16 2002/05/31 05:01:17 archie Exp +.\" $FreeBSD: src/lib/libc/stdio/fgetws.3,v 1.4 2007/01/09 00:28:06 imp Exp $ +.\" +.Dd August 6, 2002 +.Dt FGETWS 3 +.Os +.Sh NAME +.Nm fgetws , +.Nm fgetws_l +.Nd get a line of wide characters from a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft "wchar_t *" +.Fo fgetws +.Fa "wchar_t *restrict ws" +.Fa "int n" +.Fa "FILE *restrict stream" +.Fc +.In stdio.h +.In wchar.h +.In xlocale.h +.Ft "wchar_t *" +.Fo fgetws_l +.Fa "wchar_t *restrict ws" +.Fa "int n" +.Fa "FILE *restrict stream" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn fgetws +function +reads at most one less than the number of characters specified by +.Fa n +from the given +.Fa stream +and stores them in the wide character string +.Fa ws . +Reading stops when a newline character is found, +at end-of-file or error. +The newline, if any, is retained. +If any characters are read and there is no error, a +.Ql \e0 +character is appended to end the string. +.Pp +While the +.Fn fgetws +function uses the current locale, the +.Fn fgetws_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +Upon successful completion, +.Fn fgetws +returns +.Fa ws . +If end-of-file occurs before any characters are read, +.Fn fgetws +returns +.Dv NULL +and the buffer contents remain unchanged. +If an error occurs, +.Fn fgetws +returns +.Dv NULL +and the buffer contents are indeterminate. +The +.Fn fgetws +function +does not distinguish between end-of-file and error; +callers must use +.Xr feof 3 +and +.Xr ferror 3 +to determine which occurred. +.Sh ERRORS +The +.Fn fgetws +function will fail if: +.Bl -tag -width Er +.It Bq Er EBADF +The given +.Fa stream +argument is not a readable stream. +.It Bq Er EILSEQ +The data obtained from the input stream does not form a valid +multibyte character. +.El +.Pp +The function +.Fn fgetws +may also fail and set +.Va errno +for any of the errors specified for the routines +.Xr fflush 3 , +.Xr fstat 2 , +.Xr read 2 , +or +.Xr malloc 3 . +.Sh SEE ALSO +.Xr feof 3 , +.Xr ferror 3 , +.Xr fgets 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn fgetws +function +conforms to +.St -p1003.1-2001 . diff --git a/stdio/FreeBSD/fgetws.c b/stdio/FreeBSD/fgetws.c new file mode 100644 index 0000000..278e809 --- /dev/null +++ b/stdio/FreeBSD/fgetws.c @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetws.c,v 1.8 2009/11/25 04:45:45 wollman Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" +#include "mblocal.h" + +wchar_t * +fgetws_l(wchar_t * __restrict ws, int n, FILE * __restrict fp, locale_t loc) +{ + wchar_t *wsp; + size_t nconv; + const char *src; + unsigned char *nl; + struct __xlocale_st_runelocale *rl; + size_t (*__mbsnrtowcs)(wchar_t * __restrict, const char ** __restrict, size_t, size_t, __darwin_mbstate_t * __restrict, locale_t); + + NORMALIZE_LOCALE(loc); + rl = loc->__lc_ctype; + __mbsnrtowcs = rl->__mbsnrtowcs; + FLOCKFILE(fp); + ORIENT(fp, 1); + + if (n <= 0) { + errno = EINVAL; + goto error; + } + + if (fp->_r <= 0 && __srefill(fp)) + /* EOF */ + goto error; + wsp = ws; + do { + src = (const char *)fp->_p; + nl = memchr(fp->_p, '\n', fp->_r); + nconv = __mbsnrtowcs(wsp, &src, + nl != NULL ? (nl - fp->_p + 1) : fp->_r, + n - 1, &fp->_mbstate, loc); + if (nconv == (size_t)-1) + /* Conversion error */ + goto error; + if (src == NULL) { + /* + * We hit a null byte. Increment the character count, + * since mbsnrtowcs()'s return value doesn't include + * the terminating null, then resume conversion + * after the null. + */ + nconv++; + src = memchr(fp->_p, '\0', fp->_r); + src++; + } + fp->_r -= (unsigned char *)src - fp->_p; + fp->_p = (unsigned char *)src; + n -= nconv; + wsp += nconv; + } while (wsp[-1] != L'\n' && n > 1 && (fp->_r > 0 || + __srefill(fp) == 0)); + if (wsp == ws) + /* EOF */ + goto error; + if (!rl->__mbsinit(&fp->_mbstate, loc)) + /* Incomplete character */ + goto error; + *wsp = L'\0'; + FUNLOCKFILE(fp); + + return (ws); + +error: + FUNLOCKFILE(fp); + return (NULL); +} + +wchar_t * +fgetws(wchar_t * __restrict ws, int n, FILE * __restrict fp) +{ + return fgetws_l(ws, n, fp, __current_locale()); +} diff --git a/stdio/FreeBSD/fileno.c b/stdio/FreeBSD/fileno.c new file mode 100644 index 0000000..d99438c --- /dev/null +++ b/stdio/FreeBSD/fileno.c @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fileno.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fileno.c,v 1.13 2008/05/05 16:03:52 jhb Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" + +#undef fileno +#undef fileno_unlocked + +int +fileno(FILE *fp) +{ + int fd; + + FLOCKFILE(fp); + fd = __sfileno(fp); + FUNLOCKFILE(fp); + + return (fd); +} + +int +fileno_unlocked(FILE *fp) +{ + + return (__sfileno(fp)); +} diff --git a/stdio/FreeBSD/findfp.c b/stdio/FreeBSD/findfp.c new file mode 100644 index 0000000..fe1110b --- /dev/null +++ b/stdio/FreeBSD/findfp.c @@ -0,0 +1,298 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcomma" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)findfp.c 8.2 (Berkeley) 1/4/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/findfp.c,v 1.34 2009/12/05 19:31:38 ed Exp $"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "libc_private.h" +#include "local.h" +#include "glue.h" + +pthread_once_t __sdidinit; + +#if !TARGET_OS_EMBEDDED +#define NDYNAMIC 10 /* add ten more whenever necessary */ +#else +#define NDYNAMIC 1 /* add one at a time on embedded */ +#endif + +#define std(flags, file) { \ + ._flags = (flags), \ + ._file = (file), \ + ._cookie = __sF + (file), \ + ._close = __sclose, \ + ._read = __sread, \ + ._seek = __sseek, \ + ._write = __swrite, \ + ._extra = __sFX + file, \ +} + /* set counted */ +#define __sFXInit3 {.fl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER, .counted = 1} + +static int __scounted; /* streams counted against STREAM_MAX */ +static int __stream_max; + +#if !TARGET_OS_EMBEDDED +/* usual and usual_extra are data pigs. See 7929728. For embedded we should + * always allocate dynamically, and probably should for desktop too. */ + /* the usual - (stdin + stdout + stderr) */ +static FILE usual[FOPEN_MAX - 3]; +static struct __sFILEX usual_extra[FOPEN_MAX - 3]; +static struct glue uglue = { NULL, FOPEN_MAX - 3, usual }; +#endif /* !TARGET_OS_EMBEDDED */ + +static struct __sFILEX __sFX[3] = {__sFXInit3, __sFXInit3, __sFXInit3}; + +/* + * We can't make this 'static' due to binary compatibility concerns. + * This also means we cannot change the sizeof(FILE) and must continue to + * use the __sFILEX stuff to add to FILE. + */ +FILE __sF[3] = { + std(__SRD, STDIN_FILENO), + std(__SWR, STDOUT_FILENO), + std(__SWR|__SNBF, STDERR_FILENO) +}; + +FILE *__stdinp = &__sF[0]; +FILE *__stdoutp = &__sF[1]; +FILE *__stderrp = &__sF[2]; + +#if !TARGET_OS_EMBEDDED +struct glue __sglue = { &uglue, 3, __sF }; +static struct glue *lastglue = &uglue; +#else +struct glue __sglue = { NULL, 3, __sF }; +static struct glue *lastglue = &__sglue; +#endif + +static struct glue * moreglue(int); + +static pthread_mutex_t filelist_lock = PTHREAD_MUTEX_INITIALIZER; +#define FILELIST_LOCK() do { pthread_mutex_lock(&filelist_lock); } while(0) +#define FILELIST_UNLOCK() do { pthread_mutex_unlock(&filelist_lock); } while(0) + +static struct glue * +moreglue(int n) +{ + struct glue *g; + FILE *p; + struct __sFILEX *fx; + size_t align; + + align = __alignof__( (struct { FILE f; struct __sFILEX s; }){} ); + g = (struct glue *)malloc(sizeof(*g) + align + n * sizeof(FILE) + + n * sizeof(struct __sFILEX)); + if (g == NULL) + return (NULL); + p = (FILE *)roundup((uintptr_t)(g + 1), align); + fx = (struct __sFILEX *)&p[n]; + g->next = NULL; + g->niobs = n; + g->iobs = p; + + while (--n >= 0) { + bzero(p, sizeof(*p)); + p->_extra = fx; + INITEXTRA(p); + p++, fx++; + } + return (g); +} + +/* + * Find a free FILE for fopen et al. + */ +FILE * +__sfp(int count) +{ + FILE *fp; + int n; + struct glue *g; + + pthread_once(&__sdidinit, __sinit); + + if (count) { + int32_t new = OSAtomicIncrement32(&__scounted); + if (new > __stream_max) { + if (new > (__stream_max = sysconf(_SC_STREAM_MAX))){ + OSAtomicDecrement32(&__scounted); + errno = EMFILE; + return NULL; + } + } + } + /* + * The list must be locked because a FILE may be updated. + */ + FILELIST_LOCK(); + for (g = &__sglue; g != NULL; g = g->next) { + for (fp = g->iobs, n = g->niobs; --n >= 0; fp++) + if (fp->_flags == 0) + goto found; + } + FILELIST_UNLOCK(); /* don't hold lock while malloc()ing. */ + if ((g = moreglue(NDYNAMIC)) == NULL) + return (NULL); + FILELIST_LOCK(); /* reacquire the lock */ + lastglue->next = g; /* atomically append glue to list */ + lastglue = g; /* not atomic; only accessed when locked */ + fp = g->iobs; +found: + fp->_flags = 1; /* reserve this slot; caller sets real flags */ + FILELIST_UNLOCK(); + + /* _flags = 1 means the FILE* is in use, and this thread owns the object while it is being initialized */ + fp->_p = NULL; /* no current pointer */ + fp->_w = 0; /* nothing to read or write */ + fp->_r = 0; + fp->_bf._base = NULL; /* no buffer */ + fp->_bf._size = 0; + fp->_lbfsize = 0; /* not line buffered */ + fp->_file = -1; /* no file */ +/* fp->_cookie = ; */ /* caller sets cookie, _read/_write etc */ + fp->_ub._base = NULL; /* no ungetc buffer */ + fp->_ub._size = 0; + fp->_lb._base = NULL; /* no line buffer */ + fp->_lb._size = 0; +/* fp->_lock = NULL; */ /* once set always set (reused) */ + INITEXTRA(fp); + fp->_extra->counted = count ? 1 : 0; + return (fp); +} + +/* + * Mark as free and update count as needed + */ +__private_extern__ void +__sfprelease(FILE *fp) +{ + if (fp->_counted) { + OSAtomicDecrement32(&__scounted); + fp->_counted = 0; + } + + pthread_mutex_destroy(&fp->_extra->fl_mutex); + + /* Make sure nobody else is enumerating the list while we clear the "in use" _flags field. */ + FILELIST_LOCK(); + fp->_flags = 0; + FILELIST_UNLOCK(); +} + +/* + * XXX. Force immediate allocation of internal memory. Not used by stdio, + * but documented historically for certain applications. Bad applications. + */ +__warn_references(f_prealloc, + "warning: this program uses f_prealloc(), which is not recommended."); + +void +f_prealloc(void) +{ + struct glue *g; + int n; + + n = getdtablesize() - FOPEN_MAX + 20; /* 20 for slop. */ + /* + * It should be safe to walk the list without locking it; + * new nodes are only added to the end and none are ever + * removed. + */ + for (g = &__sglue; (n -= g->niobs) > 0 && g->next; g = g->next) + /* void */; + if ((n > 0) && ((g = moreglue(n)) != NULL)) { + FILELIST_LOCK(); + lastglue->next = g; + lastglue = g; + FILELIST_UNLOCK(); + } +} + +/* + * exit() calls _cleanup() through *__cleanup, set whenever we + * open or buffer a file. This chicanery is done so that programs + * that do not use stdio need not link it all in. + * + * The name `_cleanup' is, alas, fairly well known outside stdio. + */ +void +_cleanup(void) +{ + /* (void) _fwalk(fclose); */ + (void) _fwalk(__sflush); /* `cheating' */ +} + +/* + * __sinit() is called whenever stdio's internal variables must be set up. + */ +void +__sinit(void) +{ +#if !TARGET_OS_EMBEDDED + int i; +#endif + + /* Make sure we clean up on exit. */ + __cleanup = _cleanup; /* conservative */ + __stream_max = sysconf(_SC_STREAM_MAX); + __scounted = 3; /* std{in,out,err} already exists */ + +#if !TARGET_OS_EMBEDDED + /* Set _extra for the usual suspects. */ + for (i = 0; i < FOPEN_MAX - 3; i++) { + usual[i]._extra = &usual_extra[i]; + INITEXTRA(&usual[i]); + } +#endif +} +#pragma clang diagnostic pop diff --git a/stdio/FreeBSD/flags.c b/stdio/FreeBSD/flags.c new file mode 100644 index 0000000..3b90476 --- /dev/null +++ b/stdio/FreeBSD/flags.c @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)flags.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/flags.c,v 1.10 2007/01/09 00:28:06 imp Exp $"); + +#include +#include +#include +#include + +#include "local.h" + +/* + * Return the (stdio) flags for a given mode. Store the flags + * to be passed to an _open() syscall through *optr. + * Return 0 on error. + */ +int +__sflags(mode, optr) + const char *mode; + int *optr; +{ + int ret, m, o; + + switch (*mode++) { + + case 'r': /* open for reading */ + ret = __SRD; + m = O_RDONLY; + o = 0; + break; + + case 'w': /* open for writing */ + ret = __SWR; + m = O_WRONLY; + o = O_CREAT | O_TRUNC; + break; + + case 'a': /* open for appending */ + ret = __SWR; + m = O_WRONLY; + o = O_CREAT | O_APPEND; + break; + + default: /* illegal mode */ + errno = EINVAL; + return (0); + } + + /* [rwa]\+ or [rwa]b\+ means read and write */ + if (*mode == 'b') + mode++; + if (*mode == '+') { + ret = __SRW; + m = O_RDWR; + mode++; + if (*mode == 'b') + mode++; + } + if (*mode == 'x') + o |= O_EXCL; + *optr = m | o; + return (ret); +} diff --git a/stdio/FreeBSD/floatio.h b/stdio/FreeBSD/floatio.h new file mode 100644 index 0000000..9c57d8e --- /dev/null +++ b/stdio/FreeBSD/floatio.h @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)floatio.h 8.1 (Berkeley) 6/4/93 + * $FreeBSD: src/lib/libc/stdio/floatio.h,v 1.6 2007/01/09 00:28:06 imp Exp $ + */ + +/* + * Floating point scanf/printf (input/output) definitions. + */ + +/* + * MAXEXPDIG is the maximum number of decimal digits needed to store a + * floating point exponent in the largest supported format. It should + * be ceil(log10(LDBL_MAX_10_EXP)) or, if hexadecimal floating point + * conversions are supported, ceil(log10(LDBL_MAX_EXP)). But since it + * is presently never greater than 5 in practice, we fudge it. + */ +#define MAXEXPDIG 6 +#if LDBL_MAX_EXP > 999999 +#error "floating point buffers too small" +#endif + +char *__hdtoa(double, const char *, int, int *, int *, char **); +char *__hldtoa(long double, const char *, int, int *, int *, char **); +char *__ldtoa(long double *, int, int, int *, int *, char **); diff --git a/stdio/FreeBSD/flockfile.3 b/stdio/FreeBSD/flockfile.3 new file mode 100644 index 0000000..924b9e5 --- /dev/null +++ b/stdio/FreeBSD/flockfile.3 @@ -0,0 +1,105 @@ +.\" Copyright (c) 2003 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/stdio/flockfile.3,v 1.3 2003/01/13 01:29:14 tjr Exp $ +.\" +.Dd January 10, 2003 +.Dt FLOCKFILE 3 +.Os +.Sh NAME +.Nm flockfile , +.Nm ftrylockfile , +.Nm funlockfile +.Nd "stdio locking functions" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft void +.Fn flockfile "FILE *file" +.Ft int +.Fn ftrylockfile "FILE *file" +.Ft void +.Fn funlockfile "FILE *file" +.Sh DESCRIPTION +These functions provide explicit application-level locking +of stdio FILE objects. +They can be used to avoid output from multiple threads being interspersed, +input being dispersed among multiple readers, and to avoid the overhead +of locking the object for each operation. +.Pp +The +.Fn flockfile +function acquires an exclusive lock on the specified object. +If another thread has already locked the object, +.Fn flockfile +will block until the lock is released. +.Pp +The +.Fn ftrylockfile +function is a non-blocking version of +.Fn flockfile ; +if the lock cannot be acquired immediately, +.Fn ftrylockfile +returns non-zero instead of blocking. +.Pp +The +.Fn funlockfile +function releases the lock on an object acquired by an earlier call to +.Fn flockfile +or +.Fn ftrylockfile . +.Pp +These functions behave as if there is a lock count associated +with each object. +Each time +.Fn flockfile +is called on the object, the count is incremented, +and each time +.Fn funlockfile +is called on the object, the count is decremented. +The lock is only actually released when the count reaches zero. +.Sh RETURN VALUES +The +.Fn flockfile +and +.Fn funlockfile +functions return no value. +.Pp +The +.Fn ftrylockfile +function +returns zero if the object was successfully locked, +non-zero otherwise. +.Sh SEE ALSO +.Xr getc_unlocked 3 , +.Xr putc_unlocked 3 +.Sh STANDARDS +The +.Fn flockfile , +.Fn ftrylockfile , +and +.Fn funlockfile +functions conform to +.St -p1003.1-2001 . diff --git a/stdio/FreeBSD/fmemopen.c b/stdio/FreeBSD/fmemopen.c new file mode 100644 index 0000000..bcf187d --- /dev/null +++ b/stdio/FreeBSD/fmemopen.c @@ -0,0 +1,262 @@ +/*- + * Copyright (C) 2013 Pietro Cerutti + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include "local.h" + +struct fmemopen_cookie +{ + char *buf; /* pointer to the memory region */ + bool own; /* did we allocate the buffer ourselves? */ + char bin; /* is this a binary buffer? */ + size_t size; /* buffer length in bytes */ + size_t len; /* data length in bytes */ + size_t off; /* current offset into the buffer */ +}; + +static int fmemopen_read(void *cookie, char *buf, int nbytes); +static int fmemopen_write(void *cookie, const char *buf, int nbytes); +static fpos_t fmemopen_seek(void *cookie, fpos_t offset, int whence); +static int fmemopen_close(void *cookie); + +FILE * +fmemopen(void * __restrict buf, size_t size, const char * __restrict mode) +{ + struct fmemopen_cookie *ck; + FILE *f; + int flags, rc; + + /* + * POSIX says we shall return EINVAL if size is 0. + */ + if (size == 0) { + errno = EINVAL; + return (NULL); + } + + /* + * Retrieve the flags as used by open(2) from the mode argument, and + * validate them. + */ + rc = __sflags(mode, &flags); + if (rc == 0) { + errno = EINVAL; + return (NULL); + } + + /* + * There's no point in requiring an automatically allocated buffer + * in write-only mode. + */ + if (!(flags & O_RDWR) && buf == NULL) { + errno = EINVAL; + return (NULL); + } + + ck = malloc(sizeof(struct fmemopen_cookie)); + if (ck == NULL) { + return (NULL); + } + + ck->off = 0; + ck->size = size; + + /* Check whether we have to allocate the buffer ourselves. */ + ck->own = ((ck->buf = buf) == NULL); + if (ck->own) { + ck->buf = malloc(size); + if (ck->buf == NULL) { + free(ck); + return (NULL); + } + } + + /* + * POSIX distinguishes between w+ and r+, in that w+ is supposed to + * truncate the buffer. + */ + if (ck->own || mode[0] == 'w') { + ck->buf[0] = '\0'; + } + + /* Check for binary mode. */ + ck->bin = strchr(mode, 'b') != NULL; + + /* + * The size of the current buffer contents is set depending on the + * mode: + * + * for append (text-mode), the position of the first NULL byte, or the + * size of the buffer if none is found + * + * for append (binary-mode), the size of the buffer + * + * for read, the size of the buffer + * + * for write, 0 + */ + switch (mode[0]) { + case 'a': + ck->off = ck->len = strnlen(ck->buf, ck->size); + break; + case 'r': + ck->len = size; + break; + case 'w': + ck->len = 0; + break; + } + + f = funopen(ck, + flags & O_WRONLY ? NULL : fmemopen_read, + flags & O_RDONLY ? NULL : fmemopen_write, + fmemopen_seek, fmemopen_close); + + if (f == NULL) { + if (ck->own) + free(ck->buf); + free(ck); + return (NULL); + } + + if (mode[0] == 'a') + f->_flags |= __SAPP; + + /* + * Turn off buffering, so a write past the end of the buffer + * correctly returns a short object count. + */ + setvbuf(f, NULL, _IONBF, 0); + + return (f); +} + +static int +fmemopen_read(void *cookie, char *buf, int nbytes) +{ + struct fmemopen_cookie *ck = cookie; + + if (nbytes > ck->len - ck->off) + nbytes = ck->len - ck->off; + + if (nbytes == 0) + return (0); + + memcpy(buf, ck->buf + ck->off, nbytes); + + ck->off += nbytes; + + return (nbytes); +} + +static int +fmemopen_write(void *cookie, const char *buf, int nbytes) +{ + struct fmemopen_cookie *ck = cookie; + + if (nbytes > ck->size - ck->off) + nbytes = ck->size - ck->off; + + if (nbytes == 0) + return (0); + + memcpy(ck->buf + ck->off, buf, nbytes); + + ck->off += nbytes; + + if (ck->off > ck->len) + ck->len = ck->off; + + /* + * We append a NULL byte if all these conditions are met: + * - the buffer is not binary + * - the buffer is not full + * - the data just written doesn't already end with a NULL byte + */ + if (!ck->bin && ck->off < ck->size && ck->buf[ck->off - 1] != '\0') + ck->buf[ck->off] = '\0'; + + return (nbytes); +} + +static fpos_t +fmemopen_seek(void *cookie, fpos_t offset, int whence) +{ + struct fmemopen_cookie *ck = cookie; + + + switch (whence) { + case SEEK_SET: + if (offset > ck->size) { + errno = EINVAL; + return (-1); + } + ck->off = offset; + break; + + case SEEK_CUR: + if (ck->off + offset > ck->size) { + errno = EINVAL; + return (-1); + } + ck->off += offset; + break; + + case SEEK_END: + if (offset > 0 || -offset > ck->len) { + errno = EINVAL; + return (-1); + } + ck->off = ck->len + offset; + break; + + default: + errno = EINVAL; + return (-1); + } + + return (ck->off); +} + +static int +fmemopen_close(void *cookie) +{ + struct fmemopen_cookie *ck = cookie; + + if (ck->own) + free(ck->buf); + + free(ck); + + return (0); +} diff --git a/stdio/FreeBSD/fopen.3 b/stdio/FreeBSD/fopen.3 new file mode 100644 index 0000000..1edd25e --- /dev/null +++ b/stdio/FreeBSD/fopen.3 @@ -0,0 +1,360 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fopen.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd January 30, 2013 +.Dt FOPEN 3 +.Os +.Sh NAME +.Nm fopen , +.Nm fdopen , +.Nm freopen , +.Nm fmemopen +.Nd stream open functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft FILE * +.Fn fopen "const char * restrict path" "const char * restrict mode" +.Ft FILE * +.Fn fdopen "int fildes" "const char *mode" +.Ft FILE * +.Fn freopen "const char *path" "const char *mode" "FILE *stream" +.Ft FILE * +.Fn fmemopen "void *restrict *buf" "size_t size" "const char * restrict mode" +.Sh DESCRIPTION +The +.Fn fopen +function +opens the file whose name is the string pointed to by +.Fa path +and associates a stream with it. +.Pp +The argument +.Fa mode +points to a string beginning with one of the following letters: +.Bl -tag -width indent +.It Dq Li r +Open for reading. +The stream is positioned at the beginning of the file. +Fail if the file does not exist. +.It Dq Li w +Open for writing. +The stream is positioned at the beginning of the file. +Create the file if it does not exist. +.It Dq Li a +Open for writing. +The stream is positioned at the end of the file. +Subsequent writes to the file will always end up at the then current +end of file, irrespective of any intervening +.Xr fseek 3 +or similar. +Create the file if it does not exist. +.El +.Pp +An optional +.Dq Li + +following +.Dq Li r , +.Dq Li w , +or +.Dq Li a +opens the file for both reading and writing. +An optional +.Dq Li x +following +.Dq Li w +or +.Dq Li w+ +causes the +.Fn fopen +call to fail if the file already exists. +An optional +.Dq Li e +following the above +causes the +.Fn fopen +call to set the +.Dv FD_CLOEXEC +flag on the underlying file descriptor. +.Pp +The +.Fa mode +string can also include the letter +.Dq Li b +after either the +.Dq Li + +or the first letter. +This is strictly for compatibility with +.St -isoC +and has effect only for +.Fn fmemopen +; otherwise +.Dq Li b +is ignored. +.Pp +Any created files will have mode +.Do Dv S_IRUSR +\&| +.Dv S_IWUSR +\&| +.Dv S_IRGRP +\&| +.Dv S_IWGRP +\&| +.Dv S_IROTH +\&| +.Dv S_IWOTH Dc +.Pq Li 0666 , +as modified by the process' +umask value (see +.Xr umask 2 ) . +.Pp +Reads and writes may be intermixed on read/write streams in any order; however, +a file positioning function must be called when switching between output and +input, unless an input operation encounters end-of-file. +.Pp +The +.Fn fdopen +function associates a stream with the existing file descriptor, +.Fa fildes . +The mode +of the stream must be compatible with the mode of the file descriptor. +The +.Dq Li x +mode option is ignored. +If the +.Dq Li e +mode option is present, the +.Dv FD_CLOEXEC +flag is set, otherwise it remains unchanged. +When the stream is closed via +.Xr fclose 3 , +.Fa fildes +is closed also. +.Pp +The +.Fn freopen +function +opens the file whose name is the string pointed to by +.Fa path +and associates the stream pointed to by +.Fa stream +with it. +The original stream (if it exists) is closed. +The +.Fa mode +argument is used just as in the +.Fn fopen +function. +.Pp +If the +.Fa path +argument is +.Dv NULL , +.Fn freopen +attempts to re-open the file associated with +.Fa stream +with a new mode. +The new mode must be compatible with the mode that the stream was originally +opened with: +Streams open for reading can only be re-opened for reading, +streams open for writing can only be re-opened for writing, +and streams open for reading and writing can be re-opened in any mode. +The +.Dq Li x +mode option is not meaningful in this context. +.Pp +The primary use of the +.Fn freopen +function +is to change the file associated with a +standard text stream +.Dv ( stderr , stdin , +or +.Dv stdout ) . +.Pp +The +.Fn fmemopen +function +associates the buffer given by the +.Fa buf +and +.Fa size +arguments with a stream. +The +.Fa buf +argument is either a null pointer or a pointer to a buffer that +is at least +.Fa size +bytes long. +If a null pointer is specified as the +.Fa buf +argument, +.Fn fmemopen +allocates +.Fa size +bytes of memory, and this allocation is automatically freed when the stream is +closed. +If a non-null pointer is specified, the caller retains ownership of +the buffer and is responsible for disposing of it after the stream has been +closed. +Buffers can be opened in text-mode (default) or binary-mode +(if +.Dq Li b +is present in the second or third position of the +.Fa mode +argument). Buffers opened in text-mode make sure that writes are terminated with +a NULL byte, if the last write hasn't filled up the whole buffer. Buffers +opened in binary-mode never append a NULL byte. +.Pp +Input and output against the opened stream will be fully buffered, unless +it refers to an interactive terminal device, or a different kind of buffering +is specified in the environment. +See +.Xr setvbuf 3 +for additional details. +.Sh RETURN VALUES +Upon successful completion +.Fn fopen , +.Fn fdopen , +.Fn freopen +and +.Fn fmemopen +return a +.Tn FILE +pointer. +Otherwise, +.Dv NULL +is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa mode +argument +to +.Fn fopen , +.Fn fdopen , +.Fn freopen , +or +.Fn fmemopen +was invalid. +.El +.Pp +The +.Fn fopen , +.Fn fdopen , +.Fn freopen +and +.Fn fmemopen +functions +may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr malloc 3 . +.Pp +The +.Fn fopen +function +may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr open 2 . +.Pp +The +.Fn fdopen +function +may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr fcntl 2 . +.Pp +The +.Fn freopen +function +may also fail and set +.Va errno +for any of the errors specified for the routines +.Xr open 2 , +.Xr fclose 3 +and +.Xr fflush 3 . +.Pp +The +.Fn fmemopen +function +may also fail and set +.Va errno +if the +.Fa size +argument is 0. +.Sh SEE ALSO +.Xr open 2 , +.Xr fclose 3 , +.Xr fileno 3 , +.Xr fseek 3 , +.Xr funopen 3 +.Sh STANDARDS +The +.Fn fopen +and +.Fn freopen +functions +conform to +.St -isoC , +with the exception of the +.Dq Li x +mode option which conforms to +.St -isoC-2011 . +The +.Fn fdopen +function +conforms to +.St -p1003.1-88 . +The +.Dq Li e +mode option does not conform to any standard +but is also supported by glibc. +The +.Fn fmemopen +function +conforms to +.St -p1003.1-2008 . +The +.Dq Li b +mode does not conform to any standard +but is also supported by glibc. diff --git a/stdio/FreeBSD/fopen.c b/stdio/FreeBSD/fopen.c new file mode 100644 index 0000000..df3deea --- /dev/null +++ b/stdio/FreeBSD/fopen.c @@ -0,0 +1,108 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifdef VARIANT_DARWINEXTSN +#define _DARWIN_UNLIMITED_STREAMS +#define COUNT 0 +#elif defined(VARIANT_LEGACY) +#define COUNT 0 +#else +#define COUNT 1 +#endif + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fopen.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fopen.c,v 1.14 2008/04/22 17:03:32 jhb Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "local.h" + +FILE * +fopen(file, mode) + const char * __restrict file; + const char * __restrict mode; +{ + FILE *fp; + int f; + int flags, oflags; + + if ((flags = __sflags(mode, &oflags)) == 0) + return (NULL); + if ((fp = __sfp(COUNT)) == NULL) + return (NULL); + if ((f = _open(file, oflags, DEFFILEMODE)) < 0) { + __sfprelease(fp); /* release */ + return (NULL); + } + /* + * File descriptors are a full int, but _file is only a short. + * If we get a valid file descriptor that is greater than + * SHRT_MAX, then the fd will get sign-extended into an + * invalid file descriptor. Handle this case by failing the + * open. + */ + if (f > SHRT_MAX) { + fp->_flags = 0; /* release */ + _close(f); + errno = EMFILE; + return (NULL); + } + fp->_file = f; + fp->_flags = flags; + fp->_cookie = fp; + fp->_read = __sread; + fp->_write = __swrite; + fp->_seek = __sseek; + fp->_close = __sclose; + /* + * When opening in append mode, even though we use O_APPEND, + * we need to seek to the end so that ftell() gets the right + * answer. If the user then alters the seek pointer, or + * the file extends, this will fail, but there is not much + * we can do about this. (We could set __SAPP and check in + * fseek and ftell.) + */ + if (oflags & O_APPEND) + (void)_sseek(fp, (fpos_t)0, SEEK_END); + return (fp); +} diff --git a/stdio/FreeBSD/fprintf.c b/stdio/FreeBSD/fprintf.c new file mode 100644 index 0000000..76bca94 --- /dev/null +++ b/stdio/FreeBSD/fprintf.c @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fprintf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fprintf.c,v 1.11 2007/01/09 00:28:06 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include + +int +fprintf(FILE * __restrict fp, const char * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vfprintf_l(fp, __current_locale(), fmt, ap); + va_end(ap); + return (ret); +} + +int +fprintf_l(FILE * __restrict fp, locale_t loc, const char * __restrict fmt, ...) +{ + int ret; + va_list ap; + + /* no need to call NORMALIZE_LOCALE(loc), because vfprintf_l will */ + va_start(ap, fmt); + ret = vfprintf_l(fp, loc, fmt, ap); + va_end(ap); + return (ret); +} diff --git a/stdio/FreeBSD/fpurge.c b/stdio/FreeBSD/fpurge.c new file mode 100644 index 0000000..4a673ec --- /dev/null +++ b/stdio/FreeBSD/fpurge.c @@ -0,0 +1,70 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fpurge.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fpurge.c,v 1.11 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +/* + * fpurge: like fflush, but without writing anything: leave the + * given FILE's buffer empty. + */ +int +fpurge(fp) + FILE *fp; +{ + int retval; + FLOCKFILE(fp); + if (!fp->_flags) { + errno = EBADF; + retval = EOF; + } else { + if (HASUB(fp)) + FREEUB(fp); + fp->_p = fp->_bf._base; + fp->_r = 0; + fp->_w = fp->_flags & (__SLBF|__SNBF) ? 0 : fp->_bf._size; + retval = 0; + } + FUNLOCKFILE(fp); + return (retval); +} diff --git a/stdio/FreeBSD/fputc.c b/stdio/FreeBSD/fputc.c new file mode 100644 index 0000000..e429d1c --- /dev/null +++ b/stdio/FreeBSD/fputc.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fputc.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fputc.c,v 1.14 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +int +fputc(c, fp) + int c; + FILE *fp; +{ + int retval; + FLOCKFILE(fp); + /* Orientation set by __sputc() when buffer is full. */ + /* ORIENT(fp, -1); */ + retval = __sputc(c, fp); + FUNLOCKFILE(fp); + return (retval); +} diff --git a/stdio/FreeBSD/fputs.3 b/stdio/FreeBSD/fputs.3 new file mode 100644 index 0000000..4c4ca1e --- /dev/null +++ b/stdio/FreeBSD/fputs.3 @@ -0,0 +1,127 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fputs.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/fputs.3,v 1.14 2007/04/19 14:01:04 phk Exp $ +.\" +.Dd June 4, 1993 +.Dt FPUTS 3 +.Os +.Sh NAME +.Nm fputs , +.Nm puts +.Nd output a line to a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fo fputs +.Fa "const char *restrict s" +.Fa "FILE *restrict stream" +.Fc +.Ft int +.Fo puts +.Fa "const char *s" +.Fc +.Sh DESCRIPTION +The function +.Fn fputs +writes the string pointed to by +.Fa s +to the stream pointed to by +.Fa stream . +.\" The terminating +.\" .Dv NUL +.\" character is not written. +.Pp +The function +.Fn puts +writes the string +.Fa s , +and a terminating newline character, +to the stream +.Dv stdout . +.Sh RETURN VALUES +The functions +.Fn fputs +and +.Fn puts +return a nonnegative integer on success and +.Dv EOF +on error. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa stream +argument +is not a writable stream. +.El +.Pp +The functions +.Fn fputs +and +.Fn puts +may also fail and set +.Va errno +for any of the errors specified for the routines +.Xr write 2 . +.Sh COMPATIBILITY +.Fn fputs +now returns a non-negative number (as opposed to 0) +on successful completion. +As a result, many tests (e.g., "fputs() == 0", "fputs() != 0") +do not give the desired result. +Use "fputs() != EOF" or "fputs() == EOF" +to determine success or failure. +.Sh SEE ALSO +.Xr ferror 3 , +.Xr fputws 3 , +.Xr putc 3 , +.Xr stdio 3 +.Sh STANDARDS +The functions +.Fn fputs +and +.Fn puts +conform to +.St -isoC . +While not mentioned in the standard, both +.Fn fputs +and +.Fn puts +print +.Ql (null) +if +.Fa str +is +.Dv NULL . diff --git a/stdio/FreeBSD/fputs.c b/stdio/FreeBSD/fputs.c new file mode 100644 index 0000000..0cd58ef --- /dev/null +++ b/stdio/FreeBSD/fputs.c @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fputs.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fputs.c,v 1.12 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "fvwrite.h" +#include "libc_private.h" +#include "local.h" + +// 3340719: __puts_null__ is used if string is NULL. Defined in puts.c +extern char const __puts_null__[]; + +/* + * Write the given string to the given file. + */ +int +fputs(s, fp) + const char * __restrict s; + FILE * __restrict fp; +{ + int retval; + struct __suio uio; + struct __siov iov; + + // 3340719: __puts_null__ is used if s is NULL + if(s == NULL) + s = __puts_null__; + iov.iov_base = (void *)s; + iov.iov_len = uio.uio_resid = strlen(s); + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + FLOCKFILE(fp); + ORIENT(fp, -1); + retval = __sfvwrite(fp, &uio); + FUNLOCKFILE(fp); +#if __DARWIN_UNIX03 + if (retval == 0) + return iov.iov_len; +#endif /* __DARWIN_UNIX03 */ + return (retval); +} diff --git a/stdio/FreeBSD/fputwc.c b/stdio/FreeBSD/fputwc.c new file mode 100644 index 0000000..e835bc2 --- /dev/null +++ b/stdio/FreeBSD/fputwc.c @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fputwc.c,v 1.11 2008/04/17 22:17:53 jhb Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" +#include "mblocal.h" + +/* + * Non-MT-safe version. + */ +__private_extern__ wint_t +__fputwc(wchar_t wc, FILE *fp, locale_t loc) +{ + char buf[MB_LEN_MAX]; + size_t i, len; + struct __xlocale_st_runelocale *xrl = loc->__lc_ctype; + + if (xrl->__mb_cur_max == 1 && wc > 0 && wc <= UCHAR_MAX) { + /* + * Assume single-byte locale with no special encoding. + * A more careful test would be to check + * _CurrentRuneLocale->encoding. + */ + *buf = (unsigned char)wc; + len = 1; + } else { + if ((len = loc->__lc_ctype->__wcrtomb(buf, wc, &fp->_mbstate, loc)) == (size_t)-1) { + fp->_flags |= __SERR; + return (WEOF); + } + } + + for (i = 0; i < len; i++) + if (__sputc((unsigned char)buf[i], fp) == EOF) + return (WEOF); + + return ((wint_t)wc); +} + +/* + * MT-safe version. + */ +wint_t +fputwc(wchar_t wc, FILE *fp) +{ + wint_t r; + + FLOCKFILE(fp); + ORIENT(fp, 1); + r = __fputwc(wc, fp, __current_locale()); + FUNLOCKFILE(fp); + + return (r); +} + +wint_t +fputwc_l(wchar_t wc, FILE *fp, locale_t loc) +{ + wint_t r; + + NORMALIZE_LOCALE(loc); + FLOCKFILE(fp); + ORIENT(fp, 1); + r = __fputwc(wc, fp, loc); + FUNLOCKFILE(fp); + + return (r); +} diff --git a/stdio/FreeBSD/fputws.3 b/stdio/FreeBSD/fputws.3 new file mode 100644 index 0000000..d7326b2 --- /dev/null +++ b/stdio/FreeBSD/fputws.3 @@ -0,0 +1,110 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fputs.3 8.1 (Berkeley) 6/4/93 +.\" FreeBSD: src/lib/libc/stdio/fputs.3,v 1.8 2001/10/01 16:08:59 ru Exp +.\" $FreeBSD: src/lib/libc/stdio/fputws.3,v 1.6 2007/01/09 00:28:06 imp Exp $ +.\" +.Dd August 6, 2002 +.Dt FPUTWS 3 +.Os +.Sh NAME +.Nm fputws , +.Nm fputws_l +.Nd output a line of wide characters to a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft int +.Fo fputws +.Fa "const wchar_t *restrict ws" +.Fa "FILE *restrict stream" +.Fc +.In stdio.h +.In wchar.h +.In xlocale.h +.Ft int +.Fo fputws_l +.Fa "const wchar_t *restrict ws" +.Fa "FILE *restrict stream" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn fputws +function writes the wide character string pointed to by +.Fa ws +to the stream pointed to by +.Fa stream . +.Pp +Although the +.Fn fputws +function uses the current locale, the +.Fn fputws_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn fputws +function +returns 0 on success and \-1 on error. +.Sh ERRORS +The +.Fn fputws +function will fail if: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa stream +argument supplied +is not a writable stream. +.El +.Pp +The +.Fn fputws +function may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr write 2 . +.Sh SEE ALSO +.Xr ferror 3 , +.Xr fputs 3 , +.Xr putwc 3 , +.Xr stdio 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn fputws +function conforms to +.St -p1003.1-2001 . diff --git a/stdio/FreeBSD/fputws.c b/stdio/FreeBSD/fputws.c new file mode 100644 index 0000000..1ff0484 --- /dev/null +++ b/stdio/FreeBSD/fputws.c @@ -0,0 +1,84 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fputws.c,v 1.8 2009/01/15 18:53:52 rdivacky Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" +#include "fvwrite.h" +#include "libc_private.h" +#include "local.h" +#include "mblocal.h" + +int +fputws_l(const wchar_t * __restrict ws, FILE * __restrict fp, locale_t loc) +{ + size_t nbytes; + char buf[BUFSIZ]; + struct __suio uio; + struct __siov iov; + const wchar_t *wsp = ws; + size_t (*__wcsnrtombs)(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict, locale_t); + + NORMALIZE_LOCALE(loc); + __wcsnrtombs = loc->__lc_ctype->__wcsnrtombs; + FLOCKFILE(fp); + ORIENT(fp, 1); + if (prepwrite(fp) != 0) + goto error; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + iov.iov_base = buf; + do { + nbytes = __wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf), + &fp->_mbstate, loc); + if (nbytes == (size_t)-1) + goto error; + iov.iov_len = uio.uio_resid = nbytes; + if (__sfvwrite(fp, &uio) != 0) + goto error; + } while (wsp != NULL); + FUNLOCKFILE(fp); + return (0); + +error: + FUNLOCKFILE(fp); + return (-1); +} + +int +fputws(const wchar_t * __restrict ws, FILE * __restrict fp) +{ + return fputws_l(ws, fp, __current_locale()); +} diff --git a/stdio/FreeBSD/fread.3 b/stdio/FreeBSD/fread.3 new file mode 100644 index 0000000..1ba5005 --- /dev/null +++ b/stdio/FreeBSD/fread.3 @@ -0,0 +1,107 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fread.3 8.2 (Berkeley) 3/8/94 +.\" $FreeBSD: src/lib/libc/stdio/fread.3,v 1.10 2007/01/09 00:28:06 imp Exp $ +.\" +.Dd March 8, 1994 +.Dt FREAD 3 +.Os +.Sh NAME +.Nm fread , +.Nm fwrite +.Nd binary stream input/output +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft size_t +.Fn fread "void *restrict ptr" "size_t size" "size_t nitems" \ + "FILE *restrict stream" +.Ft size_t +.Fn fwrite "const void *restrict ptr" "size_t size" "size_t nitems" \ + "FILE *restrict stream" +.Sh DESCRIPTION +The function +.Fn fread +reads +.Fa nitems +objects, each +.Fa size +bytes long, from the stream pointed to by +.Fa stream , +storing them at the location given by +.Fa ptr . +.Pp +The function +.Fn fwrite +writes +.Fa nitems +objects, each +.Fa size +bytes long, to the stream pointed to by +.Fa stream , +obtaining them from the location given by +.Fa ptr . +.Sh RETURN VALUES +The functions +.Fn fread +and +.Fn fwrite +advance the file position indicator for the stream +by the number of bytes read or written. +They return the number of objects read or written. +If an error occurs, or the end-of-file is reached, +the return value is a short object count (or zero). +.Pp +The function +.Fn fread +does not distinguish between end-of-file and error; callers +must use +.Xr feof 3 +and +.Xr ferror 3 +to determine which occurred. +The function +.Fn fwrite +returns a value less than +.Fa nitems +only if a write error has occurred. +.Sh SEE ALSO +.Xr read 2 , +.Xr write 2 +.Sh STANDARDS +The functions +.Fn fread +and +.Fn fwrite +conform to +.St -isoC . diff --git a/stdio/FreeBSD/fread.c b/stdio/FreeBSD/fread.c new file mode 100644 index 0000000..b02257b --- /dev/null +++ b/stdio/FreeBSD/fread.c @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fread.c 8.2 (Berkeley) 12/11/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fread.c,v 1.16 2009/07/12 13:09:43 ed Exp $"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +/* + * MT-safe version + */ + +size_t +fread(void * __restrict buf, size_t size, size_t count, FILE * __restrict fp) +{ + size_t ret; + + FLOCKFILE(fp); + ret = __fread(buf, size, count, fp); + FUNLOCKFILE(fp); + return (ret); +} + +/* + * The maximum amount to read to avoid integer overflow. INT_MAX is odd, + * so it make sense to make it even. We subtract (BUFSIZ - 1) to get a + * whole number of BUFSIZ chunks. + */ +#define MAXREAD (INT_MAX - (BUFSIZ - 1)) + +/* __fread0: int sized, with size = 1 */ +static inline int +__fread0(void * __restrict buf, int count, FILE * __restrict fp) +{ + int resid; + char *p; + int r, ret; + + resid = count; + p = buf; + /* first deal with anything left in buffer, plus any ungetc buffers */ + while (resid > (r = fp->_r)) { + (void)memcpy((void *)p, (void *)fp->_p, (size_t)r); + fp->_p += r; + /* fp->_r = 0 ... done in __srefill */ + p += r; + resid -= r; + if ((ret = __srefill0(fp)) > 0) + break; + else if (ret) { + /* no more input: return partial result */ + return (count - resid); + } + } + /* + * 5980080: don't use optimization if __SMBF not set (meaning setvbuf + * was called, and the buffer belongs to the user). + * 6180417: but for unbuffered (__SMBF is not set), so specifically + * test for it. + */ + if ((fp->_flags & (__SMBF | __SNBF)) && resid > fp->_bf._size) { + struct __sbuf save; + size_t n; + + save = fp->_bf; + fp->_bf._base = (unsigned char *)p; + fp->_bf._size = resid; + while (fp->_bf._size > 0) { + if ((ret = __srefill1(fp)) != 0) { + /* no more input: return partial result */ + resid = fp->_bf._size; + fp->_bf = save; + fp->_p = fp->_bf._base; + /* fp->_r = 0; already set in __srefill1 */ + return (count - resid); + } + fp->_bf._base += fp->_r; + fp->_bf._size -= fp->_r; + } + fp->_bf = save; + n = fp->_bf._size * ((resid - 1) / fp->_bf._size); + r = resid - n; + (void)memcpy((void *)fp->_bf._base, (void *)(p + n), (size_t)r); + fp->_p = fp->_bf._base + r; + fp->_r = 0; + } else { + while (resid > (r = fp->_r)) { + (void)memcpy((void *)p, (void *)fp->_p, (size_t)r); + fp->_p += r; + /* fp->_r = 0 ... done in __srefill */ + p += r; + resid -= r; + if (__srefill1(fp)) { + /* no more input: return partial result */ + return (count - resid); + } + } + (void)memcpy((void *)p, (void *)fp->_p, resid); + fp->_r -= resid; + fp->_p += resid; + } + return (count); +} + +size_t +__fread(void * __restrict buf, size_t size, size_t count, FILE * __restrict fp) +{ + size_t resid; + int r, ret; + size_t total; + + /* + * ANSI and SUSv2 require a return value of 0 if size or count are 0. + */ + if ((resid = count * size) == 0) + return (0); + ORIENT(fp, -1); + if (fp->_r < 0) + fp->_r = 0; + + for (total = resid; resid > 0; buf += r, resid -= r) { + r = resid > INT_MAX ? MAXREAD : (int)resid; + if ((ret = __fread0(buf, r, fp)) != r) { + count = (total - resid + ret) / size; + break; + } + } + return (count); +} diff --git a/stdio/FreeBSD/freopen.c b/stdio/FreeBSD/freopen.c new file mode 100644 index 0000000..b401304 --- /dev/null +++ b/stdio/FreeBSD/freopen.c @@ -0,0 +1,248 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)freopen.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/freopen.c,v 1.21 2008/04/17 22:17:54 jhb Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +/* + * Re-direct an existing, open (probably) file to some other file. + * ANSI is written such that the original file gets closed if at + * all possible, no matter what. + */ +FILE * +freopen(file, mode, fp) + const char * __restrict file; + const char * __restrict mode; + FILE *fp; +{ + int f; + int dflags, flags, isopen, oflags, sverrno, wantfd; + + if ((flags = __sflags(mode, &oflags)) == 0) { + sverrno = errno; + (void) fclose(fp); + errno = sverrno; + return (NULL); + } + + pthread_once(&__sdidinit, __sinit); + + FLOCKFILE(fp); + + /* + * If the filename is a NULL pointer, the caller is asking us to + * re-open the same file with a different mode. We allow this only + * if the modes are compatible. + */ + if (file == NULL) { + /* See comment below regarding freopen() of closed files. */ + if (fp->_flags == 0) { + FUNLOCKFILE(fp); + errno = EINVAL; + return (NULL); + } + if ((dflags = _fcntl(fp->_file, F_GETFL)) < 0) { + sverrno = errno; + fclose(fp); + FUNLOCKFILE(fp); + errno = sverrno; + return (NULL); + } + if ((dflags & O_ACCMODE) != O_RDWR && (dflags & O_ACCMODE) != + (oflags & O_ACCMODE)) { + fclose(fp); + FUNLOCKFILE(fp); + errno = EBADF; + return (NULL); + } + if (fp->_flags & __SWR) + (void) __sflush(fp); + if ((oflags ^ dflags) & O_APPEND) { + dflags &= ~O_APPEND; + dflags |= oflags & O_APPEND; + if (_fcntl(fp->_file, F_SETFL, dflags) < 0) { + sverrno = errno; + fclose(fp); + FUNLOCKFILE(fp); + errno = sverrno; + return (NULL); + } + } + if (oflags & O_TRUNC) + (void) ftruncate(fp->_file, (off_t)0); + if (!(oflags & O_APPEND)) + (void) _sseek(fp, (fpos_t)0, SEEK_SET); + f = fp->_file; + isopen = 0; + wantfd = -1; + goto finish; + } + + /* + * There are actually programs that depend on being able to "freopen" + * descriptors that weren't originally open. Keep this from breaking. + * Remember whether the stream was open to begin with, and which file + * descriptor (if any) was associated with it. If it was attached to + * a descriptor, defer closing it; freopen("/dev/stdin", "r", stdin) + * should work. This is unnecessary if it was not a Unix file. + * + * For UNIX03, we always close if it was open. + */ + if (fp->_flags == 0) { + fp->_flags = __SEOF; /* hold on to it */ + isopen = 0; + wantfd = -1; + } else { + /* flush the stream; ANSI doesn't require this. */ + if (fp->_flags & __SWR) + (void) __sflush(fp); + /* if close is NULL, closing is a no-op, hence pointless */ +#if __DARWIN_UNIX03 + if (fp->_close) + (void) (*fp->_close)(fp->_cookie); + isopen = 0; + wantfd = -1; +#else /* !__DARWIN_UNIX03 */ + isopen = fp->_close != NULL; + if ((wantfd = fp->_file) < 0 && isopen) { + (void) (*fp->_close)(fp->_cookie); + isopen = 0; + } +#endif /* __DARWIN_UNIX03 */ + } + + /* Get a new descriptor to refer to the new file. */ + f = _open(file, oflags, DEFFILEMODE); + if (f < 0 && isopen) { + /* If out of fd's close the old one and try again. */ + if (errno == ENFILE || errno == EMFILE) { + (void) (*fp->_close)(fp->_cookie); + isopen = 0; + f = _open(file, oflags, DEFFILEMODE); + } + } + sverrno = errno; + +finish: + /* + * Finish closing fp. Even if the open succeeded above, we cannot + * keep fp->_base: it may be the wrong size. This loses the effect + * of any setbuffer calls, but stdio has always done this before. + */ + if (isopen) + (void) (*fp->_close)(fp->_cookie); + if (fp->_flags & __SMBF) + free((char *)fp->_bf._base); + fp->_w = 0; + fp->_r = 0; + fp->_p = NULL; + fp->_bf._base = NULL; + fp->_bf._size = 0; + fp->_lbfsize = 0; + if (HASUB(fp)) + FREEUB(fp); + fp->_ub._size = 0; + if (HASLB(fp)) + FREELB(fp); + fp->_lb._size = 0; + fp->_orientation = 0; + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + + if (f < 0) { /* did not get it after all */ + FUNLOCKFILE(fp); + __sfprelease(fp); /* set it free */ + errno = sverrno; /* restore in case _close clobbered */ + return (NULL); + } + + /* + * If reopening something that was open before on a real file, try + * to maintain the descriptor. Various C library routines (perror) + * assume stderr is always fd STDERR_FILENO, even if being freopen'd. + */ + if (wantfd >= 0 && f != wantfd) { + if (_dup2(f, wantfd) >= 0) { + (void)_close(f); + f = wantfd; + } + } + + /* + * File descriptors are a full int, but _file is only a short. + * If we get a valid file descriptor that is greater than + * SHRT_MAX, then the fd will get sign-extended into an + * invalid file descriptor. Handle this case by failing the + * open. + */ + if (f > SHRT_MAX) { + FUNLOCKFILE(fp); + __sfprelease(fp); /* set it free */ + errno = EMFILE; + return (NULL); + } + + fp->_flags = flags; + fp->_file = f; + fp->_cookie = fp; + fp->_read = __sread; + fp->_write = __swrite; + fp->_seek = __sseek; + fp->_close = __sclose; + /* + * When opening in append mode, even though we use O_APPEND, + * we need to seek to the end so that ftell() gets the right + * answer. If the user then alters the seek pointer, or + * the file extends, this will fail, but there is not much + * we can do about this. (We could set __SAPP and check in + * fseek and ftell.) + */ + if (oflags & O_APPEND) + (void) _sseek(fp, (fpos_t)0, SEEK_END); + FUNLOCKFILE(fp); + return (fp); +} diff --git a/stdio/FreeBSD/fscanf.c b/stdio/FreeBSD/fscanf.c new file mode 100644 index 0000000..2db747e --- /dev/null +++ b/stdio/FreeBSD/fscanf.c @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fscanf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fscanf.c,v 1.13 2007/01/09 00:28:06 imp Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +int +fscanf(FILE * __restrict fp, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + FLOCKFILE(fp); + ret = __svfscanf_l(fp, __current_locale(), fmt, ap); + va_end(ap); + FUNLOCKFILE(fp); + return (ret); +} + +int +fscanf_l(FILE * __restrict fp, locale_t loc, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + NORMALIZE_LOCALE(loc); + va_start(ap, fmt); + FLOCKFILE(fp); + ret = __svfscanf_l(fp, loc, fmt, ap); + va_end(ap); + FUNLOCKFILE(fp); + return (ret); +} diff --git a/stdio/FreeBSD/fseek.3 b/stdio/FreeBSD/fseek.3 new file mode 100644 index 0000000..edf7791 --- /dev/null +++ b/stdio/FreeBSD/fseek.3 @@ -0,0 +1,305 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)fseek.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/fseek.3,v 1.27 2007/06/18 02:13:04 ache Exp $ +.\" +.Dd March 19, 2004 +.Dt FSEEK 3 +.Os +.Sh NAME +.Nm fgetpos , +.Nm fseek , +.Nm fseeko , +.Nm fsetpos , +.Nm ftell , +.Nm ftello , +.Nm rewind +.Nd reposition a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fo fgetpos +.Fa "FILE *restrict stream" +.Fa "fpos_t *restrict pos" +.Fc +.Ft int +.Fo fseek +.Fa "FILE *stream" +.Fa "long offset" +.Fa "int whence" +.Fc +.Ft int +.Fo fseeko +.Fa "FILE *stream" +.Fa "off_t offset" +.Fa "int whence" +.Fc +.Ft int +.Fo fsetpos +.Fa "FILE *stream" +.Fa "const fpos_t *pos" +.Fc +.Ft long +.Fo ftell +.Fa "FILE *stream" +.Fc +.Ft off_t +.Fo ftello +.Fa "FILE *stream" +.Fc +.Ft void +.Fo rewind +.Fa "FILE *stream" +.Fc +.Sh DESCRIPTION +The +.Fn fseek +function sets the file position indicator for the stream pointed +to by +.Fa stream . +The new position, measured in bytes, is obtained by adding +.Fa offset +bytes to the position specified by +.Fa whence . +If +.Fa whence +is set to +.Dv SEEK_SET , +.Dv SEEK_CUR , +or +.Dv SEEK_END , +the offset is relative to the +start of the file, the current position indicator, or end-of-file, +respectively. +A successful call to the +.Fn fseek +function clears the end-of-file indicator for the stream and undoes +any effects of the +.Xr ungetc 3 +and +.Xr ungetwc 3 +functions on the same stream. +.Pp +The +.Fn ftell +function +obtains the current value of the file position indicator for the +stream pointed to by +.Fa stream . +.Pp +The +.Fn rewind +function sets the file position indicator for the stream pointed +to by +.Fa stream +to the beginning of the file. +It is equivalent to: +.Pp +.Dl (void)fseek(stream, 0L, SEEK_SET) +.Pp +except that the error indicator for the stream is also cleared +(see +.Xr clearerr 3 ) . +.Pp +Since +.Fn rewind +does not return a value, +an application wishing to detect errors should clear +.Va errno , +then call +.Fn rewind , +and if +.Va errno +is non-zero, assume an error has occurred. +.Pp +The +.Fn fseeko +function is identical to +.Fn fseek , +except it takes an +.Fa off_t +argument +instead of a +.Fa long . +Likewise, the +.Fn ftello +function is identical to +.Fn ftell , +except it returns an +.Fa off_t . +.Pp +The +.Fn fgetpos +and +.Fn fsetpos +functions +are alternate interfaces for retrieving and setting the current position in +the file, similar to +.Fn ftell +and +.Fn fseek , +except that the current position is stored in an opaque object of +type +.Vt fpos_t +pointed to by +.Fa pos . +These functions provide a portable way to seek to offsets larger than +those that can be represented by a +.Vt long int . +They may also store additional state information in the +.Vt fpos_t +object to facilitate seeking within files containing multibyte +characters with state-dependent encodings. +Although +.Vt fpos_t +has traditionally been an integral type, +applications cannot assume that it is; +in particular, they must not perform arithmetic on objects +of this type. +.Pp +If the stream is a wide character stream (see +.Xr fwide 3 ) , +the position specified by the combination of +.Fa offset +and +.Fa whence +must contain the first byte of a multibyte sequence. +.Sh RETURN VALUES +The +.Fn rewind +function +returns no value. +.Pp +.Rv -std fgetpos fseek fseeko fsetpos +.Pp +Upon successful completion, +.Fn ftell +and +.Fn ftello +return the current offset. +Otherwise, \-1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa stream +argument +is not a seekable stream. +.It Bq Er EINVAL +The +.Fa whence +argument is invalid or +the resulting file-position +indicator would be set to a negative value. +.It Bq Er EOVERFLOW +The resulting file offset would be a value which +cannot be represented correctly in an object of type +.Fa off_t +for +.Fn fseeko +and +.Fn ftello +or +.Fa long +for +.Fn fseek +and +.Fn ftell . +.It Bq Er ESPIPE +The file descriptor underlying stream is associated with a pipe or FIFO +or file-position indicator value is unspecified +(see +.Xr ungetc 3 ) . +.El +.Pp +The functions +.Fn fgetpos , +.Fn fseek , +.Fn fseeko , +.Fn fsetpos , +.Fn ftell , +.Fn ftello , +and +.Fn rewind +may also fail and set +.Va errno +for any of the errors specified for the routines +.Xr fflush 3 , +.Xr fstat 2 , +.Xr lseek 2 , +and +.Xr malloc 3 . +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +.Ft int +.br +.Fo fseeko +.Fa "FILE *stream" +.Fa "off_t offset" +.Fa "int whence" +.Fc ; +.Pp +The include file +.In sys/types.h +supplies the definition for +.Vt off_t . +.Sh SEE ALSO +.Xr lseek 2 , +.Xr clearerr 3 , +.Xr fwide 3 , +.Xr ungetc 3 , +.Xr ungetwc 3 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn fgetpos , +.Fn fsetpos , +.Fn fseek , +.Fn ftell , +and +.Fn rewind +functions +conform to +.St -isoC . +.Pp +The +.Fn fseeko +and +.Fn ftello +functions conform to +.St -p1003.1-2001 . diff --git a/stdio/FreeBSD/fseek.c b/stdio/FreeBSD/fseek.c new file mode 100644 index 0000000..9f45c9b --- /dev/null +++ b/stdio/FreeBSD/fseek.c @@ -0,0 +1,309 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fseek.c 8.3 (Berkeley) 1/2/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fseek.c,v 1.44 2008/04/17 22:17:54 jhb Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +#define POS_ERR (-(fpos_t)1) + +int +fseek(fp, offset, whence) + FILE *fp; + long offset; + int whence; +{ + int ret; + int serrno = errno; + + /* make sure stdio is set up */ + pthread_once(&__sdidinit, __sinit); + + FLOCKFILE(fp); + ret = _fseeko(fp, (off_t)offset, whence, 1); + FUNLOCKFILE(fp); + if (ret == 0) + errno = serrno; + return (ret); +} + +int +fseeko(fp, offset, whence) + FILE *fp; + off_t offset; + int whence; +{ + int ret; + int serrno = errno; + + /* make sure stdio is set up */ + pthread_once(&__sdidinit, __sinit); + + FLOCKFILE(fp); + ret = _fseeko(fp, offset, whence, 0); + FUNLOCKFILE(fp); + if (ret == 0) + errno = serrno; + return (ret); +} + +/* + * Seek the given file to the given offset. + * `Whence' must be one of the three SEEK_* macros. + */ +int +_fseeko(fp, offset, whence, ltest) + FILE *fp; + off_t offset; + int whence; + int ltest; +{ + fpos_t (*seekfn)(void *, fpos_t, int); + fpos_t target, curoff, ret; + size_t n; + struct stat st; + int havepos; + + /* + * Have to be able to seek. + */ + if ((seekfn = fp->_seek) == NULL) { + errno = ESPIPE; /* historic practice */ + return (-1); + } + + /* + * Change any SEEK_CUR to SEEK_SET, and check `whence' argument. + * After this, whence is either SEEK_SET or SEEK_END. + */ + switch (whence) { + + case SEEK_CUR: + /* + * In order to seek relative to the current stream offset, + * we have to first find the current stream offset via + * ftell (see ftell for details). + */ + if (_ftello(fp, &curoff)) + return (-1); + if (curoff < 0) { + /* Unspecified position because of ungetc() at 0 */ + errno = ESPIPE; + return (-1); + } + if (offset > 0 && curoff > OFF_MAX - offset) { + errno = EOVERFLOW; + return (-1); + } + offset += curoff; + if (offset < 0) { + errno = EINVAL; + return (-1); + } + if (ltest && offset > LONG_MAX) { + errno = EOVERFLOW; + return (-1); + } + whence = SEEK_SET; + havepos = 1; + break; + + case SEEK_SET: + if (offset < 0) { + errno = EINVAL; + return (-1); + } + case SEEK_END: + curoff = 0; /* XXX just to keep gcc quiet */ + havepos = 0; + break; + + default: + errno = EINVAL; + return (-1); + } + + /* + * Can only optimise if: + * reading (and not reading-and-writing); + * not unbuffered; and + * this is a `regular' Unix file (and hence seekfn==__sseek). + * We must check __NBF first, because it is possible to have __NBF + * and __SOPT both set. + */ + if (fp->_bf._base == NULL) + __smakebuf(fp); + if (fp->_flags & (__SWR | __SRW | __SNBF | __SNPT)) + goto dumb; + if ((fp->_flags & __SOPT) == 0) { + if (seekfn != __sseek || + fp->_file < 0 || _fstat(fp->_file, &st) || + (st.st_mode & S_IFMT) != S_IFREG) { + fp->_flags |= __SNPT; + goto dumb; + } + fp->_blksize = st.st_blksize; + fp->_flags |= __SOPT; + } + + /* + * We are reading; we can try to optimise. + * Figure out where we are going and where we are now. + */ + if (whence == SEEK_SET) + target = offset; + else { + if (_fstat(fp->_file, &st)) + goto dumb; + if (offset > 0 && st.st_size > OFF_MAX - offset) { + errno = EOVERFLOW; + return (-1); + } + target = st.st_size + offset; + if ((off_t)target < 0) { + errno = EINVAL; + return (-1); + } + if (ltest && (off_t)target > LONG_MAX) { + errno = EOVERFLOW; + return (-1); + } + } + + if (!havepos && _ftello(fp, &curoff)) + goto dumb; + + /* + * (If the buffer was modified, we have to + * skip this; see fgetln.c.) + */ + if (fp->_flags & __SMOD) + goto abspos; + + /* + * Compute the number of bytes in the input buffer (pretending + * that any ungetc() input has been discarded). Adjust current + * offset backwards by this count so that it represents the + * file offset for the first byte in the current input buffer. + */ + if (HASUB(fp)) { + curoff += fp->_r; /* kill off ungetc */ + n = fp->_up - fp->_bf._base; + curoff -= n; + n += fp->_ur; + } else { + n = fp->_p - fp->_bf._base; + curoff -= n; + n += fp->_r; + } + + /* + * If the target offset is within the current buffer, + * simply adjust the pointers, clear EOF, undo ungetc(), + * and return. + */ + if (target >= curoff && target < curoff + n) { + size_t o = target - curoff; + + fp->_p = fp->_bf._base + o; + fp->_r = n - o; + if (HASUB(fp)) + FREEUB(fp); + fp->_flags &= ~__SEOF; + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + return (0); + } + +abspos: + /* + * The place we want to get to is not within the current buffer, + * but we can still be kind to the kernel copyout mechanism. + * By aligning the file offset to a block boundary, we can let + * the kernel use the VM hardware to map pages instead of + * copying bytes laboriously. Using a block boundary also + * ensures that we only read one block, rather than two. + */ + curoff = target & ~(fp->_blksize - 1); + if (_sseek(fp, curoff, SEEK_SET) == POS_ERR) + goto dumb; + fp->_r = 0; + fp->_p = fp->_bf._base; + if (HASUB(fp)) + FREEUB(fp); + n = target - curoff; + if (n) { + if (__srefill(fp) || fp->_r < n) + goto dumb; + fp->_p += n; + fp->_r -= n; + } + fp->_flags &= ~__SEOF; + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + return (0); + + /* + * We get here if we cannot optimise the seek ... just + * do it. Allow the seek function to change fp->_bf._base. + */ +dumb: + if (__sflush(fp) || + (ret = _sseek(fp, (fpos_t)offset, whence)) == POS_ERR) + return (-1); + if (ltest && ret > LONG_MAX) { + fp->_flags |= __SERR; + errno = EOVERFLOW; + return (-1); + } + /* success: clear EOF indicator and discard ungetc() data */ + if (HASUB(fp)) + FREEUB(fp); + fp->_p = fp->_bf._base; + fp->_r = 0; + /* fp->_w = 0; */ /* unnecessary (I think...) */ + fp->_flags &= ~__SEOF; + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + return (0); +} diff --git a/stdio/FreeBSD/fsetpos.c b/stdio/FreeBSD/fsetpos.c new file mode 100644 index 0000000..6d9bddf --- /dev/null +++ b/stdio/FreeBSD/fsetpos.c @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fsetpos.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fsetpos.c,v 1.9 2007/01/09 00:28:06 imp Exp $"); + +#include +#include + +/* + * fsetpos: like fseek. + */ +int +fsetpos(iop, pos) + FILE *iop; + const fpos_t *pos; +{ + return (fseeko(iop, (off_t)*pos, SEEK_SET)); +} diff --git a/stdio/FreeBSD/ftell.c b/stdio/FreeBSD/ftell.c new file mode 100644 index 0000000..8bb5716 --- /dev/null +++ b/stdio/FreeBSD/ftell.c @@ -0,0 +1,141 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ftell.c 8.2 (Berkeley) 5/4/95"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/ftell.c,v 1.27 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +/* + * standard ftell function. + */ +long +ftell(fp) + FILE *fp; +{ + off_t rv; + + rv = ftello(fp); + if (rv > LONG_MAX) { + errno = EOVERFLOW; + return (-1); + } + return (rv); +} + +/* + * ftello: return current offset. + */ +off_t +ftello(fp) + FILE *fp; +{ + fpos_t rv; + int ret; + + FLOCKFILE(fp); + ret = _ftello(fp, &rv); + FUNLOCKFILE(fp); + if (ret) + return (-1); + if (rv < 0) { /* Unspecified value because of ungetc() at 0 */ + errno = ESPIPE; + return (-1); + } + return (rv); +} + +int +_ftello(fp, offset) + FILE *fp; + fpos_t *offset; +{ + fpos_t pos; + size_t n; + + if (fp->_seek == NULL) { + errno = ESPIPE; /* historic practice */ + return (1); + } + + /* + * Find offset of underlying I/O object, then + * adjust for buffered bytes. + */ + if (__sflush(fp)) /* may adjust seek offset on append stream */ + return (1); + if (fp->_flags & __SOFF) + pos = fp->_offset; + else { + pos = _sseek(fp, (fpos_t)0, SEEK_CUR); + if (pos == -1) + return (1); + } + if (fp->_flags & __SRD) { + /* + * Reading. Any unread characters (including + * those from ungetc) cause the position to be + * smaller than that in the underlying object. + */ + if ((pos -= (HASUB(fp) ? fp->_ur : fp->_r)) < 0) { + fp->_flags |= __SERR; + errno = EIO; + return (1); + } + if (HASUB(fp)) + pos -= fp->_r; /* Can be negative at this point. */ + } else if ((fp->_flags & __SWR) && fp->_p != NULL) { + /* + * Writing. Any buffered characters cause the + * position to be greater than that in the + * underlying object. + */ + n = fp->_p - fp->_bf._base; + if (pos > OFF_MAX - n) { + errno = EOVERFLOW; + return (1); + } + pos += n; + } + *offset = pos; + return (0); +} diff --git a/stdio/FreeBSD/funopen.3 b/stdio/FreeBSD/funopen.3 new file mode 100644 index 0000000..f4a3f1c --- /dev/null +++ b/stdio/FreeBSD/funopen.3 @@ -0,0 +1,176 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)funopen.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/stdio/funopen.3,v 1.16 2007/01/09 00:28:06 imp Exp $ +.\" +.Dd March 19, 2004 +.Dt FUNOPEN 3 +.Os +.Sh NAME +.Nm funopen , +.Nm fropen , +.Nm fwopen +.Nd open a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft FILE * +.Fn funopen "const void *cookie" "int (*readfn)(void *, char *, int)" "int (*writefn)(void *, const char *, int)" "fpos_t (*seekfn)(void *, fpos_t, int)" "int (*closefn)(void *)" +.Ft FILE * +.Fn fropen "void *cookie" "int (*readfn)(void *, char *, int)" +.Ft FILE * +.Fn fwopen "void *cookie" "int (*writefn)(void *, const char *, int)" +.Sh DESCRIPTION +The +.Fn funopen +function +associates a stream with up to four +.Dq Tn I/O No functions . +Either +.Fa readfn +or +.Fa writefn +must be specified; +the others can be given as an appropriately-typed +.Dv NULL +pointer. +These +.Tn I/O +functions will be used to read, write, seek and +close the new stream. +.Pp +In general, omitting a function means that any attempt to perform the +associated operation on the resulting stream will fail. +If the close function is omitted, closing the stream will flush +any buffered output and then succeed. +.Pp +The calling conventions of +.Fa readfn , +.Fa writefn , +.Fa seekfn +and +.Fa closefn +must match those, respectively, of +.Xr read 2 , +.Xr write 2 , +.Xr lseek 2 , +and +.Xr close 2 +with the single exception that they are passed the +.Fa cookie +argument specified to +.Fn funopen +in place of the traditional file descriptor argument. +.Pp +Read and write +.Tn I/O +functions are allowed to change the underlying buffer +on fully buffered or line buffered streams by calling +.Xr setvbuf 3 . +They are also not required to completely fill or empty the buffer. +They are not, however, allowed to change streams from unbuffered to buffered +or to change the state of the line buffering flag. +They must also be prepared to have read or write calls occur on buffers other +than the one most recently specified. +.Pp +All user +.Tn I/O +functions can report an error by returning \-1. +Additionally, all of the functions should set the external variable +.Va errno +appropriately if an error occurs. +.Pp +An error on +.Fn closefn +does not keep the stream open. +.Pp +As a convenience, the include file +.In stdio.h +defines the macros +.Fn fropen +and +.Fn fwopen +as calls to +.Fn funopen +with only a read or write function specified. +.Sh RETURN VALUES +Upon successful completion, +.Fn funopen +returns a +.Dv FILE +pointer. +Otherwise, +.Dv NULL +is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fn funopen +function +was called without either a read or write function. +The +.Fn funopen +function +may also fail and set +.Va errno +for any of the errors +specified for the routine +.Xr malloc 3 . +.El +.Sh SEE ALSO +.Xr fcntl 2 , +.Xr open 2 , +.Xr fclose 3 , +.Xr fopen 3 , +.Xr fseek 3 , +.Xr setbuf 3 +.Sh HISTORY +The +.Fn funopen +functions first appeared in +.Bx 4.4 . +.Sh BUGS +The +.Fn funopen +function +may not be portable to systems other than +.Bx . +.Pp +The +.Fn funopen +interface erroneously assumes that +.Vt fpos_t +is an integral type; see +.Xr fseek 3 +for a discussion of this issue. diff --git a/stdio/FreeBSD/funopen.c b/stdio/FreeBSD/funopen.c new file mode 100644 index 0000000..408f0f4 --- /dev/null +++ b/stdio/FreeBSD/funopen.c @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)funopen.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/funopen.c,v 1.7 2009/12/05 19:31:38 ed Exp $"); + +#include +#include + +#include "local.h" + +FILE * +funopen(const void *cookie, + int (*readfn)(void *, char *, int), + int (*writefn)(void *, const char *, int), + fpos_t (*seekfn)(void *, fpos_t, int), + int (*closefn)(void *)) +{ + FILE *fp; + int flags; + + if (readfn == NULL) { + if (writefn == NULL) { /* illegal */ + errno = EINVAL; + return (NULL); + } else + flags = __SWR; /* write only */ + } else { + if (writefn == NULL) + flags = __SRD; /* read only */ + else + flags = __SRW; /* read-write */ + } + /* funopen in not covered in SUSv3, so never count the streams */ + if ((fp = __sfp(0)) == NULL) + return (NULL); + fp->_flags = flags; + fp->_file = -1; + fp->_cookie = (void *)cookie; + fp->_read = readfn; + fp->_write = writefn; + fp->_seek = seekfn; + fp->_close = closefn; + return (fp); +} diff --git a/stdio/FreeBSD/fvwrite.c b/stdio/FreeBSD/fvwrite.c new file mode 100644 index 0000000..719c120 --- /dev/null +++ b/stdio/FreeBSD/fvwrite.c @@ -0,0 +1,207 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fvwrite.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fvwrite.c,v 1.19 2009/11/25 04:21:42 wollman Exp $"); + +#include +#include +#include +#include "local.h" +#include "fvwrite.h" + +/* + * Write some memory regions. Return zero on success, EOF on error. + * + * This routine is large and unsightly, but most of the ugliness due + * to the three different kinds of output buffering is handled here. + */ +int +__sfvwrite(fp, uio) + FILE *fp; + struct __suio *uio; +{ + size_t len; + char *p; + struct __siov *iov; + int w, s; + char *nl; + int nlknown, nldist; + + if (uio->uio_resid == 0) + return (0); + /* make sure we can write */ + if (prepwrite(fp) != 0) + return (EOF); + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define COPY(n) (void)memcpy((void *)fp->_p, (void *)p, (size_t)(n)) + + iov = uio->uio_iov; + p = iov->iov_base; + len = iov->iov_len; + iov++; +#define GETIOV(extra_work) \ + while (len == 0) { \ + extra_work; \ + p = iov->iov_base; \ + len = iov->iov_len; \ + iov++; \ + } + if (fp->_flags & __SNBF) { + /* + * Unbuffered: write up to BUFSIZ bytes at a time. + */ + do { + GETIOV(;); + w = _swrite(fp, p, MIN(len, BUFSIZ)); + if (w <= 0) + goto err; + p += w; + len -= w; + } while ((uio->uio_resid -= w) != 0); + } else if ((fp->_flags & __SLBF) == 0) { + /* + * Fully buffered: fill partially full buffer, if any, + * and then flush. If there is no partial buffer, write + * one _bf._size byte chunk directly (without copying). + * + * String output is a special case: write as many bytes + * as fit, but pretend we wrote everything. This makes + * snprintf() return the number of bytes needed, rather + * than the number used, and avoids its write function + * (so that the write function can be invalid). + */ + do { + GETIOV(;); + if ((fp->_flags & (__SALC | __SSTR)) == + (__SALC | __SSTR) && fp->_w < len) { + size_t blen = fp->_p - fp->_bf._base; + + /* + * Alloc an extra 128 bytes (+ 1 for NULL) + * so we don't call realloc(3) so often. + */ + fp->_w = len + 128; + fp->_bf._size = blen + len + 128; + fp->_bf._base = + reallocf(fp->_bf._base, fp->_bf._size + 1); + if (fp->_bf._base == NULL) + goto err; + fp->_p = fp->_bf._base + blen; + } + w = fp->_w; + if (fp->_flags & __SSTR) { + if (len < w) + w = len; + if (w > 0) { + COPY(w); /* copy MIN(fp->_w,len), */ + fp->_w -= w; + fp->_p += w; + } + w = len; /* but pretend copied all */ + } else if (fp->_p > fp->_bf._base && len > w) { + /* fill and flush */ + COPY(w); + /* fp->_w -= w; */ /* unneeded */ + fp->_p += w; + if (__fflush(fp)) + goto err; + } else if (len >= (w = fp->_bf._size)) { + /* write directly */ + w = _swrite(fp, p, w); + if (w <= 0) + goto err; + } else { + /* fill and done */ + w = len; + COPY(w); + fp->_w -= w; + fp->_p += w; + } + p += w; + len -= w; + } while ((uio->uio_resid -= w) != 0); + } else { + /* + * Line buffered: like fully buffered, but we + * must check for newlines. Compute the distance + * to the first newline (including the newline), + * or `infinity' if there is none, then pretend + * that the amount to write is MIN(len,nldist). + */ + nlknown = 0; + nldist = 0; /* XXX just to keep gcc happy */ + do { + GETIOV(nlknown = 0); + if (!nlknown) { + nl = memchr((void *)p, '\n', len); + nldist = nl ? nl + 1 - p : len + 1; + nlknown = 1; + } + s = MIN(len, nldist); + w = fp->_w + fp->_bf._size; + if (fp->_p > fp->_bf._base && s > w) { + COPY(w); + /* fp->_w -= w; */ + fp->_p += w; + if (__fflush(fp)) + goto err; + } else if (s >= (w = fp->_bf._size)) { + w = _swrite(fp, p, w); + if (w <= 0) + goto err; + } else { + w = s; + COPY(w); + fp->_w -= w; + fp->_p += w; + } + if ((nldist -= w) == 0) { + /* copied the newline: flush and forget */ + if (__fflush(fp)) + goto err; + nlknown = 0; + } + p += w; + len -= w; + } while ((uio->uio_resid -= w) != 0); + } + return (0); + +err: + fp->_flags |= __SERR; + return (EOF); +} diff --git a/stdio/FreeBSD/fvwrite.h b/stdio/FreeBSD/fvwrite.h new file mode 100644 index 0000000..45a0382 --- /dev/null +++ b/stdio/FreeBSD/fvwrite.h @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)fvwrite.h 8.1 (Berkeley) 6/4/93 + * $FreeBSD: src/lib/libc/stdio/fvwrite.h,v 1.4 2007/01/09 00:28:06 imp Exp $ + */ + +/* + * I/O descriptors for __sfvwrite(). + */ +struct __siov { + void *iov_base; + size_t iov_len; +}; +struct __suio { + struct __siov *uio_iov; + int uio_iovcnt; + int uio_resid; +}; + +extern int __sfvwrite(FILE *, struct __suio *); diff --git a/stdio/FreeBSD/fwalk.c b/stdio/FreeBSD/fwalk.c new file mode 100644 index 0000000..10d93d9 --- /dev/null +++ b/stdio/FreeBSD/fwalk.c @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fwalk.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fwalk.c,v 1.10 2007/01/09 00:28:06 imp Exp $"); + +#include +#include +#include +#include "local.h" +#include "glue.h" + +int +_fwalk(function) + int (*function)(FILE *); +{ + FILE *fp; + int n, ret; + struct glue *g; + + ret = 0; + /* + * It should be safe to walk the list without locking it; + * new nodes are only added to the end and none are ever + * removed. + * + * Avoid locking this list while walking it or else you will + * introduce a potential deadlock in [at least] refill.c. + */ + for (g = &__sglue; g != NULL; g = g->next) + for (fp = g->iobs, n = g->niobs; --n >= 0; fp++) + if ((fp->_flags != 0) && ((fp->_flags & __SIGN) == 0)) + ret |= (*function)(fp); + return (ret); +} diff --git a/stdio/FreeBSD/fwide.3 b/stdio/FreeBSD/fwide.3 new file mode 100644 index 0000000..93163f3 --- /dev/null +++ b/stdio/FreeBSD/fwide.3 @@ -0,0 +1,99 @@ +.\" $NetBSD: fwide.3,v 1.3 2002/02/07 07:00:25 ross Exp $ +.\" +.\" Copyright (c)2001 Citrus Project, +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Citrus: xpg4dl/FreeBSD/lib/libc/stdio/fwide.3,v 1.2 2001/12/07 04:47:08 yamt Exp $ +.\" $FreeBSD: src/lib/libc/stdio/fwide.3,v 1.3 2002/12/18 12:45:10 ru Exp $ +.\" +.Dd October 24, 2001 +.Dt FWIDE 3 +.Os +.Sh NAME +.Nm fwide +.Nd get/set orientation of a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft int +.Fn fwide "FILE *stream" "int mode" +.Sh DESCRIPTION +The +.Fn fwide +function +determines the orientation of the stream pointed at by +.Fa stream . +.Pp +If the orientation of +.Fa stream +has already been determined, +.Fn fwide +leaves it unchanged. +Otherwise, +.Fn fwide +sets the orientation of +.Fa stream +according to +.Fa mode . +.Pp +If +.Fa mode +is less than zero, +.Fa stream +is set to be byte-oriented. +If +.Fa mode +is greater than zero, +.Fa stream +is set to be wide-oriented. +Otherwise, +.Fa mode +is zero, and +.Fa stream +is unchanged. +.Sh RETURN VALUES +The +.Fn fwide +function +returns a value according to orientation after the call of +.Fn fwide ; +a value less than zero if byte-oriented, a value greater than zero +if wide-oriented, and zero if the stream has no orientation. +.Sh SEE ALSO +.Xr ferror 3 , +.Xr fgetc 3 , +.Xr fgetwc 3 , +.Xr fopen 3 , +.Xr fputc 3 , +.Xr fputwc 3 , +.Xr freopen 3 , +.Xr stdio 3 +.Sh STANDARDS +The +.Fn fwide +function +conforms to +.St -isoC-99 . diff --git a/stdio/FreeBSD/fwide.c b/stdio/FreeBSD/fwide.c new file mode 100644 index 0000000..c19aa5c --- /dev/null +++ b/stdio/FreeBSD/fwide.c @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fwide.c,v 1.2 2008/04/17 22:17:54 jhb Exp $"); + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +int +fwide(FILE *fp, int mode) +{ + int m; + + FLOCKFILE(fp); + /* Only change the orientation if the stream is not oriented yet. */ + if (mode != 0 && fp->_orientation == 0) + fp->_orientation = mode > 0 ? 1 : -1; + m = fp->_orientation; + FUNLOCKFILE(fp); + + return (m); +} diff --git a/stdio/FreeBSD/fwprintf.c b/stdio/FreeBSD/fwprintf.c new file mode 100644 index 0000000..5fefd4a --- /dev/null +++ b/stdio/FreeBSD/fwprintf.c @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fwprintf.c,v 1.1 2002/09/21 13:00:30 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +int +fwprintf(FILE * __restrict fp, const wchar_t * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vfwprintf_l(fp, __current_locale(), fmt, ap); + va_end(ap); + + return (ret); +} + +int +fwprintf_l(FILE * __restrict fp, locale_t loc, const wchar_t * __restrict fmt, ...) +{ + int ret; + va_list ap; + + /* no need to call NORMALIZE_LOCALE(loc) because vfwprintf_l will */ + va_start(ap, fmt); + ret = vfwprintf_l(fp, loc, fmt, ap); + va_end(ap); + + return (ret); +} diff --git a/stdio/FreeBSD/fwrite.c b/stdio/FreeBSD/fwrite.c new file mode 100644 index 0000000..09eae83 --- /dev/null +++ b/stdio/FreeBSD/fwrite.c @@ -0,0 +1,99 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fwrite.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fwrite.c,v 1.13 2009/07/12 13:09:43 ed Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "local.h" +#include "fvwrite.h" +#include "libc_private.h" + +/* + * The maximum amount to write to avoid integer overflow (especially for + * uio_resid in struct __suio). INT_MAX is odd, so it make sense to make it + * even. We subtract (BUFSIZ - 1) to get a whole number of BUFSIZ chunks. + */ +#define MAXWRITE (INT_MAX - (BUFSIZ - 1)) + +/* + * Write `count' objects (each size `size') from memory to the given file. + * Return the number of whole objects written. + */ +size_t +fwrite(buf, size, count, fp) + const void * __restrict buf; + size_t size, count; + FILE * __restrict fp; +{ + size_t n, resid; + struct __suio uio; + struct __siov iov; + int s; + + /* + * ANSI and SUSv2 require a return value of 0 if size or count are 0. + */ + n = count * size; +#if __DARWIN_UNIX03 + if (n == 0) + return (0); +#endif + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + + FLOCKFILE(fp); + ORIENT(fp, -1); + + for (resid = n; resid > 0; buf += s, resid -= s) { + s = resid > INT_MAX ? MAXWRITE : (int)resid; + iov.iov_base = (void *)buf; + uio.uio_resid = iov.iov_len = s; + + /* + * The usual case is success (__sfvwrite returns 0); + * skip the divide if this happens, since divides are + * generally slow and since this occurs whenever size==0. + */ + if (__sfvwrite(fp, &uio) != 0) { + count = (n - resid + s - uio.uio_resid) / size; + break; + } + } + FUNLOCKFILE(fp); + return (count); +} diff --git a/stdio/FreeBSD/fwscanf.c b/stdio/FreeBSD/fwscanf.c new file mode 100644 index 0000000..4fefaea --- /dev/null +++ b/stdio/FreeBSD/fwscanf.c @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/fwscanf.c,v 1.1 2002/09/23 12:40:06 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +int +fwscanf(FILE * __restrict fp, const wchar_t * __restrict fmt, ...) +{ + va_list ap; + int r; + + va_start(ap, fmt); + r = vfwscanf_l(fp, __current_locale(), fmt, ap); + va_end(ap); + + return (r); +} + +int +fwscanf_l(FILE * __restrict fp, locale_t loc, const wchar_t * __restrict fmt, ...) +{ + va_list ap; + int r; + + /* no need to call NORMALIZE_LOCALE(loc) because vfwscanf_l will */ + va_start(ap, fmt); + r = vfwscanf_l(fp, loc, fmt, ap); + va_end(ap); + + return (r); +} diff --git a/stdio/FreeBSD/getc.3 b/stdio/FreeBSD/getc.3 new file mode 100644 index 0000000..b1c114b --- /dev/null +++ b/stdio/FreeBSD/getc.3 @@ -0,0 +1,170 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getc.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/getc.3,v 1.21 2007/01/09 00:28:06 imp Exp $ +.\" +.Dd January 10, 2003 +.Dt GETC 3 +.Os +.Sh NAME +.Nm fgetc , +.Nm getc , +.Nm getc_unlocked , +.Nm getchar , +.Nm getchar_unlocked , +.Nm getw +.Nd get next character or word from input stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn fgetc "FILE *stream" +.Ft int +.Fn getc "FILE *stream" +.Ft int +.Fn getc_unlocked "FILE *stream" +.Ft int +.Fn getchar "void" +.Ft int +.Fn getchar_unlocked "void" +.Ft int +.Fn getw "FILE *stream" +.Sh DESCRIPTION +The +.Fn fgetc +function +obtains the next input character (if present) from the stream pointed at by +.Fa stream , +or the next character pushed back on the stream via +.Xr ungetc 3 . +.Pp +The +.Fn getc +function +acts essentially identically to +.Fn fgetc , +but is a macro that expands in-line. +.Pp +The +.Fn getchar +function +is equivalent to +.Fn getc stdin . +.Pp +The +.Fn getw +function +obtains the next +.Vt int +(if present) +from the stream pointed at by +.Fa stream . +.Pp +The +.Fn getc_unlocked +and +.Fn getchar_unlocked +functions are equivalent to +.Fn getc +and +.Fn getchar +respectively, +except that the caller is responsible for locking the stream +with +.Xr flockfile 3 +before calling them. +These functions may be used to avoid the overhead of locking the stream +for each character, and to avoid input being dispersed among multiple +threads reading from the same stream. +.Sh RETURN VALUES +If successful, these routines return the next requested object +from the +.Fa stream . +Character values are returned as an +.Vt "unsigned char" +converted to an +.Vt int . +If the stream is at end-of-file or a read error occurs, +the routines return +.Dv EOF . +The routines +.Xr feof 3 +and +.Xr ferror 3 +must be used to distinguish between end-of-file and error. +If an error occurs, the global variable +.Va errno +is set to indicate the error. +The end-of-file condition is remembered, even on a terminal, and all +subsequent attempts to read will return +.Dv EOF +until the condition is cleared with +.Xr clearerr 3 . +.Sh SEE ALSO +.Xr ferror 3 , +.Xr flockfile 3 , +.Xr fopen 3 , +.Xr fread 3 , +.Xr getwc 3 , +.Xr putc 3 , +.Xr ungetc 3 +.Sh STANDARDS +The +.Fn fgetc , +.Fn getc , +and +.Fn getchar +functions +conform to +.St -isoC . +The +.Fn getc_unlocked +and +.Fn getchar_unlocked +functions conform to +.St -p1003.1-2001 . +.Sh BUGS +Since +.Dv EOF +is a valid integer value, +.Xr feof 3 +and +.Xr ferror 3 +must be used to check for failure after calling +.Fn getw . +The size and byte order of an +.Vt int +varies from one machine to another, and +.Fn getw +is not recommended for portable applications. +.Pp diff --git a/stdio/FreeBSD/getc.c b/stdio/FreeBSD/getc.c new file mode 100644 index 0000000..06ad2a3 --- /dev/null +++ b/stdio/FreeBSD/getc.c @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getc.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/getc.c,v 1.16 2008/05/05 16:03:52 jhb Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +#undef getc +#undef getc_unlocked + +int +getc(FILE *fp) +{ + int retval; + FLOCKFILE(fp); + /* Orientation set by __sgetc() when buffer is empty. */ + /* ORIENT(fp, -1); */ + retval = __sgetc(fp); + FUNLOCKFILE(fp); + return (retval); +} + +int +getc_unlocked(FILE *fp) +{ + + return (__sgetc(fp)); +} diff --git a/stdio/FreeBSD/getchar.c b/stdio/FreeBSD/getchar.c new file mode 100644 index 0000000..a17496a --- /dev/null +++ b/stdio/FreeBSD/getchar.c @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getchar.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/getchar.c,v 1.15 2008/05/05 16:03:52 jhb Exp $"); + +/* + * A subroutine version of the macro getchar. + */ +#include "namespace.h" +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +#undef getchar +#undef getchar_unlocked + +int +getchar() +{ + int retval; + FLOCKFILE(stdin); + /* Orientation set by __sgetc() when buffer is empty. */ + /* ORIENT(stdin, -1); */ + retval = __sgetc(stdin); + FUNLOCKFILE(stdin); + return (retval); +} + +int +getchar_unlocked(void) +{ + + return (__sgetc(stdin)); +} diff --git a/stdio/FreeBSD/getdelim.c b/stdio/FreeBSD/getdelim.c new file mode 100644 index 0000000..705231a --- /dev/null +++ b/stdio/FreeBSD/getdelim.c @@ -0,0 +1,168 @@ +/*- + * Copyright (c) 2009 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/getdelim.c,v 1.3 2009/10/04 19:43:36 das Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" +#include "local.h" + +static inline size_t +p2roundup(size_t n) +{ + + if (!powerof2(n)) { + n--; + n |= n >> 1; + n |= n >> 2; + n |= n >> 4; + n |= n >> 8; + n |= n >> 16; +#if SIZE_T_MAX > 0xffffffffU + n |= n >> 32; +#endif + n++; + } + return (n); +} + +/* + * Expand *linep to hold len bytes (up to SSIZE_MAX + 1). + */ +static inline int +expandtofit(char ** __restrict linep, size_t len, size_t * __restrict capp) +{ + char *newline; + size_t newcap; + + if (len > (size_t)SSIZE_MAX + 1) { + errno = EOVERFLOW; + return (-1); + } + if (len > *capp) { + if (len == (size_t)SSIZE_MAX + 1) /* avoid overflow */ + newcap = (size_t)SSIZE_MAX + 1; + else + newcap = p2roundup(len); + newline = realloc(*linep, newcap); + if (newline == NULL) + return (-1); + *capp = newcap; + *linep = newline; + } + return (0); +} + +/* + * Append the src buffer to the *dstp buffer. The buffers are of + * length srclen and *dstlenp, respectively, and dst has space for + * *dstlenp bytes. After the call, *dstlenp and *dstcapp are updated + * appropriately, and *dstp is reallocated if needed. Returns 0 on + * success, -1 on allocation failure. + */ +static int +sappend(char ** __restrict dstp, size_t * __restrict dstlenp, + size_t * __restrict dstcapp, char * __restrict src, size_t srclen) +{ + size_t tmp; + + /* avoid overflowing the result length */ + if (os_add3_overflow(srclen, *dstlenp, 1, &tmp)) { + errno = EOVERFLOW; + return (-1); + } + + /* ensure room for srclen + dstlen + terminating NUL */ + if (expandtofit(dstp, tmp, dstcapp)) + return (-1); + memcpy(*dstp + *dstlenp, src, srclen); + *dstlenp += srclen; + return (0); +} + +ssize_t +getdelim(char ** __restrict linep, size_t * __restrict linecapp, int delim, + FILE * __restrict fp) +{ + u_char *endp; + size_t linelen; + + FLOCKFILE(fp); + ORIENT(fp, -1); + + if (linep == NULL || linecapp == NULL) { + errno = EINVAL; + goto error; + } + + if (*linep == NULL) + *linecapp = 0; + + if (fp->_r <= 0 && __srefill(fp)) { + /* If fp is at EOF already, we just need space for the NUL. */ + if (__sferror(fp) || expandtofit(linep, 1, linecapp)) + goto error; + FUNLOCKFILE(fp); + (*linep)[0] = '\0'; + return (-1); + } + + linelen = 0; + while ((endp = memchr(fp->_p, delim, fp->_r)) == NULL) { + if (sappend(linep, &linelen, linecapp, (char*)fp->_p, fp->_r)) + goto error; + if (__srefill(fp)) { + if (__sferror(fp)) + goto error; + goto done; /* hit EOF */ + } + } + endp++; /* snarf the delimiter, too */ + if (sappend(linep, &linelen, linecapp, (char*)fp->_p, endp - fp->_p)) + goto error; + fp->_r -= endp - fp->_p; + fp->_p = endp; +done: + /* Invariant: *linep has space for at least linelen+1 bytes. */ + (*linep)[linelen] = '\0'; + FUNLOCKFILE(fp); + return (linelen); + +error: + fp->_flags |= __SERR; + FUNLOCKFILE(fp); + return (-1); +} diff --git a/stdio/FreeBSD/getline.3 b/stdio/FreeBSD/getline.3 new file mode 100644 index 0000000..11e1e89 --- /dev/null +++ b/stdio/FreeBSD/getline.3 @@ -0,0 +1,136 @@ +.\" Copyright (c) 2009 David Schultz +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/stdio/getline.3,v 1.5 2012/03/29 05:02:12 eadler Exp $ +.\" +.Dd November 30, 2010 +.Dt GETLINE 3 +.Os +.Sh NAME +.Nm getdelim , +.Nm getline +.Nd get a line from a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft ssize_t +.Fn getdelim "char ** restrict linep" "size_t * restrict linecapp" "int delimiter" " FILE * restrict stream" +.Ft ssize_t +.Fn getline "char ** restrict linep" "size_t * restrict linecapp" " FILE * restrict stream" +.Sh DESCRIPTION +The +.Fn getdelim +function reads a line from +.Fa stream , +delimited by the character +.Fa delimiter . +The +.Fn getline +function is equivalent to +.Fn getdelim +with the newline character as the delimiter. +The delimiter character is included as part of the line, unless +the end of the file is reached. +.Pp +The caller may provide a pointer to a malloced buffer for the line in +.Fa *linep , +and the capacity of that buffer in +.Fa *linecapp . +These functions expand the buffer as needed, as if via +.Fn realloc . +If +.Fa linep +points to a +.Dv NULL +pointer, a new buffer will be allocated. +In either case, +.Fa *linep +and +.Fa *linecapp +will be updated accordingly. +.Sh RETURN VALUES +The +.Fn getdelim +and +.Fn getline +functions return the number of characters written, excluding the +terminating +.Dv NUL +character. +The value \-1 is returned if an error occurs, or if end-of-file is reached. +.Sh EXAMPLES +The following code fragment reads lines from a file and +writes them to standard output. +The +.Fn fwrite +function is used in case the line contains embedded +.Dv NUL +characters. +.Bd -literal -offset indent +char *line = NULL; +size_t linecap = 0; +ssize_t linelen; +while ((linelen = getline(&line, &linecap, fp)) > 0) + fwrite(line, linelen, 1, stdout); +.Ed +.Sh ERRORS +These functions may fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +Either +.Fa linep +or +.Fa linecapp +is +.Dv NULL . +.It Bq Er EOVERFLOW +No delimiter was found in the first +.Dv SSIZE_MAX +characters. +.El +.Pp +These functions may also fail due to any of the errors specified for +.Fn fgets +and +.Fn malloc . +.Sh SEE ALSO +.Xr fgetln 3 , +.Xr fgets 3 , +.Xr malloc 3 +.Sh STANDARDS +The +.Fn getdelim +and +.Fn getline +functions conform to +.St -p1003.1-2008 . +.Sh HISTORY +These routines first appeared in +.Fx 8.0 . +.Sh BUGS +There are no wide character versions of +.Fn getdelim +or +.Fn getline . diff --git a/stdio/FreeBSD/getline.c b/stdio/FreeBSD/getline.c new file mode 100644 index 0000000..1384481 --- /dev/null +++ b/stdio/FreeBSD/getline.c @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2009 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/getline.c,v 1.1 2009/02/28 06:00:58 das Exp $"); + +#define _WITH_GETLINE +#include + +ssize_t +getline(char ** __restrict linep, size_t * __restrict linecapp, + FILE * __restrict fp) +{ + + return (getdelim(linep, linecapp, '\n', fp)); +} diff --git a/stdio/FreeBSD/gets.c b/stdio/FreeBSD/gets.c new file mode 100644 index 0000000..7dda9fb --- /dev/null +++ b/stdio/FreeBSD/gets.c @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gets.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/gets.c,v 1.17 2007/01/09 00:28:06 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +__warn_references(gets, "warning: this program uses gets(), which is unsafe."); + +char * +gets(buf) + char *buf; +{ + int c; + char *s; + static int warned; + static const char w[] = + "warning: this program uses gets(), which is unsafe.\n"; + + FLOCKFILE(stdin); + ORIENT(stdin, -1); + if (!warned) { + (void) _write(STDERR_FILENO, w, sizeof(w) - 1); + warned = 1; + } + for (s = buf; (c = __sgetc(stdin)) != '\n';) + if (c == EOF) + if (s == buf) { + FUNLOCKFILE(stdin); + return (NULL); + } else + break; + else + *s++ = c; + *s = 0; + FUNLOCKFILE(stdin); + return (buf); +} diff --git a/stdio/FreeBSD/getw.c b/stdio/FreeBSD/getw.c new file mode 100644 index 0000000..7b669aa --- /dev/null +++ b/stdio/FreeBSD/getw.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getw.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/getw.c,v 1.8 2007/01/09 00:28:06 imp Exp $"); + +#include + +int +getw(fp) + FILE *fp; +{ + int x; + + return (fread((void *)&x, sizeof(x), 1, fp) == 1 ? x : EOF); +} diff --git a/stdio/FreeBSD/getwc.3 b/stdio/FreeBSD/getwc.3 new file mode 100644 index 0000000..d994aad --- /dev/null +++ b/stdio/FreeBSD/getwc.3 @@ -0,0 +1,121 @@ +.\" $NetBSD: getwc.3,v 1.3 2002/02/07 07:00:26 ross Exp $ +.\" +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getc.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/getwc.3,v 1.8 2007/01/09 00:28:06 imp Exp $ +.\" +.Dd March 3, 2004 +.Dt GETWC 3 +.Os +.Sh NAME +.Nm fgetwc , +.Nm getwc , +.Nm getwchar +.Nd get next wide character from input stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft wint_t +.Fn fgetwc "FILE *stream" +.Ft wint_t +.Fn getwc "FILE *stream" +.Ft wint_t +.Fn getwchar "void" +.Sh DESCRIPTION +The +.Fn fgetwc +function +obtains the next input wide character (if present) from the stream pointed at by +.Fa stream , +or the next character pushed back on the stream via +.Xr ungetwc 3 . +.Pp +The +.Fn getwc +function +acts essentially identically to +.Fn fgetwc . +.Pp +The +.Fn getwchar +function +is equivalent to +.Fn getwc +with the argument +.Dv stdin . +.Pp +Extended locale versions of these functions are documented in +.Xr getwc_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If successful, these routines return the next wide character +from the +.Fa stream . +If the stream is at end-of-file or a read error occurs, +the routines return +.Dv WEOF . +The routines +.Xr feof 3 +and +.Xr ferror 3 +must be used to distinguish between end-of-file and error. +If an error occurs, the global variable +.Va errno +is set to indicate the error. +The end-of-file condition is remembered, even on a terminal, and all +subsequent attempts to read will return +.Dv WEOF +until the condition is cleared with +.Xr clearerr 3 . +.Sh SEE ALSO +.Xr ferror 3 , +.Xr fopen 3 , +.Xr fread 3 , +.Xr getc 3 , +.Xr getwc_l , +.Xr putwc 3 , +.Xr stdio 3 , +.Xr ungetwc 3 +.Sh STANDARDS +The +.Fn fgetwc , +.Fn getwc , +and +.Fn getwchar +functions +conform to +.St -isoC-99 . diff --git a/stdio/FreeBSD/getwc.c b/stdio/FreeBSD/getwc.c new file mode 100644 index 0000000..0128a77 --- /dev/null +++ b/stdio/FreeBSD/getwc.c @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/getwc.c,v 1.3 2004/05/25 10:42:52 tjr Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +#undef getwc + +/* + * Synonym for fgetwc(). The only difference is that getwc(), if it is a + * macro, may evaluate `fp' more than once. + */ +wint_t +getwc(FILE *fp) +{ + + return (fgetwc_l(fp, __current_locale())); +} + +wint_t +getwc_l(FILE *fp, locale_t loc) +{ + + /* no need to call NORMALIZE_LOCALE(loc) because fgetwc_l will */ + return (fgetwc_l(fp, loc)); +} diff --git a/stdio/FreeBSD/getwchar.c b/stdio/FreeBSD/getwchar.c new file mode 100644 index 0000000..f5c2dd6 --- /dev/null +++ b/stdio/FreeBSD/getwchar.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/getwchar.c,v 1.3 2004/05/25 10:42:52 tjr Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +#undef getwchar + +/* + * Synonym for fgetwc(stdin). + */ +wint_t +getwchar(void) +{ + + return (fgetwc_l(stdin, __current_locale())); +} + +wint_t +getwchar_l(locale_t loc) +{ + + /* no need to call NORMALIZE_LOCALE(loc) because fgetwc_l will */ + return (fgetwc_l(stdin, loc)); +} diff --git a/stdio/FreeBSD/glue.h b/stdio/FreeBSD/glue.h new file mode 100644 index 0000000..1543dc3 --- /dev/null +++ b/stdio/FreeBSD/glue.h @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)glue.h 8.1 (Berkeley) 6/4/93 + * $FreeBSD: src/lib/libc/stdio/glue.h,v 1.4 2007/01/09 00:28:06 imp Exp $ + */ + +/* + * The first few FILEs are statically allocated; others are dynamically + * allocated and linked in via this glue structure. + */ +struct glue { + struct glue *next; + int niobs; + FILE *iobs; +}; +extern struct glue __sglue; diff --git a/stdio/FreeBSD/local.h b/stdio/FreeBSD/local.h new file mode 100644 index 0000000..51262bc --- /dev/null +++ b/stdio/FreeBSD/local.h @@ -0,0 +1,161 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)local.h 8.3 (Berkeley) 7/3/94 + * $FreeBSD: src/lib/libc/stdio/local.h,v 1.33 2008/05/05 16:03:52 jhb Exp $ + */ + +#include +#include "xlocale_private.h" +#include "xprintf_private.h" +#include /* for off_t */ +#include +#include +#include +#include + +/* + * Information local to this implementation of stdio, + * in particular, macros and private variables. + */ + +extern int _sread(FILE *, char *, int); +extern int _swrite(FILE *, char const *, int); +extern fpos_t _sseek(FILE *, fpos_t, int); +extern int _ftello(FILE *, fpos_t *); +extern int _fseeko(FILE *, off_t, int, int); +extern int _vasprintf(printf_comp_t __restrict, printf_domain_t __restrict, + char ** __restrict, locale_t __restrict, + const char * __restrict, __va_list); +extern int _vdprintf(printf_comp_t __restrict, printf_domain_t __restrict, + int, locale_t __restrict, const char * __restrict, va_list); +extern int _vsnprintf(printf_comp_t __restrict, printf_domain_t __restrict, + char * __restrict, size_t n, locale_t __restrict, + const char * __restrict, __va_list); + +extern int __fflush(FILE *fp); +extern void __fcloseall(void); +extern wint_t __fgetwc(FILE *, locale_t); +extern wint_t __fputwc(wchar_t, FILE *, locale_t); +extern int __sflush(FILE *); +extern FILE *__sfp(int); +extern void __sfprelease(FILE *); /* mark free and update count as needed */ +extern int __slbexpand(FILE *, size_t); +extern int __srefill(FILE *); +extern int __srefill0(FILE *); +extern int __srefill1(FILE *); +extern int __sread(void *, char *, int); +extern int __swrite(void *, char const *, int); +extern fpos_t __sseek(void *, fpos_t, int); +extern int __sclose(void *); +extern void __sinit(void); +extern void _cleanup(void); +extern void (*__cleanup)(void); +extern void __smakebuf(FILE *); +extern int __swhatbuf(FILE *, size_t *, int *); +extern int _fwalk(int (*)(FILE *)); +extern int __svfscanf_l(FILE *, locale_t, const char *, __va_list); +extern int __swsetup(FILE *); +extern int __sflags(const char *, int *); +extern int __ungetc(int, FILE *); +extern wint_t __ungetwc(wint_t, FILE *, locale_t); +extern int __vfprintf(FILE *, locale_t, const char *, __va_list); +extern int __vfscanf(FILE *, const char *, __va_list); +extern int __vfwprintf(FILE *, locale_t, const wchar_t *, __va_list); +extern int __vfwscanf(FILE * __restrict, locale_t, const wchar_t * __restrict, + __va_list); +extern size_t __fread(void * __restrict buf, size_t size, size_t count, + FILE * __restrict fp); +extern pthread_once_t __sdidinit; + + +/* hold a buncha junk that would grow the ABI */ +struct __sFILEX { + unsigned char *up; /* saved _p when _p is doing ungetc data */ + pthread_mutex_t fl_mutex; /* used for MT-safety */ + int orientation:2; /* orientation for fwide() */ + int counted:1; /* stream counted against STREAM_MAX */ + mbstate_t mbstate; /* multibyte conversion state */ +}; + +#define _up _extra->up +#define _fl_mutex _extra->fl_mutex +#define _orientation _extra->orientation +#define _mbstate _extra->mbstate +#define _counted _extra->counted + + + +#define INITEXTRA(fp) do { \ + (fp)->_extra->up = NULL; \ + (fp)->_extra->fl_mutex = (pthread_mutex_t)PTHREAD_RECURSIVE_MUTEX_INITIALIZER; \ + (fp)->_extra->orientation = 0; \ + memset(&(fp)->_extra->mbstate, 0, sizeof(mbstate_t)); \ + (fp)->_extra->counted = 0; \ +} while(0); + +/* + * Prepare the given FILE for writing, and return 0 iff it + * can be written now. Otherwise, return EOF and set errno. + */ +#define prepwrite(fp) \ + ((((fp)->_flags & __SWR) == 0 || \ + ((fp)->_bf._base == NULL && ((fp)->_flags & __SSTR) == 0)) && \ + __swsetup(fp)) + +/* + * Test whether the given stdio file has an active ungetc buffer; + * release such a buffer, without restoring ordinary unread data. + */ +#define HASUB(fp) ((fp)->_ub._base != NULL) +#define FREEUB(fp) { \ + if ((fp)->_ub._base != (fp)->_ubuf) \ + free((char *)(fp)->_ub._base); \ + (fp)->_ub._base = NULL; \ +} + +/* + * test for an fgetln() buffer. + */ +#define HASLB(fp) ((fp)->_lb._base != NULL) +#define FREELB(fp) { \ + free((char *)(fp)->_lb._base); \ + (fp)->_lb._base = NULL; \ +} + +/* + * Set the orientation for a stream. If o > 0, the stream has wide- + * orientation. If o < 0, the stream has byte-orientation. + */ +#define ORIENT(fp, o) do { \ + if ((fp)->_orientation == 0) \ + (fp)->_orientation = (o); \ +} while (0) diff --git a/stdio/FreeBSD/makebuf.c b/stdio/FreeBSD/makebuf.c new file mode 100644 index 0000000..a472776 --- /dev/null +++ b/stdio/FreeBSD/makebuf.c @@ -0,0 +1,241 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)makebuf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" +#include "local.h" +#include +#include +#include + +#ifdef FEATURE_SMALL_STDIOBUF +# define MAXBUFSIZE (1 << 12) +#else +# define MAXBUFSIZE (1 << 16) +#endif + +#define TTYBUFSIZE 4096 +#define MAXEVPSIZE 16 + +static char __fallback_evp[MAXEVPSIZE]; +static char __stdout_evp[MAXEVPSIZE]; + +static void +__loadevp(const char* key, char destination[MAXEVPSIZE]) +{ + char* evp = getenv(key); + if (evp != NULL) { + strlcpy(destination, evp, MAXEVPSIZE); + } else { + destination[0] = '\0'; + } +} + +static void +__evpinit(void* __unused unused) +{ + __loadevp("STDBUF", __fallback_evp); + __loadevp("STDBUF1", __stdout_evp); +} + +static char* +__getevp(int fd) +{ + static os_once_t predicate; + os_once(&predicate, NULL, __evpinit); + + if (fd == STDOUT_FILENO && __stdout_evp[0] != '\0') { + return __stdout_evp; + } else if (__fallback_evp[0] != '\0') { + return __fallback_evp; + } else { + return NULL; + } + +} + +/* + * Internal routine to determine environment override buffering for a file. + * + * Sections of the below taken from NetBSD's version of this file under the same license. + */ +static int +__senvbuf(FILE *fp, size_t *bufsize, int *couldbetty) +{ + char* evp; + char* end; + int flags; + long size; + + flags = 0; // Default to fully buffered + + if ((evp = __getevp(fp->_file)) == NULL) { + return flags; + } + + // Look at the first character only to determine buffering mode + switch (*evp) { + case 'u': + case 'U': + flags |= __SNBF; + break; + case 'l': + case 'L': + flags |= __SLBF; + break; + case 'f': + case 'F': + // Default flags is fully buffered + break; + default: + // Unexpected buffering mode, use default fully buffered + return flags; + } + // User specified envrionment defaults have higher priority than tty defaults + *couldbetty = 0; + + // Advance the envrionment variable pointer, so we can attempt to parse the number + evp++; + if (!isdigit(*evp)) { + return flags; // No number found, this protects us from negative size values + } + + size = strtol_l(evp, &end, 10, LC_C_LOCALE); + if (*end != '\0') { + return flags; + } + + if (size <= 0) { + return __SNBF; // Override with unbuffered if the buffer size is 0 + } + + // We had a non zero buffer, cap it and return the flags; + *bufsize = size > MAXBUFSIZE ? MAXBUFSIZE : size; + return flags; +} + +/* + * Allocate a file buffer, or switch to unbuffered I/O. + * Per the ANSI C standard, ALL tty devices default to line buffered. + * + * As a side effect, we set __SOPT or __SNPT (en/dis-able fseek + * optimisation) right after the _fstat() that finds the buffer size. + */ +void +__smakebuf(FILE *fp) +{ + void *p; + int flags; + size_t size; + int couldbetty; + + if (fp->_flags & __SNBF) { + fp->_bf._base = fp->_p = fp->_nbuf; + fp->_bf._size = 1; + return; + } + flags = __swhatbuf(fp, &size, &couldbetty); + if (fp->_file >= 0) { + flags |= __senvbuf(fp, &size, &couldbetty); + + if (flags & __SNBF) { + fp->_flags |= __SNBF; + fp->_bf._base = fp->_p = fp->_nbuf; + fp->_bf._size = 1; + return; + } + } + + if (couldbetty && isatty(fp->_file)) { + flags |= __SLBF; + /* st_blksize for ttys is 128K, so make it more reasonable */ + if (size > TTYBUFSIZE) + fp->_blksize = size = TTYBUFSIZE; + } + if ((p = malloc(size)) == NULL) { + fp->_flags |= __SNBF; + fp->_bf._base = fp->_p = fp->_nbuf; + fp->_bf._size = 1; + return; + } + __cleanup = _cleanup; + flags |= __SMBF; + fp->_bf._base = fp->_p = p; + fp->_bf._size = size; + fp->_flags |= flags; +} + +/* + * Internal routine to determine `proper' buffering for a file. + */ +int +__swhatbuf(FILE *fp, size_t *bufsize, int *couldbetty) +{ + struct stat st; + + if (fp->_file < 0 || _fstat(fp->_file, &st) < 0) { + *couldbetty = 0; + *bufsize = BUFSIZ; + return (__SNPT); + } + + /* could be a tty iff it is a character device */ + *couldbetty = (st.st_mode & S_IFMT) == S_IFCHR; + if (st.st_blksize <= 0) { + *bufsize = BUFSIZ; + return (__SNPT); + } + + /* + * Optimise fseek() only if it is a regular file. (The test for + * __sseek is mainly paranoia.) It is safe to set _blksize + * unconditionally; it will only be used if __SOPT is also set. + */ + fp->_blksize = *bufsize = st.st_blksize > MAXBUFSIZE ? MAXBUFSIZE : st.st_blksize; + return ((st.st_mode & S_IFMT) == S_IFREG && fp->_seek == __sseek ? + __SOPT : __SNPT); +} diff --git a/stdio/FreeBSD/mktemp.3 b/stdio/FreeBSD/mktemp.3 new file mode 100644 index 0000000..3a55c7f --- /dev/null +++ b/stdio/FreeBSD/mktemp.3 @@ -0,0 +1,381 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)mktemp.3 8.1 (Berkeley) 6/4/93 +.\" +.Dd December 18, 2015 +.Dt MKTEMP 3 +.Os +.Sh NAME +.Nm mktemp , +.Nm mkstemp , +.Nm mkdtemp , +.Nm mkdtempat_np , +.Nm mkstemps , +.Nm mkstempsat_np , +.Nm mkostemp , +.Nm mkostemps , +.Nm mkostempsat_np +.Nd make temporary file name (unique) +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft char * +.Fo mktemp +.Fa "char *template" +.Fc +.Ft int +.Fo mkstemp +.Fa "char *template" +.Fc +.Ft char * +.Fo mkdtemp +.Fa "char *template" +.Fc +.Ft char * +.Fo mkdtempat_np +.Fa "int dfd" +.Fa "char *template" +.Fc +.Ft int +.Fo mkstemps +.Fa "char *template" +.Fa "int suffixlen" +.Fc +.Ft int +.Fo mkstempsat_np +.Fa "int dfd" +.Fa "char *template" +.Fa "int suffixlen" +.Fc +.Ft int +.Fo mkostemp +.Fa "char *template" +.Fa "int oflags" +.Fc +.Ft int +.Fo mkostemps +.Fa "char *template" +.Fa "int suffixlen" +.Fa "int oflags" +.Fc +.Ft int +.Fo mkostempsat_np +.Fa "int dfd" +.Fa "char *template" +.Fa "int suffixlen" +.Fa "int oflags" +.Fc +.Sh DESCRIPTION +The +.Fn mktemp +function +takes the given file name template and overwrites a portion of it +to create a file name. +This file name is guaranteed not to exist at the time of function invocation +and is suitable for use +by the application. +The template may be any file name with some number of +.Ql X Ns s +appended +to it, for example +.Pa /tmp/temp.XXXXXX . +The trailing +.Ql X Ns s +are replaced with a +unique alphanumeric combination. +The number of unique file names +.Fn mktemp +can return depends on the number of +.Ql X Ns s +provided; six +.Ql X Ns s +will +result in +.Fn mktemp +selecting one of 56800235584 (62 ** 6) possible temporary file names. +.Pp +The +.Fn mkstemp +function +makes the same replacement to the template and creates the template file, +mode 0600, returning a file descriptor opened for reading and writing. +This avoids the race between testing for a file's existence and opening it +for use. +.Pp +The +.Fn mkdtemp +function makes the same replacement to the template as in +.Fn mktemp +and creates the template directory, mode 0700. +.Pp +The +.Fn mkostemp +function +is like +.Fn mkstemp +but allows specifying additional +.Xr open 2 +flags (defined in +.In fcntl.h ) . +The permitted flags are +.Dv O_APPEND , +.Dv O_SHLOCK , +.Dv O_EXLOCK +and +.Dv O_CLOEXEC . +.Pp +The +.Fn mkstemps +and +.Fn mkostemps +functions act the same as +.Fn mkstemp +and +.Fn mkostemp +respectively, +except they permit a suffix to exist in the template. +The template should be of the form +.Pa /tmp/tmpXXXXXXsuffix . +The +.Fn mkstemps +and +.Fn mkostemps +functions +are told the length of the suffix string. +.Pp +The +.Fn mkdtempat_np , +.Fn mkstempsat_np , +and +.Fn mkostempsat_np +functions +act the same as +.Fn mkdtemp , +.Fn mkstemps , +and +.Fn mkostemps +respectively, +except in the case where the +.Ar path +specifies a relative path. +In this case, path is treated as relative to the directory associated with the file descriptor +.Ar fd +instead of the current working directory. +.Sh RETURN VALUES +The +.Fn mktemp +and +.Fn mkdtemp +functions return a pointer to the template on success and +.Dv NULL +on failure. +The +.Fn mkstemp , +.Fn mkostemp , +.Fn mkstemps +and +.Fn mkostemps +functions +return \-1 if no suitable file could be created. +If either call fails an error code is placed in the global variable +.Va errno . +.Sh ERRORS +The +.Fn mkstemp , +.Fn mkostemp , +.Fn mkstemps , +.Fn mkostemps , +and +.Fn mkdtemp +functions +may set +.Va errno +to one of the following values: +.Bl -tag -width Er +.It Bq Er ENOTDIR +The pathname portion of the template is not an existing directory. +.El +.Pp +The +.Fn mkostemp +and +.Fn mkostemps +functions +may also set +.Va errno +to the following value: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa oflags +argument is invalid. +.El +.Pp +The +.Fn mkstemp , +.Fn mkostemp , +.Fn mkstemps , +.Fn mkostemps +and +.Fn mkdtemp +functions +may also set +.Va errno +to any value specified by the +.Xr stat 2 +function. +.Pp +The +.Fn mkstemp , +.Fn mkostemp , +.Fn mkstemps +and +.Fn mkostemps +functions +may also set +.Va errno +to any value specified by the +.Xr open 2 +function. +.Pp +The +.Fn mkdtemp +function +may also set +.Va errno +to any value specified by the +.Xr mkdir 2 +function. +.Sh NOTES +A common problem that results in a core dump is that the programmer +passes in a read-only string to +.Fn mktemp , +.Fn mkstemp , +.Fn mkstemps +or +.Fn mkdtemp . +This is common with programs that were developed before +.St -isoC +compilers were common. +For example, calling +.Fn mkstemp +with an argument of +.Qq /tmp/tempfile.XXXXXX +will result in a core dump due to +.Fn mkstemp +attempting to modify the string constant that was given. +.Sh LEGACY SYNOPSIS +.Fd #include +.Pp +The include file +.In unistd.h +is necessary and sufficient for all functions. +.Sh SEE ALSO +.Xr chmod 2 , +.Xr getpid 2 , +.Xr mkdir 2 , +.Xr open 2 , +.Xr stat 2 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn mkstemp +and +.Fn mkdtemp +functions are expected to conform to +.St -p1003.1-2008 . +The +.Fn mktemp +function is expected to conform to +.St -p1003.1-2001 +and is not specified by +.St -p1003.1-2008 . +The +.Fn mkostemp , +.Fn mkstemps +and +.Fn mkostemps +functions do not conform to any standard. +.Sh HISTORY +A +.Fn mktemp +function appeared in +.At v7 . +The +.Fn mkstemp +function appeared in +.Bx 4.4 . +The +.Fn mkdtemp +function first appeared in +.Ox 2.2 , +and later in +.Fx 3.2 . +The +.Fn mkstemps +function first appeared in +.Ox 2.4 , +and later in +.Fx 3.4 . +The +.Fn mkostemp +and +.Fn mkostemps +functions appeared in OS X 10.12. +.Sh BUGS +This family of functions produces filenames which can be guessed, +though the risk is minimized when large numbers of +.Ql X Ns s +are used to +increase the number of possible temporary filenames. +This makes the race in +.Fn mktemp , +between testing for a file's existence (in the +.Fn mktemp +function call) +and opening it for use +(later in the user application) +particularly dangerous from a security perspective. +Whenever it is possible, +.Fn mkstemp +or +.Fn mkostemp +should be used instead, since it does not have the race condition. +If +.Fn mkstemp +cannot be used, the filename created by +.Fn mktemp +should be created using the +.Dv O_EXCL +flag to +.Xr open 2 +and the return status of the call should be tested for failure. +This will ensure that the program does not continue blindly +in the event that an attacker has already created the file +with the intention of manipulating or reading its contents. diff --git a/stdio/FreeBSD/mktemp.c b/stdio/FreeBSD/mktemp.c new file mode 100644 index 0000000..001cf3e --- /dev/null +++ b/stdio/FreeBSD/mktemp.c @@ -0,0 +1,335 @@ +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#define ALLOWED_MKOSTEMP_FLAGS (O_APPEND | O_SHLOCK | O_EXLOCK | O_CLOEXEC) + +char *_mktemp(char *); + +typedef enum { + FTPP_DONE, FTPP_TRY_NEXT, FTPP_ERROR +} find_temp_path_progress_t; + +/* A contract for actions that find_temp_path performs for every path from + * the template. + * + * If the desired path was found, set result and return FTPP_DONE. + * If an IO/FS error ocurred, set errno and return FTPP_ERROR. + * Otherwise return FTPP_TRY_NEXT. + */ +typedef find_temp_path_progress_t (*find_temp_path_action_t)( + int dfd, char *path, void *ctx, void *result); + +static int find_temp_path(int dfd, char *path, int slen, bool stat_base_dir, + find_temp_path_action_t action, void *action_ctx, void *action_result); + +static find_temp_path_progress_t _mkostemps_action( + int dfd, char *path, void *ctx, void *result); +static find_temp_path_progress_t _mktemp_action( + int dfd, char *path, void *ctx, void *result); +static find_temp_path_progress_t _mkdtemp_action( + int dfd, char *path, void *ctx, void *result); +static find_temp_path_progress_t _mkstemp_dprotected_np_action( + int dfd, char *path, void *ctx, void *result); + +static const char padchar[] = +"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + +int +mkostemps(char *path, int slen, int oflags) +{ + int fd; + if (oflags & ~ALLOWED_MKOSTEMP_FLAGS) { + errno = EINVAL; + return -1; + } + return (find_temp_path(AT_FDCWD, path, slen, TRUE, _mkostemps_action, &oflags, &fd) ? fd : -1); +} + +int +mkostempsat_np(int dfd, char *path, int slen, int oflags) +{ + int fd; + if (oflags & ~ALLOWED_MKOSTEMP_FLAGS) { + errno = EINVAL; + return -1; + } + return (find_temp_path(dfd, path, slen, TRUE, _mkostemps_action, &oflags, &fd) ? fd : -1); +} + +int +mkstemps(char *path, int slen) +{ + int fd; + + return (find_temp_path(AT_FDCWD, path, slen, TRUE, _mkostemps_action, NULL, &fd) ? fd : -1); +} + +int +mkstempsat_np(int dfd, char *path, int slen) +{ + int fd; + + return (find_temp_path(dfd, path, slen, TRUE, _mkostemps_action, NULL, &fd) ? fd : -1); +} + +int +mkostemp(char *path, int oflags) +{ + int fd; + if (oflags & ~ALLOWED_MKOSTEMP_FLAGS) { + errno = EINVAL; + return -1; + } + return (find_temp_path(AT_FDCWD, path, 0, TRUE, _mkostemps_action, &oflags, &fd) ? fd : -1); +} + +int +mkstemp(char *path) +{ + int fd; + + return (find_temp_path(AT_FDCWD, path, 0, TRUE, _mkostemps_action, NULL, &fd) ? fd : -1); +} + +char * +mkdtemp(char *path) +{ + return (find_temp_path(AT_FDCWD, path, 0, TRUE, _mkdtemp_action, NULL, NULL) ? + path : (char *)NULL); +} + +char * +mkdtempat_np(int dfd, char *path) +{ + return (find_temp_path(dfd, path, 0, TRUE, _mkdtemp_action, NULL, NULL) ? + path : (char *)NULL); +} + +char * +_mktemp(char *path) +{ + return (find_temp_path(AT_FDCWD, path, 0, FALSE, _mktemp_action, NULL, NULL) ? + path : (char *)NULL); +} + +__warn_references(mktemp, + "warning: mktemp() possibly used unsafely; consider using mkstemp()"); + +char * +mktemp(char *path) +{ + return (_mktemp(path)); +} + +int +mkstemp_dprotected_np(char *path, int class, int dpflags) +{ + int fd; + int ctx[2] = { class, dpflags }; + + return (find_temp_path(AT_FDCWD, path, 0, TRUE, _mkstemp_dprotected_np_action, &ctx, &fd) ? fd : -1); +} + +/* For every path matching a given template, invoke an action. Depending on + * the progress reported by action, stops or tries the next path. + * Returns 1 if succeeds, 0 and sets errno if fails. + */ +static int +find_temp_path(int dfd, char *path, int slen, bool stat_base_dir, + find_temp_path_action_t action, void *action_ctx, void *action_result) +{ + char *start, *trv, *suffp, *carryp; + char *pad; + struct stat sbuf; + int rval; + uint32_t rand; + char carrybuf[MAXPATHLEN]; + + if (slen < 0) { + errno = EINVAL; + return (0); + } + + for (trv = path; *trv != '\0'; ++trv) + ; + if (trv - path >= MAXPATHLEN) { + errno = ENAMETOOLONG; + return (0); + } + trv -= slen; + suffp = trv; + --trv; + if (trv < path || NULL != strchr(suffp, '/')) { + errno = EINVAL; + return (0); + } + + /* Fill space with random characters */ + while (trv >= path && *trv == 'X') { + rand = arc4random_uniform(sizeof(padchar) - 1); + *trv-- = padchar[rand]; + } + start = trv + 1; + + /* save first combination of random characters */ + memcpy(carrybuf, start, suffp - start); + + /* + * check the target directory. + */ + if (stat_base_dir) { + for (; trv > path; --trv) { + if (*trv == '/') { + *trv = '\0'; + rval = fstatat(dfd, path, &sbuf, 0); + *trv = '/'; + if (rval != 0) + return (0); + if (!S_ISDIR(sbuf.st_mode)) { + errno = ENOTDIR; + return (0); + } + break; + } + } + } + + for (;;) { + switch (action(dfd, path, action_ctx, action_result)) { + case FTPP_DONE: + return (1); + case FTPP_ERROR: + return (0); // errno must be set by the action + default: + ; // FTPP_TRY_NEXT, fall-through + } + + /* If we have a collision, cycle through the space of filenames */ + for (trv = start, carryp = carrybuf;;) { + /* have we tried all possible permutations? */ + if (trv == suffp) { + /* yes - exit with EEXIST */ + errno = EEXIST; + return (0); + } + pad = strchr(padchar, *trv); + if (pad == NULL) { + /* this should never happen */ + errno = EIO; + return (0); + } + /* increment character */ + *trv = (*++pad == '\0') ? padchar[0] : *pad; + /* carry to next position? */ + if (*trv == *carryp) { + /* increment position and loop */ + ++trv; + ++carryp; + } else { + /* try with new name */ + break; + } + } + } + /*NOTREACHED*/ +} + +static find_temp_path_progress_t +_mkostemps_action(int dfd, char *path, void *ctx, void *result) +{ + int oflags = (ctx != NULL) ? *((int *) ctx) : 0; + int fd = openat(dfd, path, O_CREAT|O_EXCL|O_RDWR|oflags, 0600); + if (fd >= 0) { + *((int *) result) = fd; + return FTPP_DONE; + } + return (errno == EEXIST) ? + FTPP_TRY_NEXT : + FTPP_ERROR; // errno is set already +} + +static find_temp_path_progress_t +_mktemp_action(int dfd, char *path, void *ctx __unused, void *result __unused) +{ + struct stat sbuf; + if (fstatat(dfd, path, &sbuf, AT_SYMLINK_NOFOLLOW)) { + // stat failed + return (errno == ENOENT) ? + FTPP_DONE : // path is vacant, done + FTPP_ERROR; // errno is set already + } + return FTPP_TRY_NEXT; +} + +static find_temp_path_progress_t +_mkdtemp_action(int dfd, char *path, void *ctx __unused, void *result __unused) +{ + if (mkdirat(dfd, path, 0700) == 0) + return FTPP_DONE; + return (errno == EEXIST) ? + FTPP_TRY_NEXT : + FTPP_ERROR; // errno is set already +} + +static find_temp_path_progress_t +_mkstemp_dprotected_np_action(int dfd, char *path, void *ctx, void *result) +{ + assert(dfd == AT_FDCWD); + + int class = ((int *) ctx)[0]; + int dpflags = ((int *) ctx)[1]; + int fd = open_dprotected_np(path, O_CREAT|O_EXCL|O_RDWR, class, dpflags, 0600); + if (fd >= 0) { + *((int *) result) = fd; + return FTPP_DONE; + } + return (errno == EEXIST) ? + FTPP_TRY_NEXT : + FTPP_ERROR; // errno is set already +} + + diff --git a/stdio/FreeBSD/open_memstream.3 b/stdio/FreeBSD/open_memstream.3 new file mode 100644 index 0000000..8e2c1e9 --- /dev/null +++ b/stdio/FreeBSD/open_memstream.3 @@ -0,0 +1,155 @@ +.\" Copyright (c) 2013 Hudson River Trading LLC +.\" Written by: John H. Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 1, 2015 +.Dt OPEN_MEMSTREAM 3 +.Os +.Sh NAME +.Nm open_memstream , +.Nm open_wmemstream +.Nd dynamic memory buffer stream open functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft FILE * +.Fn open_memstream "char **bufp" "size_t *sizep" +.In wchar.h +.Ft FILE * +.Fn open_wmemstream "wchar_t **bufp" "size_t *sizep" +.Sh DESCRIPTION +The +.Fn open_memstream +and +.Fn open_wmemstream +functions create a write-only, seekable stream backed by a dynamically +allocated memory buffer. +The +.Fn open_memstream +function creates a byte-oriented stream, +while the +.Fn open_wmemstream +function creates a wide-oriented stream. +.Pp +Each stream maintains a current position and size. +Initially, +the position and size are set to zero. +Each write begins at the current position and advances it the number of +successfully written bytes for +.Fn open_memstream +or wide characters for +.Fn open_wmemstream . +If a write moves the current position beyond the length of the buffer, +the length of the buffer is extended and a null character is appended to the +buffer. +.Pp +A stream's buffer always contains a null character at the end of the buffer +that is not included in the current length. +.Pp +If a stream's current position is moved beyond the current length via a +seek operation and a write is performed, +the characters between the current length and the current position are filled +with null characters before the write is performed. +.Pp +After a successful call to +.Xr fclose 3 +or +.Xr fflush 3 , +the pointer referenced by +.Fa bufp +will contain the start of the memory buffer and the variable referenced by +.Fa sizep +will contain the smaller of the current position and the current buffer length. +.Pp +After a successful call to +.Xr fflush 3 , +the pointer referenced by +.Fa bufp +and the variable referenced by +.Fa sizep +are only valid until the next write operation or a call to +.Xr fclose 3 . +.Pp +Once a stream is closed, +the allocated buffer referenced by +.Fa bufp +should be released via a call to +.Xr free 3 +when it is no longer needed. +.Sh IMPLEMENTATION NOTES +Internally all I/O streams are effectively byte-oriented, +so using wide-oriented operations to write to a stream opened via +.Fn open_wmemstream +results in wide characters being expanded to a stream of multibyte characters +in stdio's internal buffers. +These multibyte characters are then converted back to wide characters when +written into the stream. +As a result, +the wide-oriented streams maintain an internal multibyte character conversion +state that is cleared on any seek opertion that changes the current position. +This should have no effect as long as wide-oriented output operations are used +on a wide-oriented stream. +.Sh RETURN VALUES +Upon successful completion, +.Fn open_memstream +and +.Fn open_wmemstream +return a +.Tn FILE +pointer. +Otherwise, +.Dv NULL +is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa bufp +or +.Fa sizep +argument was +.Dv NULL . +.It Bq Er ENOMEM +Memory for the stream or buffer could not be allocated. +.El +.Sh SEE ALSO +.Xr fclose 3 , +.Xr fflush 3 , +.Xr fopen 3 , +.Xr free 3 , +.Xr fseek 3 , +.Xr stdio 3 , +.Xr sbuf 9 +.Sh STANDARDS +The +.Fn open_memstream +and +.Fn open_wmemstream +functions conform to +.St -p1003.1-2008 . diff --git a/stdio/FreeBSD/open_memstream.c b/stdio/FreeBSD/open_memstream.c new file mode 100644 index 0000000..e36f3e6 --- /dev/null +++ b/stdio/FreeBSD/open_memstream.c @@ -0,0 +1,223 @@ +/*- + * Copyright (c) 2013 Hudson River Trading LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#ifdef DEBUG +#include +#endif +#include +#include +#include +#include +#include + +/* XXX: There is no FPOS_MAX. This assumes fpos_t is an off_t. */ +#define FPOS_MAX OFF_MAX + +struct memstream { + char **bufp; + size_t *sizep; + ssize_t len; + fpos_t offset; +}; + +static int +memstream_grow(struct memstream *ms, fpos_t newoff) +{ + char *buf; + ssize_t newsize; + + if (newoff < 0 || newoff >= SSIZE_MAX) + newsize = SSIZE_MAX - 1; + else + newsize = newoff; + if (newsize > ms->len) { + /* + * Grow by 1.5x (15 / 10). + */ + ssize_t growsize; + bool ovf = os_mul_overflow(ms->len, 15, &growsize); + if (ovf) { + growsize = SSIZE_MAX - 1; + } else { + growsize /= 10; + } + newsize = MAX(growsize, newsize); + + buf = realloc(*ms->bufp, newsize + 1); + if (buf != NULL) { +#ifdef DEBUG + fprintf(stderr, "MS: %p growing from %zd to %zd\n", + ms, ms->len, newsize); +#endif + memset(buf + ms->len + 1, 0, newsize - ms->len); + *ms->bufp = buf; + ms->len = newsize; + return (1); + } + return (0); + } + return (1); +} + +static void +memstream_update(struct memstream *ms) +{ + assert(ms->len >= 0 && ms->offset >= 0); + *ms->sizep = ms->len < ms->offset ? ms->len : ms->offset; +} + +static int +memstream_write(void *cookie, const char *buf, int len) +{ + struct memstream *ms; + ssize_t tocopy; + + ms = cookie; + if (!memstream_grow(ms, ms->offset + len)) + return (-1); + tocopy = ms->len - ms->offset; + if (len < tocopy) + tocopy = len; + memcpy(*ms->bufp + ms->offset, buf, tocopy); + ms->offset += tocopy; + memstream_update(ms); +#ifdef DEBUG + fprintf(stderr, "MS: write(%p, %d) = %zd\n", ms, len, tocopy); +#endif + return (tocopy); +} + +static fpos_t +memstream_seek(void *cookie, fpos_t pos, int whence) +{ + struct memstream *ms; +#ifdef DEBUG + fpos_t old; +#endif + + ms = cookie; +#ifdef DEBUG + old = ms->offset; +#endif + switch (whence) { + case SEEK_SET: + /* _fseeko() checks for negative offsets. */ + assert(pos >= 0); + ms->offset = pos; + break; + case SEEK_CUR: + /* This is only called by _ftello(). */ + assert(pos == 0); + break; + case SEEK_END: + if (pos < 0) { + if (pos + ms->len < 0) { +#ifdef DEBUG + fprintf(stderr, + "MS: bad SEEK_END: pos %jd, len %zd\n", + (intmax_t)pos, ms->len); +#endif + errno = EINVAL; + return (-1); + } + } else { + if (FPOS_MAX - ms->len < pos) { +#ifdef DEBUG + fprintf(stderr, + "MS: bad SEEK_END: pos %jd, len %zd\n", + (intmax_t)pos, ms->len); +#endif + errno = EOVERFLOW; + return (-1); + } + } + ms->offset = ms->len + pos; + break; + } + memstream_update(ms); +#ifdef DEBUG + fprintf(stderr, "MS: seek(%p, %jd, %d) %jd -> %jd\n", ms, (intmax_t)pos, + whence, (intmax_t)old, (intmax_t)ms->offset); +#endif + return (ms->offset); +} + +static int +memstream_close(void *cookie) +{ + + free(cookie); + return (0); +} + +FILE * +open_memstream(char **bufp, size_t *sizep) +{ + struct memstream *ms; + int save_errno; + FILE *fp; + + if (bufp == NULL || sizep == NULL) { + errno = EINVAL; + return (NULL); + } + *bufp = calloc(1, 1); + if (*bufp == NULL) + return (NULL); + ms = malloc(sizeof(*ms)); + if (ms == NULL) { + save_errno = errno; + free(*bufp); + *bufp = NULL; + errno = save_errno; + return (NULL); + } + ms->bufp = bufp; + ms->sizep = sizep; + ms->len = 0; + ms->offset = 0; + memstream_update(ms); + fp = funopen(ms, NULL, memstream_write, memstream_seek, + memstream_close); + if (fp == NULL) { + save_errno = errno; + free(ms); + free(*bufp); + *bufp = NULL; + errno = save_errno; + return (NULL); + } + fwide(fp, -1); + return (fp); +} diff --git a/stdio/FreeBSD/open_wmemstream.c b/stdio/FreeBSD/open_wmemstream.c new file mode 100644 index 0000000..948a90b --- /dev/null +++ b/stdio/FreeBSD/open_wmemstream.c @@ -0,0 +1,274 @@ +/*- + * Copyright (c) 2013 Hudson River Trading LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#ifdef DEBUG +#include +#endif +#include +#include +#include +#include + +#include + +/* XXX: There is no FPOS_MAX. This assumes fpos_t is an off_t. */ +#define FPOS_MAX OFF_MAX + +struct wmemstream { + wchar_t **bufp; + size_t *sizep; + ssize_t len; + fpos_t offset; + mbstate_t mbstate; +}; + +static int +wmemstream_grow(struct wmemstream *ms, fpos_t newoff) +{ + wchar_t *buf; + ssize_t newsize; + + if (newoff < 0 || newoff >= SSIZE_MAX / sizeof(wchar_t)) + newsize = SSIZE_MAX / sizeof(wchar_t) - 1; + else + newsize = newoff; + if (newsize > ms->len) { + buf = reallocarray(*ms->bufp, newsize + 1, sizeof(wchar_t)); + if (buf != NULL) { +#ifdef DEBUG + fprintf(stderr, "WMS: %p growing from %zd to %zd\n", + ms, ms->len, newsize); +#endif + wmemset(buf + ms->len + 1, 0, newsize - ms->len); + *ms->bufp = buf; + ms->len = newsize; + return (1); + } + return (0); + } + return (1); +} + +static void +wmemstream_update(struct wmemstream *ms) +{ + + assert(ms->len >= 0 && ms->offset >= 0); + *ms->sizep = ms->len < ms->offset ? ms->len : ms->offset; +} + +/* + * Based on a starting multibyte state and an input buffer, determine + * how many wchar_t's would be output. This doesn't use mbsnrtowcs() + * so that it can handle embedded null characters. + */ +static size_t +wbuflen(const mbstate_t *state, const char *buf, int len) +{ + mbstate_t lenstate; + size_t charlen, count; + + count = 0; + lenstate = *state; + while (len > 0) { + charlen = mbrlen(buf, len, &lenstate); + if (charlen == (size_t)-1) + return (-1); + if (charlen == (size_t)-2) + break; + if (charlen == 0) + /* XXX: Not sure how else to handle this. */ + charlen = 1; + len -= charlen; + buf += charlen; + count++; + } + return (count); +} + +static int +wmemstream_write(void *cookie, const char *buf, int len) +{ + struct wmemstream *ms; + ssize_t consumed, wlen; + size_t charlen; + + ms = cookie; + wlen = wbuflen(&ms->mbstate, buf, len); + if (wlen < 0) { + errno = EILSEQ; + return (-1); + } + if (!wmemstream_grow(ms, ms->offset + wlen)) + return (-1); + + /* + * This copies characters one at a time rather than using + * mbsnrtowcs() so it can properly handle embedded null + * characters. + */ + consumed = 0; + while (len > 0 && ms->offset < ms->len) { + charlen = mbrtowc(*ms->bufp + ms->offset, buf, len, + &ms->mbstate); + if (charlen == (size_t)-1) { + if (consumed == 0) { + errno = EILSEQ; + return (-1); + } + /* Treat it as a successful short write. */ + break; + } + if (charlen == 0) + /* XXX: Not sure how else to handle this. */ + charlen = 1; + if (charlen == (size_t)-2) { + consumed += len; + len = 0; + } else { + consumed += charlen; + buf += charlen; + len -= charlen; + ms->offset++; + } + } + wmemstream_update(ms); +#ifdef DEBUG + fprintf(stderr, "WMS: write(%p, %d) = %zd\n", ms, len, consumed); +#endif + return (consumed); +} + +static fpos_t +wmemstream_seek(void *cookie, fpos_t pos, int whence) +{ + struct wmemstream *ms; + fpos_t old; + + ms = cookie; + old = ms->offset; + switch (whence) { + case SEEK_SET: + /* _fseeko() checks for negative offsets. */ + assert(pos >= 0); + ms->offset = pos; + break; + case SEEK_CUR: + /* This is only called by _ftello(). */ + assert(pos == 0); + break; + case SEEK_END: + if (pos < 0) { + if (pos + ms->len < 0) { +#ifdef DEBUG + fprintf(stderr, + "WMS: bad SEEK_END: pos %jd, len %zd\n", + (intmax_t)pos, ms->len); +#endif + errno = EINVAL; + return (-1); + } + } else { + if (FPOS_MAX - ms->len < pos) { +#ifdef DEBUG + fprintf(stderr, + "WMS: bad SEEK_END: pos %jd, len %zd\n", + (intmax_t)pos, ms->len); +#endif + errno = EOVERFLOW; + return (-1); + } + } + ms->offset = ms->len + pos; + break; + } + /* Reset the multibyte state if a seek changes the position. */ + if (ms->offset != old) + memset(&ms->mbstate, 0, sizeof(ms->mbstate)); + wmemstream_update(ms); +#ifdef DEBUG + fprintf(stderr, "WMS: seek(%p, %jd, %d) %jd -> %jd\n", ms, + (intmax_t)pos, whence, (intmax_t)old, (intmax_t)ms->offset); +#endif + return (ms->offset); +} + +static int +wmemstream_close(void *cookie) +{ + + free(cookie); + return (0); +} + +FILE * +open_wmemstream(wchar_t **bufp, size_t *sizep) +{ + struct wmemstream *ms; + int save_errno; + FILE *fp; + + if (bufp == NULL || sizep == NULL) { + errno = EINVAL; + return (NULL); + } + *bufp = calloc(1, sizeof(wchar_t)); + if (*bufp == NULL) + return (NULL); + ms = malloc(sizeof(*ms)); + if (ms == NULL) { + save_errno = errno; + free(*bufp); + *bufp = NULL; + errno = save_errno; + return (NULL); + } + ms->bufp = bufp; + ms->sizep = sizep; + ms->len = 0; + ms->offset = 0; + memset(&ms->mbstate, 0, sizeof(mbstate_t)); + wmemstream_update(ms); + fp = funopen(ms, NULL, wmemstream_write, wmemstream_seek, + wmemstream_close); + if (fp == NULL) { + save_errno = errno; + free(ms); + free(*bufp); + *bufp = NULL; + errno = save_errno; + return (NULL); + } + fwide(fp, 1); + return (fp); +} diff --git a/stdio/FreeBSD/perror.c b/stdio/FreeBSD/perror.c new file mode 100644 index 0000000..25d147f --- /dev/null +++ b/stdio/FreeBSD/perror.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)perror.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/perror.c,v 1.9 2007/01/09 00:28:07 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +void +perror(s) + const char *s; +{ + char msgbuf[NL_TEXTMAX]; + struct iovec *v; + struct iovec iov[4]; + + v = iov; + if (s != NULL && *s != '\0') { + v->iov_base = (char *)s; + v->iov_len = strlen(s); + v++; + v->iov_base = ": "; + v->iov_len = 2; + v++; + } + strerror_r(errno, msgbuf, sizeof(msgbuf)); + v->iov_base = msgbuf; + v->iov_len = strlen(v->iov_base); + v++; + v->iov_base = "\n"; + v->iov_len = 1; + FLOCKFILE(stderr); + __sflush(stderr); + (void)_writev(stderr->_file, iov, (v - iov) + 1); + stderr->_flags &= ~__SOFF; + FUNLOCKFILE(stderr); +} diff --git a/stdio/FreeBSD/printf-pos.c b/stdio/FreeBSD/printf-pos.c new file mode 100644 index 0000000..4de7aba --- /dev/null +++ b/stdio/FreeBSD/printf-pos.c @@ -0,0 +1,798 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/printf-pos.c,v 1.6 2009/03/02 04:07:58 das Exp $"); + +/* + * This is the code responsible for handling positional arguments + * (%m$ and %m$.n$) for vfprintf() and vfwprintf(). + */ + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "un-namespace.h" +#include "printflocal.h" + +/* + * Type ids for argument type table. + */ +enum typeid { + T_UNUSED, TP_SHORT, T_INT, T_U_INT, TP_INT, + T_LONG, T_U_LONG, TP_LONG, T_LLONG, T_U_LLONG, TP_LLONG, + T_PTRDIFFT, TP_PTRDIFFT, T_SSIZET, T_SIZET, TP_SSIZET, + T_INTMAXT, T_UINTMAXT, TP_INTMAXT, TP_VOID, TP_CHAR, TP_SCHAR, + T_DOUBLE, T_LONG_DOUBLE, T_WINT, TP_WCHAR, +#ifdef VECTORS + T_VECTOR, +#endif +}; + +/* An expandable array of types. */ +struct typetable { + enum typeid *table; /* table of types */ + enum typeid stattable[STATIC_ARG_TBL_SIZE]; + int tablesize; /* current size of type table */ + int tablemax; /* largest used index in table */ + int nextarg; /* 1-based argument index */ +}; + +static int __grow_type_table(struct typetable *); +static void build_arg_table (struct typetable *, va_list, union arg **); + +/* + * Initialize a struct typetable. + */ +static inline void +inittypes(struct typetable *types) +{ + int n; + + types->table = types->stattable; + types->tablesize = STATIC_ARG_TBL_SIZE; + types->tablemax = 0; + types->nextarg = 1; + for (n = 0; n < STATIC_ARG_TBL_SIZE; n++) + types->table[n] = T_UNUSED; +} + +/* + * struct typetable destructor. + */ +static inline void +freetypes(struct typetable *types) +{ + + if (types->table != types->stattable) + free (types->table); +} + +/* + * Ensure that there is space to add a new argument type to the type table. + * Expand the table if necessary. Returns 0 on success. + */ +static inline int +_ensurespace(struct typetable *types) +{ + + if (types->nextarg >= types->tablesize) { + if (__grow_type_table(types)) + return (-1); + } + if (types->nextarg > types->tablemax) + types->tablemax = types->nextarg; + return (0); +} + +/* + * Add an argument type to the table, expanding if necessary. + * Returns 0 on success. + */ +static inline int +addtype(struct typetable *types, enum typeid type) +{ + + if (_ensurespace(types)) + return (-1); + types->table[types->nextarg++] = type; + return (0); +} + +static inline int +addsarg(struct typetable *types, int flags) +{ + + if (_ensurespace(types)) + return (-1); + if (flags & INTMAXT) + types->table[types->nextarg++] = T_INTMAXT; + else if (flags & SIZET) + types->table[types->nextarg++] = T_SSIZET; + else if (flags & PTRDIFFT) + types->table[types->nextarg++] = T_PTRDIFFT; + else if (flags & LLONGINT) + types->table[types->nextarg++] = T_LLONG; + else if (flags & LONGINT) + types->table[types->nextarg++] = T_LONG; + else + types->table[types->nextarg++] = T_INT; + return (0); +} + +static inline int +adduarg(struct typetable *types, int flags) +{ + + if (_ensurespace(types)) + return (-1); + if (flags & INTMAXT) + types->table[types->nextarg++] = T_UINTMAXT; + else if (flags & SIZET) + types->table[types->nextarg++] = T_SIZET; + else if (flags & PTRDIFFT) + types->table[types->nextarg++] = T_SIZET; + else if (flags & LLONGINT) + types->table[types->nextarg++] = T_U_LLONG; + else if (flags & LONGINT) + types->table[types->nextarg++] = T_U_LONG; + else + types->table[types->nextarg++] = T_U_INT; + return (0); +} + +/* + * Add * arguments to the type array. + */ +static inline int +addaster(struct typetable *types, char **fmtp) +{ + char *cp; + int n2; + + n2 = 0; + cp = *fmtp; + while (is_digit(*cp)) { + n2 = 10 * n2 + to_digit(*cp); + cp++; + } + if (*cp == '$') { + int hold = types->nextarg; + types->nextarg = n2; + if (addtype(types, T_INT)) + return (-1); + types->nextarg = hold; + *fmtp = ++cp; + } else { + if (addtype(types, T_INT)) + return (-1); + } + return (0); +} + +static inline int +addwaster(struct typetable *types, wchar_t **fmtp) +{ + wchar_t *cp; + int n2; + + n2 = 0; + cp = *fmtp; + while (is_digit(*cp)) { + n2 = 10 * n2 + to_digit(*cp); + cp++; + } + if (*cp == '$') { + int hold = types->nextarg; + types->nextarg = n2; + if (addtype(types, T_INT)) + return (-1); + types->nextarg = hold; + *fmtp = ++cp; + } else { + if (addtype(types, T_INT)) + return (-1); + } + return (0); +} + +/* + * Find all arguments when a positional parameter is encountered. Returns a + * table, indexed by argument number, of pointers to each arguments. The + * initial argument table should be an array of STATIC_ARG_TBL_SIZE entries. + * It will be replaces with a malloc-ed one if it overflows. + * Returns 0 on success. On failure, returns nonzero and sets errno. + */ +__private_extern__ int +__find_arguments (const char *fmt0, va_list ap, union arg **argtable) +{ + char *fmt; /* format string */ + int ch; /* character from fmt */ + int n; /* handy integer (short term usage) */ + int error; + int flags; /* flags as above */ + int width; /* width from format (%8d), or 0 */ + struct typetable types; /* table of types */ + + fmt = (char *)fmt0; + inittypes(&types); + error = 0; + + /* + * Scan the format for conversions (`%' character). + */ + for (;;) { + while ((ch = *fmt) != '\0' && ch != '%') + fmt++; + if (ch == '\0') + goto done; + fmt++; /* skip over '%' */ + + flags = 0; + width = 0; + +rflag: ch = *fmt++; +reswitch: switch (ch) { + case ' ': + case '#': + goto rflag; + case '*': + if ((error = addaster(&types, &fmt))) + goto error; + goto rflag; + case '-': + case '+': + case '\'': + goto rflag; + case '.': + if ((ch = *fmt++) == '*') { + if ((error = addaster(&types, &fmt))) + goto error; + goto rflag; + } + while (is_digit(ch)) { + ch = *fmt++; + } + goto reswitch; + case '0': + goto rflag; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + n = 0; + do { + n = 10 * n + to_digit(ch); + ch = *fmt++; + } while (is_digit(ch)); + if (ch == '$') { + types.nextarg = n; + goto rflag; + } + width = n; + goto reswitch; +#ifndef NO_FLOATING_POINT + case 'L': + flags |= LONGDBL; + goto rflag; +#endif + case 'h': + if (flags & SHORTINT) { + flags &= ~SHORTINT; + flags |= CHARINT; + } else + flags |= SHORTINT; + goto rflag; + case 'j': + flags |= INTMAXT; + goto rflag; + case 'l': + if (flags & LONGINT) { + flags &= ~LONGINT; + flags |= LLONGINT; + } else + flags |= LONGINT; + goto rflag; + case 'q': + flags |= LLONGINT; /* not necessarily */ + goto rflag; + case 't': + flags |= PTRDIFFT; + goto rflag; + case 'z': + flags |= SIZET; + goto rflag; + case 'C': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'c': + error = addtype(&types, +#ifdef VECTORS + (flags & LONGINT) ? T_WINT : ((flags & VECTOR) ? T_VECTOR : T_INT)); +#else + (flags & LONGINT) ? T_WINT : T_INT); +#endif + if (error) + goto error; + break; + case 'D': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'd': + case 'i': +#ifdef VECTORS + if (flags & VECTOR) { + if ((error = addtype(&types, T_VECTOR))) + goto error; + } else +#endif + if ((error = addsarg(&types, flags))) + goto error; + break; +#ifndef NO_FLOATING_POINT + case 'a': + case 'A': + case 'e': + case 'E': + case 'f': + case 'F': + case 'g': + case 'G': + error = addtype(&types, +#ifdef VECTORS + (flags & VECTOR) ? T_VECTOR : ((flags & LONGDBL) ? T_LONG_DOUBLE : T_DOUBLE)); +#else + (flags & LONGDBL) ? T_LONG_DOUBLE : T_DOUBLE); +#endif + if (error) + goto error; + break; +#endif /* !NO_FLOATING_POINT */ + case 'n': + if (flags & INTMAXT) + error = addtype(&types, TP_INTMAXT); + else if (flags & PTRDIFFT) + error = addtype(&types, TP_PTRDIFFT); + else if (flags & SIZET) + error = addtype(&types, TP_SSIZET); + else if (flags & LLONGINT) + error = addtype(&types, TP_LLONG); + else if (flags & LONGINT) + error = addtype(&types, TP_LONG); + else if (flags & SHORTINT) + error = addtype(&types, TP_SHORT); + else if (flags & CHARINT) + error = addtype(&types, TP_SCHAR); + else + error = addtype(&types, TP_INT); + if (error) + goto error; + continue; /* no output */ + case 'O': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'o': +#ifdef VECTORS + if (flags & VECTOR) { + if ((error = addtype(&types, T_VECTOR))) + goto error; + } else +#endif + if ((error = adduarg(&types, flags))) + goto error; + break; + case 'p': +#ifdef VECTORS + if ((error = addtype(&types, (flags & VECTOR) ? T_VECTOR : TP_VOID))) +#else + if ((error = addtype(&types, TP_VOID))) +#endif + goto error; + break; + case 'S': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 's': + error = addtype(&types, + (flags & LONGINT) ? TP_WCHAR : TP_CHAR); + if (error) + goto error; + break; + case 'U': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'u': + case 'X': + case 'x': +#ifdef VECTORS + if (flags & VECTOR) { + if ((error = addtype(&types, T_VECTOR))) + goto error; + } else +#endif + if ((error = adduarg(&types, flags))) + goto error; + break; + default: /* "%?" prints ?, unless ? is NUL */ + if (ch == '\0') + goto done; + break; + } + } +done: + build_arg_table(&types, ap, argtable); +error: + freetypes(&types); + return (error || *argtable == NULL); +} + +/* wchar version of __find_arguments. */ +__private_extern__ int +__find_warguments (const wchar_t *fmt0, va_list ap, union arg **argtable) +{ + wchar_t *fmt; /* format string */ + wchar_t ch; /* character from fmt */ + int n; /* handy integer (short term usage) */ + int error; + int flags; /* flags as above */ + int width; /* width from format (%8d), or 0 */ + struct typetable types; /* table of types */ + + fmt = (wchar_t *)fmt0; + inittypes(&types); + error = 0; + + /* + * Scan the format for conversions (`%' character). + */ + for (;;) { + while ((ch = *fmt) != '\0' && ch != '%') + fmt++; + if (ch == '\0') + goto done; + fmt++; /* skip over '%' */ + + flags = 0; + width = 0; + +rflag: ch = *fmt++; +reswitch: switch (ch) { + case ' ': + case '#': + goto rflag; + case '*': + if ((error = addwaster(&types, &fmt))) + goto error; + goto rflag; + case '-': + case '+': + case '\'': + goto rflag; + case '.': + if ((ch = *fmt++) == '*') { + if ((error = addwaster(&types, &fmt))) + goto error; + goto rflag; + } + while (is_digit(ch)) { + ch = *fmt++; + } + goto reswitch; + case '0': + goto rflag; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + n = 0; + do { + n = 10 * n + to_digit(ch); + ch = *fmt++; + } while (is_digit(ch)); + if (ch == '$') { + types.nextarg = n; + goto rflag; + } + width = n; + goto reswitch; +#ifndef NO_FLOATING_POINT + case 'L': + flags |= LONGDBL; + goto rflag; +#endif + case 'h': + if (flags & SHORTINT) { + flags &= ~SHORTINT; + flags |= CHARINT; + } else + flags |= SHORTINT; + goto rflag; + case 'j': + flags |= INTMAXT; + goto rflag; + case 'l': + if (flags & LONGINT) { + flags &= ~LONGINT; + flags |= LLONGINT; + } else + flags |= LONGINT; + goto rflag; + case 'q': + flags |= LLONGINT; /* not necessarily */ + goto rflag; + case 't': + flags |= PTRDIFFT; + goto rflag; + case 'z': + flags |= SIZET; + goto rflag; + case 'C': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'c': + error = addtype(&types, + (flags & LONGINT) ? T_WINT : T_INT); + if (error) + goto error; + break; + case 'D': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'd': + case 'i': + if ((error = addsarg(&types, flags))) + goto error; + break; +#ifndef NO_FLOATING_POINT + case 'a': + case 'A': + case 'e': + case 'E': + case 'f': + case 'F': + case 'g': + case 'G': + error = addtype(&types, + (flags & LONGDBL) ? T_LONG_DOUBLE : T_DOUBLE); + if (error) + goto error; + break; +#endif /* !NO_FLOATING_POINT */ + case 'n': + if (flags & INTMAXT) + error = addtype(&types, TP_INTMAXT); + else if (flags & PTRDIFFT) + error = addtype(&types, TP_PTRDIFFT); + else if (flags & SIZET) + error = addtype(&types, TP_SSIZET); + else if (flags & LLONGINT) + error = addtype(&types, TP_LLONG); + else if (flags & LONGINT) + error = addtype(&types, TP_LONG); + else if (flags & SHORTINT) + error = addtype(&types, TP_SHORT); + else if (flags & CHARINT) + error = addtype(&types, TP_SCHAR); + else + error = addtype(&types, TP_INT); + if (error) + goto error; + continue; /* no output */ + case 'O': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'o': + if ((error = adduarg(&types, flags))) + goto error; + break; + case 'p': + if ((error = addtype(&types, TP_VOID))) + goto error; + break; + case 'S': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 's': + error = addtype(&types, + (flags & LONGINT) ? TP_WCHAR : TP_CHAR); + if (error) + goto error; + break; + case 'U': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'u': + case 'X': + case 'x': + if ((error = adduarg(&types, flags))) + goto error; + break; + default: /* "%?" prints ?, unless ? is NUL */ + if (ch == '\0') + goto done; + break; + } + } +done: + build_arg_table(&types, ap, argtable); +error: + freetypes(&types); + return (error || *argtable == NULL); +} + +/* + * Increase the size of the type table. Returns 0 on success. + */ +static int +__grow_type_table(struct typetable *types) +{ + enum typeid *const oldtable = types->table; + const int oldsize = types->tablesize; + enum typeid *newtable; + int n, newsize = oldsize * 2; + + if (newsize < types->nextarg + 1) + newsize = types->nextarg + 1; + if (oldsize == STATIC_ARG_TBL_SIZE) { + if ((newtable = malloc(newsize * sizeof(enum typeid))) == NULL) + return (-1); + bcopy(oldtable, newtable, oldsize * sizeof(enum typeid)); + } else { + newtable = realloc(oldtable, newsize * sizeof(enum typeid)); + if (newtable == NULL) + return (-1); + } + for (n = oldsize; n < newsize; n++) + newtable[n] = T_UNUSED; + + types->table = newtable; + types->tablesize = newsize; + + return (0); +} + +/* + * Build the argument table from the completed type table. + * On malloc failure, *argtable is set to NULL. + */ +static void +build_arg_table(struct typetable *types, va_list ap, union arg **argtable) +{ + int n; + + if (types->tablemax >= STATIC_ARG_TBL_SIZE) { + *argtable = (union arg *) + malloc (sizeof (union arg) * (types->tablemax + 1)); + if (*argtable == NULL) + return; + } + + (*argtable) [0].intarg = 0; + for (n = 1; n <= types->tablemax; n++) { + switch (types->table[n]) { + case T_UNUSED: /* whoops! */ + (*argtable) [n].intarg = va_arg (ap, int); + break; + case TP_SCHAR: + (*argtable) [n].pschararg = va_arg (ap, signed char *); + break; + case TP_SHORT: + (*argtable) [n].pshortarg = va_arg (ap, short *); + break; + case T_INT: + (*argtable) [n].intarg = va_arg (ap, int); + break; + case T_U_INT: + (*argtable) [n].uintarg = va_arg (ap, unsigned int); + break; + case TP_INT: + (*argtable) [n].pintarg = va_arg (ap, int *); + break; + case T_LONG: + (*argtable) [n].longarg = va_arg (ap, long); + break; + case T_U_LONG: + (*argtable) [n].ulongarg = va_arg (ap, unsigned long); + break; + case TP_LONG: + (*argtable) [n].plongarg = va_arg (ap, long *); + break; + case T_LLONG: + (*argtable) [n].longlongarg = va_arg (ap, long long); + break; + case T_U_LLONG: + (*argtable) [n].ulonglongarg = va_arg (ap, unsigned long long); + break; + case TP_LLONG: + (*argtable) [n].plonglongarg = va_arg (ap, long long *); + break; + case T_PTRDIFFT: + (*argtable) [n].ptrdiffarg = va_arg (ap, ptrdiff_t); + break; + case TP_PTRDIFFT: + (*argtable) [n].pptrdiffarg = va_arg (ap, ptrdiff_t *); + break; + case T_SIZET: + (*argtable) [n].sizearg = va_arg (ap, size_t); + break; + case T_SSIZET: + (*argtable) [n].sizearg = va_arg (ap, ssize_t); + break; + case TP_SSIZET: + (*argtable) [n].pssizearg = va_arg (ap, ssize_t *); + break; + case T_INTMAXT: + (*argtable) [n].intmaxarg = va_arg (ap, intmax_t); + break; + case T_UINTMAXT: + (*argtable) [n].uintmaxarg = va_arg (ap, uintmax_t); + break; + case TP_INTMAXT: + (*argtable) [n].pintmaxarg = va_arg (ap, intmax_t *); + break; + case T_DOUBLE: +#ifndef NO_FLOATING_POINT + (*argtable) [n].doublearg = va_arg (ap, double); +#endif + break; + case T_LONG_DOUBLE: +#ifndef NO_FLOATING_POINT + (*argtable) [n].longdoublearg = va_arg (ap, long double); +#endif + break; +#ifdef VECTORS + case T_VECTOR: + (*argtable) [n].vectorarg = va_arg (ap, VECTORTYPE); + break; +#endif /* VECTORS */ + case TP_CHAR: + (*argtable) [n].pchararg = va_arg (ap, char *); + break; + case TP_VOID: + (*argtable) [n].pvoidarg = va_arg (ap, void *); + break; + case T_WINT: + (*argtable) [n].wintarg = va_arg (ap, wint_t); + break; + case TP_WCHAR: + (*argtable) [n].pwchararg = va_arg (ap, wchar_t *); + break; + } + } +} diff --git a/stdio/FreeBSD/printf.3 b/stdio/FreeBSD/printf.3 new file mode 100644 index 0000000..380ffeb --- /dev/null +++ b/stdio/FreeBSD/printf.3 @@ -0,0 +1,957 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)printf.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd December 2, 2009 +.Dt PRINTF 3 +.Os +.Sh NAME +.Nm printf , fprintf , sprintf , snprintf , asprintf , dprintf , +.Nm vprintf , vfprintf, vsprintf , vsnprintf , vasprintf, vdprintf +.Nd formatted output conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn printf "const char * restrict format" ... +.Ft int +.Fn fprintf "FILE * restrict stream" "const char * restrict format" ... +.Ft int +.Fn sprintf "char * restrict str" "const char * restrict format" ... +.Ft int +.Fn snprintf "char * restrict str" "size_t size" "const char * restrict format" ... +.Ft int +.Fn asprintf "char **ret" "const char *format" ... +.Ft int +.Fn dprintf "int fd" "const char * restrict format" ... +.In stdarg.h +.Ft int +.Fn vprintf "const char * restrict format" "va_list ap" +.Ft int +.Fn vfprintf "FILE * restrict stream" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsprintf "char * restrict str" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsnprintf "char * restrict str" "size_t size" "const char * restrict format" "va_list ap" +.Ft int +.Fn vasprintf "char **ret" "const char *format" "va_list ap" +.Ft int +.Fn vdprintf "int fd" "const char * restrict format" "va_list ap" +.Sh DESCRIPTION +The +.Fn printf +family of functions produces output according to a +.Fa format +as described below. +The +.Fn printf +and +.Fn vprintf +functions +write output to +.Dv stdout , +the standard output stream; +.Fn fprintf +and +.Fn vfprintf +write output to the given output +.Fa stream ; +.Fn dprintf +and +.Fn vdprintf +write output to the given file descriptor; +.Fn sprintf , +.Fn snprintf , +.Fn vsprintf , +and +.Fn vsnprintf +write to the character string +.Fa str ; +and +.Fn asprintf +and +.Fn vasprintf +dynamically allocate a new string with +.Xr malloc 3 . +.Pp +Extended locale versions of these functions are documented in +.Xr printf_l 3 . +See +.Xr xlocale 3 +for more information. +.Pp +These functions write the output under the control of a +.Fa format +string that specifies how subsequent arguments +(or arguments accessed via the variable-length argument facilities of +.Xr stdarg 3 ) +are converted for output. +.Pp +The +.Fn asprintf +and +.Fn vasprintf +functions +set +.Fa *ret +to be a pointer to a buffer sufficiently large to hold the formatted string. +This pointer should be passed to +.Xr free 3 +to release the allocated storage when it is no longer needed. +If sufficient space cannot be allocated, +.Fn asprintf +and +.Fn vasprintf +will return \-1 and set +.Fa ret +to be a +.Dv NULL +pointer. +.Pp +The +.Fn snprintf +and +.Fn vsnprintf +functions +will write at most +.Fa size Ns \-1 +of the characters printed into the output string +(the +.Fa size Ns 'th +character then gets the terminating +.Ql \e0 ) ; +if the return value is greater than or equal to the +.Fa size +argument, the string was too short +and some of the printed characters were discarded. +The output is always null-terminated, unless +.Fa size +is 0. +.Pp +The +.Fn sprintf +and +.Fn vsprintf +functions +effectively assume a +.Fa size +of +.Dv INT_MAX + 1. +.Pp +For those routines that write to a user-provided character string, +that string and the format strings should not overlap, as the +behavior is undefined. +.Pp +The format string is composed of zero or more directives: +ordinary +.\" multibyte +characters (not +.Cm % ) , +which are copied unchanged to the output stream; +and conversion specifications, each of which results +in fetching zero or more subsequent arguments. +Each conversion specification is introduced by +the +.Cm % +character. +The arguments must correspond properly (after type promotion) +with the conversion specifier. +After the +.Cm % , +the following appear in sequence: +.Bl -bullet +.It +An optional field, consisting of a decimal digit string followed by a +.Cm $ , +specifying the next argument to access. +If this field is not provided, the argument following the last +argument accessed will be used. +Arguments are numbered starting at +.Cm 1 . +If unaccessed arguments in the format string are interspersed with ones that +are accessed the results will be indeterminate. +.It +Zero or more of the following flags: +.Bl -tag -width ".So \ Sc (space)" +.It Sq Cm # +The value should be converted to an +.Dq alternate form . +For +.Cm c , d , i , n , p , s , +and +.Cm u +conversions, this option has no effect. +For +.Cm o +conversions, the precision of the number is increased to force the first +character of the output string to a zero. +For +.Cm x +and +.Cm X +conversions, a non-zero result has the string +.Ql 0x +(or +.Ql 0X +for +.Cm X +conversions) prepended to it. +For +.Cm a , A , e , E , f , F , g , +and +.Cm G +conversions, the result will always contain a decimal point, even if no +digits follow it (normally, a decimal point appears in the results of +those conversions only if a digit follows). +For +.Cm g +and +.Cm G +conversions, trailing zeros are not removed from the result as they +would otherwise be. +.It So Cm 0 Sc (zero) +Zero padding. +For all conversions except +.Cm n , +the converted value is padded on the left with zeros rather than blanks. +If a precision is given with a numeric conversion +.Cm ( d , i , o , u , i , x , +and +.Cm X ) , +the +.Cm 0 +flag is ignored. +.It Sq Cm \- +A negative field width flag; +the converted value is to be left adjusted on the field boundary. +Except for +.Cm n +conversions, the converted value is padded on the right with blanks, +rather than on the left with blanks or zeros. +A +.Cm \- +overrides a +.Cm 0 +if both are given. +.It So "\ " Sc (space) +A blank should be left before a positive number +produced by a signed conversion +.Cm ( a , A , d , e , E , f , F , g , G , +or +.Cm i ) . +.It Sq Cm + +A sign must always be placed before a +number produced by a signed conversion. +A +.Cm + +overrides a space if both are used. +.It So "'" Sc (apostrophe) +Decimal conversions +.Cm ( d , u , +or +.Cm i ) +or the integral portion of a floating point conversion +.Cm ( f +or +.Cm F ) +should be grouped and separated by thousands using +the non-monetary separator returned by +.Xr localeconv 3 . +.El +.It +An optional separator character ( +.Cm \ , | \; | \ : | _ +) used for separating multiple values when printing an AltiVec or SSE vector, +or other multi-value unit. +.Pp +NOTE: This is an extension to the +.Fn printf +specification. +Behaviour of these values for +.Fn printf +is only defined for operating systems conforming to the +AltiVec Technology Programming Interface Manual. +(At time of writing this includes only Mac OS X 10.2 and later.) +.It +An optional decimal digit string specifying a minimum field width. +If the converted value has fewer characters than the field width, it will +be padded with spaces on the left (or right, if the left-adjustment +flag has been given) to fill out +the field width. +.It +An optional precision, in the form of a period +.Cm \&. +followed by an +optional digit string. +If the digit string is omitted, the precision is taken as zero. +This gives the minimum number of digits to appear for +.Cm d , i , o , u , x , +and +.Cm X +conversions, the number of digits to appear after the decimal-point for +.Cm a , A , e , E , f , +and +.Cm F +conversions, the maximum number of significant digits for +.Cm g +and +.Cm G +conversions, or the maximum number of characters to be printed from a +string for +.Cm s +conversions. +.It +An optional length modifier, that specifies the size of the argument. +The following length modifiers are valid for the +.Cm d , i , n , o , u , x , +or +.Cm X +conversion: +.Bl -column ".Cm q Em (deprecated)" ".Vt signed char" ".Vt unsigned long long" ".Vt long long *" +.It Sy Modifier Ta Cm d , i Ta Cm o , u , x , X Ta Cm n +.It Cm hh Ta Vt "signed char" Ta Vt "unsigned char" Ta Vt "signed char *" +.It Cm h Ta Vt short Ta Vt "unsigned short" Ta Vt "short *" +.It Cm l No (ell) Ta Vt long Ta Vt "unsigned long" Ta Vt "long *" +.It Cm ll No (ell ell) Ta Vt "long long" Ta Vt "unsigned long long" Ta Vt "long long *" +.It Cm j Ta Vt intmax_t Ta Vt uintmax_t Ta Vt "intmax_t *" +.It Cm t Ta Vt ptrdiff_t Ta (see note) Ta Vt "ptrdiff_t *" +.It Cm z Ta (see note) Ta Vt size_t Ta (see note) +.It Cm q Em (deprecated) Ta Vt quad_t Ta Vt u_quad_t Ta Vt "quad_t *" +.El +.Pp +Note: +the +.Cm t +modifier, when applied to a +.Cm o , u , x , +or +.Cm X +conversion, indicates that the argument is of an unsigned type +equivalent in size to a +.Vt ptrdiff_t . +The +.Cm z +modifier, when applied to a +.Cm d +or +.Cm i +conversion, indicates that the argument is of a signed type equivalent in +size to a +.Vt size_t . +Similarly, when applied to an +.Cm n +conversion, it indicates that the argument is a pointer to a signed type +equivalent in size to a +.Vt size_t . +.Pp +The following length modifier is valid for the +.Cm a , A , e , E , f , F , g , +or +.Cm G +conversion: +.Bl -column ".Sy Modifier" ".Cm a , A , e , E , f , F , g , G" +.It Sy Modifier Ta Cm a , A , e , E , f , F , g , G +.It Cm l No (ell) Ta Vt double +(ignored, same behavior as without it) +.It Cm L Ta Vt "long double" +.El +.Pp +The following length modifier is valid for the +.Cm c +or +.Cm s +conversion: +.Bl -column ".Sy Modifier" ".Vt wint_t" ".Vt wchar_t *" +.It Sy Modifier Ta Cm c Ta Cm s +.It Cm l No (ell) Ta Vt wint_t Ta Vt "wchar_t *" +.El +.Pp +The AltiVec Technology Programming Interface Manual also defines five additional length modifiers +which can be used (in place of the conventional length modifiers) for the printing of AltiVec or SSE vectors: +.Bl -tag -compact +.It Cm v +Treat the argument as a vector value, unit length will be determined by the conversion +specifier (default = 16 8-bit units for all integer conversions, +4 32-bit units for floating point conversions). +.It Cm vh, hv +Treat the argument as a vector of 8 16-bit units. +.It Cm vl, lv +Treat the argument as a vector of 4 32-bit units. +.El +.Pp +NOTE: The vector length specifiers are extensions to the +.Fn printf +specification. +Behaviour of these values for +.Fn printf +is only defined for operating systems conforming to the +AltiVec Technology Programming Interface Manual. +(At time of writing this includes only Mac OS X 10.2 and later.) +.Pp +As a further extension, for SSE2 64-bit units: +.Bl -tag -compact +.It Cm vll, llv +Treat the argument as a vector of 2 64-bit units. +.El +.It +A character that specifies the type of conversion to be applied. +.El +.Pp +A field width or precision, or both, may be indicated by +an asterisk +.Ql * +or an asterisk followed by one or more decimal digits and a +.Ql $ +instead of a +digit string. +In this case, an +.Vt int +argument supplies the field width or precision. +A negative field width is treated as a left adjustment flag followed by a +positive field width; a negative precision is treated as though it were +missing. +If a single format directive mixes positional +.Pq Li nn$ +and non-positional arguments, the results are undefined. +.Pp +The conversion specifiers and their meanings are: +.Bl -tag -width ".Cm diouxX" +.It Cm diouxX +The +.Vt int +(or appropriate variant) argument is converted to signed decimal +.Cm ( d +and +.Cm i ) , +unsigned octal +.Pq Cm o , +unsigned decimal +.Pq Cm u , +or unsigned hexadecimal +.Cm ( x +and +.Cm X ) +notation. +The letters +.Dq Li abcdef +are used for +.Cm x +conversions; the letters +.Dq Li ABCDEF +are used for +.Cm X +conversions. +The precision, if any, gives the minimum number of digits that must +appear; if the converted value requires fewer digits, it is padded on +the left with zeros. +.It Cm DOU +The +.Vt "long int" +argument is converted to signed decimal, unsigned octal, or unsigned +decimal, as if the format had been +.Cm ld , lo , +or +.Cm lu +respectively. +These conversion characters are deprecated, and will eventually disappear. +.It Cm eE +The +.Vt double +argument is rounded and converted in the style +.Sm off +.Oo \- Oc Ar d Li \&. Ar ddd Li e \(+- Ar dd +.Sm on +where there is one digit before the +decimal-point character +and the number of digits after it is equal to the precision; +if the precision is missing, +it is taken as 6; if the precision is +zero, no decimal-point character appears. +An +.Cm E +conversion uses the letter +.Ql E +(rather than +.Ql e ) +to introduce the exponent. +The exponent always contains at least two digits; if the value is zero, +the exponent is 00. +.Pp +For +.Cm a , A , e , E , f , F , g , +and +.Cm G +conversions, positive and negative infinity are represented as +.Li inf +and +.Li -inf +respectively when using the lowercase conversion character, and +.Li INF +and +.Li -INF +respectively when using the uppercase conversion character. +Similarly, NaN is represented as +.Li nan +when using the lowercase conversion, and +.Li NAN +when using the uppercase conversion. +.It Cm fF +The +.Vt double +argument is rounded and converted to decimal notation in the style +.Sm off +.Oo \- Oc Ar ddd Li \&. Ar ddd , +.Sm on +where the number of digits after the decimal-point character +is equal to the precision specification. +If the precision is missing, it is taken as 6; if the precision is +explicitly zero, no decimal-point character appears. +If a decimal point appears, at least one digit appears before it. +.It Cm gG +The +.Vt double +argument is converted in style +.Cm f +or +.Cm e +(or +.Cm F +or +.Cm E +for +.Cm G +conversions). +The precision specifies the number of significant digits. +If the precision is missing, 6 digits are given; if the precision is zero, +it is treated as 1. +Style +.Cm e +is used if the exponent from its conversion is less than \-4 or greater than +or equal to the precision. +Trailing zeros are removed from the fractional part of the result; a +decimal point appears only if it is followed by at least one digit. +.It Cm aA +The +.Vt double +argument is rounded and converted to hexadecimal notation in the style +.Sm off +.Oo \- Oc Li 0x Ar h Li \&. Ar hhhp Oo \(+- Oc Ar d , +.Sm on +where the number of digits after the hexadecimal-point character +is equal to the precision specification. +If the precision is missing, it is taken as enough to represent +the floating-point number exactly, and no rounding occurs. +If the precision is zero, no hexadecimal-point character appears. +The +.Cm p +is a literal character +.Ql p , +and the exponent consists of a positive or negative sign +followed by a decimal number representing an exponent of 2. +The +.Cm A +conversion uses the prefix +.Dq Li 0X +(rather than +.Dq Li 0x ) , +the letters +.Dq Li ABCDEF +(rather than +.Dq Li abcdef ) +to represent the hex digits, and the letter +.Ql P +(rather than +.Ql p ) +to separate the mantissa and exponent. +.Pp +Note that there may be multiple valid ways to represent floating-point +numbers in this hexadecimal format. +For example, +.Li 0x1.92p+1 , 0x3.24p+0 , 0x6.48p-1 , +and +.Li 0xc.9p-2 +are all equivalent. +The format chosen depends on the internal representation of the +number, but the implementation guarantees that the length of the +mantissa will be minimized. +Zeroes are always represented with a mantissa of 0 (preceded by a +.Ql - +if appropriate) and an exponent of +.Li +0 . +.It Cm C +Treated as +.Cm c +with the +.Cm l +(ell) modifier. +.It Cm c +The +.Vt int +argument is converted to an +.Vt "unsigned char" , +and the resulting character is written. +.Pp +If the +.Cm l +(ell) modifier is used, the +.Vt wint_t +argument shall be converted to a +.Vt wchar_t , +and the (potentially multi-byte) sequence representing the +single wide character is written, including any shift sequences. +If a shift sequence is used, the shift state is also restored +to the original state after the character. +.It Cm S +Treated as +.Cm s +with the +.Cm l +(ell) modifier. +.It Cm s +The +.Vt "char *" +argument is expected to be a pointer to an array of character type (pointer +to a string). +Characters from the array are written up to (but not including) +a terminating +.Dv NUL +character; +if a precision is specified, no more than the number specified are +written. +If a precision is given, no null character +need be present; if the precision is not specified, or is greater than +the size of the array, the array must contain a terminating +.Dv NUL +character. +.Pp +If the +.Cm l +(ell) modifier is used, the +.Vt "wchar_t *" +argument is expected to be a pointer to an array of wide characters +(pointer to a wide string). +For each wide character in the string, the (potentially multi-byte) +sequence representing the +wide character is written, including any shift sequences. +If any shift sequence is used, the shift state is also restored +to the original state after the string. +Wide characters from the array are written up to (but not including) +a terminating wide +.Dv NUL +character; +if a precision is specified, no more than the number of bytes specified are +written (including shift sequences). +Partial characters are never written. +If a precision is given, no null character +need be present; if the precision is not specified, or is greater than +the number of bytes required to render the multibyte representation of +the string, the array must contain a terminating wide +.Dv NUL +character. +.It Cm p +The +.Vt "void *" +pointer argument is printed in hexadecimal (as if by +.Ql %#x +or +.Ql %#lx ) . +.It Cm n +The number of characters written so far is stored into the +integer indicated by the +.Vt "int *" +(or variant) pointer argument. +No argument is converted. +The +.Fa format +argument must be in write-protected memory if this specifier is used; see +.Sx SECURITY CONSIDERATIONS +below. +.It Cm % +A +.Ql % +is written. +No argument is converted. +The complete conversion specification +is +.Ql %% . +.El +.Pp +The decimal point +character is defined in the program's locale (category +.Dv LC_NUMERIC ) . +.Pp +In no case does a non-existent or small field width cause truncation of +a numeric field; if the result of a conversion is wider than the field +width, the +field is expanded to contain the conversion result. +.Sh RETURN VALUES +These functions return the number of characters printed +(not including the trailing +.Ql \e0 +used to end output to strings), +except for +.Fn snprintf +and +.Fn vsnprintf , +which return the number of characters that would have been printed if the +.Fa size +were unlimited +(again, not including the final +.Ql \e0 ) . +These functions return a negative value if an error occurs. +.Sh EXAMPLES +To print a date and time in the form +.Dq Li "Sunday, July 3, 10:02" , +where +.Fa weekday +and +.Fa month +are pointers to strings: +.Bd -literal -offset indent +#include +fprintf(stdout, "%s, %s %d, %.2d:%.2d\en", + weekday, month, day, hour, min); +.Ed +.Pp +To print \*(Pi +to five decimal places: +.Bd -literal -offset indent +#include +#include +fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0)); +.Ed +.Pp +To allocate a 128 byte string and print into it: +.Bd -literal -offset indent +#include +#include +#include +char *newfmt(const char *fmt, ...) +{ + char *p; + va_list ap; + if ((p = malloc(128)) == NULL) + return (NULL); + va_start(ap, fmt); + (void) vsnprintf(p, 128, fmt, ap); + va_end(ap); + return (p); +} +.Ed +.Sh COMPATIBILITY +The conversion formats +.Cm \&%D , \&%O , +and +.Cm \&%U +are not standard and +are provided only for backward compatibility. +The effect of padding the +.Cm %p +format with zeros (either by the +.Cm 0 +flag or by specifying a precision), and the benign effect (i.e., none) +of the +.Cm # +flag on +.Cm %n +and +.Cm %p +conversions, as well as other +nonsensical combinations such as +.Cm %Ld , +are not standard; such combinations +should be avoided. +.Sh ERRORS +In addition to the errors documented for the +.Xr write 2 +system call, the +.Fn printf +family of functions may fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid wide character code was encountered. +.It Bq Er ENOMEM +Insufficient storage space is available. +.El +.Sh SEE ALSO +.Xr printf 1 , +.Xr printf_l 3 , +.Xr fmtcheck 3 , +.Xr scanf 3 , +.Xr setlocale 3 , +.Xr stdarg 3 , +.Xr wprintf 3 +.Sh STANDARDS +Subject to the caveats noted in the +.Sx BUGS +section below, the +.Fn fprintf , +.Fn printf , +.Fn sprintf , +.Fn vprintf , +.Fn vfprintf , +and +.Fn vsprintf +functions +conform to +.St -ansiC +and +.St -isoC-99 . +With the same reservation, the +.Fn snprintf +and +.Fn vsnprintf +functions conform to +.St -isoC-99 , +while +.Fn dprintf +and +.Fn vdprintf +conform to +.St -p1003.1-2008 . +.Sh HISTORY +The functions +.Fn asprintf +and +.Fn vasprintf +first appeared in the +.Tn GNU C +library. +These were implemented by +.An Peter Wemm Aq Mt peter@FreeBSD.org +in +.Fx 2.2 , +but were later replaced with a different implementation +from +.Ox 2.3 +by +.An Todd C. Miller Aq Mt Todd.Miller@courtesan.com . +The +.Fn dprintf +and +.Fn vdprintf +functions were added in +.Fx 8.0 . +.Sh BUGS +The +.Nm +family of functions do not correctly handle multibyte characters in the +.Fa format +argument. +.Sh SECURITY CONSIDERATIONS +The +.Fn sprintf +and +.Fn vsprintf +functions are easily misused in a manner which enables malicious users +to arbitrarily change a running program's functionality through +a buffer overflow attack. +Because +.Fn sprintf +and +.Fn vsprintf +assume an infinitely long string, +callers must be careful not to overflow the actual space; +this is often hard to assure. +For safety, programmers should use the +.Fn snprintf +interface instead. +For example: +.Bd -literal +void +foo(const char *arbitrary_string, const char *and_another) +{ + char onstack[8]; + +#ifdef BAD + /* + * This first sprintf is bad behavior. Do not use sprintf! + */ + sprintf(onstack, "%s, %s", arbitrary_string, and_another); +#else + /* + * The following two lines demonstrate better use of + * snprintf(). + */ + snprintf(onstack, sizeof(onstack), "%s, %s", arbitrary_string, + and_another); +#endif +} +.Ed +.Pp +The +.Fn printf +and +.Fn sprintf +family of functions are also easily misused in a manner +allowing malicious users to arbitrarily change a running program's +functionality by either causing the program +to print potentially sensitive data +.Dq "left on the stack" , +or causing it to generate a memory fault or bus error +by dereferencing an invalid pointer. +.Pp +.Cm %n +can be used to write arbitrary data to potentially carefully-selected +addresses. +Programmers are therefore strongly advised to never pass untrusted strings +as the +.Fa format +argument, as an attacker can put format specifiers in the string +to mangle your stack, +leading to a possible security hole. +This holds true even if the string was built using a function like +.Fn snprintf , +as the resulting string may still contain user-supplied conversion specifiers +for later interpolation by +.Fn printf . +For this reason, a +.Fa format +argument containing +.Cm %n +is assumed to be untrustworthy if located in writable memory (i.e. memory with +protection PROT_WRITE; see +.Xr mprotect 2 ) +and any attempt to use such an argument is fatal. +Practically, this means that +.Cm %n +is permitted in literal +.Fa format +strings but disallowed in +.Fa format +strings located in normal stack- or heap-allocated memory. +.Pp +Always use the proper secure idiom: +.Pp +.Dl "snprintf(buffer, sizeof(buffer), \*q%s\*q, string);" diff --git a/stdio/FreeBSD/printf.c b/stdio/FreeBSD/printf.c new file mode 100644 index 0000000..e65851a --- /dev/null +++ b/stdio/FreeBSD/printf.c @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)printf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/printf.c,v 1.11 2007/01/09 00:28:07 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include + +int +printf(char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vfprintf_l(stdout, __current_locale(), fmt, ap); + va_end(ap); + return (ret); +} + +int +printf_l(locale_t loc, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + /* no need to call NORMALIZE_LOCALE(loc) because vfprintf_l will */ + va_start(ap, fmt); + ret = vfprintf_l(stdout, loc, fmt, ap); + va_end(ap); + return (ret); +} diff --git a/stdio/FreeBSD/printfcommon.h b/stdio/FreeBSD/printfcommon.h new file mode 100644 index 0000000..889b12e --- /dev/null +++ b/stdio/FreeBSD/printfcommon.h @@ -0,0 +1,301 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/printfcommon.h,v 1.4 2009/01/22 08:14:28 das Exp $ + */ + +/* + * This file defines common routines used by both printf and wprintf. + * You must define CHAR to either char or wchar_t prior to including this. + */ + + +#ifndef NO_FLOATING_POINT + +#define dtoa __dtoa +#define freedtoa __freedtoa + +#include +#include +#include "floatio.h" +#include "gdtoa.h" + +#define DEFPREC 6 + +static int exponent(CHAR *, int, CHAR); + +#endif /* !NO_FLOATING_POINT */ + +static CHAR *__ujtoa(uintmax_t, CHAR *, int, int, const char *); +static CHAR *__ultoa(u_long, CHAR *, int, int, const char *); + +#define NIOV 8 +struct io_state { + FILE *fp; + struct __suio uio; /* output information: summary */ + struct __siov iov[NIOV];/* ... and individual io vectors */ +}; + +static inline void +io_init(struct io_state *iop, FILE *fp) +{ + + iop->uio.uio_iov = iop->iov; + iop->uio.uio_resid = 0; + iop->uio.uio_iovcnt = 0; + iop->fp = fp; +} + +/* + * WARNING: The buffer passed to io_print() is not copied immediately; it must + * remain valid until io_flush() is called. + */ +static inline int +io_print(struct io_state *iop, const CHAR * __restrict ptr, int len, locale_t loc) +{ + + iop->iov[iop->uio.uio_iovcnt].iov_base = (char *)ptr; + iop->iov[iop->uio.uio_iovcnt].iov_len = len; + iop->uio.uio_resid += len; + if (++iop->uio.uio_iovcnt >= NIOV) + return (__sprint(iop->fp, loc, &iop->uio)); + else + return (0); +} + +/* + * Choose PADSIZE to trade efficiency vs. size. If larger printf + * fields occur frequently, increase PADSIZE and make the initialisers + * below longer. + */ +#define PADSIZE 16 /* pad chunk size */ +static const CHAR blanks[PADSIZE] = +{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; +static const CHAR zeroes[PADSIZE] = +{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + +/* + * Pad with blanks or zeroes. 'with' should point to either the blanks array + * or the zeroes array. + */ +static inline int +io_pad(struct io_state *iop, int howmany, const CHAR * __restrict with, locale_t loc) +{ + int n; + + while (howmany > 0) { + n = (howmany >= PADSIZE) ? PADSIZE : howmany; + if (io_print(iop, with, n, loc)) + return (-1); + howmany -= n; + } + return (0); +} + +/* + * Print exactly len characters of the string spanning p to ep, truncating + * or padding with 'with' as necessary. + */ +static inline int +io_printandpad(struct io_state *iop, const CHAR *p, const CHAR *ep, + int len, const CHAR * __restrict with, locale_t loc) +{ + int p_len; + + p_len = (int)(ep - p); + if (p_len > len) + p_len = len; + if (p_len > 0) { + if (io_print(iop, p, p_len, loc)) + return (-1); + } else { + p_len = 0; + } + return (io_pad(iop, len - p_len, with, loc)); +} + +static inline int +io_flush(struct io_state *iop, locale_t loc) +{ + + return (__sprint(iop->fp, loc, &iop->uio)); +} + +/* + * Convert an unsigned long to ASCII for printf purposes, returning + * a pointer to the first character of the string representation. + * Octal numbers can be forced to have a leading zero; hex numbers + * use the given digits. + */ +static CHAR * +__ultoa(u_long val, CHAR *endp, int base, int octzero, const char *xdigs) +{ + CHAR *cp = endp; + long sval; + + /* + * Handle the three cases separately, in the hope of getting + * better/faster code. + */ + switch (base) { + case 10: + if (val < 10) { /* many numbers are 1 digit */ + *--cp = (CHAR)to_char(val); + return (cp); + } + /* + * On many machines, unsigned arithmetic is harder than + * signed arithmetic, so we do at most one unsigned mod and + * divide; this is sufficient to reduce the range of + * the incoming value to where signed arithmetic works. + */ + if (val > LONG_MAX) { + *--cp = to_char(val % 10); + sval = val / 10; + } else + sval = val; + do { + *--cp = to_char(sval % 10); + sval /= 10; + } while (sval != 0); + break; + + case 8: + do { + *--cp = to_char(val & 7); + val >>= 3; + } while (val); + if (octzero && *cp != '0') + *--cp = '0'; + break; + + case 16: + do { + *--cp = xdigs[val & 15]; + val >>= 4; + } while (val); + break; + + default: /* oops */ + LIBC_ABORT("__ultoa: invalid base=%d", base); + } + return (cp); +} + +/* Identical to __ultoa, but for intmax_t. */ +static CHAR * +__ujtoa(uintmax_t val, CHAR *endp, int base, int octzero, const char *xdigs) +{ + CHAR *cp = endp; + intmax_t sval; + + /* quick test for small values; __ultoa is typically much faster */ + /* (perhaps instead we should run until small, then call __ultoa?) */ + if (val <= ULONG_MAX) + return (__ultoa((u_long)val, endp, base, octzero, xdigs)); + switch (base) { + case 10: + if (val < 10) { + *--cp = to_char(val % 10); + return (cp); + } + if (val > INTMAX_MAX) { + *--cp = to_char(val % 10); + sval = val / 10; + } else + sval = val; + do { + *--cp = to_char(sval % 10); + sval /= 10; + } while (sval != 0); + break; + + case 8: + do { + *--cp = to_char(val & 7); + val >>= 3; + } while (val); + if (octzero && *cp != '0') + *--cp = '0'; + break; + + case 16: + do { + *--cp = xdigs[val & 15]; + val >>= 4; + } while (val); + break; + + default: + LIBC_ABORT("__ujtoa: invalid base=%d", base); + } + return (cp); +} + +#ifndef NO_FLOATING_POINT + +static int +exponent(CHAR *p0, int exp, CHAR fmtch) +{ + CHAR *p, *t; + CHAR expbuf[MAXEXPDIG]; + + p = p0; + *p++ = fmtch; + if (exp < 0) { + exp = -exp; + *p++ = '-'; + } + else + *p++ = '+'; + t = expbuf + MAXEXPDIG; + if (exp > 9) { + do { + *--t = to_char(exp % 10); + } while ((exp /= 10) > 9); + *--t = to_char(exp); + for (; t < expbuf + MAXEXPDIG; *p++ = *t++); + } + else { + /* + * Exponents for decimal floating point conversions + * (%[eEgG]) must be at least two characters long, + * whereas exponents for hexadecimal conversions can + * be only one character long. + */ + if (fmtch == 'e' || fmtch == 'E') + *p++ = '0'; + *p++ = to_char(exp); + } + return (int)(p - p0); +} + +#endif /* !NO_FLOATING_POINT */ diff --git a/stdio/FreeBSD/printflocal.h b/stdio/FreeBSD/printflocal.h new file mode 100644 index 0000000..89b24a2 --- /dev/null +++ b/stdio/FreeBSD/printflocal.h @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/printflocal.h,v 1.3 2009/03/02 04:07:58 das Exp $ + */ + +/* + * Defining here VECTORS for all files that include this header () + */ +#ifndef VECTORS +#define VECTORS +typedef __attribute__ ((vector_size(16))) unsigned char VECTORTYPE; +#ifdef __SSE2__ +#define V64TYPE +#endif /* __SSE2__ */ +#endif /* VECTORS */ + +/* + * Flags used during conversion. + */ +#define ALT 0x001 /* alternate form */ +#define LADJUST 0x004 /* left adjustment */ +#define LONGDBL 0x008 /* long double */ +#define LONGINT 0x010 /* long integer */ +#define LLONGINT 0x020 /* long long integer */ +#define SHORTINT 0x040 /* short integer */ +#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */ +#define FPT 0x100 /* Floating point number */ +#define GROUPING 0x200 /* use grouping ("'" flag) */ + /* C99 additional size modifiers: */ +#define SIZET 0x400 /* size_t */ +#define PTRDIFFT 0x800 /* ptrdiff_t */ +#define INTMAXT 0x1000 /* intmax_t */ +#define CHARINT 0x2000 /* print char using int format */ +#ifdef VECTORS +#define VECTOR 0x4000 /* Altivec or SSE vector */ +#endif /* VECTORS */ + +/* + * Macros for converting digits to letters and vice versa + */ +#define to_digit(c) ((c) - '0') +#define is_digit(c) ((unsigned)to_digit(c) <= 9) +#define to_char(n) ((n) + '0') + +/* Size of the static argument table. */ +#define STATIC_ARG_TBL_SIZE 8 + +union arg { + int intarg; + u_int uintarg; + long longarg; + u_long ulongarg; + long long longlongarg; + unsigned long long ulonglongarg; + ptrdiff_t ptrdiffarg; + size_t sizearg; + intmax_t intmaxarg; + uintmax_t uintmaxarg; + void *pvoidarg; + char *pchararg; + signed char *pschararg; + short *pshortarg; + int *pintarg; + long *plongarg; + long long *plonglongarg; + ptrdiff_t *pptrdiffarg; + ssize_t *pssizearg; + intmax_t *pintmaxarg; +#ifndef NO_FLOATING_POINT + double doublearg; + long double longdoublearg; +#endif + wint_t wintarg; + wchar_t *pwchararg; +#ifdef VECTORS + VECTORTYPE vectorarg; + unsigned char vuchararg[16]; + signed char vchararg[16]; + unsigned short vushortarg[8]; + signed short vshortarg[8]; + unsigned int vuintarg[4]; + signed int vintarg[4]; + float vfloatarg[4]; +#ifdef V64TYPE + double vdoublearg[2]; + unsigned long long vulonglongarg[2]; + long long vlonglongarg[2]; +#endif /* V64TYPE */ +#endif /* VECTORS */ +}; + +/* Handle positional parameters. */ +int __find_arguments(const char *, va_list, union arg **); +int __find_warguments(const wchar_t *, va_list, union arg **); diff --git a/stdio/FreeBSD/putc.3 b/stdio/FreeBSD/putc.3 new file mode 100644 index 0000000..b5370aa --- /dev/null +++ b/stdio/FreeBSD/putc.3 @@ -0,0 +1,181 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)putc.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/putc.3,v 1.16 2007/01/09 00:28:07 imp Exp $ +.\" +.Dd January 10, 2003 +.Dt PUTC 3 +.Os +.Sh NAME +.Nm fputc , +.Nm putc , +.Nm putc_unlocked , +.Nm putchar , +.Nm putchar_unlocked , +.Nm putw +.Nd output a character or word to a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fo fputc +.Fa "int c" +.Fa "FILE *stream" +.Fc +.Ft int +.Fo putc +.Fa "int c" +.Fa "FILE *stream" +.Fc +.Ft int +.Fo putc_unlocked +.Fa "int c" +.Fa "FILE *stream" +.Fc +.Ft int +.Fo putchar +.Fa "int c" +.Fc +.Ft int +.Fo putchar_unlocked +.Fa "int c" +.Fc +.Ft int +.Fo putw +.Fa "int w" +.Fa "FILE *stream" +.Fc +.Sh DESCRIPTION +The +.Fn fputc +function +writes the character +.Fa c +(converted to an ``unsigned char'') +to the output stream pointed to by +.Fa stream . +.Pp +The +.Fn putc +macro acts essentially identically to +.Fn fputc , +but is a macro that expands in-line. +It may evaluate +.Fa stream +more than once, so arguments given to +.Fn putc +should not be expressions with potential side effects. +.Pp +The +.Fn putchar +function +is identical to +.Fn putc +with an output stream of +.Dv stdout . +.Pp +The +.Fn putw +function +writes the specified +.Vt int +to the named output +.Fa stream . +.Pp +The +.Fn putc_unlocked +and +.Fn putchar_unlocked +functions are equivalent to +.Fn putc +and +.Fn putchar +respectively, +except that the caller is responsible for locking the stream +with +.Xr flockfile 3 +before calling them. +These functions may be used to avoid the overhead of locking the stream +for each character, and to avoid output being interspersed from multiple +threads writing to the same stream. +.Sh RETURN VALUES +The functions, +.Fn fputc , +.Fn putc , +.Fn putchar , +.Fn putc_unlocked , +and +.Fn putchar_unlocked +return the character written. +If an error occurs, the value +.Dv EOF +is returned. +The +.Fn putw +function +returns 0 on success; +.Dv EOF +is returned if +a write error occurs, +or if an attempt is made to write a read-only stream. +.Sh SEE ALSO +.Xr ferror 3 , +.Xr flockfile 3 , +.Xr fopen 3 , +.Xr getc 3 , +.Xr putwc 3 , +.Xr stdio 3 +.Sh STANDARDS +The functions +.Fn fputc , +.Fn putc , +and +.Fn putchar , +conform to +.St -isoC . +The +.Fn putc_unlocked +and +.Fn putchar_unlocked +functions conform to +.St -p1003.1-2001 . +A function +.Fn putw +function appeared in +.At v6 . +.Sh BUGS +The size and byte order of an +.Vt int +varies from one machine to another, and +.Fn putw +is not recommended for portable applications. diff --git a/stdio/FreeBSD/putc.c b/stdio/FreeBSD/putc.c new file mode 100644 index 0000000..44b64b4 --- /dev/null +++ b/stdio/FreeBSD/putc.c @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)putc.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/putc.c,v 1.16 2008/05/05 16:03:52 jhb Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +#undef putc +#undef putc_unlocked + +int +putc(c, fp) + int c; + FILE *fp; +{ + int retval; + FLOCKFILE(fp); + /* Orientation set by __sputc() when buffer is full. */ + /* ORIENT(fp, -1); */ + retval = __sputc(c, fp); + FUNLOCKFILE(fp); + return (retval); +} + +int +putc_unlocked(int ch, FILE *fp) +{ + + return (__sputc(ch, fp)); +} diff --git a/stdio/FreeBSD/putchar.c b/stdio/FreeBSD/putchar.c new file mode 100644 index 0000000..d07157b --- /dev/null +++ b/stdio/FreeBSD/putchar.c @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)putchar.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/putchar.c,v 1.16 2008/05/05 16:03:52 jhb Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +#undef putchar +#undef putchar_unlocked + +/* + * A subroutine version of the macro putchar + */ +int +putchar(c) + int c; +{ + int retval; + FILE *so = stdout; + + FLOCKFILE(so); + /* Orientation set by __sputc() when buffer is full. */ + /* ORIENT(so, -1); */ + retval = __sputc(c, so); + FUNLOCKFILE(so); + return (retval); +} + +int +putchar_unlocked(int ch) +{ + + return (__sputc(ch, stdout)); +} diff --git a/stdio/FreeBSD/puts.c b/stdio/FreeBSD/puts.c new file mode 100644 index 0000000..511cab4 --- /dev/null +++ b/stdio/FreeBSD/puts.c @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)puts.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/puts.c,v 1.11 2007/01/09 00:28:07 imp Exp $"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "fvwrite.h" +#include "libc_private.h" +#include "local.h" + +// 3340719: __puts_null__ is used if string is NULL. Shared by fputs.c +__private_extern__ char const __puts_null__[] = "(null)"; + +/* + * Write the given string to stdout, appending a newline. + */ +int +puts(s) + char const *s; +{ + int retval; + size_t c; + struct __suio uio; + struct __siov iov[2]; + + // 3340719: __puts_null__ is used if s is NULL + if(s == NULL) + s = __puts_null__; + iov[0].iov_base = (void *)s; + iov[0].iov_len = c = strlen(s); + iov[1].iov_base = "\n"; + iov[1].iov_len = 1; + uio.uio_resid = c + 1; + uio.uio_iov = &iov[0]; + uio.uio_iovcnt = 2; + FLOCKFILE(stdout); + ORIENT(stdout, -1); + retval = __sfvwrite(stdout, &uio) ? EOF : '\n'; + FUNLOCKFILE(stdout); + return (retval); +} diff --git a/stdio/FreeBSD/putw.c b/stdio/FreeBSD/putw.c new file mode 100644 index 0000000..b5a88a8 --- /dev/null +++ b/stdio/FreeBSD/putw.c @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)putw.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/putw.c,v 1.10 2007/01/09 00:28:07 imp Exp $"); + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "fvwrite.h" +#include "libc_private.h" + +int +putw(w, fp) + int w; + FILE *fp; +{ + int retval; + struct __suio uio; + struct __siov iov; + + iov.iov_base = &w; + iov.iov_len = uio.uio_resid = sizeof(w); + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + FLOCKFILE(fp); + retval = __sfvwrite(fp, &uio); + FUNLOCKFILE(fp); + return (retval); +} diff --git a/stdio/FreeBSD/putwc.3 b/stdio/FreeBSD/putwc.3 new file mode 100644 index 0000000..84799bc --- /dev/null +++ b/stdio/FreeBSD/putwc.3 @@ -0,0 +1,118 @@ +.\" $NetBSD: putwc.3,v 1.2 2002/02/07 07:00:26 ross Exp $ +.\" +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)putc.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/putwc.3,v 1.8 2007/01/09 00:28:07 imp Exp $ +.\" +.Dd March 3, 2004 +.Dt PUTWC 3 +.Os +.Sh NAME +.Nm fputwc , +.Nm putwc , +.Nm putwchar +.Nd output a wide character to a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft wint_t +.Fo fputwc +.Fa "wchar_t wc" +.Fa "FILE *stream" +.Fc +.Ft wint_t +.Fo putwc +.Fa "wchar_t wc" +.Fa "FILE *stream" +.Fc +.Ft wint_t +.Fo putwchar +.Fa "wchar_t wc" +.Fc +.Sh DESCRIPTION +The +.Fn fputwc +function +writes the wide character +.Fa wc +to the output stream pointed to by +.Fa stream . +.Pp +The +.Fn putwc +function +acts essentially identically to +.Fn fputwc . +.Pp +The +.Fn putwchar +function +is identical to +.Fn putwc +with an output stream of +.Dv stdout . +.Pp +Extended locale versions of these functions are documented in +.Xr putwc_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn fputwc , +.Fn putwc , +and +.Fn putwchar +functions +return the wide character written. +If an error occurs, the value +.Dv WEOF +is returned. +.Sh SEE ALSO +.Xr ferror 3 , +.Xr fopen 3 , +.Xr getwc 3 , +.Xr putc 3 , +.Xr putwc_l 3 , +.Xr stdio 3 +.Sh STANDARDS +The +.Fn fputwc , +.Fn putwc , +and +.Fn putwchar +functions +conform to +.St -isoC-99 . diff --git a/stdio/FreeBSD/putwc.c b/stdio/FreeBSD/putwc.c new file mode 100644 index 0000000..e854309 --- /dev/null +++ b/stdio/FreeBSD/putwc.c @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/putwc.c,v 1.3 2004/05/25 10:42:52 tjr Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +#undef putwc + +/* + * Synonym for fputwc(). The only difference is that putwc(), if it is a + * macro, may evaluate `fp' more than once. + */ +wint_t +putwc(wchar_t wc, FILE *fp) +{ + + return (fputwc_l(wc, fp, __current_locale())); +} + +wint_t +putwc_l(wchar_t wc, FILE *fp, locale_t loc) +{ + + /* no need to call NORMALIZE_LOCALE(loc) because fputwc_l will */ + return (fputwc_l(wc, fp, loc)); +} diff --git a/stdio/FreeBSD/putwchar.c b/stdio/FreeBSD/putwchar.c new file mode 100644 index 0000000..bc3ef1f --- /dev/null +++ b/stdio/FreeBSD/putwchar.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/putwchar.c,v 1.3 2004/05/25 10:42:52 tjr Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +#undef putwchar + +/* + * Synonym for fputwc(wc, stdout). + */ +wint_t +putwchar(wchar_t wc) +{ + + return (fputwc_l(wc, stdout, __current_locale())); +} + +wint_t +putwchar_l(wchar_t wc, locale_t loc) +{ + + /* no need to call NORMALIZE_LOCALE(loc) because fputwc_l will */ + return (fputwc_l(wc, stdout, loc)); +} diff --git a/stdio/FreeBSD/refill.c b/stdio/FreeBSD/refill.c new file mode 100644 index 0000000..7daa062 --- /dev/null +++ b/stdio/FreeBSD/refill.c @@ -0,0 +1,162 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)refill.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/refill.c,v 1.20 2008/04/17 22:17:54 jhb Exp $"); + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" +#include "local.h" + +static int lflush(FILE *); + +static int +lflush(FILE *fp) +{ + int ret = 0; + + if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) { + FLOCKFILE(fp); + ret = __sflush(fp); + FUNLOCKFILE(fp); + } + return (ret); +} + +/* + * Refill a stdio buffer. + * Return EOF on eof or error, 0 otherwise. + */ +__private_extern__ int +__srefill0(FILE *fp) +{ + + /* make sure stdio is set up */ + pthread_once(&__sdidinit, __sinit); + + ORIENT(fp, -1); + + fp->_r = 0; /* largely a convenience for callers */ + + /* SysV does not make this test; take it out for compatibility */ + if (fp->_flags & __SEOF) + return (EOF); + + /* if not already reading, have to be reading and writing */ + if ((fp->_flags & __SRD) == 0) { + if ((fp->_flags & __SRW) == 0) { + errno = EBADF; + fp->_flags |= __SERR; + return (EOF); + } + /* switch to reading */ + if (fp->_flags & __SWR) { + if (__sflush(fp)) + return (EOF); + fp->_flags &= ~__SWR; + fp->_w = 0; + fp->_lbfsize = 0; + } + fp->_flags |= __SRD; + } else { + /* + * We were reading. If there is an ungetc buffer, + * we must have been reading from that. Drop it, + * restoring the previous buffer (if any). If there + * is anything in that buffer, return. + */ + if (HASUB(fp)) { + FREEUB(fp); + if ((fp->_r = fp->_ur) != 0) { + fp->_p = fp->_up; + return (0); + } + } + } + + if (fp->_bf._base == NULL) + __smakebuf(fp); + + /* + * Before reading from a line buffered or unbuffered file, + * flush all line buffered output files, per the ANSI C + * standard. + */ + if (fp->_flags & (__SLBF|__SNBF)) { + /* Ignore this file in _fwalk to avoid potential deadlock. */ + fp->_flags |= __SIGN; + (void) _fwalk(lflush); + fp->_flags &= ~__SIGN; + + /* Now flush this file without locking it. */ + if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) + __sflush(fp); + } + return (1); +} + +__private_extern__ int +__srefill1(FILE *fp) +{ + + fp->_p = fp->_bf._base; + fp->_r = _sread(fp, (char *)fp->_p, fp->_bf._size); + fp->_flags &= ~__SMOD; /* buffer contents are again pristine */ + if (fp->_r <= 0) { + if (fp->_r == 0) + fp->_flags |= __SEOF; + else { + fp->_r = 0; + fp->_flags |= __SERR; + } + return (EOF); + } + return (0); +} + +int +__srefill(FILE *fp) +{ + int ret; + + if ((ret = __srefill0(fp)) <= 0) + return ret; + return __srefill1(fp); +} diff --git a/stdio/FreeBSD/remove.3 b/stdio/FreeBSD/remove.3 new file mode 100644 index 0000000..5f10003 --- /dev/null +++ b/stdio/FreeBSD/remove.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)remove.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/remove.3,v 1.10 2007/01/09 00:28:07 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt REMOVE 3 +.Os +.Sh NAME +.Nm remove +.Nd remove directory entry +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn remove "const char *path" +.Sh DESCRIPTION +The +.Fn remove +function removes the file or directory specified by +.Fa path . +.Pp +If +.Fa path +specifies a directory, +.Fn remove "path" +is the equivalent of +.Fn rmdir "path" . +Otherwise, it is the equivalent of +.Fn unlink "path" . +.Sh RETURN VALUES +.Rv -std remove +.Sh ERRORS +The +.Fn remove +function +may fail and set +.Va errno +for any of the errors specified for the routines +.Xr lstat 2 , +.Xr rmdir 2 , +or +.Xr unlink 2 . +.Sh SEE ALSO +.Xr rmdir 2 , +.Xr unlink 2 +.Sh STANDARDS +The +.Fn remove +function conforms to +.St -isoC +and +.St -xpg4.2 . diff --git a/stdio/FreeBSD/remove.c b/stdio/FreeBSD/remove.c new file mode 100644 index 0000000..c6e608b --- /dev/null +++ b/stdio/FreeBSD/remove.c @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)remove.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/remove.c,v 1.9 2007/01/09 00:28:07 imp Exp $"); + +#include +#include +#include +#include + +int +remove(file) + const char *file; +{ + struct stat sb; + + if (lstat(file, &sb) < 0) + return (-1); + if (S_ISDIR(sb.st_mode)) + return (rmdir(file)); + return (unlink(file)); +} diff --git a/stdio/FreeBSD/rewind.c b/stdio/FreeBSD/rewind.c new file mode 100644 index 0000000..33aea2f --- /dev/null +++ b/stdio/FreeBSD/rewind.c @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rewind.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/rewind.c,v 1.12 2007/01/09 00:28:07 imp Exp $"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +void +rewind(FILE *fp) +{ + int serrno = errno; + + /* make sure stdio is set up */ + pthread_once(&__sdidinit, __sinit); + + FLOCKFILE(fp); + if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0) { + errno = serrno; + } + clearerr_unlocked(fp); /* POSIX: clear stdio error regardless */ + FUNLOCKFILE(fp); +} diff --git a/stdio/FreeBSD/rget.c b/stdio/FreeBSD/rget.c new file mode 100644 index 0000000..7e69c41 --- /dev/null +++ b/stdio/FreeBSD/rget.c @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rget.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/rget.c,v 1.6 2007/01/09 00:28:07 imp Exp $"); + +#include +#include "local.h" + +/* + * Handle getc() when the buffer ran out: + * Refill, then return the first character + * in the newly-filled buffer. + */ +int +__srget(FILE *fp) +{ + if (__srefill(fp) == 0) { + fp->_r--; + return (*fp->_p++); + } + return (EOF); +} diff --git a/stdio/FreeBSD/scanf.3 b/stdio/FreeBSD/scanf.3 new file mode 100644 index 0000000..4bf7240 --- /dev/null +++ b/stdio/FreeBSD/scanf.3 @@ -0,0 +1,540 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)scanf.3 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD: src/lib/libc/stdio/scanf.3,v 1.25 2007/01/09 00:28:07 imp Exp $ +.\" +.Dd January 4, 2003 +.Dt SCANF 3 +.Os +.Sh NAME +.Nm fscanf , +.Nm scanf , +.Nm sscanf , +.Nm vfscanf , +.Nm vscanf , +.Nm vsscanf +.Nd input format conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fo fscanf +.Fa "FILE *restrict stream" +.Fa "const char *restrict format" ... +.Fc +.Ft int +.Fo scanf +.Fa "const char *restrict format" ... +.Fc +.Ft int +.Fo sscanf +.Fa "const char *restrict s" +.Fa "const char *restrict format" ... +.Fc +.In stdarg.h +.In stdio.h +.Ft int +.Fo vfscanf +.Fa "FILE *restrict stream" +.Fa "const char *restrict format" +.Fa "va_list arg" +.Fc +.Ft int +.Fo vscanf +.Fa "const char *restrict format" +.Fa "va_list arg" +.Fc +.Ft int +.Fo vsscanf +.Fa "const char *restrict s" +.Fa "const char *restrict format" +.Fa "va_list arg" +.Fc +.Sh DESCRIPTION +The +.Fn scanf +family of functions scans input according to a +.Fa format , +as described below. +This format may contain +.Em conversion specifiers ; +the results from such conversions, if any, +are stored through the +.Em pointer +arguments. +The +.Fn scanf +function +reads input from the standard input stream +.Dv stdin , +.Fn fscanf +reads input from the stream pointer +.Fa stream , +and +.Fn sscanf +reads its input from the character string pointed to by +.Fa s . +.Pp +The +.Fn vfscanf +function +is analogous to +.Xr vfprintf 3 +and reads input from the stream pointer +.Fa stream +using a variable argument list of pointers (see +.Xr stdarg 3 ) . +The +.Fn vscanf +function scans a variable argument list from the standard input and +the +.Fn vsscanf +function scans it from a string; +these are analogous to +the +.Fn vprintf +and +.Fn vsprintf +functions, respectively. +.Pp +Each successive +.Em pointer +argument must correspond properly with +each successive conversion specifier +(but see the +.Cm * +conversion below). +All conversions are introduced by the +.Cm % +(percent sign) character. +The +.Fa format +string +may also contain other characters. +White space (such as blanks, tabs, or newlines) in the +.Fa format +string match any amount of white space, including none, in the input. +Everything else +matches only itself. +Scanning stops +when an input character does not match such a format character. +Scanning also stops +when an input conversion cannot be made (see below). +.Pp +Extended locale versions of these functions are documented in +.Xr scanf_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh CONVERSIONS +Following the +.Cm % +character introducing a conversion, +there may be a number of +.Em flag +characters, as follows: +.Bl -tag -width ".Cm l No (ell)" +.It Cm * +Suppresses assignment. +The conversion that follows occurs as usual, but no pointer is used; +the result of the conversion is simply discarded. +.It Cm hh +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt char +(rather than +.Vt int ) . +.It Cm h +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt "short int" +(rather than +.Vt int ) . +.It Cm l No (ell) +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt "long int" +(rather than +.Vt int ) , +that the conversion will be one of +.Cm a , e , f , +or +.Cm g +and the next pointer is a pointer to +.Vt double +(rather than +.Vt float ) , +or that the conversion will be one of +.Cm c , +.Cm s +or +.Cm \&[ +and the next pointer is a pointer to an array of +.Vt wchar_t +(rather than +.Vt char ) . +.It Cm ll No (ell ell) +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt "long long int" +(rather than +.Vt int ) . +.It Cm L +Indicates that the conversion will be one of +.Cm a , e , f , +or +.Cm g +and the next pointer is a pointer to +.Vt "long double" . +.It Cm j +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt intmax_t +(rather than +.Vt int ) . +.It Cm t +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt ptrdiff_t +(rather than +.Vt int ) . +.It Cm z +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt size_t +(rather than +.Vt int ) . +.It Cm q +(deprecated.) +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt "long long int" +(rather than +.Vt int ) . +.El +.Pp +In addition to these flags, +there may be an optional maximum field width, +expressed as a decimal integer, +between the +.Cm % +and the conversion. +If no width is given, +a default of +.Dq infinity +is used (with one exception, below); +otherwise at most this many bytes are scanned +in processing the conversion. +In the case of the +.Cm lc , +.Cm ls +and +.Cm l[ +conversions, the field width specifies the maximum number +of multibyte characters that will be scanned. +Before conversion begins, +most conversions skip white space; +this white space is not counted against the field width. +.Pp +The following conversions are available: +.Bl -tag -width XXXX +.It Cm % +Matches a literal +.Ql % . +That is, +.Dq Li %% +in the format string +matches a single input +.Ql % +character. +No conversion is done, and assignment does not occur. +.It Cm d +Matches an optionally signed decimal integer; +the next pointer must be a pointer to +.Vt int . +.It Cm i +Matches an optionally signed integer; +the next pointer must be a pointer to +.Vt int . +The integer is read in base 16 if it begins +with +.Ql 0x +or +.Ql 0X , +in base 8 if it begins with +.Ql 0 , +and in base 10 otherwise. +Only characters that correspond to the base are used. +.It Cm o +Matches an octal integer; +the next pointer must be a pointer to +.Vt "unsigned int" . +.It Cm u +Matches an optionally signed decimal integer; +the next pointer must be a pointer to +.Vt "unsigned int" . +.It Cm x , X +Matches an optionally signed hexadecimal integer; +the next pointer must be a pointer to +.Vt "unsigned int" . +.It Cm a , A , e , E , f , F , g , G +Matches a floating-point number in the style of +.Xr strtod 3 . +The next pointer must be a pointer to +.Vt float +(unless +.Cm l +or +.Cm L +is specified.) +.It Cm s +Matches a sequence of non-white-space characters; +the next pointer must be a pointer to +.Vt char , +and the array must be large enough to accept all the sequence and the +terminating +.Dv NUL +character. +The input string stops at white space +or at the maximum field width, whichever occurs first. +.Pp +If an +.Cm l +qualifier is present, the next pointer must be a pointer to +.Vt wchar_t , +into which the input will be placed after conversion by +.Xr mbrtowc 3 . +.It Cm S +The same as +.Cm ls . +.It Cm c +Matches a sequence of +.Em width +count +characters (default 1); +the next pointer must be a pointer to +.Vt char , +and there must be enough room for all the characters +(no terminating +.Dv NUL +is added). +The usual skip of leading white space is suppressed. +To skip white space first, use an explicit space in the format. +.Pp +If an +.Cm l +qualifier is present, the next pointer must be a pointer to +.Vt wchar_t , +into which the input will be placed after conversion by +.Xr mbrtowc 3 . +.It Cm C +The same as +.Cm lc . +.It Cm \&[ +Matches a nonempty sequence of characters from the specified set +of accepted characters; +the next pointer must be a pointer to +.Vt char , +and there must be enough room for all the characters in the string, +plus a terminating +.Dv NUL +character. +The usual skip of leading white space is suppressed. +The string is to be made up of characters in +(or not in) +a particular set; +the set is defined by the characters between the open bracket +.Cm [ +character +and a close bracket +.Cm ] +character. +The set +.Em excludes +those characters +if the first character after the open bracket is a circumflex +.Cm ^ . +To include a close bracket in the set, +make it the first character after the open bracket +or the circumflex; +any other position will end the set. +The hyphen character +.Cm - +is also special; +when placed between two other characters, +it adds all intervening characters to the set. +To include a hyphen, +make it the last character before the final close bracket. +For instance, +.Ql [^]0-9-] +means the set +.Dq "everything except close bracket, zero through nine, and hyphen" . +The string ends with the appearance of a character not in the +(or, with a circumflex, in) set +or when the field width runs out. +.Pp +If an +.Cm l +qualifier is present, the next pointer must be a pointer to +.Vt wchar_t , +into which the input will be placed after conversion by +.Xr mbrtowc 3 . +.It Cm p +Matches a pointer value (as printed by +.Ql %p +in +.Xr printf 3 ) ; +the next pointer must be a pointer to +.Vt "void *" +(or other pointer type). +.It Cm n +Nothing is expected; +instead, the number of characters consumed thus far from the input +is stored through the next pointer, +which must be a pointer to +.Vt int . +This is +.Em not +a conversion, although it can be suppressed with the +.Cm * +flag. +.El +.Pp +The decimal point +character is defined in the program's locale (category +.Dv LC_NUMERIC ) . +.Pp +For backwards compatibility, a +.Dq conversion +of +.Ql %\e0 +causes an immediate return of +.Dv EOF . +.Sh RETURN VALUES +These functions return the number of input items assigned. +This can be fewer than provided for, or even zero, +in the event of a matching failure. +Zero indicates that, although there was input available, +no conversions were assigned; +typically this is due to an invalid input character, +such as an alphabetic character for a +.Ql %d +conversion. +The value +.Dv EOF +is returned if an input failure occurs before any conversion such as an +end-of-file occurs. +If an error or end-of-file occurs after conversion +has begun, +the number of conversions which were successfully completed is returned. +.Sh SEE ALSO +.Xr getc 3 , +.Xr mbrtowc 3 , +.Xr printf 3 , +.Xr scanf_l 3 , +.Xr strtod 3 , +.Xr strtol 3 , +.Xr strtoul 3 , +.Xr wscanf 3 +.Sh STANDARDS +The functions +.Fn fscanf , +.Fn scanf , +.Fn sscanf , +.Fn vfscanf , +.Fn vscanf , +and +.Fn vsscanf +conform to +.St -isoC-99 . +.Sh BUGS +Earlier implementations of +.Nm +treated +.Cm \&%D , \&%E , \&%F , \&%O +and +.Cm \&%X +as their lowercase equivalents with an +.Cm l +modifier. +In addition, +.Nm +treated an unknown conversion character as +.Cm \&%d +or +.Cm \&%D , +depending on its case. +This functionality has been removed. +.Pp +Numerical strings are truncated to 512 characters; for example, +.Cm %f +and +.Cm %d +are implicitly +.Cm %512f +and +.Cm %512d . +.Pp +The +.Cm %n$ +modifiers for positional arguments are not implemented. +.Pp +The +.Nm +family of functions do not correctly handle multibyte characters in the +.Fa format +argument. diff --git a/stdio/FreeBSD/scanf.c b/stdio/FreeBSD/scanf.c new file mode 100644 index 0000000..c2992ec --- /dev/null +++ b/stdio/FreeBSD/scanf.c @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)scanf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/scanf.c,v 1.13 2007/01/09 00:28:07 imp Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +int +scanf(char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + FLOCKFILE(stdin); + ret = __svfscanf_l(stdin, __current_locale(), fmt, ap); + FUNLOCKFILE(stdin); + va_end(ap); + return (ret); +} + +int +scanf_l(locale_t loc, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + NORMALIZE_LOCALE(loc); + va_start(ap, fmt); + FLOCKFILE(stdin); + ret = __svfscanf_l(stdin, loc, fmt, ap); + FUNLOCKFILE(stdin); + va_end(ap); + return (ret); +} diff --git a/stdio/FreeBSD/setbuf.3 b/stdio/FreeBSD/setbuf.3 new file mode 100644 index 0000000..6a33459 --- /dev/null +++ b/stdio/FreeBSD/setbuf.3 @@ -0,0 +1,242 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)setbuf.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/setbuf.3,v 1.17 2007/01/09 00:28:07 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt SETBUF 3 +.Os +.Sh NAME +.Nm setbuf , +.Nm setbuffer , +.Nm setlinebuf , +.Nm setvbuf +.Nd stream buffering operations +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft void +.Fo setbuf +.Fa "FILE *restrict stream" +.Fa "char *restrict buf" +.Fc +.Ft void +.Fo setbuffer +.Fa "FILE *stream" +.Fa "char *buf" +.Fa "int size" +.Fc +.Ft int +.Fo setlinebuf +.Fa "FILE *stream" +.Fc +.Ft int +.Fo setvbuf +.Fa "FILE *restrict stream" +.Fa "char *restrict buf" +.Fa "int type" +.Fa "size_t size" +.Fc +.Sh DESCRIPTION +Three types of buffering are available: +unbuffered, block buffered, and line buffered. +When an output stream is unbuffered, information appears on the +destination file or terminal as soon as written; +when it is block buffered, +many characters are saved up and written as a block; +when it is line buffered, +characters are saved up until a newline is output +or input is read from any stream attached to a terminal device +(typically +.Dv stdin ) . +.Pp +The default buffer settings can be overwritten for stdout +.Dv ( STDBUF1 ) +or for all descriptors +.Dv ( STDBUF ) . +The environment variable value is a letter followed by an optional numeric +value indicating the size of the buffer. +Valid sizes range from 0B to 64KB. +Valid letters are: +.Bl -tag -width X -indent +.It Dv Li U +Unbuffered. +.It Dv Li L +Line-buffered. +.It Dv Li F +Fully-buffered. +.El +.Pp +The function +.Xr fflush 3 +may be used to force the block out early. +(See +.Xr fclose 3 . ) +.Pp +Normally, all files are block buffered. +When the first +.Tn I/O +operation occurs on a file, +.Xr malloc 3 +is called and an optimally-sized buffer is obtained. +If a stream refers to a terminal +(as +.Dv stdout +normally does), it is line buffered. +The standard error stream +.Dv stderr +is always unbuffered. +.Pp +The +.Fn setvbuf +function +may be used to alter the buffering behavior of a stream. +The +.Fa type +argument must be one of the following three macros: +.Bl -tag -width _IOFBF -offset indent +.It Dv _IONBF +unbuffered +.It Dv _IOLBF +line buffered +.It Dv _IOFBF +fully buffered +.El +.Pp +The +.Fa size +argument may be given as zero +to obtain deferred optimal-size buffer allocation as usual. +If it is not zero, +then except for unbuffered files, the +.Fa buf +argument should point to a buffer at least +.Fa size +bytes long; +this buffer will be used instead of the current buffer. +If +.Fa buf +is not +.Dv NULL , +it is the caller's responsibility to +.Xr free 3 +this buffer after closing the stream. +(If the +.Fa size +argument +is not zero but +.Fa buf +is +.Dv NULL , +a buffer of the given size will be allocated immediately, +and released on close. +This is an extension to ANSI C; +portable code should use a size of 0 with any +.Dv NULL +buffer.) +.Pp +The +.Fn setvbuf +function may be used at any time, +but may have peculiar side effects +(such as discarding input or flushing output) +if the stream is ``active''. +Portable applications should call it only once on any given stream, +and before any +.Tn I/O +is performed. +.Pp +The other three calls are, in effect, simply aliases for calls to +.Fn setvbuf . +Except for the lack of a return value, the +.Fn setbuf +function is exactly equivalent to the call +.Pp +.Dl "setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);" +.Pp +The +.Fn setbuffer +function +is the same, except that the size of the buffer is up to the caller, +rather than being determined by the default +.Dv BUFSIZ . +The +.Fn setlinebuf +function +is exactly equivalent to the call: +.Pp +.Dl "setvbuf(stream, (char *)NULL, _IOLBF, 0);" +.Sh RETURN VALUES +The +.Fn setvbuf +function returns 0 on success, or +.Dv EOF +if the request cannot be honored +(note that the stream is still functional in this case). +.Pp +The +.Fn setlinebuf +function returns what the equivalent +.Fn setvbuf +would have returned. +.Sh SEE ALSO +.Xr fclose 3 , +.Xr fopen 3 , +.Xr fread 3 , +.Xr malloc 3 , +.Xr printf 3 , +.Xr puts 3 +.Sh STANDARDS +The +.Fn setbuf +and +.Fn setvbuf +functions +conform to +.St -isoC . +.Sh BUGS +The +.Fn setbuffer +and +.Fn setlinebuf +functions are not portable to versions of +.Bx +before +.Bx 4.2 . +On +.Bx 4.2 +and +.Bx 4.3 +systems, +.Fn setbuf +always uses a suboptimal buffer size and should be avoided. diff --git a/stdio/FreeBSD/setbuf.c b/stdio/FreeBSD/setbuf.c new file mode 100644 index 0000000..933afb7 --- /dev/null +++ b/stdio/FreeBSD/setbuf.c @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setbuf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/setbuf.c,v 1.5 2007/01/09 00:28:07 imp Exp $"); + +#include +#include "local.h" + +void +setbuf(FILE * __restrict fp, char * __restrict buf) +{ + (void) setvbuf(fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ); +} diff --git a/stdio/FreeBSD/setbuffer.c b/stdio/FreeBSD/setbuffer.c new file mode 100644 index 0000000..64e5932 --- /dev/null +++ b/stdio/FreeBSD/setbuffer.c @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setbuffer.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/setbuffer.c,v 1.8 2007/01/09 00:28:07 imp Exp $"); + +#include + +void +setbuffer(fp, buf, size) + FILE *fp; + char *buf; + int size; +{ + + (void)setvbuf(fp, buf, buf ? _IOFBF : _IONBF, (size_t)size); +} + +/* + * set line buffering + */ +int +setlinebuf(fp) + FILE *fp; +{ + + return (setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0)); +} diff --git a/stdio/FreeBSD/setvbuf.c b/stdio/FreeBSD/setvbuf.c new file mode 100644 index 0000000..bedaa37 --- /dev/null +++ b/stdio/FreeBSD/setvbuf.c @@ -0,0 +1,161 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setvbuf.c 8.2 (Berkeley) 11/16/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/setvbuf.c,v 1.14 2007/01/09 00:28:07 imp Exp $"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +/* + * Set one of the three kinds of buffering, optionally including + * a buffer. + */ +int +setvbuf(FILE * __restrict fp, char * __restrict buf, int mode, size_t size) +{ + int ret, flags; + size_t iosize; + int ttyflag; + + /* + * Verify arguments. The `int' limit on `size' is due to this + * particular implementation. Note, buf and size are ignored + * when setting _IONBF. + */ + if (mode != _IONBF) + if ((mode != _IOFBF && mode != _IOLBF) || (int)size < 0) + return (EOF); + + FLOCKFILE(fp); + /* + * Write current buffer, if any. Discard unread input (including + * ungetc data), cancel line buffering, and free old buffer if + * malloc()ed. We also clear any eof condition, as if this were + * a seek. + */ + ret = 0; + (void)__sflush(fp); + if (HASUB(fp)) + FREEUB(fp); + fp->_r = fp->_lbfsize = 0; + flags = fp->_flags; + if (flags & __SMBF) + free((void *)fp->_bf._base); + flags &= ~(__SLBF | __SNBF | __SMBF | __SOPT | __SOFF | __SNPT | __SEOF); + + /* If setting unbuffered mode, skip all the hard work. */ + if (mode == _IONBF) + goto nbf; + + /* + * Find optimal I/O size for seek optimization. This also returns + * a `tty flag' to suggest that we check isatty(fd), but we do not + * care since our caller told us how to buffer. + */ + flags |= __swhatbuf(fp, &iosize, &ttyflag); + if (size == 0) { + buf = NULL; /* force local allocation */ + size = iosize; + } + + /* Allocate buffer if needed. */ + if (buf == NULL) { + if ((buf = malloc(size)) == NULL) { + /* + * Unable to honor user's request. We will return + * failure, but try again with file system size. + */ + ret = EOF; + if (size != iosize) { + size = iosize; + buf = malloc(size); + } + } + if (buf == NULL) { + /* No luck; switch to unbuffered I/O. */ +nbf: + fp->_flags = flags | __SNBF; + fp->_w = 0; + fp->_bf._base = fp->_p = fp->_nbuf; + fp->_bf._size = 1; + FUNLOCKFILE(fp); + return (ret); + } + flags |= __SMBF; + } + + /* + * Kill any seek optimization if the buffer is not the + * right size. + * + * SHOULD WE ALLOW MULTIPLES HERE (i.e., ok iff (size % iosize) == 0)? + */ + if (size != iosize) + flags |= __SNPT; + + /* + * Fix up the FILE fields, and set __cleanup for output flush on + * exit (since we are buffered in some way). + */ + if (mode == _IOLBF) + flags |= __SLBF; + fp->_flags = flags; + fp->_bf._base = fp->_p = (unsigned char *)buf; + fp->_bf._size = size; + /* fp->_lbfsize is still 0 */ + if (flags & __SWR) { + /* + * Begin or continue writing: see __swsetup(). Note + * that __SNBF is impossible (it was handled earlier). + */ + if (flags & __SLBF) { + fp->_w = 0; + fp->_lbfsize = -fp->_bf._size; + } else + fp->_w = size; + } else { + /* begin/continue reading, or stay in intermediate state */ + fp->_w = 0; + } + __cleanup = _cleanup; + + FUNLOCKFILE(fp); + return (ret); +} diff --git a/stdio/FreeBSD/snprintf.c b/stdio/FreeBSD/snprintf.c new file mode 100644 index 0000000..55f01cf --- /dev/null +++ b/stdio/FreeBSD/snprintf.c @@ -0,0 +1,70 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)snprintf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/snprintf.c,v 1.22 2008/04/17 22:17:54 jhb Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +#include "local.h" + +int +snprintf(char * __restrict str, size_t n, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vsnprintf_l(str, n, __current_locale(), fmt, ap); + va_end(ap); + return (ret); +} + +int +snprintf_l(char * __restrict str, size_t n, locale_t loc, + char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vsnprintf_l(str, n, loc, fmt, ap); + va_end(ap); + return (ret); +} diff --git a/stdio/FreeBSD/sprintf.c b/stdio/FreeBSD/sprintf.c new file mode 100644 index 0000000..f2cb3a9 --- /dev/null +++ b/stdio/FreeBSD/sprintf.c @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sprintf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/sprintf.c,v 1.16 2008/04/17 22:17:54 jhb Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include "local.h" + +int +sprintf(char * __restrict str, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vsprintf_l(str, __current_locale(), fmt, ap); + va_end(ap); + return (ret); +} + +int +sprintf_l(char * __restrict str, locale_t loc, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vsprintf_l(str, loc, fmt, ap); + va_end(ap); + return (ret); +} diff --git a/stdio/FreeBSD/sscanf.c b/stdio/FreeBSD/sscanf.c new file mode 100644 index 0000000..16c313f --- /dev/null +++ b/stdio/FreeBSD/sscanf.c @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sscanf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/sscanf.c,v 1.13 2008/04/17 22:17:54 jhb Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include "local.h" + +int +sscanf(const char * __restrict str, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vsscanf_l(str, __current_locale(), fmt, ap); + va_end(ap); + return (ret); +} + +int +sscanf_l(const char * __restrict str, locale_t loc, char const * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vsscanf_l(str, loc, fmt, ap); + va_end(ap); + return (ret); +} diff --git a/stdio/FreeBSD/stdio.3 b/stdio/FreeBSD/stdio.3 new file mode 100644 index 0000000..1cf1be6 --- /dev/null +++ b/stdio/FreeBSD/stdio.3 @@ -0,0 +1,366 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)stdio.3 8.7 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/stdio/stdio.3,v 1.30 2009/03/04 03:38:51 das Exp $ +.\" +.Dd March 3, 2009 +.Dt STDIO 3 +.Os +.Sh NAME +.Nm stdio +.Nd standard input/output library functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Vt FILE *stdin ; +.Vt FILE *stdout ; +.Vt FILE *stderr ; +.Pp +Note: +The current implementation does not allow these variables +to be evaluated at C compile/link time. +That is, a runtime calculation must be performed, such as: +.Bd -literal -offset indent +#include + +static FILE *var; + +int main() { + var = stdout; +} +.Ed +.Sh DESCRIPTION +The standard +.Tn I/O +library provides a simple and efficient buffered stream +.Tn I/O +interface. +Input and output is mapped into logical data streams +and the physical +.Tn I/O +characteristics are concealed. +The functions and macros are listed +below; more information is available from the individual man pages. +.Pp +A stream is associated with an external file (which may be a physical +device) by +.Em opening +a file, which may involve creating a new file. +Creating an +existing file causes its former contents to be discarded. +If a file can support positioning requests (such as a disk file, as opposed +to a terminal) then a +.Em file position indicator +associated with the stream is positioned at the start of the file (byte +zero), unless the file is opened with append mode. +If append mode +is used, the position indicator will be placed at the end-of-file. +The position indicator is maintained by subsequent reads, writes +and positioning requests. +All input occurs as if the characters +were read by successive calls to the +.Xr fgetc 3 +function; all output takes place as if all characters were +written by successive calls to the +.Xr fputc 3 +function. +.Pp +A file is disassociated from a stream by +.Em closing +the file. +Output streams are flushed (any unwritten buffer contents are transferred +to the host environment) before the stream is disassociated from the file. +The value of a pointer to a +.Dv FILE +object is indeterminate (garbage) after a file is closed. +.Pp +A file may be subsequently reopened, by the same or another program +execution, and its contents reclaimed or modified (if it can be repositioned +at the start). +If the main function returns to its original caller, or +the +.Xr exit 3 +function is called, all open files are closed (hence all output +streams are flushed) before program termination. +Other methods +of program termination may not close files properly and hence +buffered output may be lost. +In particular, +.Xr _exit 2 +does not flush stdio files. +Neither does an exit due to a signal. +Buffers are flushed by +.Xr abort 3 +as required by POSIX, although previous implementations did not. +.Pp +This implementation makes no distinction between +.Dq text +and +.Dq binary +streams. +In effect, all streams are binary. +No translation is performed and no extra padding appears on any stream. +.Pp +At program startup, three streams are predefined and need not be +opened explicitly: +.Bl -bullet -compact -offset indent +.It +.Em standard input +(for reading conventional input), +.It +.Em standard output +(for writing conventional output), and +.It +.Em standard error +(for writing diagnostic output). +.El +These streams are abbreviated +.Dv stdin , stdout +and +.Dv stderr . +Initially, the standard error stream +is unbuffered; the standard input and output streams are +fully buffered if and only if the streams do not refer to +an interactive or +.Dq terminal +device, as determined by the +.Xr isatty 3 +function. +In fact, +.Em all +freshly-opened streams that refer to terminal devices +default to line buffering, and +pending output to such streams is written automatically +whenever such an input stream is read. +Note that this applies only to +.Dq "true reads" ; +if the read request can be satisfied by existing buffered data, +no automatic flush will occur. +In these cases, +or when a large amount of computation is done after printing +part of a line on an output terminal, it is necessary to +.Xr fflush 3 +the standard output before going off and computing so that the output +will appear. +Alternatively, these defaults may be modified via the +.Xr setvbuf 3 +function. +.Pp +The +.Nm +library is a part of the library +.Nm libc +and routines are automatically loaded as needed by the C compiler. +The +.Tn SYNOPSIS +sections of the following manual pages indicate which include files +are to be used, what the compiler declaration for the function +looks like and which external variables are of interest. +.Pp +The following are defined as macros; +these names may not be re-used +without first removing their current definitions with +.Ic #undef : +.Dv BUFSIZ , +.Dv EOF , +.Dv FILENAME_MAX , +.Dv FOPEN_MAX , +.Dv L_ctermid , +.Dv L_cuserid , +.Dv L_tmpnam , +.Dv NULL , +.Dv P_tmpdir , +.Dv SEEK_CUR , +.Dv SEEK_END , +.Dv SEEK_SET , +.Dv TMP_MAX , +.Dv clearerr , +.Dv clearerr_unlocked , +.Dv feof , +.Dv feof_unlocked , +.Dv ferror , +.Dv ferror_unlocked , +.Dv fileno , +.Dv fileno_unlocked , +.Dv fropen , +.Dv fwopen , +.Dv getc , +.Dv getc_unlocked , +.Dv getchar , +.Dv getchar_unlocked , +.Dv putc , +.Dv putc_unlocked , +.Dv putchar , +.Dv putchar_unlocked , +.Dv stderr , +.Dv stdin +and +.Dv stdout . +Function versions of the macro functions +.Dv clearerr , +.Dv clearerr_unlocked , +.Dv feof , +.Dv feof_unlocked , +.Dv ferror , +.Dv ferror_unlocked , +.Dv fileno , +.Dv fileno_unlocked , +.Dv getc , +.Dv getc_unlocked , +.Dv getchar , +.Dv getchar_unlocked , +.Dv putc , +.Dv putc_unlocked , +.Dv putchar , +and +.Dv putchar_unlocked +exist and will be used if the macro +definitions are explicitly removed. +.Sh LEGACY SYNOPSIS +The -D_NONSTD_SOURCE flag can be used +to allow stdin, stdout, and/or stderr +to be evaluated at compile/link time, as: +.Bd -literal -offset indent +#include + +static FILE *var = stdout; +.Ed +.Sh SEE ALSO +.Xr close 2 , +.Xr open 2 , +.Xr read 2 , +.Xr write 2 , +.Xr compat 5 +.Sh STANDARDS +The +.Nm +library conforms to +.St -isoC-99 . +.Sh LIST OF FUNCTIONS +.Bl -column "Description" +.It Sy "Function Description" +.It "asprintf formatted output conversion" +.It "" +.It "clearerr check and reset stream status" +.It "" +.It "fclose close a stream" +.It "fdopen stream open functions" +.It "feof check and reset stream status" +.It "ferror check and reset stream status" +.It "fflush flush a stream" +.It "fgetc get next character or word from input stream" +.It "fgetln get a line from a stream" +.It "fgetpos reposition a stream" +.It "fgets get a line from a stream" +.It "fgetwc get next wide character from input stream" +.It "fgetws get a line of wide characters from a stream" +.It "fileno check and reset stream status" +.It "fopen stream open functions" +.It "fprintf formatted output conversion" +.It "fpurge flush a stream" +.It "fputc output a character or word to a stream" +.It "fputs output a line to a stream" +.It "fputwc output a wide character to a stream" +.It "fputws output a line of wide characters to a stream" +.It "fread binary stream input/output" +.It "freopen stream open functions" +.It "fropen open a stream" +.It "fscanf input format conversion" +.It "fseek reposition a stream" +.It "fsetpos reposition a stream" +.It "ftell reposition a stream" +.It "funopen open a stream" +.It "fwide set/get orientation of stream" +.It "fwopen open a stream" +.It "fwprintf formatted wide character output conversion" +.It "fwrite binary stream input/output" +.It "" +.It "getc get next character or word from input stream" +.It "getchar get next character or word from input stream" +.It "getdelim get a line from a stream" +.It "getline get a line from a stream" +.It "gets get a line from a stream" +.It "getw get next character or word from input stream" +.It "getwc get next wide character from input stream" +.It "getwchar get next wide character from input stream" +.It "" +.It "mkdtemp create unique temporary directory" +.It "mkstemp create unique temporary file" +.It "mktemp create unique temporary file" +.It "" +.It "perror system error messages" +.It "printf formatted output conversion" +.It "putc output a character or word to a stream" +.It "putchar output a character or word to a stream" +.It "puts output a line to a stream" +.It "putw output a character or word to a stream" +.It "putwc output a wide character to a stream" +.It "putwchar output a wide character to a stream" +.It "" +.It "remove remove directory entry" +.It "rewind reposition a stream" +.It "" +.It "scanf input format conversion" +.It "setbuf stream buffering operations" +.It "setbuffer stream buffering operations" +.It "setlinebuf stream buffering operations" +.It "setvbuf stream buffering operations" +.It "snprintf formatted output conversion" +.It "sprintf formatted output conversion" +.It "sscanf input format conversion" +.It "strerror system error messages" +.It "swprintf formatted wide character output conversion" +.It "sys_errlist system error messages" +.It "sys_nerr system error messages" +.It "" +.It "tempnam temporary file routines" +.It "tmpfile temporary file routines" +.It "tmpnam temporary file routines" +.It "" +.It "ungetc un-get character from input stream" +.It "ungetwc un-get wide character from input stream" +.It "" +.It "vasprintf formatted output conversion" +.It "vfprintf formatted output conversion" +.It "vfscanf input format conversion" +.It "vfwprintf formatted wide character output conversion" +.It "vprintf formatted output conversion" +.It "vscanf input format conversion" +.It "vsnprintf formatted output conversion" +.It "vsprintf formatted output conversion" +.It "vsscanf input format conversion" +.It "vswprintf formatted wide character output conversion" +.It "vwprintf formatted wide character output conversion" +.It "" +.It "wprintf formatted wide character output conversion" +.El +.Sh BUGS +The standard buffered functions do not interact well with certain other +library and system functions, especially +.Xr vfork 2 . diff --git a/stdio/FreeBSD/stdio.c b/stdio/FreeBSD/stdio.c new file mode 100644 index 0000000..70f455d --- /dev/null +++ b/stdio/FreeBSD/stdio.c @@ -0,0 +1,187 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)stdio.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/stdio.c,v 1.28 2008/05/05 16:14:02 jhb Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "local.h" + +/* + * Small standard I/O/seek/close functions. + */ +int +__sread(cookie, buf, n) + void *cookie; + char *buf; + int n; +{ + FILE *fp = cookie; + + return(_read(fp->_file, buf, (size_t)n)); +} + +int +__swrite(cookie, buf, n) + void *cookie; + char const *buf; + int n; +{ + FILE *fp = cookie; + + return (_write(fp->_file, buf, (size_t)n)); +} + +fpos_t +__sseek(cookie, offset, whence) + void *cookie; + fpos_t offset; + int whence; +{ + FILE *fp = cookie; + + return (lseek(fp->_file, (off_t)offset, whence)); +} + +int +__sclose(cookie) + void *cookie; +{ + + return (_close(((FILE *)cookie)->_file)); +} + +/* + * Higher level wrappers. + */ +int +_sread(fp, buf, n) + FILE *fp; + char *buf; + int n; +{ + int ret; + + ret = (*fp->_read)(fp->_cookie, buf, n); + if (ret > 0) { + if (fp->_flags & __SOFF) { + if (fp->_offset <= OFF_MAX - ret) + fp->_offset += ret; + else + fp->_flags &= ~__SOFF; + } + } else if (ret < 0) + fp->_flags &= ~__SOFF; + return (ret); +} + +int +_swrite(fp, buf, n) + FILE *fp; + char const *buf; + int n; +{ + int ret; + int serrno; + + if (fp->_flags & __SAPP) { + serrno = errno; + if (_sseek(fp, (fpos_t)0, SEEK_END) == -1 && + (fp->_flags & __SOPT)) + return (-1); + errno = serrno; + } + ret = (*fp->_write)(fp->_cookie, buf, n); + /* __SOFF removed even on success in case O_APPEND mode is set. */ + if (ret >= 0) { + if ((fp->_flags & (__SAPP|__SOFF)) == (__SAPP|__SOFF) && + fp->_offset <= OFF_MAX - ret) + fp->_offset += ret; + else + fp->_flags &= ~__SOFF; + + } else if (ret < 0) + fp->_flags &= ~__SOFF; + return (ret); +} + +fpos_t +_sseek(fp, offset, whence) + FILE *fp; + fpos_t offset; + int whence; +{ + fpos_t ret; + int serrno, errret; + + serrno = errno; + errno = 0; + ret = (*fp->_seek)(fp->_cookie, offset, whence); + errret = errno; + if (errno == 0) + errno = serrno; + /* + * Disallow negative seeks per POSIX. + * It is needed here to help upper level caller + * in the cases it can't detect. + */ + if (ret < 0) { + if (errret == 0) { + if (offset != 0 || whence != SEEK_CUR) { + if (HASUB(fp)) + FREEUB(fp); + fp->_p = fp->_bf._base; + fp->_r = 0; + fp->_flags &= ~__SEOF; + } + fp->_flags |= __SERR; + errno = EINVAL; + } else if (errret == ESPIPE) + fp->_flags &= ~__SAPP; + fp->_flags &= ~__SOFF; + ret = -1; + } else if (fp->_flags & __SOPT) { + fp->_flags |= __SOFF; + fp->_offset = ret; + } + return (ret); +} diff --git a/stdio/FreeBSD/swprintf.c b/stdio/FreeBSD/swprintf.c new file mode 100644 index 0000000..698b6c8 --- /dev/null +++ b/stdio/FreeBSD/swprintf.c @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/swprintf.c,v 1.1 2002/09/21 13:00:30 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +int +swprintf(wchar_t * __restrict s, size_t n, const wchar_t * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vswprintf_l(s, n, __current_locale(), fmt, ap); + va_end(ap); + + return (ret); +} + +int +swprintf_l(wchar_t * __restrict s, size_t n, locale_t loc, + const wchar_t * __restrict fmt, ...) +{ + int ret; + va_list ap; + + /* no need to call NORMALIZE_LOCALE(loc) because vswprintf_l will */ + va_start(ap, fmt); + ret = vswprintf_l(s, n, loc, fmt, ap); + va_end(ap); + + return (ret); +} diff --git a/stdio/FreeBSD/swscanf.c b/stdio/FreeBSD/swscanf.c new file mode 100644 index 0000000..4fc850a --- /dev/null +++ b/stdio/FreeBSD/swscanf.c @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/swscanf.c,v 1.1 2002/09/23 12:40:06 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +int +swscanf(const wchar_t * __restrict str, const wchar_t * __restrict fmt, ...) +{ + va_list ap; + int r; + + va_start(ap, fmt); + r = vswscanf_l(str, __current_locale(), fmt, ap); + va_end(ap); + + return (r); +} + +int +swscanf_l(const wchar_t * __restrict str, locale_t loc, + const wchar_t * __restrict fmt, ...) +{ + va_list ap; + int r; + + /* no need to call NORMALIZE_LOCALE(loc) because vswscanf_l will */ + va_start(ap, fmt); + r = vswscanf_l(str, loc, fmt, ap); + va_end(ap); + + return (r); +} diff --git a/stdio/FreeBSD/tempnam.c b/stdio/FreeBSD/tempnam.c new file mode 100644 index 0000000..adc2adf --- /dev/null +++ b/stdio/FreeBSD/tempnam.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)tempnam.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/tempnam.c,v 1.11 2007/01/09 00:28:07 imp Exp $"); + +#include +#include +#include +#include +#include +#include +#include + +__warn_references(tempnam, + "warning: tempnam() possibly used unsafely; consider using mkstemp()"); + +extern char *_mktemp(char *); + +char * +tempnam(dir, pfx) + const char *dir, *pfx; +{ + int sverrno; + char *f, *name; + + if (!(name = malloc(MAXPATHLEN))) { + return(NULL); + } + + if (!pfx) + pfx = "tmp."; + +#if !__DARWIN_UNIX03 + if (issetugid() == 0 && (f = getenv("TMPDIR"))) { + (void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXX", f, + *(f + strlen(f) - 1) == '/'? "": "/", pfx); + if ((f = _mktemp(name))) { + return(f); + } + } +#endif /* !__DARWIN_UNIX03 */ + if ((f = (char *)dir)) { +#if __DARWIN_UNIX03 + if (access(dir, W_OK) == 0) { +#endif /* __DARWIN_UNIX03 */ + (void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXX", f, + *(f + strlen(f) - 1) == '/'? "": "/", pfx); + if ((f = _mktemp(name))) { + return(f); + } +#if __DARWIN_UNIX03 + } +#endif /* __DARWIN_UNIX03 */ + } + + f = P_tmpdir; +#if __DARWIN_UNIX03 + if (access(f, W_OK) == 0) { /* directory accessible? */ +#endif /* __DARWIN_UNIX03 */ + (void)snprintf(name, MAXPATHLEN, "%s%sXXXXXX", f, pfx); + if ((f = _mktemp(name))) { + return(f); + } + +#if __DARWIN_UNIX03 + } + if (issetugid() == 0 && (f = getenv("TMPDIR")) && access(f, W_OK) == 0) { + (void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXX", f, + *(f + strlen(f) - 1) == '/'? "": "/", pfx); + if ((f = _mktemp(name))) { + return(f); + } + } +#endif /* __DARWIN_UNIX03 */ + f = _PATH_TMP; + (void)snprintf(name, MAXPATHLEN, "%s%sXXXXXX", f, pfx); + if ((f = _mktemp(name))) { + return(f); + } + + sverrno = errno; + free(name); + errno = sverrno; + return(NULL); +} diff --git a/stdio/FreeBSD/tmpfile.c b/stdio/FreeBSD/tmpfile.c new file mode 100644 index 0000000..1efbca7 --- /dev/null +++ b/stdio/FreeBSD/tmpfile.c @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)tmpfile.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/tmpfile.c,v 1.10 2007/01/09 00:28:07 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +FILE * +tmpfile(void) +{ + sigset_t set, oset; + FILE *fp; + int fd, sverrno; +#define TRAILER "tmp.XXXXXX" + char *buf; + const char *tmpdir; + + tmpdir = NULL; + if (issetugid() == 0) + tmpdir = getenv("TMPDIR"); + if (tmpdir == NULL) + tmpdir = _PATH_TMP; + + if (*tmpdir == '\0') + return (NULL); + + (void)asprintf(&buf, "%s%s%s", tmpdir, + (tmpdir[strlen(tmpdir) - 1] == '/') ? "" : "/", TRAILER); + if (buf == NULL) + return (NULL); + + sigfillset(&set); + (void)_sigprocmask(SIG_BLOCK, &set, &oset); + + fd = mkstemp(buf); + if (fd != -1) + (void)unlink(buf); + + free(buf); + + (void)_sigprocmask(SIG_SETMASK, &oset, NULL); + + if (fd == -1) + return (NULL); + + if ((fp = fdopen(fd, "w+")) == NULL) { + sverrno = errno; + (void)_close(fd); + errno = sverrno; + return (NULL); + } + return (fp); +} diff --git a/stdio/FreeBSD/tmpnam.3 b/stdio/FreeBSD/tmpnam.3 new file mode 100644 index 0000000..5f377d9 --- /dev/null +++ b/stdio/FreeBSD/tmpnam.3 @@ -0,0 +1,264 @@ +.\" Copyright (c) 1988, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)tmpnam.3 8.2 (Berkeley) 11/17/93 +.\" $FreeBSD: src/lib/libc/stdio/tmpnam.3,v 1.20 2007/03/16 21:46:24 maxim Exp $ +.\" +.Dd November 12, 2008 +.Dt TMPFILE 3 +.Os +.Sh NAME +.Nm tempnam , +.Nm tmpfile , +.Nm tmpnam +.Nd temporary file routines +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft FILE * +.Fo tmpfile +.Fa "void" +.Fc +.Ft char * +.Fo tmpnam +.Fa "char *s" +.Fc +.Ft char * +.Fo tempnam +.Fa "const char *dir" +.Fa "const char *pfx" +.Fc +.Sh DESCRIPTION +The +.Fn tmpfile +function +returns a pointer to a stream associated with a file descriptor returned +by the routine +.Xr mkstemp 3 . +The created file is unlinked before +.Fn tmpfile +returns, causing the file to be automatically deleted when the last +reference to it is closed. +The file is opened with the access value +.Ql w+ . +If the environment variable +.Ev TMPDIR +is defined, +the file is created in the specified directory. +The default location, if +.Ev TMPDIR +is not set, is +.Pa /tmp . +.Pp +The +.Fn tmpnam +function +returns a pointer to a file name, in the +.Dv P_tmpdir +directory, which +did not reference an existing file at some indeterminate point in the +past. +.Dv P_tmpdir +is defined in the include file +.In stdio.h . +If the argument +.Fa s +is +.Pf non- Dv NULL , +the file name is copied to the buffer it references. +Otherwise, the file name is copied to a static buffer. +In either case, +.Fn tmpnam +returns a pointer to the file name. +.Pp +The buffer referenced by +.Fa s +is expected to be at least +.Dv L_tmpnam +bytes in length. +.Dv L_tmpnam +is defined in the include file +.In stdio.h . +.Pp +The +.Fn tempnam +function +is similar to +.Fn tmpnam , +but provides the ability to specify the directory which will +contain the temporary file and the file name prefix. +.Pp +The argument +.Fa dir +(if +.Pf non- Dv NULL ) , +the directory +.Dv P_tmpdir , +the environment variable +.Ev TMPDIR +(if set), +the directory +.Pa /tmp +and finally, the current directory, +are tried, in the listed order, as directories in which to store the +temporary file. +.Pp +The argument +.Fa pfx , +if +.Pf non- Dv NULL , +is used to specify a file name prefix, which will be the +first part of the created file name. +The +.Fn tempnam +function +allocates memory in which to store the file name; the returned pointer +may be used as a subsequent argument to +.Xr free 3 . +.Sh RETURN VALUES +The +.Fn tmpfile +function +returns a pointer to an open file stream on success, and a +.Dv NULL +pointer +on error. +.Pp +The +.Fn tmpnam +and +.Fn tempfile +functions +return a pointer to a file name on success, and a +.Dv NULL +pointer +on error. +.Sh ENVIRONMENT +.Bl -tag -width Ds +.It Ev TMPDIR +.Pf [ Fn tempnam +only] +If set, +the directory in which the temporary file is stored. +.Ev TMPDIR +is ignored for processes +for which +.Xr issetugid 2 +is true. +.El +.Sh COMPATIBILITY +These interfaces are provided from System V and +.Tn ANSI +compatibility only. +.Pp +Most historic implementations of these functions provide +only a limited number of possible temporary file names +(usually 26) +before file names will start being recycled. +System V implementations of these functions +(and of +.Xr mktemp 3 ) +use the +.Xr access 2 +system call to determine whether or not the temporary file +may be created. +This has obvious ramifications for setuid or setgid programs, +complicating the portable use of these interfaces in such programs. +.Pp +The +.Fn tmpfile +interface should not be used in software expected to be used on other systems +if there is any possibility that the user does not wish the temporary file to +be publicly readable and writable. +.Sh ERRORS +The +.Fn tmpfile +function +may fail and set the global variable +.Va errno +for any of the errors specified for the library functions +.Xr fdopen 3 +or +.Xr mkstemp 3 . +.Pp +The +.Fn tmpnam +function +may fail and set +.Va errno +for any of the errors specified for the library function +.Xr mktemp 3 . +.Pp +The +.Fn tempnam +function +may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr malloc 3 +or +.Xr mktemp 3 . +.Sh SECURITY CONSIDERATIONS +The +.Fn tmpnam +and +.Fn tempnam +functions are susceptible to a race condition +occurring between the selection of the file name +and the creation of the file, +which allows malicious users +to potentially overwrite arbitrary files in the system, +depending on the level of privilege of the running program. +Additionally, there is no means by which +file permissions may be specified. +It is strongly suggested that +.Xr mkstemp 3 +be used in place of these functions. +(See +the FSA.) +.Sh LEGACY DESCRIPTION +In legacy mode, the order directories are tried by the +.Fn tempnam +function is different; the environment variable +.Ev TMPDIR +(if defined) is used first. +.Sh SEE ALSO +.Xr mkstemp 3 , +.Xr mktemp 3 +.Sh STANDARDS +The +.Fn tmpfile +and +.Fn tmpnam +functions +conform to +.St -isoC . diff --git a/stdio/FreeBSD/tmpnam.c b/stdio/FreeBSD/tmpnam.c new file mode 100644 index 0000000..6dad888 --- /dev/null +++ b/stdio/FreeBSD/tmpnam.c @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)tmpnam.c 8.3 (Berkeley) 3/28/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/tmpnam.c,v 1.6 2007/01/09 00:28:07 imp Exp $"); + +#include + +#include +#include +#include +#include + +__warn_references(tmpnam, + "warning: tmpnam() possibly used unsafely; consider using mkstemp()"); + +extern char *_mktemp(char *); + +static char *tmpnam_buf = NULL; +static pthread_once_t tmpnam_buf_control = PTHREAD_ONCE_INIT; + +static void tmpnam_buf_allocate(void) +{ + tmpnam_buf = malloc(L_tmpnam); +} + +char * +tmpnam(s) + char *s; +{ + static u_long tmpcount; + + if (s == NULL) { + if (pthread_once(&tmpnam_buf_control, tmpnam_buf_allocate) + || !tmpnam_buf) { + return NULL; + } + s = tmpnam_buf; + } + (void)snprintf(s, L_tmpnam, "%stmp.%lu.XXXXXX", P_tmpdir, tmpcount); + ++tmpcount; + return (_mktemp(s)); +} diff --git a/stdio/FreeBSD/ungetc.3 b/stdio/FreeBSD/ungetc.3 new file mode 100644 index 0000000..169a02b --- /dev/null +++ b/stdio/FreeBSD/ungetc.3 @@ -0,0 +1,101 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ungetc.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/ungetc.3,v 1.14 2007/01/09 00:28:07 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt UNGETC 3 +.Os +.Sh NAME +.Nm ungetc +.Nd un-get character from input stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fo ungetc +.Fa "int c" +.Fa "FILE *stream" +.Fc +.Sh DESCRIPTION +The +.Fn ungetc +function pushes the character +.Fa c +(converted to an unsigned char) +back onto the input stream pointed to by +.Fa stream . +The pushed-back characters will be returned (in reverse order) +by subsequent reads on the stream. +A successful intervening call +to one of the file positioning functions +.Xr ( fseek 3 , +.Xr fsetpos 3 , +or +.Xr rewind 3 ) , +using the same stream, +will discard the pushed-back characters. +.Pp +Only one character of push-back is guaranteed, +but as long as there is sufficient memory, +an effectively infinite amount of push-back is allowed. +.Pp +If a character is successfully pushed-back, +the end-of-file indicator for the stream is cleared. +The file-position indicator is decremented +by each successful call to +.Fn ungetc ; +if its value was 0 before a call, its value is unspecified after +the call. +.Sh RETURN VALUES +The +.Fn ungetc +function returns the character pushed-back after the conversion, +or +.Dv EOF +if the operation fails. +If the value of the argument +.Fa c +character equals +.Dv EOF , +the operation will fail and the stream will remain unchanged. +.Sh SEE ALSO +.Xr fseek 3 , +.Xr getc 3 , +.Xr setvbuf 3 , +.Xr ungetwc 3 +.Sh STANDARDS +The +.Fn ungetc +function conforms to +.St -isoC . diff --git a/stdio/FreeBSD/ungetc.c b/stdio/FreeBSD/ungetc.c new file mode 100644 index 0000000..287fa02 --- /dev/null +++ b/stdio/FreeBSD/ungetc.c @@ -0,0 +1,168 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ungetc.c 8.2 (Berkeley) 11/3/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/ungetc.c,v 1.18 2008/04/17 22:17:54 jhb Exp $"); + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" +#include "local.h" +#include "libc_private.h" + +static int __submore(FILE *); + +/* + * Expand the ungetc buffer `in place'. That is, adjust fp->_p when + * the buffer moves, so that it points the same distance from the end, + * and move the bytes in the buffer around as necessary so that they + * are all at the end (stack-style). + */ +static int +__submore(FILE *fp) +{ + int i; + unsigned char *p; + + if (fp->_ub._base == fp->_ubuf) { + /* + * Get a new buffer (rather than expanding the old one). + */ + if ((p = malloc((size_t)BUFSIZ)) == NULL) + return (EOF); + fp->_ub._base = p; + fp->_ub._size = BUFSIZ; + p += BUFSIZ - sizeof(fp->_ubuf); + for (i = sizeof(fp->_ubuf); --i >= 0;) + p[i] = fp->_ubuf[i]; + fp->_p = p; + return (0); + } + i = fp->_ub._size; + p = realloc(fp->_ub._base, (size_t)(i << 1)); + if (p == NULL) + return (EOF); + /* no overlap (hence can use memcpy) because we doubled the size */ + (void)memcpy((void *)(p + i), (void *)p, (size_t)i); + fp->_p = p + i; + fp->_ub._base = p; + fp->_ub._size = i << 1; + return (0); +} + +/* + * MT-safe version + */ +int +ungetc(int c, FILE *fp) +{ + int ret; + + pthread_once(&__sdidinit, __sinit); + + FLOCKFILE(fp); + ORIENT(fp, -1); + ret = __ungetc(c, fp); + FUNLOCKFILE(fp); + return (ret); +} + +/* + * Non-MT-safe version + */ +int +__ungetc(int c, FILE *fp) +{ + + if (c == EOF) + return (EOF); + if ((fp->_flags & __SRD) == 0) { + /* + * Not already reading: no good unless reading-and-writing. + * Otherwise, flush any current write stuff. + */ + if ((fp->_flags & __SRW) == 0) + return (EOF); + if (fp->_flags & __SWR) { + if (__sflush(fp)) + return (EOF); + fp->_flags &= ~__SWR; + fp->_w = 0; + fp->_lbfsize = 0; + } + fp->_flags |= __SRD; + } + c = (unsigned char)c; + + /* + * If we are in the middle of ungetc'ing, just continue. + * This may require expanding the current ungetc buffer. + */ + if (HASUB(fp)) { + if (fp->_r >= fp->_ub._size && __submore(fp)) + return (EOF); + *--fp->_p = c; + fp->_r++; + return (c); + } + fp->_flags &= ~__SEOF; + + /* + * If we can handle this by simply backing up, do so, + * but never replace the original character. + * (This makes sscanf() work when scanning `const' data.) + */ + if (fp->_bf._base != NULL && fp->_p > fp->_bf._base && + fp->_p[-1] == c) { + fp->_p--; + fp->_r++; + return (c); + } + + /* + * Create an ungetc buffer. + * Initially, we will use the `reserve' buffer. + */ + fp->_ur = fp->_r; + fp->_up = fp->_p; + fp->_ub._base = fp->_ubuf; + fp->_ub._size = sizeof(fp->_ubuf); + fp->_ubuf[sizeof(fp->_ubuf) - 1] = c; + fp->_p = &fp->_ubuf[sizeof(fp->_ubuf) - 1]; + fp->_r = 1; + return (c); +} diff --git a/stdio/FreeBSD/ungetwc.3 b/stdio/FreeBSD/ungetwc.3 new file mode 100644 index 0000000..726ec65 --- /dev/null +++ b/stdio/FreeBSD/ungetwc.3 @@ -0,0 +1,118 @@ +.\" $NetBSD: ungetwc.3,v 1.3 2002/02/07 07:00:27 ross Exp $ +.\" +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ungetc.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/ungetwc.3,v 1.6 2007/01/09 00:28:07 imp Exp $ +.\" +.Dd March 3, 2004 +.Dt UNGETWC 3 +.Os +.Sh NAME +.Nm ungetwc , +.Nm ungetwc_l +.Nd un-get wide character from input stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft wint_t +.Fo ungetwc +.Fa "wint_t wc" +.Fa "FILE *stream" +.Fc +.In stdio.h +.In wchar.h +.In xlocale.h +.Ft wint_t +.Fo ungetwc_l +.Fa "wint_t wc" +.Fa "FILE *stream" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn ungetwc +function pushes the wide character +.Fa wc +(converted to an +.Vt wchar_t ) +back onto the input stream pointed to by +.Fa stream . +The pushed-backed wide characters will be returned (in reverse order) +by subsequent reads on the stream. +A successful intervening call to one of the file +positioning functions +.Xr fseek 3 , +.Xr fsetpos 3 , +or +.Xr rewind 3 , +using the same stream, +will discard the pushed-back wide characters. +.Pp +Only one wide character of push-back is guaranteed, +but as long as there is sufficient memory, +an effectively infinite amount of push-back is allowed. +.Pp +If a character is successfully pushed-back, +the end-of-file indicator for the stream is cleared. +.Pp +Although the +.Fn ungetwc +function uses the current locale, the +.Fn ungetwc_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn ungetwc +function +returns +the wide character pushed-back after the conversion, or +.Dv WEOF +if the operation fails. +If the value of the argument +.Fa c +character equals +.Dv WEOF , +the operation will fail and the stream will remain unchanged. +.Sh SEE ALSO +.Xr fseek 3 , +.Xr getwc 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn ungetwc +function conforms to +.St -isoC-99 . diff --git a/stdio/FreeBSD/ungetwc.c b/stdio/FreeBSD/ungetwc.c new file mode 100644 index 0000000..37e6402 --- /dev/null +++ b/stdio/FreeBSD/ungetwc.c @@ -0,0 +1,93 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/ungetwc.c,v 1.11 2008/04/17 22:17:54 jhb Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" +#include "mblocal.h" + +/* + * Non-MT-safe version. + */ +wint_t +__ungetwc(wint_t wc, FILE *fp, locale_t loc) +{ + char buf[MB_LEN_MAX]; + size_t len; + + if (wc == WEOF) + return (WEOF); + if ((len = loc->__lc_ctype->__wcrtomb(buf, wc, &fp->_mbstate, loc)) == (size_t)-1) { + fp->_flags |= __SERR; + return (WEOF); + } + while (len-- != 0) + if (__ungetc((unsigned char)buf[len], fp) == EOF) + return (WEOF); + + return (wc); +} + +/* + * MT-safe version. + */ +wint_t +ungetwc(wint_t wc, FILE *fp) +{ + wint_t r; + + FLOCKFILE(fp); + ORIENT(fp, 1); + r = __ungetwc(wc, fp, __current_locale()); + FUNLOCKFILE(fp); + + return (r); +} + +wint_t +ungetwc_l(wint_t wc, FILE *fp, locale_t loc) +{ + wint_t r; + + NORMALIZE_LOCALE(loc); + FLOCKFILE(fp); + ORIENT(fp, 1); + r = __ungetwc(wc, fp, loc); + FUNLOCKFILE(fp); + + return (r); +} diff --git a/stdio/FreeBSD/vasprintf.c b/stdio/FreeBSD/vasprintf.c new file mode 100644 index 0000000..81f5172 --- /dev/null +++ b/stdio/FreeBSD/vasprintf.c @@ -0,0 +1,82 @@ +/* $OpenBSD: vasprintf.c,v 1.4 1998/06/21 22:13:47 millert Exp $ */ + +/* + * Copyright (c) 1997 Todd C. Miller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vasprintf.c,v 1.19 2008/04/17 22:17:54 jhb Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include "local.h" + +__private_extern__ int +_vasprintf(printf_comp_t __restrict pc, printf_domain_t __restrict domain, char ** __restrict str, locale_t __restrict loc, const char * __restrict fmt, __va_list ap) +{ + int ret; + FILE f; + struct __sFILEX ext; + f._extra = &ext; + INITEXTRA(&f); + + f._file = -1; + f._flags = __SWR | __SSTR | __SALC; + f._bf._base = f._p = (unsigned char *)malloc(128); + if (f._bf._base == NULL) { + *str = NULL; + errno = ENOMEM; + return (-1); + } + f._bf._size = f._w = 127; /* Leave room for the NUL */ + f._orientation = 0; + memset(&f._mbstate, 0, sizeof(mbstate_t)); + ret = __v2printf(pc, domain, &f, loc, fmt, ap); + if (ret < 0) { + free(f._bf._base); + *str = NULL; + errno = ENOMEM; + return (-1); + } + *f._p = '\0'; + *str = (char *)f._bf._base; + return (ret); +} + +int +vasprintf_l(char ** __restrict str, locale_t __restrict loc, const char * __restrict fmt, __va_list ap) +{ + return _vasprintf(XPRINTF_PLAIN, NULL, str, loc, fmt, ap); +} + +int +vasprintf(char ** __restrict str, const char * __restrict fmt, __va_list ap) +{ + return _vasprintf(XPRINTF_PLAIN, NULL, str, __current_locale(), fmt, ap); +} diff --git a/stdio/FreeBSD/vdprintf.c b/stdio/FreeBSD/vdprintf.c new file mode 100644 index 0000000..c1b03c9 --- /dev/null +++ b/stdio/FreeBSD/vdprintf.c @@ -0,0 +1,82 @@ +/*- + * Copyright (c) 2009 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vdprintf.c,v 1.1 2009/03/04 03:38:51 das Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" + +#include "local.h" + +__private_extern__ int +_vdprintf(printf_comp_t __restrict pc, printf_domain_t __restrict domain, int fd, locale_t __restrict loc, const char * __restrict fmt, va_list ap) +{ + FILE f; + unsigned char buf[BUFSIZ]; + int ret; + struct __sFILEX ext; + f._extra = &ext; + INITEXTRA(&f); + + if (fd > SHRT_MAX) { + errno = EMFILE; + return (EOF); + } + + f._p = buf; + f._w = sizeof(buf); + f._flags = __SWR; + f._file = fd; + f._cookie = &f; + f._write = __swrite; + f._bf._base = buf; + f._bf._size = sizeof(buf); + f._orientation = 0; + bzero(&f._mbstate, sizeof(f._mbstate)); + + if ((ret = __v2printf(pc, domain, &f, loc, fmt, ap)) < 0) + return (ret); + + return (__fflush(&f) ? EOF : ret); +} + +int +vdprintf_l(int fd, locale_t __restrict loc, const char * __restrict fmt, va_list ap) +{ + return _vdprintf(XPRINTF_PLAIN, NULL, fd, loc, fmt, ap); +} + +int +vdprintf(int fd, const char * __restrict fmt, va_list ap) { + return _vdprintf(XPRINTF_PLAIN, NULL, fd, __current_locale(), fmt, ap); +} diff --git a/stdio/FreeBSD/vfprintf.c b/stdio/FreeBSD/vfprintf.c new file mode 100644 index 0000000..cf51045 --- /dev/null +++ b/stdio/FreeBSD/vfprintf.c @@ -0,0 +1,1461 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wint-conversion" + +#include +#if !TARGET_OS_DRIVERKIT +#define OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE 1 +#endif + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.90 2009/02/28 06:06:57 das Exp $"); + +#include "xlocale_private.h" + +/* + * Actual printf innards. + * + * This code is large and complicated... + */ + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if 0 // xprintf pending API review +#include +#endif +#include + +#include +#include "un-namespace.h" + +#include +#include +#include + +#include "libc_private.h" +#include "local.h" +#include "fvwrite.h" +#include "printflocal.h" + +static int __sprint(FILE *, locale_t, struct __suio *); +#if 0 +static int __sbprintf(FILE *, locale_t, const char *, va_list) __printflike(3, 0); +#endif +static char *__wcsconv(wchar_t *, int, locale_t); + +__private_extern__ const char *__fix_nogrouping(const char *); + +#define CHAR char +#include "printfcommon.h" + +struct grouping_state { + char *thousands_sep; /* locale-specific thousands separator */ + int thousep_len; /* length of thousands_sep */ + const char *grouping; /* locale-specific numeric grouping rules */ + int lead; /* sig figs before decimal or group sep */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ +}; + +/* + * Initialize the thousands' grouping state in preparation to print a + * number with ndigits digits. This routine returns the total number + * of bytes that will be needed. + */ +static int +grouping_init(struct grouping_state *gs, int ndigits, locale_t loc) +{ + struct lconv *locale; + + locale = localeconv_l(loc); + gs->grouping = __fix_nogrouping(locale->grouping); + gs->thousands_sep = locale->thousands_sep; + gs->thousep_len = strlen(gs->thousands_sep); + + gs->nseps = gs->nrepeats = 0; + gs->lead = ndigits; + while (*gs->grouping != CHAR_MAX) { + if (gs->lead <= *gs->grouping) + break; + gs->lead -= *gs->grouping; + if (*(gs->grouping+1)) { + gs->nseps++; + gs->grouping++; + } else + gs->nrepeats++; + } + return ((gs->nseps + gs->nrepeats) * gs->thousep_len); +} + +/* + * Print a number with thousands' separators. + */ +static int +grouping_print(struct grouping_state *gs, struct io_state *iop, + const CHAR *cp, const CHAR *ep, locale_t loc) +{ + const CHAR *cp0 = cp; + + if (io_printandpad(iop, cp, ep, gs->lead, zeroes, loc)) + return (-1); + cp += gs->lead; + while (gs->nseps > 0 || gs->nrepeats > 0) { + if (gs->nrepeats > 0) + gs->nrepeats--; + else { + gs->grouping--; + gs->nseps--; + } + if (io_print(iop, gs->thousands_sep, gs->thousep_len, loc)) + return (-1); + if (io_printandpad(iop, cp, ep, *gs->grouping, zeroes, loc)) + return (-1); + cp += *gs->grouping; + } + if (cp > ep) + cp = ep; + return (cp - cp0); +} + +/* + * Flush out all the vectors defined by the given uio, + * then reset it so that it can be reused. + */ +static int +__sprint(FILE *fp, locale_t loc __unused, struct __suio *uio) +{ + int err; + + if (uio->uio_resid == 0) { + uio->uio_iovcnt = 0; + return (0); + } + err = __sfvwrite(fp, uio); + uio->uio_resid = 0; + uio->uio_iovcnt = 0; + return (err); +} + +#if 0 +/* + * Helper function for `fprintf to unbuffered unix file': creates a + * temporary buffer. We only work on write-only files; this avoids + * worries about ungetc buffers and so forth. + */ +static int +__sbprintf(FILE *fp, locale_t loc, const char *fmt, va_list ap) +{ + int ret; + FILE fake; + unsigned char buf[BUFSIZ]; + struct __sFILEX ext; + fake._extra = &ext; + INITEXTRA(&fake); + + /* XXX This is probably not needed. */ + if (prepwrite(fp) != 0) + return (EOF); + + /* copy the important variables */ + fake._flags = fp->_flags & ~__SNBF; + fake._file = fp->_file; + fake._cookie = fp->_cookie; + fake._write = fp->_write; + fake._orientation = fp->_orientation; + fake._mbstate = fp->_mbstate; + + /* set up the buffer */ + fake._bf._base = fake._p = buf; + fake._bf._size = fake._w = sizeof(buf); + fake._lbfsize = 0; /* not actually used, but Just In Case */ + + /* do the work, then copy any error status */ + ret = __vfprintf(&fake, loc, fmt, ap); + if (ret >= 0 && __fflush(&fake)) + ret = EOF; + if (fake._flags & __SERR) + fp->_flags |= __SERR; + return (ret); +} +#endif + +/* + * Convert a wide character string argument for the %ls format to a multibyte + * string representation. If not -1, prec specifies the maximum number of + * bytes to output, and also means that we can't assume that the wide char. + * string ends is null-terminated. + */ +static char * +__wcsconv(wchar_t *wcsarg, int prec, locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs; + char buf[MB_LEN_MAX]; + wchar_t *p; + char *convbuf; + size_t clen, nbytes; + + /* Allocate space for the maximum number of bytes we could output. */ + if (prec < 0) { + p = wcsarg; + mbs = initial; + nbytes = wcsrtombs_l(NULL, (const wchar_t **)&p, 0, &mbs, loc); + if (nbytes == (size_t)-1) + return (NULL); + } else { + /* + * Optimisation: if the output precision is small enough, + * just allocate enough memory for the maximum instead of + * scanning the string. + */ + if (prec < 128) + nbytes = prec; + else { + nbytes = 0; + p = wcsarg; + mbs = initial; + for (;;) { + clen = wcrtomb_l(buf, *p++, &mbs, loc); + if (clen == 0 || clen == (size_t)-1 || + nbytes + clen > prec) + break; + nbytes += clen; + } + } + } + if ((convbuf = malloc(nbytes + 1)) == NULL) + return (NULL); + + /* Fill the output buffer. */ + p = wcsarg; + mbs = initial; + if ((nbytes = wcsrtombs_l(convbuf, (const wchar_t **)&p, + nbytes, &mbs, loc)) == (size_t)-1) { + free(convbuf); + return (NULL); + } + convbuf[nbytes] = '\0'; + return (convbuf); +} + +/* + * MT-safe version + */ +int +vfprintf_l(FILE * __restrict fp, locale_t loc, const char * __restrict fmt0, va_list ap) + +{ + int ret; + + FLOCKFILE(fp); + ret = __xvprintf(XPRINTF_PLAIN, NULL, fp, loc, fmt0, ap); + FUNLOCKFILE(fp); + return (ret); +} + +int +vfprintf(FILE * __restrict fp, const char * __restrict fmt0, va_list ap) + +{ + int ret; + + FLOCKFILE(fp); + ret = __xvprintf(XPRINTF_PLAIN, NULL, fp, __current_locale(), fmt0, ap); + FUNLOCKFILE(fp); + return ret; +} + +/* + * The size of the buffer we use as scratch space for integer + * conversions, among other things. We need enough space to + * write a uintmax_t in octal (plus one byte). + */ +#if UINTMAX_MAX <= UINT64_MAX +#define BUF 32 +#else +#error "BUF must be large enough to format a uintmax_t" +#endif + +__private_extern__ bool +__printf_is_memory_read_only(void *addr, size_t __unused size) +{ + vm_address_t address = addr; + vm_size_t vmsize = 0; + vm_region_basic_info_data_64_t info; + mach_msg_type_number_t info_cnt = VM_REGION_BASIC_INFO_COUNT_64; + memory_object_name_t object = MACH_PORT_NULL; + kern_return_t kr = KERN_SUCCESS; + + kr = vm_region_64(mach_task_self(), + &address, + &vmsize, + VM_REGION_BASIC_INFO_64, + (vm_region_info_t) &info, + &info_cnt, + &object); + return (kr == KERN_SUCCESS) && !(info.protection & VM_PROT_WRITE); +} + +/* + * Non-MT-safe version + */ +__private_extern__ int +__vfprintf(FILE *fp, locale_t loc, const char *fmt0, va_list ap) +{ + char *fmt; /* format string */ + int ch; /* character from fmt */ + ssize_t n, n2; /* handy integer (short term usage) */ + char *cp; /* handy char pointer (short term usage) */ + int flags; /* flags as above */ + ssize_t ret; /* return value accumulator */ + ssize_t width; /* width from format (%8d), or 0 */ + ssize_t prec; /* precision from format; <0 for N/A */ + char sign; /* sign prefix (' ', '+', '-', or \0) */ + struct grouping_state gs; /* thousands' grouping info */ + +#ifndef ALLOW_DYNAMIC_PERCENT_N + bool static_format_checked = false; +#endif // ALLOW_DYNAMIC_PERCENT_N + +#ifndef NO_FLOATING_POINT + /* + * We can decompose the printed representation of floating + * point numbers into several parts, some of which may be empty: + * + * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ + * A B ---C--- D E F + * + * A: 'sign' holds this value if present; '\0' otherwise + * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal + * C: cp points to the string MMMNNN. Leading and trailing + * zeros are not in the string and must be added. + * D: expchar holds this character; '\0' if no exponent, e.g. %f + * F: at least two digits for decimal, at least one digit for hex + */ + char *decimal_point; /* locale specific decimal point */ + int decpt_len; /* length of decimal_point */ + int signflag; /* true if float is negative */ + union { /* floating point arguments %[aAeEfFgG] */ + double dbl; + long double ldbl; + } fparg; + int expt; /* integer value of exponent */ + char expchar; /* exponent character: [eEpP\0] */ + char *dtoaend; /* pointer to end of converted digits */ + int expsize; /* character count for expstr */ + int ndig; /* actual number of digits returned by dtoa */ + char expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ + char *dtoaresult; /* buffer allocated by dtoa */ +#endif +#ifdef VECTORS + union arg vval; /* Vector argument. */ + char *pct; /* Pointer to '%' at beginning of specifier. */ + char vsep; /* Vector separator character. */ +#endif + u_long ulval; /* integer arguments %[diouxX] */ + uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ + int base; /* base for [diouxX] conversion */ + int dprec; /* a copy of prec if [diouxX], 0 otherwise */ + ssize_t realsz; /* field size expanded by dprec, sign, etc */ + ssize_t size; /* size of converted field or string */ + ssize_t prsize; /* max size of printed field */ + const char *xdigs; /* digits for %[xX] conversion */ + struct io_state io; /* I/O buffering state */ + char buf[BUF]; /* buffer with space for digits of uintmax_t */ + char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ + union arg *argtable; /* args, built due to positional arg */ + union arg statargtable [STATIC_ARG_TBL_SIZE]; + int nextarg; /* 1-based argument index */ + va_list orgap; /* original argument pointer */ + char *convbuf; /* wide to multibyte conversion result */ + + static const char xdigs_lower[16] = "0123456789abcdef"; + static const char xdigs_upper[16] = "0123456789ABCDEF"; + + /* BEWARE, these `goto error' on error. */ +#define PRINT(ptr, len) { \ + if (io_print(&io, (ptr), (len), loc)) \ + goto error; \ +} +#define PAD(howmany, with) { \ + if (io_pad(&io, (howmany), (with), loc)) \ + goto error; \ +} +#define PRINTANDPAD(p, ep, len, with) { \ + if (io_printandpad(&io, (p), (ep), (len), (with), loc)) \ + goto error; \ +} +#define FLUSH() { \ + if (io_flush(&io, loc)) \ + goto error; \ +} + + /* + * Get the argument indexed by nextarg. If the argument table is + * built, use it to get the argument. If its not, get the next + * argument (and arguments must be gotten sequentially). + */ +#define GETARG(type) \ + ((argtable != NULL) ? *((type*)(&argtable[nextarg++])) : \ + (nextarg++, va_arg(ap, type))) + + /* + * To extend shorts properly, we need both signed and unsigned + * argument extraction methods. + */ +#define SARG() \ + (flags&LONGINT ? GETARG(long) : \ + flags&SHORTINT ? (long)(short)GETARG(int) : \ + flags&CHARINT ? (long)(signed char)GETARG(int) : \ + (long)GETARG(int)) +#define UARG() \ + (flags&LONGINT ? GETARG(u_long) : \ + flags&SHORTINT ? (u_long)(u_short)GETARG(int) : \ + flags&CHARINT ? (u_long)(u_char)GETARG(int) : \ + (u_long)GETARG(u_int)) +#define INTMAX_SIZE (INTMAXT|SIZET|PTRDIFFT|LLONGINT) +#define SJARG() \ + (flags&INTMAXT ? GETARG(intmax_t) : \ + flags&SIZET ? (intmax_t)GETARG(ssize_t) : \ + flags&PTRDIFFT ? (intmax_t)GETARG(ptrdiff_t) : \ + (intmax_t)GETARG(long long)) +#define UJARG() \ + (flags&INTMAXT ? GETARG(uintmax_t) : \ + flags&SIZET ? (uintmax_t)GETARG(size_t) : \ + flags&PTRDIFFT ? (uintmax_t)(unsigned long)GETARG(ptrdiff_t) : \ + (uintmax_t)GETARG(unsigned long long)) + + /* + * Get * arguments, including the form *nn$. Preserve the nextarg + * that the argument can be gotten once the type is determined. + */ +#define GETASTER(val) \ + n2 = 0; \ + cp = fmt; \ + while (is_digit(*cp)) { \ + n2 = 10 * n2 + to_digit(*cp); \ + cp++; \ + } \ + if (*cp == '$') { \ + int hold = nextarg; \ + if (argtable == NULL) { \ + argtable = statargtable; \ + if (__find_arguments (fmt0, orgap, &argtable)) { \ + ret = EOF; \ + goto error; \ + } \ + } \ + nextarg = n2; \ + val = GETARG (int); \ + nextarg = hold; \ + fmt = ++cp; \ + } else { \ + val = GETARG (int); \ + } + + /* The following has been moved to __v2printf() */ +#if 0 + /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ + if (prepwrite(fp) != 0) { + errno = EBADF; + return (EOF); + } + ORIENT(fp, -1); +#endif + + convbuf = NULL; + fmt = (char *)fmt0; + argtable = NULL; + nextarg = 1; + va_copy(orgap, ap); + io_init(&io, fp); + ret = 0; +#ifndef NO_FLOATING_POINT + dtoaresult = NULL; + decimal_point = localeconv_l(loc)->decimal_point; + /* The overwhelmingly common case is decpt_len == 1. */ + decpt_len = (decimal_point[1] == '\0' ? 1 : strlen(decimal_point)); +#endif + + /* + * Scan the format for conversions (`%' character). + */ + for (;;) { + for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++) + /* void */; + if ((n = fmt - cp) != 0) { + if (ret + n >= INT_MAX) { + ret = EOF; + errno = EOVERFLOW; + goto error; + } + PRINT(cp, n); + ret += n; + } + if (ch == '\0') + goto done; +#ifdef VECTORS + pct = fmt; +#endif /* VECTORS */ + fmt++; /* skip over '%' */ + + flags = 0; + dprec = 0; + width = 0; + prec = -1; + gs.grouping = NULL; + sign = '\0'; + ox[1] = '\0'; +#ifdef VECTORS + vsep = 'X'; /* Illegal value, changed to defaults later. */ +#endif /* VECTORS */ + +rflag: ch = *fmt++; +reswitch: switch (ch) { + case ' ': + /*- + * ``If the space and + flags both appear, the space + * flag will be ignored.'' + * -- ANSI X3J11 + */ + if (!sign) + sign = ' '; + goto rflag; + case '#': + flags |= ALT; + goto rflag; +#ifdef VECTORS + case ',': case ';': case ':': case '_': + vsep = ch; + goto rflag; +#endif /* VECTORS */ + case '*': + /*- + * ``A negative field width argument is taken as a + * - flag followed by a positive field width.'' + * -- ANSI X3J11 + * They don't exclude field widths read from args. + */ + GETASTER (width); + if (width >= 0) + goto rflag; + width = -width; + /* FALLTHROUGH */ + case '-': + flags |= LADJUST; + goto rflag; + case '+': + sign = '+'; + goto rflag; + case '\'': + flags |= GROUPING; + goto rflag; + case '.': + if ((ch = *fmt++) == '*') { + GETASTER (prec); + goto rflag; + } + prec = 0; + while (is_digit(ch)) { + prec = 10 * prec + to_digit(ch); + ch = *fmt++; + } + goto reswitch; + case '0': + /*- + * ``Note that 0 is taken as a flag, not as the + * beginning of a field width.'' + * -- ANSI X3J11 + */ + flags |= ZEROPAD; + goto rflag; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + n = 0; + do { + n = 10 * n + to_digit(ch); + ch = *fmt++; + } while (is_digit(ch)); + if (ch == '$') { + nextarg = n; + if (argtable == NULL) { + argtable = statargtable; + if (__find_arguments (fmt0, orgap, + &argtable)) { + ret = EOF; + goto error; + } + } + goto rflag; + } + width = n; + goto reswitch; +#ifndef NO_FLOATING_POINT + case 'L': + flags |= LONGDBL; + goto rflag; +#endif + case 'h': + if (flags & SHORTINT) { + flags &= ~SHORTINT; + flags |= CHARINT; + } else + flags |= SHORTINT; + goto rflag; + case 'j': + flags |= INTMAXT; + goto rflag; + case 'l': + if (flags & LONGINT) { + flags &= ~LONGINT; + flags |= LLONGINT; + } else + flags |= LONGINT; + goto rflag; + case 'q': + flags |= LLONGINT; /* not necessarily */ + goto rflag; + case 't': + flags |= PTRDIFFT; + goto rflag; + case 'z': + flags |= SIZET; + goto rflag; + case 'C': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'c': +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & LONGINT) { + static const mbstate_t initial; + mbstate_t mbs; + size_t mbseqlen; + + mbs = initial; + mbseqlen = wcrtomb_l(cp = buf, + (wchar_t)GETARG(wint_t), &mbs, loc); + if (mbseqlen == (size_t)-1) { + fp->_flags |= __SERR; + goto error; + } + size = (int)mbseqlen; + } else { + *(cp = buf) = GETARG(int); + size = 1; + } + sign = '\0'; + break; + case 'D': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'd': + case 'i': +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & INTMAX_SIZE) { + ujval = SJARG(); + if ((intmax_t)ujval < 0) { + ujval = -ujval; + sign = '-'; + } + } else { + ulval = SARG(); + if ((long)ulval < 0) { + ulval = -ulval; + sign = '-'; + } + } + base = 10; + goto number; +#ifndef NO_FLOATING_POINT + case 'a': + case 'A': +#ifdef VECTORS + if (flags & VECTOR) { + flags |= FPT; + break; + } +#endif /* VECTORS */ + if (ch == 'a') { + ox[1] = 'x'; + xdigs = xdigs_lower; + expchar = 'p'; + } else { + ox[1] = 'X'; + xdigs = xdigs_upper; + expchar = 'P'; + } + if (prec >= 0) + prec++; + if (dtoaresult != NULL) + freedtoa(dtoaresult); + if (flags & LONGDBL) { + fparg.ldbl = GETARG(long double); + dtoaresult = cp = + __hldtoa(fparg.ldbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = cp = + __hdtoa(fparg.dbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } + if (prec < 0) + prec = dtoaend - cp; + if (expt == INT_MAX) + ox[1] = '\0'; + goto fp_common; + case 'e': + case 'E': +#ifdef VECTORS + if (flags & VECTOR) { + flags |= FPT; + break; + } +#endif /* VECTORS */ + expchar = ch; + if (prec < 0) /* account for digit before decpt */ + prec = DEFPREC + 1; + else + prec++; + goto fp_begin; + case 'f': + case 'F': +#ifdef VECTORS + if (flags & VECTOR) { + flags |= FPT; + break; + } +#endif /* VECTORS */ + expchar = '\0'; + goto fp_begin; + case 'g': + case 'G': +#ifdef VECTORS + if (flags & VECTOR) { + flags |= FPT; + break; + } +#endif /* VECTORS */ + expchar = ch - ('g' - 'e'); + if (prec == 0) + prec = 1; +fp_begin: + if (prec < 0) + prec = DEFPREC; + if (dtoaresult != NULL) + freedtoa(dtoaresult); + if (flags & LONGDBL) { + fparg.ldbl = GETARG(long double); + dtoaresult = cp = + __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = cp = + dtoa(fparg.dbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + if (expt == 9999) + expt = INT_MAX; + } +fp_common: + if (signflag) + sign = '-'; + if (expt == INT_MAX) { /* inf or nan */ + if (*cp == 'N') { + cp = (ch >= 'a') ? "nan" : "NAN"; + sign = '\0'; + } else + cp = (ch >= 'a') ? "inf" : "INF"; + size = 3; + flags &= ~ZEROPAD; + break; + } + flags |= FPT; + ndig = dtoaend - cp; + if (ch == 'g' || ch == 'G') { + if (expt > -4 && expt <= prec) { + /* Make %[gG] smell like %[fF] */ + expchar = '\0'; + if (flags & ALT) + prec -= expt; + else + prec = ndig - expt; + if (prec < 0) + prec = 0; + } else { + /* + * Make %[gG] smell like %[eE], but + * trim trailing zeroes if no # flag. + */ + if (!(flags & ALT)) + prec = ndig; + } + } + if (expchar) { + expsize = exponent(expstr, expt - 1, expchar); + size = expsize + prec; + if (prec > 1 || flags & ALT) + size += decpt_len; + } else { + /* space for digits before decimal point */ + if (expt > 0) + size = expt; + else /* "0" */ + size = 1; + /* space for decimal pt and following digits */ + if (prec || flags & ALT) + size += prec + decpt_len; + if ((flags & GROUPING) && expt > 0) + size += grouping_init(&gs, expt, loc); + } + break; +#endif /* !NO_FLOATING_POINT */ + case 'n': + { + /* + * Assignment-like behavior is specified if the + * value overflows or is otherwise unrepresentable. + * C99 says to use `signed char' for %hhn conversions. + */ + void *ptr = GETARG(void *); + if (ptr == NULL) + continue; + +#ifndef ALLOW_DYNAMIC_PERCENT_N + if (!static_format_checked) { + static_format_checked = __printf_is_memory_read_only((void*)fmt0, strlen(fmt0)); + } + if (!static_format_checked) { +#if OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE + os_crash("%%n used in a non-immutable format string: %s", fmt0); +#else + os_crash("%%n used in a non-immutable format string"); +#endif + } +#endif // ALLOW_DYNAMIC_PERCENT_N + + if (flags & LLONGINT) + *(long long *)ptr = ret; + else if (flags & SIZET) + *(ssize_t *)ptr = (ssize_t)ret; + else if (flags & PTRDIFFT) + *(ptrdiff_t *)ptr = ret; + else if (flags & INTMAXT) + *(intmax_t *)ptr = ret; + else if (flags & LONGINT) + *(long *)ptr = ret; + else if (flags & SHORTINT) + *(short *)ptr = ret; + else if (flags & CHARINT) + *(signed char *)ptr = ret; + else + *(int *)ptr = ret; + continue; /* no output */ + } + case 'O': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'o': +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & INTMAX_SIZE) + ujval = UJARG(); + else + ulval = UARG(); + base = 8; + goto nosign; + case 'p': + /*- + * ``The argument shall be a pointer to void. The + * value of the pointer is converted to a sequence + * of printable characters, in an implementation- + * defined manner.'' + * -- ANSI X3J11 + */ +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + ujval = (uintmax_t)(uintptr_t)GETARG(void *); + base = 16; + xdigs = xdigs_lower; + flags = flags | INTMAXT; + ox[1] = 'x'; + goto nosign; + case 'S': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 's': + if (flags & LONGINT) { + wchar_t *wcp; + + free(convbuf); + if ((wcp = GETARG(wchar_t *)) == NULL) { + convbuf = NULL; + cp = "(null)"; + } else { + convbuf = __wcsconv(wcp, prec, loc); + if (convbuf == NULL) { + fp->_flags |= __SERR; + goto error; + } + cp = convbuf; + } + } else if ((cp = GETARG(char *)) == NULL) + cp = "(null)"; + { + size_t cp_len = (prec >= 0) ? strnlen(cp, prec) : strlen(cp); + if (cp_len < INT_MAX) { + size = cp_len; + } else { + ret = EOF; + goto error; + } + } + sign = '\0'; + break; + case 'U': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'u': +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & INTMAX_SIZE) + ujval = UJARG(); + else + ulval = UARG(); + base = 10; + goto nosign; + case 'X': + xdigs = xdigs_upper; + goto hex; + case 'x': + xdigs = xdigs_lower; +hex: +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & INTMAX_SIZE) + ujval = UJARG(); + else + ulval = UARG(); + base = 16; + /* leading 0x/X only if non-zero */ + if (flags & ALT && + (flags & INTMAX_SIZE ? ujval != 0 : ulval != 0)) + ox[1] = ch; + + flags &= ~GROUPING; + /* unsigned conversions */ +nosign: sign = '\0'; + /*- + * ``... diouXx conversions ... if a precision is + * specified, the 0 flag will be ignored.'' + * -- ANSI X3J11 + * except for %#.0o and zero value + */ +number: if ((dprec = prec) >= 0) + flags &= ~ZEROPAD; + + /*- + * ``The result of converting a zero value with an + * explicit precision of zero is no characters.'' + * -- ANSI X3J11 + * + * ``The C Standard is clear enough as is. The call + * printf("%#.0o", 0) should print 0.'' + * -- Defect Report #151 + */ + cp = buf + BUF; + if (flags & INTMAX_SIZE) { + if (ujval != 0 || prec != 0 || + (flags & ALT && base == 8)) + cp = __ujtoa(ujval, cp, base, + flags & ALT, xdigs); + } else { + if (ulval != 0 || prec != 0 || + (flags & ALT && base == 8)) + cp = __ultoa(ulval, cp, base, + flags & ALT, xdigs); + } + size = buf + BUF - cp; + if (size > BUF) /* should never happen */ + LIBC_ABORT("size (%zd) > BUF (%d)", size, BUF); + if ((flags & GROUPING) && size != 0) + size += grouping_init(&gs, size, loc); + break; +#ifdef VECTORS + case 'v': + flags |= VECTOR; + goto rflag; +#endif /* VECTORS */ + default: /* "%?" prints ?, unless ? is NUL */ + if (ch == '\0') + goto done; + /* pretend it was %c with argument ch */ + cp = buf; + *cp = ch; + size = 1; + sign = '\0'; + break; + } + +#ifdef VECTORS + if (flags & VECTOR) { + /* + * Do the minimum amount of work necessary to construct + * a format specifier that can be used to recursively + * call vfprintf() for each element in the vector. + */ + int i, j; /* Counter. */ + int vcnt; /* Number of elements in vector. */ + char *vfmt; /* Pointer to format specifier. */ +#define EXTRAHH 2 + char vfmt_buf[32 + EXTRAHH]; /* Static buffer for format spec. */ + int vwidth = 0; /* Width specified via '*'. */ + int vprec = 0; /* Precision specified via '*'. */ + char *vstr; /* Used for asprintf(). */ + int vlen; /* Length returned by asprintf(). */ + enum { + V_CHAR, V_SHORT, V_INT, + V_PCHAR, V_PSHORT, V_PINT, + V_FLOAT, +#ifdef V64TYPE + V_LONGLONG, V_PLONGLONG, + V_DOUBLE, +#endif /* V64TYPE */ + } vtype; + + vval.vectorarg = GETARG(VECTORTYPE); + /* + * Set vfmt. If vfmt_buf may not be big enough, + * malloc() space, taking care to free it later. + * (EXTRAHH is for possible extra "hh") + */ + if (&fmt[-1] - pct + EXTRAHH < sizeof(vfmt_buf)) + vfmt = vfmt_buf; + else + vfmt = (char *)malloc(&fmt[-1] - pct + EXTRAHH + 1); + + /* Set the separator character, if not specified. */ + if (vsep == 'X') { + if (ch == 'c') + vsep = '\0'; + else + vsep = ' '; + } + + /* Create the format specifier. */ + for (i = j = 0; i < &fmt[-1] - pct; i++) { + switch (pct[i]) { + case ',': case ';': case ':': case '_': + case 'v': case 'h': case 'l': + /* Ignore. */ + break; + case '*': + if (pct[i - 1] != '.') + vwidth = 1; + else + vprec = 1; + /* FALLTHROUGH */ + default: + vfmt[j++] = pct[i]; + } + } + + /* + * Determine the number of elements in the vector and + * finish up the format specifier. + */ + if (flags & SHORTINT) { + switch (ch) { + case 'c': + vtype = V_SHORT; + break; + case 'p': + vtype = V_PSHORT; + break; + default: + vfmt[j++] = 'h'; + vtype = V_SHORT; + break; + } + vcnt = 8; + } else if (flags & LONGINT) { + vcnt = 4; + vtype = (ch == 'p') ? V_PINT : V_INT; +#ifdef V64TYPE + } else if (flags & LLONGINT) { + switch (ch) { + case 'a': + case 'A': + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + vcnt = 2; + vtype = V_DOUBLE; + break; + case 'd': + case 'i': + case 'u': + case 'o': + case 'p': + case 'x': + case 'X': + vfmt[j++] = 'l'; + vfmt[j++] = 'l'; + vcnt = 2; + vtype = (ch == 'p') ? V_PLONGLONG : V_LONGLONG; + break; + default: + /* + * The default case should never + * happen. + */ + case 'c': + vcnt = 16; + vtype = V_CHAR; + } +#endif /* V64TYPE */ + } else { + switch (ch) { + case 'a': + case 'A': + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + vcnt = 4; + vtype = V_FLOAT; + break; + default: + /* + * The default case should never + * happen. + */ + case 'd': + case 'i': + case 'u': + case 'o': + case 'x': + case 'X': + vfmt[j++] = 'h'; + vfmt[j++] = 'h'; + /* drop through */ + case 'p': + case 'c': + vcnt = 16; + vtype = (ch == 'p') ? V_PCHAR : V_CHAR; + } + } + vfmt[j++] = ch; + vfmt[j++] = '\0'; + +/* Get a vector element. */ +#ifdef V64TYPE +#define VPRINT(type, ind, args...) do { \ + switch (type) { \ + case V_CHAR: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vuchararg[ind]); \ + break; \ + case V_PCHAR: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vuchararg[ind]); \ + break; \ + case V_SHORT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vushortarg[ind]); \ + break; \ + case V_PSHORT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vushortarg[ind]); \ + break; \ + case V_INT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vuintarg[ind]); \ + break; \ + case V_PINT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vuintarg[ind]); \ + break; \ + case V_LONGLONG: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vulonglongarg[ind]); \ + break; \ + case V_PLONGLONG: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vulonglongarg[ind]); \ + break; \ + case V_FLOAT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vfloatarg[ind]); \ + break; \ + case V_DOUBLE: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vdoublearg[ind]); \ + break; \ + } \ + ret += vlen; \ + PRINT(vstr, vlen); \ + FLUSH(); \ + free(vstr); \ +} while (0) +#else /* !V64TYPE */ +#define VPRINT(type, ind, args...) do { \ + switch (type) { \ + case V_CHAR: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vuchararg[ind]); \ + break; \ + case V_PCHAR: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vuchararg[ind]); \ + break; \ + case V_SHORT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vushortarg[ind]); \ + break; \ + case V_PSHORT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vushortarg[ind]); \ + break; \ + case V_INT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vuintarg[ind]); \ + break; \ + case V_PINT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vuintarg[ind]); \ + break; \ + case V_FLOAT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vfloatarg[ind]); \ + break; \ + } \ + ret += vlen; \ + PRINT(vstr, vlen); \ + FLUSH(); \ + free(vstr); \ +} while (0) +#endif /* V64TYPE */ + + /* Actually print. */ + if (vwidth == 0) { + if (vprec == 0) { + /* First element. */ + VPRINT(vtype, 0); + for (i = 1; i < vcnt; i++) { + /* Separator. */ + if(vsep) + PRINT(&vsep, 1); + + /* Element. */ + VPRINT(vtype, i); + } + } else { + /* First element. */ + VPRINT(vtype, 0, prec); + for (i = 1; i < vcnt; i++) { + /* Separator. */ + if(vsep) + PRINT(&vsep, 1); + + /* Element. */ + VPRINT(vtype, i, prec); + } + } + } else { + if (vprec == 0) { + /* First element. */ + VPRINT(vtype, 0, width); + for (i = 1; i < vcnt; i++) { + /* Separator. */ + if(vsep) + PRINT(&vsep, 1); + + /* Element. */ + VPRINT(vtype, i, width); + } + } else { + /* First element. */ + VPRINT(vtype, 0, width, prec); + for (i = 1; i < vcnt; i++) { + /* Separator. */ + if(vsep) + PRINT(&vsep, 1); + + /* Element. */ + VPRINT(vtype, i, width, prec); + } + } + } +#undef VPRINT + + if (vfmt != vfmt_buf) + free(vfmt); + + continue; + } +#endif /* VECTORS */ + /* + * All reasonable formats wind up here. At this point, `cp' + * points to a string which (if not flags&LADJUST) should be + * padded out to `width' places. If flags&ZEROPAD, it should + * first be prefixed by any sign or other prefix; otherwise, + * it should be blank padded before the prefix is emitted. + * After any left-hand padding and prefixing, emit zeroes + * required by a decimal [diouxX] precision, then print the + * string proper, then emit zeroes required by any leftover + * floating precision; finally, if LADJUST, pad with blanks. + * + * Compute actual size, so we know how much to pad. + * size excludes decimal prec; realsz includes it. + */ + realsz = dprec > size ? dprec : size; + if (sign) + realsz++; + if (ox[1]) + realsz += 2; + + prsize = width > realsz ? width : realsz; + if (ret + prsize >= INT_MAX) { + ret = EOF; + errno = EOVERFLOW; + goto error; + } + + /* right-adjusting blank padding */ + if ((flags & (LADJUST|ZEROPAD)) == 0) + PAD(width - realsz, blanks); + + /* prefix */ + if (sign) + PRINT(&sign, 1); + + if (ox[1]) { /* ox[1] is either x, X, or \0 */ + ox[0] = '0'; + PRINT(ox, 2); + } + + /* right-adjusting zero padding */ + if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) + PAD(width - realsz, zeroes); + + /* the string or number proper */ +#ifndef NO_FLOATING_POINT + if ((flags & FPT) == 0) { +#endif + /* leading zeroes from decimal precision */ + PAD(dprec - size, zeroes); + if (gs.grouping) { + if (grouping_print(&gs, &io, cp, buf+BUF, loc) < 0) + goto error; + } else { + PRINT(cp, size); + } +#ifndef NO_FLOATING_POINT + } else { /* glue together f_p fragments */ + if (!expchar) { /* %[fF] or sufficiently short %[gG] */ + if (expt <= 0) { + PRINT(zeroes, 1); + if (prec || flags & ALT) + PRINT(decimal_point,decpt_len); + PAD(-expt, zeroes); + /* already handled initial 0's */ + prec += expt; + } else { + if (gs.grouping) { + n = grouping_print(&gs, &io, + cp, dtoaend, loc); + if (n < 0) + goto error; + cp += n; + } else { + PRINTANDPAD(cp, dtoaend, + expt, zeroes); + cp += expt; + } + if (prec || flags & ALT) + PRINT(decimal_point,decpt_len); + } + PRINTANDPAD(cp, dtoaend, prec, zeroes); + } else { /* %[eE] or sufficiently long %[gG] */ + if (prec > 1 || flags & ALT) { + PRINT(cp++, 1); + PRINT(decimal_point, decpt_len); + PRINT(cp, ndig-1); + PAD(prec - ndig, zeroes); + } else /* XeYYY */ + PRINT(cp, 1); + PRINT(expstr, expsize); + } + } +#endif + /* left-adjusting padding (always blank) */ + if (flags & LADJUST) + PAD(width - realsz, blanks); + + /* finally, adjust ret */ + ret += prsize; + + FLUSH(); /* copy out the I/O vectors */ + } +done: + FLUSH(); +error: + va_end(orgap); +#ifndef NO_FLOATING_POINT + if (dtoaresult != NULL) + freedtoa(dtoaresult); +#endif + free(convbuf); + if (__sferror(fp)) + ret = EOF; + if ((argtable != NULL) && (argtable != statargtable)) + free (argtable); + return (ret < 0 || ret >= INT_MAX) ? -1 : (int)ret; + /* NOTREACHED */ +} +#pragma clang diagnostic pop diff --git a/stdio/FreeBSD/vfscanf.c b/stdio/FreeBSD/vfscanf.c new file mode 100644 index 0000000..eca2766 --- /dev/null +++ b/stdio/FreeBSD/vfscanf.c @@ -0,0 +1,1200 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcomma" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfscanf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfscanf.c,v 1.43 2009/01/19 06:19:51 das Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "collate.h" +#include "libc_private.h" +#include "local.h" + +#ifndef NO_FLOATING_POINT +#include +#endif + +#define BUF 513 /* Maximum length of numeric string. */ + +/* + * Flags used during conversion. + */ +#define LONG 0x01 /* l: long or double */ +#define LONGDBL 0x02 /* L: long double */ +#define SHORT 0x04 /* h: short */ +#define SUPPRESS 0x08 /* *: suppress assignment */ +#define POINTER 0x10 /* p: void * (as hex) */ +#define NOSKIP 0x20 /* [ or c: do not skip blanks */ +#define LONGLONG 0x400 /* ll: long long (+ deprecated q: quad) */ +#define INTMAXT 0x800 /* j: intmax_t */ +#define PTRDIFFT 0x1000 /* t: ptrdiff_t */ +#define SIZET 0x2000 /* z: size_t */ +#define SHORTSHORT 0x4000 /* hh: char */ +#define UNSIGNED 0x8000 /* %[oupxX] conversions */ + +/* + * The following are used in integral conversions only: + * SIGNOK, NDIGITS, PFXOK, and NZDIGITS + */ +#define SIGNOK 0x40 /* +/- is (still) legal */ +#define NDIGITS 0x80 /* no digits detected */ +#define PFXOK 0x100 /* 0x prefix is (still) legal */ +#define NZDIGITS 0x200 /* no zero digits detected */ +#define HAVESIGN 0x10000 /* sign detected */ + +/* + * Conversion types. + */ +#define CT_CHAR 0 /* %c conversion */ +#define CT_CCL 1 /* %[...] conversion */ +#define CT_STRING 2 /* %s conversion */ +#define CT_INT 3 /* %[dioupxX] conversion */ +#define CT_FLOAT 4 /* %[efgEFG] conversion */ + +static const u_char *__sccl(char *, const u_char *, locale_t); +#ifndef NO_FLOATING_POINT +static int parsefloat(FILE *, char **, size_t, locale_t); +#endif + +__weak_reference(__vfscanf, vfscanf); + +/* + * __vfscanf - MT-safe version + */ +int +__vfscanf(FILE * __restrict fp, char const * __restrict fmt0, va_list ap) +{ + int ret; + + FLOCKFILE(fp); + ret = __svfscanf_l(fp, __current_locale(), fmt0, ap); + FUNLOCKFILE(fp); + return (ret); +} + +int +vfscanf_l(FILE * __restrict fp, locale_t loc, char const * __restrict fmt0, va_list ap) +{ + int ret; + + NORMALIZE_LOCALE(loc); + FLOCKFILE(fp); + ret = __svfscanf_l(fp, loc, fmt0, ap); + FUNLOCKFILE(fp); + return (ret); +} + +/* + * __svfscanf - non-MT-safe version of __vfscanf + */ +__private_extern__ int +__svfscanf_l(FILE * __restrict fp, locale_t loc, const char * __restrict fmt0, va_list ap) +{ + const u_char *fmt = (const u_char *)fmt0; + int c; /* character from format, or conversion */ + size_t width; /* field width, or 0 */ + char *p; /* points into all kinds of strings */ + int n; /* handy integer */ + int flags; /* flags as defined above */ + char *p0; /* saves original value of p when necessary */ + int nassigned; /* number of fields assigned */ + int nread; /* number of characters consumed from fp */ + int base; /* base argument to conversion function */ + char ccltab[256]; /* character class table for %[...] */ + char buf[BUF]; /* buffer for numeric and mb conversions */ + wchar_t *wcp; /* handy wide character pointer */ + size_t nconv; /* length of multibyte sequence converted */ + int index; /* %index$, zero if unset */ + va_list ap_orig; /* to reset ap to first argument */ + static const mbstate_t initial; + mbstate_t mbs; + int mb_cur_max; + + /* `basefix' is used to avoid `if' tests in the integer scanner */ + static const short basefix[17] = + { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; + + NORMALIZE_LOCALE(loc); + mb_cur_max = MB_CUR_MAX_L(loc); + ORIENT(fp, -1); + + nassigned = 0; + nread = 0; + va_copy(ap_orig, ap); + for (;;) { + c = *fmt++; + if (c == 0) + return (nassigned); + if (isspace_l(c, loc)) { + while ((fp->_r > 0 || __srefill(fp) == 0) && isspace_l(*fp->_p, loc)) + nread++, fp->_r--, fp->_p++; + continue; + } + if (c != '%') { + if (fp->_r <= 0 && __srefill(fp)) + goto input_failure; + goto literal; + } + width = 0; + flags = 0; + /* + * switch on the format. continue if done; + * break once format type is derived. + */ +again: c = *fmt++; + switch (c) { + case '%': + /* Consume leading white space */ + for(;;) { + if (fp->_r <= 0 && __srefill(fp)) + goto input_failure; + if (!isspace_l(*fp->_p, loc)) + break; + nread++; + fp->_r--; + fp->_p++; + } +literal: + if (*fp->_p != c) + goto match_failure; + fp->_r--, fp->_p++; + nread++; + continue; + + case '$': + index = width; + if (index < 1 || index > NL_ARGMAX || fmt[-3] != '%') { + goto input_failure; + } + width = 0; + va_end(ap); + va_copy(ap, ap_orig); /* reset to %1$ */ + for (; index > 1; index--) { + va_arg(ap, void*); + } + goto again; + case '*': + flags |= SUPPRESS; + goto again; + case 'j': + flags |= INTMAXT; + goto again; + case 'l': + if (flags & LONG) { + flags &= ~LONG; + flags |= LONGLONG; + } else + flags |= LONG; + goto again; + case 'q': + flags |= LONGLONG; /* not quite */ + goto again; + case 't': + flags |= PTRDIFFT; + goto again; + case 'z': + flags |= SIZET; + goto again; + case 'L': + flags |= LONGDBL; + goto again; + case 'h': + if (flags & SHORT) { + flags &= ~SHORT; + flags |= SHORTSHORT; + } else + flags |= SHORT; + goto again; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + width = width * 10 + c - '0'; + goto again; + + /* + * Conversions. + */ + case 'd': + c = CT_INT; + base = 10; + break; + + case 'i': + c = CT_INT; + base = 0; + break; + + case 'o': + c = CT_INT; + flags |= UNSIGNED; + base = 8; + break; + + case 'u': + c = CT_INT; + flags |= UNSIGNED; + base = 10; + break; + + case 'X': + case 'x': + flags |= PFXOK; /* enable 0x prefixing */ + c = CT_INT; + flags |= UNSIGNED; + base = 16; + break; + +#ifndef NO_FLOATING_POINT + case 'A': case 'E': case 'F': case 'G': + case 'a': case 'e': case 'f': case 'g': + c = CT_FLOAT; + break; +#endif + + case 'S': + flags |= LONG; + /* FALLTHROUGH */ + case 's': + c = CT_STRING; + break; + + case '[': + fmt = __sccl(ccltab, fmt, loc); + flags |= NOSKIP; + c = CT_CCL; + break; + + case 'C': + flags |= LONG; + /* FALLTHROUGH */ + case 'c': + flags |= NOSKIP; + c = CT_CHAR; + break; + + case 'p': /* pointer format is like hex */ + flags |= POINTER | PFXOK; + c = CT_INT; /* assumes sizeof(uintmax_t) */ + flags |= UNSIGNED; /* >= sizeof(uintptr_t) */ + base = 16; + break; + + case 'n': + { + if (flags & SUPPRESS) /* ??? */ + continue; + void *ptr = va_arg(ap, void *); + if (ptr == NULL) + continue; + else if (flags & SHORTSHORT) + *(char *)ptr = nread; + else if (flags & SHORT) + *(short *)ptr = nread; + else if (flags & LONG) + *(long *)ptr = nread; + else if (flags & LONGLONG) + *(long long *)ptr = nread; + else if (flags & INTMAXT) + *(intmax_t *)ptr = nread; + else if (flags & SIZET) + *(size_t *)ptr = nread; + else if (flags & PTRDIFFT) + *(ptrdiff_t *)ptr = nread; + else + *(int *)ptr = nread; + continue; + } + default: + goto match_failure; + + /* + * Disgusting backwards compatibility hack. XXX + */ + case '\0': /* compat */ + return (EOF); + } + + /* + * We have a conversion that requires input. + */ + if (fp->_r <= 0 && __srefill(fp)) + goto input_failure; + + /* + * Consume leading white space, except for formats + * that suppress this. + */ + if ((flags & NOSKIP) == 0) { + while (isspace_l(*fp->_p, loc)) { + nread++; + if (--fp->_r > 0) + fp->_p++; + else if (__srefill(fp)) + goto input_failure; + } + /* + * Note that there is at least one character in + * the buffer, so conversions that do not set NOSKIP + * ca no longer result in an input failure. + */ + } + + /* + * Do the conversion. + */ + switch (c) { + + case CT_CHAR: + /* scan arbitrary characters (sets NOSKIP) */ + if (width == 0) + width = 1; + if (flags & LONG) { + if ((flags & SUPPRESS) == 0) + wcp = va_arg(ap, wchar_t *); + else + wcp = NULL; + n = 0; + while (width != 0) { + if (n == mb_cur_max) { + fp->_flags |= __SERR; + goto input_failure; + } + buf[n++] = *fp->_p; + fp->_p++; + fp->_r--; + mbs = initial; + nconv = mbrtowc_l(wcp, buf, n, &mbs, loc); + if (nconv == (size_t)-1) { + fp->_flags |= __SERR; + goto input_failure; + } + if (nconv == 0 && !(flags & SUPPRESS)) + *wcp = L'\0'; + if (nconv != (size_t)-2) { + nread += n; + width--; + if (!(flags & SUPPRESS)) + wcp++; + n = 0; + } + if (fp->_r <= 0 && __srefill(fp)) { + if (n != 0) { + fp->_flags |= __SERR; + goto input_failure; + } + break; + } + } + if (!(flags & SUPPRESS)) + nassigned++; + } else if (flags & SUPPRESS) { + size_t sum = 0; + for (;;) { + if ((n = fp->_r) < width) { + sum += n; + width -= n; + fp->_p += n; + if (__srefill(fp)) { + if (sum == 0) + goto input_failure; + break; + } + } else { + sum += width; + fp->_r -= width; + fp->_p += width; + break; + } + } + nread += sum; + } else { + size_t r = __fread((void *)va_arg(ap, char *), 1, + width, fp); + + if (r == 0) + goto input_failure; + nread += r; + nassigned++; + } + break; + + case CT_CCL: + /* scan a (nonempty) character class (sets NOSKIP) */ + if (width == 0) + width = (size_t)~0; /* `infinity' */ + /* take only those things in the class */ + if (flags & LONG) { + wchar_t twc; + int nchars; + + if ((flags & SUPPRESS) == 0) + wcp = va_arg(ap, wchar_t *); + else + wcp = &twc; + n = 0; + nchars = 0; + while (width != 0) { + if (n == mb_cur_max) { + fp->_flags |= __SERR; + goto input_failure; + } + buf[n++] = *fp->_p; + fp->_p++; + fp->_r--; + mbs = initial; + nconv = mbrtowc_l(wcp, buf, n, &mbs, loc); + if (nconv == (size_t)-1) { + fp->_flags |= __SERR; + goto input_failure; + } + if (nconv == 0) + *wcp = L'\0'; + if (nconv != (size_t)-2) { + if (wctob_l(*wcp, loc) != EOF && + !ccltab[wctob_l(*wcp, loc)]) { + while (n != 0) { + n--; + __ungetc(buf[n], + fp); + } + break; + } + nread += n; + width--; + if (!(flags & SUPPRESS)) + wcp++; + nchars++; + n = 0; + } + if (fp->_r <= 0 && __srefill(fp)) { + if (n != 0) { + fp->_flags |= __SERR; + goto input_failure; + } + break; + } + } + if (n != 0) { + fp->_flags |= __SERR; + goto input_failure; + } + n = nchars; + if (n == 0) + goto match_failure; + if (!(flags & SUPPRESS)) { + *wcp = L'\0'; + nassigned++; + } + } else if (flags & SUPPRESS) { + n = 0; + while (ccltab[*fp->_p]) { + n++, fp->_r--, fp->_p++; + if (--width == 0) + break; + if (fp->_r <= 0 && __srefill(fp)) { + if (n == 0) + goto input_failure; + break; + } + } + if (n == 0) + goto match_failure; + } else { + p0 = p = va_arg(ap, char *); + while (ccltab[*fp->_p]) { + fp->_r--; + *p++ = *fp->_p++; + if (--width == 0) + break; + if (fp->_r <= 0 && __srefill(fp)) { + if (p == p0) + goto input_failure; + break; + } + } + n = p - p0; + if (n == 0) + goto match_failure; + *p = 0; + nassigned++; + } + nread += n; + break; + + case CT_STRING: + /* like CCL, but zero-length string OK, & no NOSKIP */ + if (width == 0) + width = (size_t)~0; + if (flags & LONG) { + wchar_t twc; + + if ((flags & SUPPRESS) == 0) + wcp = va_arg(ap, wchar_t *); + else + wcp = &twc; + n = 0; + while (width != 0) { + if (n == mb_cur_max) { + fp->_flags |= __SERR; + goto input_failure; + } + buf[n++] = *fp->_p; + fp->_p++; + fp->_r--; + mbs = initial; + nconv = mbrtowc_l(wcp, buf, n, &mbs, loc); + if (nconv == (size_t)-1) { + fp->_flags |= __SERR; + goto input_failure; + } + if (nconv == 0) + *wcp = L'\0'; + if (nconv != (size_t)-2) { + if (iswspace_l(*wcp, loc)) { + while (n != 0) { + n--; + __ungetc(buf[n], + fp); + } + break; + } + nread += n; + width--; + if (!(flags & SUPPRESS)) + wcp++; + n = 0; + } + if (fp->_r <= 0 && __srefill(fp)) { + if (n != 0) { + fp->_flags |= __SERR; + goto input_failure; + } + break; + } + } + if (!(flags & SUPPRESS)) { + *wcp = L'\0'; + nassigned++; + } + } else if (flags & SUPPRESS) { + n = 0; + while (!isspace_l(*fp->_p, loc)) { + n++, fp->_r--, fp->_p++; + if (--width == 0) + break; + if (fp->_r <= 0 && __srefill(fp)) + break; + } + nread += n; + } else { + p0 = p = va_arg(ap, char *); + while (!isspace_l(*fp->_p, loc)) { + fp->_r--; + *p++ = *fp->_p++; + if (--width == 0) + break; + if (fp->_r <= 0 && __srefill(fp)) + break; + } + *p = 0; + nread += p - p0; + nassigned++; + } + continue; + + case CT_INT: + /* scan an integer as if by the conversion function */ +#ifdef hardway + if (width == 0 || width > sizeof(buf) - 1) + width = sizeof(buf) - 1; +#else + /* size_t is unsigned, hence this optimisation */ + if (--width > sizeof(buf) - 2) + width = sizeof(buf) - 2; + width++; +#endif + flags |= SIGNOK | NDIGITS | NZDIGITS; + for (p = buf; width; width--) { + c = *fp->_p; + /* + * Switch on the character; `goto ok' + * if we accept it as a part of number. + */ + switch (c) { + + /* + * The digit 0 is always legal, but is + * special. For %i conversions, if no + * digits (zero or nonzero) have been + * scanned (only signs), we will have + * base==0. In that case, we should set + * it to 8 and enable 0x prefixing. + * Also, if we have not scanned zero digits + * before this, do not turn off prefixing + * (someone else will turn it off if we + * have scanned any nonzero digits). + */ + case '0': + if (base == 0) { + base = 8; + flags |= PFXOK; + } + if (flags & NZDIGITS) + flags &= ~(SIGNOK|NZDIGITS|NDIGITS); + else + flags &= ~(SIGNOK|PFXOK|NDIGITS); + goto ok; + + /* 1 through 7 always legal */ + case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + base = basefix[base]; + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* digits 8 and 9 ok iff decimal or hex */ + case '8': case '9': + base = basefix[base]; + if (base <= 8) + break; /* not legal here */ + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* letters ok iff hex */ + case 'A': case 'B': case 'C': + case 'D': case 'E': case 'F': + case 'a': case 'b': case 'c': + case 'd': case 'e': case 'f': + /* no need to fix base here */ + if (base <= 10) + break; /* not legal here */ + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* sign ok only as first character */ + case '+': case '-': + if (flags & SIGNOK) { + flags &= ~SIGNOK; + flags |= HAVESIGN; + goto ok; + } + break; + + /* + * x ok iff flag still set & 2nd char (or + * 3rd char if we have a sign). + */ + case 'x': case 'X': + if (flags & PFXOK && p == + buf + 1 + !!(flags & HAVESIGN)) { + base = 16; /* if %i */ + flags &= ~PFXOK; + goto ok; + } + break; + } + + /* + * If we got here, c is not a legal character + * for a number. Stop accumulating digits. + */ + break; + ok: + /* + * c is legal: store it and look at the next. + */ + *p++ = c; + if (--fp->_r > 0) + fp->_p++; + else if (__srefill(fp)) + break; /* EOF */ + } + /* + * If we had only a sign, it is no good; push + * back the sign. If the number ends in `x', + * it was [sign] '0' 'x', so push back the x + * and treat it as [sign] '0'. + */ + if (flags & NDIGITS) { + if (p > buf) + (void) __ungetc(*(u_char *)--p, fp); + goto match_failure; + } + c = ((u_char *)p)[-1]; + if (c == 'x' || c == 'X') { + --p; + (void) __ungetc(c, fp); + } + if ((flags & SUPPRESS) == 0) { + uintmax_t res; + + *p = 0; + if ((flags & UNSIGNED) == 0) + res = strtoimax_l(buf, (char **)NULL, base, loc); + else + res = strtoumax_l(buf, (char **)NULL, base, loc); + if (flags & POINTER) + *va_arg(ap, void **) = + (void *)(uintptr_t)res; + else if (flags & SHORTSHORT) + *va_arg(ap, char *) = res; + else if (flags & SHORT) + *va_arg(ap, short *) = res; + else if (flags & LONG) + *va_arg(ap, long *) = res; + else if (flags & LONGLONG) + *va_arg(ap, long long *) = res; + else if (flags & INTMAXT) + *va_arg(ap, intmax_t *) = res; + else if (flags & PTRDIFFT) + *va_arg(ap, ptrdiff_t *) = res; + else if (flags & SIZET) + *va_arg(ap, size_t *) = res; + else + *va_arg(ap, int *) = res; + nassigned++; + } + nread += p - buf; + break; + +#ifndef NO_FLOATING_POINT + case CT_FLOAT: + { + char *pbuf; + /* scan a floating point number as if by strtod */ + if ((width = parsefloat(fp, &pbuf, width, loc)) == 0) + goto match_failure; + if ((flags & SUPPRESS) == 0) { + if (flags & LONGDBL) { + long double res = strtold_l(pbuf, &p, loc); + *va_arg(ap, long double *) = res; + } else if (flags & LONG) { + double res = strtod_l(pbuf, &p, loc); + *va_arg(ap, double *) = res; + } else { + float res = strtof_l(pbuf, &p, loc); + *va_arg(ap, float *) = res; + } + nassigned++; + } + nread += width; + break; + } +#endif /* !NO_FLOATING_POINT */ + } + } +input_failure: + return (nassigned ? nassigned : EOF); +match_failure: + return (nassigned); +} + +int +__svfscanf(FILE * __restrict fp, const char * __restrict fmt0, va_list ap) +{ + return __svfscanf_l(fp, __current_locale(), fmt0, ap); +} + +/* + * Fill in the given table from the scanset at the given format + * (just after `['). Return a pointer to the character past the + * closing `]'. The table has a 1 wherever characters should be + * considered part of the scanset. + */ +static const u_char * +__sccl(tab, fmt, loc) + char *tab; + const u_char *fmt; + locale_t loc; +{ + int c, n, v, i; + + /* first `clear' the whole table */ + c = *fmt++; /* first char hat => negated scanset */ + if (c == '^') { + v = 1; /* default => accept */ + c = *fmt++; /* get new first char */ + } else + v = 0; /* default => reject */ + + /* XXX: Will not work if sizeof(tab*) > sizeof(char) */ + (void) memset(tab, v, 256); + + if (c == 0) + return (fmt - 1);/* format ended before closing ] */ + + /* + * Now set the entries corresponding to the actual scanset + * to the opposite of the above. + * + * The first character may be ']' (or '-') without being special; + * the last character may be '-'. + */ + v = 1 - v; + for (;;) { + tab[c] = v; /* take character c */ +doswitch: + n = *fmt++; /* and examine the next */ + switch (n) { + + case 0: /* format ended too soon */ + return (fmt - 1); + + case '-': + { + /* + * A scanset of the form + * [01+-] + * is defined as `the digit 0, the digit 1, + * the character +, the character -', but + * the effect of a scanset such as + * [a-zA-Z0-9] + * is implementation defined. The V7 Unix + * scanf treats `a-z' as `the letters a through + * z', but treats `a-a' as `the letter a, the + * character -, and the letter a'. + * + * For compatibility, the `-' is not considerd + * to define a range if the character following + * it is either a close bracket (required by ANSI) + * or is not numerically greater than the character + * we just stored in the table (c). + */ + n = *fmt; + if (n == ']' + || (loc->__collate_load_error ? n < c : + __collate_range_cmp (n, c, loc) < 0 + ) + ) { + c = '-'; + break; /* resume the for(;;) */ + } + fmt++; + /* fill in the range */ + if (loc->__collate_load_error) { + do { + tab[++c] = v; + } while (c < n); + } else { + for (i = 0; i < 256; i ++) + if ( __collate_range_cmp (c, i, loc) < 0 + && __collate_range_cmp (i, n, loc) <= 0 + ) + tab[i] = v; + } +#if 1 /* XXX another disgusting compatibility hack */ + c = n; + /* + * Alas, the V7 Unix scanf also treats formats + * such as [a-c-e] as `the letters a through e'. + * This too is permitted by the standard.... + */ + goto doswitch; +#else + c = *fmt++; + if (c == 0) + return (fmt - 1); + if (c == ']') + return (fmt); +#endif + break; + } + case ']': /* end of scanset */ + return (fmt); + + default: /* just another character */ + c = n; + break; + } + } + /* NOTREACHED */ +} + +#ifndef NO_FLOATING_POINT +/* + * Maintain a per-thread parsefloat buffer, shared by __svfscanf_l and + * __vfwscanf. + */ +#ifdef BUILDING_VARIANT +extern char *__parsefloat_buf(size_t s); +#else /* !BUILDING_VARIANT */ +__private_extern__ char * +__parsefloat_buf(size_t s) +{ + char *b; + static pthread_key_t parsefloat_tsd_key = (pthread_key_t)-1; + static pthread_mutex_t parsefloat_tsd_lock = PTHREAD_MUTEX_INITIALIZER; + static size_t bsiz = 0; + + if (parsefloat_tsd_key == (pthread_key_t)-1) { + pthread_mutex_lock(&parsefloat_tsd_lock); + if (parsefloat_tsd_key == (pthread_key_t)-1) { + parsefloat_tsd_key = __LIBC_PTHREAD_KEY_PARSEFLOAT; + pthread_key_init_np(parsefloat_tsd_key, free); + } + pthread_mutex_unlock(&parsefloat_tsd_lock); + } + if ((b = (char *)pthread_getspecific(parsefloat_tsd_key)) == NULL) { + bsiz = s > BUF ? s : BUF; + b = (char *)malloc(bsiz); + if (b == NULL) { + bsiz = 0; + return NULL; + } + pthread_setspecific(parsefloat_tsd_key, b); + return b; + } + if (s > bsiz) { + b = (char *)reallocf(b, s); + pthread_setspecific(parsefloat_tsd_key, b); + if (b == NULL) { + bsiz = 0; + return NULL; + } + bsiz = s; + } + return b; +} +#endif /* BUILDING_VARIANT */ + +static int +parsefloat(FILE *fp, char **buf, size_t width, locale_t loc) +{ + char *commit, *p; + int infnanpos = 0, decptpos = 0; + enum { + S_START, S_GOTSIGN, S_INF, S_NAN, S_DONE, S_MAYBEHEX, + S_DIGITS, S_DECPT, S_FRAC, S_EXP, S_EXPDIGITS + } state = S_START; + unsigned char c; + const char *decpt = localeconv_l(loc)->decimal_point; + _Bool gotmantdig = 0, ishex = 0; + char *b; + char *e; + size_t s; + + s = (width == 0 ? BUF : (width + 1)); + if ((b = __parsefloat_buf(s)) == NULL) { + *buf = NULL; + return 0; + } + e = b + (s - 1); + /* + * We set commit = p whenever the string we have read so far + * constitutes a valid representation of a floating point + * number by itself. At some point, the parse will complete + * or fail, and we will ungetc() back to the last commit point. + * To ensure that the file offset gets updated properly, it is + * always necessary to read at least one character that doesn't + * match; thus, we can't short-circuit "infinity" or "nan(...)". + */ + commit = b - 1; + for (p = b; width == 0 || p < e; ) { + c = *fp->_p; +reswitch: + switch (state) { + case S_START: + state = S_GOTSIGN; + if (c == '-' || c == '+') + break; + else + goto reswitch; + case S_GOTSIGN: + switch (c) { + case '0': + state = S_MAYBEHEX; + commit = p; + break; + case 'I': + case 'i': + state = S_INF; + break; + case 'N': + case 'n': + state = S_NAN; + break; + default: + state = S_DIGITS; + goto reswitch; + } + break; + case S_INF: + if (infnanpos > 6 || + (c != "nfinity"[infnanpos] && + c != "NFINITY"[infnanpos])) + goto parsedone; + if (infnanpos == 1 || infnanpos == 6) + commit = p; /* inf or infinity */ + infnanpos++; + break; + case S_NAN: + switch (infnanpos) { + case 0: + if (c != 'A' && c != 'a') + goto parsedone; + break; + case 1: + if (c != 'N' && c != 'n') + goto parsedone; + else + commit = p; + break; + case 2: + if (c != '(') + goto parsedone; + break; + default: + if (c == ')') { + commit = p; + state = S_DONE; + } else if (!isalnum_l(c, loc) && c != '_') + goto parsedone; + break; + } + infnanpos++; + break; + case S_DONE: + goto parsedone; + case S_MAYBEHEX: + state = S_DIGITS; + if (c == 'X' || c == 'x') { + ishex = 1; + break; + } else { /* we saw a '0', but no 'x' */ + gotmantdig = 1; + goto reswitch; + } + case S_DIGITS: + if ((ishex && isxdigit_l(c, loc)) || isdigit_l(c, loc)) { + gotmantdig = 1; + commit = p; + break; + } else { + state = S_DECPT; + goto reswitch; + } + case S_DECPT: + if (c == decpt[decptpos]) { + if (decpt[++decptpos] == '\0') { + /* We read the complete decpt seq. */ + state = S_FRAC; + if (gotmantdig) + commit = p; + } + break; + } else if (!decptpos) { + /* We didn't read any decpt characters. */ + state = S_FRAC; + goto reswitch; + } else { + /* + * We read part of a multibyte decimal point, + * but the rest is invalid, so bail. + */ + goto parsedone; + } + case S_FRAC: + if (((c == 'E' || c == 'e') && !ishex) || + ((c == 'P' || c == 'p') && ishex)) { + if (!gotmantdig) + goto parsedone; + else + state = S_EXP; + } else if ((ishex && isxdigit_l(c, loc)) || isdigit_l(c, loc)) { + commit = p; + gotmantdig = 1; + } else + goto parsedone; + break; + case S_EXP: + state = S_EXPDIGITS; + if (c == '-' || c == '+') + break; + else + goto reswitch; + case S_EXPDIGITS: + if (isdigit_l(c, loc)) + commit = p; + else + goto parsedone; + break; + default: + LIBC_ABORT("unknown state %d", state); + } + if (p >= e) { + ssize_t diff = (p - b); + ssize_t com = (commit - b); + s += BUF; + b = __parsefloat_buf(s); + if (b == NULL) { + *buf = NULL; + return 0; + } + e = b + (s - 1); + p = b + diff; + commit = b + com; + } + *p++ = c; + if (--fp->_r > 0) + fp->_p++; + else if (__srefill(fp)) + break; /* EOF */ + } + +parsedone: + while (commit < --p) + __ungetc(*(u_char *)p, fp); + *++commit = '\0'; + *buf = b; + return (commit - b); +} +#endif +#pragma clang diagnostic push diff --git a/stdio/FreeBSD/vfwprintf.c b/stdio/FreeBSD/vfwprintf.c new file mode 100644 index 0000000..176a11c --- /dev/null +++ b/stdio/FreeBSD/vfwprintf.c @@ -0,0 +1,1478 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#endif +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.42 2009/11/25 04:27:55 wollman Exp $"); + +#include "xlocale_private.h" + +/* + * Actual wprintf innards. + * + * Avoid making gratuitous changes to this source file; it should be kept + * as close as possible to vfprintf.c for ease of maintenance. + */ + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include +#include + +#include "libc_private.h" +#include "local.h" +#include "fvwrite.h" +#include "printflocal.h" + +static int __sprint(FILE *, locale_t, struct __suio *); +static int __sbprintf(FILE *, locale_t, const wchar_t *, va_list); +static wint_t __xfputwc(wchar_t, FILE *, locale_t); +static wchar_t *__mbsconv(char *, int, locale_t); +__private_extern__ const char *__fix_nogrouping(const char *); + +#define CHAR wchar_t +#include "printfcommon.h" + +struct grouping_state { + wchar_t thousands_sep; /* locale-specific thousands separator */ + const char *grouping; /* locale-specific numeric grouping rules */ + int lead; /* sig figs before decimal or group sep */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ +}; + +static const mbstate_t initial_mbs; + +static inline wchar_t +get_decpt(locale_t loc) +{ + mbstate_t mbs; + wchar_t decpt; + int nconv; + + mbs = initial_mbs; + nconv = mbrtowc_l(&decpt, localeconv_l(loc)->decimal_point, MB_CUR_MAX_L(loc), &mbs, loc); + if (nconv == (size_t)-1 || nconv == (size_t)-2) + decpt = '.'; /* failsafe */ + return (decpt); +} + +static inline wchar_t +get_thousep(locale_t loc) +{ + mbstate_t mbs; + wchar_t thousep; + int nconv; + + mbs = initial_mbs; + nconv = mbrtowc_l(&thousep, localeconv_l(loc)->thousands_sep, + MB_CUR_MAX_L(loc), &mbs, loc); + if (nconv == (size_t)-1 || nconv == (size_t)-2) + thousep = '\0'; /* failsafe */ + return (thousep); +} + +/* + * Initialize the thousands' grouping state in preparation to print a + * number with ndigits digits. This routine returns the total number + * of wide characters that will be printed. + */ +static int +grouping_init(struct grouping_state *gs, int ndigits, locale_t loc) +{ + + gs->grouping = __fix_nogrouping(localeconv_l(loc)->grouping); + gs->thousands_sep = get_thousep(loc); + + gs->nseps = gs->nrepeats = 0; + gs->lead = ndigits; + while (*gs->grouping != CHAR_MAX) { + if (gs->lead <= *gs->grouping) + break; + gs->lead -= *gs->grouping; + if (*(gs->grouping+1)) { + gs->nseps++; + gs->grouping++; + } else + gs->nrepeats++; + } + return (gs->nseps + gs->nrepeats); +} + +/* + * Print a number with thousands' separators. + */ +static int +grouping_print(struct grouping_state *gs, struct io_state *iop, + const CHAR *cp, const CHAR *ep, locale_t loc) +{ + const CHAR *cp0 = cp; + + if (io_printandpad(iop, cp, ep, gs->lead, zeroes, loc)) + return (-1); + cp += gs->lead; + while (gs->nseps > 0 || gs->nrepeats > 0) { + if (gs->nrepeats > 0) + gs->nrepeats--; + else { + gs->grouping--; + gs->nseps--; + } + if (io_print(iop, &gs->thousands_sep, 1, loc)) + return (-1); + if (io_printandpad(iop, cp, ep, *gs->grouping, zeroes, loc)) + return (-1); + cp += *gs->grouping; + } + if (cp > ep) + cp = ep; + return (cp - cp0); +} + + +/* + * Flush out all the vectors defined by the given uio, + * then reset it so that it can be reused. + * + * XXX The fact that we do this a character at a time and convert to a + * multibyte character sequence even if the destination is a wide + * string eclipses the benefits of buffering. + */ +static int +__sprint(FILE *fp, locale_t loc, struct __suio *uio) +{ + struct __siov *iov; + wchar_t *p; + int i, len; + + iov = uio->uio_iov; + for (; uio->uio_resid != 0; uio->uio_resid -= len, iov++) { + p = (wchar_t *)iov->iov_base; + len = iov->iov_len; + for (i = 0; i < len; i++) { + if (__xfputwc(p[i], fp, loc) == WEOF) + return (-1); + } + } + uio->uio_iovcnt = 0; + return (0); +} + +/* + * Helper function for `fprintf to unbuffered unix file': creates a + * temporary buffer. We only work on write-only files; this avoids + * worries about ungetc buffers and so forth. + */ +static int +__sbprintf(FILE *fp, locale_t loc, const wchar_t *fmt, va_list ap) +{ + int ret; + FILE fake; + unsigned char buf[BUFSIZ]; + struct __sFILEX ext; + fake._extra = &ext; + INITEXTRA(&fake); + + /* XXX This is probably not needed. */ + if (prepwrite(fp) != 0) + return (EOF); + + /* copy the important variables */ + fake._flags = fp->_flags & ~__SNBF; + fake._file = fp->_file; + fake._cookie = fp->_cookie; + fake._write = fp->_write; + fake._orientation = fp->_orientation; + fake._mbstate = fp->_mbstate; + + /* set up the buffer */ + fake._bf._base = fake._p = buf; + fake._bf._size = fake._w = sizeof(buf); + fake._lbfsize = 0; /* not actually used, but Just In Case */ + + /* do the work, then copy any error status */ + ret = __vfwprintf(&fake, loc, fmt, ap); + if (ret >= 0 && __fflush(&fake)) + ret = WEOF; + if (fake._flags & __SERR) + fp->_flags |= __SERR; + return (ret); +} + +/* + * Like __fputwc, but handles fake string (__SSTR) files properly. + * File must already be locked. + */ +static wint_t +__xfputwc(wchar_t wc, FILE *fp, locale_t loc) +{ + mbstate_t mbs; + char buf[MB_LEN_MAX]; + struct __suio uio; + struct __siov iov; + size_t len; + + if ((fp->_flags & __SSTR) == 0) + return (__fputwc(wc, fp, loc)); + + mbs = initial_mbs; + if ((len = wcrtomb_l(buf, wc, &mbs, loc)) == (size_t)-1) { + fp->_flags |= __SERR; + return (WEOF); + } + uio.uio_iov = &iov; + uio.uio_resid = len; + uio.uio_iovcnt = 1; + iov.iov_base = buf; + iov.iov_len = len; + return (__sfvwrite(fp, &uio) != EOF ? (wint_t)wc : WEOF); +} + +/* + * Convert a multibyte character string argument for the %s format to a wide + * string representation. ``prec'' specifies the maximum number of bytes + * to output. If ``prec'' is greater than or equal to zero, we can't assume + * that the multibyte char. string ends in a null character. + */ +static wchar_t * +__mbsconv(char *mbsarg, int prec, locale_t loc) +{ + mbstate_t mbs; + wchar_t *convbuf, *wcp; + const char *p; + size_t insize, nchars, nconv = 0; + int mb_cur_max = MB_CUR_MAX_L(loc); + + if (mbsarg == NULL) + return (NULL); + + /* + * Supplied argument is a multibyte string; convert it to wide + * characters first. + */ + if (prec >= 0) { + /* + * String is not guaranteed to be NUL-terminated. Find the + * number of characters to print. + */ + p = mbsarg; + insize = nchars = nconv = 0; + mbs = initial_mbs; + while (nchars != (size_t)prec) { + nconv = mbrlen_l(p, mb_cur_max, &mbs, loc); + if (nconv == 0 || nconv == (size_t)-1 || + nconv == (size_t)-2) + break; + p += nconv; + nchars++; + insize += nconv; + } + if (nconv == (size_t)-1 || nconv == (size_t)-2) + return (NULL); + } else { + insize = strlen(mbsarg); + nconv = 0; + } + + /* + * Allocate buffer for the result and perform the conversion, + * converting at most `size' bytes of the input multibyte string to + * wide characters for printing. + */ + convbuf = malloc((insize + 1) * sizeof(*convbuf)); + if (convbuf == NULL) + return (NULL); + wcp = convbuf; + p = mbsarg; + mbs = initial_mbs; + while (insize != 0) { + nconv = mbrtowc_l(wcp, p, insize, &mbs, loc); + if (nconv == 0 || nconv == (size_t)-1 || nconv == (size_t)-2) + break; + wcp++; + p += nconv; + insize -= nconv; + } + if (nconv == (size_t)-1 || nconv == (size_t)-2) { + free(convbuf); + return (NULL); + } + *wcp = L'\0'; + + return (convbuf); +} + +/* + * MT-safe version + */ +int +vfwprintf_l(FILE * __restrict fp, locale_t loc, const wchar_t * __restrict fmt0, va_list ap) +{ + int ret; + + NORMALIZE_LOCALE(loc); + FLOCKFILE(fp); + /* optimise fprintf(stderr) (and other unbuffered Unix files) */ + if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && + fp->_file >= 0) + ret = __sbprintf(fp, loc, fmt0, ap); + else + ret = __vfwprintf(fp, loc, fmt0, ap); + FUNLOCKFILE(fp); + return (ret); +} + +int +vfwprintf(FILE * __restrict fp, const wchar_t * __restrict fmt0, va_list ap) +{ + return vfwprintf_l(fp, __current_locale(), fmt0, ap); +} + +// Defined in vfprintf.c +bool __printf_is_memory_read_only(void *addr, size_t size); + +/* + * The size of the buffer we use as scratch space for integer + * conversions, among other things. We need enough space to + * write a uintmax_t in octal (plus one byte). + */ +#if UINTMAX_MAX <= UINT64_MAX +#define BUF 32 +#else +#error "BUF must be large enough to format a uintmax_t" +#endif + +/* + * Non-MT-safe version + */ +__private_extern__ int +__vfwprintf(FILE *fp, locale_t loc, const wchar_t *fmt0, va_list ap) +{ + wchar_t *fmt; /* format string */ + wchar_t ch; /* character from fmt */ + ssize_t n, n2; /* handy integer (short term usage) */ + wchar_t *cp; /* handy char pointer (short term usage) */ + int flags; /* flags as above */ + ssize_t ret; /* return value accumulator */ + ssize_t width; /* width from format (%8d), or 0 */ + ssize_t prec; /* precision from format; <0 for N/A */ + wchar_t sign; /* sign prefix (' ', '+', '-', or \0) */ + struct grouping_state gs; /* thousands' grouping info */ + +#ifndef NO_FLOATING_POINT + /* + * We can decompose the printed representation of floating + * point numbers into several parts, some of which may be empty: + * + * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ + * A B ---C--- D E F + * + * A: 'sign' holds this value if present; '\0' otherwise + * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal + * C: cp points to the string MMMNNN. Leading and trailing + * zeros are not in the string and must be added. + * D: expchar holds this character; '\0' if no exponent, e.g. %f + * F: at least two digits for decimal, at least one digit for hex + */ + wchar_t decimal_point; /* locale specific decimal point */ + int signflag; /* true if float is negative */ + union { /* floating point arguments %[aAeEfFgG] */ + double dbl; + long double ldbl; + } fparg; + int expt; /* integer value of exponent */ + char expchar; /* exponent character: [eEpP\0] */ + char *dtoaend; /* pointer to end of converted digits */ + int expsize; /* character count for expstr */ + int ndig; /* actual number of digits returned by dtoa */ + wchar_t expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ + char *dtoaresult; /* buffer allocated by dtoa */ +#endif +#ifdef VECTORS + union arg vval; /* Vector argument. */ + wchar_t *pct; /* Pointer to '%' at beginning of specifier. */ + wchar_t vsep; /* Vector separator character. */ +#endif + u_long ulval; /* integer arguments %[diouxX] */ + uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ + int base; /* base for [diouxX] conversion */ + int dprec; /* a copy of prec if [diouxX], 0 otherwise */ + ssize_t realsz; /* field size expanded by dprec, sign, etc */ + ssize_t size; /* size of converted field or string */ + ssize_t prsize; /* max size of printed field */ + const char *xdigs; /* digits for [xX] conversion */ + struct io_state io; /* I/O buffering state */ + wchar_t buf[BUF]; /* buffer with space for digits of uintmax_t */ + wchar_t ox[2]; /* space for 0x hex-prefix */ + union arg *argtable; /* args, built due to positional arg */ + union arg statargtable [STATIC_ARG_TBL_SIZE]; + int nextarg; /* 1-based argument index */ + va_list orgap; /* original argument pointer */ + wchar_t *convbuf; /* multibyte to wide conversion result */ + + static const char xdigs_lower[16] = "0123456789abcdef"; + static const char xdigs_upper[16] = "0123456789ABCDEF"; + + /* BEWARE, these `goto error' on error. */ +#define PRINT(ptr, len) do { \ + if (io_print(&io, (ptr), (len), loc)) \ + goto error; \ +} while (0) +#define PAD(howmany, with) { \ + if (io_pad(&io, (howmany), (with), loc)) \ + goto error; \ +} +#define PRINTANDPAD(p, ep, len, with) { \ + if (io_printandpad(&io, (p), (ep), (len), (with), loc)) \ + goto error; \ +} +#define FLUSH() { \ + if (io_flush(&io, loc)) \ + goto error; \ +} + + /* + * Get the argument indexed by nextarg. If the argument table is + * built, use it to get the argument. If its not, get the next + * argument (and arguments must be gotten sequentially). + */ +#define GETARG(type) \ + ((argtable != NULL) ? *((type*)(&argtable[nextarg++])) : \ + (nextarg++, va_arg(ap, type))) + + /* + * To extend shorts properly, we need both signed and unsigned + * argument extraction methods. + */ +#define SARG() \ + (flags&LONGINT ? GETARG(long) : \ + flags&SHORTINT ? (long)(short)GETARG(int) : \ + flags&CHARINT ? (long)(signed char)GETARG(int) : \ + (long)GETARG(int)) +#define UARG() \ + (flags&LONGINT ? GETARG(u_long) : \ + flags&SHORTINT ? (u_long)(u_short)GETARG(int) : \ + flags&CHARINT ? (u_long)(u_char)GETARG(int) : \ + (u_long)GETARG(u_int)) +#define INTMAX_SIZE (INTMAXT|SIZET|PTRDIFFT|LLONGINT) +#define SJARG() \ + (flags&INTMAXT ? GETARG(intmax_t) : \ + flags&SIZET ? (intmax_t)GETARG(ssize_t) : \ + flags&PTRDIFFT ? (intmax_t)GETARG(ptrdiff_t) : \ + (intmax_t)GETARG(long long)) +#define UJARG() \ + (flags&INTMAXT ? GETARG(uintmax_t) : \ + flags&SIZET ? (uintmax_t)GETARG(size_t) : \ + flags&PTRDIFFT ? (uintmax_t)(unsigned long)GETARG(ptrdiff_t) : \ + (uintmax_t)GETARG(unsigned long long)) + + /* + * Get * arguments, including the form *nn$. Preserve the nextarg + * that the argument can be gotten once the type is determined. + */ +#define GETASTER(val) \ + n2 = 0; \ + cp = fmt; \ + while (is_digit(*cp)) { \ + n2 = 10 * n2 + to_digit(*cp); \ + cp++; \ + } \ + if (*cp == '$') { \ + int hold = nextarg; \ + if (argtable == NULL) { \ + argtable = statargtable; \ + if (__find_warguments (fmt0, orgap, &argtable)) { \ + ret = EOF; \ + goto error; \ + } \ + } \ + nextarg = n2; \ + val = GETARG (int); \ + nextarg = hold; \ + fmt = ++cp; \ + } else { \ + val = GETARG (int); \ + } + + + /* sorry, fwprintf(read_only_file, L"") returns WEOF, not 0 */ + if (prepwrite(fp) != 0) { + errno = EBADF; + return (EOF); + } + ORIENT(fp, 1); + + convbuf = NULL; + fmt = (wchar_t *)fmt0; + argtable = NULL; + nextarg = 1; + va_copy(orgap, ap); + io_init(&io, fp); + ret = 0; +#ifndef NO_FLOATING_POINT + decimal_point = get_decpt(loc); +#endif + + /* + * Scan the format for conversions (`%' character). + */ + for (;;) { + for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++) + /* void */; + if ((n = fmt - cp) != 0) { + if (ret + n > INT_MAX) { + ret = EOF; + errno = EOVERFLOW; + goto error; + } + PRINT(cp, n); + ret += n; + } + if (ch == '\0') + goto done; +#ifdef VECTORS + pct = fmt; +#endif /* VECTORS */ + fmt++; /* skip over '%' */ + + flags = 0; + dprec = 0; + width = 0; + prec = -1; + gs.grouping = NULL; + sign = '\0'; + ox[1] = '\0'; +#ifdef VECTORS + vsep = 'X'; /* Illegal value, changed to defaults later. */ +#endif /* VECTORS */ + +rflag: ch = *fmt++; +reswitch: switch (ch) { + case ' ': + /*- + * ``If the space and + flags both appear, the space + * flag will be ignored.'' + * -- ANSI X3J11 + */ + if (!sign) + sign = ' '; + goto rflag; + case '#': + flags |= ALT; + goto rflag; +#ifdef VECTORS + case ',': case ';': case ':': case '_': + vsep = ch; + goto rflag; +#endif /* VECTORS */ + case '*': + /*- + * ``A negative field width argument is taken as a + * - flag followed by a positive field width.'' + * -- ANSI X3J11 + * They don't exclude field widths read from args. + */ + GETASTER (width); + if (width >= 0) + goto rflag; + width = -width; + /* FALLTHROUGH */ + case '-': + flags |= LADJUST; + goto rflag; + case '+': + sign = '+'; + goto rflag; + case '\'': + flags |= GROUPING; + goto rflag; + case '.': + if ((ch = *fmt++) == '*') { + GETASTER (prec); + goto rflag; + } + prec = 0; + while (is_digit(ch)) { + prec = 10 * prec + to_digit(ch); + ch = *fmt++; + } + goto reswitch; + case '0': + /*- + * ``Note that 0 is taken as a flag, not as the + * beginning of a field width.'' + * -- ANSI X3J11 + */ + flags |= ZEROPAD; + goto rflag; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + n = 0; + do { + n = 10 * n + to_digit(ch); + ch = *fmt++; + } while (is_digit(ch)); + if (ch == '$') { + nextarg = n; + if (argtable == NULL) { + argtable = statargtable; + if (__find_warguments (fmt0, orgap, + &argtable)) { + ret = EOF; + goto error; + } + } + goto rflag; + } + width = n; + goto reswitch; +#ifndef NO_FLOATING_POINT + case 'L': + flags |= LONGDBL; + goto rflag; +#endif + case 'h': + if (flags & SHORTINT) { + flags &= ~SHORTINT; + flags |= CHARINT; + } else + flags |= SHORTINT; + goto rflag; + case 'j': + flags |= INTMAXT; + goto rflag; + case 'l': + if (flags & LONGINT) { + flags &= ~LONGINT; + flags |= LLONGINT; + } else + flags |= LONGINT; + goto rflag; + case 'q': + flags |= LLONGINT; /* not necessarily */ + goto rflag; + case 't': + flags |= PTRDIFFT; + goto rflag; + case 'z': + flags |= SIZET; + goto rflag; + case 'C': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'c': +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & LONGINT) + *(cp = buf) = (wchar_t)GETARG(wint_t); + else + *(cp = buf) = (wchar_t)btowc_l(GETARG(int), loc); + size = 1; + sign = '\0'; + break; + case 'D': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'd': + case 'i': +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & INTMAX_SIZE) { + ujval = SJARG(); + if ((intmax_t)ujval < 0) { + ujval = -ujval; + sign = '-'; + } + } else { + ulval = SARG(); + if ((long)ulval < 0) { + ulval = -ulval; + sign = '-'; + } + } + base = 10; + goto number; +#ifndef NO_FLOATING_POINT + case 'a': + case 'A': +#ifdef VECTORS + if (flags & VECTOR) { + flags |= FPT; + break; + } +#endif /* VECTORS */ + if (ch == 'a') { + ox[1] = 'x'; + xdigs = xdigs_lower; + expchar = 'p'; + } else { + ox[1] = 'X'; + xdigs = xdigs_upper; + expchar = 'P'; + } + if (prec >= 0) + prec++; + if (flags & LONGDBL) { + fparg.ldbl = GETARG(long double); + dtoaresult = + __hldtoa(fparg.ldbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = + __hdtoa(fparg.dbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } + if (prec < 0) + prec = dtoaend - dtoaresult; + if (expt == INT_MAX) + ox[1] = '\0'; + free(convbuf); + ndig = dtoaend - dtoaresult; + cp = convbuf = __mbsconv(dtoaresult, -1, loc); + freedtoa(dtoaresult); + goto fp_common; + case 'e': + case 'E': +#ifdef VECTORS + if (flags & VECTOR) { + flags |= FPT; + break; + } +#endif /* VECTORS */ + expchar = ch; + if (prec < 0) /* account for digit before decpt */ + prec = DEFPREC + 1; + else + prec++; + goto fp_begin; + case 'f': + case 'F': +#ifdef VECTORS + if (flags & VECTOR) { + flags |= FPT; + break; + } +#endif /* VECTORS */ + expchar = '\0'; + goto fp_begin; + case 'g': + case 'G': +#ifdef VECTORS + if (flags & VECTOR) { + flags |= FPT; + break; + } +#endif /* VECTORS */ + expchar = ch - ('g' - 'e'); + if (prec == 0) + prec = 1; +fp_begin: + if (prec < 0) + prec = DEFPREC; + free(convbuf); + if (flags & LONGDBL) { + fparg.ldbl = GETARG(long double); + dtoaresult = + __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = + dtoa(fparg.dbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + if (expt == 9999) + expt = INT_MAX; + } + ndig = dtoaend - dtoaresult; + cp = convbuf = __mbsconv(dtoaresult, -1, loc); + freedtoa(dtoaresult); +fp_common: + if (signflag) + sign = '-'; + if (expt == INT_MAX) { /* inf or nan */ + if (*cp == 'N') { + cp = (ch >= 'a') ? L"nan" : L"NAN"; + sign = '\0'; + } else + cp = (ch >= 'a') ? L"inf" : L"INF"; + size = 3; + flags &= ~ZEROPAD; + break; + } + flags |= FPT; + if (ch == 'g' || ch == 'G') { + if (expt > -4 && expt <= prec) { + /* Make %[gG] smell like %[fF] */ + expchar = '\0'; + if (flags & ALT) + prec -= expt; + else + prec = ndig - expt; + if (prec < 0) + prec = 0; + } else { + /* + * Make %[gG] smell like %[eE], but + * trim trailing zeroes if no # flag. + */ + if (!(flags & ALT)) + prec = ndig; + } + } + if (expchar) { + expsize = exponent(expstr, expt - 1, expchar); + size = expsize + prec; + if (prec > 1 || flags & ALT) + ++size; + } else { + /* space for digits before decimal point */ + if (expt > 0) + size = expt; + else /* "0" */ + size = 1; + /* space for decimal pt and following digits */ + if (prec || flags & ALT) + size += prec + 1; + if ((flags & GROUPING) && expt > 0) + size += grouping_init(&gs, expt, loc); + } + break; +#endif /* !NO_FLOATING_POINT */ + case 'n': + { + /* + * Assignment-like behavior is specified if the + * value overflows or is otherwise unrepresentable. + * C99 says to use `signed char' for %hhn conversions. + */ + void *ptr = GETARG(void *); + if (ptr == NULL) + continue; + + if (flags & LLONGINT) + *(long long *)ptr = ret; + else if (flags & SIZET) + *(ssize_t *)ptr = (ssize_t)ret; + else if (flags & PTRDIFFT) + *(ptrdiff_t *)ptr = ret; + else if (flags & INTMAXT) + *(intmax_t *)ptr = ret; + else if (flags & LONGINT) + *(long *)ptr = ret; + else if (flags & SHORTINT) + *(short *)ptr = ret; + else if (flags & CHARINT) + *(signed char *)ptr = ret; + else + *(int *)ptr = ret; + continue; /* no output */ + } + case 'O': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'o': +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & INTMAX_SIZE) + ujval = UJARG(); + else + ulval = UARG(); + base = 8; + goto nosign; + case 'p': + /*- + * ``The argument shall be a pointer to void. The + * value of the pointer is converted to a sequence + * of printable characters, in an implementation- + * defined manner.'' + * -- ANSI X3J11 + */ +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + ujval = (uintmax_t)(uintptr_t)GETARG(void *); + base = 16; + xdigs = xdigs_lower; + flags = flags | INTMAXT; + ox[1] = 'x'; + goto nosign; + case 'S': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 's': + if (flags & LONGINT) { + if ((cp = GETARG(wchar_t *)) == NULL) + cp = L"(null)"; + } else { + char *mbp; + + free(convbuf); + if ((mbp = GETARG(char *)) == NULL) { + convbuf = NULL; + cp = L"(null)"; + } else { + convbuf = __mbsconv(mbp, prec, loc); + if (convbuf == NULL) { + fp->_flags |= __SERR; + goto error; + } + cp = convbuf; + } + } +#if 0 // wcsnlen needs API review first + size = (prec >= 0) ? wcsnlen(cp, prec) : wcslen(cp); +#else + size = wcslen(cp); + if (size >= INT_MAX) { + ret = EOF; + errno = EOVERFLOW; + goto error; + } + if(prec >= 0 && prec < size) + size = prec; +#endif + sign = '\0'; + break; + case 'U': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'u': +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & INTMAX_SIZE) + ujval = UJARG(); + else + ulval = UARG(); + base = 10; + goto nosign; + case 'X': + xdigs = xdigs_upper; + goto hex; + case 'x': + xdigs = xdigs_lower; +hex: +#ifdef VECTORS + if (flags & VECTOR) + break; +#endif /* VECTORS */ + if (flags & INTMAX_SIZE) + ujval = UJARG(); + else + ulval = UARG(); + base = 16; + /* leading 0x/X only if non-zero */ + if (flags & ALT && + (flags & INTMAX_SIZE ? ujval != 0 : ulval != 0)) + ox[1] = ch; + + flags &= ~GROUPING; + /* unsigned conversions */ +nosign: sign = '\0'; + /*- + * ``... diouXx conversions ... if a precision is + * specified, the 0 flag will be ignored.'' + * -- ANSI X3J11 + * except for %#.0o and zero value + */ +number: if ((dprec = prec) >= 0) + flags &= ~ZEROPAD; + + /*- + * ``The result of converting a zero value with an + * explicit precision of zero is no characters.'' + * -- ANSI X3J11 + * + * ``The C Standard is clear enough as is. The call + * printf("%#.0o", 0) should print 0.'' + * -- Defect Report #151 + */ + cp = buf + BUF; + if (flags & INTMAX_SIZE) { + if (ujval != 0 || prec != 0 || + (flags & ALT && base == 8)) + cp = __ujtoa(ujval, cp, base, + flags & ALT, xdigs); + } else { + if (ulval != 0 || prec != 0 || + (flags & ALT && base == 8)) + cp = __ultoa(ulval, cp, base, + flags & ALT, xdigs); + } + size = buf + BUF - cp; + if (size > BUF) /* should never happen */ + LIBC_ABORT("size (%zd) > BUF (%d)", size, BUF); + if ((flags & GROUPING) && size != 0) + size += grouping_init(&gs, size, loc); + break; +#ifdef VECTORS + case 'v': + flags |= VECTOR; + goto rflag; +#endif /* VECTORS */ + default: /* "%?" prints ?, unless ? is NUL */ + if (ch == '\0') + goto done; + /* pretend it was %c with argument ch */ + cp = buf; + *cp = ch; + size = 1; + sign = '\0'; + break; + } + +#ifdef VECTORS + if (flags & VECTOR) { + /* + * Do the minimum amount of work necessary to construct + * a format specifier that can be used to recursively + * call vfprintf() for each element in the vector. + */ + int i, j; /* Counter. */ + int vcnt; /* Number of elements in vector. */ + char *vfmt; /* Pointer to format specifier. */ +#define EXTRAHH 2 + char vfmt_buf[32 + EXTRAHH]; /* Static buffer for format spec. */ + int vwidth = 0; /* Width specified via '*'. */ + int vprec = 0; /* Precision specified via '*'. */ + char *vstr; /* Used for asprintf(). */ + int vlen; /* Length returned by asprintf(). */ + enum { + V_CHAR, V_SHORT, V_INT, + V_PCHAR, V_PSHORT, V_PINT, + V_FLOAT, +#ifdef V64TYPE + V_LONGLONG, V_PLONGLONG, + V_DOUBLE, +#endif /* V64TYPE */ + } vtype; + + vval.vectorarg = GETARG(VECTORTYPE); + /* + * Set vfmt. If vfmt_buf may not be big enough, + * malloc() space, taking care to free it later. + * (EXTRAHH is for possible extra "hh") + */ + if (&fmt[-1] - pct + EXTRAHH < sizeof(vfmt_buf)) + vfmt = vfmt_buf; + else + vfmt = (char *)malloc(&fmt[-1] - pct + EXTRAHH + 1); + + /* Set the separator character, if not specified. */ + if (vsep == 'X') { + if (ch == 'c') + vsep = '\0'; + else + vsep = ' '; + } + + /* Create the format specifier. */ + for (i = j = 0; i < &fmt[-1] - pct; i++) { + switch (pct[i]) { + case ',': case ';': case ':': case '_': + case 'v': case 'h': case 'l': + /* Ignore. */ + break; + case '*': + if (pct[i - 1] != '.') + vwidth = 1; + else + vprec = 1; + /* FALLTHROUGH */ + default: + vfmt[j++] = pct[i]; + } + } + + /* + * Determine the number of elements in the vector and + * finish up the format specifier. + */ + if (flags & SHORTINT) { + switch (ch) { + case 'c': + vtype = V_SHORT; + break; + case 'p': + vtype = V_PSHORT; + break; + default: + vfmt[j++] = 'h'; + vtype = V_SHORT; + break; + } + vcnt = 8; + } else if (flags & LONGINT) { + vcnt = 4; + vtype = (ch == 'p') ? V_PINT : V_INT; +#ifdef V64TYPE + } else if (flags & LLONGINT) { + switch (ch) { + case 'a': + case 'A': + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + vcnt = 2; + vtype = V_DOUBLE; + break; + case 'd': + case 'i': + case 'u': + case 'o': + case 'p': + case 'x': + case 'X': + vfmt[j++] = 'l'; + vfmt[j++] = 'l'; + vcnt = 2; + vtype = (ch == 'p') ? V_PLONGLONG : V_LONGLONG; + break; + default: + /* + * The default case should never + * happen. + */ + case 'c': + vcnt = 16; + vtype = V_CHAR; + } +#endif /* V64TYPE */ + } else { + switch (ch) { + case 'a': + case 'A': + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + vcnt = 4; + vtype = V_FLOAT; + break; + default: + /* + * The default case should never + * happen. + */ + case 'd': + case 'i': + case 'u': + case 'o': + case 'x': + case 'X': + vfmt[j++] = 'h'; + vfmt[j++] = 'h'; + /* drop through */ + case 'p': + case 'c': + vcnt = 16; + vtype = (ch == 'p') ? V_PCHAR : V_CHAR; + } + } + vfmt[j++] = ch; + vfmt[j++] = '\0'; + +/* Get a vector element. */ +#ifdef V64TYPE +#define VPRINT(type, ind, args...) do { \ + switch (type) { \ + case V_CHAR: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vuchararg[ind]); \ + break; \ + case V_PCHAR: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vuchararg[ind]); \ + break; \ + case V_SHORT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vushortarg[ind]); \ + break; \ + case V_PSHORT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vushortarg[ind]); \ + break; \ + case V_INT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vuintarg[ind]); \ + break; \ + case V_PINT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vuintarg[ind]); \ + break; \ + case V_LONGLONG: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vulonglongarg[ind]); \ + break; \ + case V_PLONGLONG: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vulonglongarg[ind]); \ + break; \ + case V_FLOAT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vfloatarg[ind]); \ + break; \ + case V_DOUBLE: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vdoublearg[ind]); \ + break; \ + } \ + ret += vlen; \ + PRINT((const CHAR *) vstr, vlen); \ + free(vstr); \ +} while (0) +#else /* !V64TYPE */ +#define VPRINT(type, ind, args...) do { \ + switch (type) { \ + case V_CHAR: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vuchararg[ind]); \ + break; \ + case V_PCHAR: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vuchararg[ind]); \ + break; \ + case V_SHORT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vushortarg[ind]); \ + break; \ + case V_PSHORT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vushortarg[ind]); \ + break; \ + case V_INT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vuintarg[ind]); \ + break; \ + case V_PINT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, (void *)(uintptr_t)vval.vuintarg[ind]); \ + break; \ + case V_FLOAT: \ + vlen = asprintf_l(&vstr, loc, vfmt , ## args, vval.vfloatarg[ind]); \ + break; \ + } \ + ret += vlen; \ + PRINT((const CHAR *) vstr, vlen); \ + free(vstr); \ +} while (0) +#endif /* V64TYPE */ + + /* Actually print. */ + if (vwidth == 0) { + if (vprec == 0) { + /* First element. */ + VPRINT(vtype, 0); + for (i = 1; i < vcnt; i++) { + /* Separator. */ + if(vsep) + PRINT(&vsep, 1); + + /* Element. */ + VPRINT(vtype, i); + } + } else { + /* First element. */ + VPRINT(vtype, 0, prec); + for (i = 1; i < vcnt; i++) { + /* Separator. */ + if(vsep) + PRINT(&vsep, 1); + + /* Element. */ + VPRINT(vtype, i, prec); + } + } + } else { + if (vprec == 0) { + /* First element. */ + VPRINT(vtype, 0, width); + for (i = 1; i < vcnt; i++) { + /* Separator. */ + if(vsep) + PRINT(&vsep, 1); + + /* Element. */ + VPRINT(vtype, i, width); + } + } else { + /* First element. */ + VPRINT(vtype, 0, width, prec); + for (i = 1; i < vcnt; i++) { + /* Separator. */ + if(vsep) + PRINT(&vsep, 1); + + /* Element. */ + VPRINT(vtype, i, width, prec); + } + } + } +#undef VPRINT + + if (vfmt != vfmt_buf) + free(vfmt); + + continue; + } +#endif /* VECTORS */ + /* + * All reasonable formats wind up here. At this point, `cp' + * points to a string which (if not flags&LADJUST) should be + * padded out to `width' places. If flags&ZEROPAD, it should + * first be prefixed by any sign or other prefix; otherwise, + * it should be blank padded before the prefix is emitted. + * After any left-hand padding and prefixing, emit zeroes + * required by a decimal [diouxX] precision, then print the + * string proper, then emit zeroes required by any leftover + * floating precision; finally, if LADJUST, pad with blanks. + * + * Compute actual size, so we know how much to pad. + * size excludes decimal prec; realsz includes it. + */ + realsz = dprec > size ? dprec : size; + if (sign) + realsz++; + if (ox[1]) + realsz += 2; + + prsize = width > realsz ? width : realsz; + if (ret + prsize > INT_MAX) { + ret = EOF; + errno = EOVERFLOW; + goto error; + } + + /* right-adjusting blank padding */ + if ((flags & (LADJUST|ZEROPAD)) == 0) + PAD(width - realsz, blanks); + + /* prefix */ + if (sign) + PRINT(&sign, 1); + + if (ox[1]) { /* ox[1] is either x, X, or \0 */ + ox[0] = '0'; + PRINT(ox, 2); + } + + /* right-adjusting zero padding */ + if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) + PAD(width - realsz, zeroes); + + /* the string or number proper */ +#ifndef NO_FLOATING_POINT + if ((flags & FPT) == 0) { +#endif + /* leading zeroes from decimal precision */ + PAD(dprec - size, zeroes); + if (gs.grouping) { + if (grouping_print(&gs, &io, cp, buf+BUF, loc) < 0) + goto error; + } else { + PRINT(cp, size); + } +#ifndef NO_FLOATING_POINT + } else { /* glue together f_p fragments */ + if (!expchar) { /* %[fF] or sufficiently short %[gG] */ + if (expt <= 0) { + PRINT(zeroes, 1); + if (prec || flags & ALT) + PRINT(&decimal_point, 1); + PAD(-expt, zeroes); + /* already handled initial 0's */ + prec += expt; + } else { + if (gs.grouping) { + n = grouping_print(&gs, &io, + cp, convbuf + ndig, loc); + if (n < 0) + goto error; + cp += n; + } else { + PRINTANDPAD(cp, convbuf + ndig, + expt, zeroes); + cp += expt; + } + if (prec || flags & ALT) + PRINT(&decimal_point, 1); + } + PRINTANDPAD(cp, convbuf + ndig, prec, zeroes); + } else { /* %[eE] or sufficiently long %[gG] */ + if (prec > 1 || flags & ALT) { + buf[0] = *cp++; + buf[1] = decimal_point; + PRINT(buf, 2); + PRINT(cp, ndig-1); + PAD(prec - ndig, zeroes); + } else /* XeYYY */ + PRINT(cp, 1); + PRINT(expstr, expsize); + } + } +#endif + /* left-adjusting padding (always blank) */ + if (flags & LADJUST) + PAD(width - realsz, blanks); + + /* finally, adjust ret */ + ret += prsize; + + FLUSH(); /* copy out the I/O vectors */ + } +done: + FLUSH(); +error: + va_end(orgap); + free(convbuf); + if (__sferror(fp)) + ret = EOF; + if ((argtable != NULL) && (argtable != statargtable)) + free (argtable); + return (ret < 0 || ret >= INT_MAX) ? -1 : (int)ret; + /* NOTREACHED */ +} diff --git a/stdio/FreeBSD/vfwscanf.c b/stdio/FreeBSD/vfwscanf.c new file mode 100644 index 0000000..61b868a --- /dev/null +++ b/stdio/FreeBSD/vfwscanf.c @@ -0,0 +1,946 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfscanf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#endif +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwscanf.c,v 1.17 2009/01/19 06:19:51 das Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" +#include "local.h" + +#ifndef NO_FLOATING_POINT +#include +#endif + +#define BUF 513 /* Maximum length of numeric string. */ + +/* + * Flags used during conversion. + */ +#define LONG 0x01 /* l: long or double */ +#define LONGDBL 0x02 /* L: long double */ +#define SHORT 0x04 /* h: short */ +#define SUPPRESS 0x08 /* *: suppress assignment */ +#define POINTER 0x10 /* p: void * (as hex) */ +#define NOSKIP 0x20 /* [ or c: do not skip blanks */ +#define LONGLONG 0x400 /* ll: long long (+ deprecated q: quad) */ +#define INTMAXT 0x800 /* j: intmax_t */ +#define PTRDIFFT 0x1000 /* t: ptrdiff_t */ +#define SIZET 0x2000 /* z: size_t */ +#define SHORTSHORT 0x4000 /* hh: char */ +#define UNSIGNED 0x8000 /* %[oupxX] conversions */ + +/* + * The following are used in integral conversions only: + * SIGNOK, NDIGITS, PFXOK, and NZDIGITS + */ +#define SIGNOK 0x40 /* +/- is (still) legal */ +#define NDIGITS 0x80 /* no digits detected */ +#define PFXOK 0x100 /* 0x prefix is (still) legal */ +#define NZDIGITS 0x200 /* no zero digits detected */ +#define HAVESIGN 0x10000 /* sign detected */ + +/* + * Conversion types. + */ +#define CT_CHAR 0 /* %c conversion */ +#define CT_CCL 1 /* %[...] conversion */ +#define CT_STRING 2 /* %s conversion */ +#define CT_INT 3 /* %[dioupxX] conversion */ +#define CT_FLOAT 4 /* %[efgEFG] conversion */ + +#ifndef NO_FLOATING_POINT +static int parsefloat(FILE *, wchar_t **, size_t, locale_t loc); +#endif + +#define INCCL(_c) \ + (cclcompl ? (wmemchr(ccls, (_c), ccle - ccls) == NULL) : \ + (wmemchr(ccls, (_c), ccle - ccls) != NULL)) + +static const mbstate_t initial_mbs; + +/* + * MT-safe version. + */ +int +vfwscanf(FILE * __restrict fp, const wchar_t * __restrict fmt, va_list ap) +{ + int ret; + + FLOCKFILE(fp); + ORIENT(fp, 1); + ret = __vfwscanf(fp, __current_locale(), fmt, ap); + FUNLOCKFILE(fp); + return (ret); +} + +int +vfwscanf_l(FILE * __restrict fp, locale_t loc, const wchar_t * __restrict fmt, + va_list ap) +{ + int ret; + + NORMALIZE_LOCALE(loc); + FLOCKFILE(fp); + ORIENT(fp, 1); + ret = __vfwscanf(fp, loc, fmt, ap); + FUNLOCKFILE(fp); + return (ret); +} + +/* + * Non-MT-safe version. + */ +__private_extern__ int +__vfwscanf(FILE * __restrict fp, locale_t loc, const wchar_t * __restrict fmt, + va_list ap) +{ + wint_t c; /* character from format, or conversion */ + size_t width; /* field width, or 0 */ + wchar_t *p; /* points into all kinds of strings */ + int n; /* handy integer */ + int flags; /* flags as defined above */ + wchar_t *p0; /* saves original value of p when necessary */ + int nassigned; /* number of fields assigned */ + int nread; /* number of characters consumed from fp */ + int base; /* base argument to conversion function */ + wchar_t buf[BUF]; /* buffer for numeric conversions */ + const wchar_t *ccls; /* character class start */ + const wchar_t *ccle; /* character class end */ + int cclcompl; /* ccl is complemented? */ + wint_t wi; /* handy wint_t */ + char *mbp; /* multibyte string pointer for %c %s %[ */ + size_t nconv; /* number of bytes in mb. conversion */ + char mbbuf[MB_LEN_MAX]; /* temporary mb. character buffer */ + int index; /* for %index$ */ + va_list ap_orig; /* to reset ap to first argument */ + mbstate_t mbs; + int mb_cur_max = MB_CUR_MAX_L(loc); + + /* `basefix' is used to avoid `if' tests in the integer scanner */ + static const short basefix[17] = + { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; + + nassigned = 0; + nread = 0; + ccls = ccle = NULL; + va_copy(ap_orig, ap); + for (;;) { + c = *fmt++; + if (c == 0) + return (nassigned); + if (iswspace_l(c, loc)) { + while ((c = __fgetwc(fp, loc)) != WEOF && + iswspace_l(c, loc)) + ; + if (c != WEOF) + __ungetwc(c, fp, loc); + continue; + } + if (c != '%') { + if ((wi = __fgetwc(fp, loc)) == WEOF) + goto input_failure; + goto literal; + } + width = 0; + flags = 0; + /* + * switch on the format. continue if done; + * break once format type is derived. + */ +again: c = *fmt++; + switch (c) { + case '%': + /* Consume leading white space */ + for(;;) { + if ((wi = __fgetwc(fp, loc)) == WEOF) + goto input_failure; + if (!iswspace_l(wi, loc)) + break; + nread++; + } +literal: + if (wi != c) { + __ungetwc(wi, fp, loc); + goto match_failure; + } + nread++; + continue; + + case '$': + index = width; + if (index < 1 || index > NL_ARGMAX || fmt[-3] != '%') { + goto input_failure; + } + width = 0; + va_end(ap); + va_copy(ap, ap_orig); /* reset to %1$ */ + for (; index > 1; index--) { + va_arg(ap, void*); + } + goto again; + case '*': + flags |= SUPPRESS; + goto again; + case 'j': + flags |= INTMAXT; + goto again; + case 'l': + if (flags & LONG) { + flags &= ~LONG; + flags |= LONGLONG; + } else + flags |= LONG; + goto again; + case 'q': + flags |= LONGLONG; /* not quite */ + goto again; + case 't': + flags |= PTRDIFFT; + goto again; + case 'z': + flags |= SIZET; + goto again; + case 'L': + flags |= LONGDBL; + goto again; + case 'h': + if (flags & SHORT) { + flags &= ~SHORT; + flags |= SHORTSHORT; + } else + flags |= SHORT; + goto again; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + width = width * 10 + c - '0'; + goto again; + + /* + * Conversions. + */ + case 'd': + c = CT_INT; + base = 10; + break; + + case 'i': + c = CT_INT; + base = 0; + break; + + case 'o': + c = CT_INT; + flags |= UNSIGNED; + base = 8; + break; + + case 'u': + c = CT_INT; + flags |= UNSIGNED; + base = 10; + break; + + case 'X': + case 'x': + flags |= PFXOK; /* enable 0x prefixing */ + c = CT_INT; + flags |= UNSIGNED; + base = 16; + break; + +#ifndef NO_FLOATING_POINT + case 'A': case 'E': case 'F': case 'G': + case 'a': case 'e': case 'f': case 'g': + c = CT_FLOAT; + break; +#endif + + case 'S': + flags |= LONG; + /* FALLTHROUGH */ + case 's': + c = CT_STRING; + break; + + case '[': + ccls = fmt; + if (*fmt == '^') { + cclcompl = 1; + fmt++; + } else + cclcompl = 0; + if (*fmt == ']') + fmt++; + while (*fmt != '\0' && *fmt != ']') + fmt++; + ccle = fmt; + fmt++; + flags |= NOSKIP; + c = CT_CCL; + break; + + case 'C': + flags |= LONG; + /* FALLTHROUGH */ + case 'c': + flags |= NOSKIP; + c = CT_CHAR; + break; + + case 'p': /* pointer format is like hex */ + flags |= POINTER | PFXOK; + c = CT_INT; /* assumes sizeof(uintmax_t) */ + flags |= UNSIGNED; /* >= sizeof(uintptr_t) */ + base = 16; + break; + + case 'n': + { + if (flags & SUPPRESS) /* ??? */ + continue; + void *ptr = va_arg(ap, void *); + if (ptr == NULL) + continue; + else if (flags & SHORTSHORT) + *(char *)ptr = nread; + else if (flags & SHORT) + *(short *)ptr = nread; + else if (flags & LONG) + *(long *)ptr = nread; + else if (flags & LONGLONG) + *(long long *)ptr = nread; + else if (flags & INTMAXT) + *(intmax_t *)ptr = nread; + else if (flags & SIZET) + *(size_t *)ptr = nread; + else if (flags & PTRDIFFT) + *(ptrdiff_t *)ptr = nread; + else + *(int *)ptr = nread; + continue; + } + default: + goto match_failure; + + /* + * Disgusting backwards compatibility hack. XXX + */ + case '\0': /* compat */ + return (EOF); + } + + /* + * Consume leading white space, except for formats + * that suppress this. + */ + if ((flags & NOSKIP) == 0) { + while ((wi = __fgetwc(fp, loc)) != WEOF && iswspace_l(wi, loc)) + nread++; + if (wi == WEOF) + goto input_failure; + __ungetwc(wi, fp, loc); + } + + /* + * Do the conversion. + */ + switch (c) { + + case CT_CHAR: + /* scan arbitrary characters (sets NOSKIP) */ + if (width == 0) + width = 1; + if (flags & LONG) { + if (!(flags & SUPPRESS)) + p = va_arg(ap, wchar_t *); + n = 0; + while (width-- != 0 && + (wi = __fgetwc(fp, loc)) != WEOF) { + if (!(flags & SUPPRESS)) + *p++ = (wchar_t)wi; + n++; + } + if (n == 0) + goto input_failure; + nread += n; + if (!(flags & SUPPRESS)) + nassigned++; + } else { + if (!(flags & SUPPRESS)) + mbp = va_arg(ap, char *); + n = 0; + mbs = initial_mbs; + while (width != 0 && + (wi = __fgetwc(fp, loc)) != WEOF) { + if (width >= mb_cur_max && + !(flags & SUPPRESS)) { + nconv = wcrtomb_l(mbp, wi, &mbs, loc); + if (nconv == (size_t)-1) + goto input_failure; + } else { + nconv = wcrtomb_l(mbbuf, wi, + &mbs, loc); + if (nconv == (size_t)-1) + goto input_failure; + if (nconv > width) { + __ungetwc(wi, fp, loc); + break; + } + if (!(flags & SUPPRESS)) + memcpy(mbp, mbbuf, + nconv); + } + if (!(flags & SUPPRESS)) + mbp += nconv; + width -= nconv; + n++; + } + if (n == 0) + goto input_failure; + nread += n; + if (!(flags & SUPPRESS)) + nassigned++; + } + break; + + case CT_CCL: + /* scan a (nonempty) character class (sets NOSKIP) */ + if (width == 0) + width = (size_t)~0; /* `infinity' */ + /* take only those things in the class */ + if ((flags & SUPPRESS) && (flags & LONG)) { + n = 0; + while ((wi = __fgetwc(fp, loc)) != WEOF && + width-- != 0 && INCCL(wi)) + n++; + if (wi != WEOF) + __ungetwc(wi, fp, loc); + if (n == 0) + goto match_failure; + } else if (flags & LONG) { + p0 = p = va_arg(ap, wchar_t *); + while ((wi = __fgetwc(fp, loc)) != WEOF && + width-- != 0 && INCCL(wi)) + *p++ = (wchar_t)wi; + if (wi != WEOF) + __ungetwc(wi, fp, loc); + n = p - p0; + if (n == 0) + goto match_failure; + *p = 0; + nassigned++; + } else { + if (!(flags & SUPPRESS)) + mbp = va_arg(ap, char *); + n = 0; + mbs = initial_mbs; + while ((wi = __fgetwc(fp, loc)) != WEOF && + width != 0 && INCCL(wi)) { + if (width >= mb_cur_max && + !(flags & SUPPRESS)) { + nconv = wcrtomb_l(mbp, wi, &mbs, loc); + if (nconv == (size_t)-1) + goto input_failure; + } else { + nconv = wcrtomb_l(mbbuf, wi, + &mbs, loc); + if (nconv == (size_t)-1) + goto input_failure; + if (nconv > width) + break; + if (!(flags & SUPPRESS)) + memcpy(mbp, mbbuf, + nconv); + } + if (!(flags & SUPPRESS)) + mbp += nconv; + width -= nconv; + n++; + } + if (wi != WEOF) + __ungetwc(wi, fp, loc); + if (n == 0) + goto match_failure; + if (!(flags & SUPPRESS)) { + *mbp = 0; + nassigned++; + } + } + nread += n; + break; + + case CT_STRING: + /* like CCL, but zero-length string OK, & no NOSKIP */ + if (width == 0) + width = (size_t)~0; + if ((flags & SUPPRESS) && (flags & LONG)) { + while ((wi = __fgetwc(fp, loc)) != WEOF && + width-- != 0 && + !iswspace_l(wi, loc)) + nread++; + if (wi != WEOF) + __ungetwc(wi, fp, loc); + } else if (flags & LONG) { + p0 = p = va_arg(ap, wchar_t *); + while ((wi = __fgetwc(fp, loc)) != WEOF && + width-- != 0 && + !iswspace_l(wi, loc)) { + *p++ = (wchar_t)wi; + nread++; + } + if (wi != WEOF) + __ungetwc(wi, fp, loc); + *p = '\0'; + nassigned++; + } else { + if (!(flags & SUPPRESS)) + mbp = va_arg(ap, char *); + mbs = initial_mbs; + while ((wi = __fgetwc(fp, loc)) != WEOF && + width != 0 && + !iswspace_l(wi, loc)) { + if (width >= mb_cur_max && + !(flags & SUPPRESS)) { + nconv = wcrtomb_l(mbp, wi, &mbs, loc); + if (nconv == (size_t)-1) + goto input_failure; + } else { + nconv = wcrtomb_l(mbbuf, wi, + &mbs, loc); + if (nconv == (size_t)-1) + goto input_failure; + if (nconv > width) + break; + if (!(flags & SUPPRESS)) + memcpy(mbp, mbbuf, + nconv); + } + if (!(flags & SUPPRESS)) + mbp += nconv; + width -= nconv; + nread++; + } + if (wi != WEOF) + __ungetwc(wi, fp, loc); + if (!(flags & SUPPRESS)) { + *mbp = 0; + nassigned++; + } + } + continue; + + case CT_INT: + /* scan an integer as if by the conversion function */ + if (width == 0 || width > sizeof(buf) / + sizeof(*buf) - 1) + width = sizeof(buf) / sizeof(*buf) - 1; + flags |= SIGNOK | NDIGITS | NZDIGITS; + for (p = buf; width; width--) { + c = __fgetwc(fp, loc); + /* + * Switch on the character; `goto ok' + * if we accept it as a part of number. + */ + switch (c) { + + /* + * The digit 0 is always legal, but is + * special. For %i conversions, if no + * digits (zero or nonzero) have been + * scanned (only signs), we will have + * base==0. In that case, we should set + * it to 8 and enable 0x prefixing. + * Also, if we have not scanned zero digits + * before this, do not turn off prefixing + * (someone else will turn it off if we + * have scanned any nonzero digits). + */ + case '0': + if (base == 0) { + base = 8; + flags |= PFXOK; + } + if (flags & NZDIGITS) + flags &= ~(SIGNOK|NZDIGITS|NDIGITS); + else + flags &= ~(SIGNOK|PFXOK|NDIGITS); + goto ok; + + /* 1 through 7 always legal */ + case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + base = basefix[base]; + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* digits 8 and 9 ok iff decimal or hex */ + case '8': case '9': + base = basefix[base]; + if (base <= 8) + break; /* not legal here */ + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* letters ok iff hex */ + case 'A': case 'B': case 'C': + case 'D': case 'E': case 'F': + case 'a': case 'b': case 'c': + case 'd': case 'e': case 'f': + /* no need to fix base here */ + if (base <= 10) + break; /* not legal here */ + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* sign ok only as first character */ + case '+': case '-': + if (flags & SIGNOK) { + flags &= ~SIGNOK; + flags |= HAVESIGN; + goto ok; + } + break; + + /* + * x ok iff flag still set & 2nd char (or + * 3rd char if we have a sign). + */ + case 'x': case 'X': + if (flags & PFXOK && p == + buf + 1 + !!(flags & HAVESIGN)) { + base = 16; /* if %i */ + flags &= ~PFXOK; + goto ok; + } + break; + } + + /* + * If we got here, c is not a legal character + * for a number. Stop accumulating digits. + */ + if (c != WEOF) + __ungetwc(c, fp, loc); + break; + ok: + /* + * c is legal: store it and look at the next. + */ + *p++ = (wchar_t)c; + } + /* + * If we had only a sign, it is no good; push + * back the sign. If the number ends in `x', + * it was [sign] '0' 'x', so push back the x + * and treat it as [sign] '0'. + */ + if (flags & NDIGITS) { + if (p > buf) + __ungetwc(*--p, fp, loc); + goto match_failure; + } + c = p[-1]; + if (c == 'x' || c == 'X') { + --p; + __ungetwc(c, fp, loc); + } + if ((flags & SUPPRESS) == 0) { + uintmax_t res; + + *p = 0; + if ((flags & UNSIGNED) == 0) + res = wcstoimax_l(buf, NULL, base, loc); + else + res = wcstoumax_l(buf, NULL, base, loc); + if (flags & POINTER) + *va_arg(ap, void **) = + (void *)(uintptr_t)res; + else if (flags & SHORTSHORT) + *va_arg(ap, char *) = res; + else if (flags & SHORT) + *va_arg(ap, short *) = res; + else if (flags & LONG) + *va_arg(ap, long *) = res; + else if (flags & LONGLONG) + *va_arg(ap, long long *) = res; + else if (flags & INTMAXT) + *va_arg(ap, intmax_t *) = res; + else if (flags & PTRDIFFT) + *va_arg(ap, ptrdiff_t *) = res; + else if (flags & SIZET) + *va_arg(ap, size_t *) = res; + else + *va_arg(ap, int *) = res; + nassigned++; + } + nread += p - buf; + break; + +#ifndef NO_FLOATING_POINT + case CT_FLOAT: + { + wchar_t *pbuf; + /* scan a floating point number as if by strtod */ + if ((width = parsefloat(fp, &pbuf, width, loc)) == 0) + goto match_failure; + if ((flags & SUPPRESS) == 0) { + if (flags & LONGDBL) { + long double res = wcstold_l(pbuf, &p, loc); + *va_arg(ap, long double *) = res; + } else if (flags & LONG) { + double res = wcstod_l(pbuf, &p, loc); + *va_arg(ap, double *) = res; + } else { + float res = wcstof_l(pbuf, &p, loc); + *va_arg(ap, float *) = res; + } + nassigned++; + } + nread += width; + break; + } +#endif /* !NO_FLOATING_POINT */ + } + } +input_failure: + return (nassigned ? nassigned : EOF); +match_failure: + return (nassigned); +} + +#ifndef NO_FLOATING_POINT +extern char *__parsefloat_buf(size_t s); /* see vfscanf-fbsd.c */ + +static int +parsefloat(FILE *fp, wchar_t **buf, size_t width, locale_t loc) +{ + mbstate_t mbs; + size_t nconv; + wchar_t *commit, *p; + int infnanpos = 0; + enum { + S_START, S_GOTSIGN, S_INF, S_NAN, S_DONE, S_MAYBEHEX, + S_DIGITS, S_FRAC, S_EXP, S_EXPDIGITS + } state = S_START; + wchar_t c; + wchar_t decpt; + _Bool gotmantdig = 0, ishex = 0; + wchar_t *b; + wchar_t *e; + size_t s; + + mbs = initial_mbs; + + nconv = mbrtowc_l(&decpt, localeconv()->decimal_point, MB_CUR_MAX_L(loc), &mbs, loc); + if (nconv == (size_t)-1 || nconv == (size_t)-2) + decpt = '.'; /* failsafe */ + + s = (width == 0 ? BUF : (width + 1)); + if ((b = (wchar_t *)__parsefloat_buf(s * sizeof(wchar_t))) == NULL) { + *buf = NULL; + return 0; + } + e = b + (s - 1); + /* + * We set commit = p whenever the string we have read so far + * constitutes a valid representation of a floating point + * number by itself. At some point, the parse will complete + * or fail, and we will ungetc() back to the last commit point. + * To ensure that the file offset gets updated properly, it is + * always necessary to read at least one character that doesn't + * match; thus, we can't short-circuit "infinity" or "nan(...)". + */ + commit = b - 1; + c = WEOF; + for (p = b; width == 0 || p < e; ) { + if ((c = __fgetwc(fp, loc)) == WEOF) + break; +reswitch: + switch (state) { + case S_START: + state = S_GOTSIGN; + if (c == '-' || c == '+') + break; + else + goto reswitch; + case S_GOTSIGN: + switch (c) { + case '0': + state = S_MAYBEHEX; + commit = p; + break; + case 'I': + case 'i': + state = S_INF; + break; + case 'N': + case 'n': + state = S_NAN; + break; + default: + state = S_DIGITS; + goto reswitch; + } + break; + case S_INF: + if (infnanpos > 6 || + (c != "nfinity"[infnanpos] && + c != "NFINITY"[infnanpos])) + goto parsedone; + if (infnanpos == 1 || infnanpos == 6) + commit = p; /* inf or infinity */ + infnanpos++; + break; + case S_NAN: + switch (infnanpos) { + case 0: + if (c != 'A' && c != 'a') + goto parsedone; + break; + case 1: + if (c != 'N' && c != 'n') + goto parsedone; + else + commit = p; + break; + case 2: + if (c != '(') + goto parsedone; + break; + default: + if (c == ')') { + commit = p; + state = S_DONE; + } else if (!iswalnum_l(c, loc) && c != '_') + goto parsedone; + break; + } + infnanpos++; + break; + case S_DONE: + goto parsedone; + case S_MAYBEHEX: + state = S_DIGITS; + if (c == 'X' || c == 'x') { + ishex = 1; + break; + } else { /* we saw a '0', but no 'x' */ + gotmantdig = 1; + goto reswitch; + } + case S_DIGITS: + if ((ishex && iswxdigit_l(c, loc)) || iswdigit_l(c, loc)) + gotmantdig = 1; + else { + state = S_FRAC; + if (c != decpt) + goto reswitch; + } + if (gotmantdig) + commit = p; + break; + case S_FRAC: + if (((c == 'E' || c == 'e') && !ishex) || + ((c == 'P' || c == 'p') && ishex)) { + if (!gotmantdig) + goto parsedone; + else + state = S_EXP; + } else if ((ishex && iswxdigit_l(c, loc)) || iswdigit_l(c, loc)) { + commit = p; + gotmantdig = 1; + } else + goto parsedone; + break; + case S_EXP: + state = S_EXPDIGITS; + if (c == '-' || c == '+') + break; + else + goto reswitch; + case S_EXPDIGITS: + if (iswdigit_l(c, loc)) + commit = p; + else + goto parsedone; + break; + default: + LIBC_ABORT("unknown state %d", state); + } + if (p >= e) { + ssize_t diff = (p - b); + ssize_t com = (commit - b); + s += BUF; + b = (wchar_t *)__parsefloat_buf(s * sizeof(wchar_t)); + if (b == NULL) { + *buf = NULL; + return 0; + } + e = b + (s - 1); + p = b + diff; + commit = b + com; + } + *p++ = c; + c = WEOF; + } + +parsedone: + if (c != WEOF) + __ungetwc(c, fp, loc); + while (commit < --p) + __ungetwc(*p, fp, loc); + *++commit = '\0'; + *buf = b; + return (commit - b); +} +#endif diff --git a/stdio/FreeBSD/vprintf.c b/stdio/FreeBSD/vprintf.c new file mode 100644 index 0000000..894cd79 --- /dev/null +++ b/stdio/FreeBSD/vprintf.c @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vprintf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vprintf.c,v 1.11 2007/01/09 00:28:08 imp Exp $"); + +#include "xlocale_private.h" + +#include + +int +vprintf(const char * __restrict fmt, __va_list ap) +{ + + return (vfprintf_l(stdout, __current_locale(), fmt, ap)); +} + +int +vprintf_l(locale_t loc, const char * __restrict fmt, __va_list ap) +{ + + /* no need to call NORMALIZE_LOCALE(loc) because vfprintf_l will */ + return (vfprintf_l(stdout, loc, fmt, ap)); +} diff --git a/stdio/FreeBSD/vscanf.c b/stdio/FreeBSD/vscanf.c new file mode 100644 index 0000000..397382e --- /dev/null +++ b/stdio/FreeBSD/vscanf.c @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Donn Seeley at UUNET Technologies, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vscanf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vscanf.c,v 1.13 2007/01/09 00:28:08 imp Exp $"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +int +vscanf(fmt, ap) + const char * __restrict fmt; + __va_list ap; +{ + int retval; + + FLOCKFILE(stdin); + retval = __svfscanf_l(stdin, __current_locale(), fmt, ap); + FUNLOCKFILE(stdin); + return (retval); +} + +int +vscanf_l(loc, fmt, ap) + locale_t loc; + const char * __restrict fmt; + __va_list ap; +{ + int retval; + + NORMALIZE_LOCALE(loc); + FLOCKFILE(stdin); + retval = __svfscanf_l(stdin, loc, fmt, ap); + FUNLOCKFILE(stdin); + return (retval); +} diff --git a/stdio/FreeBSD/vsnprintf.c b/stdio/FreeBSD/vsnprintf.c new file mode 100644 index 0000000..4b29144 --- /dev/null +++ b/stdio/FreeBSD/vsnprintf.c @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vsnprintf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vsnprintf.c,v 1.24 2008/04/17 22:17:54 jhb Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include "local.h" + +__private_extern__ int +_vsnprintf(printf_comp_t __restrict pc, printf_domain_t __restrict domain, char * __restrict str, size_t n, locale_t __restrict loc, const char * __restrict fmt, __va_list ap) +{ + size_t on; + int ret; + char dummy[2]; + FILE f; + struct __sFILEX ext; + f._extra = &ext; + INITEXTRA(&f); + + on = n; + if (n != 0) + n--; +#if defined(__i386__) + /* don't corrupt the output buffer at all if the size underflowed */ + if (n > INT_MAX) + on = n = 0; +#else + if (n > INT_MAX) + n = INT_MAX; +#endif + + /* Stdio internals do not deal correctly with zero length buffer */ + if (n == 0) { + if (on > 0) + *str = '\0'; + str = dummy; + n = 1; + } + f._file = -1; + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *)str; + f._bf._size = f._w = n; + f._orientation = 0; + memset(&f._mbstate, 0, sizeof(mbstate_t)); + ret = __v2printf(pc, domain, &f, loc, fmt, ap); + if (on > 0) + *f._p = '\0'; + return (ret); +} +int +vsnprintf_l(char * __restrict str, size_t n, locale_t __restrict loc, const char * __restrict fmt, + __va_list ap) +{ + return _vsnprintf(XPRINTF_PLAIN, NULL, str, n, loc, fmt, ap); +} + +int +vsnprintf(char * __restrict str, size_t n, const char * __restrict fmt, + __va_list ap) +{ + return _vsnprintf(XPRINTF_PLAIN, NULL, str, n, __current_locale(), fmt, ap); +} diff --git a/stdio/FreeBSD/vsprintf.c b/stdio/FreeBSD/vsprintf.c new file mode 100644 index 0000000..9ec7b24 --- /dev/null +++ b/stdio/FreeBSD/vsprintf.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vsprintf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vsprintf.c,v 1.16 2008/04/17 22:17:54 jhb Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include "local.h" + +int +vsprintf_l(char * __restrict str, locale_t loc, const char * __restrict fmt, __va_list ap) +{ + int ret; + FILE f; + struct __sFILEX ext; + f._extra = &ext; + INITEXTRA(&f); + + f._file = -1; + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *)str; + f._bf._size = f._w = INT_MAX; + f._orientation = 0; + memset(&f._mbstate, 0, sizeof(mbstate_t)); + ret = __v2printf(XPRINTF_PLAIN, NULL, &f, loc, fmt, ap); + *f._p = 0; + return (ret); +} + +int +vsprintf(char * __restrict str, const char * __restrict fmt, __va_list ap) +{ + return vsprintf_l(str, __current_locale(), fmt, ap); +} diff --git a/stdio/FreeBSD/vsscanf.c b/stdio/FreeBSD/vsscanf.c new file mode 100644 index 0000000..7144259 --- /dev/null +++ b/stdio/FreeBSD/vsscanf.c @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Donn Seeley at UUNET Technologies, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vsscanf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vsscanf.c,v 1.14 2008/04/17 22:17:54 jhb Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include "local.h" + +static int +eofread(void *, char *, int); + +/* ARGSUSED */ +static int +eofread(cookie, buf, len) + void *cookie; + char *buf; + int len; +{ + + return (0); +} + +int +vsscanf_l(str, loc, fmt, ap) + const char * __restrict str; + locale_t loc; + const char * __restrict fmt; + __va_list ap; +{ + FILE f; + struct __sFILEX ext; + f._extra = &ext; + INITEXTRA(&f); + + f._file = -1; + f._flags = __SRD; + f._bf._base = f._p = (unsigned char *)str; + f._bf._size = f._r = strlen(str); + f._read = eofread; + f._ub._base = NULL; + f._lb._base = NULL; + f._orientation = 0; + memset(&f._mbstate, 0, sizeof(mbstate_t)); + return (__svfscanf_l(&f, loc, fmt, ap)); +} + +int +vsscanf(str, fmt, ap) + const char * __restrict str; + const char * __restrict fmt; + __va_list ap; +{ + return vsscanf_l(str, __current_locale(), fmt, ap); +} + diff --git a/stdio/FreeBSD/vswprintf.c b/stdio/FreeBSD/vswprintf.c new file mode 100644 index 0000000..9129639 --- /dev/null +++ b/stdio/FreeBSD/vswprintf.c @@ -0,0 +1,108 @@ +/* $OpenBSD: vasprintf.c,v 1.4 1998/06/21 22:13:47 millert Exp $ */ + +/* + * Copyright (c) 1997 Todd C. Miller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#if 0 +__FBSDID("FreeBSD: src/lib/libc/stdio/vasprintf.c,v 1.16 2002/08/21 16:19:57 mike Exp "); +#endif +__FBSDID("$FreeBSD: src/lib/libc/stdio/vswprintf.c,v 1.7 2008/04/17 22:17:54 jhb Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "local.h" + +int +vswprintf_l(wchar_t * __restrict s, size_t n, locale_t loc, + const wchar_t * __restrict fmt, __va_list ap) +{ + static const mbstate_t initial; + mbstate_t mbs; + FILE f; + char *mbp; + int ret, sverrno; + size_t nwc; + struct __sFILEX ext; + f._extra = &ext; + INITEXTRA(&f); + + NORMALIZE_LOCALE(loc); + if (n == 0) { + errno = EINVAL; + return (-1); + } + + f._file = -1; + f._flags = __SWR | __SSTR | __SALC; + f._bf._base = f._p = (unsigned char *)malloc(128); + if (f._bf._base == NULL) { + errno = ENOMEM; + return (-1); + } + f._bf._size = f._w = 127; /* Leave room for the NUL */ + f._orientation = 0; + memset(&f._mbstate, 0, sizeof(mbstate_t)); + ret = __vfwprintf(&f, loc, fmt, ap); + if (ret < 0) { + sverrno = errno; + free(f._bf._base); + errno = sverrno; + return (-1); + } + *f._p = '\0'; + mbp = (char*)f._bf._base; + /* + * XXX Undo the conversion from wide characters to multibyte that + * fputwc() did in __vfwprintf(). + */ + mbs = initial; + nwc = mbsrtowcs_l(s, (const char **)&mbp, n, &mbs, loc); + free(f._bf._base); + if (nwc == (size_t)-1) { + errno = EILSEQ; + return (-1); + } + if (nwc == n) { + s[n - 1] = L'\0'; + errno = EOVERFLOW; + return (-1); + } + + return (ret); +} + +int +vswprintf(wchar_t * __restrict s, size_t n, + const wchar_t * __restrict fmt, __va_list ap) +{ + return vswprintf_l(s, n, __current_locale(), fmt, ap); +} diff --git a/stdio/FreeBSD/vswscanf.c b/stdio/FreeBSD/vswscanf.c new file mode 100644 index 0000000..d688164 --- /dev/null +++ b/stdio/FreeBSD/vswscanf.c @@ -0,0 +1,110 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Donn Seeley at UUNET Technologies, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vsscanf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +__FBSDID("FreeBSD: src/lib/libc/stdio/vsscanf.c,v 1.11 2002/08/21 16:19:57 mike Exp "); +#endif +__FBSDID("$FreeBSD: src/lib/libc/stdio/vswscanf.c,v 1.6 2009/01/15 18:53:52 rdivacky Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include "local.h" + +static int eofread(void *, char *, int); + +static int +eofread(void *cookie, char *buf, int len) +{ + + return (0); +} + +int +vswscanf_l(const wchar_t * __restrict str, locale_t loc, const wchar_t * __restrict fmt, + va_list ap) +{ + static const mbstate_t initial; + mbstate_t mbs; + FILE f; + char *mbstr; + size_t mlen; + int r; + const wchar_t *strp; + struct __sFILEX ext; + f._extra = &ext; + INITEXTRA(&f); + + NORMALIZE_LOCALE(loc); + /* + * XXX Convert the wide character string to multibyte, which + * __vfwscanf() will convert back to wide characters. + */ + if ((mbstr = malloc(wcslen(str) * MB_CUR_MAX_L(loc) + 1)) == NULL) + return (EOF); + mbs = initial; + strp = str; + if ((mlen = wcsrtombs_l(mbstr, &strp, SIZE_T_MAX, &mbs, loc)) == (size_t)-1) { + free(mbstr); + return (EOF); + } + f._file = -1; + f._flags = __SRD; + f._bf._base = f._p = (unsigned char *)mbstr; + f._bf._size = f._r = mlen; + f._read = eofread; + f._ub._base = NULL; + f._lb._base = NULL; + f._orientation = 0; + memset(&f._mbstate, 0, sizeof(mbstate_t)); + r = __vfwscanf(&f, loc, fmt, ap); + free(mbstr); + + return (r); +} + +int +vswscanf(const wchar_t * __restrict str, const wchar_t * __restrict fmt, + va_list ap) +{ + return vswscanf_l(str, __current_locale(), fmt, ap); +} + diff --git a/stdio/FreeBSD/vwprintf.c b/stdio/FreeBSD/vwprintf.c new file mode 100644 index 0000000..634f06d --- /dev/null +++ b/stdio/FreeBSD/vwprintf.c @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vwprintf.c,v 1.1 2002/09/21 13:00:30 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +int +vwprintf(const wchar_t * __restrict fmt, va_list ap) +{ + + return (vfwprintf_l(stdout, __current_locale(), fmt, ap)); +} + +int +vwprintf_l(locale_t loc, const wchar_t * __restrict fmt, va_list ap) +{ + + /* no need to call NORMALIZE_LOCALE(loc) because vfwprintf_l will */ + return (vfwprintf_l(stdout, loc, fmt, ap)); +} diff --git a/stdio/FreeBSD/vwscanf.c b/stdio/FreeBSD/vwscanf.c new file mode 100644 index 0000000..3b2fb28 --- /dev/null +++ b/stdio/FreeBSD/vwscanf.c @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/vwscanf.c,v 1.1 2002/09/23 12:40:06 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +int +vwscanf(const wchar_t * __restrict fmt, va_list ap) +{ + + return (vfwscanf_l(stdin, __current_locale(), fmt, ap)); +} + +int +vwscanf_l(locale_t loc, const wchar_t * __restrict fmt, va_list ap) +{ + + /* no need to call NORMALIZE_LOCALE(loc) because vfwscanf_l will */ + return (vfwscanf_l(stdin, loc, fmt, ap)); +} diff --git a/stdio/FreeBSD/wbuf.c b/stdio/FreeBSD/wbuf.c new file mode 100644 index 0000000..9e9b59e --- /dev/null +++ b/stdio/FreeBSD/wbuf.c @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)wbuf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/wbuf.c,v 1.12 2007/01/09 00:28:08 imp Exp $"); + +#include +#include +#include "local.h" + +/* + * Write the given character into the (probably full) buffer for + * the given file. Flush the buffer out if it is or becomes full, + * or if c=='\n' and the file is line buffered. + * + * Non-MT-safe + */ +int +__swbuf(c, fp) + int c; + FILE *fp; +{ + int n; + + /* + * In case we cannot write, or longjmp takes us out early, + * make sure _w is 0 (if fully- or un-buffered) or -_bf._size + * (if line buffered) so that we will get called again. + * If we did not do this, a sufficient number of putc() + * calls might wrap _w from negative to positive. + */ + fp->_w = fp->_lbfsize; + if (prepwrite(fp) != 0) { + errno = EBADF; + return (EOF); + } + c = (unsigned char)c; + + ORIENT(fp, -1); + + /* + * If it is completely full, flush it out. Then, in any case, + * stuff c into the buffer. If this causes the buffer to fill + * completely, or if c is '\n' and the file is line buffered, + * flush it (perhaps a second time). The second flush will always + * happen on unbuffered streams, where _bf._size==1; fflush() + * guarantees that putc() will always call wbuf() by setting _w + * to 0, so we need not do anything else. + */ + n = fp->_p - fp->_bf._base; + if (n >= fp->_bf._size) { + if (__fflush(fp)) + return (EOF); + n = 0; + } + fp->_w--; + *fp->_p++ = c; + if (++n == fp->_bf._size || (fp->_flags & __SLBF && c == '\n')) + if (__fflush(fp)) + return (EOF); + return (c); +} diff --git a/stdio/FreeBSD/wprintf.3 b/stdio/FreeBSD/wprintf.3 new file mode 100644 index 0000000..12a3bea --- /dev/null +++ b/stdio/FreeBSD/wprintf.3 @@ -0,0 +1,637 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)printf.3 8.1 (Berkeley) 6/4/93 +.\" FreeBSD: src/lib/libc/stdio/printf.3,v 1.47 2002/09/06 11:23:55 tjr Exp +.\" $FreeBSD$ +.\" +.Dd July 5, 2003 +.Dt WPRINTF 3 +.Os +.Sh NAME +.Nm wprintf , fwprintf , swprintf , +.Nm vwprintf , vfwprintf , vswprintf +.Nd formatted wide character output conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft int +.Fn fwprintf "FILE * restrict stream" "const wchar_t * restrict format" ... +.Ft int +.Fn swprintf "wchar_t * restrict ws" "size_t n" "const wchar_t * restrict format" ... +.Ft int +.Fn wprintf "const wchar_t * restrict format" ... +.In stdarg.h +.Ft int +.Fn vfwprintf "FILE * restrict stream" "const wchar_t * restrict" "va_list ap" +.Ft int +.Fn vswprintf "wchar_t * restrict ws" "size_t n" "const wchar_t *restrict format" "va_list ap" +.Ft int +.Fn vwprintf "const wchar_t * restrict format" "va_list ap" +.Sh DESCRIPTION +The +.Fn wprintf +family of functions produces output according to a +.Fa format +as described below. +The +.Fn wprintf +and +.Fn vwprintf +functions +write output to +.Dv stdout , +the standard output stream; +.Fn fwprintf +and +.Fn vfwprintf +write output to the given output +.Fa stream ; +.Fn swprintf +and +.Fn vswprintf +write to the wide character string +.Fa ws . +.Pp +Extended locale versions of these functions are documented in +.Xr wprintf_l 3 . +See +.Xr xlocale 3 +for more information. +.Pp +These functions write the output under the control of a +.Fa format +string that specifies how subsequent arguments +(or arguments accessed via the variable-length argument facilities of +.Xr stdarg 3 ) +are converted for output. +.Pp +These functions return the number of characters printed +(not including the trailing +.Ql \e0 , +used to end output to strings). +.Pp +The +.Fn swprintf +and +.Fn vswprintf +functions return the number of characters written (not including the terminating +null wide character). +These functions will fail (returning a negative value and setting +.Va errno +appropriately) if +.Fa n +or more wide characters were requested to be written. +.Pp +The other functions return the number of wide characters printed on success, or +a negative value on faiure, setting +.Va errno +to indicate the error. +.Pp +The format string is composed of zero or more directives: +ordinary +characters (not +.Cm % ) , +which are copied unchanged to the output stream; +and conversion specifications, each of which results +in fetching zero or more subsequent arguments. +Each conversion specification is introduced by +the +.Cm % +character. +The arguments must correspond properly (after type promotion) +with the conversion specifier. +After the +.Cm % , +the following appear in sequence: +.Bl -bullet +.It +An optional field, consisting of a decimal digit string followed by a +.Cm $ , +specifying the next argument to access. +If this field is not provided, the argument following the last +argument accessed will be used. +Arguments are numbered starting at +.Cm 1 . +If unaccessed arguments in the format string are interspersed with ones that +are accessed the results will be indeterminate. +.It +Zero or more of the following flags: +.Bl -tag -width ".So \ Sc (space)" +.It Sq Cm # +The value should be converted to an +.Dq alternate form . +For +.Cm c , d , i , n , p , s , +and +.Cm u +conversions, this option has no effect. +For +.Cm o +conversions, the precision of the number is increased to force the first +character of the output string to a zero (except if a zero value is printed +with an explicit precision of zero). +For +.Cm x +and +.Cm X +conversions, a non-zero result has the string +.Ql 0x +(or +.Ql 0X +for +.Cm X +conversions) prepended to it. +For +.Cm a , A , e , E , f , F , g , +and +.Cm G +conversions, the result will always contain a decimal point, even if no +digits follow it (normally, a decimal point appears in the results of +those conversions only if a digit follows). +For +.Cm g +and +.Cm G +conversions, trailing zeros are not removed from the result as they +would otherwise be. +.It So Cm 0 Sc (zero) +Zero padding. +For all conversions except +.Cm n , +the converted value is padded on the left with zeros rather than blanks. +If a precision is given with a numeric conversion +.Cm ( d , i , o , u , i , x , +and +.Cm X ) , +the +.Cm 0 +flag is ignored. +.It Sq Cm \- +A negative field width flag; +the converted value is to be left adjusted on the field boundary. +Except for +.Cm n +conversions, the converted value is padded on the right with blanks, +rather than on the left with blanks or zeros. +A +.Cm \- +overrides a +.Cm 0 +if both are given. +.It So "\ " Sc (space) +A blank should be left before a positive number +produced by a signed conversion +.Cm ( a , A , d , e , E , f , F , g , G , +or +.Cm i ) . +.It Sq Cm + +A sign must always be placed before a +number produced by a signed conversion. +A +.Cm + +overrides a space if both are used. +.It Sq Cm ' +Decimal conversions +.Cm ( d , u , +or +.Cm i ) +or the integral portion of a floating point conversion +.Cm ( f +or +.Cm F ) +should be grouped and separated by thousands using +the non-monetary separator returned by +.Xr localeconv 3 . +.El +.It +An optional decimal digit string specifying a minimum field width. +If the converted value has fewer characters than the field width, it will +be padded with spaces on the left (or right, if the left-adjustment +flag has been given) to fill out +the field width. +.It +An optional precision, in the form of a period +.Cm \&. +followed by an +optional digit string. +If the digit string is omitted, the precision is taken as zero. +This gives the minimum number of digits to appear for +.Cm d , i , o , u , x , +and +.Cm X +conversions, the number of digits to appear after the decimal-point for +.Cm a , A , e , E , f , +and +.Cm F +conversions, the maximum number of significant digits for +.Cm g +and +.Cm G +conversions, or the maximum number of characters to be printed from a +string for +.Cm s +conversions. +.It +An optional length modifier, that specifies the size of the argument. +The following length modifiers are valid for the +.Cm d , i , n , o , u , x , +or +.Cm X +conversion: +.Bl -column ".Cm q Em (deprecated)" ".Vt signed char" ".Vt unsigned long long" ".Vt long long *" +.It Sy Modifier Ta Cm d , i Ta Cm o , u , x , X Ta Cm n +.It Cm hh Ta Vt "signed char" Ta Vt "unsigned char" Ta Vt "signed char *" +.It Cm h Ta Vt short Ta Vt "unsigned short" Ta Vt "short *" +.It Cm l No (ell) Ta Vt long Ta Vt "unsigned long" Ta Vt "long *" +.It Cm ll No (ell ell) Ta Vt "long long" Ta Vt "unsigned long long" Ta Vt "long long *" +.It Cm j Ta Vt intmax_t Ta Vt uintmax_t Ta Vt "intmax_t *" +.It Cm t Ta Vt ptrdiff_t Ta (see note) Ta Vt "ptrdiff_t *" +.It Cm z Ta (see note) Ta Vt size_t Ta (see note) +.It Cm q Em (deprecated) Ta Vt quad_t Ta Vt u_quad_t Ta Vt "quad_t *" +.El +.Pp +Note: +the +.Cm t +modifier, when applied to a +.Cm o , u , x , +or +.Cm X +conversion, indicates that the argument is of an unsigned type +equivalent in size to a +.Vt ptrdiff_t . +The +.Cm z +modifier, when applied to a +.Cm d +or +.Cm i +conversion, indicates that the argument is of a signed type equivalent in +size to a +.Vt size_t . +Similarly, when applied to an +.Cm n +conversion, it indicates that the argument is a pointer to a signed type +equivalent in size to a +.Vt size_t . +.Pp +The following length modifier is valid for the +.Cm a , A , e , E , f , F , g , +or +.Cm G +conversion: +.Bl -column ".Sy Modifier" ".Cm a , A , e , E , f , F , g , G" +.It Sy Modifier Ta Cm a , A , e , E , f , F , g , G +.It Cm L Ta Vt "long double" +.El +.Pp +The following length modifier is valid for the +.Cm c +or +.Cm s +conversion: +.Bl -column ".Sy Modifier" ".Vt wint_t" ".Vt wchar_t *" +.It Sy Modifier Ta Cm c Ta Cm s +.It Cm l No (ell) Ta Vt wint_t Ta Vt "wchar_t *" +.El +.It +A character that specifies the type of conversion to be applied. +.El +.Pp +A field width or precision, or both, may be indicated by +an asterisk +.Ql * +or an asterisk followed by one or more decimal digits and a +.Ql $ +instead of a +digit string. +In this case, an +.Vt int +argument supplies the field width or precision. +A negative field width is treated as a left adjustment flag followed by a +positive field width; a negative precision is treated as though it were +missing. +If a single format directive mixes positional +.Pq Li nn$ +and non-positional arguments, the results are undefined. +.Pp +The conversion specifiers and their meanings are: +.Bl -tag -width ".Cm diouxX" +.It Cm diouxX +The +.Vt int +(or appropriate variant) argument is converted to signed decimal +.Cm ( d +and +.Cm i ) , +unsigned octal +.Pq Cm o , +unsigned decimal +.Pq Cm u , +or unsigned hexadecimal +.Cm ( x +and +.Cm X ) +notation. +The letters +.Dq Li abcdef +are used for +.Cm x +conversions; the letters +.Dq Li ABCDEF +are used for +.Cm X +conversions. +The precision, if any, gives the minimum number of digits that must +appear; if the converted value requires fewer digits, it is padded on +the left with zeros. +.It Cm DOU +The +.Vt "long int" +argument is converted to signed decimal, unsigned octal, or unsigned +decimal, as if the format had been +.Cm ld , lo , +or +.Cm lu +respectively. +These conversion characters are deprecated, and will eventually disappear. +.It Cm eE +The +.Vt double +argument is rounded and converted in the style +.Sm off +.Oo \- Oc Ar d Li \&. Ar ddd Li e \(+- Ar dd +.Sm on +where there is one digit before the +decimal-point character +and the number of digits after it is equal to the precision; +if the precision is missing, +it is taken as 6; if the precision is +zero, no decimal-point character appears. +An +.Cm E +conversion uses the letter +.Ql E +(rather than +.Ql e ) +to introduce the exponent. +The exponent always contains at least two digits; if the value is zero, +the exponent is 00. +.Pp +For +.Cm a , A , e , E , f , F , g , +and +.Cm G +conversions, positive and negative infinity are represented as +.Li inf +and +.Li -inf +respectively when using the lowercase conversion character, and +.Li INF +and +.Li -INF +respectively when using the uppercase conversion character. +Similarly, NaN is represented as +.Li nan +when using the lowercase conversion, and +.Li NAN +when using the uppercase conversion. +.It Cm fF +The +.Vt double +argument is rounded and converted to decimal notation in the style +.Sm off +.Oo \- Oc Ar ddd Li \&. Ar ddd , +.Sm on +where the number of digits after the decimal-point character +is equal to the precision specification. +If the precision is missing, it is taken as 6; if the precision is +explicitly zero, no decimal-point character appears. +If a decimal point appears, at least one digit appears before it. +.It Cm gG +The +.Vt double +argument is converted in style +.Cm f +or +.Cm e +(or +.Cm F +or +.Cm E +for +.Cm G +conversions). +The precision specifies the number of significant digits. +If the precision is missing, 6 digits are given; if the precision is zero, +it is treated as 1. +Style +.Cm e +is used if the exponent from its conversion is less than \-4 or greater than +or equal to the precision. +Trailing zeros are removed from the fractional part of the result; a +decimal point appears only if it is followed by at least one digit. +.It Cm aA +The +.Vt double +argument is converted to hexadecimal notation in the style +.Sm off +.Oo \- Oc Li 0x Ar h Li \&. Ar hhhp Oo \(+- Oc Ar d , +.Sm on +where the number of digits after the hexadecimal-point character +is equal to the precision specification. +If the precision is missing, it is taken as enough to exactly +represent the floating-point number; if the precision is +explicitly zero, no hexadecimal-point character appears. +This is an exact conversion of the mantissa+exponent internal +floating point representation; the +.Sm off +.Oo \- Oc Li 0x Ar h Li \&. Ar hhh +.Sm on +portion represents exactly the mantissa; only denormalized +mantissas have a zero value to the left of the hexadecimal +point. +The +.Cm p +is a literal character +.Ql p ; +the exponent is preceded by a positive or negative sign +and is represented in decimal, using only enough characters +to represent the exponent. +The +.Cm A +conversion uses the prefix +.Dq Li 0X +(rather than +.Dq Li 0x ) , +the letters +.Dq Li ABCDEF +(rather than +.Dq Li abcdef ) +to represent the hex digits, and the letter +.Ql P +(rather than +.Ql p ) +to separate the mantissa and exponent. +.It Cm C +Treated as +.Cm c +with the +.Cm l +(ell) modifier. +.It Cm c +The +.Vt int +argument is converted to an +.Vt "unsigned char" , +then to a +.Vt wchar_t +as if by +.Xr btowc 3 , +and the resulting character is written. +.Pp +If the +.Cm l +(ell) modifier is used, the +.Vt wint_t +argument is converted to a +.Vt wchar_t +and written. +.It Cm S +Treated as +.Cm s +with the +.Cm l +(ell) modifier. +.It Cm s +The +.Vt "char *" +argument is expected to be a pointer to an array of character type (pointer +to a string) containing a multibyte sequence. +Characters from the array are converted to wide characters and written up to +(but not including) +a terminating +.Dv NUL +character; +if a precision is specified, no more than the number specified are +written. +If a precision is given, no null character +need be present; if the precision is not specified, or is greater than +the size of the array, the array must contain a terminating +.Dv NUL +character. +.Pp +If the +.Cm l +(ell) modifier is used, the +.Vt "wchar_t *" +argument is expected to be a pointer to an array of wide characters +(pointer to a wide string). +Each wide character in the string +is written. +Wide characters from the array are written up to (but not including) +a terminating wide +.Dv NUL +character; +if a precision is specified, no more than the number specified are +written (including shift sequences). +If a precision is given, no null character +need be present; if the precision is not specified, or is greater than +the number of characters in +the string, the array must contain a terminating wide +.Dv NUL +character. +.It Cm p +The +.Vt "void *" +pointer argument is printed in hexadecimal (as if by +.Ql %#x +or +.Ql %#lx ) . +.It Cm n +The number of characters written so far is stored into the +integer indicated by the +.Vt "int *" +(or variant) pointer argument. +No argument is converted. +.It Cm % +A +.Ql % +is written. +No argument is converted. +The complete conversion specification +is +.Ql %% . +.El +.Pp +The decimal point +character is defined in the program's locale (category +.Dv LC_NUMERIC ) . +.Pp +In no case does a non-existent or small field width cause truncation of +a numeric field; if the result of a conversion is wider than the field +width, the +field is expanded to contain the conversion result. +.Sh SECURITY CONSIDERATIONS +Refer to +.Xr printf 3 . +.Sh ERRORS +Refer to +.Xr printf 3 . +.Sh SEE ALSO +.Xr btowc 3 , +.Xr fputws 3 , +.Xr printf 3 , +.Xr putwc 3 , +.Xr setlocale 3 , +.Xr wcsrtombs 3 , +.Xr wprintf_l 3 , +.Xr wscanf 3 +.Sh STANDARDS +Subject to the caveats noted in the +.Sx BUGS +section +of +.Xr printf 3 , +the +.Fn wprintf , +.Fn fwprintf , +.Fn swprintf , +.Fn vwprintf , +.Fn vfwprintf +and +.Fn vswprintf +functions +conform to +.St -isoC-99 . diff --git a/stdio/FreeBSD/wprintf.c b/stdio/FreeBSD/wprintf.c new file mode 100644 index 0000000..42deed0 --- /dev/null +++ b/stdio/FreeBSD/wprintf.c @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/wprintf.c,v 1.1 2002/09/21 13:00:30 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +int +wprintf(const wchar_t * __restrict fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vfwprintf_l(stdout, __current_locale(), fmt, ap); + va_end(ap); + + return (ret); +} + +int +wprintf_l(locale_t loc, const wchar_t * __restrict fmt, ...) +{ + int ret; + va_list ap; + + /* no need to call NORMALIZE_LOCALE(loc) because vfwprintf_l will */ + va_start(ap, fmt); + ret = vfwprintf_l(stdout, loc, fmt, ap); + va_end(ap); + + return (ret); +} diff --git a/stdio/FreeBSD/wscanf.3 b/stdio/FreeBSD/wscanf.3 new file mode 100644 index 0000000..54fa5d6 --- /dev/null +++ b/stdio/FreeBSD/wscanf.3 @@ -0,0 +1,509 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)scanf.3 8.2 (Berkeley) 12/11/93 +.\" FreeBSD: src/lib/libc/stdio/scanf.3,v 1.24 2003/06/28 09:03:25 das Exp +.\" $FreeBSD: src/lib/libc/stdio/wscanf.3,v 1.7 2007/01/09 00:28:08 imp Exp $ +.\" +.Dd July 5, 2003 +.Dt WSCANF 3 +.Os +.Sh NAME +.Nm fwscanf , +.Nm swscanf , +.Nm vfwscanf , +.Nm vswscanf , +.Nm vwscanf , +.Nm wscanf +.Nd wide character input format conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.Ft int +.Fo fwscanf +.Fa "FILE *restrict stream" +.Fa "const wchar_t *restrict format" +.Fa ... +.Fc +.Ft int +.Fo swscanf +.Fa "const wchar_t *restrict ws" +.Fa "const wchar_t *restrict format" +.Fa ... +.Fc +.Ft int +.Fo wscanf +.Fa "const wchar_t *restrict format" +.Fa ... +.Fc +.In stdarg.h +.In stdio.h +.In wchar.h +.Ft int +.Fo vfwscanf +.Fa "FILE *restrict stream" +.Fa "const wchar_t *restrict format" +.Fa "va_list arg" +.Fc +.Ft int +.Fo vswscanf +.Fa "const wchar_t *restrict ws" +.Fa "const wchar_t *restrict format" +.Fa "va_list arg" +.Fc +.Ft int +.Fo vwscanf +.Fa "const wchar_t *restrict format" +.Fa "va_list arg" +.Fc +.Sh DESCRIPTION +The +.Fn wscanf +family of functions scans input, according to a +.Fa format +as described below. +This format may contain +.Em conversion specifiers ; +the results from such conversions, if any, +are stored through the +.Em pointer +arguments. +The +.Fn wscanf +function +reads input from the standard input stream +.Dv stdin , +.Fn fwscanf +reads input from the stream pointer +.Fa stream , +and +.Fn swscanf +reads its input from the wide character string pointed to by +.Fa ws . +.Pp +The +.Fn vfwscanf +function +is analogous to +.Xr vfwprintf 3 +and reads input from the stream pointer +.Fa stream +using a variable argument list of pointers (see +.Xr stdarg 3 ) . +The +.Fn vwscanf +function scans a variable argument list from the standard input and +the +.Fn vswscanf +function scans it from a wide character string; +these are analogous to +the +.Fn vwprintf +and +.Fn vswprintf +functions respectively. +Each successive +.Em pointer +argument must correspond properly with +each successive conversion specifier +(but see the +.Cm * +conversion below). +All conversions are introduced by the +.Cm % +(percent sign) character. +.Pp +The +.Fa format +string +may also contain other characters. +White space (such as blanks, tabs, or newlines) in the +.Fa format +string match any amount of white space, including none, in the input. +Everything else +matches only itself. +Scanning stops +when an input character does not match such a format character. +Scanning also stops +when an input conversion cannot be made (see below). +.Pp +Extended locale versions of these functions are documented in +.Xr wscanf_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh CONVERSIONS +Following the +.Cm % +character introducing a conversion, +there may be a number of +.Em flag +characters, as follows: +.Bl -tag -width ".Cm l No (ell)" +.It Cm * +Suppresses assignment. +The conversion that follows occurs as usual, but no pointer is used; +the result of the conversion is simply discarded. +.It Cm hh +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt char +(rather than +.Vt int ) . +.It Cm h +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt "short int" +(rather than +.Vt int ) . +.It Cm l No (ell) +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt "long int" +(rather than +.Vt int ) , +that the conversion will be one of +.Cm a , e , f , +or +.Cm g +and the next pointer is a pointer to +.Vt double +(rather than +.Vt float ) , +or that the conversion will be one of +.Cm c +or +.Cm s +and the next pointer is a pointer to an array of +.Vt wchar_t +(rather than +.Vt char ) . +.It Cm ll No (ell ell) +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt "long long int" +(rather than +.Vt int ) . +.It Cm L +Indicates that the conversion will be one of +.Cm a , e , f , +or +.Cm g +and the next pointer is a pointer to +.Vt "long double" . +.It Cm j +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt intmax_t +(rather than +.Vt int ) . +.It Cm t +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt ptrdiff_t +(rather than +.Vt int ) . +.It Cm z +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt size_t +(rather than +.Vt int ) . +.It Cm q +(deprecated.) +Indicates that the conversion will be one of +.Cm dioux +or +.Cm n +and the next pointer is a pointer to a +.Vt "long long int" +(rather than +.Vt int ) . +.El +.Pp +In addition to these flags, +there may be an optional maximum field width, +expressed as a decimal integer, +between the +.Cm % +and the conversion. +If no width is given, +a default of +.Dq infinity +is used (with one exception, below); +otherwise at most this many characters are scanned +in processing the conversion. +Before conversion begins, +most conversions skip white space; +this white space is not counted against the field width. +.Pp +The following conversions are available: +.Bl -tag -width XXXX +.It Cm % +Matches a literal +.Ql % . +That is, +.Dq Li %% +in the format string +matches a single input +.Ql % +character. +No conversion is done, and assignment does not occur. +.It Cm d +Matches an optionally signed decimal integer; +the next pointer must be a pointer to +.Vt int . +.It Cm i +Matches an optionally signed integer; +the next pointer must be a pointer to +.Vt int . +The integer is read in base 16 if it begins +with +.Ql 0x +or +.Ql 0X , +in base 8 if it begins with +.Ql 0 , +and in base 10 otherwise. +Only characters that correspond to the base are used. +.It Cm o +Matches an octal integer; +the next pointer must be a pointer to +.Vt "unsigned int" . +.It Cm u +Matches an optionally signed decimal integer; +the next pointer must be a pointer to +.Vt "unsigned int" . +.It Cm x , X +Matches an optionally signed hexadecimal integer; +the next pointer must be a pointer to +.Vt "unsigned int" . +.It Cm a , A , e , E , f , F , g , G +Matches a floating-point number in the style of +.Xr wcstod 3 . +The next pointer must be a pointer to +.Vt float +(unless +.Cm l +or +.Cm L +is specified.) +.It Cm s +Matches a sequence of non-white-space wide characters; +the next pointer must be a pointer to +.Vt char , +and the array must be large enough to accept the multibyte representation +of all the sequence and the +terminating +.Dv NUL +character. +The input string stops at white space +or at the maximum field width, whichever occurs first. +.Pp +If an +.Cm l +qualifier is present, the next pointer must be a pointer to +.Vt wchar_t , +into which the input will be placed. +.It Cm S +The same as +.Cm ls . +.It Cm c +Matches a sequence of +.Em width +count +wide characters (default 1); +the next pointer must be a pointer to +.Vt char , +and there must be enough room for the multibyte representation +of all the characters +(no terminating +.Dv NUL +is added). +The usual skip of leading white space is suppressed. +To skip white space first, use an explicit space in the format. +.Pp +If an +.Cm l +qualifier is present, the next pointer must be a pointer to +.Vt wchar_t , +into which the input will be placed. +.It Cm C +The same as +.Cm lc . +.It Cm \&[ +Matches a nonempty sequence of characters from the specified set +of accepted characters; +the next pointer must be a pointer to +.Vt char , +and there must be enough room for the multibyte representation of +all the characters in the string, +plus a terminating +.Dv NUL +character. +The usual skip of leading white space is suppressed. +The string is to be made up of characters in +(or not in) +a particular set; +the set is defined by the characters between the open bracket +.Cm [ +character +and a close bracket +.Cm ] +character. +The set +.Em excludes +those characters +if the first character after the open bracket is a circumflex +.Cm ^ . +To include a close bracket in the set, +make it the first character after the open bracket +or the circumflex; +any other position will end the set. +To include a hyphen in the set, +make it the last character before the final close bracket; +some implementations of +.Fn wscanf +use +.Dq Li A-Z +to represent the range of characters between +.Ql A +and +.Ql Z . +The string ends with the appearance of a character not in the +(or, with a circumflex, in) set +or when the field width runs out. +.Pp +If an +.Cm l +qualifier is present, the next pointer must be a pointer to +.Vt wchar_t , +into which the input will be placed. +.It Cm p +Matches a pointer value (as printed by +.Ql %p +in +.Xr wprintf 3 ) ; +the next pointer must be a pointer to +.Vt void . +.It Cm n +Nothing is expected; +instead, the number of characters consumed thus far from the input +is stored through the next pointer, +which must be a pointer to +.Vt int . +This is +.Em not +a conversion, although it can be suppressed with the +.Cm * +flag. +.El +.Pp +The decimal point +character is defined in the program's locale (category +.Dv LC_NUMERIC ) . +.Pp +For backwards compatibility, a +.Dq conversion +of +.Ql %\e0 +causes an immediate return of +.Dv EOF . +.Sh RETURN VALUES +These functions return the number of input items assigned, +which can be fewer than provided for, or even zero, +in the event of a matching failure. +Zero indicates that, while there was input available, +no conversions were assigned; +typically, this is due to an invalid input character, +such as an alphabetic character for a +.Ql %d +conversion. +The value +.Dv EOF +is returned if an input failure occurs before any conversion such as an +end-of-file occurs. +If an error or end-of-file occurs after conversion +has begun, +the number of conversions which were successfully completed is returned. +.Sh SEE ALSO +.Xr fgetwc 3 , +.Xr scanf 3 , +.Xr wcrtomb 3 , +.Xr wcstod 3 , +.Xr wcstol 3 , +.Xr wcstoul 3 , +.Xr wprintf 3 , +.Xr wscanf_l 3 +.Sh STANDARDS +The +.Fn fwscanf , +.Fn wscanf , +.Fn swscanf , +.Fn vfwscanf , +.Fn vwscanf , +and +.Fn vswscanf +functions +conform to +.St -isoC-99 . +.Sh BUGS +In addition to the bugs documented in +.Xr scanf 3 , +.Fn wscanf +does not support the +.Dq Li A-Z +notation for specifying character ranges with the character +class conversion +.Pq Sq Cm %[ . diff --git a/stdio/FreeBSD/wscanf.c b/stdio/FreeBSD/wscanf.c new file mode 100644 index 0000000..99dc48d --- /dev/null +++ b/stdio/FreeBSD/wscanf.c @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/wscanf.c,v 1.1 2002/09/23 12:40:06 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include + +int +wscanf(const wchar_t * __restrict fmt, ...) +{ + va_list ap; + int r; + + va_start(ap, fmt); + r = vfwscanf_l(stdin, __current_locale(), fmt, ap); + va_end(ap); + + return (r); +} + +int +wscanf_l(locale_t loc, const wchar_t * __restrict fmt, ...) +{ + va_list ap; + int r; + + /* no need to call NORMALIZE_LOCALE(loc) because vfwscanf_l will */ + va_start(ap, fmt); + r = vfwscanf_l(stdin, loc, fmt, ap); + va_end(ap); + + return (r); +} diff --git a/stdio/FreeBSD/wsetup.c b/stdio/FreeBSD/wsetup.c new file mode 100644 index 0000000..b0bdfb4 --- /dev/null +++ b/stdio/FreeBSD/wsetup.c @@ -0,0 +1,92 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)wsetup.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdio/wsetup.c,v 1.11 2009/01/08 06:38:06 das Exp $"); + +#include +#include +#include +#include "local.h" + +/* + * Various output routines call wsetup to be sure it is safe to write, + * because either _flags does not include __SWR, or _buf is NULL. + * _wsetup returns 0 if OK to write; otherwise, it returns EOF and sets errno. + */ +int +__swsetup(fp) + FILE *fp; +{ + /* make sure stdio is set up */ + pthread_once(&__sdidinit, __sinit); + + /* + * If we are not writing, we had better be reading and writing. + */ + if ((fp->_flags & __SWR) == 0) { + if ((fp->_flags & __SRW) == 0) { + errno = EBADF; + fp->_flags |= __SERR; + return (EOF); + } + if (fp->_flags & __SRD) { + /* clobber any ungetc data */ + if (HASUB(fp)) + FREEUB(fp); + fp->_flags &= ~(__SRD|__SEOF); + fp->_r = 0; + fp->_p = fp->_bf._base; + } + fp->_flags |= __SWR; + } + + /* + * Make a buffer if necessary, then set _w. + */ + if (fp->_bf._base == NULL) + __smakebuf(fp); + if (fp->_flags & __SLBF) { + /* + * It is line buffered, so make _lbfsize be -_bufsize + * for the putc() macro. We will change _lbfsize back + * to 0 whenever we turn off __SWR. + */ + fp->_w = 0; + fp->_lbfsize = -fp->_bf._size; + } else + fp->_w = fp->_flags & __SNBF ? 0 : fp->_bf._size; + return (0); +} diff --git a/stdio/FreeBSD/xprintf.c b/stdio/FreeBSD/xprintf.c new file mode 100644 index 0000000..772155d --- /dev/null +++ b/stdio/FreeBSD/xprintf.c @@ -0,0 +1,1199 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/xprintf.c,v 1.9 2010/03/11 17:03:32 jhb Exp $ + */ + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +//#define MACHTIME +#ifdef MACHTIME +#include +#endif // MACHTIME + +#ifdef XPRINTF_PERF +#include +#endif /* XPRINTF_PERF */ + +#include "local.h" +#include "xprintf_private.h" +#include "xprintf_domain.h" +#include "fvwrite.h" + +/* + * Defining XPRINTF_DEBUG allows the __private_extern__ variable __use_xprintf + * to be set so that regular printf variants will use the extensible printf + * code path. This is normally off, and is only used to test the extensible + * printf code in the conformance tests. + */ +#ifdef XPRINTF_DEBUG +#include +int __use_xprintf = 0; +#endif + +/* private stuff -----------------------------------------------------*/ + +union arg { + int intarg; + long longarg; + intmax_t intmaxarg; +#ifndef NO_FLOATING_POINT + double doublearg; + long double longdoublearg; +#endif + wint_t wintarg; + char *pchararg; + wchar_t *pwchararg; + void *pvoidarg; +#ifdef VECTORS + VECTORTYPE vectorarg; + unsigned char vuchararg[16]; + signed char vchararg[16]; + unsigned short vushortarg[8]; + signed short vshortarg[8]; + unsigned int vuintarg[4]; + signed int vintarg[4]; + float vfloatarg[4]; +#ifdef V64TYPE + double vdoublearg[2]; + unsigned long long vulonglongarg[2]; + long long vlonglongarg[2]; +#endif /* V64TYPE */ +#endif /* VECTORS */ +}; + +/* + * Macros for converting digits to letters and vice versa + */ +#define to_digit(c) ((c) - '0') +#define is_digit(c) (((unsigned)to_digit(c)) <= 9) + +/* various globals ---------------------------------------------------*/ + +__private_extern__ const char __lowercase_hex[17] = "0123456789abcdef?"; /*lint !e784 */ +__private_extern__ const char __uppercase_hex[17] = "0123456789ABCDEF?"; /*lint !e784 */ + +#define PADSIZE 16 +static char blanks[PADSIZE] = + {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; +static char zeroes[PADSIZE] = + {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + +/* printing and padding functions ------------------------------------*/ + +#define NIOV 8 + +struct __printf_io { + FILE *fp; + struct __suio uio; + struct __siov iov[NIOV]; + struct __siov *iovp; +}; + +static void +__printf_init(struct __printf_io *io) +{ + + io->uio.uio_iov = io->iovp = &io->iov[0]; + io->uio.uio_resid = 0; + io->uio.uio_iovcnt = 0; +} + +__private_extern__ void +__printf_flush(struct __printf_io *io) +{ + + __sfvwrite(io->fp, &io->uio); + __printf_init(io); +} + +__private_extern__ int +__printf_puts(struct __printf_io *io, const void *ptr, int len) +{ + + +#if 0 + if (io->fp->_flags & __SERR) + return (0); +#endif + if (len == 0) + return (0); + io->iovp->iov_base = __DECONST(void *, ptr); + io->iovp->iov_len = len; + io->uio.uio_resid += len; + io->iovp++; + io->uio.uio_iovcnt++; + if (io->uio.uio_iovcnt >= NIOV) + __printf_flush(io); + return (len); +} + +__private_extern__ int +__printf_pad(struct __printf_io *io, int howmany, int zero) +{ + int n; + const char *with; + int ret = 0; + + if (zero) + with = zeroes; + else + with = blanks; + + if ((n = (howmany)) > 0) { + while (n > PADSIZE) { + ret += __printf_puts(io, with, PADSIZE); + n -= PADSIZE; + } + ret += __printf_puts(io, with, n); + } + return (ret); +} + +__private_extern__ int +__printf_out(struct __printf_io *io, const struct printf_info *pi, const void *ptr, int len) +{ + int ret = 0; + + if ((!pi->left) && pi->width > len) + ret += __printf_pad(io, pi->width - len, pi->pad == '0'); + ret += __printf_puts(io, ptr, len); + if (pi->left && pi->width > len) + ret += __printf_pad(io, pi->width - len, pi->pad == '0'); + return (ret); +} + + +/* percent handling -------------------------------------------------*/ + +__private_extern__ int +__printf_arginfo_pct(const struct printf_info *pi __unused, size_t n __unused, int *argt __unused) +{ + + return (0); +} + +__private_extern__ int +__printf_render_pct(struct __printf_io *io, const struct printf_info *pi __unused, const void *const *arg __unused) +{ + + return (__printf_puts(io, "%", 1)); +} + +/* 'n' ---------------------------------------------------------------*/ + +__private_extern__ int +__printf_arginfo_n(const struct printf_info *pi, size_t n, int *argt) +{ + + assert(n >= 1); + argt[0] = PA_POINTER; + return (1); +} + +/* + * This is a printf_render so that all output has been flushed before it + * gets called. + */ + +__private_extern__ int +__printf_render_n(FILE *io __unused, const struct printf_info *pi, const void *const *arg) +{ + + if (pi->is_char) + **((signed char **)arg[0]) = (signed char)pi->sofar; + else if (pi->is_short) + **((short **)arg[0]) = (short)pi->sofar; + else if (pi->is_long) + **((long **)arg[0]) = pi->sofar; + else if (pi->is_long_double) + **((long long **)arg[0]) = pi->sofar; + else if (pi->is_intmax) + **((intmax_t **)arg[0]) = pi->sofar; + else if (pi->is_ptrdiff) + **((ptrdiff_t **)arg[0]) = pi->sofar; + else if (pi->is_quad) + **((quad_t **)arg[0]) = pi->sofar; + else if (pi->is_size) + **((size_t **)arg[0]) = pi->sofar; + else + **((int **)arg[0]) = pi->sofar; + + return (0); +} + +/* dynamic array handling -------------------------------------------------*/ +#define ARRAYDELTA 8 + +struct array { +#ifdef XPRINTF_PERF + struct array *next; +#endif /* XPRINTF_PERF */ + void *data; + int itemsize; + int max; +}; + +#ifdef XPRINTF_PERF +__private_extern__ +#else /* !XPRINTF_PERF */ +static +#endif /* !XPRINTF_PERF */ +void +arrayfree(struct array *a) +{ + if(a) free(a->data); +} + +static void * +arrayget(struct array *a, int i) +{ + if (i >= a->max) { + int oldsize = a->max * a->itemsize; + int newmax = i + ARRAYDELTA; + int newsize = newmax * a->itemsize; + void *newdata = realloc(a->data, newsize); + if(!newdata) return NULL; + bzero(newdata + oldsize, newsize - oldsize); + a->data = newdata; + a->max = newmax; + } + return a->data + i * a->itemsize; +} + +static struct array * +arrayinit(struct array *a, int itemsize) +{ + a->data = CALLOC(ARRAYDELTA, itemsize); + if(!a->data) return NULL; + a->itemsize = itemsize; + a->max = ARRAYDELTA; + return a; +} + +/* dynamic array caching -------------------------------------------------*/ +/* + * Normally, dynamic array structures are created on the stack, and array + * itself is freshly allocated, and then freed when no longer needed. When + * the XPRINTF_PERF macro is defined, the dynamic array structures associated + * with all-in-one printf variants are not freed, but store in a cache for + * later use (dynamic array structures used for compile/execute continue to + * be freed after they are no longer needed). This means there should be + * at most one structure in the cached per thread that actually used the + * all-in-one printf variant. + * + * The amount of memory that is cached is fairly small, totally about 1K + * for three structures used by a format string using ten conversion + * specifiers. This is too small for purgeable memory. + * + * However, we do flush these caches in case we every are unable to allocate + * memory, and retry the allocation, just in case. + */ +#ifdef XPRINTF_PERF +static OSQueueHead arg_type_queue = OS_ATOMIC_QUEUE_INIT; +static OSQueueHead printf_info_queue = OS_ATOMIC_QUEUE_INIT; +static OSQueueHead union_arg_queue = OS_ATOMIC_QUEUE_INIT; + +#define DEFINE_DEQUEUE(which, type) \ +static struct array * \ +which ## _dequeue(void) \ +{ \ + struct array *a = (struct array *)OSAtomicDequeue(&which ## _queue, offsetof(struct array, next)); \ + \ + if (a) { \ + bzero(a->data, a->max * a->itemsize); \ + return a; \ + } \ + a = (struct array *)MALLOC(sizeof(*a)); \ + if (!a) return NULL; \ + if (!arrayinit(a, sizeof(type))) { \ + free(a); \ + return NULL; \ + } \ + return a; \ +} + +#define DEFINE_ENQUEUE(which) \ +__private_extern__ void \ +which ## _enqueue(struct array *a) \ +{ \ + if (!a) return; \ + OSAtomicEnqueue(&which ## _queue, a, offsetof(struct array, next)); \ +} + +#define DEFINE_FLUSH(which) \ +static void \ +which ## _flush(void) \ +{ \ + struct array *a; \ + while((a = (struct array *)OSAtomicDequeue(&which ## _queue, offsetof(struct array, next))) != NULL) { \ + arrayfree(a); \ + free(a); \ + } \ +} + +DEFINE_DEQUEUE(arg_type, int) +DEFINE_ENQUEUE(arg_type) +DEFINE_FLUSH(arg_type) +DEFINE_DEQUEUE(printf_info, struct printf_info) +DEFINE_ENQUEUE(printf_info) +DEFINE_FLUSH(printf_info) +DEFINE_DEQUEUE(union_arg, union arg) +DEFINE_ENQUEUE(union_arg) +DEFINE_FLUSH(union_arg) + +static void +flush_queues(void) +{ + arg_type_flush(); + printf_info_flush(); + union_arg_flush(); +} + +__private_extern__ void * +xprintf_calloc(size_t count, size_t size) +{ + void *x = calloc(count, size); + if(!x) { + flush_queues(); + x = calloc(count, size); + } + return x; +} + +__private_extern__ void * +xprintf_malloc(size_t size) +{ + void *x = malloc(size); + if(!x) { + flush_queues(); + x = malloc(size); + } + return x; +} + +#if 0 +void +show_queues(void) +{ + struct array *a; + printf("arg_type:"); + while((a = (struct array *)OSAtomicDequeue(&arg_type_queue, offsetof(struct array, next))) != NULL) printf("\n%p", a); + printf("\nprintf_info:"); + while((a = (struct array *)OSAtomicDequeue(&printf_info_queue, offsetof(struct array, next))) != NULL) printf("\n%p", a); + printf("\nunion_arg:"); + while((a = (struct array *)OSAtomicDequeue(&union_arg_queue, offsetof(struct array, next))) != NULL) printf("\n%p", a); + printf("\n"); +} +#endif +#endif /* XPRINTF_PERF */ + +/* -------------------------------------------------------------------------*/ + +__private_extern__ int +__printf_comp(printf_comp_t restrict pc, printf_domain_t restrict domain) +{ + struct printf_info *pi, *pil; + const char *fmt; + int ch, pii; + int *argt; + int nextarg; + int maxarg; + int ret = 0; + int n; +#ifndef XPRINTF_PERF + struct array piarr, argtarr; +#endif /* XPRINTF_PERF */ + struct array *pa, *aa; + + fmt = pc->fmt; + maxarg = 0; + nextarg = 1; +#ifdef XPRINTF_PERF + pa = printf_info_dequeue(); +#else /* !XPRINTF_PERF */ + pa = arrayinit(&piarr, sizeof(*pi)); +#endif /* !XPRINTF_PERF */ + if (!pa) { +#ifdef XPRINTF_PERF + flush_queues(); +#endif /* XPRINTF_PERF */ + return EOF; + } +#ifdef XPRINTF_PERF + pc->pa = pa; + aa = arg_type_dequeue(); +#else /* !XPRINTF_PERF */ + aa = arrayinit(&argtarr, sizeof(*argt)); +#endif /* !XPRINTF_PERF */ + if (!aa) { + arrayfree(pa); +#ifdef XPRINTF_PERF + free(pa); + flush_queues(); +#endif /* XPRINTF_PERF */ + return EOF; + } +#ifdef XPRINTF_PERF + pc->aa = aa; +#endif /* XPRINTF_PERF */ + for (pii = 0; ; pii++) { + pi = arrayget(pa, pii); + if (!pi) { + ret = EOF; + goto error; + } + pil = pi; + if (*fmt == '\0') + break; + pil = pi + 1; + pi->prec = -1; + pi->pad = ' '; +#ifdef VECTORS + pi->vsep = 'X'; /* Illegal value, changed to defaults later. */ +#endif /* VECTORS */ + pi->begin = pi->end = fmt; + while (*fmt != '\0' && *fmt != '%') + pi->end = ++fmt; + if (*fmt == '\0') + break; + fmt++; + for (;;) { + pi->spec = *fmt; + switch (pi->spec) { + case ' ': + /*- + * ``If the space and + flags both appear, the space + * flag will be ignored.'' + * -- ANSI X3J11 + */ + if (pi->showsign == 0) { + pi->space = 1; + pi->signchar = ' '; + } + fmt++; + continue; + case '#': + pi->alt = 1; + fmt++; + continue; +#ifdef VECTORS + case ',': case ';': case ':': case '_': + pi->vsep = pi->spec; + fmt++; + continue; +#endif /* VECTORS */ + case '.': + pi->prec = 0; + fmt++; + if (*fmt == '*') { + fmt++; + /* Look for *nn$ and deal with it */ + n = 0; + while (*fmt != '\0' && is_digit(*fmt)) { + n *= 10; + n += to_digit(*fmt); + fmt++; + } + if (*fmt == '$') { + if ((n + 1) > maxarg) + maxarg = (n + 1); + fmt++; + } else n = nextarg++; + pi->get_prec = n; + argt = (int *)arrayget(aa, n); + if (!argt) { + ret = EOF; + goto error; + } + *argt = PA_INT; + continue; + } + while (*fmt != '\0' && is_digit(*fmt)) { + pi->prec *= 10; + pi->prec += to_digit(*fmt); + fmt++; + } + continue; + case '-': + pi->left = 1; + fmt++; + continue; + case '+': + pi->showsign = 1; + pi->signchar = '+'; + fmt++; + continue; + case '*': + fmt++; + /* Look for *nn$ and deal with it */ + n = 0; + while (*fmt != '\0' && is_digit(*fmt)) { + n *= 10; + n += to_digit(*fmt); + fmt++; + } + if (*fmt == '$') { + if ((n + 1) > maxarg) + maxarg = (n + 1); + fmt++; + } else n = nextarg++; + pi->get_width = n; + argt = (int *)arrayget(aa, n); + if (!argt) { + ret = EOF; + goto error; + } + *argt = PA_INT; + continue; + case '%': + fmt++; + break; + case '\'': + pi->group = 1; + fmt++; + continue; + case '0': + /*- + * ``Note that 0 is taken as a flag, not as the + * beginning of a field width.'' + * -- ANSI X3J11 + */ + pi->pad = '0'; + fmt++; + continue; + case '1': case '2': case '3': + case '4': case '5': case '6': + case '7': case '8': case '9': + n = 0; + while (*fmt != '\0' && is_digit(*fmt)) { + n *= 10; + n += to_digit(*fmt); + fmt++; + } + if (*fmt == '$') { + if (nextarg > maxarg) + maxarg = nextarg; + nextarg = n; + fmt++; + } else + pi->width = n; + continue; +#if 0 + case 'D': + case 'O': + case 'U': + pi->spec += ('a' - 'A'); + pi->is_intmax = 0; + if (pi->is_long_double || pi->is_quad) { + pi->is_long = 0; + pi->is_long_double = 1; + } else { + pi->is_long = 1; + pi->is_long_double = 0; + } + fmt++; + break; +#endif + case 'j': + pi->is_intmax = 1; + fmt++; + continue; + case 'q': + pi->is_long = 0; + pi->is_quad = 1; + fmt++; + continue; + case 'L': + pi->is_long_double = 1; + fmt++; + continue; + case 'h': + fmt++; + if (*fmt == 'h') { + fmt++; + pi->is_char = 1; + } else { + pi->is_short = 1; + } + continue; + case 'l': + fmt++; + if (*fmt == 'l') { + fmt++; + pi->is_long_double = 1; + pi->is_quad = 0; + } else { + pi->is_quad = 0; + pi->is_long = 1; + } + continue; + case 't': + pi->is_ptrdiff = 1; + fmt++; + continue; + case 'v': +#ifdef VECTORS + pi->is_vec = 1; +#endif /* VECTORS */ + fmt++; + continue; + case 'z': + pi->is_size = 1; + fmt++; + continue; + default: + fmt++; + break; + } + if (printf_tbl_in_range(pi->spec)) { + switch(domain->type[printf_tbl_index(pi->spec)]) { + /* ignore PRINTF_DOMAIN_UNUSED until later */ + case PRINTF_DOMAIN_FLAG: + errx(1, "Unexpected flag: %c", pi->spec); + case PRINTF_DOMAIN_GLIBC_API: + case PRINTF_DOMAIN_FBSD_API: + /* + * Insure that there are always + * __PRINTFMAXARG available. + */ + if (!arrayget(aa, nextarg + __PRINTFMAXARG - 1)) { + ret = EOF; + goto error; + } + pi->context = domain->tbl[printf_tbl_index(pi->spec)].context; + pi->loc = pc->loc; + ch = domain->tbl[printf_tbl_index(pi->spec)].arginfo( + pi, __PRINTFMAXARG, arrayget(aa, nextarg)); + if (ch > 0) + pi->arg[0] = (void *)(long)nextarg; + if (ch > 1) + pi->arg[1] = (void *)(long)(nextarg + 1); + nextarg += ch; + break; + } + } + break; + } + } + if (nextarg > maxarg) + maxarg = nextarg; + pc->argt = aa->data; + pc->pi = pa->data; + pc->pil = pil; + pc->maxarg = ch = maxarg; + if (ch < 1) ch = 1; +#ifdef XPRINTF_PERF + pc->ua = union_arg_dequeue(); + if (!pc->ua) { + ret = EOF; + goto error; + } + if (!arrayget(pc->ua, ch)) { + union_arg_enqueue(pc->ua); + ret = EOF; + goto error; + } + pc->args = pc->ua->data; +#else /* !XPRINTF_PERF */ + pc->args = (union arg *)malloc(ch * sizeof(*pc->args)); + if (!pc->args) { + ret = EOF; + goto error; + } +#endif /* !XPRINTF_PERF */ + for (pi = pc->pi; pi < pil; pi++) { + if (pi->arg[0]) pi->arg[0] = &pc->args[(long)pi->arg[0]]; + if (pi->arg[1]) pi->arg[1] = &pc->args[(long)pi->arg[1]]; + } +#if 0 + fprintf(stderr, "fmt0 <%s>\n", fmt0); + fprintf(stderr, "pil %p\n", pil); +#endif + pc->domain = domain; + + return (ret); +error: + arrayfree(pa); + arrayfree(aa); +#ifdef XPRINTF_PERF + free(pa); + free(aa); + flush_queues(); +#endif /* XPRINTF_PERF */ + return (ret); +} + +__private_extern__ int +__printf_exec(printf_comp_t restrict pc, FILE * restrict fp, va_list ap) +{ + struct printf_info *pi; + int ch; + int ret = 0; + int n; + struct __printf_io io; + + __printf_init(&io); + io.fp = fp; + + for (ch = 1; ch < pc->maxarg; ch++) { +#if 0 + fprintf(stderr, "arg %d %x\n", ch, pc->argt[ch]); +#endif + switch(pc->argt[ch]) { + case PA_CHAR: + pc->args[ch].intarg = (char)va_arg (ap, int); + break; + case PA_INT: + pc->args[ch].intarg = va_arg (ap, int); + break; + case PA_INT | PA_FLAG_SHORT: + pc->args[ch].intarg = (short)va_arg (ap, int); + break; + case PA_INT | PA_FLAG_LONG: + pc->args[ch].longarg = va_arg (ap, long); + break; + case PA_INT | PA_FLAG_INTMAX: + pc->args[ch].intmaxarg = va_arg (ap, intmax_t); + break; + case PA_INT | PA_FLAG_QUAD: + pc->args[ch].intmaxarg = va_arg (ap, quad_t); + break; + case PA_INT | PA_FLAG_LONG_LONG: + pc->args[ch].intmaxarg = va_arg (ap, long long); + break; + case PA_INT | PA_FLAG_SIZE: + pc->args[ch].intmaxarg = va_arg (ap, size_t); + break; + case PA_INT | PA_FLAG_PTRDIFF: + pc->args[ch].intmaxarg = (unsigned long)va_arg (ap, ptrdiff_t); + break; + case PA_WCHAR: + pc->args[ch].wintarg = va_arg (ap, wint_t); + break; + case PA_POINTER: + pc->args[ch].pvoidarg = va_arg (ap, void *); + break; + case PA_STRING: + pc->args[ch].pchararg = va_arg (ap, char *); + break; + case PA_WSTRING: + pc->args[ch].pwchararg = va_arg (ap, wchar_t *); + break; + case PA_DOUBLE: +#ifndef NO_FLOATING_POINT + pc->args[ch].doublearg = va_arg (ap, double); +#endif + break; + case PA_DOUBLE | PA_FLAG_LONG_DOUBLE: +#ifndef NO_FLOATING_POINT + pc->args[ch].longdoublearg = va_arg (ap, long double); +#endif + break; +#ifdef VECTORS + case PA_VECTOR: + pc->args[ch].vectorarg = va_arg (ap, VECTORTYPE); + break; +#endif /* VECTORS */ + default: + errx(1, "argtype = %x (fmt = \"%s\")\n", + pc->argt[ch], pc->fmt); + } + } + for (pi = pc->pi; pi < pc->pil; pi++) { +#if 0 + fprintf(stderr, "pi %p", pi); + fprintf(stderr, " spec '%c'", pi->spec); + fprintf(stderr, " args %d", + ((uintptr_t)pi->arg[0] - (uintptr_t)pc->args) / sizeof pc->args[0]); + if (pi->width) fprintf(stderr, " width %d", pi->width); + if (pi->pad) fprintf(stderr, " pad 0x%x", pi->pad); + if (pi->left) fprintf(stderr, " left"); + if (pi->showsign) fprintf(stderr, " showsign"); + if (pi->signchar) fprintf(stderr, " signchar 0x%x", pi->signchar); + if (pi->prec != -1) fprintf(stderr, " prec %d", pi->prec); + if (pi->is_char) fprintf(stderr, " char"); + if (pi->is_short) fprintf(stderr, " short"); + if (pi->is_long) fprintf(stderr, " long"); + if (pi->is_long_double) fprintf(stderr, " long_double"); + fprintf(stderr, "\n"); + fprintf(stderr, "\t\"%.*s\"\n", pi->end - pi->begin, pi->begin); +#endif + if (pi->get_width) { + pi->width = pc->args[pi->get_width].intarg; + /*- + * ``A negative field width argument is taken as a + * - flag followed by a positive field width.'' + * -- ANSI X3J11 + * They don't exclude field widths read from args. + */ + if (pi->width < 0) { + pi->left = 1; + pi->width = -pi->width; + } + } + if (pi->get_prec) + pi->prec = pc->args[pi->get_prec].intarg; + ret += __printf_puts(&io, pi->begin, pi->end - pi->begin); + if (pi->spec) { + if (!printf_tbl_in_range(pi->spec)) goto unused; + switch(pc->domain->type[printf_tbl_index(pi->spec)]) { + case PRINTF_DOMAIN_UNUSED: + unused: + { + char unknown = pi->spec; + ret += __printf_out(&io, pi, &unknown, 1); + break; + } + case PRINTF_DOMAIN_GLIBC_API: + __printf_flush(&io); + pi->sofar = ret; + ret += ((printf_function *)pc->domain->tbl[printf_tbl_index(pi->spec)].render)( + fp, pi, (const void *)pi->arg); + break; + case PRINTF_DOMAIN_FBSD_API: + pi->sofar = ret; + n = ((printf_render *)pc->domain->tbl[printf_tbl_index(pi->spec)].render)( + &io, pi, (const void *)pi->arg); + if (n < 0) + io.fp->_flags |= __SERR; + else + ret += n; + break; + } + } + } + __printf_flush(&io); + return (ret); +} + +__private_extern__ int +__v2printf(printf_comp_t restrict pc, printf_domain_t restrict domain, FILE * restrict fp, locale_t restrict loc, const char * restrict fmt, va_list ap) +{ + struct _printf_compiled spc; + int ret, saverrno; + + /* + * All the printf family (including extensible printf variants) funnel + * down to this point. So we can do common work here, and then fork + * out to the appropriate handler. + */ + /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ + if (prepwrite(fp) != 0) { + errno = EBADF; + return (EOF); + } + ORIENT(fp, -1); + + if (pc == XPRINTF_PLAIN) { + NORMALIZE_LOCALE(loc); +#ifdef XPRINTF_DEBUG + if (!__use_xprintf) +#endif + return __vfprintf(fp, loc, fmt, ap); +#ifdef XPRINTF_DEBUG + xprintf_domain_init(); + domain = xprintf_domain_global; +#endif + } else if (pc) { + pthread_mutex_lock(&pc->mutex); + pthread_rwlock_rdlock(&pc->domain->rwlock); + ret = __printf_exec(pc, fp, ap); + saverrno = errno; + pthread_rwlock_unlock(&pc->domain->rwlock); + pthread_mutex_unlock(&pc->mutex); + errno = saverrno; + return ret; + } + if (!domain) { + errno = EINVAL; + return EOF; + } + xprintf_domain_init(); + bzero(&spc, sizeof(spc)); + spc.fmt = fmt; + DEFAULT_CURRENT_LOCALE(loc); + XL_RETAIN(loc); + spc.loc = loc; + /* + * We don't need to lock the printf_comp_t mutex, since the + * printf_comp_t was just created on the stack, and is private. + */ + pthread_rwlock_rdlock(&domain->rwlock); + if (__printf_comp(&spc, domain) < 0) { + saverrno = errno; + pthread_rwlock_unlock(&domain->rwlock); + XL_RELEASE(loc); + errno = saverrno; + return EOF; + } + ret = __printf_exec(&spc, fp, ap); + saverrno = errno; + pthread_rwlock_unlock(&domain->rwlock); + XL_RELEASE(loc); + +#ifdef XPRINTF_PERF + printf_info_enqueue(spc.pa); + arg_type_enqueue(spc.aa); + union_arg_enqueue(spc.ua); +#else /* !XPRINTF_PERF */ + free(spc.pi); + free(spc.argt); + free(spc.args); +#endif /* !XPRINTF_PERF */ + errno = saverrno; + return ret; +} + +extern int __fflush(FILE *fp); + +/* + * Helper function for `fprintf to unbuffered unix file': creates a + * temporary buffer. We only work on write-only files; this avoids + * worries about ungetc buffers and so forth. + */ +static int +__v3printf(printf_comp_t restrict pc, printf_domain_t restrict domain, FILE * restrict fp, locale_t restrict loc, const char * restrict fmt, va_list ap) +{ + int ret; + FILE fake; + struct __sFILEX extra; + unsigned char buf[BUFSIZ]; + + fake._extra = &extra; + INITEXTRA(&fake); + + /* copy the important variables */ + fake._flags = fp->_flags & ~__SNBF; + fake._file = fp->_file; + fake._cookie = fp->_cookie; + fake._write = fp->_write; + fake._orientation = fp->_orientation; + fake._mbstate = fp->_mbstate; + + /* set up the buffer */ + fake._bf._base = fake._p = buf; + fake._bf._size = fake._w = sizeof(buf); + fake._lbfsize = 0; /* not actually used, but Just In Case */ + + /* do the work, then copy any error status */ + ret = __v2printf(pc, domain, &fake, loc, fmt, ap); + if (ret >= 0 && __fflush(&fake)) + ret = EOF; + if (fake._flags & __SERR) + fp->_flags |= __SERR; + return (ret); +} + +__private_extern__ int +__xvprintf(printf_comp_t restrict pc, printf_domain_t restrict domain, FILE * restrict fp, locale_t restrict loc, const char * restrict fmt0, va_list ap) +{ + int ret; + + /* optimise fprintf(stderr) (and other unbuffered Unix files) */ + if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && + fp->_file >= 0) + ret = __v3printf(pc, domain, fp, loc, fmt0, ap); + else + ret = __v2printf(pc, domain, fp, loc, fmt0, ap); + return ret; +} + +/* extending ---------------------------------------------------------*/ + +// No global domain support +#if 0 +int +register_printf_function(int spec, printf_function *render, printf_arginfo_function *arginfo) +{ + return register_printf_domain_function(NULL, spec, render, arginfo); +} + +__private_extern__ int +register_printf_render(int spec, printf_render *render, printf_arginfo_function *arginfo) +{ + return register_printf_domain_render(NULL, spec, render, arginfo); +} + +int +register_printf_render_std(const char *specs) +{ + return register_printf_domain_render_std(NULL, specs); +} +#endif + +#ifdef VECTORS +/* vector support ----------------------------------------------------*/ + +#define PRINTVECTOR(_io, _pi, _arg, _cnt, _type, _elem, _render, _ret) { \ + int i; \ + _type a, *ap; \ + a = (_type)(_arg)->_elem[0]; \ + ap = &a; \ + (_ret) += _render((_io), (_pi), (const void *)&ap); \ + for(i = 1; i < (_cnt); i++) { \ + (_ret) += __printf_puts((_io), (_pi)->begin, (_pi)->end - (_pi)->begin); \ + a = (_type)(_arg)->_elem[i]; \ + (_ret) += _render((_io), (_pi), (const void *)&ap); \ + } \ +} + +#define PRINTVECTOR_P(_io, _pi, _arg, _cnt, _elem, _render, _ret) { \ + int i; \ + void * a, *ap; \ + a = (void *)(uintptr_t)(_arg)->_elem[0]; \ + ap = &a; \ + (_ret) += _render((_io), (_pi), (const void *)&ap); \ + for(i = 1; i < (_cnt); i++) { \ + (_ret) += __printf_puts((_io), (_pi)->begin, (_pi)->end - (_pi)->begin); \ + a = (void *)(uintptr_t)(_arg)->_elem[i]; \ + (_ret) += _render((_io), (_pi), (const void *)&ap); \ + } \ +} + +__private_extern__ int +__xprintf_vector(struct __printf_io *io, const struct printf_info *pi, const void *const *arg) +{ + char vsep; /* Vector separator character. */ + const union arg *argp; + int ret = 0; + struct printf_info info = *pi; + + argp = arg[0]; + vsep = pi->vsep; + if (vsep == 'X') { + if (pi->spec == 'c') + vsep = '\0'; + else + vsep = ' '; + } + info.begin = info.end = &vsep; + if (vsep) info.end++; + info.is_vec = 0; + + if (pi->is_short) { + if (pi->spec == 'p') { + PRINTVECTOR_P(io, &info, argp, 8, vushortarg, __printf_render_ptr, ret); + } else { + PRINTVECTOR(io, &info, argp, 8, unsigned int, vushortarg, __printf_render_int, ret); + } + } else if (pi->is_long) { + info.is_long = 0; + if (pi->spec == 'p') { + PRINTVECTOR_P(io, &info, argp, 4, vuintarg, __printf_render_ptr, ret); + } else { + PRINTVECTOR(io, &info, argp, 4, unsigned int, vuintarg, __printf_render_int, ret); + } +#ifdef V64TYPE + } else if (pi->is_long_double) { + switch (pi->spec) { + case 'a': + case 'A': + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + info.is_long_double = 0; + PRINTVECTOR(io, &info, argp, 2, double, vdoublearg, __printf_render_float, ret); + break; + case 'p': + info.is_long_double = 0; + PRINTVECTOR_P(io, &info, argp, 2, vulonglongarg, __printf_render_ptr, ret); + break; + case 'd': + case 'i': + case 'u': + case 'o': + case 'x': + case 'X': + PRINTVECTOR(io, &info, argp, 2, unsigned long long, vulonglongarg, __printf_render_int, ret); + break; + default: + /* + * The default case should never + * happen. + */ + case 'c': + info.is_long_double = 0; + PRINTVECTOR(io, &info, argp, 16, unsigned int, vuchararg, __printf_render_chr, ret); + } +#endif /* V64TYPE */ + } else { + switch (pi->spec) { + case 'a': + case 'A': + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + PRINTVECTOR(io, &info, argp, 4, double, vfloatarg, __printf_render_float, ret); + break; + default: + /* + * The default case should never + * happen. + */ + case 'p': + PRINTVECTOR_P(io, &info, argp, 16, vuchararg, __printf_render_ptr, ret); + break; + case 'd': + case 'i': + case 'u': + case 'o': + case 'x': + case 'X': + info.is_char = 1; + PRINTVECTOR(io, &info, argp, 16, unsigned int, vuchararg, __printf_render_int, ret); + break; + case 'c': + PRINTVECTOR(io, &info, argp, 16, unsigned int, vuchararg, __printf_render_chr, ret); + } + } + return ret; +} +#endif /* VECTORS */ diff --git a/stdio/FreeBSD/xprintf_errno.c b/stdio/FreeBSD/xprintf_errno.c new file mode 100644 index 0000000..83bd019 --- /dev/null +++ b/stdio/FreeBSD/xprintf_errno.c @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/xprintf_errno.c,v 1.1 2006/01/25 12:45:24 phk Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "printf.h" +#include "xprintf_private.h" + +__private_extern__ int +__printf_arginfo_errno(const struct printf_info *pi __unused, size_t n, int *argt) +{ + + assert(n >= 1); + argt[0] = PA_INT; + return (1); +} + +__private_extern__ int +__printf_render_errno(struct __printf_io *io, const struct printf_info *pi __unused, const void *const *arg) +{ + int ret, error; + char buf[64]; + const char *p; + + ret = 0; + error = *((const int *)arg[0]); + if (error >= 0 && error < sys_nerr) { + p = strerror(error); + return (__printf_out(io, pi, p, strlen(p))); + } + sprintf(buf, "errno=%d/0x%x", error, error); + ret += __printf_out(io, pi, buf, strlen(buf)); + __printf_flush(io); + return(ret); +} diff --git a/stdio/FreeBSD/xprintf_float.c b/stdio/FreeBSD/xprintf_float.c new file mode 100644 index 0000000..217956e --- /dev/null +++ b/stdio/FreeBSD/xprintf_float.c @@ -0,0 +1,446 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/xprintf_float.c,v 1.1 2005/12/16 18:56:38 phk Exp $ + */ + +#include +#include "xlocale_private.h" +#include +#include +#include +#include +#include +#include + +#define dtoa __dtoa +#define freedtoa __freedtoa + +#include +#include +#include "gdtoa.h" +#include "floatio.h" +#include "printf.h" +#include "xprintf_private.h" +#include + +/* + * The size of the buffer we use as scratch space for integer + * conversions, among other things. Technically, we would need the + * most space for base 10 conversions with thousands' grouping + * characters between each pair of digits. 100 bytes is a + * conservative overestimate even for a 128-bit uintmax_t. + */ +#define BUF 100 + +#define DEFPREC 6 /* Default FP precision */ + + +/* various globals ---------------------------------------------------*/ + + +/* padding function---------------------------------------------------*/ + +#define PRINTANDPAD(p, ep, len, with) do { \ + n2 = (ep) - (p); \ + if (n2 > (len)) \ + n2 = (len); \ + if (n2 > 0) \ + ret += __printf_puts(io, (p), n2); \ + ret += __printf_pad(io, (len) - (n2 > 0 ? n2 : 0), (with)); \ +} while(0) + +/* misc --------------------------------------------------------------*/ + +extern const char *__fix_nogrouping(const char *str); + +#define to_char(n) ((n) + '0') + +static int +exponent(char *p0, int expo, int fmtch) +{ + char *p, *t; + char expbuf[MAXEXPDIG]; + + p = p0; + *p++ = fmtch; + if (expo < 0) { + expo = -expo; + *p++ = '-'; + } + else + *p++ = '+'; + t = expbuf + MAXEXPDIG; + if (expo > 9) { + do { + *--t = to_char(expo % 10); + } while ((expo /= 10) > 9); + *--t = to_char(expo); + for (; t < expbuf + MAXEXPDIG; *p++ = *t++) + ; + } + else { + /* + * Exponents for decimal floating point conversions + * (%[eEgG]) must be at least two characters long, + * whereas exponents for hexadecimal conversions can + * be only one character long. + */ + if (fmtch == 'e' || fmtch == 'E') + *p++ = '0'; + *p++ = to_char(expo); + } + return (p - p0); +} + +/* 'f' ---------------------------------------------------------------*/ + +__private_extern__ int +__printf_arginfo_float(const struct printf_info *pi, size_t n, int *argt) +{ + assert (n > 0); +#ifdef VECTORS + if (pi->is_vec) + argt[0] = PA_VECTOR; + else { +#endif /* VECTORS */ + argt[0] = PA_DOUBLE; + if (pi->is_long_double) + argt[0] |= PA_FLAG_LONG_DOUBLE; +#ifdef VECTORS + } +#endif /* VECTORS */ + return (1); +} + +/* + * We can decompose the printed representation of floating + * point numbers into several parts, some of which may be empty: + * + * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ + * A B ---C--- D E F + * + * A: 'sign' holds this value if present; '\0' otherwise + * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal + * C: cp points to the string MMMNNN. Leading and trailing + * zeros are not in the string and must be added. + * D: expchar holds this character; '\0' if no exponent, e.g. %f + * F: at least two digits for decimal, at least one digit for hex + */ + +__private_extern__ int +__printf_render_float(struct __printf_io *io, const struct printf_info *pi, const void *const *arg) +{ + int prec; /* precision from format; <0 for N/A */ + char *dtoaresult; /* buffer allocated by dtoa */ + char expchar; /* exponent character: [eEpP\0] */ + char *cp; + int expt; /* integer value of exponent */ + int signflag; /* true if float is negative */ + char *dtoaend; /* pointer to end of converted digits */ + char sign; /* sign prefix (' ', '+', '-', or \0) */ + int size; /* size of converted field or string */ + int ndig; /* actual number of digits returned by dtoa */ + int expsize; /* character count for expstr */ + char expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ + const char *grouping; /* locale specific numeric grouping rules */ + int lead; /* sig figs before decimal or group sep */ + long double ld; + double d; + int realsz; /* field size expanded by dprec, sign, etc */ + int dprec; /* a copy of prec if [diouxX], 0 otherwise */ + char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ + int prsize; /* max size of printed field */ + int ret; /* return value accumulator */ + const char *decimal_point; /* locale specific decimal point */ + int decimal_point_len; /* length of locale specific decimal point */ + int n2; /* XXX: for PRINTANDPAD */ + const char *thousands_sep; /* locale specific thousands separator */ + int thousands_sep_len; /* length of locale specific thousands separator */ + char buf[BUF]; /* buffer with space for digits of uintmax_t */ + const char *xdigs; + int flag; + +#ifdef VECTORS + if (pi->is_vec) return __xprintf_vector(io, pi, arg); +#endif /* VECTORS */ + + prec = pi->prec; + ox[1] = '\0'; + sign = pi->signchar; + flag = 0; + ret = 0; + + thousands_sep = localeconv_l(pi->loc)->thousands_sep; + thousands_sep_len = strlen(thousands_sep); + grouping = NULL; + if (pi->group) + grouping = __fix_nogrouping(localeconv_l(pi->loc)->grouping); + decimal_point = localeconv_l(pi->loc)->decimal_point; + decimal_point_len = strlen(decimal_point); + dprec = -1; + + switch(pi->spec) { + case 'a': + case 'A': + if (pi->spec == 'a') { + ox[1] = 'x'; + xdigs = __lowercase_hex; + expchar = 'p'; + } else { + ox[1] = 'X'; + xdigs = __uppercase_hex; + expchar = 'P'; + } + if (prec >= 0) + prec++; + if (pi->is_long_double) { + ld = *((long double *)arg[0]); + dtoaresult = cp = + __hldtoa(ld, xdigs, prec, + &expt, &signflag, &dtoaend); + } else { + d = *((double *)arg[0]); + dtoaresult = cp = + __hdtoa(d, xdigs, prec, + &expt, &signflag, &dtoaend); + } + if (prec < 0) + prec = dtoaend - cp; + if (expt == INT_MAX) + ox[1] = '\0'; + goto fp_common; + case 'e': + case 'E': + expchar = pi->spec; + if (prec < 0) /* account for digit before decpt */ + prec = DEFPREC + 1; + else + prec++; + break; + case 'f': + case 'F': + expchar = '\0'; + break; + case 'g': + case 'G': + expchar = pi->spec - ('g' - 'e'); + if (prec == 0) + prec = 1; + break; + default: + assert(pi->spec == 'f'); + } + + if (prec < 0) + prec = DEFPREC; + if (pi->is_long_double) { + ld = *((long double *)arg[0]); + dtoaresult = cp = + __ldtoa(&ld, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + } else { + d = *((double *)arg[0]); + dtoaresult = cp = + dtoa(d, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + if (expt == 9999) + expt = INT_MAX; + } +fp_common: + if (signflag) + sign = '-'; + if (expt == INT_MAX) { /* inf or nan */ + if (*cp == 'N') { + cp = (pi->spec >= 'a') ? "nan" : "NAN"; + sign = '\0'; + } else + cp = (pi->spec >= 'a') ? "inf" : "INF"; + size = 3; + flag = 1; + goto here; + } + ndig = dtoaend - cp; + if (pi->spec == 'g' || pi->spec == 'G') { + if (expt > -4 && expt <= prec) { + /* Make %[gG] smell like %[fF] */ + expchar = '\0'; + if (pi->alt) + prec -= expt; + else + prec = ndig - expt; + if (prec < 0) + prec = 0; + } else { + /* + * Make %[gG] smell like %[eE], but + * trim trailing zeroes if no # flag. + */ + if (!pi->alt) + prec = ndig; + } + } + if (expchar) { + expsize = exponent(expstr, expt - 1, expchar); + size = expsize + prec; + if (prec > 1 || pi->alt) + ++size; + } else { + /* space for digits before decimal point */ + if (expt > 0) + size = expt; + else /* "0" */ + size = 1; + /* space for decimal pt and following digits */ + if (prec || pi->alt) + size += prec + 1; + if (grouping && expt > 0) { + /* space for thousands' grouping */ + nseps = nrepeats = 0; + lead = expt; + while (*grouping != CHAR_MAX) { + if (lead <= *grouping) + break; + lead -= *grouping; + if (*(grouping+1)) { + nseps++; + grouping++; + } else + nrepeats++; + } + size += nseps + nrepeats; + } else + lead = expt; + } + +here: + /* + * All reasonable formats wind up here. At this point, `cp' + * points to a string which (if not flags&LADJUST) should be + * padded out to `width' places. If flags&ZEROPAD, it should + * first be prefixed by any sign or other prefix; otherwise, + * it should be blank padded before the prefix is emitted. + * After any left-hand padding and prefixing, emit zeroes + * required by a decimal [diouxX] precision, then print the + * string proper, then emit zeroes required by any leftover + * floating precision; finally, if LADJUST, pad with blanks. + * + * Compute actual size, so we know how much to pad. + * size excludes decimal prec; realsz includes it. + */ + realsz = dprec > size ? dprec : size; + if (sign) + realsz++; + if (ox[1]) + realsz += 2; + + prsize = pi->width > realsz ? pi->width : realsz; + + /* right-adjusting blank padding */ + if (pi->pad != '0' && pi->left == 0) + ret += __printf_pad(io, pi->width - realsz, 0); + + /* prefix */ + if (sign) + ret += __printf_puts(io, &sign, 1); + + if (ox[1]) { /* ox[1] is either x, X, or \0 */ + ox[0] = '0'; + ret += __printf_puts(io, ox, 2); + } + + /* right-adjusting zero padding */ + if (pi->pad == '0' && pi->left == 0) + ret += __printf_pad(io, pi->width - realsz, 1); + + /* leading zeroes from decimal precision */ + ret += __printf_pad(io, dprec - size, 1); + + if (flag) + ret += __printf_puts(io, cp, size); + else { + /* glue together f_p fragments */ + if (!expchar) { /* %[fF] or sufficiently short %[gG] */ + if (expt <= 0) { + ret += __printf_puts(io, "0", 1); + if (prec || pi->alt) + ret += __printf_puts(io, decimal_point, decimal_point_len); + ret += __printf_pad(io, -expt, 1); + /* already handled initial 0's */ + prec += expt; + } else { + PRINTANDPAD(cp, dtoaend, lead, 1); + cp += lead; + if (grouping) { + while (nseps>0 || nrepeats>0) { + if (nrepeats > 0) + nrepeats--; + else { + grouping--; + nseps--; + } + ret += __printf_puts(io, thousands_sep, thousands_sep_len); + PRINTANDPAD(cp,dtoaend, + *grouping, 1); + cp += *grouping; + } + if (cp > dtoaend) + cp = dtoaend; + } + if (prec || pi->alt) + ret += __printf_puts(io, decimal_point, decimal_point_len); + } + PRINTANDPAD(cp, dtoaend, prec, 1); + } else { /* %[eE] or sufficiently long %[gG] */ + if (prec > 1 || pi->alt) { + buf[0] = *cp++; + memcpy(buf + 1, decimal_point, decimal_point_len); + ret += __printf_puts(io, buf, decimal_point_len + 1); + ret += __printf_puts(io, cp, ndig-1); + ret += __printf_pad(io, prec - ndig, 1); + } else /* XeYYY */ + ret += __printf_puts(io, cp, 1); + ret += __printf_puts(io, expstr, expsize); + } + } + /* left-adjusting padding (always blank) */ + if (pi->left) + ret += __printf_pad(io, pi->width - realsz, 0); + + __printf_flush(io); + if (dtoaresult != NULL) + freedtoa(dtoaresult); + + return (ret); +} diff --git a/stdio/FreeBSD/xprintf_hexdump.c b/stdio/FreeBSD/xprintf_hexdump.c new file mode 100644 index 0000000..0e90ad7 --- /dev/null +++ b/stdio/FreeBSD/xprintf_hexdump.c @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/xprintf_hexdump.c,v 1.1 2005/12/16 18:56:38 phk Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include "printf.h" +#include "xprintf_private.h" + +__private_extern__ int +__printf_arginfo_hexdump(const struct printf_info *pi, size_t n, int *argt) +{ + + assert(n >= 2); + argt[0] = PA_POINTER; + argt[1] = PA_INT; + return (2); +} + +__private_extern__ int +__printf_render_hexdump(struct __printf_io *io, const struct printf_info *pi, const void *const *arg) +{ + unsigned char *p; + unsigned u, l, j, a; + char buf[100], *q; + int ret; + + if (pi->width > 0 && pi->width < 16) + l = pi->width; + else + l = 16; + p = *((unsigned char **)arg[0]); + u = *((unsigned *)arg[1]); + + ret = 0; + a = 0; + while (u > 0) { + q = buf; + if (pi->showsign) + q += sprintf(q, " %04x", a); + for (j = 0; j < l && j < u; j++) + q += sprintf(q, " %02x", p[j]); + if (pi->alt) { + for (; j < l; j++) + q += sprintf(q, " "); + q += sprintf(q, " |"); + for (j = 0; j < l && j < u; j++) { + if (p[j] < ' ' || p[j] > '~') + *q++ = '.'; + else + *q++ = p[j]; + } + for (; j < l; j++) + *q++ = ' '; + *q++ = '|'; + } + if (l < u) + j = l; + else + j = u; + p += j; + u -= j; + a += j; + if (u > 0) + *q++ = '\n'; + ret += __printf_puts(io, buf + 1, q - (buf + 1)); + __printf_flush(io); + } + return (ret); +} diff --git a/stdio/FreeBSD/xprintf_int.c b/stdio/FreeBSD/xprintf_int.c new file mode 100644 index 0000000..ce33d2a --- /dev/null +++ b/stdio/FreeBSD/xprintf_int.c @@ -0,0 +1,498 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/xprintf_int.c,v 1.2 2005/12/22 14:23:54 cognet Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "printf.h" +#include "xprintf_private.h" + +/* private stuff -----------------------------------------------------*/ + +union arg { + int intarg; + u_int uintarg; + long longarg; + u_long ulongarg; + intmax_t intmaxarg; + uintmax_t uintmaxarg; +}; + +/* + * Macros for converting digits to letters and vice versa + */ +#define to_char(n) ((n) + '0') + +/* various globals ---------------------------------------------------*/ + +/* + * The size of the buffer we use for integer conversions. + * Technically, we would need the most space for base 10 + * conversions with thousands' grouping characters between + * each pair of digits: 39 digits for 128 bit intmax_t plus + * 20 grouping characters (which may be multibyte). + * Use a bit more for better alignment of stuff. + */ +#define BUF 128 + +/* misc --------------------------------------------------------------*/ + +extern const char *__fix_nogrouping(const char *str); + +/* + * Convert an unsigned long to ASCII for printf purposes, returning + * a pointer to the first character of the string representation. + * Octal numbers can be forced to have a leading zero; hex numbers + * use the given digits. + */ +static char * +__ultoa(u_long val, char *endp, int base, const char *xdigs, + int needgrp, const char *thousep, int thousep_len, const char *grp) +{ + char *cp = endp; + long sval; + int ndig; + + /* + * Handle the three cases separately, in the hope of getting + * better/faster code. + */ + switch (base) { + case 10: + if (val < 10) { /* many numbers are 1 digit */ + *--cp = to_char(val); + return (cp); + } + ndig = 0; + /* + * On many machines, unsigned arithmetic is harder than + * signed arithmetic, so we do at most one unsigned mod and + * divide; this is sufficient to reduce the range of + * the incoming value to where signed arithmetic works. + */ + if (val > LONG_MAX) { + *--cp = to_char(val % 10); + ndig++; + sval = val / 10; + } else + sval = val; + do { + *--cp = to_char(sval % 10); + ndig++; + /* + * If (*grp == CHAR_MAX) then no more grouping + * should be performed. + */ + if (needgrp && ndig == *grp && *grp != CHAR_MAX + && sval > 9) { + cp -= thousep_len; + memcpy(cp, thousep, thousep_len); + ndig = 0; + /* + * If (*(grp+1) == '\0') then we have to + * use *grp character (last grouping rule) + * for all next cases + */ + if (*(grp+1) != '\0') + grp++; + } + sval /= 10; + } while (sval != 0); + break; + + case 8: + do { + *--cp = to_char(val & 7); + val >>= 3; + } while (val); + break; + + case 16: + do { + *--cp = xdigs[val & 15]; + val >>= 4; + } while (val); + break; + + default: /* oops */ + assert(base == 16); + } + return (cp); +} + + +/* Identical to __ultoa, but for intmax_t. */ +static char * +__ujtoa(uintmax_t val, char *endp, int base, const char *xdigs, + int needgrp, const char *thousep, int thousep_len, const char *grp) +{ + char *cp = endp; + intmax_t sval; + int ndig; + + switch (base) { + case 10: + if (val < 10) { + *--cp = to_char(val % 10); + return (cp); + } + ndig = 0; + if (val > INTMAX_MAX) { + *--cp = to_char(val % 10); + ndig++; + sval = val / 10; + } else + sval = val; + do { + *--cp = to_char(sval % 10); + ndig++; + /* + * If (*grp == CHAR_MAX) then no more grouping + * should be performed. + */ + if (needgrp && *grp != CHAR_MAX && ndig == *grp + && sval > 9) { + cp -= thousep_len; + memcpy(cp, thousep, thousep_len); + ndig = 0; + /* + * If (*(grp+1) == '\0') then we have to + * use *grp character (last grouping rule) + * for all next cases + */ + if (*(grp+1) != '\0') + grp++; + } + sval /= 10; + } while (sval != 0); + break; + + case 8: + do { + *--cp = to_char(val & 7); + val >>= 3; + } while (val); + break; + + case 16: + do { + *--cp = xdigs[val & 15]; + val >>= 4; + } while (val); + break; + + default: + abort(); + } + return (cp); +} + + +/* 'd' ---------------------------------------------------------------*/ + +__private_extern__ int +__printf_arginfo_int(const struct printf_info *pi, size_t n, int *argt) +{ + assert (n > 0); + argt[0] = PA_INT; +#ifdef VECTORS + if (pi->is_vec) + argt[0] = PA_VECTOR; + else +#endif /* VECTORS */ + if (pi->is_ptrdiff) + argt[0] |= PA_FLAG_PTRDIFF; + else if (pi->is_size) + argt[0] |= PA_FLAG_SIZE; + else if (pi->is_long) + argt[0] |= PA_FLAG_LONG; + else if (pi->is_intmax) + argt[0] |= PA_FLAG_INTMAX; + else if (pi->is_quad) + argt[0] |= PA_FLAG_QUAD; + else if (pi->is_long_double) + argt[0] |= PA_FLAG_LONG_LONG; + else if (pi->is_short) + argt[0] |= PA_FLAG_SHORT; + else if (pi->is_char) + argt[0] = PA_CHAR; + return (1); +} + +__private_extern__ int +__printf_render_int(struct __printf_io *io, const struct printf_info *pi, const void *const *arg) +{ + const union arg *argp; + char buf[BUF]; + char *p, *pe; + char ns; + int rdx, sign, zext, ngrp, l; + const char *nalt, *digit; + const char *thousands_sep; /* locale specific thousands separator */ + int thousands_sep_len; /* locale specific thousands separator length */ + const char *grouping; /* locale specific numeric grouping rules */ + uintmax_t uu; + int ret; + +#ifdef VECTORS + if (pi->is_vec) return __xprintf_vector(io, pi, arg); +#endif /* VECTORS */ + + ret = 0; + nalt = NULL; + digit = __lowercase_hex; + ns = '\0'; + pe = buf + sizeof buf - 1; + + if (pi->group) { + thousands_sep = localeconv_l(pi->loc)->thousands_sep; + thousands_sep_len = strlen(thousands_sep); + grouping = __fix_nogrouping(localeconv_l(pi->loc)->grouping); + ngrp = 1; + } else { + thousands_sep = NULL; + thousands_sep_len = 0; + grouping = NULL; + ngrp = 0; + } + + switch(pi->spec) { + case 'd': + case 'i': + rdx = 10; + sign = 1; + break; + case 'X': + digit = __uppercase_hex; + /*FALLTHOUGH*/ + case 'x': + rdx = 16; + sign = 0; + break; + case 'u': + case 'U': + rdx = 10; + sign = 0; + break; + case 'o': + case 'O': + rdx = 8; + sign = 0; + break; + default: + fprintf(stderr, "pi->spec = '%c'\n", pi->spec); + assert(1 == 0); + } + argp = arg[0]; + + if (sign) + ns = pi->signchar; + + if (pi->is_long_double || pi->is_quad || pi->is_intmax || + pi->is_size || pi->is_ptrdiff) { + if (sign && argp->intmaxarg < 0) { + uu = -argp->intmaxarg; + ns = '-'; + } else + uu = argp->uintmaxarg; + } else if (pi->is_long) { + if (sign && argp->longarg < 0) { + uu = (u_long)-argp->longarg; + ns = '-'; + } else + uu = argp->ulongarg; + } else if (pi->is_short) { + if (sign && (short)argp->intarg < 0) { + uu = -(short)argp->intarg; + ns = '-'; + } else + uu = (unsigned short)argp->uintarg; + } else if (pi->is_char) { + if (sign && (signed char)argp->intarg < 0) { + uu = -(signed char)argp->intarg; + ns = '-'; + } else + uu = (unsigned char)argp->uintarg; + } else { + if (sign && argp->intarg < 0) { + uu = (unsigned)-argp->intarg; + ns = '-'; + } else + uu = argp->uintarg; + } + if (uu <= ULONG_MAX) + p = __ultoa(uu, pe, rdx, digit, ngrp, thousands_sep, thousands_sep_len, grouping); + else + p = __ujtoa(uu, pe, rdx, digit, ngrp, thousands_sep, thousands_sep_len, grouping); + + l = 0; + if (uu == 0) { + /*- + * ``The result of converting a zero value with an + * explicit precision of zero is no characters.'' + * -- ANSI X3J11 + * + * ``The C Standard is clear enough as is. The call + * printf("%#.0o", 0) should print 0.'' + * -- Defect Report #151 + */ + ; + if (pi->prec == 0 && !(pi->alt && rdx == 8)) + p = pe; + } else if (pi->alt) { + if (rdx == 8) + *--p = '0'; + if (rdx == 16) { + if (pi->spec == 'x') + nalt = "0x"; + else + nalt = "0X"; + l += 2; + } + } + l += pe - p; + if (ns) + l++; + + /*- + * ``... diouXx conversions ... if a precision is + * specified, the 0 flag will be ignored.'' + * -- ANSI X3J11 + */ + if (pi->prec > (pe - p)) + zext = pi->prec - (pe - p); + else if (pi->prec != -1) + zext = 0; + else if (pi->pad == '0' && pi->width > l && !pi->left) + zext = pi->width - l; + else + zext = 0; + + l += zext; + + while (zext > 0 && p > buf) { + *--p = '0'; + zext--; + } + + if (l < BUF) { + if (ns) { + *--p = ns; + } else if (nalt != NULL) { + *--p = nalt[1]; + *--p = nalt[0]; + } + if (pi->width > (pe - p) && !pi->left) { + l = pi->width - (pe - p); + while (l > 0 && p > buf) { + *--p = ' '; + l--; + } + if (l) + ret += __printf_pad(io, l, 0); + } + } else { + if (!pi->left && pi->width > l) + ret += __printf_pad(io, pi->width - l, 0); + if (ns != '\0') + ret += __printf_puts(io, &ns, 1); + else if (nalt != NULL) + ret += __printf_puts(io, nalt, 2); + if (zext > 0) + ret += __printf_pad(io, zext, 1); + } + + ret += __printf_puts(io, p, pe - p); + if (pi->width > ret && pi->left) + ret += __printf_pad(io, pi->width - ret, 0); + __printf_flush(io); + return (ret); +} + +/* 'p' ---------------------------------------------------------------*/ + +__private_extern__ int +__printf_arginfo_ptr(const struct printf_info *pi __unused, size_t n, int *argt) +{ + + assert (n > 0); +#ifdef VECTORS + if (pi->is_vec) + argt[0] = PA_VECTOR; + else +#endif /* VECTORS */ + argt[0] = PA_POINTER; + return (1); +} + +__private_extern__ int +__printf_render_ptr(struct __printf_io *io, const struct printf_info *pi, const void *const *arg) +{ + struct printf_info p2; + uintmax_t u; + const void *p; + +#ifdef VECTORS + if (pi->is_vec) return __xprintf_vector(io, pi, arg); +#endif /* VECTORS */ + + /*- + * ``The argument shall be a pointer to void. The + * value of the pointer is converted to a sequence + * of printable characters, in an implementation- + * defined manner.'' + * -- ANSI X3J11 + */ + u = (uintmax_t)(uintptr_t) *((void **)arg[0]); + p2 = *pi; + + p2.spec = 'x'; + p2.alt = 1; + p2.is_long_double = 1; + p = &u; + return (__printf_render_int(io, &p2, &p)); +} diff --git a/stdio/FreeBSD/xprintf_private.h b/stdio/FreeBSD/xprintf_private.h new file mode 100644 index 0000000..5f24296 --- /dev/null +++ b/stdio/FreeBSD/xprintf_private.h @@ -0,0 +1,171 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/include/printf.h,v 1.5 2011/03/06 17:45:37 pjd Exp $ + */ + +#ifndef _XPRINTF_PRIVATE_H_ +#define _XPRINTF_PRIVATE_H_ + +#include +#include + +#ifndef VECTORS +#define VECTORS +typedef __attribute__ ((vector_size(16))) unsigned char VECTORTYPE; +#ifdef __SSE2__ +#define V64TYPE +#endif /* __SSE2__ */ +#endif /* !VECTORS */ + +/* FreeBSD extension */ +struct __printf_io; +typedef int printf_render(struct __printf_io *, const struct printf_info *, const void *const *); + +#if 0 +int register_printf_render(int spec, printf_render *render, printf_arginfo_function *arginfo); +#endif + +/* + * Unlike register_printf_domain_function(), register_printf_domain_render() + * doesn't have a context pointer, because none of the internal rendering + * functions use it. + */ +int register_printf_domain_render(printf_domain_t, int, printf_render *, printf_arginfo_function *); + +/* xprintf.c */ +extern const char __lowercase_hex[17]; +extern const char __uppercase_hex[17]; + +void __printf_flush(struct __printf_io *io); +int __printf_puts(struct __printf_io *io, const void *ptr, int len); +int __printf_pad(struct __printf_io *io, int n, int zero); +int __printf_out(struct __printf_io *io, const struct printf_info *pi, const void *ptr, int len); + +int __v2printf(printf_comp_t restrict pc, printf_domain_t restrict domain, FILE * restrict fp, locale_t restrict loc, const char * restrict fmt0, va_list ap); +int __xvprintf(printf_comp_t restrict pc, printf_domain_t restrict domain, FILE * restrict fp, locale_t restrict loc, const char * restrict fmt0, va_list ap); +extern int __use_xprintf; + +printf_arginfo_function __printf_arginfo_pct; +printf_render __printf_render_pct; + +printf_arginfo_function __printf_arginfo_n; +printf_function __printf_render_n; + +#ifdef VECTORS +printf_render __xprintf_vector; +#endif /* VECTORS */ + +#ifdef XPRINTF_PERF +#define CALLOC(x,y) xprintf_calloc((x),(y)) +#define MALLOC(x) xprintf_malloc((x)) +void *xprintf_calloc(size_t, size_t) __attribute__((__malloc__)); +void *xprintf_malloc(size_t) __attribute__((__malloc__)); +#else /* !XPRINTF_PERF */ +#define CALLOC(x,y) calloc((x),(y)) +#define MALLOC(x) malloc((x)) +#endif /* !XPRINTF_PERF */ + +/* xprintf_domain.c */ +void __xprintf_domain_init(void); +extern pthread_once_t __xprintf_domain_once; +#ifdef XPRINTF_DEBUG +extern printf_domain_t xprintf_domain_global; +#endif +#ifdef XPRINTF_PERF +struct array; /* forward reference */ +void arrayfree(struct array *); +#endif + +#define xprintf_domain_init() pthread_once(&__xprintf_domain_once, __xprintf_domain_init) + +/* xprintf_errno.c */ +printf_arginfo_function __printf_arginfo_errno; +printf_render __printf_render_errno; + +/* xprintf_float.c */ +printf_arginfo_function __printf_arginfo_float; +printf_render __printf_render_float; + +/* xprintf_hexdump.c */ +printf_arginfo_function __printf_arginfo_hexdump; +printf_render __printf_render_hexdump; + +/* xprintf_int.c */ +printf_arginfo_function __printf_arginfo_ptr; +printf_arginfo_function __printf_arginfo_int; +printf_render __printf_render_ptr; +printf_render __printf_render_int; + +/* xprintf_quoute.c */ +printf_arginfo_function __printf_arginfo_quote; +printf_render __printf_render_quote; + +/* xprintf_str.c */ +printf_arginfo_function __printf_arginfo_chr; +printf_render __printf_render_chr; +printf_arginfo_function __printf_arginfo_str; +printf_render __printf_render_str; + +/* xprintf_time.c */ +printf_arginfo_function __printf_arginfo_time; +printf_render __printf_render_time; + +/* xprintf_vis.c */ +printf_arginfo_function __printf_arginfo_vis; +printf_render __printf_render_vis; + +#ifdef XPRINTF_PERF +struct array; /* forward reference */ +#endif /* XPRINTF_PERF */ +struct _printf_compiled { + pthread_mutex_t mutex; +#ifdef XPRINTF_PERF + struct array *aa; + struct array *pa; + struct array *ua; +#endif /* XPRINTF_PERF */ + const char *fmt; + printf_domain_t domain; + locale_t loc; + struct printf_info *pi; + struct printf_info *pil; + int *argt; + union arg *args; + int maxarg; +}; + +#define XPRINTF_PLAIN ((printf_comp_t)-1) + +int __printf_comp(printf_comp_t restrict, printf_domain_t restrict); +int __printf_exec(printf_comp_t restrict, FILE * restrict, va_list); + +#ifdef XPRINTF_PERF +void arg_type_enqueue(struct array *); +void print_info_enqueue(struct array *); +void union_arg_enqueue(struct array *); +#endif /* XPRINTF_PERF */ + +#endif /* !_XPRINTF_PRIVATE_H_ */ diff --git a/stdio/FreeBSD/xprintf_quote.c b/stdio/FreeBSD/xprintf_quote.c new file mode 100644 index 0000000..a1a4c3e --- /dev/null +++ b/stdio/FreeBSD/xprintf_quote.c @@ -0,0 +1,99 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/xprintf_quote.c,v 1.2 2006/03/02 08:53:45 phk Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "printf.h" +#include "xprintf_private.h" + +__private_extern__ int +__printf_arginfo_quote(const struct printf_info *pi __unused, size_t n, int *argt) +{ + + assert(n >= 1); + argt[0] = PA_POINTER; + return (1); +} + +__private_extern__ int +__printf_render_quote(struct __printf_io *io, const struct printf_info *pi __unused, const void *const *arg) +{ + const char *str, *p, *t, *o; + char r[5]; + int i, ret; + + str = *((const char *const *)arg[0]); + if (str == NULL) + return (__printf_out(io, pi, "\"(null)\"", 8)); + if (*str == '\0') + return (__printf_out(io, pi, "\"\"", 2)); + + for (i = 0, p = str; *p; p++) + if (isspace(*p) || *p == '\\' || *p == '"') + i++; + if (!i) + return (__printf_out(io, pi, str, strlen(str))); + + ret = __printf_out(io, pi, "\"", 1); + for (t = p = str; *p; p++) { + o = NULL; + if (*p == '\\') + o = "\\\\"; + else if (*p == '\n') + o = "\\n"; + else if (*p == '\r') + o = "\\r"; + else if (*p == '\t') + o = "\\t"; + else if (*p == ' ') + o = " "; + else if (*p == '"') + o = "\\\""; + else if (isspace(*p)) { + sprintf(r, "\\%03o", *p); + o = r; + } else + continue; + if (p != t) + ret += __printf_out(io, pi, t, p - t); + ret += __printf_out(io, pi, o, strlen(o)); + t = p + 1; + } + if (p != t) + ret += __printf_out(io, pi, t, p - t); + ret += __printf_out(io, pi, "\"", 1); + __printf_flush(io); + return(ret); +} diff --git a/stdio/FreeBSD/xprintf_str.c b/stdio/FreeBSD/xprintf_str.c new file mode 100644 index 0000000..a563c3f --- /dev/null +++ b/stdio/FreeBSD/xprintf_str.c @@ -0,0 +1,201 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/xprintf_str.c,v 1.1 2005/12/16 18:56:38 phk Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "printf.h" +#include "xprintf_private.h" + +/* + * Convert a wide character string argument for the %ls format to a multibyte + * string representation. If not -1, prec specifies the maximum number of + * bytes to output, and also means that we can't assume that the wide char. + * string ends is null-terminated. + */ +static char * +__wcsconv(wchar_t *wcsarg, int prec, locale_t loc) +{ + static const mbstate_t initial; + mbstate_t mbs; + char buf[MB_LEN_MAX]; + wchar_t *p; + char *convbuf; + size_t clen, nbytes; + + /* Allocate space for the maximum number of bytes we could output. */ + if (prec < 0) { + p = wcsarg; + mbs = initial; + nbytes = wcsrtombs_l(NULL, (const wchar_t **)&p, 0, &mbs, loc); + if (nbytes == (size_t)-1) + return (NULL); + } else { + /* + * Optimisation: if the output precision is small enough, + * just allocate enough memory for the maximum instead of + * scanning the string. + */ + if (prec < 128) + nbytes = prec; + else { + nbytes = 0; + p = wcsarg; + mbs = initial; + for (;;) { + clen = wcrtomb_l(buf, *p++, &mbs, loc); + if (clen == 0 || clen == (size_t)-1 || + (int)(nbytes + clen) > prec) + break; + nbytes += clen; + } + } + } + if ((convbuf = MALLOC(nbytes + 1)) == NULL) + return (NULL); + + /* Fill the output buffer. */ + p = wcsarg; + mbs = initial; + if ((nbytes = wcsrtombs_l(convbuf, (const wchar_t **)&p, + nbytes, &mbs, loc)) == (size_t)-1) { + free(convbuf); + return (NULL); + } + convbuf[nbytes] = '\0'; + return (convbuf); +} + + +/* 's' ---------------------------------------------------------------*/ + +__private_extern__ int +__printf_arginfo_str(const struct printf_info *pi, size_t n, int *argt) +{ + + assert (n > 0); + if (pi->is_long || pi->spec == 'C') + argt[0] = PA_WSTRING; + else + argt[0] = PA_STRING; + return (1); +} + +__private_extern__ int +__printf_render_str(struct __printf_io *io, const struct printf_info *pi, const void *const *arg) +{ + const char *p; + wchar_t *wcp; + char *convbuf; + int l; + + if (pi->is_long || pi->spec == 'S') { + wcp = *((wint_t **)arg[0]); + if (wcp == NULL) + return (__printf_out(io, pi, "(null)", 6)); + convbuf = __wcsconv(wcp, pi->prec, pi->loc); + if (convbuf == NULL) + return (-1); + l = __printf_out(io, pi, convbuf, strlen(convbuf)); + __printf_flush(io); + free(convbuf); + return (l); + } + p = *((char **)arg[0]); + if (p == NULL) + return (__printf_out(io, pi, "(null)", 6)); + l = strlen(p); + if (pi->prec >= 0 && pi->prec < l) + l = pi->prec; + return (__printf_out(io, pi, p, l)); +} + +/* 'c' ---------------------------------------------------------------*/ + +__private_extern__ int +__printf_arginfo_chr(const struct printf_info *pi, size_t n, int *argt) +{ + + assert (n > 0); +#ifdef VECTORS + if (pi->is_vec) + argt[0] = PA_VECTOR; + else +#endif /* VECTORS */ + if (pi->is_long || pi->spec == 'C') + argt[0] = PA_WCHAR; + else + argt[0] = PA_INT; + return (1); +} + +__private_extern__ int +__printf_render_chr(struct __printf_io *io, const struct printf_info *pi, const void *const *arg) +{ + int i; + wint_t ii; + unsigned char c; + static const mbstate_t initial; /* XXX: this is bogus! */ + mbstate_t mbs; + size_t mbseqlen; + char buf[MB_CUR_MAX_L(pi->loc)]; + +#ifdef VECTORS + if (pi->is_vec) return __xprintf_vector(io, pi, arg); +#endif /* VECTORS */ + + if (pi->is_long || pi->spec == 'C') { + int ret; + ii = *((wint_t *)arg[0]); + + mbs = initial; + mbseqlen = wcrtomb_l(buf, (wchar_t)ii, &mbs, pi->loc); + if (mbseqlen == (size_t) -1) + return (-1); + ret = __printf_out(io, pi, buf, mbseqlen); + __printf_flush(io); + return ret; + } + i = *((int *)arg[0]); + c = i; + i = __printf_out(io, pi, &c, 1); + __printf_flush(io); + return (i); +} diff --git a/stdio/FreeBSD/xprintf_time.c b/stdio/FreeBSD/xprintf_time.c new file mode 100644 index 0000000..050fd49 --- /dev/null +++ b/stdio/FreeBSD/xprintf_time.c @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/xprintf_time.c,v 1.6 2011/03/06 19:47:46 pjd Exp $ + */ +#include +#include +#include +#include +#include +#include +#include "printf.h" +#include "xprintf_private.h" + +__private_extern__ int +__printf_arginfo_time(const struct printf_info *pi, size_t n, int *argt) +{ + + assert(n >= 1); + argt[0] = PA_POINTER; + return (1); +} +#define MINUTE 60 +#define HOUR (60 * MINUTE) +#define DAY (24 * HOUR) +#define YEAR (365 * DAY) + +__private_extern__ int +__printf_render_time(struct __printf_io *io, const struct printf_info *pi, const void *const *arg) +{ + char buf[100]; + char *p; + struct timeval *tv; + struct timespec *ts; + time_t *tp; + intmax_t t, tx; + int i, prec, nsec, ret; + + if (pi->is_long) { + tv = *((struct timeval **)arg[0]); + t = tv->tv_sec; + nsec = tv->tv_usec * 1000; + prec = 6; + } else if (pi->is_long_double) { + ts = *((struct timespec **)arg[0]); + t = ts->tv_sec; + nsec = ts->tv_nsec; + prec = 9; + } else { + tp = *((time_t **)arg[0]); + t = *tp; + nsec = 0; + prec = 0; + } + if (pi->is_long || pi->is_long_double) { + if (pi->prec >= 0) + prec = pi->prec; + if (prec == 0) + nsec = 0; + } + + p = buf; + if (pi->alt) { + tx = t; + if (t >= YEAR) { + p += sprintf(p, "%jdy", t / YEAR); + t %= YEAR; + } + if (tx >= DAY && (t != 0 || prec != 0)) { + p += sprintf(p, "%jdd", t / DAY); + t %= DAY; + } + if (tx >= HOUR && (t != 0 || prec != 0)) { + p += sprintf(p, "%jdh", t / HOUR); + t %= HOUR; + } + if (tx >= MINUTE && (t != 0 || prec != 0)) { + p += sprintf(p, "%jdm", t / MINUTE); + t %= MINUTE; + } + if (t != 0 || tx == 0 || prec != 0) + p += sprintf(p, "%jds", t); + } else { + p += sprintf(p, "%jd", (intmax_t)t); + } + if (prec != 0) { + for (i = prec; i < 9; i++) + nsec /= 10; + p += sprintf(p, ".%.*d", prec, nsec); + } + ret = __printf_out(io, pi, buf, p - buf); + __printf_flush(io); + return (ret); +} diff --git a/stdio/FreeBSD/xprintf_vis.c b/stdio/FreeBSD/xprintf_vis.c new file mode 100644 index 0000000..013d0b0 --- /dev/null +++ b/stdio/FreeBSD/xprintf_vis.c @@ -0,0 +1,79 @@ +/*- + * Copyright (c) 2005 Poul-Henning Kamp + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdio/xprintf_vis.c,v 1.2 2006/01/25 12:45:24 phk Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "printf.h" +#include "xprintf_private.h" + +__private_extern__ int +__printf_arginfo_vis(const struct printf_info *pi, size_t n, int *argt) +{ + + assert(n >= 1); + argt[0] = PA_POINTER; + return (1); +} + +__private_extern__ int +__printf_render_vis(struct __printf_io *io, const struct printf_info *pi, const void *const *arg) +{ + char *p, *buf; + unsigned l; + int ret; + + ret = 0; + p = *((char **)arg[0]); + if (p == NULL) + return (__printf_out(io, pi, "(null)", 6)); + if (pi->prec >= 0) + l = pi->prec; + else + l = strlen(p); + buf = MALLOC(l * 4 + 1); + if (buf == NULL) + return (-1); + if (pi->showsign) + ret = strvisx(buf, p, l, VIS_WHITE | VIS_HTTPSTYLE); + else if (pi->pad == '0') + ret = strvisx(buf, p, l, VIS_WHITE | VIS_OCTAL); + else if (pi->alt) + ret = strvisx(buf, p, l, VIS_WHITE); + else + ret = strvisx(buf, p, l, VIS_WHITE | VIS_CSTYLE | VIS_OCTAL); + ret += __printf_out(io, pi, buf, ret); + __printf_flush(io); + free(buf); + return(ret); +} diff --git a/stdio/getwc_l.3 b/stdio/getwc_l.3 new file mode 100644 index 0000000..701b9b5 --- /dev/null +++ b/stdio/getwc_l.3 @@ -0,0 +1,78 @@ +.\" $NetBSD: getwc.3,v 1.3 2002/02/07 07:00:26 ross Exp $ +.\" +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getc.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/getwc.3,v 1.6 2004/03/16 13:30:11 tjr Exp $ +.\" +.Dd March 11, 2005 +.Dt GETWC_L 3 +.Os +.Sh NAME +.Nm fgetwc_l , +.Nm getwc_l , +.Nm getwchar_l +.Nd get next wide character from input stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.In xlocale.h +.Ft wint_t +.Fn fgetwc_l "FILE *stream" "locale_t loc" +.Ft wint_t +.Fn getwc_l "FILE *stream" "locale_t loc" +.Ft wint_t +.Fn getwchar_l "locale_t loc" +.Sh DESCRIPTION +The +.Fn fgetwc_l , +.Fn getwc_l , +and +.Fn getwchar_l +functions are extended locale versions of the +.Fn fgetwc , +.Fn getwc , +and +.Fn getwchar +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr getwc 3 , +.Xr xlocale 3 diff --git a/stdio/printf_l.3 b/stdio/printf_l.3 new file mode 100644 index 0000000..9ac0bcd --- /dev/null +++ b/stdio/printf_l.3 @@ -0,0 +1,182 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)printf.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/printf.3,v 1.58 2004/10/16 16:00:01 stefanf Exp $ +.\" +.Dd December 15, 2009 +.Dt PRINTF_L 3 +.Os +.Sh NAME +.Nm asprintf_l , +.Nm dprintf_l , +.Nm fprintf_l , +.Nm printf_l , +.Nm snprintf_l , +.Nm sprintf_l , +.Nm vasprintf_l , +.Nm vdprintf_l , +.Nm vfprintf_l , +.Nm vprintf_l , +.Nm vsnprintf_l , +.Nm vsprintf_l +.Nd formatted output conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In xlocale.h +.Ft int +.Fo asprintf_l +.Fa "char **ret" +.Fa "locale_t loc" +.Fa "const char *format" +.Fa ... +.Fc +.Ft int +.Fo dprintf_l +.Fa "int fd" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa ... +.Fc +.Ft int +.Fo fprintf_l +.Fa "FILE * restrict stream" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa ... +.Fc +.Ft int +.Fo printf_l +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa ... +.Fc +.Ft int +.Fo snprintf_l +.Fa "char * restrict str" +.Fa "size_t size" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa ... +.Fc +.Ft int +.Fo sprintf_l +.Fa "char * restrict str" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa ... +.Fc +.In stdarg.h +.In xlocale.h +.Ft int +.Fo vasprintf_l +.Fa "char **ret" +.Fa "locale_t loc" +.Fa "const char *format" +.Fa "va_list ap" +.Fc +.Ft int +.Fo vdprintf_l +.Fa "int fd" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa "va_list ap" +.Fc +.Ft int +.Fo vfprintf_l +.Fa "FILE * restrict stream" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa "va_list ap" +.Fc +.Ft int +.Fo vprintf_l +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa "va_list ap" +.Fc +.Ft int +.Fo vsnprintf_l +.Fa "char * restrict str" +.Fa "size_t size" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa "va_list ap" +.Fc +.Ft int +.Fo vsprintf_l +.Fa "char * restrict str" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa "va_list ap" +.Fc +.Sh DESCRIPTION +The +.Fn printf_l , +.Fn dprintf_l , +.Fn fprintf_l , +.Fn sprintf_l , +.Fn snprintf_l , +.Fn asprintf_l , +.Fn vprintf_l , +.Fn vdprintf_l , +.Fn vfprintf_l , +.Fn vsprintf_l , +.Fn vsnprintf_l , +and +.Fn vasprintf_l +functions are extended locale versions of the +.Fn printf , +.Fn dprintf , +.Fn fprintf , +.Fn sprintf , +.Fn snprintf , +.Fn asprintf , +.Fn vprintf , +.Fn vdprintf , +.Fn vfprintf , +.Fn vsprintf , +.Fn vsnprintf , +and +.Fn vasprintf +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr printf 3 , +.Xr xlocale 3 diff --git a/stdio/putwc_l.3 b/stdio/putwc_l.3 new file mode 100644 index 0000000..ce403bc --- /dev/null +++ b/stdio/putwc_l.3 @@ -0,0 +1,78 @@ +.\" $NetBSD: putwc.3,v 1.2 2002/02/07 07:00:26 ross Exp $ +.\" +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)putc.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdio/putwc.3,v 1.7 2004/03/16 13:30:11 tjr Exp $ +.\" +.Dd March 11, 2005 +.Dt PUTWC_L 3 +.Os +.Sh NAME +.Nm fputwc_l , +.Nm putwc_l , +.Nm putwchar_l +.Nd output a wide character to a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.In xlocale.h +.Ft wint_t +.Fn fputwc_l "wchar_t wc" "FILE *stream" "locale_t loc" +.Ft wint_t +.Fn putwc_l "wchar_t wc" "FILE *stream" "locale_t loc" +.Ft wint_t +.Fn putwchar_l "wchar_t wc" "locale_t loc" +.Sh DESCRIPTION +The +.Fn fputwc_l , +.Fn putwc_l , +and +.Fn putwchar_l +functions are extended locale versions of the +.Fn fputwc , +.Fn putwc , +and +.Fn putwchar +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr putwc 3 , +.Xr xlocale 3 diff --git a/stdio/scanf_l.3 b/stdio/scanf_l.3 new file mode 100644 index 0000000..90bea68 --- /dev/null +++ b/stdio/scanf_l.3 @@ -0,0 +1,120 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)scanf.3 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD: src/lib/libc/stdio/scanf.3,v 1.24 2003/06/28 09:03:25 das Exp $ +.\" +.Dd March 11, 2005 +.Dt SCANF_L 3 +.Os +.Sh NAME +.Nm fscanf_l , +.Nm scanf_l , +.Nm sscanf_l , +.Nm vfscanf_l , +.Nm vscanf_l , +.Nm vsscanf_l +.Nd input format conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In xlocale.h +.Ft int +.Fo fscanf_l +.Fa "FILE * restrict stream" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa ... +.Fc +.Ft int +.Fo scanf_l +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa ... +.Fc +.Ft int +.Fo sscanf_l +.Fa "const char * restrict str" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa ... +.Fc +.In stdarg.h +.In xlocale.h +.Ft int +.Fo vfscanf_l +.Fa "FILE * restrict stream" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa "va_list ap" +.Fc +.Ft int +.Fo vscanf_l +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa "va_list ap" +.Fc +.Ft int +.Fo vsscanf_l +.Fa "const char * restrict str" +.Fa "locale_t loc" +.Fa "const char * restrict format" +.Fa "va_list ap" +.Fc +.Sh DESCRIPTION +The +.Fn scanf_l , +.Fn fscanf_l , +.Fn sscanf_l , +.Fn vscanf_l , +.Fn vsscanf_l , +and +.Fn vfscanf_l +functions are extended locale versions of the +.Fn scanf , +.Fn fscanf , +.Fn sscanf , +.Fn vscanf , +.Fn vsscanf , +and +.Fn vfscanf +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr scanf 3 , +.Xr xlocale 3 diff --git a/stdio/wprintf_l.3 b/stdio/wprintf_l.3 new file mode 100644 index 0000000..1af3bab --- /dev/null +++ b/stdio/wprintf_l.3 @@ -0,0 +1,89 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)printf.3 8.1 (Berkeley) 6/4/93 +.\" FreeBSD: src/lib/libc/stdio/printf.3,v 1.47 2002/09/06 11:23:55 tjr Exp +.\" $FreeBSD: src/lib/libc/stdio/wprintf.3,v 1.5 2003/07/05 07:55:34 tjr Exp $ +.\" +.Dd March 11, 2005 +.Dt WPRINTF_L 3 +.Os +.Sh NAME +.Nm wprintf_l , fwprintf_l , swprintf_l , +.Nm vwprintf_l , vfwprintf_l , vswprintf_l +.Nd formatted wide character output conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.In xlocale.h +.Ft int +.Fn fwprintf_l "FILE * restrict stream" "locale_t loc" "const wchar_t * restrict format" ... +.Ft int +.Fn swprintf_l "wchar_t * restrict ws" "size_t n" "locale_t loc" "const wchar_t * restrict format" ... +.Ft int +.Fn wprintf_l "locale_t loc" "const wchar_t * restrict format" ... +.In stdarg.h +.Ft int +.Fn vfwprintf_l "FILE * restrict stream" "locale_t loc" "const wchar_t * restrict" "va_list ap" +.Ft int +.Fn vswprintf_l "wchar_t * restrict ws" "size_t n" "locale_t loc" "const wchar_t *restrict format" "va_list ap" +.Ft int +.Fn vwprintf_l "locale_t loc" "const wchar_t * restrict format" "va_list ap" +.Sh DESCRIPTION +The +.Fn wprintf_l , +.Fn fwprintf_l , +.Fn swprintf_l , +.Fn vwprintf_l , +.Fn vfwprintf_l , +and +.Fn vswprintf_l +functions are extended locale versions of the +.Fn wprintf , +.Fn fwprintf , +.Fn swprintf , +.Fn vwprintf , +.Fn vfwprintf , +and +.Fn vswprintf +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr wprintf 3 , +.Xr xlocale 3 diff --git a/stdio/wscanf_l.3 b/stdio/wscanf_l.3 new file mode 100644 index 0000000..907d00f --- /dev/null +++ b/stdio/wscanf_l.3 @@ -0,0 +1,122 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)scanf.3 8.2 (Berkeley) 12/11/93 +.\" FreeBSD: src/lib/libc/stdio/scanf.3,v 1.24 2003/06/28 09:03:25 das Exp +.\" $FreeBSD: src/lib/libc/stdio/wscanf.3,v 1.6 2003/07/05 07:47:55 tjr Exp $ +.\" +.Dd March 11, 2005 +.Dt WSCANF_L 3 +.Os +.Sh NAME +.Nm fwscanf_l , +.Nm swscanf_l , +.Nm vfwscanf_l , +.Nm vswscanf_l , +.Nm vwscanf_l , +.Nm wscanf_l +.Nd wide character input format conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In wchar.h +.In xlocale.h +.Ft int +.Fo fwscanf_l +.Fa "FILE * restrict stream" +.Fa "locale_t loc" +.Fa "const wchar_t * restrict format" +.Fa ... +.Fc +.Ft int +.Fo swscanf_l +.Fa "const wchar_t * restrict str" +.Fa "locale_t loc" +.Fa "const wchar_t * restrict format" +.Fa ... +.Fc +.Ft int +.Fo wscanf_l +.Fa "locale_t loc" +.Fa "const wchar_t * restrict format" +.Fa ... +.Fc +.In stdarg.h +.In xlocale.h +.Ft int +.Fo vfwscanf_l +.Fa "FILE * restrict stream" +.Fa "locale_t loc" +.Fa "const wchar_t * restrict format" +.Fa "va_list ap" +.Fc +.Ft int +.Fo vswscanf_l +.Fa "const wchar_t * restrict str" +.Fa "locale_t loc" +.Fa "const wchar_t * restrict format" +.Fa "va_list ap" +.Fc +.Ft int +.Fo vwscanf_l +.Fa "locale_t loc" +.Fa "const wchar_t * restrict format" +.Fa "va_list ap" +.Fc +.Sh DESCRIPTION +The +.Fn wscanf_l , +.Fn fwscanf_l , +.Fn swscanf_l , +.Fn vwscanf_l , +.Fn vswscanf_l , +and +.Fn vfwscanf_l +functions are extended locale versions of the +.Fn wscanf , +.Fn fwscanf , +.Fn swscanf , +.Fn vwscanf , +.Fn vswscanf , +and +.Fn vfwscanf +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr wscanf 3 , +.Xr xlocale 3 diff --git a/stdio/xprintf.3 b/stdio/xprintf.3 new file mode 100644 index 0000000..fba50ae --- /dev/null +++ b/stdio/xprintf.3 @@ -0,0 +1,64 @@ +.Dd Aug 19, 2012 +.Dt XPRINTF 3 +.Os Darwin +.Sh NAME +.Nm asxprintf , dxprintf , fxprintf , sxprintf , xprintf , +.Nm vasxprintf , vdxprintf , vfxprintf , vsxprintf , vxprintf +.Nd extensible printf +.Sh SYNOPSIS +.In printf.h +.Ft int +.Fn asxprintf "char ** restrict ret" "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" ... +.Ft int +.Fn dxprintf "int fd" "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" ... +.Ft int +.Fn fxprintf "FILE * restrict stream" "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" ... +.Ft int +.Fn sxprintf "char * restrict str" "size_t size" "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" ... +.Ft int +.Fn xprintf "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" ... +.In stdarg.h +.Ft int +.Fn vasxprintf "char ** restrict ret" "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vdxprintf "int fd" "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vfxprintf "FILE * restrict stream" "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsxprintf "char * restrict str" "size_t size" "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vxprintf "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict format" "va_list ap" +.Sh DESCRIPTION +These extensible printf (see +.Xr xprintf 5 ) +variants behave like their normal printf counterparts +(see +.Xr printf 3 ) +without +.Sq Li x +in the name (except +.Fn sxprintf +and +.Fn vsxprintf +behave like +.Fn snprintf +and +.Fn vsnprintf , +respectively). +.Pp +The +.Va domain +argument must be a pointer to a printf domain structure, as returned by one of +the functions described in +.Xr xprintf_domain 3 . +The +.Va loc +argument should be an extended locale (see +.Xr xlocale 3 ) +or NULL, which means to use the current locale in effect (either the per-thread +locale if set, or the global locale by default). +.Sh SEE ALSO +.Xr printf 3 , +.Xr xlocale 3 , +.Xr xprintf_domain 3 , +.Xr xprintf 5 diff --git a/stdio/xprintf.5 b/stdio/xprintf.5 new file mode 100644 index 0000000..442f504 --- /dev/null +++ b/stdio/xprintf.5 @@ -0,0 +1,533 @@ +.Dd Aug 19, 2012 +.Dt XPRINTF 5 +.Os Darwin +.Sh NAME +.Nm xprintf +.Nd extensible printf +.Sh SYNOPSIS +.In printf.h +.Ft "typedef int" +.Fn printf_arginfo_function "const struct printf_info *info" "size_t n" "int *argtypes" +.Ft "typedef int" +.Fn printf_function "FILE *stream" "const struct printf_info *info" "const void *const *args" +.Sh DESCRIPTION +The standard +.Xr printf 3 +family of routines provides a convenient way to convert one or more arguments +to various forms for output, under the control of a format string. +The format string may contain any number of conversion specifications, which +start with the +.Sq Li % +character and end with a conversion specifier character (like +.Sq Li d +or +.Sq Li f ) , +with conversion flag characters in-between. +.Pp +Extensible printf is an enhancement that allows adding new (user-defined) +conversion specifiers, or modifying/removing existing ones. +The implementation of extensible printf in Mac OS X is derived from the +FreeBSD version, which is based on the one in GNU libc (GLIBC). +Documentation for the GLIBC version is available at: +.Pp +.Li http://www.gnu.org/software/libc/manual/html_node/Customizing-Printf.html +.Pp +The main problem with the usual forms of extensible printf is that +changes to +.Xr printf 3 +are program-wide. +But this is unsafe, since frameworks, +libraries or some other thread could change printf behavior in ways +unexpected by the main program, or the latter could unexpectedly affect the +former. +.Pp +So instead, the implementation used in Mac OS X makes +changes to conversion specifiers within printf domains, +which are independent structures containing the specifier definitions. +These domains are created as described in +.Xr xprintf_domain 3 , +and once set up, it can be passed to a +.Xr xprintf 3 +variant along with the format string and arguments to generate output. +The standard +.Xr printf 3 +behavior is never affected. +.Pp +To define a new conversion specifier, two function typedefs are defined, and +the user must provide two functions based on these typedefs. +These functions will get called from extensible printf while processing +the corresponding conversion specification. +.Pp +During the first of three phases of extensible printf processing, the format +string is parsed, and for each conversion specification, a +.Vt struct printf_info +is created, containing the option flags specified in the +conversion specification as well as other settings. +Important fields in +.Vt struct printf_info +are: +.Bl -tag -width ".Va is_long_double" +.It Va alt +Boolean value whether the +.Sq Li # +flag was specified. +.It Va context +A +.Vt void * +pointer to arbitrary data specified in the original call to +.Xr register_printf_domain_function 3 . +.It Va group +Boolean value whether the +.Sq Li ' +flag was specified. +.It Va is_char +Boolean value whether the +.Sq Li hh +flag was specified. +.It Va is_intmax +Boolean value whether the +.Sq Li j +flag was specified. +.It Va is_long +Boolean value whether the +.Sq Li l +flag was specified. +.It Va is_long_double +Boolean value whether the +.Sq Li L +or +.Sq Li ll +flags were specified. +.It Va is_ptrdiff +Boolean value whether the +.Sq Li t +flag was specified. +.It Va is_quad +Boolean value whether the +.Sq Li q +flag was specified. +.It Va is_short +Boolean value whether the +.Sq Li h +flag was specified. +.It Va is_size +Boolean value whether the +.Sq Li z +flag was specified. +.It Va is_vec +Boolean value whether the +.Sq Li v +flag was specified. +.It Va left +Boolean value whether the +.Sq Li - +flag was specified. +.It Va loc +The extended locale (see +.Xr xlocale 3 ) +specified by the extensible printf caller (never +.Dv NULL ) . +.It Va pad +The padding character; either +.Sq Li 0 +or space. +.It Va prec +The value of the optional precision. +-1 means the precision was unspecified. +.It Va showsign +Boolean value whether the +.Sq Li + +flag was specified. +.It Va signchar +The sign character, either +.Sq Li + , +space or zero if none. +.It Va space +Boolean value whether the space flag was specified. +.It Va spec +The specifier character itself. +.It Va vsep +The separator character between vector items (using the +.Sq Li v +flag). +Can be any one of the four characters +.Dq Li ,:;_ +or +.Sq Li X +if no separator character was specified (meaning that a space is used as the +separator, unless the specifier is +.Sq Li c , +in which case no separator is used). +.It Va width +The value of the minimum field width (defaults to zero). +.El +.Pp +All other structure fields are either unused or private (and shouldn't be +used). +.Pp +This +.Vt struct printf_info +structure is then passed to the corresponding +.Nm printf_arginfo_function +callback function. +The callback function should return the number of consecutive arguments the +specifier handles, including zero (the maximum number of consecutive arguments +a single specifier can handle is +.Dv __PRINTFMAXARG , +which is currently set to 2, but could be increased in the future if there is +need). +.Pp +The callback function is also passed an integer array and the length of that +array; the length will typically be +.Dv __PRINTFMAXARG . +The function should fill out the array up to the number of arguments it expects, +using the following values: +.Bl -tag -width ".Dv PA_POINTER" +.It Dv PA_CHAR +The argument type is an +.Vt int +cast to a +.Vt char . +.It Dv PA_DOUBLE +The argument type is a +.Vt double . +OR-ing +.Dv PA_DOUBLE +with +.Dv PA_FLAG_LONG_DOUBLE +specifies a +.Vt "long double" +type. +.It Dv PA_FLOAT +(Defined but unused; best to avoid, since +.Vt float +is automatically promoted to +.Vt double +anyways.) +.It Dv PA_INT +The argument type is +.Vt int +(either signed or unsigned). +The size can be adjusted by OR-ing the following values to +.Dv PA_INT : +.Bl -tag -width ".Dv PA_FLAG_LONG_LONG" +.It Dv PA_FLAG_INTMAX +The integer is the size of a +.Vt intmax_t . +.It Dv PA_FLAG_LONG +The integer is the size of a +.Vt long . +.It Dv PA_FLAG_LONG_LONG +The integer is the size of a +.Vt "long long" . +.It Dv PA_FLAG_PTRDIFF +The integer is the size of a +.Vt ptrdiff_t . +.It Dv PA_FLAG_QUAD +The integer is the size of a +.Vt quad_t +(deprecated). +.It Dv PA_FLAG_SHORT +The integer is the size of a +.Vt short . +.It Dv PA_FLAG_SIZE +The integer is the size of a +.Vt size_t . +.El +.It Dv PA_POINTER +The argument type is a pointer type, cast to a +.Vt "void *" . +.It Dv PA_STRING +The argument type is a null-terminated character string +.Vt ( "char *" ) . +.It Dv PA_VECTOR +The argument type is an AltiVec or SSE vector (16 bytes). +.It Dv PA_WCHAR +The argument type is a +.Vt wchar_t . +.It Dv PA_WSTRING +The argument type is a null-terminated wide character string +.Vt ( "wchar_t *" ) . +.El +.Pp +After the +.Nm printf_arginfo_function +returns, phase 2 of extensible printf processing involves converting the +argument according to the types specified by the returned type array. +Note that positional arguments are dealt with here as well. +.Pp +Then in phase 3, output is generated, either from the text in-between the +conversion specifications, or by calling the so-called rendering functions +associated with each conversion specifier (with typedef +.Nm printf_function ) . +The rendering function is passed the same +.Vt struct printf_info +structure, as well as an array of pointers to each of the arguments converted +in phase 2 that it is responsible for. +The callback should write its output to the provided output +stdio stream, and then return the number of characters written. +.Sh EXAMPLE +Here is an example that demonstrates many of the features of extensible printf: +.Bd -literal +#include +#include +#include +#include +#include +#include + +/* The Coordinate type */ +typedef struct { + double x; + double y; +} Coordinate; + +#define L (1 << 0) +#define P (1 << 1) + +/* The renderer callback for Coordinate */ +static int +print_coordinate (FILE *stream, const struct printf_info *info, + const void *const *args) +{ + const Coordinate *c; + int width, ret, which = 0; + char fmt[32]; + char *bp, *cp, *ep; + /* The optional coordinate labels */ + const char **labels = (const char **)info->context; + + /* Get the argument pointer to a Coordinate */ + c = *((const Coordinate **) (args[0])); + + /* Set up the format string */ + cp = fmt; + if(info->alt) *cp++ = '('; + bp = cp; + if(labels) { + which |= L; + *cp++ = '%'; + *cp++ = 's'; + } + *cp++ = '%'; + if(info->group) *cp++ = '\e''; + *cp++ = '*'; + if(info->prec >= 0) { + which |= P; + *cp++ = '.'; + *cp++ = '*'; + } + *cp++ = 'l'; + *cp++ = 'f'; + ep = cp; + if(info->alt) *cp++ = ','; + *cp++ = ' '; + while(bp < ep) *cp++ = *bp++; + if(info->alt) *cp++ = ')'; + *cp = 0; + + width = info->left ? -info->width : info->width; + + /* Output to the given stream */ + switch(which) { + case 0: + ret = fprintf_l(stream, info->loc, fmt, width, c->x, width, c->y); + break; + case L: + ret = fprintf_l(stream, info->loc, fmt, labels[0], width, c->x, + labels[1], width, c->y); + break; + case P: + ret = fprintf_l(stream, info->loc, fmt, width, info->prec, c->x, + width, info->prec, c->y); + break; + case (L | P): + ret = fprintf_l(stream, info->loc, fmt, labels[0], width, + info->prec, c->x, labels[1], width, info->prec, + c->y); + break; + } + + return ret; +} + +/* The arginfo callback for Coordinate */ +static int +coordinate_arginfo (const struct printf_info *info, size_t n, + int *argtypes) +{ + /* We always take exactly one argument and this is a pointer to the + structure.. */ + if (n > 0) + argtypes[0] = PA_POINTER; + return 1; +} + +int +main (void) +{ + Coordinate mycoordinate = {12345.6789, 3.141593}; + printf_domain_t domain; + locale_t loc; + const char *labels[] = {"x=", "y="}; + + /* Set up a domain to add support for Coordinate conversion */ + domain = new_printf_domain(); + if(!domain) + err(1, "new_printf_domain"); + /* Set up an extended locale to test locale support */ + loc = newlocale(LC_ALL_MASK, "uk_UA.UTF-8", NULL); + if(!loc) + err(1, "newlocale"); + + /* Register the callbacks for Coordinates in the domain */ + register_printf_domain_function (domain, 'C', print_coordinate, + coordinate_arginfo, NULL); + + /* Print the coordinate using the current locale (C). */ + xprintf(domain, NULL, "|%'C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'14C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'-14.2C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'#C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'#14C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'#-14.2C|\en", &mycoordinate); + + printf("-------------\en"); + /* Reregister the callbacks, specifying coordinate labels + * and setting the global locale (notice thousands separator) */ + register_printf_domain_function (domain, 'C', print_coordinate, + coordinate_arginfo, labels); + if(setlocale(LC_ALL, "en_US.UTF-8") == NULL) + errx(1, "setlocale"); + + /* Reprint with labels */ + xprintf(domain, NULL, "|%'C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'14C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'-14.2C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'#C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'#14C|\en", &mycoordinate); + xprintf(domain, NULL, "|%'#-14.2C|\en", &mycoordinate); + + printf("-------------\en"); + /* Now print with the test locale (notice decimal point and + * thousands separator) */ + xprintf(domain, loc, "|%'C|\en", &mycoordinate); + xprintf(domain, loc, "|%'14C|\en", &mycoordinate); + xprintf(domain, loc, "|%'-14.2C|\en", &mycoordinate); + xprintf(domain, loc, "|%'#C|\en", &mycoordinate); + xprintf(domain, loc, "|%'#14C|\en", &mycoordinate); + xprintf(domain, loc, "|%'#-14.2C|\en", &mycoordinate); + + return 0; +} +.Ed +.Pp +This example defines a Coordinate type, that consists of a pair of doubles. +We create a conversion specifier that displays a Coordinate type, either just +as two floating point numbers, or with the +.Sq Li # +(alternate form) flag, as parenthesized numbers separated by a comma. +Note the use of +.Nm printf_l +to do the actual output; this is using regular printf from within an extensible +printf renderer callback. +The use of +.Nm printf_l +also insures correct handling of extended locales. +.Pp +The output of the programs looks like: +.Bd -literal +|12345.678900 3.141593| +| 12345.678900 3.141593| +|12345.68 3.14 | +|(12345.678900, 3.141593)| +|( 12345.678900, 3.141593)| +|(12345.68 , 3.14 )| +------------- +|x=12,345.678900 y=3.141593| +|x= 12,345.678900 y= 3.141593| +|x=12,345.68 y=3.14 | +|(x=12,345.678900, y=3.141593)| +|(x= 12,345.678900, y= 3.141593)| +|(x=12,345.68 , y=3.14 )| +------------- +|x=12 345,678900 y=3,141593| +|x= 12 345,678900 y= 3,141593| +|x=12 345,68 y=3,14 | +|(x=12 345,678900, y=3,141593)| +|(x= 12 345,678900, y= 3,141593)| +|(x=12 345,68 , y=3,14 )| +.Ed +.Pp +Notice: +.Bl -bullet +.It +Field width, precision and left adjustment are applied to each of the numbers. +.It +The alternate form, using parenthesized numbers separated by a comma. +.It +In the second group of six, the thousands separator corresponds to the +global locale setting +.Pq Li en_US.UTF-8 . +.It +The second and third group have a label for each number, provide through +the user-defined context argument. +.It +The third group has the decimal point and thousands separator of the extended +locale argument +.Pq Li uk_UA.UTF-8 . +.El +.Sh PERFORMANCE +Because of the three phase processing of extensible printf, as well as the +use of two callbacks for each conversion specifier, performance is +considerably slower than the one pass, highly optimized regular +.Xr printf 3 . +Recursive use of +.Xr printf 3 +from within an extensible printf renderer callback +(as in the +.Sx EXAMPLE +above) adds additional overhead. +.Pp +To ameliorate some of this slowness, the concept of separate compilation +and execution phases has be added to extensible printf. +The functions in +.Xr xprintf_comp 3 +allow the creation of pre-compiled extensible printf structures (performing +phase one of extensible printf processing). +These pre-compiled structures can then be passed to the printf variants in +.Xr xprintf_exec 3 +to produce the actual output (performing phases 2 and 3). +The compilation phase need only be done once, while execution can be performed +any number of times. +.Pp +A simple example of use is: +.Bd -literal + printf_comp_t pc = new_printf_comp(domain, loc, "%d: %C\en"); + for(i = 0; i = sizeof(coords) / sizeof(*coords); i++) { + xprintf_exec(pc, i, &coords[i]); + } + free_printf_comp(pc); +.Ed +.Pp +Here, +.Va coords +is a array containing +.Vt Coordinate +structures that are to be printed and the +.Va domain +and +.Va loc +variables are as from +.Sx EXAMPLE +above. +(Error checking on the return value from +.Fn new_printf_comp +is not shown). +.Sh SEE ALSO +.Xr printf 3 , +.Xr xlocale 3 , +.Xr xprintf 3 , +.Xr xprintf_comp 3 , +.Xr xprintf_domain 3 , +.Xr xprintf_exec 3 diff --git a/stdio/xprintf_all_in_one.c b/stdio/xprintf_all_in_one.c new file mode 100644 index 0000000..69b7194 --- /dev/null +++ b/stdio/xprintf_all_in_one.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#define __va_list __darwin_va_list + +#include +#include +#include +#include + +int +asxprintf(char ** __restrict ret, printf_domain_t __restrict domain, + locale_t __restrict loc, const char * __restrict format, ...) +{ + int iret; + va_list ap; + + va_start(ap, format); + iret = _vasprintf(NULL, domain, ret, loc, format, ap); + va_end(ap); + return iret; +} + +int +dxprintf(int fd, printf_domain_t __restrict domain, locale_t __restrict loc, + const char * __restrict format, ...) +{ + int ret; + va_list ap; + + va_start(ap, format); + ret = _vdprintf(NULL, domain, fd, loc, format, ap); + va_end(ap); + return ret; +} + +int +fxprintf(FILE * __restrict stream, printf_domain_t __restrict domain, + locale_t __restrict loc, const char * __restrict format, ...) +{ + int ret; + va_list ap; + + va_start(ap, format); + ret = __xvprintf(NULL, domain, stream, loc, format, ap); + va_end(ap); + return ret; +} + +int +sxprintf(char * __restrict str, size_t size, printf_domain_t __restrict domain, + locale_t __restrict loc, const char * __restrict format, ...) +{ + int ret; + va_list ap; + + va_start(ap, format); + ret = _vsnprintf(NULL, domain, str, size, loc, format, ap); + va_end(ap); + return ret; +} + +int +xprintf(printf_domain_t __restrict domain, locale_t __restrict loc, + const char * __restrict format, ...) +{ + int ret; + va_list ap; + + va_start(ap, format); + ret = __xvprintf(NULL, domain, stdout, loc, format, ap); + va_end(ap); + return ret; +} + +int +vasxprintf(char ** __restrict ret, printf_domain_t __restrict domain, + locale_t __restrict loc, const char * __restrict format, va_list ap) +{ + return _vasprintf(NULL, domain, ret, loc, format, ap); +} + +int +vdxprintf(int fd, printf_domain_t __restrict domain, locale_t __restrict loc, + const char * __restrict format, va_list ap) +{ + return _vdprintf(NULL, domain, fd, loc, format, ap); +} + +int +vfxprintf(FILE * __restrict stream, printf_domain_t __restrict domain, + locale_t __restrict loc, const char * __restrict format, va_list ap) +{ + return __xvprintf(NULL, domain, stream, loc, format, ap); +} + +int +vsxprintf(char * __restrict str, size_t size, printf_domain_t __restrict domain, + locale_t __restrict loc, const char * __restrict format, va_list ap) +{ + return _vsnprintf(NULL, domain, str, size, loc, format, ap); +} + +int +vxprintf(printf_domain_t __restrict domain, locale_t __restrict loc, + const char * __restrict format, va_list ap) +{ + return __xvprintf(NULL, domain, stdout, loc, format, ap); +} diff --git a/stdio/xprintf_comp.3 b/stdio/xprintf_comp.3 new file mode 100644 index 0000000..2e0af35 --- /dev/null +++ b/stdio/xprintf_comp.3 @@ -0,0 +1,66 @@ +.Dd Aug 19, 2012 +.Dt XPRINTF_COMP 3 +.Os Darwin +.Sh NAME +.Nm free_printf_comp , new_printf_comp +.Nd extensible printf compilation +.Sh SYNOPSIS +.In printf.h +.Ft void +.Fn free_printf_comp "printf_comp_t pc" +.Ft printf_comp_t +.Fn new_printf_comp "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict fmt" +.Sh DESCRIPTION +To ameliorate some of the slowness caused by the extra overhead in +extensible printf (see +.Xr xprintf 5 ) , +a compile/execute mechanism has been created. +The +.Fn new_printf_comp +function compiles the given format string, along with a printf domain +(see +.Xr xprintf_domain 3 ) +and an extended locale +(see +.Xr xlocale 3 ) , +and returns a +.Ft printf_comp_t +structure. +The domain may not be +.Dv NULL , +but the locale can be +.Dv NULL , +which means to use the current locale, either the per-thread locale if it +was set, or else the global locale. +Because the +.Ft printf_comp_t +structure records the domain and locale, care should be taken if either +of these are changed. +.Pp +Once a +.Ft printf_comp_t +structure is created, it can be passed to one of the extensible printf +execution variants, described in +.Xr xprintf_exec 3 , +along with the necessary arguments. +Creating the +.Ft printf_comp_t +structure needs to be done only once, but it can be passed +to extensible printf execution variants any number of times. +.Pp +When the +.Ft printf_comp_t +structure is no longer needed, it should be passed to +.Fn free_printf_comp +to release internal memory. +.Sh RETURN VALUES +The +.Fn new_printf_comp +function returns the new structure, or +.Dv NULL +on error (usually NULL domain or out of memory condition). +.Sh SEE ALSO +.Xr xlocale 3 , +.Xr xprintf_domain 3 , +.Xr xprintf_exec 3 , +.Xr xprintf 5 diff --git a/stdio/xprintf_comp.c b/stdio/xprintf_comp.c new file mode 100644 index 0000000..75787ca --- /dev/null +++ b/stdio/xprintf_comp.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include "xprintf_domain.h" +#include "xprintf_private.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpointer-bool-conversion" + +void +free_printf_comp(printf_comp_t pc) +{ + if(!pc) return; + XL_RELEASE(pc->loc); +#ifdef XPRINTF_PERF + arrayfree(pc->pa); + free(pc->pa); + arrayfree(pc->aa); + free(pc->aa); + arrayfree(pc->ua); + free(pc->ua); +#else /* !XPRINTF_PERF */ + free(pc->pi); + free(pc->argt); + free(pc->args); +#endif /* !XPRINTF_PERF */ + pthread_mutex_destroy(&pc->mutex); + free(pc); +} + +printf_comp_t +new_printf_comp(printf_domain_t restrict domain, locale_t loc, const char * restrict fmt) +{ + int ret, saverrno; + printf_comp_t restrict pc; + + if(!domain) { + errno = EINVAL; + return NULL; + } + pc = MALLOC(sizeof(*pc) + strlen(fmt) + 1); + if(!pc) return NULL; + bzero(pc, sizeof(*pc)); + pc->mutex = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER; + pc->fmt = (const char *)(pc + 1); + strcpy((char *)pc->fmt, fmt); + DEFAULT_CURRENT_LOCALE(loc); + XL_RETAIN(loc); + pc->loc = loc; + xprintf_domain_init(); + pthread_rwlock_rdlock(&domain->rwlock); + ret = __printf_comp(pc, domain); + saverrno = errno; + pthread_rwlock_unlock(&domain->rwlock); + if(ret < 0) { + XL_RELEASE(loc); + pthread_mutex_destroy(&pc->mutex); + free(pc); + errno = saverrno; + return NULL; + } + return pc; +} +#pragma clang diagnostic pop + diff --git a/stdio/xprintf_domain.3 b/stdio/xprintf_domain.3 new file mode 100644 index 0000000..2336c46 --- /dev/null +++ b/stdio/xprintf_domain.3 @@ -0,0 +1,219 @@ +.Dd Aug 19, 2012 +.Dt XPRINTF_DOMAIN 3 +.Os Darwin +.Sh NAME +.Nm copy_printf_domain , free_printf_domain , new_printf_domain , +.Nm register_printf_domain_function , register_printf_domain_render_std +.Nd extensible printf domains +.Sh SYNOPSIS +.In printf.h +.Ft printf_domain_t +.Fn copy_printf_domain "printf_domain_t domain" +.Ft void +.Fn free_printf_domain "printf_domain_t domain" +.Ft printf_domain_t +.Fn new_printf_domain void +.Ft int +.Fn register_printf_domain_function "printf_domain_t domain" "int spec" "printf_function *render" "printf_arginfo_function *arginfo", "void *context" +.Ft int +.Fn register_printf_domain_render_std "printf_domain_t domain" "const char *specs" +.Sh DESCRIPTION +A printf domain is an extensible printf (see +.Xr xprintf 5 ) +structure defining a set of conversion specifiers that +will be used in calls to the routines discussed in +.Xr xprintf 3 +and +.Xr xprintf_comp 3 . +Domains can be modified independently of one another, and do not affect the +behavior of the normal printf calls in +.Xr printf 3 . +.Pp +To create a new domain, call +.Fn new_printf_domain ; +the standard POSIX conversion specifiers are defined by default. +To make a copy of an existing domain, use +.Fn copy_printf_domain . +When a domain is no longer needed, call +.Fn free_printf_domain +to release the associated memory. +.Pp +The +.Fn register_printf_domain_function +function is used to add, modify or remove conversion specifiers for a +given domain. +The +.Fa spec +argument is the specifier character, which can be any printable (non-control) +ASCII character, +except for those characters that are used as flag/option characters. +The set of flag/option characters includes the space character, and the +following: +.Pp +.Dl # $ ' * + \&, - \&. 0 1 2 3 4 5 6 7 8 9 \&: \&; L _ h j l q t v z +.Pp +Two user-defined callback function must also be given; see +.Xr xprintf 5 +for a description of these callback functions and an example of use. +Setting either or both callbacks to +.Dv NULL +deletes the given specifier from the domain. +Note that while it is permissible to redefine the standard conversion +specifiers, it is not usually recommended as it may cause confusion. +.Pp +The +.Fn register_printf_domain_render_std +function is used to add pre-defined conversion specifiers to the given domain. +The +.Fa specs +argument is a null-terminated C string containing one or more of the following +specifier characters: +.Bl -tag -width ".Li H" +.It Li H +Hex dump. +The +.Sq Li H +specifier takes two arguments; the first is a pointer to the data to +dump, while the second argument is the length of the data, given as type +.Vt unsigned . +Normally, 16 characters are displayed per line, as pairs of hex characters +separated by spaces. +Specifying a field width less than 16 will display that number of characters +per line. +Setting the +.Sq Li + +(showsign) flag will prefix each line with the hex offset of the beginning +character in that line. +Setting the +.Sq Li # +(alternate form) flag will postfix an ASCII representation to each line, with +.Sq Li \&. +representing non-printable characters. +.It Li M +Errno. +The +.Sq Li M +specifier displayed the text representation of the given +.Vt int +argument, expected to be a valid +.Va errno +value (as returned by +.Xr strerror 3 ) . +Invalid errno values are represent by the +.Dq Li errno= +string followed by the decimal and hex values of the argument. +.It Li Q +Quoted. +The +.Sq Li Q +specifier displays a null-terminated string argument as a C string, with +leading and trailing double quotes. +Newlines, carriage-returns and tabs are represented by +.Sq Li \en , +.Sq Li \er +and +.Sq Li \et , +respectively, while backslashes and double quotes are preceeded with a +backslash. +All other whitespace characters not including space itself (those in which +.Xr isspace 3 +returns true) are displayed as octal escape sequences (a backslash followed by +three octal digits). +All other characters print as themselves. +.It Li T +time_t/timeval/timespec. +The +.Sq Li T +specifier displays the three types of time values as a single decimal value. +The argument should be a pointer to the time value to be converted. +Setting the appropriate flags indicates which type is indicated: +.Bl -tag -width ".Pq none" +.It Li ll +The +.Sq Li ll +(long long) flag indicates the argument points to a +.Vt struct timespec +structure. +The default precision is 9. +.It Li l +The +.Sq Li l +(long) flag indicates the argument points to a +.Vt struct timeval +structure. +The default precision is 6. +.It Pq none +By default, the argument points to a +.Vt time_t +value. +The default precision is 0 (the fractional part is not displayed). +.El +.Pp +If the +.Sq Li # +(alternate form) flag is specified, the value is displayed in years, days, +hours, minutes and seconds, as in: +.Dq Li 3y123d21h59m59s.987654 +(zero values are not displayed at all). +Note that the years are 365 days (no leap days). +.It Li V +String vis. +The +.Sq Li V +specifier uses +.Xr strvisx 3 +to display the null-terminated C string argument. +The precision value can be used to limit the amount of the string that is +processed (defaults to the entire string). +.Pp +Flag values can be used to obtain different encodings: +.Bl -tag -width "(none)" +.It Li + +The +.Sq Li + +(showsign) flag uses the +.Dq Li VIS_WHITE | VIS_HTTPSTYLE +flag value to +.Xr strvisx 3 . +.It Li 0 +The +.Sq Li 0 +(leading zero) flag uses the +.Dq Li VIS_WHITE | VIS_OCTAL +flag value to +.Xr strvisx 3 . +.It Li # +The +.Sq Li # +(alternate form) flag uses the +.Dq Li VIS_WHITE +flag value to +.Xr strvisx 3 . +.It Pq none +The default flag value to +.Xr strvisx 3 +is +.Dq Li VIS_WHITE | VIS_CSTYLE | VIS_OCTAL . +.El +.El +.Sh RETURN VALUES +The +.Fn new_printf_domain +and +.Fn copy_printf_domain +functions return the new domain, or +.Dv NULL +on failure (usually out of memory condition). +.Pp +The +.Fn register_printf_domain_function +and +.Fn register_printf_domain_render_std +return zero on success and \-1 on failure (usually due to an improper specifier +character or out of memory condition). +.Sh SEE ALSO +.Xr printf 3 , +.Xr strvisx 3 , +.Xr xprintf 3 , +.Xr xprintf_comp 3 , +.Xr xprintf 5 diff --git a/stdio/xprintf_domain.c b/stdio/xprintf_domain.c new file mode 100644 index 0000000..468f7ad --- /dev/null +++ b/stdio/xprintf_domain.c @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include "xprintf_domain.h" +#include "xprintf_private.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpointer-bool-conversion" + +/* These are flag characters and can never be used as conversion specifiers */ +static const char _printf_tbl_flags[] = "#$'*+,-.0123456789:;L_hjlqtvz"; + +struct _printf_tbl_defaults_fbsd { + const char *spec; + printf_arginfo_function *arginfo; + printf_render *render; +}; +static struct _printf_tbl_defaults_fbsd _printf_tbl_defaults_fbsd[] = { + {"%", __printf_arginfo_pct, __printf_render_pct}, + {"AEFGaefg", __printf_arginfo_float, __printf_render_float}, + {"Cc", __printf_arginfo_chr, __printf_render_chr}, + {"DOUXdioux", __printf_arginfo_int, __printf_render_int}, + {"Ss", __printf_arginfo_str, __printf_render_str}, + {"p", __printf_arginfo_ptr, __printf_render_ptr}, +}; +struct _printf_tbl_defaults_glibc { + const char *spec; + printf_arginfo_function *arginfo; + printf_function *render; +}; +static struct _printf_tbl_defaults_glibc _printf_tbl_defaults_glibc[] = { + {"n", __printf_arginfo_n, __printf_render_n}, +}; + +static printf_domain_t xprintf_domain_default; +#ifdef XPRINTF_DEBUG +__private_extern__ printf_domain_t xprintf_domain_global = NULL; +#endif + +__private_extern__ pthread_once_t __xprintf_domain_once = PTHREAD_ONCE_INIT; + +__private_extern__ void +__xprintf_domain_init(void) +{ + xprintf_domain_default = (printf_domain_t)calloc( +#ifdef XPRINTF_DEBUG + 2, +#else + 1, +#endif + sizeof(*xprintf_domain_default)); + if(xprintf_domain_default == NULL) + LIBC_ABORT("No memory"); + + xprintf_domain_default->rwlock = (pthread_rwlock_t)PTHREAD_RWLOCK_INITIALIZER; + { + const char *cp; + for(cp = _printf_tbl_flags; *cp; cp++) + xprintf_domain_default->type[printf_tbl_index(*cp)] = PRINTF_DOMAIN_FLAG; + } + { + struct _printf_tbl_defaults_fbsd *d = _printf_tbl_defaults_fbsd; + int n = sizeof(_printf_tbl_defaults_fbsd) / sizeof(*_printf_tbl_defaults_fbsd); + for(; n > 0; d++, n--) { + for(const char *cp = d->spec; *cp; cp++) { + xprintf_domain_default->type[printf_tbl_index(*cp)] = PRINTF_DOMAIN_FBSD_API; + xprintf_domain_default->tbl[printf_tbl_index(*cp)] = (struct _printf_tbl){d->arginfo, d->render, NULL}; + } + } + } + { + struct _printf_tbl_defaults_glibc *d = _printf_tbl_defaults_glibc; + int n = sizeof(_printf_tbl_defaults_glibc) / sizeof(*_printf_tbl_defaults_glibc); + for(; n > 0; d++, n--) { + for(const char *cp = d->spec; *cp; cp++) { + xprintf_domain_default->type[printf_tbl_index(*cp)] = PRINTF_DOMAIN_GLIBC_API; + xprintf_domain_default->tbl[printf_tbl_index(*cp)] = (struct _printf_tbl){d->arginfo, d->render, NULL}; + } + } + } +#ifdef XPRINTF_DEBUG + xprintf_domain_global = xprintf_domain_default + 1; + *xprintf_domain_global = *xprintf_domain_default; +#endif +} + +printf_domain_t +copy_printf_domain(printf_domain_t src) +{ + printf_domain_t restrict copy; + + if(!src) { + errno = EINVAL; + return NULL; + } + copy = (printf_domain_t)MALLOC(sizeof(*copy)); + if(!copy) return NULL; + xprintf_domain_init(); + pthread_rwlock_rdlock(&src->rwlock); + *copy = *src; + pthread_rwlock_unlock(&src->rwlock); + copy->rwlock = (pthread_rwlock_t)PTHREAD_RWLOCK_INITIALIZER; + return copy; +} + +void +free_printf_domain(printf_domain_t d) +{ + if(!d) return; + pthread_rwlock_destroy(&d->rwlock); + free(d); +} + +printf_domain_t +new_printf_domain(void) +{ + printf_domain_t restrict d; + + xprintf_domain_init(); + + d = (printf_domain_t)MALLOC(sizeof(*d)); + if(!d) return NULL; + *d = *xprintf_domain_default; + return d; +} + +int +register_printf_domain_function(printf_domain_t d, int spec, printf_function *render, printf_arginfo_function *arginfo, void *context) +{ + xprintf_domain_init(); + + if(!d || !printf_tbl_in_range(spec)) { + errno = EINVAL; + return -1; + } + xprintf_domain_init(); + + switch(d->type[printf_tbl_index(spec)]) { + case PRINTF_DOMAIN_FLAG: + errno = EINVAL; + return -1; + default: + pthread_rwlock_wrlock(&d->rwlock); + if(!render || !arginfo) { + d->type[printf_tbl_index(spec)] = PRINTF_DOMAIN_UNUSED; + } else { + d->type[printf_tbl_index(spec)] = PRINTF_DOMAIN_GLIBC_API; + d->tbl[printf_tbl_index(spec)] = (struct _printf_tbl){arginfo, render, context}; + } + pthread_rwlock_unlock(&d->rwlock); + } + + return 0; +} + +__private_extern__ int +register_printf_domain_render(printf_domain_t d, int spec, printf_render *render, printf_arginfo_function *arginfo) +{ + xprintf_domain_init(); + + if(!d || !printf_tbl_in_range(spec)) { + errno = EINVAL; + return -1; + } + xprintf_domain_init(); + + switch(d->type[printf_tbl_index(spec)]) { + case PRINTF_DOMAIN_FLAG: + errno = EINVAL; + return -1; + default: + pthread_rwlock_wrlock(&d->rwlock); + if(!render || !arginfo) { + d->type[printf_tbl_index(spec)] = PRINTF_DOMAIN_UNUSED; + } else { + d->type[printf_tbl_index(spec)] = PRINTF_DOMAIN_FBSD_API; + d->tbl[printf_tbl_index(spec)] = (struct _printf_tbl){arginfo, render, NULL}; + } + pthread_rwlock_unlock(&d->rwlock); + } + + return 0; +} + +int +register_printf_domain_render_std(printf_domain_t d, const char *specs) +{ + int ret = 0; + + for (; *specs != '\0'; specs++) { + switch (*specs) { + case 'H': + ret = register_printf_domain_render(d, *specs, + __printf_render_hexdump, + __printf_arginfo_hexdump); + break; + case 'M': + ret = register_printf_domain_render(d, *specs, + __printf_render_errno, + __printf_arginfo_errno); + break; + case 'Q': + ret = register_printf_domain_render(d, *specs, + __printf_render_quote, + __printf_arginfo_quote); + break; + case 'T': + ret = register_printf_domain_render(d, *specs, + __printf_render_time, + __printf_arginfo_time); + break; + case 'V': + ret = register_printf_domain_render(d, *specs, + __printf_render_vis, + __printf_arginfo_vis); + break; + default: + errno = EINVAL; + return (-1); + } + if(ret < 0) return ret; + } + return (0); +} +#pragma clang diagnostic pop + diff --git a/stdio/xprintf_domain.h b/stdio/xprintf_domain.h new file mode 100644 index 0000000..dd8a117 --- /dev/null +++ b/stdio/xprintf_domain.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __XPRINTF_DOMAIN_H_ +#define __XPRINTF_DOMAIN_H_ + +#include +#include +#include + +#define PRINTF_TBL_FIRST '!' +#define PRINTF_TBL_LAST '~' +#define PRINTF_TBL_SIZE (PRINTF_TBL_LAST - PRINTF_TBL_FIRST + 1) + +#define printf_tbl_index(x) ((x) - PRINTF_TBL_FIRST) +#define printf_tbl_in_range(x) ((x) >= PRINTF_TBL_FIRST && (x) <= PRINTF_TBL_LAST) + +enum { + PRINTF_DOMAIN_UNUSED = 0, + PRINTF_DOMAIN_GLIBC_API, + PRINTF_DOMAIN_FBSD_API, + PRINTF_DOMAIN_FLAG, +}; +#define printf_domain_fbsd_api(d,x) ((d)->type[x] == PRINTF_DOMAIN_FBSD_API) +#define printf_domain_flag(d,x) ((d)->type[x] == PRINTF_DOMAIN_FLAG) +#define printf_domain_glibc_api(d,x) ((d)->type[x] == PRINTF_DOMAIN_GLIBC_API) +#define printf_domain_unused(d,x) ((d)->type[x] == PRINTF_DOMAIN_UNUSED) + +struct _printf_tbl { + printf_arginfo_function *arginfo; + void *render; /* either typedef printf_function or printf_render */ + void *context; +}; +struct _printf_domain { + pthread_rwlock_t rwlock; + char type[PRINTF_TBL_SIZE]; + struct _printf_tbl tbl[PRINTF_TBL_SIZE]; +}; + +__BEGIN_DECLS +__END_DECLS + +#endif /* __XPRINTF_DOMAIN_H_ */ diff --git a/stdio/xprintf_exec.3 b/stdio/xprintf_exec.3 new file mode 100644 index 0000000..5a66408 --- /dev/null +++ b/stdio/xprintf_exec.3 @@ -0,0 +1,57 @@ +.Dd Aug 19, 2012 +.Dt XPRINTF_EXEC 3 +.Os Darwin +.Sh NAME +.Nm asxprintf_exec , dxprintf_exec , fxprintf_exec , sxprintf_exec , +.Nm xprintf_exec , vasxprintf_exec , vdxprintf_exec , vfxprintf_exec , +.Nm vsxprintf_exec , vxprintf_exec +.Nd execute-only extensible printf execution +.Sh SYNOPSIS +.In printf.h +.Ft int +.Fn asxprintf_exec "char ** restrict ret" "printf_comp_t restrict pc" ... +.Ft int +.Fn dxprintf_exec "int fd" "printf_comp_t restrict pc" ... +.Ft int +.Fn fxprintf_exec "FILE * restrict stream" "printf_comp_t restrict pc" ... +.Ft int +.Fn sxprintf_exec "char * restrict str" "size_t size" "printf_comp_t restrict pc" ... +.Ft int +.Fn xprintf_exec "printf_comp_t restrict pc" ... +.In stdarg.h +.Ft int +.Fn vasxprintf_exec "char ** restrict ret" "printf_comp_t restrict pc" "va_list ap" +.Ft int +.Fn vdxprintf_exec "int fd" "printf_comp_t restrict pc" "va_list ap" +.Ft int +.Fn vfxprintf_exec "FILE * restrict stream" "printf_comp_t restrict pc" "va_list ap" +.Ft int +.Fn vsxprintf_exec "char * restrict str" "size_t size" "printf_comp_t restrict pc" "va_list ap" +.Ft int +.Fn vxprintf_exec "printf_comp_t restrict pc" "va_list ap" +.Sh DESCRIPTION +These functions are execute-only, extensible printf (see +.Xr xprintf 5 ) +variants, taking a +.Ft printf_comp_t +structure created by the format string compilation routine +.Xr new_printf_comp 3 . +All these variants behave like their normal printf counterparts (see +.Xr printf 3 ) +without +.Sq Li x +and +.Dq Li _exec +in the name (except +.Fn sxprintf_exec +and +.Fn vsxprintf_exec +behave like +.Fn snprintf +and +.Fn vsnprintf , +respectively). +.Sh SEE ALSO +.Xr printf 3 , +.Xr xprintf_comp 3 , +.Xr xprintf 5 diff --git a/stdio/xprintf_exec.c b/stdio/xprintf_exec.c new file mode 100644 index 0000000..2875212 --- /dev/null +++ b/stdio/xprintf_exec.c @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#define __va_list __darwin_va_list + +#include +#include +#include +#include +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpointer-bool-conversion" + +int +asxprintf_exec(char ** __restrict ret, + printf_comp_t __restrict pc, ...) +{ + int iret; + va_list ap; + + if (!pc) { + errno = EINVAL; + return -1; + } + + va_start(ap, pc); + iret = _vasprintf(pc, NULL, ret, NULL, NULL, ap); + va_end(ap); + return iret; +} + +int +dxprintf_exec(int fd, printf_comp_t __restrict pc, ...) +{ + int ret; + va_list ap; + + if (!pc) { + errno = EINVAL; + return -1; + } + + va_start(ap, pc); + ret = _vdprintf(pc, NULL, fd, NULL, NULL, ap); + va_end(ap); + return ret; +} + +int +fxprintf_exec(FILE * __restrict stream, + printf_comp_t __restrict pc, ...) +{ + int ret; + va_list ap; + + if (!pc) { + errno = EINVAL; + return -1; + } + + va_start(ap, pc); + ret = __xvprintf(pc, NULL, stream, NULL, NULL, ap); + va_end(ap); + return ret; +} + +int +sxprintf_exec(char * __restrict str, size_t size, + printf_comp_t __restrict pc, ...) +{ + int ret; + va_list ap; + + if (!pc) { + errno = EINVAL; + return -1; + } + + va_start(ap, pc); + ret = _vsnprintf(pc, NULL, str, size, NULL, NULL, ap); + va_end(ap); + return ret; +} + +int +xprintf_exec(printf_comp_t __restrict pc, ...) +{ + int ret; + va_list ap; + + if (!pc) { + errno = EINVAL; + return -1; + } + + va_start(ap, pc); + ret = __xvprintf(pc, NULL, stdout, NULL, NULL, ap); + va_end(ap); + return ret; +} + +int +vasxprintf_exec(char ** __restrict ret, + printf_comp_t __restrict pc, va_list ap) +{ + if (!pc) { + errno = EINVAL; + return -1; + } + + return _vasprintf(pc, NULL, ret, NULL, NULL, ap); +} + +int +vdxprintf_exec(int fd, printf_comp_t __restrict pc, + va_list ap) +{ + if (!pc) { + errno = EINVAL; + return -1; + } + + return _vdprintf(pc, NULL, fd, NULL, NULL, ap); +} + +int +vfxprintf_exec(FILE * __restrict stream, + printf_comp_t __restrict pc, va_list ap) +{ + if (!pc) { + errno = EINVAL; + return -1; + } + + return __xvprintf(pc, NULL, stream, NULL, NULL, ap); +} + +int +vsxprintf_exec(char * __restrict str, size_t size, + printf_comp_t __restrict pc, va_list ap) +{ + if (!pc) { + errno = EINVAL; + return -1; + } + + return _vsnprintf(pc, NULL, str, size, NULL, NULL, ap); +} + +int +vxprintf_exec(printf_comp_t __restrict pc, va_list ap) +{ + if (!pc) { + errno = EINVAL; + return -1; + } + + return __xvprintf(pc, NULL, stdout, NULL, NULL, ap); +} +#pragma clang diagnostic pop diff --git a/stdlib/CMakeLists.txt b/stdlib/CMakeLists.txt new file mode 100644 index 0000000..fb4c3c6 --- /dev/null +++ b/stdlib/CMakeLists.txt @@ -0,0 +1,108 @@ +project(libc-stdlib) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -fblocks -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") + +set(stdlib_sources a64l.c grantpt.c l64a.c qsort_b.c) + +set(stdlib_sources ${stdlib_sources} + FreeBSD/abort.c + FreeBSD/abs.c + FreeBSD/atexit.c + FreeBSD/atof.c + FreeBSD/atoi.c + FreeBSD/atol.c + FreeBSD/atoll.c + FreeBSD/bsearch.c + FreeBSD/div.c + FreeBSD/exit.c + FreeBSD/_Exit_.c + FreeBSD/getenv.c + FreeBSD/getopt.c + FreeBSD/getopt_long.c + FreeBSD/getsubopt.c + FreeBSD/hcreate.c + FreeBSD/heapsort_b.c + FreeBSD/heapsort.c + FreeBSD/heapsort_r.c + FreeBSD/imaxabs.c + FreeBSD/imaxdiv.c + FreeBSD/insque.c + FreeBSD/labs.c + FreeBSD/ldiv.c + FreeBSD/llabs.c + FreeBSD/lldiv.c + FreeBSD/lsearch.c + FreeBSD/merge_b.c + FreeBSD/merge.c + FreeBSD/psort_b.c + FreeBSD/psort.c + FreeBSD/psort_r.c + FreeBSD/putenv.c + FreeBSD/qsort.c + FreeBSD/qsort_r.c + FreeBSD/radixsort.c + FreeBSD/rand.c + FreeBSD/random.c + FreeBSD/reallocf.c + FreeBSD/realpath.c + FreeBSD/remque.c + FreeBSD/setenv.c + FreeBSD/strhash.c + FreeBSD/strtoimax.c + FreeBSD/strtol.c + FreeBSD/strtoll.c + FreeBSD/strtoq.c + FreeBSD/strtoul.c + FreeBSD/strtoull.c + FreeBSD/strtoumax.c + FreeBSD/strtouq.c + FreeBSD/system.c + FreeBSD/tdelete.c + FreeBSD/tfind.c + FreeBSD/tsearch.c + FreeBSD/twalk.c +) + +set(stdlib_sources ${stdlib_sources} + OpenBSD/ecvt.c + OpenBSD/gcvt.c +) + +set(stdlib_sources ${stdlib_sources} + NetBSD/strfmon.c +) + +SET_SOURCE_FILES_PROPERTIES(FreeBSD/psort_b.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DI_AM_PSORT_B") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/psort_r.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DI_AM_PSORT_R") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/system.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_SYSTEM") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/getopt.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_GETOPT") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/realpath.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_REALPATH") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/setenv.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_SETENV -DLIBC_ALIAS_UNSETENV") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/putenv.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_PUTENV") + +add_darling_object_library(libc-stdlib ${stdlib_sources}) + +# Cancelable variant +set(stdlib-cancelable_sources FreeBSD/system.c) +add_library(libc-stdlib_cancelable OBJECT ${stdlib-cancelable_sources}) +SET_TARGET_PROPERTIES(libc-stdlib_cancelable PROPERTIES COMPILE_DEFINITIONS "BUILDING_VARIANT;VARIANT_CANCELABLE") + +# Legacy variant +if (TARGET_i386) + set(stdlib-legacy_sources FreeBSD/getopt.c FreeBSD/realpath.c + FreeBSD/setenv.c FreeBSD/putenv.c) + add_library(libc-stdlib_legacy OBJECT ${stdlib-legacy_sources}) + SET_TARGET_PROPERTIES(libc-stdlib_legacy PROPERTIES COMPILE_DEFINITIONS "BUILDING_VARIANT;VARIANT_LEGACY") +endif (TARGET_i386) + +# DARWIN_EXTSN variant +set(stdlib-extsn_sources FreeBSD/realpath.c) +add_library(libc-stdlib_extsn OBJECT ${stdlib-extsn_sources}) +SET_TARGET_PROPERTIES(libc-stdlib_extsn PROPERTIES COMPILE_DEFINITIONS "BUILDING_VARIANT;VARIANT_DARWINEXTSN") + +# DYLD variant +add_library(libc-stdlib_dyld OBJECT FreeBSD/atexit.c FreeBSD/exit.c FreeBSD/heapsort.c FreeBSD/abort.c FreeBSD/merge.c FreeBSD/qsort.c FreeBSD/reallocf.c FreeBSD/realpath.c FreeBSD/strtoul.c FreeBSD/strtol.c FreeBSD/getenv.c FreeBSD/exit.c) +SET_TARGET_PROPERTIES(libc-stdlib_dyld PROPERTIES COMPILE_FLAGS "-UBUILDING_VARIANT -DVARIANT_DYLD -DVARIANT_CANCELABLE -DVARIANT_DARWINEXTSN") + diff --git a/stdlib/FreeBSD/_Exit_.c b/stdlib/FreeBSD/_Exit_.c new file mode 100644 index 0000000..3a2e94e --- /dev/null +++ b/stdlib/FreeBSD/_Exit_.c @@ -0,0 +1,22 @@ +/* + * This file is in the public domain. Written by Garrett A. Wollman, + * 2002-09-07. + * + * $FreeBSD: src/lib/libc/stdlib/_Exit.c,v 1.1 2002/09/10 02:04:49 wollman Exp $ + */ + +#include +#include + +/* + * ISO C99 added this function to provide for Standard C applications + * which needed something like POSIX _exit(). A new interface was created + * in case it turned out that _exit() was insufficient to meet the + * requirements of ISO C. (That's probably not the case, but here + * is where you would put the extra code if it were.) + */ +void +_Exit(int code) +{ + _exit(code); +} diff --git a/stdlib/FreeBSD/abort.3 b/stdlib/FreeBSD/abort.3 new file mode 100644 index 0000000..80ed972 --- /dev/null +++ b/stdlib/FreeBSD/abort.3 @@ -0,0 +1,86 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)abort.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/abort.3,v 1.10 2007/01/09 00:28:09 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt ABORT 3 +.Os +.Sh NAME +.Nm abort +.Nd cause abnormal program termination +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft void +.Fn abort void +.Sh DESCRIPTION +The +.Fn abort +function causes abnormal program termination to occur, unless the +signal +.Dv SIGABRT +is being caught and the signal handler does not return. +.Pp +Any open streams are flushed and closed. +.Sh IMPLEMENTATION NOTES +The +.Fn abort +function is thread-safe. +It is unknown if it is async-cancel-safe. +.Pp +The +.Fn abort +function causes a report to be generated by Crash Reporter. If you wish to +terminate without generating a crash report, use +.Xr exit 3 +instead. +.Sh RETURN VALUES +The +.Fn abort +function +never returns. +.Sh SEE ALSO +.Xr sigaction 2 , +.Xr exit 3 +.Sh STANDARDS +The +.Fn abort +function +conforms to +.St -p1003.1-90 . +The +.Fn abort +function also conforms to +.St -isoC-99 +with the implementation specific details as noted above. diff --git a/stdlib/FreeBSD/abort.c b/stdlib/FreeBSD/abort.c new file mode 100644 index 0000000..bac55ad --- /dev/null +++ b/stdlib/FreeBSD/abort.c @@ -0,0 +1,177 @@ +/* + * Copyright (c) 1985, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)abort.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/abort.c,v 1.11 2007/01/09 00:28:09 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" + +#if __has_include() +#include +#else +#define CRGetCrashLogMessage() NULL +#define CRSetCrashLogMessage(...) +#endif +#include "_simple.h" + +extern void (*__cleanup)(); +extern void __abort(void) __cold __dead2; + +#define TIMEOUT 10000 /* 10 milliseconds */ + +void +abort() +{ + struct sigaction act; + + if (!CRGetCrashLogMessage()) + CRSetCrashLogMessage("abort() called"); + + /* + * POSIX requires we flush stdio buffers on abort. + * XXX ISO C requires that abort() be async-signal-safe. + */ + if (__cleanup) + (*__cleanup)(); + + sigfillset(&act.sa_mask); + /* + * Don't block SIGABRT to give any handler a chance; we ignore + * any errors -- ISO C doesn't allow abort to return anyway. + */ + sigdelset(&act.sa_mask, SIGABRT); + + /* + * Don't block SIGSEGV since we might trigger a segfault if the pthread + * struct is corrupt. The end user behavior is that the program will + * terminate with a SIGSEGV instead of a SIGABRT which is acceptable. If + * the user registers a SIGSEGV handler, then they are responsible for + * dealing with any corruption themselves and abort may not work. + * rdar://48853131 + */ + sigdelset(&act.sa_mask, SIGSEGV); + sigdelset(&act.sa_mask, SIGBUS); + + /* abort() should call pthread_kill to deliver a signal to the aborting thread + * This helps gdb focus on the thread calling abort() + */ + + /* Block all signals on all other threads */ + sigset_t fullmask; + sigfillset(&fullmask); + (void)_sigprocmask(SIG_SETMASK, &fullmask, NULL); + + /* Set the workqueue killable */ + __pthread_workqueue_setkill(1); + + (void)pthread_sigmask(SIG_SETMASK, &act.sa_mask, NULL); + (void)pthread_kill(pthread_self(), SIGABRT); + + usleep(TIMEOUT); /* give time for signal to happen */ + + /* + * If SIGABRT was ignored, or caught and the handler returns, do + * it again, only harder. + */ + __abort(); +} + +__private_extern__ void +__abort() +{ + struct sigaction act; + + if (!CRGetCrashLogMessage()) + CRSetCrashLogMessage("__abort() called"); + act.sa_handler = SIG_DFL; + act.sa_flags = 0; + sigfillset(&act.sa_mask); + (void)_sigaction(SIGABRT, &act, NULL); + sigdelset(&act.sa_mask, SIGABRT); + + /* abort() should call pthread_kill to deliver a signal to the aborting thread + * This helps gdb focus on the thread calling abort() + */ + + /* Block all signals on all other threads */ + sigset_t fullmask; + sigfillset(&fullmask); + (void)_sigprocmask(SIG_SETMASK, &fullmask, NULL); + + /* Set the workqueue killable */ + __pthread_workqueue_setkill(1); + + (void)pthread_sigmask(SIG_SETMASK, &act.sa_mask, NULL); + (void)pthread_kill(pthread_self(), SIGABRT); + + usleep(TIMEOUT); /* give time for signal to happen */ + + /* If for some reason SIGABRT was not delivered, we exit using __builtin_trap + * which generates an illegal instruction on i386: + * and SIGTRAP on arm. + */ + sigfillset(&act.sa_mask); + sigdelset(&act.sa_mask, SIGILL); + sigdelset(&act.sa_mask, SIGTRAP); + (void)_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); + __builtin_trap(); +} + +void +abort_report_np(const char *fmt, ...) +{ + _SIMPLE_STRING s; + va_list ap; + + if ((s = _simple_salloc()) != NULL) { + va_start(ap, fmt); + _simple_vsprintf(s, fmt, ap); + va_end(ap); + CRSetCrashLogMessage(_simple_string(s)); + } else + CRSetCrashLogMessage(fmt); /* the format string is better than nothing */ + abort(); +} +#pragma clang diagnostic pop diff --git a/stdlib/FreeBSD/abs.3 b/stdlib/FreeBSD/abs.3 new file mode 100644 index 0000000..9dc5299 --- /dev/null +++ b/stdlib/FreeBSD/abs.3 @@ -0,0 +1,73 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)abs.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/abs.3,v 1.13 2007/01/09 00:28:09 imp Exp $ +.\" +.Dd November 14, 2001 +.Dt ABS 3 +.Os +.Sh NAME +.Nm abs +.Nd integer absolute value function +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fn abs "int i" +.Sh DESCRIPTION +The +.Fn abs +function computes the absolute value of the integer +.Fa i . +.Sh RETURN VALUES +The +.Fn abs +function +returns +the absolute value. +.Sh SEE ALSO +.Xr cabs 3 , +.Xr fabs 3 , +.Xr floor 3 , +.Xr hypot 3 , +.Xr imaxabs 3 , +.Xr labs 3 , +.Xr llabs 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn abs +function conforms to +.St -isoC-99 . +.Sh BUGS +The absolute value of the most negative integer remains negative. diff --git a/stdlib/FreeBSD/abs.c b/stdlib/FreeBSD/abs.c new file mode 100644 index 0000000..85cc8f0 --- /dev/null +++ b/stdlib/FreeBSD/abs.c @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)abs.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/abs.c,v 1.3 2007/01/09 00:28:09 imp Exp $"); + +#include + +int +abs(j) + int j; +{ + return(j < 0 ? -j : j); +} diff --git a/stdlib/FreeBSD/alloca.3 b/stdlib/FreeBSD/alloca.3 new file mode 100644 index 0000000..492100a --- /dev/null +++ b/stdlib/FreeBSD/alloca.3 @@ -0,0 +1,89 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)alloca.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/alloca.3,v 1.13 2007/01/09 00:28:09 imp Exp $ +.\" +.Dd September 5, 2006 +.Dt ALLOCA 3 +.Os +.Sh NAME +.Nm alloca +.Nd memory allocator +.Sh SYNOPSIS +.In alloca.h +or +.br +.In stdlib.h +.Ft void * +.Fn alloca "size_t size" +.Sh DESCRIPTION +The +.Fn alloca +macro +allocates +.Fa size +bytes of space in the stack frame of the caller. +This temporary space is automatically freed on +return. +.Sh RETURN VALUES +.Fn alloca +returns a pointer to the beginning of the allocated space. +.Sh SEE ALSO +.Xr brk 2 , +.Xr calloc 3 , +.Xr getpagesize 3 , +.Xr malloc 3 , +.Xr realloc 3 +.Sh HISTORY +.Fn alloca +appeared in +.At 32v . +.\" .Bx ?? . +.\" The function appeared in 32v, pwb and pwb.2 and in 3bsd 4bsd +.\" The first man page (or link to a man page that I can find at the +.\" moment is 4.3... +.Sh BUGS +.Fn alloca +is machine and compiler dependent; +its use is discouraged. +.Pp +.Fn alloca +is slightly unsafe because it cannot ensure that the pointer +returned points to a valid and usable block of memory. +The allocation made may exceed the bounds of the stack, or even go +further into other objects in memory, and +.Fn alloca +cannot determine such an error. +Avoid +.Fn alloca +with large unbounded allocations. +.Pp +The use of C99 variable-length arrays and +.Fn alloca +in the same function will cause the lifetime of alloca's storage to be limited to the block containing the +.Fn alloca diff --git a/stdlib/FreeBSD/atexit.3 b/stdlib/FreeBSD/atexit.3 new file mode 100644 index 0000000..9d60aa8 --- /dev/null +++ b/stdlib/FreeBSD/atexit.3 @@ -0,0 +1,120 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)atexit.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd September 6, 2002 +.Dt ATEXIT 3 +.Os +.Sh NAME +.Nm atexit +.Nd register a function to be called on exit +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fn atexit "void (*function)(void)" +#ifdef UNIFDEF_BLOCKS +.Ft int +.Fn atexit_b "void (^function)(void)" +#endif +.Sh DESCRIPTION +The +.Fn atexit +function +registers the given +.Fa function +to be called at program exit, whether via +.Xr exit 3 +or via return from the program's +.Fn main . +Functions so registered are called in reverse order; +no arguments are passed. +.Pp +If the provided +.Fa function +is located in a library that has been dynamically loaded (e.g. by +.Fn dlopen ) Ns , +it will be called when the library is unloaded (due to a call +to +.Fn dlclose ) +or at program exit. +#ifdef UNIFDEF_BLOCKS +.Pp +The +.Fn atexit_b +function is like +.Fn atexit +except the callback is a block pointer instead of a function pointer. +.Bd -ragged -offset indent +Note: The +.Fn Block_copy +function (defined in +.In Blocks.h ) +is used by +.Fn atexit_b +to make a copy of the block, especially for the case when a stack-based +block might go out of scope when the subroutine returns. +.Ed +#endif +.Pp +These functions must not call +.Fn exit ; +if it should be necessary to terminate the process while in such a +function, the +.Xr _exit 2 +function should be used. +(Alternatively, the function may cause abnormal +process termination, for example by calling +.Xr abort 3 . ) +.Pp +At least 32 functions can always be registered, +and more are allowed as long as sufficient memory can be allocated. +.\" XXX {ATEXIT_MAX} is not implemented yet +.Sh RETURN VALUES +#ifdef UNIFDEF_BLOCKS +.ds ATEXIT_B atexit_b +#endif +.Rv -std atexit \*[ATEXIT_B] +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er ENOMEM +No memory was available to add the function to the list. +The existing list of functions is unmodified. +.El +.Sh SEE ALSO +.Xr exit 3 +.Sh STANDARDS +The +.Fn atexit +function +conforms to +.St -isoC . diff --git a/stdlib/FreeBSD/atexit.c b/stdlib/FreeBSD/atexit.c new file mode 100644 index 0000000..48ada4c --- /dev/null +++ b/stdlib/FreeBSD/atexit.c @@ -0,0 +1,332 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wimplicit-function-declaration" +#pragma clang diagnostic ignored "-Wstrict-prototypes" +#pragma clang diagnostic ignored "-Winvalid-pp-token" +#pragma clang diagnostic ignored "-Wint-conversion" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)atexit.c 8.2 (Berkeley) 7/3/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/atexit.c,v 1.8 2007/01/09 00:28:09 imp Exp $"); +#include + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#if (defined(__DYNAMIC__) || defined (__BLOCKS__)) && !TARGET_OS_DRIVERKIT +#include +#endif /* defined(__DYNAMIC__) */ +#include "atexit.h" +#include "un-namespace.h" + +#ifdef __BLOCKS__ +#include +#include +#endif /* __BLOCKS__ */ +#include "libc_private.h" +#include + +#define ATEXIT_FN_EMPTY 0 +#define ATEXIT_FN_STD 1 +#define ATEXIT_FN_CXA 2 +#ifdef __BLOCKS__ +#define ATEXIT_FN_BLK 3 +#endif /* __BLOCKS__ */ + +static pthread_mutex_t atexit_mutex = PTHREAD_MUTEX_INITIALIZER; + +#define _MUTEX_LOCK(x) if (__isthreaded) _pthread_mutex_lock(x) +#define _MUTEX_UNLOCK(x) if (__isthreaded) _pthread_mutex_unlock(x) + +struct atexit { + struct atexit *next; /* next in list */ + int ind; /* next index in this table */ + struct atexit_fn { + int fn_type; /* ATEXIT_? from above */ + union { + void (*std_func)(void); + void (*cxa_func)(void *); +#ifdef __BLOCKS__ + void (^block)(void); +#endif /* __BLOCKS__ */ + } fn_ptr; /* function pointer */ + void *fn_arg; /* argument for CXA callback */ + void *fn_dso; /* shared module handle */ + } fns[ATEXIT_SIZE]; /* the table itself */ +}; + +static struct atexit *__atexit; /* points to head of LIFO stack */ +static int __atexit_new_registration; + +__attribute__ ((visibility ("hidden"))) +void +__atexit_init(void) +{ + __atexit = os_alloc_once(OS_ALLOC_ONCE_KEY_LIBSYSTEM_C, + sizeof(struct atexit), NULL); +} + +/* + * Register the function described by 'fptr' to be called at application + * exit or owning shared object unload time. This is a helper function + * for atexit and __cxa_atexit. + */ +static int +atexit_register(struct atexit_fn *fptr) +{ + struct atexit *p = __atexit; + assert(p); + _MUTEX_LOCK(&atexit_mutex); + while (p->ind >= ATEXIT_SIZE) { + struct atexit *old__atexit; + old__atexit = __atexit; + _MUTEX_UNLOCK(&atexit_mutex); + if ((p = (struct atexit *)malloc(sizeof(*p))) == NULL) + return (-1); + _MUTEX_LOCK(&atexit_mutex); + if (old__atexit != __atexit) { + /* Lost race, retry operation */ + _MUTEX_UNLOCK(&atexit_mutex); + free(p); + _MUTEX_LOCK(&atexit_mutex); + p = __atexit; + continue; + } + p->ind = 0; + p->next = __atexit; + __atexit = p; + } + p->fns[p->ind++] = *fptr; + __atexit_new_registration = 1; + _MUTEX_UNLOCK(&atexit_mutex); + return 0; +} + +/* + * Register a function to be performed at exit. + */ +int +atexit(void (*func)(void)) +{ + struct atexit_fn fn; + int error; + + fn.fn_type = ATEXIT_FN_STD; + fn.fn_ptr.std_func = func; + fn.fn_arg = NULL; + fn.fn_dso = NULL; + +#if defined(__DYNAMIC__) && !TARGET_OS_IPHONE && !TARGET_OS_DRIVERKIT + // + struct dl_info info; + if (dladdr(func, &info)) { + fn.fn_dso = info.dli_fbase; + } +#endif + + error = atexit_register(&fn); + return (error); +} + +#ifdef __BLOCKS__ +int +atexit_b(void (^block)(void)) +{ + struct atexit_fn fn; + int error; + + fn.fn_type = ATEXIT_FN_BLK; + fn.fn_ptr.block = Block_copy(block); + fn.fn_arg = NULL; + fn.fn_dso = NULL; + + error = atexit_register(&fn); + return (error); +} +#endif /* __BLOCKS__ */ + +/* + * Register a function to be performed at exit or when an shared object + * with given dso handle is unloaded dynamically. + */ +int +__cxa_atexit(void (*func)(void *), void *arg, void *dso) +{ + struct atexit_fn fn; + int error; + + fn.fn_type = ATEXIT_FN_CXA; + fn.fn_ptr.cxa_func = func;; + fn.fn_arg = arg; + fn.fn_dso = dso; + + error = atexit_register(&fn); + return (error); +} + +static bool +__cxa_in_range(const struct __cxa_range_t ranges[], + unsigned int count, + const void* fn) +{ + uintptr_t addr = (uintptr_t)fn; + + unsigned int i; + for (i = 0; i < count; ++i) { + const struct __cxa_range_t *r = &ranges[i]; + if (addr < (uintptr_t)r->addr) { + continue; + } + if (addr < ((uintptr_t)r->addr + r->length)) { + return true; + } + } + return false; +} + +/* + * Call handlers registered via __cxa_atexit/atexit that are in a + * a range specified. + * Note: rangeCount==0, means call all handlers. + */ +void +__cxa_finalize_ranges(const struct __cxa_range_t ranges[], unsigned int count) +{ + struct atexit *p; + struct atexit_fn *fn; + int n; + _MUTEX_LOCK(&atexit_mutex); + +restart: + for (p = __atexit; p; p = p->next) { + for (n = p->ind; --n >= 0;) { + fn = &p->fns[n]; + + if (fn->fn_type == ATEXIT_FN_EMPTY) { + continue; // already been called + } + + // Verify that the entry is within the range being unloaded. + if (count > 0) { + if (fn->fn_type == ATEXIT_FN_CXA) { + // for __cxa_atexit(), call if *dso* is in range be unloaded + if (!__cxa_in_range(ranges, count, fn->fn_dso)) { + continue; // not being unloaded yet + } + } else if (fn->fn_type == ATEXIT_FN_STD) { + // for atexit, call if *function* is in range be unloaded + if (!__cxa_in_range(ranges, count, fn->fn_ptr.std_func)) { + continue; // not being unloaded yet + } +#ifdef __BLOCKS__ + } else if (fn->fn_type == ATEXIT_FN_BLK) { + // for atexit_b, call if block code is in range be unloaded + void *a = ((struct Block_layout *)fn->fn_ptr.block)->invoke; + if (!__cxa_in_range(ranges, count, a)) { + continue; // not being unloaded yet + } +#endif // __BLOCKS__ + } + } + + // Clear the entry to indicate that this handler has been called. + int fn_type = fn->fn_type; + fn->fn_type = ATEXIT_FN_EMPTY; + + // Detect recursive registrations. + __atexit_new_registration = 0; + _MUTEX_UNLOCK(&atexit_mutex); + + // Call the handler. + if (fn_type == ATEXIT_FN_CXA) { + fn->fn_ptr.cxa_func(fn->fn_arg); + } else if (fn_type == ATEXIT_FN_STD) { + fn->fn_ptr.std_func(); +#ifdef __BLOCKS__ + } else if (fn_type == ATEXIT_FN_BLK) { + fn->fn_ptr.block(); +#endif // __BLOCKS__ + } + + // Call any recursively registered handlers. + _MUTEX_LOCK(&atexit_mutex); + if (__atexit_new_registration) { + goto restart; + } + } + } + _MUTEX_UNLOCK(&atexit_mutex); +} + + +/* + * Call all handlers registered with __cxa_atexit for the shared + * object owning 'dso'. Note: if 'dso' is NULL, then all remaining + * handlers are called. + */ +void +__cxa_finalize(const void *dso) +{ + if (dso != NULL) { + // Note: this should not happen as only dyld should be calling + // this and dyld has switched to call __cxa_finalize_ranges directly. + struct __cxa_range_t range; + range.addr = dso; + range.length = 1; + __cxa_finalize_ranges(&range, 1); + } else { + __cxa_finalize_ranges(NULL, 0); + } +} + +#if !TARGET_IPHONE_SIMULATOR && (__i386__ || __x86_64__) +/* + * Support for thread_local in C++, using existing _tlv_atexit() in libdyld + */ + +void _tlv_atexit(void(*f)(void*), void* arg); /* in libdyld */ + +void +__cxa_thread_atexit(void(*f)(void*), void* arg) +{ + _tlv_atexit(f, arg); +} +#endif +#pragma clang diagnostic pop diff --git a/stdlib/FreeBSD/atexit.h b/stdlib/FreeBSD/atexit.h new file mode 100644 index 0000000..608104f --- /dev/null +++ b/stdlib/FreeBSD/atexit.h @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)atexit.h 8.2 (Berkeley) 7/3/94 + * $FreeBSD: src/lib/libc/stdlib/atexit.h,v 1.4 2007/01/09 00:28:09 imp Exp $ + */ + +/* must be at least 32 to guarantee ANSI conformance */ +#define ATEXIT_SIZE 32 + +struct __cxa_range_t { + const void* addr; + size_t length; +}; + +void __cxa_finalize(const void *dso); + +void __cxa_finalize_ranges(const struct __cxa_range_t ranges[], + unsigned int count); diff --git a/stdlib/FreeBSD/atof.3 b/stdlib/FreeBSD/atof.3 new file mode 100644 index 0000000..5454422 --- /dev/null +++ b/stdlib/FreeBSD/atof.3 @@ -0,0 +1,114 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)atof.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/atof.3,v 1.17 2007/01/09 00:28:09 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt ATOF 3 +.Os +.Sh NAME +.Nm atof , +.Nm atof_l +.Nd convert +.Tn ASCII +string to double +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft double +.Fn atof "const char *str" +.In xlocale.h +.Ft double +.Fn atof_l "const char *str" "locale_t loc" +.Sh DESCRIPTION +The +.Fn atof +function converts the initial portion of the string pointed to by +.Fa str +to +.Vt double +representation. +.Pp +It is equivalent to: +.Bd -literal -offset indent +strtod(str, (char **)NULL); +.Ed +.Pp +The decimal point +character is defined in the program's locale (category +.Dv LC_NUMERIC ) . +.Pp +While the +.Fn atof +function uses the current locale, the +.Fn atof_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh IMPLEMENTATION NOTES +The +.Fn atof +and +.Fn atof_l +functions are thread-safe and async-cancel-safe. +.Pp +The +.Fn strtod +and +.Fn strtod_l +functions are recommended instead of +.Fn atof +and +.Fn atof_l +functions, especially in new code. +.Sh ERRORS +The function +.Fn atof +need not affect the value of +.Va errno +on an error. +.Sh SEE ALSO +.Xr atoi 3 , +.Xr atol 3 , +.Xr strtod 3 , +.Xr strtol 3 , +.Xr strtoul 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn atof +function conforms to +.St -p1003.1-90 , +.St -isoC , +and +.St -isoC-99 . diff --git a/stdlib/FreeBSD/atof.c b/stdlib/FreeBSD/atof.c new file mode 100644 index 0000000..fff3e7d --- /dev/null +++ b/stdlib/FreeBSD/atof.c @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)atof.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/atof.c,v 1.6 2007/01/09 00:28:09 imp Exp $"); + +#include "xlocale_private.h" + +#include + +double +atof(ascii) + const char *ascii; +{ + return strtod_l(ascii, (char **)NULL, __current_locale()); +} + +double +atof_l(ascii, loc) + const char *ascii; + locale_t loc; +{ + /* no need to call NORMALIZE_LOCALE(loc) because strtod_l will */ + return strtod_l(ascii, (char **)NULL, loc); +} diff --git a/stdlib/FreeBSD/atoi.3 b/stdlib/FreeBSD/atoi.3 new file mode 100644 index 0000000..6e8a796 --- /dev/null +++ b/stdlib/FreeBSD/atoi.3 @@ -0,0 +1,110 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)atoi.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/atoi.3,v 1.14 2007/10/19 06:23:39 davidxu Exp $ +.\" +.Dd June 4, 1993 +.Dt ATOI 3 +.Os +.Sh NAME +.Nm atoi , +.Nm atoi_l +.Nd convert +.Tn ASCII +string to integer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fn atoi "const char *str" +.In xlocale.h +.Ft int +.Fn atoi_l "const char *str" "locale_t loc" +.Sh DESCRIPTION +The +.Fn atoi +function converts the initial portion of the string pointed to by +.Fa str +to +.Vt int +representation. +.Pp +It is equivalent to: +.Bd -literal -offset indent +(int)strtol(str, (char **)NULL, 10); +.Ed +.Pp +While the +.Fn atoi +function uses the current locale, the +.Fn atoi_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh IMPLEMENTATION NOTES +The +.Fn atoi +and +.Fn atoi_l +functions are thread-safe and async-cancel-safe. +.Pp +The +.Fn strtol +and +.Fn strtol_l +functions are recommended instead of +.Fn atoi +and +.Fn atoi_l +functions, especially in new code. +.Sh ERRORS +The function +.Fn atoi +need not affect the value of +.Va errno +on an error. +.Sh SEE ALSO +.Xr atof 3 , +.Xr atol 3 , +.Xr strtod 3 , +.Xr strtol 3 , +.Xr strtoul 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn atoi +function conforms to +.St -p1003.1-90 , +.St -isoC , +and +.St -isoC-99 . diff --git a/stdlib/FreeBSD/atoi.c b/stdlib/FreeBSD/atoi.c new file mode 100644 index 0000000..ac6fcca --- /dev/null +++ b/stdlib/FreeBSD/atoi.c @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)atoi.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/atoi.c,v 1.6 2007/01/09 00:28:09 imp Exp $"); + +#include "xlocale_private.h" + +#include + +int +atoi(str) + const char *str; +{ + return (int)strtol_l(str, (char **)NULL, 10, __current_locale()); +} + +int +atoi_l(str, loc) + const char *str; + locale_t loc; +{ + /* no need to call NORMALIZE_LOCALE(loc) because strtol_l will */ + return (int)strtol_l(str, (char **)NULL, 10, loc); +} diff --git a/stdlib/FreeBSD/atol.3 b/stdlib/FreeBSD/atol.3 new file mode 100644 index 0000000..2c21151 --- /dev/null +++ b/stdlib/FreeBSD/atol.3 @@ -0,0 +1,162 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)atol.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/atol.3,v 1.16 2009/03/01 05:44:28 delphij Exp $ +.\" +.Dd February 1, 2009 +.Dt ATOL 3 +.Os +.Sh NAME +.Nm atol , atoll , +.Nm atol_l , atoll_l +.Nd convert +.Tn ASCII +string to +.Vt long +or +.Vt "long long" +integer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft long +.Fn atol "const char *str" +.Ft "long long" +.Fn atoll "const char *str" +.In xlocale.h +.Ft long +.Fn atol_l "const char *str" "locale_t loc" +.Ft "long long" +.Fn atoll_l "const char *str" "locale_t loc" +.Sh DESCRIPTION +The +.Fn atol +function converts the initial portion of the string pointed to by +.Fa str +to +.Vt long +integer +representation. +.Pp +It is equivalent to: +.Pp +.Dl "strtol(str, (char **)NULL, 10);" +.Pp +The +.Fn atoll +function converts the initial portion of the string pointed to by +.Fa str +to +.Vt "long long" +integer +representation. +.Pp +It is equivalent to: +.Pp +.Dl "strtoll(str, (char **)NULL, 10);" +.Pp +While the +.Fn atol +and +.Fn atoll +functions use the current locale, the +.Fn atol_l +and +.Fn atoll_l +functions may be passed locales directly. See +.Xr xlocale 3 +for more information. +.Sh IMPLEMENTATION NOTES +The +.Fn atol , +.Fn atoll , +.Fn atol_l , +and +.Fn atoll_l +functions are thread-safe and async-cancel-safe. +.Pp +The +.Fx +implementations of the +.Fn atol +and +.Fn atoll +functions are thin wrappers around +.Fn strtol +and +.Fn stroll +respectively, so these functions will affect the value of +.Va errno +in the same way that the +.Fn strtol +and +.Fn stroll +functions are able to. +This behavior of +.Fn atol +and +.Fn atoll +is not required by +.St -isoC +or +.St -isoC-99 , +but it is allowed by all of +.St -isoC , St -isoC-99 +and +.St -p1003.1-2001 . +.Sh ERRORS +The functions +.Fn atol +and +.Fn atoll +may affect the value of +.Va errno +on an error. +.Sh SEE ALSO +.Xr atof 3 , +.Xr atoi 3 , +.Xr strtod 3 , +.Xr strtol 3 , +.Xr strtoul 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn atol +function +conforms to +.St -isoC . +The +.Fn atoll +function +conforms to +.St -isoC-99 . diff --git a/stdlib/FreeBSD/atol.c b/stdlib/FreeBSD/atol.c new file mode 100644 index 0000000..5e52d95 --- /dev/null +++ b/stdlib/FreeBSD/atol.c @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)atol.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/atol.c,v 1.5 2007/01/09 00:28:09 imp Exp $"); + +#include "xlocale_private.h" + +#include + +long +atol(str) + const char *str; +{ + return strtol_l(str, (char **)NULL, 10, __current_locale()); +} + +long +atol_l(str, loc) + const char *str; + locale_t loc; +{ + /* no need to call NORMALIZE_LOCALE(loc) because strtol_l will */ + return strtol_l(str, (char **)NULL, 10, loc); +} diff --git a/stdlib/FreeBSD/atoll.c b/stdlib/FreeBSD/atoll.c new file mode 100644 index 0000000..c25a4da --- /dev/null +++ b/stdlib/FreeBSD/atoll.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/atoll.c,v 1.5 2007/01/09 00:28:09 imp Exp $"); + +#include "xlocale_private.h" + +#include + +long long +atoll(str) + const char *str; +{ + return strtoll_l(str, (char **)NULL, 10, __current_locale()); +} + +long long +atoll_l(str, loc) + const char *str; + locale_t loc; +{ + /* no need to call NORMALIZE_LOCALE(loc) because strtoll_l will */ + return strtoll_l(str, (char **)NULL, 10, loc); +} diff --git a/stdlib/FreeBSD/bsearch.3 b/stdlib/FreeBSD/bsearch.3 new file mode 100644 index 0000000..857f800 --- /dev/null +++ b/stdlib/FreeBSD/bsearch.3 @@ -0,0 +1,114 @@ +.\" Copyright (c) 1990, 1991, 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)bsearch.3 8.3 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/stdlib/bsearch.3,v 1.9 2007/01/09 00:28:09 imp Exp $ +.\" +.Dd May 20, 2008 +.Dt BSEARCH 3 +.Os +.Sh NAME +#ifdef UNIFDEF_BLOCKS +.Nm bsearch , +.Nm bsearch_b +#else +.Nm bsearch +#endif +.Nd binary search of a sorted table +.Sh SYNOPSIS +.In stdlib.h +.Ft void * +.Fn bsearch "const void *key" "const void *base" "size_t nel" "size_t width" "int (*compar) (const void *, const void *)" +#ifdef UNIFDEF_BLOCKS +.Ft void * +.Fn bsearch_b "const void *key" "const void *base" "size_t nel" "size_t width" "int (^compar) (const void *, const void *)" +#endif +.Sh DESCRIPTION +The +.Fn bsearch +function searches an array of +.Fa nel +objects, the initial member of which is +pointed to by +.Fa base , +for a member that matches the object pointed to by +.Fa key . +The size (in bytes) of each member of the array is specified by +.Fa width . +.Pp +The contents of the array should be in ascending sorted order according +to the comparison function referenced by +.Fa compar . +The +.Fa compar +routine +is expected to have +two arguments which point to the +.Fa key +object and to an array member, in that order. +It should return an integer which is +less than, equal to, or greater than zero if the +.Fa key +object is found, respectively, to be less than, to match, or be +greater than the array member. +#ifdef UNIFDEF_BLOCKS +.Pp +The +.Fn bsearch_b +function is like +.Fn bsearch +except the callback +.Fa compar +is a block pointer instead of a function pointer. +#endif +.Sh RETURN VALUES +The +.Fn bsearch +#ifdef UNIFDEF_BLOCKS +and +.Fn bsearch_b +functions +#else +function +#endif +returns a pointer to a matching member of the array, or a null +pointer if no match is found. +If two members compare as equal, which member is matched is unspecified. +.Sh SEE ALSO +.Xr db 3 , +.Xr lsearch 3 , +.Xr qsort 3 +.\" .Xr tsearch 3 +.Sh STANDARDS +The +.Fn bsearch +function conforms to +.St -isoC . diff --git a/stdlib/FreeBSD/bsearch.c b/stdlib/FreeBSD/bsearch.c new file mode 100644 index 0000000..6af4291 --- /dev/null +++ b/stdlib/FreeBSD/bsearch.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bsearch.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/bsearch.c,v 1.4 2007/01/09 00:28:09 imp Exp $"); + +#include +#include + +/* + * Perform a binary search. + * + * The code below is a bit sneaky. After a comparison fails, we + * divide the work in half by moving either left or right. If lim + * is odd, moving left simply involves halving lim: e.g., when lim + * is 5 we look at item 2, so we change lim to 2 so that we will + * look at items 0 & 1. If lim is even, the same applies. If lim + * is odd, moving right again involes halving lim, this time moving + * the base up one item past p: e.g., when lim is 5 we change base + * to item 3 and make lim 2 so that we will look at items 3 and 4. + * If lim is even, however, we have to shrink it by one before + * halving: e.g., when lim is 4, we still looked at item 2, so we + * have to make lim 3, then halve, obtaining 1, so that we will only + * look at item 3. + */ +void * +bsearch(key, base0, nmemb, size, compar) + const void *key; + const void *base0; + size_t nmemb; + size_t size; + int (*compar)(const void *, const void *); +{ + const char *base = base0; + size_t lim; + int cmp; + const void *p; + + for (lim = nmemb; lim != 0; lim >>= 1) { + p = base + (lim >> 1) * size; + cmp = (*compar)(key, p); + if (cmp == 0) + return ((void *)p); + if (cmp > 0) { /* key > p: move right */ + base = (char *)p + size; + lim--; + } /* else move left */ + } + return (NULL); +} + +#ifdef __BLOCKS__ +void * +bsearch_b(key, base0, nmemb, size, compar) + const void *key; + const void *base0; + size_t nmemb; + size_t size; + int (^compar)(const void *, const void *); +{ + const char *base = base0; + size_t lim; + int cmp; + const void *p; + + for (lim = nmemb; lim != 0; lim >>= 1) { + p = base + (lim >> 1) * size; + cmp = compar(key, p); + if (cmp == 0) + return ((void *)p); + if (cmp > 0) { /* key > p: move right */ + base = (char *)p + size; + lim--; + } /* else move left */ + } + return (NULL); +} +#endif /* __BLOCKS__ */ diff --git a/stdlib/FreeBSD/div.3 b/stdlib/FreeBSD/div.3 new file mode 100644 index 0000000..4a5bd35 --- /dev/null +++ b/stdlib/FreeBSD/div.3 @@ -0,0 +1,70 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)div.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/div.3,v 1.9 2007/01/09 00:28:09 imp Exp $ +.\" +.Dd November 14, 2001 +.Dt DIV 3 +.Os +.Sh NAME +.Nm div +.Nd return quotient and remainder from division +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft div_t +.Fn div "int numer" "int denom" +.Sh DESCRIPTION +The +.Fn div +function +computes the value +.Fa numer/denom +(numerator/denominator). +It returns a structure named +.Fa div_t +that contains two +.Vt int +members named +.Va quot +(quotient) and +.Va rem +(remainder). +.Sh SEE ALSO +.Xr imaxdiv 3 , +.Xr ldiv 3 , +.Xr lldiv 3 +.Sh STANDARDS +The +.Fn div +function +conforms to +.St -isoC-99 . diff --git a/stdlib/FreeBSD/div.c b/stdlib/FreeBSD/div.c new file mode 100644 index 0000000..2aa3492 --- /dev/null +++ b/stdlib/FreeBSD/div.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)div.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/div.c,v 1.3 2007/01/09 00:28:09 imp Exp $"); + +#include /* div_t */ + +div_t +div(num, denom) + int num, denom; +{ + div_t r; + + r.quot = num / denom; + r.rem = num % denom; + /* + * The ANSI standard says that |r.quot| <= |n/d|, where + * n/d is to be computed in infinite precision. In other + * words, we should always truncate the quotient towards + * 0, never -infinity. + * + * Machine division and remainer may work either way when + * one or both of n or d is negative. If only one is + * negative and r.quot has been truncated towards -inf, + * r.rem will have the same sign as denom and the opposite + * sign of num; if both are negative and r.quot has been + * truncated towards -inf, r.rem will be positive (will + * have the opposite sign of num). These are considered + * `wrong'. + * + * If both are num and denom are positive, r will always + * be positive. + * + * This all boils down to: + * if num >= 0, but r.rem < 0, we got the wrong answer. + * In that case, to get the right answer, add 1 to r.quot and + * subtract denom from r.rem. + */ + if (num >= 0 && r.rem < 0) { + r.quot++; + r.rem -= denom; + } + return (r); +} diff --git a/stdlib/FreeBSD/exit.3 b/stdlib/FreeBSD/exit.3 new file mode 100644 index 0000000..250f529 --- /dev/null +++ b/stdlib/FreeBSD/exit.3 @@ -0,0 +1,130 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)exit.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/exit.3,v 1.16 2007/01/09 00:28:09 imp Exp $ +.\" +.Dd September 9, 2002 +.Dt EXIT 3 +.Os +.Sh NAME +.Nm exit , _Exit +.Nd perform normal program termination +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft void +.Fn exit "int status" +.Ft void +.Fn _Exit "int status" +.Sh DESCRIPTION +The +.Fn exit +and +.Fn _Exit +functions terminate a process. +.Pp +Before termination, +.Fn exit +performs the following functions in the order listed: +.Bl -enum -offset indent +.It +Call the functions registered with the +.Xr atexit 3 +function, in the reverse order of their registration. +.It +Flush all open output streams. +.It +Close all open streams. +.It +Unlink all files created with the +.Xr tmpfile 3 +function. +.El +.Pp +The +.Fn _Exit +function terminates without calling the functions registered with the +.Xr atexit 3 +function, and may or may not perform the other actions listed. +Both functions make the low-order eight bits of the +.Fa status +argument available to a parent process which has called a +.Xr wait 2 Ns -family +function. +.Pp +The C Standard +.Pq St -isoC-99 +defines the values +.Li 0 , +.Dv EXIT_SUCCESS , +and +.Dv EXIT_FAILURE +as possible values of +.Fa status . +Cooperating processes may use other values; +in a program which might be called by a mail transfer agent, the +values described in +.Xr sysexits 3 +may be used to provide more information to the parent process. +.Pp +Note that +.Fn exit +does nothing to prevent bottomless recursion should a function registered +using +.Xr atexit 3 +itself call +.Fn exit . +Such functions must call +.Fn _Exit +instead (although this has other effects as well which may not be desired). +.Sh RETURN VALUES +The +.Fn exit +and +.Fn _Exit +functions +never return. +.Sh SEE ALSO +.Xr _exit 2 , +.Xr wait 2 , +.Xr atexit 3 , +.Xr intro 3 , +.Xr sysexits 3 , +.Xr tmpfile 3 +.Sh STANDARDS +The +.Fn exit +and +.Fn _Exit +functions conform to +.St -isoC-99 . diff --git a/stdlib/FreeBSD/exit.c b/stdlib/FreeBSD/exit.c new file mode 100644 index 0000000..03d8c09 --- /dev/null +++ b/stdlib/FreeBSD/exit.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)exit.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/exit.c,v 1.9 2007/01/09 00:28:09 imp Exp $"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" + +#include "atexit.h" +#include "libc_private.h" + +#include + +void (*__cleanup)(void); +extern void __exit(int) __attribute__((noreturn)); +#if !TARGET_IPHONE_SIMULATOR && (__i386__ || __x86_64__) +extern void _tlv_exit(); +#endif + +/* + * Exit, flushing stdio buffers if necessary. + */ +void +exit(int status) +{ +#if !TARGET_IPHONE_SIMULATOR && (__i386__ || __x86_64__) + _tlv_exit(); // C++11 requires thread_local objects to be destroyed before global objects +#endif + __cxa_finalize(NULL); + if (__cleanup) + (*__cleanup)(); + __exit(status); +} +#pragma clang diagnostic pop diff --git a/stdlib/FreeBSD/getenv.3 b/stdlib/FreeBSD/getenv.3 new file mode 100644 index 0000000..ebe5d28 --- /dev/null +++ b/stdlib/FreeBSD/getenv.3 @@ -0,0 +1,243 @@ +.\" Copyright (c) 1988, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getenv.3 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD$ +.\" +.Dd June 20, 2007 +.Dt GETENV 3 +.Os +.Sh NAME +.Nm getenv , +.Nm putenv , +.Nm setenv , +.Nm unsetenv +.Nd environment variable functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft char * +.Fn getenv "const char *name" +.Ft int +.Fn setenv "const char *name" "const char *value" "int overwrite" +.Ft int +.Fn putenv "char *string" +.Ft int +.Fn unsetenv "const char *name" +.Sh DESCRIPTION +These functions set, unset and fetch environment variables from the +host +.Em environment list . +.Pp +The +.Fn getenv +function obtains the current value of the environment variable, +.Fa name . +The application should not modify the string pointed +to by the +.Fn getenv +function. +.Pp +The +.Fn setenv +function inserts or resets the environment variable +.Fa name +in the current environment list. +If the variable +.Fa name +does not exist in the list, +it is inserted with the given +.Fa value . +If the variable does exist, the argument +.Fa overwrite +is tested; if +.Fa overwrite +is zero, the +variable is not reset, otherwise it is reset +to the given +.Fa value . +.Pp +The +.Fn putenv +function takes an argument of the form ``name=value'' and is +equivalent to: +.Bd -literal -offset indent +setenv(name, value, 1); +.Ed +.Pp +The string pointed to by +.Fa string +becomes part of the environment. +A program should not alter or free the string, +and should not use stack or other transient string variables +as arguments to +.Fn putenv . +The +.Fn setenv +function is strongly preferred to +.Fn putenv . +.Pp +The +.Fn unsetenv +function +deletes all instances of the variable name pointed to by +.Fa name +from the list. +Note that only the variable name (e.g., "NAME") should be given; +"NAME=value" will not work. +.Sh RETURN VALUES +The +.Fn getenv +function returns the value of the environment variable as a +.Dv NUL Ns +-terminated string. +If the variable +.Fa name +is not in the current environment, +.Dv NULL +is returned. +.Pp +.Rv -std setenv putenv unsetenv +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +The function +.Fn getenv , +.Fn setenv +or +.Fn unsetenv +failed because the +.Fa name +is a +.Dv NULL +pointer, points to an empty string, or points to a string containing an +.Dq Li \&= +character. +.Pp +The function +.Fn putenv +failed because +.Fa string +is a +.Dv NULL +pointer or +.Fa string +is without an +.Dq Li \&= +character. +.It Bq Er ENOMEM +The function +.Fn setenv , +.Fn unsetenv +or +.Fn putenv +failed because it was unable to allocate memory for the environment. +.El +.Sh LEGACY SYNOPSIS +.Fd #include +.Pp +.Ft void +.br +.Fo unsetenv +.Fa "const char *name" +.Fc ; +.Pp +.Fn unsetenv +doesn't return a value. +.Sh COMPATIBILITY +.Fn putenv +no longer copies its input buffer. +This often appears in crash logs as a crash in +.Fn getenv . +Avoid passing local buffers or freeing the memory +that is passed to +.Fn putenv . +Use +.Fn setenv , +which still makes an internal copy of its buffers. +.Pp +.Fn unsetenv +no longer parses the variable name; +e.g., unsetenv ("FOO=BAR") no longer works. +Use unsetenv("FOO"). +.Fn unsetenv +also now returns a status value and will set +.Va errno +to EINVAL if +.Fa name +is not a defined environment variable. +.Sh SEE ALSO +.Xr csh 1 , +.Xr sh 1 , +.Xr execve 2 , +.Xr compat 5 , +.Xr environ 7 +.Sh STANDARDS +The +.Fn getenv +function conforms to +.St -isoC . +The +.Fn setenv , +.Fn putenv +and +.Fn unsetenv +functions conforms to +.St -p1003.1-2001 . +.Sh HISTORY +The functions +.Fn setenv +and +.Fn unsetenv +appeared in +.At v7 . +The +.Fn putenv +function appeared in +.Bx 4.3 Reno . +.Sh BUGS +Successive calls to +.Fn setenv +that assign a larger-sized +.Fa value +than any previous value to the same +.Fa name +will result in a memory leak. +The +.Fx +semantics for this function +(namely, that the contents of +.Fa value +are copied and that old values remain accessible indefinitely) make this +bug unavoidable. +Future versions may eliminate one or both of these +semantic guarantees in order to fix the bug. diff --git a/stdlib/FreeBSD/getenv.c b/stdlib/FreeBSD/getenv.c new file mode 100644 index 0000000..c012578 --- /dev/null +++ b/stdlib/FreeBSD/getenv.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getenv.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/getenv.c,v 1.8 2007/05/01 16:02:41 ache Exp $"); + +#include +#include +#include +#include +#include + +__private_extern__ char *__findenv_locked(const char *, int *, char **); +__private_extern__ void __environ_lock(void); +__private_extern__ void __environ_unlock(void); + +/* + * __findenv_locked -- + * Returns pointer to value associated with name, if any, else NULL. + * Sets offset to be the offset of the name/value combination in the + * environmental array, for use by setenv(3) and unsetenv(3). + * Explicitly removes '=' in argument name. + * + * This routine *should* be a static; don't use it. + */ +__private_extern__ char * +__findenv_locked(name, offset, environ) + const char *name; + int *offset; + char **environ; +{ + int len, i; + const char *np; + char **p, *cp; + + if (name == NULL || environ == NULL) + return (NULL); + for (np = name; *np && *np != '='; ++np) + continue; + len = np - name; + for (p = environ; (cp = *p) != NULL; ++p) { + for (np = name, i = len; i && *cp; i--) + if (*cp++ != *np++) + break; + if (i == 0 && *cp++ == '=') { + *offset = p - environ; + return (cp); + } + } + return (NULL); +} + +static os_unfair_lock __environ_lock_obj = OS_UNFAIR_LOCK_INIT; +__private_extern__ void +__environ_lock(void) +{ + os_unfair_lock_lock_with_options( + &__environ_lock_obj, OS_UNFAIR_LOCK_DATA_SYNCHRONIZATION); +} +__private_extern__ void +__environ_unlock(void) +{ + os_unfair_lock_unlock(&__environ_lock_obj); +} +__private_extern__ void +__environ_lock_fork_child(void) +{ + __environ_lock_obj = OS_UNFAIR_LOCK_INIT; +} + +/* + * _getenvp -- SPI using an arbitrary pointer to string array (the array must + * have been created with malloc) and an env state, created by _allocenvstate(). + * Returns ptr to value associated with name, if any, else NULL. + */ +char * +_getenvp(const char *name, char ***envp, void *state __unused) +{ + // envp is passed as an argument, so the lock is not protecting everything + int offset; + __environ_lock(); + char *result = (__findenv_locked(name, &offset, *envp)); + __environ_unlock(); + return result; +} + +/* + * getenv -- + * Returns ptr to value associated with name, if any, else NULL. + */ +char * +getenv(name) + const char *name; +{ + int offset; + __environ_lock(); + char *result = __findenv_locked(name, &offset, *_NSGetEnviron()); + __environ_unlock(); + return result; +} diff --git a/stdlib/FreeBSD/getopt.3 b/stdlib/FreeBSD/getopt.3 new file mode 100644 index 0000000..ec9bf19 --- /dev/null +++ b/stdlib/FreeBSD/getopt.3 @@ -0,0 +1,306 @@ +.\" $NetBSD: getopt.3,v 1.31 2003/09/23 10:26:54 wiz Exp $ +.\" +.\" Copyright (c) 1988, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getopt.3 8.5 (Berkeley) 4/27/95 +.\" $FreeBSD: src/lib/libc/stdlib/getopt.3,v 1.26 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd April 27, 1995 +.Dt GETOPT 3 +.Os +.Sh NAME +.Nm getopt +.Nd get option character from command line argument list +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Vt extern char *optarg ; +.Vt extern int optind ; +.Vt extern int optopt ; +.Vt extern int opterr ; +.Vt extern int optreset ; +.Ft int +.Fn getopt "int argc" "char * const argv[]" "const char *optstring" +.Sh DESCRIPTION +The +.Fn getopt +function incrementally parses a command line argument list +.Fa argv +and returns the next +.Em known +option character. +An option character is +.Em known +if it has been specified in the string of accepted option characters, +.Fa optstring . +.Pp +The option string +.Fa optstring +may contain the following elements: individual characters, and +characters followed by a colon to indicate an option argument +is to follow. +For example, an option string +.Li "\&""x"" +recognizes an option +.Dq Fl x , +and an option string +.Li "\&""x:"" +recognizes an option and argument +.Dq Fl x Ar argument . +It does not matter to +.Fn getopt +if a following argument has leading white space. +.Pp +On return from +.Fn getopt , +.Va optarg +points to an option argument, if it is anticipated, +and the variable +.Va optind +contains the index to the next +.Fa argv +argument for a subsequent call +to +.Fn getopt . +The variable +.Va optopt +saves the last +.Em known +option character returned by +.Fn getopt . +.Pp +The variables +.Va opterr +and +.Va optind +are both initialized to 1. +The +.Va optind +variable may be set to another value before a set of calls to +.Fn getopt +in order to skip over more or less argv entries. +.Pp +In order to use +.Fn getopt +to evaluate multiple sets of arguments, or to evaluate a single set of +arguments multiple times, +the variable +.Va optreset +must be set to 1 before the second and each additional set of calls to +.Fn getopt , +and the variable +.Va optind +must be reinitialized. +.Pp +The +.Fn getopt +function returns \-1 when the argument list is exhausted. +The interpretation of options in the argument list may be cancelled +by the option +.Ql -- +(double dash) which causes +.Fn getopt +to signal the end of argument processing and return \-1. +When all options have been processed (i.e., up to the first non-option +argument), +.Fn getopt +returns \-1. +.Sh RETURN VALUES +The +.Fn getopt +function returns the next known option character in +.Fa optstring . +If +.Fn getopt +encounters a character not found in +.Fa optstring +or if it detects a missing option argument, +it returns +.Ql \&? +(question mark). +If +.Fa optstring +has a leading +.Ql \&: +then a missing option argument causes +.Ql \&: +to be returned instead of +.Ql \&? . +In either case, the variable +.Va optopt +is set to the character that caused the error. +The +.Fn getopt +function returns \-1 when the argument list is exhausted. +.Sh EXAMPLES +.Bd -literal -compact +#include +int bflag, ch, fd; + +bflag = 0; +while ((ch = getopt(argc, argv, "bf:")) != -1) { + switch (ch) { + case 'b': + bflag = 1; + break; + case 'f': + if ((fd = open(optarg, O_RDONLY, 0)) \*[Lt] 0) { + (void)fprintf(stderr, + "myname: %s: %s\en", optarg, strerror(errno)); + exit(1); + } + break; + case '?': + default: + usage(); + } +} +argc -= optind; +argv += optind; +.Ed +.Sh DIAGNOSTICS +If the +.Fn getopt +function encounters a character not found in the string +.Fa optstring +or detects +a missing option argument it writes an error message to the +.Dv stderr +and returns +.Ql \&? . +Setting +.Va opterr +to a zero will disable these error messages. +If +.Fa optstring +has a leading +.Ql \&: +then a missing option argument causes a +.Ql \&: +to be returned in addition to suppressing any error messages. +.Pp +Option arguments are allowed to begin with +.Dq Li \- ; +this is reasonable but reduces the amount of error checking possible. +.Sh SEE ALSO +.Xr getopt 1 , +.Xr getopt_long 3 , +.Xr getsubopt 3 +.Sh STANDARDS +The +.Va optreset +variable was added to make it possible to call the +.Fn getopt +function multiple times. +This is an extension to the +.St -p1003.2 +specification. +.Sh HISTORY +The +.Fn getopt +function appeared in +.Bx 4.3 . +.Sh BUGS +The +.Fn getopt +function was once specified to return +.Dv EOF +instead of \-1. +This was changed by +.St -p1003.2-92 +to decouple +.Fn getopt +from +.In stdio.h . +.Pp +A single dash +.Dq Li - +may be specified as a character in +.Fa optstring , +however it should +.Em never +have an argument associated with it. +This allows +.Fn getopt +to be used with programs that expect +.Dq Li - +as an option flag. +This practice is wrong, and should not be used in any current development. +It is provided for backward compatibility +.Em only . +Care should be taken not to use +.Ql \&- +as the first character in +.Fa optstring +to avoid a semantic conflict with +.Tn GNU +.Fn getopt , +which assigns different meaning to an +.Fa optstring +that begins with a +.Ql \&- . +By default, a single dash causes +.Fn getopt +to return \-1. +.Pp +It is also possible to handle digits as option letters. +This allows +.Fn getopt +to be used with programs that expect a number +.Pq Dq Li \&-\&3 +as an option. +This practice is wrong, and should not be used in any current development. +It is provided for backward compatibility +.Em only . +The following code fragment works in most cases. +.Bd -literal -offset indent +int ch; +long length; +char *p, *ep; + +while ((ch = getopt(argc, argv, "0123456789")) != -1) + switch (ch) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + p = argv[optind - 1]; + if (p[0] == '-' \*[Am]\*[Am] p[1] == ch \*[Am]\*[Am] !p[2]) { + length = ch - '0'; + ep = ""; + } else if (argv[optind] \*[Am]\*[Am] argv[optind][1] == ch) { + length = strtol((p = argv[optind] + 1), + \*[Am]ep, 10); + optind++; + optreset = 1; + } else + usage(); + if (*ep != '\e0') + errx(EX_USAGE, "illegal number -- %s", p); + break; + } +.Ed diff --git a/stdlib/FreeBSD/getopt.c b/stdlib/FreeBSD/getopt.c new file mode 100644 index 0000000..c45494c --- /dev/null +++ b/stdlib/FreeBSD/getopt.c @@ -0,0 +1,149 @@ +/* $NetBSD: getopt.c,v 1.26 2003/08/07 16:43:40 agc Exp $ */ + +/* + * Copyright (c) 1987, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/getopt.c,v 1.8 2007/01/09 00:28:10 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" + +#ifndef BUILDING_VARIANT +int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ +#endif /* !BUILDING_VARIANT */ + +#define BADCH (int)'?' +#define BADARG (int)':' +#define EMSG "" + +#if __DARWIN_UNIX03 +#define PROGNAME nargv[0] +#else +#define PROGNAME _getprogname() +#endif + +/* + * getopt -- + * Parse argc/argv argument vector. + */ +int +getopt(nargc, nargv, ostr) + int nargc; + char * const nargv[]; + const char *ostr; +{ + static char *place = EMSG; /* option letter processing */ + char *oli; /* option letter list index */ + + if (optreset || *place == 0) { /* update scanning pointer */ + optreset = 0; + place = nargv[optind]; + if (optind >= nargc || *place++ != '-') { + /* Argument is absent or is not an option */ + place = EMSG; + return (-1); + } + optopt = *place++; + if (optopt == '-' && *place == 0) { + /* "--" => end of options */ + ++optind; + place = EMSG; + return (-1); + } + if (optopt == 0) { + /* Solitary '-', treat as a '-' option + if the program (eg su) is looking for it. */ + place = EMSG; + if (strchr(ostr, '-') == NULL) + return (-1); + optopt = '-'; + } + } else + optopt = *place++; + + /* See if option letter is one the caller wanted... */ + if (optopt == ':' || (oli = strchr(ostr, optopt)) == NULL) { + if (*place == 0) + ++optind; + if (opterr && *ostr != ':') + (void)fprintf(stderr, + "%s: illegal option -- %c\n", + PROGNAME, optopt); + return (BADCH); + } + + /* Does this option need an argument? */ + if (oli[1] != ':') { + /* don't need argument */ + optarg = NULL; + if (*place == 0) + ++optind; + } else { + /* Option-argument is either the rest of this argument or the + entire next argument. */ + if (*place) + optarg = place; + else if (nargc > ++optind) + optarg = nargv[optind]; + else { + /* option-argument absent */ +#if __DARWIN_UNIX03 + /* Yes, the standard will put optind past the last + argument */ + ++optind; + optarg = NULL; +#endif /* __DARWIN_UNIX03 */ + place = EMSG; + if (*ostr == ':') + return (BADARG); + if (opterr) + (void)fprintf(stderr, + "%s: option requires an argument -- %c\n", + PROGNAME, optopt); + return (BADCH); + } + place = EMSG; + ++optind; + } + return (optopt); /* return option letter */ +} diff --git a/stdlib/FreeBSD/getopt_long.3 b/stdlib/FreeBSD/getopt_long.3 new file mode 100644 index 0000000..6904716 --- /dev/null +++ b/stdlib/FreeBSD/getopt_long.3 @@ -0,0 +1,507 @@ +.\" $OpenBSD: getopt_long.3,v 1.10 2004/01/06 23:44:28 fgsch Exp $ +.\" $NetBSD: getopt_long.3,v 1.14 2003/08/07 16:43:40 agc Exp $ +.\" +.\" Copyright (c) 1988, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getopt.3 8.5 (Berkeley) 4/27/95 +.\" $FreeBSD$ +.\" +.Dd December 25, 2011 +.Dt GETOPT_LONG 3 +.Os +.Sh NAME +.Nm getopt_long , +.Nm getopt_long_only +.Nd get long options from command line argument list +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In getopt.h +.Vt extern char *optarg ; +.Vt extern int optind ; +.Vt extern int optopt ; +.Vt extern int opterr ; +.Vt extern int optreset ; +.Ft int +.Fo getopt_long +.Fa "int argc" "char * const *argv" "const char *optstring" +.Fa "const struct option *longopts" "int *longindex" +.Fc +.Ft int +.Fo getopt_long_only +.Fa "int argc" "char * const *argv" "const char *optstring" +.Fa "const struct option *longopts" "int *longindex" +.Fc +.Sh DESCRIPTION +The +.Fn getopt_long +function is similar to +.Xr getopt 3 +but it accepts options in two forms: words and characters. +The +.Fn getopt_long +function provides a superset of the functionality of +.Xr getopt 3 . +The +.Fn getopt_long +function +can be used in two ways. +In the first way, every long option understood +by the program has a corresponding short option, and the option +structure is only used to translate from long options to short +options. +When used in this fashion, +.Fn getopt_long +behaves identically to +.Xr getopt 3 . +This is a good way to add long option processing to an existing program +with the minimum of rewriting. +.Pp +In the second mechanism, a long option sets a flag in the +.Vt option +structure passed, or will store a pointer to the command line argument +in the +.Vt option +structure passed to it for options that take arguments. +Additionally, +the long option's argument may be specified as a single argument with +an equal sign, e.g., +.Pp +.Dl "myprogram --myoption=somevalue" +.Pp +When a long option is processed, the call to +.Fn getopt_long +will return 0. +For this reason, long option processing without +shortcuts is not backwards compatible with +.Xr getopt 3 . +.Pp +It is possible to combine these methods, providing for long options +processing with short option equivalents for some options. +Less +frequently used options would be processed as long options only. +.Pp +The +.Fn getopt_long +call requires a structure to be initialized describing the long +options. +The structure is: +.Bd -literal -offset indent +struct option { + char *name; + int has_arg; + int *flag; + int val; +}; +.Ed +.Pp +The +.Va name +field should contain the option name without the leading double dash. +.Pp +The +.Va has_arg +field should be one of: +.Pp +.Bl -tag -width ".Dv optional_argument" -offset indent -compact +.It Dv no_argument +no argument to the option is expected +.It Dv required_argument +an argument to the option is required +.It Dv optional_argument +an argument to the option may be presented +.El +.Pp +If +.Va flag +is not +.Dv NULL , +then the integer pointed to by it will be set to the +value in the +.Va val +field. +If the +.Va flag +field is +.Dv NULL , +then the +.Va val +field will be returned. +Setting +.Va flag +to +.Dv NULL +and setting +.Va val +to the corresponding short option will make this function act just +like +.Xr getopt 3 . +.Pp +If the +.Fa longindex +field is not +.Dv NULL , +then the integer pointed to by it will be set to the index of the long +option relative to +.Fa longopts . +.Pp +The last element of the +.Fa longopts +array has to be filled with zeroes. +.Pp +The +.Fn getopt_long_only +function behaves identically to +.Fn getopt_long +with the exception that long options may start with +.Ql - +in addition to +.Ql -- . +If an option starting with +.Ql - +does not match a long option but does match a single-character option, +the single-character option is returned. +.Sh RETURN VALUES +If the +.Fa flag +field in +.Vt "struct option" +is +.Dv NULL , +.Fn getopt_long +and +.Fn getopt_long_only +return the value specified in the +.Fa val +field, which is usually just the corresponding short option. +If +.Fa flag +is not +.Dv NULL , +these functions return 0 and store +.Fa val +in the location pointed to by +.Fa flag . +These functions return +.Ql \&: +if there was a missing option argument, +.Ql \&? +if the user specified an unknown or ambiguous option, and +\-1 when the argument list has been exhausted. +.Sh ENVIRONMENT +.Bl -tag -width ".Ev POSIXLY_CORRECT" +.It Ev POSIXLY_CORRECT +If set, option processing stops when the first non-option is found and +a leading +.Ql - +or +.Ql + +in the +.Fa optstring +is ignored. +.El +.Sh EXAMPLES +.Bd -literal -compact +int bflag, ch, fd; +int daggerset; + +/* options descriptor */ +static struct option longopts[] = { + { "buffy", no_argument, NULL, 'b' }, + { "fluoride", required_argument, NULL, 'f' }, + { "daggerset", no_argument, \*[Am]daggerset, 1 }, + { NULL, 0, NULL, 0 } +}; + +bflag = 0; +while ((ch = getopt_long(argc, argv, "bf:", longopts, NULL)) != -1) { + switch (ch) { + case 'b': + bflag = 1; + break; + case 'f': + if ((fd = open(optarg, O_RDONLY, 0)) == -1) + err(1, "unable to open %s", optarg); + break; + case 0: + if (daggerset) { + fprintf(stderr,"Buffy will use her dagger to " + "apply fluoride to dracula's teeth\en"); + } + break; + default: + usage(); + } +} +argc -= optind; +argv += optind; +.Ed +.Sh IMPLEMENTATION DIFFERENCES +This section describes differences to the +.Tn GNU +implementation +found in glibc-2.1.3: +.Bl -bullet +.\" .It +.\" Handling of +.\" .Ql - +.\" as first char of option string in presence of +.\" environment variable +.\" .Ev POSIXLY_CORRECT : +.\" .Bl -tag -width ".Bx" +.\" .It Tn GNU +.\" ignores +.\" .Ev POSIXLY_CORRECT +.\" and returns non-options as +.\" arguments to option '\e1'. +.\" .It Bx +.\" honors +.\" .Ev POSIXLY_CORRECT +.\" and stops at the first non-option. +.\" .El +.\" .It +.\" Handling of +.\" .Ql - +.\" within the option string (not the first character): +.\" .Bl -tag -width ".Bx" +.\" .It Tn GNU +.\" treats a +.\" .Ql - +.\" on the command line as a non-argument. +.\" .It Bx +.\" a +.\" .Ql - +.\" within the option string matches a +.\" .Ql - +.\" (single dash) on the command line. +.\" This functionality is provided for backward compatibility with +.\" programs, such as +.\" .Xr su 1 , +.\" that use +.\" .Ql - +.\" as an option flag. +.\" This practice is wrong, and should not be used in any current development. +.\" .El +.\" .It +.\" Handling of +.\" .Ql :: +.\" in options string in presence of +.\" .Ev POSIXLY_CORRECT : +.\" .Bl -tag -width ".Bx" +.\" .It Both +.\" .Tn GNU +.\" and +.\" .Bx +.\" ignore +.\" .Ev POSIXLY_CORRECT +.\" here and take +.\" .Ql :: +.\" to +.\" mean the preceding option takes an optional argument. +.\" .El +.\" .It +.\" Return value in case of missing argument if first character +.\" (after +.\" .Ql + +.\" or +.\" .Ql - ) +.\" in option string is not +.\" .Ql \&: : +.\" .Bl -tag -width ".Bx" +.\" .It Tn GNU +.\" returns +.\" .Ql \&? +.\" .It Bx +.\" returns +.\" .Ql \&: +.\" (since +.\" .Bx Ns 's +.\" .Fn getopt +.\" does). +.\" .El +.\" .It +.\" Handling of +.\" .Ql --a +.\" in getopt: +.\" .Bl -tag -width ".Bx" +.\" .It Tn GNU +.\" parses this as option +.\" .Ql - , +.\" option +.\" .Ql a . +.\" .It Bx +.\" parses this as +.\" .Ql -- , +.\" and returns \-1 (ignoring the +.\" .Ql a ) . +.\" (Because the original +.\" .Fn getopt +.\" does.) +.\" .El +.It +Setting of +.Va optopt +for long options with +.Va flag +!= +.Dv NULL : +.Bl -tag -width ".Bx" +.It Tn GNU +sets +.Va optopt +to +.Va val . +.It Bx +sets +.Va optopt +to 0 (since +.Va val +would never be returned). +.El +.\" .It +.\" Handling of +.\" .Ql -W +.\" with +.\" .Ql W; +.\" in option string in +.\" .Fn getopt +.\" (not +.\" .Fn getopt_long ) : +.\" .Bl -tag -width ".Bx" +.\" .It Tn GNU +.\" causes a segfault. +.\" .It Bx +.\" no special handling is done; +.\" .Ql W; +.\" is interpreted as two separate options, neither of which take an argument. +.\" .El +.It +Setting of +.Va optarg +for long options without an argument that are +invoked via +.Ql -W +.Ql ( W; +in option string): +.Bl -tag -width ".Bx" +.It Tn GNU +sets +.Va optarg +to the option name (the argument of +.Ql -W ) . +.It Bx +sets +.Va optarg +to +.Dv NULL +(the argument of the long option). +.El +.It +Handling of +.Ql -W +with an argument that is not (a prefix to) a known +long option +.Ql ( W; +in option string): +.Bl -tag -width ".Bx" +.It Tn GNU +returns +.Ql -W +with +.Va optarg +set to the unknown option. +.It Bx +treats this as an error (unknown option) and returns +.Ql \&? +with +.Va optopt +set to 0 and +.Va optarg +set to +.Dv NULL +(as +.Tn GNU Ns 's +man page documents). +.El +.\" .It +.\" The error messages are different. +.It +.Bx +does not permute the argument vector at the same points in +the calling sequence as +.Tn GNU +does. +The aspects normally used by +the caller (ordering after \-1 is returned, value of +.Va optind +relative +to current positions) are the same, though. +(We do fewer variable swaps.) +.El +.Sh SEE ALSO +.Xr getopt 3 +.Sh HISTORY +The +.Fn getopt_long +and +.Fn getopt_long_only +functions first appeared in the +.Tn GNU +libiberty library. +The first +.Bx +implementation of +.Fn getopt_long +appeared in +.Nx 1.5 , +the first +.Bx +implementation of +.Fn getopt_long_only +in +.Ox 3.3 . +.Fx +first included +.Fn getopt_long +in +.Fx 5.0 , +.Fn getopt_long_only +in +.Fx 5.2 . +.Sh BUGS +The +.Fa argv +argument is not really +.Vt const +as its elements may be permuted (unless +.Ev POSIXLY_CORRECT +is set). +.Pp +The implementation can completely replace +.Xr getopt 3 , +but right now we are using separate code. diff --git a/stdlib/FreeBSD/getopt_long.c b/stdlib/FreeBSD/getopt_long.c new file mode 100644 index 0000000..c42edb3 --- /dev/null +++ b/stdlib/FreeBSD/getopt_long.c @@ -0,0 +1,625 @@ +/* $OpenBSD: getopt_long.c,v 1.21 2006/09/22 17:22:05 millert Exp $ */ +/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ + +/* + * Copyright (c) 2002 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dieter Baron and Thomas Klausner. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char *rcsid = "$OpenBSD: getopt_long.c,v 1.16 2004/02/04 18:17:25 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ +#endif +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/getopt_long.c,v 1.15 2006/09/23 14:48:31 ache Exp $"); + +#include +#include +#include +#include +#include + +#define GNU_COMPATIBLE /* Be more compatible, configure's use us! */ + +#if 0 /* we prefer to keep our getopt(3) */ +#define REPLACE_GETOPT /* use this getopt as the system getopt(3) */ +#endif + +#ifdef REPLACE_GETOPT +int opterr = 1; /* if error message should be printed */ +int optind = 1; /* index into parent argv vector */ +int optopt = '?'; /* character checked for validity */ +int optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ +#endif + +#define PRINT_ERROR ((opterr) && (*options != ':')) + +#define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */ +#define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */ +#define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */ + +/* return values */ +#define BADCH (int)'?' +#define BADARG ((*options == ':') ? (int)':' : (int)'?') +#define INORDER (int)1 + +#define EMSG "" + +#ifdef GNU_COMPATIBLE +#define NO_PREFIX (-1) +#define D_PREFIX 0 +#define DD_PREFIX 1 +#define W_PREFIX 2 +#endif + +static int getopt_internal(int, char * const *, const char *, + const struct option *, int *, int); +static int parse_long_options(char * const *, const char *, + const struct option *, int *, int, int); +static int gcd(int, int); +static void permute_args(int, int, int, char * const *); + +static char *place = EMSG; /* option letter processing */ + +/* XXX: set optreset to 1 rather than these two */ +static int nonopt_start = -1; /* first non option argument (for permute) */ +static int nonopt_end = -1; /* first option after non options (for permute) */ + +/* Error messages */ +static const char recargchar[] = "option requires an argument -- %c"; +static const char illoptchar[] = "illegal option -- %c"; /* From P1003.2 */ +#ifdef GNU_COMPATIBLE +static int dash_prefix = NO_PREFIX; +static const char gnuoptchar[] = "invalid option -- %c"; + +static const char recargstring[] = "option `%s%s' requires an argument"; +static const char ambig[] = "option `%s%.*s' is ambiguous"; +static const char noarg[] = "option `%s%.*s' doesn't allow an argument"; +static const char illoptstring[] = "unrecognized option `%s%s'"; +#else +static const char recargstring[] = "option requires an argument -- %s"; +static const char ambig[] = "ambiguous option -- %.*s"; +static const char noarg[] = "option doesn't take an argument -- %.*s"; +static const char illoptstring[] = "unknown option -- %s"; +#endif + +/* + * Compute the greatest common divisor of a and b. + */ +static int +gcd(int a, int b) +{ + int c; + + c = a % b; + while (c != 0) { + a = b; + b = c; + c = a % b; + } + + return (b); +} + +/* + * Exchange the block from nonopt_start to nonopt_end with the block + * from nonopt_end to opt_end (keeping the same order of arguments + * in each block). + */ +static void +permute_args(int panonopt_start, int panonopt_end, int opt_end, + char * const *nargv) +{ + int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; + char *swap; + + /* + * compute lengths of blocks and number and size of cycles + */ + nnonopts = panonopt_end - panonopt_start; + nopts = opt_end - panonopt_end; + ncycle = gcd(nnonopts, nopts); + cyclelen = (opt_end - panonopt_start) / ncycle; + + for (i = 0; i < ncycle; i++) { + cstart = panonopt_end+i; + pos = cstart; + for (j = 0; j < cyclelen; j++) { + if (pos >= panonopt_end) + pos -= nnonopts; + else + pos += nopts; + swap = nargv[pos]; + /* LINTED const cast */ + ((char **) nargv)[pos] = nargv[cstart]; + /* LINTED const cast */ + ((char **)nargv)[cstart] = swap; + } + } +} + +/* + * parse_long_options -- + * Parse long options in argc/argv argument vector. + * Returns -1 if short_too is set and the option does not match long_options. + */ +static int +parse_long_options(char * const *nargv, const char *options, + const struct option *long_options, int *idx, int short_too, int flags) +{ + char *current_argv, *has_equal; +#ifdef GNU_COMPATIBLE + char *current_dash; +#endif + size_t current_argv_len; + int i, match, exact_match, second_partial_match; + + current_argv = place; +#ifdef GNU_COMPATIBLE + switch (dash_prefix) { + case D_PREFIX: + current_dash = "-"; + break; + case DD_PREFIX: + current_dash = "--"; + break; + case W_PREFIX: + current_dash = "-W "; + break; + default: + current_dash = ""; + break; + } +#endif + match = -1; + exact_match = 0; + second_partial_match = 0; + + optind++; + + if ((has_equal = strchr(current_argv, '=')) != NULL) { + /* argument found (--option=arg) */ + current_argv_len = has_equal - current_argv; + has_equal++; + } else + current_argv_len = strlen(current_argv); + + for (i = 0; long_options[i].name; i++) { + /* find matching long option */ + if (strncmp(current_argv, long_options[i].name, + current_argv_len)) + continue; + + if (strlen(long_options[i].name) == current_argv_len) { + /* exact match */ + match = i; + exact_match = 1; + break; + } + /* + * If this is a known short option, don't allow + * a partial match of a single character. + */ + if (short_too && current_argv_len == 1) + continue; + + if (match == -1) /* first partial match */ + match = i; + else if ((flags & FLAG_LONGONLY) || + long_options[i].has_arg != + long_options[match].has_arg || + long_options[i].flag != long_options[match].flag || + long_options[i].val != long_options[match].val) + second_partial_match = 1; + } + if (!exact_match && second_partial_match) { + /* ambiguous abbreviation */ + if (PRINT_ERROR) + warnx(ambig, +#ifdef GNU_COMPATIBLE + current_dash, +#endif + (int)current_argv_len, + current_argv); + optopt = 0; + return (BADCH); + } + if (match != -1) { /* option found */ + if (long_options[match].has_arg == no_argument + && has_equal) { + if (PRINT_ERROR) + warnx(noarg, +#ifdef GNU_COMPATIBLE + current_dash, +#endif + (int)current_argv_len, + current_argv); + /* + * XXX: GNU sets optopt to val regardless of flag + */ + if (long_options[match].flag == NULL) + optopt = long_options[match].val; + else + optopt = 0; +#ifdef GNU_COMPATIBLE + return (BADCH); +#else + return (BADARG); +#endif + } + if (long_options[match].has_arg == required_argument || + long_options[match].has_arg == optional_argument) { + if (has_equal) + optarg = has_equal; + else if (long_options[match].has_arg == + required_argument) { + /* + * optional argument doesn't use next nargv + */ + optarg = nargv[optind++]; + } + } + if ((long_options[match].has_arg == required_argument) + && (optarg == NULL)) { + /* + * Missing argument; leading ':' indicates no error + * should be generated. + */ + if (PRINT_ERROR) + warnx(recargstring, +#ifdef GNU_COMPATIBLE + current_dash, +#endif + current_argv); + /* + * XXX: GNU sets optopt to val regardless of flag + */ + if (long_options[match].flag == NULL) + optopt = long_options[match].val; + else + optopt = 0; + --optind; + return (BADARG); + } + } else { /* unknown option */ + if (short_too) { + --optind; + return (-1); + } + if (PRINT_ERROR) + warnx(illoptstring, +#ifdef GNU_COMPATIBLE + current_dash, +#endif + current_argv); + optopt = 0; + return (BADCH); + } + if (idx) + *idx = match; + if (long_options[match].flag) { + *long_options[match].flag = long_options[match].val; + return (0); + } else + return (long_options[match].val); +} + +/* + * getopt_internal -- + * Parse argc/argv argument vector. Called by user level routines. + */ +static int +getopt_internal(int nargc, char * const *nargv, const char *options, + const struct option *long_options, int *idx, int flags) +{ + char *oli; /* option letter list index */ + int optchar, short_too; + int posixly_correct; /* no static, can be changed on the fly */ + + if (options == NULL) + return (-1); + + /* + * Disable GNU extensions if POSIXLY_CORRECT is set or options + * string begins with a '+'. + */ + posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); +#ifdef GNU_COMPATIBLE + if (*options == '-') + flags |= FLAG_ALLARGS; + else if (posixly_correct || *options == '+') + flags &= ~FLAG_PERMUTE; +#else + if (posixly_correct || *options == '+') + flags &= ~FLAG_PERMUTE; + else if (*options == '-') + flags |= FLAG_ALLARGS; +#endif + if (*options == '+' || *options == '-') + options++; + + /* + * XXX Some GNU programs (like cvs) set optind to 0 instead of + * XXX using optreset. Work around this braindamage. + */ + if (optind == 0) + optind = optreset = 1; + + optarg = NULL; + if (optreset) + nonopt_start = nonopt_end = -1; +start: + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; + if (optind >= nargc) { /* end of argument vector */ + place = EMSG; + if (nonopt_end != -1) { + /* do permutation, if we have to */ + permute_args(nonopt_start, nonopt_end, + optind, nargv); + optind -= nonopt_end - nonopt_start; + } + else if (nonopt_start != -1) { + /* + * If we skipped non-options, set optind + * to the first of them. + */ + optind = nonopt_start; + } + nonopt_start = nonopt_end = -1; + return (-1); + } + if (*(place = nargv[optind]) != '-' || +#ifdef GNU_COMPATIBLE + place[1] == '\0') { +#else + (place[1] == '\0' && strchr(options, '-') == NULL)) { +#endif + place = EMSG; /* found non-option */ + if (flags & FLAG_ALLARGS) { + /* + * GNU extension: + * return non-option as argument to option 1 + */ + optarg = nargv[optind++]; + return (INORDER); + } + if (!(flags & FLAG_PERMUTE)) { + /* + * If no permutation wanted, stop parsing + * at first non-option. + */ + return (-1); + } + /* do permutation */ + if (nonopt_start == -1) + nonopt_start = optind; + else if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, + optind, nargv); + nonopt_start = optind - + (nonopt_end - nonopt_start); + nonopt_end = -1; + } + optind++; + /* process next argument */ + goto start; + } + if (nonopt_start != -1 && nonopt_end == -1) + nonopt_end = optind; + + /* + * If we have "-" do nothing, if "--" we are done. + */ + if (place[1] != '\0' && *++place == '-' && place[1] == '\0') { + optind++; + place = EMSG; + /* + * We found an option (--), so if we skipped + * non-options, we have to permute. + */ + if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, + optind, nargv); + optind -= nonopt_end - nonopt_start; + } + nonopt_start = nonopt_end = -1; + return (-1); + } + } + + /* + * Check long options if: + * 1) we were passed some + * 2) the arg is not just "-" + * 3) either the arg starts with -- we are getopt_long_only() + */ + if (long_options != NULL && place != nargv[optind] && + (*place == '-' || (flags & FLAG_LONGONLY))) { + short_too = 0; +#ifdef GNU_COMPATIBLE + dash_prefix = D_PREFIX; +#endif + if (*place == '-') { + place++; /* --foo long option */ +#ifdef GNU_COMPATIBLE + dash_prefix = DD_PREFIX; +#endif + } else if (*place != ':' && strchr(options, *place) != NULL) + short_too = 1; /* could be short option too */ + + optchar = parse_long_options(nargv, options, long_options, + idx, short_too, flags); + if (optchar != -1) { + place = EMSG; + return (optchar); + } + } + + if ((optchar = (int)*place++) == (int)':' || + (optchar == (int)'-' && *place != '\0') || + (oli = strchr(options, optchar)) == NULL) { + /* + * If the user specified "-" and '-' isn't listed in + * options, return -1 (non-option) as per POSIX. + * Otherwise, it is an unknown option character (or ':'). + */ + if (optchar == (int)'-' && *place == '\0') + return (-1); + if (!*place) + ++optind; +#ifdef GNU_COMPATIBLE + if (PRINT_ERROR) + warnx(posixly_correct ? illoptchar : gnuoptchar, + optchar); +#else + if (PRINT_ERROR) + warnx(illoptchar, optchar); +#endif + optopt = optchar; + return (BADCH); + } + if (long_options != NULL && optchar == 'W' && oli[1] == ';') { + /* -W long-option */ + if (*place) /* no space */ + /* NOTHING */; + else if (++optind >= nargc) { /* no arg */ + place = EMSG; + if (PRINT_ERROR) + warnx(recargchar, optchar); + optopt = optchar; + return (BADARG); + } else /* white space */ + place = nargv[optind]; +#ifdef GNU_COMPATIBLE + dash_prefix = W_PREFIX; +#endif + optchar = parse_long_options(nargv, options, long_options, + idx, 0, flags); + place = EMSG; + return (optchar); + } + if (*++oli != ':') { /* doesn't take argument */ + if (!*place) + ++optind; + } else { /* takes (optional) argument */ + optarg = NULL; + if (*place) /* no white space */ + optarg = place; + else if (oli[1] != ':') { /* arg not optional */ + if (++optind >= nargc) { /* no arg */ + place = EMSG; + if (PRINT_ERROR) + warnx(recargchar, optchar); + optopt = optchar; + return (BADARG); + } else + optarg = nargv[optind]; + } + place = EMSG; + ++optind; + } + /* dump back option letter */ + return (optchar); +} + +#ifdef REPLACE_GETOPT +/* + * getopt -- + * Parse argc/argv argument vector. + * + * [eventually this will replace the BSD getopt] + */ +int +getopt(int nargc, char * const *nargv, const char *options) +{ + + /* + * We don't pass FLAG_PERMUTE to getopt_internal() since + * the BSD getopt(3) (unlike GNU) has never done this. + * + * Furthermore, since many privileged programs call getopt() + * before dropping privileges it makes sense to keep things + * as simple (and bug-free) as possible. + */ + return (getopt_internal(nargc, nargv, options, NULL, NULL, 0)); +} +#endif /* REPLACE_GETOPT */ + +/* + * getopt_long -- + * Parse argc/argv argument vector. + */ +int +getopt_long(int nargc, char * const *nargv, const char *options, + const struct option *long_options, int *idx) +{ + + return (getopt_internal(nargc, nargv, options, long_options, idx, + FLAG_PERMUTE)); +} + +/* + * getopt_long_only -- + * Parse argc/argv argument vector. + */ +int +getopt_long_only(int nargc, char * const *nargv, const char *options, + const struct option *long_options, int *idx) +{ + + return (getopt_internal(nargc, nargv, options, long_options, idx, + FLAG_PERMUTE|FLAG_LONGONLY)); +} diff --git a/stdlib/FreeBSD/getsubopt.3 b/stdlib/FreeBSD/getsubopt.3 new file mode 100644 index 0000000..c1ddee2 --- /dev/null +++ b/stdlib/FreeBSD/getsubopt.3 @@ -0,0 +1,149 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)getsubopt.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/stdlib/getsubopt.3,v 1.11 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd June 9, 1993 +.Dt GETSUBOPT 3 +.Os +.Sh NAME +.Nm getsubopt +.Nd get sub options from an argument +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Vt extern char *suboptarg ; +.Ft int +.Fo getsubopt +.Fa "char **optionp" +.Fa "char *const *keylistp" +.Fa "char **valuep" +.Fc +.Sh DESCRIPTION +The +.Fn getsubopt +function +parses a string containing tokens that are delimited +by one or more tab, space, or comma +.Pq Ql \&, +characters. +It is intended for use in parsing groups of option arguments +that are provided as part of a utility command line. +.Pp +The argument +.Fa optionp +is a pointer to a pointer to the string. +The argument +.Fa keylistp +is a pointer to a +.Dv NULL Ns -terminated +array of pointers to strings. +.Pp +The +.Fn getsubopt +function +returns the zero-based offset of the pointer in the +.Fa keylistp +array, referencing a string which matches the first token in the string + or \-1 if the string contains no tokens or +.Fa keylistp +does not contain a matching string. +.Pp +If the token is of the form ``name=value'', the location referenced by +.Fa valuep +will be set to point to the start of the ``value'' portion of the token. +.Pp +On return from +.Fn getsubopt , +.Fa optionp +will be set to point to the start of the next token in the string, +or the null at the end of the string if no more tokens are present. +The external variable +.Fa suboptarg +will be set to point to the start of the current token, or +.Dv NULL +if no +tokens were present. +The argument +.Fa valuep +will be set to point to the ``value'' portion of the token, or +.Dv NULL +if no ``value'' portion was present. +.Sh EXAMPLES +.Bd -literal -compact +char *keylistp[] = { + #define ONE 0 + "one", + #define TWO 1 + "two", + NULL +}; + +\&... + +extern char *optarg, *suboptarg; +char *options, *value; + +while ((ch = getopt(argc, argv, "ab:")) != \-1) { + switch(ch) { + case 'a': + /* process ``a'' option */ + break; + case 'b': + options = optarg; + while (*options) { + switch(getsubopt(&options, keylistp, &value)) { + case ONE: + /* process ``one'' sub option */ + break; + case TWO: + /* process ``two'' sub option */ + if (!value) + error("no value for two"); + i = atoi(value); + break; + case \-1: + if (suboptarg) + error("illegal sub option %s", + suboptarg); + else + error("missing sub option"); + break; + } + break; + } +.Ed +.Sh SEE ALSO +.Xr getopt 3 , +.Xr strsep 3 +.Sh HISTORY +The +.Fn getsubopt +function first appeared in +.Bx 4.4 . diff --git a/stdlib/FreeBSD/getsubopt.c b/stdlib/FreeBSD/getsubopt.c new file mode 100644 index 0000000..194734e --- /dev/null +++ b/stdlib/FreeBSD/getsubopt.c @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getsubopt.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/getsubopt.c,v 1.7 2007/01/09 00:28:10 imp Exp $"); + +#include +#include + +/* + * The SVID interface to getsubopt provides no way of figuring out which + * part of the suboptions list wasn't matched. This makes error messages + * tricky... The extern variable suboptarg is a pointer to the token + * which didn't match. + */ +char *suboptarg; + +int +getsubopt(optionp, tokens, valuep) + char **optionp, **valuep; + char * const *tokens; +{ + int cnt; + char *p; + + suboptarg = *valuep = NULL; + + if (!optionp || !*optionp) + return(-1); + + /* skip leading white-space, commas */ + for (p = *optionp; *p && (*p == ',' || *p == ' ' || *p == '\t'); ++p); + + if (!*p) { + *optionp = p; + return(-1); + } + + /* save the start of the token, and skip the rest of the token. */ + for (suboptarg = p; + *++p && *p != ',' && *p != '=' && *p != ' ' && *p != '\t';); + + if (*p) { + /* + * If there's an equals sign, set the value pointer, and + * skip over the value part of the token. Terminate the + * token. + */ + if (*p == '=') { + *p = '\0'; + for (*valuep = ++p; + *p && *p != ',' && *p != ' ' && *p != '\t'; ++p); + if (*p) + *p++ = '\0'; + } else + *p++ = '\0'; + /* Skip any whitespace or commas after this token. */ + for (; *p && (*p == ',' || *p == ' ' || *p == '\t'); ++p); + } + + /* set optionp for next round. */ + *optionp = p; + + for (cnt = 0; *tokens; ++tokens, ++cnt) + if (!strcmp(suboptarg, *tokens)) + return(cnt); + return(-1); +} diff --git a/stdlib/FreeBSD/hcreate.3 b/stdlib/FreeBSD/hcreate.3 new file mode 100644 index 0000000..10cbbaf --- /dev/null +++ b/stdlib/FreeBSD/hcreate.3 @@ -0,0 +1,258 @@ +.\"- +.\" Copyright (c) 1999 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Klaus Klein. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/stdlib/hcreate.3,v 1.7 2008/07/06 17:03:37 danger Exp $ +.\" +.Dd July 6, 2008 +.Os +.Dt HCREATE 3 +.Sh NAME +.Nm hcreate , hdestroy , hsearch +.Nd manage hash search table +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In search.h +.Ft int +.Fn hcreate "size_t nel" +.Ft void +.Fn hdestroy void +.Ft ENTRY * +.Fn hsearch "ENTRY item" "ACTION action" +.Sh DESCRIPTION +The +.Fn hcreate , +.Fn hdestroy , +and +.Fn hsearch +functions manage hash search tables. +.Pp +The +.Fn hcreate +function allocates sufficient space for the table, and the application should +ensure it is called before +.Fn hsearch +is used. +The +.Fa nel +argument is an estimate of the maximum +number of entries that the table should contain. +This number may be adjusted upward by the +algorithm in order to obtain certain mathematically favorable circumstances. +.Pp +The +.Fn hdestroy +function disposes of the search table, and may be followed by another call to +.Fn hcreate . +After the call to +.Fn hdestroy , +the data can no longer be considered accessible. +The +.Fn hdestroy +function calls +.Xr free 3 +for each comparison key in the search table +but not the data item associated with the key. +.Pp +The +.Fn hsearch +function is a hash-table search routine. +It returns a pointer into a hash table +indicating the location at which an entry can be found. +The +.Fa item +argument is a structure of type +.Vt ENTRY +(defined in the +.In search.h +header) containing two pointers: +.Fa item.key +points to the comparison key (a +.Vt "char *" ) , +and +.Fa item.data +(a +.Vt "void *" ) +points to any other data to be associated with +that key. +The comparison function used by +.Fn hsearch +is +.Xr strcmp 3 . +The +.Fa action +argument is a +member of an enumeration type +.Vt ACTION +indicating the disposition of the entry if it cannot be +found in the table. +.Dv ENTER +indicates that the +.Fa item +should be inserted in the table at an +appropriate point. +.Dv FIND +indicates that no entry should be made. +Unsuccessful resolution is +indicated by the return of a +.Dv NULL +pointer. +.Pp +The comparison key (passed to +.Fn hsearch +as +.Fa item.key ) +must be allocated using +.Xr malloc 3 +if +.Fa action +is +.Dv ENTER +and +.Fn hdestroy +is called. +.Sh RETURN VALUES +The +.Fn hcreate +function returns 0 if the table creation failed and the global variable +.Va errno +is set to indicate the error; +otherwise, a non-zero value is returned. +.Pp +The +.Fn hdestroy +function does not return a value. +.Pp +The +.Fn hsearch +function returns a +.Dv NULL +pointer if either the +.Fa action +is +.Dv FIND +and the +.Fa item +could not be found or the +.Fa action +is +.Dv ENTER +and the table is full. +.Sh EXAMPLES +The following example reads in strings followed by two numbers +and stores them in a hash table, discarding duplicates. +It then reads in strings and finds the matching entry in the hash +table and prints it out. +.Bd -literal +#include +#include +#include +#include + +struct info { /* This is the info stored in the table */ + int age, room; /* other than the key. */ +}; + +#define NUM_EMPL 5000 /* # of elements in search table. */ + +int +main(void) +{ + char str[BUFSIZ]; /* Space to read string */ + struct info info_space[NUM_EMPL]; /* Space to store employee info. */ + struct info *info_ptr = info_space; /* Next space in info_space. */ + ENTRY item; + ENTRY *found_item; /* Name to look for in table. */ + char name_to_find[30]; + int i = 0; + + /* Create table; no error checking is performed. */ + (void) hcreate(NUM_EMPL); + + while (scanf("%s%d%d", str, &info_ptr->age, + &info_ptr->room) != EOF && i++ < NUM_EMPL) { + /* Put information in structure, and structure in item. */ + item.key = strdup(str); + item.data = info_ptr; + info_ptr++; + /* Put item into table. */ + (void) hsearch(item, ENTER); + } + + /* Access table. */ + item.key = name_to_find; + while (scanf("%s", item.key) != EOF) { + if ((found_item = hsearch(item, FIND)) != NULL) { + /* If item is in the table. */ + (void)printf("found %s, age = %d, room = %d\en", + found_item->key, + ((struct info *)found_item->data)->age, + ((struct info *)found_item->data)->room); + } else + (void)printf("no such employee %s\en", name_to_find); + } + hdestroy(); + return 0; +} +.Ed +.Sh ERRORS +The +.Fn hcreate +and +.Fn hsearch +functions may fail if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient storage space is available. +.It Bq Er EINVAL +A table already exists. +.El +.Sh SEE ALSO +.Xr bsearch 3 , +.Xr lsearch 3 , +.Xr malloc 3 , +.Xr strcmp 3 , +.Xr tsearch 3 +.Sh STANDARDS +The +.Fn hcreate , +.Fn hdestroy , +and +.Fn hsearch +functions conform to +.St -xpg4.2 . +.Sh HISTORY +The +.Fn hcreate , +.Fn hdestroy , +and +.Fn hsearch +functions first appeared in +.At V . +.Sh BUGS +The interface permits the use of only one hash table at a time. diff --git a/stdlib/FreeBSD/hcreate.c b/stdlib/FreeBSD/hcreate.c new file mode 100644 index 0000000..9264599 --- /dev/null +++ b/stdlib/FreeBSD/hcreate.c @@ -0,0 +1,185 @@ +/* $NetBSD: hcreate.c,v 1.2 2001/02/19 21:26:04 ross Exp $ */ + +/* + * Copyright (c) 2001 Christopher G. Demetriou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the + * NetBSD Project. See http://www.netbsd.org/ for + * information about NetBSD. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * <> + */ + +/* + * hcreate() / hsearch() / hdestroy() + * + * SysV/XPG4 hash table functions. + * + * Implementation done based on NetBSD manual page and Solaris manual page, + * plus my own personal experience about how they're supposed to work. + * + * I tried to look at Knuth (as cited by the Solaris manual page), but + * nobody had a copy in the office, so... + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: hcreate.c,v 1.2 2001/02/19 21:26:04 ross Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/stdlib/hcreate.c,v 1.4 2008/07/06 11:31:20 danger Exp $"); + +#include +#include +#include +#include +#include +#include + +/* + * DO NOT MAKE THIS STRUCTURE LARGER THAN 32 BYTES (4 ptrs on 64-bit + * ptr machine) without adjusting MAX_BUCKETS_LG2 below. + */ +struct internal_entry { + SLIST_ENTRY(internal_entry) link; + ENTRY ent; +}; +SLIST_HEAD(internal_head, internal_entry); + +#define MIN_BUCKETS_LG2 4 +#define MIN_BUCKETS (1 << MIN_BUCKETS_LG2) + +/* + * max * sizeof internal_entry must fit into size_t. + * assumes internal_entry is <= 32 (2^5) bytes. + */ +#define MAX_BUCKETS_LG2 (sizeof (size_t) * 8 - 1 - 5) +#define MAX_BUCKETS ((size_t)1 << MAX_BUCKETS_LG2) + +/* Default hash function, from db/hash/hash_func.c */ +extern u_int32_t (*__default_hash)(const void *, size_t); + +static struct internal_head *htable; +static size_t htablesize; + +int +hcreate(size_t nel) +{ + size_t idx; + unsigned int p2; + + /* Make sure this is not called when a table already exists. */ + if (htable != NULL) { + errno = EINVAL; + return 0; + } + + /* If nel is too small, make it min sized. */ + if (nel < MIN_BUCKETS) + nel = MIN_BUCKETS; + + /* If it is too large, cap it. */ + if (nel > MAX_BUCKETS) + nel = MAX_BUCKETS; + + /* If it is not a power of two in size, round up. */ + if ((nel & (nel - 1)) != 0) { + for (p2 = 0; nel != 0; p2++) + nel >>= 1; + nel = 1 << p2; + } + + /* Allocate the table. */ + htablesize = nel; + htable = malloc(htablesize * sizeof htable[0]); + if (htable == NULL) { + errno = ENOMEM; + return 0; + } + + /* Initialize it. */ + for (idx = 0; idx < htablesize; idx++) + SLIST_INIT(&htable[idx]); + + return 1; +} + +void +hdestroy(void) +{ + struct internal_entry *ie; + size_t idx; + + if (htable == NULL) + return; + + for (idx = 0; idx < htablesize; idx++) { + while (!SLIST_EMPTY(&htable[idx])) { + ie = SLIST_FIRST(&htable[idx]); + SLIST_REMOVE_HEAD(&htable[idx], link); + free(ie->ent.key); + free(ie); + } + } + free(htable); + htable = NULL; +} + +ENTRY * +hsearch(ENTRY item, ACTION action) +{ + struct internal_head *head; + struct internal_entry *ie; + uint32_t hashval; + size_t len; + + len = strlen(item.key); + hashval = (*__default_hash)(item.key, len); + + head = &htable[hashval & (htablesize - 1)]; + ie = SLIST_FIRST(head); + while (ie != NULL) { + if (strcmp(ie->ent.key, item.key) == 0) + break; + ie = SLIST_NEXT(ie, link); + } + + if (ie != NULL) + return &ie->ent; + else if (action == FIND) + return NULL; + + ie = malloc(sizeof *ie); + if (ie == NULL) + return NULL; + ie->ent.key = item.key; + ie->ent.data = item.data; + + SLIST_INSERT_HEAD(head, ie, link); + return &ie->ent; +} diff --git a/stdlib/FreeBSD/heapsort.c b/stdlib/FreeBSD/heapsort.c new file mode 100644 index 0000000..c41865b --- /dev/null +++ b/stdlib/FreeBSD/heapsort.c @@ -0,0 +1,185 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ronnie Kon at Mindcraft Inc., Kevin Lew and Elmer Yglesias. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)heapsort.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/heapsort.c,v 1.6 2008/01/13 02:11:10 das Exp $"); + +#include +#include +#include + +/* + * Swap two areas of size number of bytes. Although qsort(3) permits random + * blocks of memory to be sorted, sorting pointers is almost certainly the + * common case (and, were it not, could easily be made so). Regardless, it + * isn't worth optimizing; the SWAP's get sped up by the cache, and pointer + * arithmetic gets lost in the time required for comparison function calls. + */ +#define SWAP(a, b, count, size, tmp) { \ + count = size; \ + do { \ + tmp = *a; \ + *a++ = *b; \ + *b++ = tmp; \ + } while (--count); \ +} + +/* Copy one block of size size to another. */ +#define COPY(a, b, count, size, tmp1, tmp2) { \ + count = size; \ + tmp1 = a; \ + tmp2 = b; \ + do { \ + *tmp1++ = *tmp2++; \ + } while (--count); \ +} + +/* + * Build the list into a heap, where a heap is defined such that for + * the records K1 ... KN, Kj/2 >= Kj for 1 <= j/2 <= j <= N. + * + * There two cases. If j == nmemb, select largest of Ki and Kj. If + * j < nmemb, select largest of Ki, Kj and Kj+1. + */ +#define CREATE(initval, nmemb, par_i, child_i, par, child, size, count, tmp) { \ + for (par_i = initval; (child_i = par_i * 2) <= nmemb; \ + par_i = child_i) { \ + child = base + child_i * size; \ + if (child_i < nmemb && compar(child, child + size) < 0) { \ + child += size; \ + ++child_i; \ + } \ + par = base + par_i * size; \ + if (compar(child, par) <= 0) \ + break; \ + SWAP(par, child, count, size, tmp); \ + } \ +} + +/* + * Select the top of the heap and 'heapify'. Since by far the most expensive + * action is the call to the compar function, a considerable optimization + * in the average case can be achieved due to the fact that k, the displaced + * elememt, is ususally quite small, so it would be preferable to first + * heapify, always maintaining the invariant that the larger child is copied + * over its parent's record. + * + * Then, starting from the *bottom* of the heap, finding k's correct place, + * again maintianing the invariant. As a result of the invariant no element + * is 'lost' when k is assigned its correct place in the heap. + * + * The time savings from this optimization are on the order of 15-20% for the + * average case. See Knuth, Vol. 3, page 158, problem 18. + * + * XXX Don't break the #define SELECT line, below. Reiser cpp gets upset. + */ +#define SELECT(par_i, child_i, nmemb, par, child, size, k, count, tmp1, tmp2) { \ + for (par_i = 1; (child_i = par_i * 2) <= nmemb; par_i = child_i) { \ + child = base + child_i * size; \ + if (child_i < nmemb && compar(child, child + size) < 0) { \ + child += size; \ + ++child_i; \ + } \ + par = base + par_i * size; \ + COPY(par, child, count, size, tmp1, tmp2); \ + } \ + for (;;) { \ + child_i = par_i; \ + par_i = child_i / 2; \ + child = base + child_i * size; \ + par = base + par_i * size; \ + if (child_i == 1 || compar(k, par) < 0) { \ + COPY(child, k, count, size, tmp1, tmp2); \ + break; \ + } \ + COPY(child, par, count, size, tmp1, tmp2); \ + } \ +} + +/* + * Heapsort -- Knuth, Vol. 3, page 145. Runs in O (N lg N), both average + * and worst. While heapsort is faster than the worst case of quicksort, + * the BSD quicksort does median selection so that the chance of finding + * a data set that will trigger the worst case is nonexistent. Heapsort's + * only advantage over quicksort is that it requires little additional memory. + */ +int +heapsort(vbase, nmemb, size, compar) + void *vbase; + size_t nmemb, size; + int (*compar)(const void *, const void *); +{ + size_t cnt, i, j, l; + char tmp, *tmp1, *tmp2; + char *base, *k, *p, *t; + + if (nmemb <= 1) + return (0); + + if (!size) { + errno = EINVAL; + return (-1); + } + + if ((k = malloc(size)) == NULL) + return (-1); + + /* + * Items are numbered from 1 to nmemb, so offset from size bytes + * below the starting address. + */ + base = (char *)vbase - size; + + for (l = nmemb / 2 + 1; --l;) + CREATE(l, nmemb, i, j, t, p, size, cnt, tmp); + + /* + * For each element of the heap, save the largest element into its + * final slot, save the displaced element (k), then recreate the + * heap. + */ + while (nmemb > 1) { + COPY(k, base + nmemb * size, cnt, size, tmp1, tmp2); + COPY(base + nmemb * size, base + size, cnt, size, tmp1, tmp2); + --nmemb; + SELECT(i, j, nmemb, t, p, size, k, cnt, tmp1, tmp2); + } + free(k); + return (0); +} +#pragma clang diagnostic pop diff --git a/stdlib/FreeBSD/heapsort_b.c b/stdlib/FreeBSD/heapsort_b.c new file mode 100644 index 0000000..b424604 --- /dev/null +++ b/stdlib/FreeBSD/heapsort_b.c @@ -0,0 +1,181 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ronnie Kon at Mindcraft Inc., Kevin Lew and Elmer Yglesias. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)heapsort.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/heapsort.c,v 1.6 2008/01/13 02:11:10 das Exp $"); + +#include +#include +#include + +/* + * Swap two areas of size number of bytes. Although qsort(3) permits random + * blocks of memory to be sorted, sorting pointers is almost certainly the + * common case (and, were it not, could easily be made so). Regardless, it + * isn't worth optimizing; the SWAP's get sped up by the cache, and pointer + * arithmetic gets lost in the time required for comparison function calls. + */ +#define SWAP(a, b, count, size, tmp) { \ + count = size; \ + do { \ + tmp = *a; \ + *a++ = *b; \ + *b++ = tmp; \ + } while (--count); \ +} + +/* Copy one block of size size to another. */ +#define COPY(a, b, count, size, tmp1, tmp2) { \ + count = size; \ + tmp1 = a; \ + tmp2 = b; \ + do { \ + *tmp1++ = *tmp2++; \ + } while (--count); \ +} + +/* + * Build the list into a heap, where a heap is defined such that for + * the records K1 ... KN, Kj/2 >= Kj for 1 <= j/2 <= j <= N. + * + * There two cases. If j == nmemb, select largest of Ki and Kj. If + * j < nmemb, select largest of Ki, Kj and Kj+1. + */ +#define CREATE(initval, nmemb, par_i, child_i, par, child, size, count, tmp) { \ + for (par_i = initval; (child_i = par_i * 2) <= nmemb; \ + par_i = child_i) { \ + child = base + child_i * size; \ + if (child_i < nmemb && compar(child, child + size) < 0) { \ + child += size; \ + ++child_i; \ + } \ + par = base + par_i * size; \ + if (compar(child, par) <= 0) \ + break; \ + SWAP(par, child, count, size, tmp); \ + } \ +} + +/* + * Select the top of the heap and 'heapify'. Since by far the most expensive + * action is the call to the compar function, a considerable optimization + * in the average case can be achieved due to the fact that k, the displaced + * elememt, is ususally quite small, so it would be preferable to first + * heapify, always maintaining the invariant that the larger child is copied + * over its parent's record. + * + * Then, starting from the *bottom* of the heap, finding k's correct place, + * again maintianing the invariant. As a result of the invariant no element + * is 'lost' when k is assigned its correct place in the heap. + * + * The time savings from this optimization are on the order of 15-20% for the + * average case. See Knuth, Vol. 3, page 158, problem 18. + * + * XXX Don't break the #define SELECT line, below. Reiser cpp gets upset. + */ +#define SELECT(par_i, child_i, nmemb, par, child, size, k, count, tmp1, tmp2) { \ + for (par_i = 1; (child_i = par_i * 2) <= nmemb; par_i = child_i) { \ + child = base + child_i * size; \ + if (child_i < nmemb && compar(child, child + size) < 0) { \ + child += size; \ + ++child_i; \ + } \ + par = base + par_i * size; \ + COPY(par, child, count, size, tmp1, tmp2); \ + } \ + for (;;) { \ + child_i = par_i; \ + par_i = child_i / 2; \ + child = base + child_i * size; \ + par = base + par_i * size; \ + if (child_i == 1 || compar(k, par) < 0) { \ + COPY(child, k, count, size, tmp1, tmp2); \ + break; \ + } \ + COPY(child, par, count, size, tmp1, tmp2); \ + } \ +} + +/* + * Heapsort -- Knuth, Vol. 3, page 145. Runs in O (N lg N), both average + * and worst. While heapsort is faster than the worst case of quicksort, + * the BSD quicksort does median selection so that the chance of finding + * a data set that will trigger the worst case is nonexistent. Heapsort's + * only advantage over quicksort is that it requires little additional memory. + */ +int +heapsort_b(vbase, nmemb, size, compar) + void *vbase; + size_t nmemb, size; + int (^compar)(const void *, const void *); +{ + size_t cnt, i, j, l; + char tmp, *tmp1, *tmp2; + char *base, *k, *p, *t; + + if (nmemb <= 1) + return (0); + + if (!size) { + errno = EINVAL; + return (-1); + } + + if ((k = malloc(size)) == NULL) + return (-1); + + /* + * Items are numbered from 1 to nmemb, so offset from size bytes + * below the starting address. + */ + base = (char *)vbase - size; + + for (l = nmemb / 2 + 1; --l;) + CREATE(l, nmemb, i, j, t, p, size, cnt, tmp); + + /* + * For each element of the heap, save the largest element into its + * final slot, save the displaced element (k), then recreate the + * heap. + */ + while (nmemb > 1) { + COPY(k, base + nmemb * size, cnt, size, tmp1, tmp2); + COPY(base + nmemb * size, base + size, cnt, size, tmp1, tmp2); + --nmemb; + SELECT(i, j, nmemb, t, p, size, k, cnt, tmp1, tmp2); + } + free(k); + return (0); +} diff --git a/stdlib/FreeBSD/heapsort_r.c b/stdlib/FreeBSD/heapsort_r.c new file mode 100644 index 0000000..42388ab --- /dev/null +++ b/stdlib/FreeBSD/heapsort_r.c @@ -0,0 +1,186 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ronnie Kon at Mindcraft Inc., Kevin Lew and Elmer Yglesias. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)heapsort.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/heapsort.c,v 1.6 2008/01/13 02:11:10 das Exp $"); + +#include +#include +#include + +/* + * Swap two areas of size number of bytes. Although qsort(3) permits random + * blocks of memory to be sorted, sorting pointers is almost certainly the + * common case (and, were it not, could easily be made so). Regardless, it + * isn't worth optimizing; the SWAP's get sped up by the cache, and pointer + * arithmetic gets lost in the time required for comparison function calls. + */ +#define SWAP(a, b, count, size, tmp) { \ + count = size; \ + do { \ + tmp = *a; \ + *a++ = *b; \ + *b++ = tmp; \ + } while (--count); \ +} + +/* Copy one block of size size to another. */ +#define COPY(a, b, count, size, tmp1, tmp2) { \ + count = size; \ + tmp1 = a; \ + tmp2 = b; \ + do { \ + *tmp1++ = *tmp2++; \ + } while (--count); \ +} + +/* + * Build the list into a heap, where a heap is defined such that for + * the records K1 ... KN, Kj/2 >= Kj for 1 <= j/2 <= j <= N. + * + * There two cases. If j == nmemb, select largest of Ki and Kj. If + * j < nmemb, select largest of Ki, Kj and Kj+1. + */ +#define CREATE(initval, nmemb, par_i, child_i, par, child, size, count, tmp) { \ + for (par_i = initval; (child_i = par_i * 2) <= nmemb; \ + par_i = child_i) { \ + child = base + child_i * size; \ + if (child_i < nmemb && compar(thunk, child, child + size) < 0) { \ + child += size; \ + ++child_i; \ + } \ + par = base + par_i * size; \ + if (compar(thunk, child, par) <= 0) \ + break; \ + SWAP(par, child, count, size, tmp); \ + } \ +} + +/* + * Select the top of the heap and 'heapify'. Since by far the most expensive + * action is the call to the compar function, a considerable optimization + * in the average case can be achieved due to the fact that k, the displaced + * elememt, is ususally quite small, so it would be preferable to first + * heapify, always maintaining the invariant that the larger child is copied + * over its parent's record. + * + * Then, starting from the *bottom* of the heap, finding k's correct place, + * again maintianing the invariant. As a result of the invariant no element + * is 'lost' when k is assigned its correct place in the heap. + * + * The time savings from this optimization are on the order of 15-20% for the + * average case. See Knuth, Vol. 3, page 158, problem 18. + * + * XXX Don't break the #define SELECT line, below. Reiser cpp gets upset. + */ +#define SELECT(par_i, child_i, nmemb, par, child, size, k, count, tmp1, tmp2) { \ + for (par_i = 1; (child_i = par_i * 2) <= nmemb; par_i = child_i) { \ + child = base + child_i * size; \ + if (child_i < nmemb && compar(thunk, child, child + size) < 0) { \ + child += size; \ + ++child_i; \ + } \ + par = base + par_i * size; \ + COPY(par, child, count, size, tmp1, tmp2); \ + } \ + for (;;) { \ + child_i = par_i; \ + par_i = child_i / 2; \ + child = base + child_i * size; \ + par = base + par_i * size; \ + if (child_i == 1 || compar(thunk, k, par) < 0) { \ + COPY(child, k, count, size, tmp1, tmp2); \ + break; \ + } \ + COPY(child, par, count, size, tmp1, tmp2); \ + } \ +} + +/* + * Heapsort -- Knuth, Vol. 3, page 145. Runs in O (N lg N), both average + * and worst. While heapsort is faster than the worst case of quicksort, + * the BSD quicksort does median selection so that the chance of finding + * a data set that will trigger the worst case is nonexistent. Heapsort's + * only advantage over quicksort is that it requires little additional memory. + */ +__private_extern__ int +__heapsort_r(vbase, nmemb, size, thunk, compar) + void *vbase; + size_t nmemb, size; + void *thunk; + int (*compar)(void *, const void *, const void *); +{ + size_t cnt, i, j, l; + char tmp, *tmp1, *tmp2; + char *base, *k, *p, *t; + + if (nmemb <= 1) + return (0); + + if (!size) { + errno = EINVAL; + return (-1); + } + + if ((k = malloc(size)) == NULL) + return (-1); + + /* + * Items are numbered from 1 to nmemb, so offset from size bytes + * below the starting address. + */ + base = (char *)vbase - size; + + for (l = nmemb / 2 + 1; --l;) + CREATE(l, nmemb, i, j, t, p, size, cnt, tmp); + + /* + * For each element of the heap, save the largest element into its + * final slot, save the displaced element (k), then recreate the + * heap. + */ + while (nmemb > 1) { + COPY(k, base + nmemb * size, cnt, size, tmp1, tmp2); + COPY(base + nmemb * size, base + size, cnt, size, tmp1, tmp2); + --nmemb; + SELECT(i, j, nmemb, t, p, size, k, cnt, tmp1, tmp2); + } + free(k); + return (0); +} +#pragma clang diagnostic pop diff --git a/stdlib/FreeBSD/imaxabs.3 b/stdlib/FreeBSD/imaxabs.3 new file mode 100644 index 0000000..ac520b2 --- /dev/null +++ b/stdlib/FreeBSD/imaxabs.3 @@ -0,0 +1,62 @@ +.\" Copyright (c) 2001 Mike Barcroft +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/stdlib/imaxabs.3,v 1.2 2001/11/21 16:19:50 ru Exp $ +.\" +.Dd November 14, 2001 +.Dt IMAXABS 3 +.Os +.Sh NAME +.Nm imaxabs +.Nd returns absolute value +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In inttypes.h +.Ft intmax_t +.Fn imaxabs "intmax_t j" +.Sh DESCRIPTION +The +.Fn imaxabs +function returns the absolute value of +.Fa j . +.Sh SEE ALSO +.Xr abs 3 , +.Xr fabs 3 , +.Xr hypot 3 , +.Xr labs 3 , +.Xr llabs 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn imaxabs +function conforms to +.St -isoC-99 . +.Sh HISTORY +The +.Fn imaxabs +function first appeared in +.Fx 5.0 . +.Sh BUGS +The absolute value of the most negative integer remains negative. diff --git a/stdlib/FreeBSD/imaxabs.c b/stdlib/FreeBSD/imaxabs.c new file mode 100644 index 0000000..531de24 --- /dev/null +++ b/stdlib/FreeBSD/imaxabs.c @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2001 Mike Barcroft + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/imaxabs.c,v 1.1 2001/11/15 02:05:03 mike Exp $"); + +#include + +intmax_t +imaxabs(intmax_t j) +{ + return (j < 0 ? -j : j); +} diff --git a/stdlib/FreeBSD/imaxdiv.3 b/stdlib/FreeBSD/imaxdiv.3 new file mode 100644 index 0000000..a9f5e12 --- /dev/null +++ b/stdlib/FreeBSD/imaxdiv.3 @@ -0,0 +1,73 @@ +.\" Copyright (c) 2001 Mike Barcroft +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/stdlib/imaxdiv.3,v 1.2 2001/11/21 16:19:50 ru Exp $ +.\" +.Dd November 14, 2001 +.Dt IMAXDIV 3 +.Os +.Sh NAME +.Nm imaxdiv +.Nd returns quotient and remainder +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In inttypes.h +.Ft imaxdiv_t +.Fn imaxdiv "intmax_t numer" "intmax_t denom" +.Sh DESCRIPTION +The +.Fn imaxdiv +function computes the value of +.Fa numer , +divided by +.Fa denom . +The stored result is returned in the form of the +.Vt imaxdiv_t +type. +.Pp +The +.Vt imaxdiv_t +type is defined as: +.Bd -literal -offset indent +typedef struct { + intmax_t quot; /* Quotient. */ + intmax_t rem; /* Remainder. */ +} imaxdiv_t; +.Ed +.Sh SEE ALSO +.Xr div 3 , +.Xr ldiv 3 , +.Xr lldiv 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn imaxdiv +function conforms to +.St -isoC-99 . +.Sh HISTORY +The +.Fn imaxdiv +function first appeared in +.Fx 5.0 . diff --git a/stdlib/FreeBSD/imaxdiv.c b/stdlib/FreeBSD/imaxdiv.c new file mode 100644 index 0000000..ff3087b --- /dev/null +++ b/stdlib/FreeBSD/imaxdiv.c @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2001 Mike Barcroft + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/imaxdiv.c,v 1.1 2001/11/15 02:05:03 mike Exp $"); + +#include + +/* See comments in div.c for implementation details. */ +imaxdiv_t +imaxdiv(intmax_t numer, intmax_t denom) +{ + imaxdiv_t retval; + + retval.quot = numer / denom; + retval.rem = numer % denom; + if (numer >= 0 && retval.rem < 0) { + retval.quot++; + retval.rem -= denom; + } + return (retval); +} diff --git a/stdlib/FreeBSD/insque.3 b/stdlib/FreeBSD/insque.3 new file mode 100644 index 0000000..b1d47d6 --- /dev/null +++ b/stdlib/FreeBSD/insque.3 @@ -0,0 +1,61 @@ +.\" +.\" Initial implementation: +.\" Copyright (c) 2002 Robert Drehmel +.\" All rights reserved. +.\" +.\" As long as the above copyright statement and this notice remain +.\" unchanged, you can do what ever you want with this file. +.\" +.\" $FreeBSD: src/lib/libc/stdlib/insque.3,v 1.3 2003/02/25 21:59:36 robert Exp $ +.\" +.Dd October 10, 2002 +.Dt INSQUE 3 +.Os +.Sh NAME +.Nm insque , +.Nm remque +.Nd doubly-linked list management +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In search.h +.Ft void +.Fn insque "void *element" "void *pred" +.Ft void +.Fn remque "void *element" +.Sh DESCRIPTION +The +.Fn insque +and +.Fn remque +functions encapsulate the ever-repeating task of doing insertion and +removal operations on doubly linked lists. +The functions expect their +arguments to point to a structure whose first and second members are +pointers to the next and previous element, respectively. +The +.Fn insque +function also allows the +.Fa pred +argument to be a +.Dv NULL +pointer for the initialization of a new list's +head element. +.Sh STANDARDS +The +.Fn insque +and +.Fn remque +functions conform to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn insque +and +.Fn remque +functions appeared in +.Bx 4.2 . +In +.Fx 5.0 , +they reappeared conforming to +.St -p1003.1-2001 . diff --git a/stdlib/FreeBSD/insque.c b/stdlib/FreeBSD/insque.c new file mode 100644 index 0000000..92984b0 --- /dev/null +++ b/stdlib/FreeBSD/insque.c @@ -0,0 +1,47 @@ +/* + * Initial implementation: + * Copyright (c) 2002 Robert Drehmel + * All rights reserved. + * + * As long as the above copyright statement and this notice remain + * unchanged, you can do what ever you want with this file. + */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/insque.c,v 1.3 2003/01/04 07:34:41 tjr Exp $"); + +#define _SEARCH_PRIVATE +#include +#ifdef DEBUG +#include +#else +#include /* for NULL */ +#endif + +void +insque(void *element, void *pred) +{ + struct que_elem *prev, *next, *elem; + + elem = (struct que_elem *)element; + prev = (struct que_elem *)pred; + + if (prev == NULL) { + elem->prev = elem->next = NULL; + return; + } + + next = prev->next; + if (next != NULL) { +#ifdef DEBUG + if (next->prev != prev) { + fprintf(stderr, "insque: Inconsistency detected:" + " next(%p)->prev(%p) != prev(%p)\n", + next, next->prev, prev); + } +#endif + next->prev = elem; + } + prev->next = elem; + elem->prev = prev; + elem->next = next; +} diff --git a/stdlib/FreeBSD/labs.3 b/stdlib/FreeBSD/labs.3 new file mode 100644 index 0000000..b000955 --- /dev/null +++ b/stdlib/FreeBSD/labs.3 @@ -0,0 +1,67 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)labs.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/labs.3,v 1.10 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd November 14, 2001 +.Dt LABS 3 +.Os +.Sh NAME +.Nm labs +.Nd return the absolute value of a long integer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft long +.Fn labs "long i" +.Sh DESCRIPTION +The +.Fn labs +function +returns the absolute value of the long integer +.Fa i . +.Sh SEE ALSO +.Xr abs 3 , +.Xr cabs 3 , +.Xr floor 3 , +.Xr imaxabs 3 , +.Xr llabs 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn labs +function +conforms to +.St -isoC . +.Sh BUGS +The absolute value of the most negative integer remains negative. diff --git a/stdlib/FreeBSD/labs.c b/stdlib/FreeBSD/labs.c new file mode 100644 index 0000000..f2ead54 --- /dev/null +++ b/stdlib/FreeBSD/labs.c @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)labs.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/labs.c,v 1.3 2007/01/09 00:28:10 imp Exp $"); + +#include + +long +labs(j) + long j; +{ + return(j < 0 ? -j : j); +} diff --git a/stdlib/FreeBSD/ldiv.3 b/stdlib/FreeBSD/ldiv.3 new file mode 100644 index 0000000..904f0d5 --- /dev/null +++ b/stdlib/FreeBSD/ldiv.3 @@ -0,0 +1,72 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ldiv.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/ldiv.3,v 1.10 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd November 14, 2001 +.Dt LDIV 3 +.Os +.Sh NAME +.Nm ldiv +.Nd return quotient and remainder from division +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft ldiv_t +.Fn ldiv "long numer" "long denom" +.Sh DESCRIPTION +The +.Fn ldiv +function +computes the value +.Fa numer Ns / Ns Fa denom +(numerator/denominator). +Ir returns the quotient and remainder in a structure named +.Vt ldiv_t +that contains two +.Vt long +members named +.Va quot +and +.Va rem . +.Sh SEE ALSO +.Xr div 3 , +.Xr imaxdiv 3 , +.Xr lldiv 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn ldiv +function +conforms to +.St -isoC-99 . diff --git a/stdlib/FreeBSD/ldiv.c b/stdlib/FreeBSD/ldiv.c new file mode 100644 index 0000000..a0707e3 --- /dev/null +++ b/stdlib/FreeBSD/ldiv.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ldiv.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/ldiv.c,v 1.3 2007/01/09 00:28:10 imp Exp $"); + +#include /* ldiv_t */ + +ldiv_t +ldiv(num, denom) + long num, denom; +{ + ldiv_t r; + + /* see div.c for comments */ + + r.quot = num / denom; + r.rem = num % denom; + if (num >= 0 && r.rem < 0) { + r.quot++; + r.rem -= denom; + } + return (r); +} diff --git a/stdlib/FreeBSD/llabs.3 b/stdlib/FreeBSD/llabs.3 new file mode 100644 index 0000000..96b104f --- /dev/null +++ b/stdlib/FreeBSD/llabs.3 @@ -0,0 +1,62 @@ +.\" Copyright (c) 2001 Mike Barcroft +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/stdlib/llabs.3,v 1.2 2001/11/21 16:19:50 ru Exp $ +.\" +.Dd November 14, 2001 +.Dt LLABS 3 +.Os +.Sh NAME +.Nm llabs +.Nd returns absolute value +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft "long long" +.Fn llabs "long long i" +.Sh DESCRIPTION +The +.Fn llabs +function returns the absolute value of +.Fa i . +.Sh SEE ALSO +.Xr abs 3 , +.Xr fabs 3 , +.Xr hypot 3 , +.Xr imaxabs 3 , +.Xr labs 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn llabs +function conforms to +.St -isoC-99 . +.Sh HISTORY +The +.Fn llabs +function first appeared in +.Fx 5.0 . +.Sh BUGS +The absolute value of the most negative integer remains negative. diff --git a/stdlib/FreeBSD/llabs.c b/stdlib/FreeBSD/llabs.c new file mode 100644 index 0000000..4721fce --- /dev/null +++ b/stdlib/FreeBSD/llabs.c @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2001 Mike Barcroft + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/llabs.c,v 1.1 2001/11/15 02:05:03 mike Exp $"); + +#include + +long long +llabs(long long j) +{ + return (j < 0 ? -j : j); +} diff --git a/stdlib/FreeBSD/lldiv.3 b/stdlib/FreeBSD/lldiv.3 new file mode 100644 index 0000000..98f4813 --- /dev/null +++ b/stdlib/FreeBSD/lldiv.3 @@ -0,0 +1,73 @@ +.\" Copyright (c) 2001 Mike Barcroft +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/stdlib/lldiv.3,v 1.2 2001/11/21 16:19:50 ru Exp $ +.\" +.Dd November 14, 2001 +.Dt LLDIV 3 +.Os +.Sh NAME +.Nm lldiv +.Nd returns quotient and remainder +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft lldiv_t +.Fn lldiv "long long numer" "long long denom" +.Sh DESCRIPTION +The +.Fn lldiv +function computes the value of +.Fa numer , +divided by +.Fa denom . +It returns the stored result in the form of the +.Vt lldiv_t +type. +.Pp +The +.Vt lldiv_t +type is defined as: +.Bd -literal -offset indent +typedef struct { + long long quot; /* Quotient. */ + long long rem; /* Remainder. */ +} lldiv_t; +.Ed +.Sh SEE ALSO +.Xr div 3 , +.Xr imaxdiv 3 , +.Xr ldiv 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn lldiv +function conforms to +.St -isoC-99 . +.Sh HISTORY +The +.Fn lldiv +function first appeared in +.Fx 5.0 . diff --git a/stdlib/FreeBSD/lldiv.c b/stdlib/FreeBSD/lldiv.c new file mode 100644 index 0000000..c9a4853 --- /dev/null +++ b/stdlib/FreeBSD/lldiv.c @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2001 Mike Barcroft + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/lldiv.c,v 1.1 2001/11/15 02:05:03 mike Exp $"); + +#include + +/* See comments in div.c for implementation details. */ +lldiv_t +lldiv(long long numer, long long denom) +{ + lldiv_t retval; + + retval.quot = numer / denom; + retval.rem = numer % denom; + if (numer >= 0 && retval.rem < 0) { + retval.quot++; + retval.rem -= denom; + } + return (retval); +} diff --git a/stdlib/FreeBSD/lsearch.3 b/stdlib/FreeBSD/lsearch.3 new file mode 100644 index 0000000..5be997c --- /dev/null +++ b/stdlib/FreeBSD/lsearch.3 @@ -0,0 +1,105 @@ +.\" +.\" Initial implementation: +.\" Copyright (c) 2002 Robert Drehmel +.\" All rights reserved. +.\" +.\" As long as the above copyright statement and this notice remain +.\" unchanged, you can do what ever you want with this file. +.\" +.\" $FreeBSD: src/lib/libc/stdlib/lsearch.3,v 1.5 2005/01/20 09:17:04 ru Exp $ +.\" +.Dd October 11, 2002 +.Dt LSEARCH 3 +.Os +.Sh NAME +.Nm lfind , +.Nm lsearch +.Nd linear search and append +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In search.h +.Ft "void *" +.Fo lfind +.Fa "const void *key" "const void *base" "size_t *nelp" "size_t width" +.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +.Ft "void *" +.Fo lsearch +.Fa "const void *key" "void *base" "size_t *nelp" "size_t width" +.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +.Sh DESCRIPTION +The +.Fn lsearch +and +.Fn lfind +functions walk linearly through an array, comparing each element with +the one to be sought, by means of a supplied comparison function. +.Pp +The +.Fa key +argument +points to an element that matches the one that is searched. +The array's address in memory is denoted by the +.Fa base +argument. +The width of one element (i.e., the size as returned by +.Fn sizeof ) +is passed as the +.Fa width +argument. +The number of valid elements contained in the array (not the number of +elements the array has space reserved for) is given in the integer pointed +to by +.Fa nelp . +The +.Fa compar +argument points to a function which compares its two arguments and returns +zero if they are matching, and non-zero otherwise. +.Pp +If no matching element was found in the array, +.Fn lsearch +copies +.Fa key +into the position after the last element and increments the +integer pointed to by +.Fa nelp . +.Sh RETURN VALUES +The +.Fn lsearch +and +.Fn lfind +functions +return a pointer to the first element found. +If no element was found, +.Fn lsearch +returns a pointer to the newly added element, whereas +.Fn lfind +returns +.Dv NULL . +Both functions return +.Dv NULL +if an error occurs. +.Sh SEE ALSO +.Xr bsearch 3 , +.Xr hsearch 3 , +.Xr tsearch 3 +.Sh STANDARDS +The +.Fn lsearch +and +.Fn lfind +functions conform to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn lsearch +and +.Fn lfind +functions appeared in +.Bx 4.2 . +In +.Fx 5.0 , +they reappeared conforming to +.St -p1003.1-2001 . diff --git a/stdlib/FreeBSD/lsearch.c b/stdlib/FreeBSD/lsearch.c new file mode 100644 index 0000000..791bc49 --- /dev/null +++ b/stdlib/FreeBSD/lsearch.c @@ -0,0 +1,64 @@ +/* + * Initial implementation: + * Copyright (c) 2002 Robert Drehmel + * All rights reserved. + * + * As long as the above copyright statement and this notice remain + * unchanged, you can do what ever you want with this file. + */ +#include +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/lsearch.c,v 1.1 2002/10/16 14:29:22 robert Exp $"); + +#define _SEARCH_PRIVATE +#include +#include /* for uint8_t */ +#include /* for NULL */ +#include /* for memcpy() prototype */ + +static void *lwork(const void *, const void *, size_t *, size_t, + int (*)(const void *, const void *), int); + +void *lsearch(const void *key, void *base, size_t *nelp, size_t width, + int (*compar)(const void *, const void *)) +{ + + return (lwork(key, base, nelp, width, compar, 1)); +} + +void *lfind(const void *key, const void *base, size_t *nelp, size_t width, + int (*compar)(const void *, const void *)) +{ + + return (lwork(key, base, nelp, width, compar, 0)); +} + +static void * +lwork(const void *key, const void *base, size_t *nelp, size_t width, + int (*compar)(const void *, const void *), int addelem) +{ + uint8_t *ep, *endp; + + /* + * Cast to an integer value first to avoid the warning for removing + * 'const' via a cast. + */ + ep = (uint8_t *)(uintptr_t)base; + for (endp = (uint8_t *)(ep + width * *nelp); ep < endp; ep += width) { + if (compar(key, ep) == 0) + return (ep); + } + + /* lfind() shall return when the key was not found. */ + if (!addelem) + return (NULL); + + /* + * lsearch() adds the key to the end of the table and increments + * the number of elements. + */ + memcpy(endp, key, width); + ++*nelp; + + return (endp); +} diff --git a/stdlib/FreeBSD/memory.3 b/stdlib/FreeBSD/memory.3 new file mode 100644 index 0000000..96cef24 --- /dev/null +++ b/stdlib/FreeBSD/memory.3 @@ -0,0 +1,136 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)memory.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/memory.3,v 1.12 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt MEMORY 3 +.Os +.Sh NAME +.Nm alloca , +.Nm calloc , +.Nm free , +.Nm malloc , +.Nm mmap , +.Nm realloc +.Nd general memory allocation operations +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft void * +.Fo alloca +.Fa "size_t size" +.Fc +.Ft void * +.Fo calloc +.Fa "size_t nelem" +.Fa "size_t elsize" +.Fc +.Ft void +.Fo free +.Fa "void *ptr" +.Fc +.Ft void * +.Fo malloc +.Fa "size_t size" +.Fc +.Ft void * +.Fo realloc +.Fa "void *ptr" +.Fa "size_t size" +.Fc +.In sys/mman.h +.Ft void * +.Fo mmap +.Fa "void * addr" +.Fa "size_t len" +.Fa "int prot" +.Fa "int flags" +.Fa "int fildes" +.Fa "off_t off" +.Fc +.Sh DESCRIPTION +These functions allocate and free memory for the calling process. +They are described in the +individual manual pages. +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +.Ft void * +.br +.Fo mmap +.Fa "void * addr" +.Fa "size_t len" +.Fa "int prot" +.Fa "int flags" +.Fa "int fildes" +.Fa "off_t off" +.Fc ; +.Pp +The include file +.In sys/types.h +is needed for this function. +.Sh COMPATIBILITY +.Fn mmap +now returns with +.Va errno +set to EINVAL in places that historically succeeded. +The rules have changed as follows: +.Bl -bullet +.It +The +.Fa flags +parameter must specify either MAP_PRIVATE or MAP_SHARED. +.It +The +.Fa size +parameter must not be 0. +.It +The +.Fa off +parameter must be a multiple of pagesize, +as returned by +.Fn sysconf . +.El +.Sh SEE ALSO +.Xr mmap 2 , +.Xr alloca 3 , +.Xr calloc 3 , +.Xr free 3 , +.Xr malloc 3 , +.Xr realloc 3 , +.Xr compat 5 +.Sh STANDARDS +These functions, with the exception of +.Fn alloca +and +.Fn mmap +conform to +.St -isoC . diff --git a/stdlib/FreeBSD/merge.c b/stdlib/FreeBSD/merge.c new file mode 100644 index 0000000..6a93bc1 --- /dev/null +++ b/stdlib/FreeBSD/merge.c @@ -0,0 +1,356 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Peter McIlroy. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcomma" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/merge.c,v 1.8 2007/01/09 00:28:10 imp Exp $"); + +/* + * Hybrid exponential search/linear search merge sort with hybrid + * natural/pairwise first pass. Requires about .3% more comparisons + * for random data than LSMS with pairwise first pass alone. + * It works for objects as small as two bytes. + */ + +#define NATURAL +#define THRESHOLD 16 /* Best choice for natural merge cut-off. */ + +/* #define NATURAL to get hybrid natural merge. + * (The default is pairwise merging.) + */ + +#include + +#include +#include +#include + +static void setup(u_char *, u_char *, size_t, size_t, + int (*)(const void *, const void *)); +static void insertionsort(u_char *, size_t, size_t, + int (*)(const void *, const void *)); + +#define ISIZE sizeof(int) +#define PSIZE sizeof(u_char *) +#define ICOPY_LIST(src, dst, last) \ + do \ + *(int*)dst = *(int*)src, src += ISIZE, dst += ISIZE; \ + while(src < last) +#define ICOPY_ELT(src, dst, i) \ + do \ + *(int*) dst = *(int*) src, src += ISIZE, dst += ISIZE; \ + while (i -= ISIZE) + +#define CCOPY_LIST(src, dst, last) \ + do \ + *dst++ = *src++; \ + while (src < last) +#define CCOPY_ELT(src, dst, i) \ + do \ + *dst++ = *src++; \ + while (i -= 1) + +/* + * Find the next possible pointer head. (Trickery for forcing an array + * to do double duty as a linked list when objects do not align with word + * boundaries. + */ +/* Assumption: PSIZE is a power of 2. */ +#define EVAL(p) (u_char **) \ + ((u_char *)0 + \ + (((u_char *)p + PSIZE - 1 - (u_char *) 0) & ~(PSIZE - 1))) + +/* + * Arguments are as for qsort. + */ +int +mergesort(base, nmemb, size, cmp) + void *base; + size_t nmemb; + size_t size; + int (*cmp)(const void *, const void *); +{ + size_t i; + int sense; + int big, iflag; + u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2; + u_char *list2, *list1, *p2, *p, *last, **p1; + + if (size < PSIZE / 2) { /* Pointers must fit into 2 * size. */ + errno = EINVAL; + return (-1); + } + + if (nmemb == 0) + return (0); + + /* + * XXX + * Stupid subtraction for the Cray. + */ + iflag = 0; + if (!(size % ISIZE) && !(((char *)base - (char *)0) % ISIZE)) + iflag = 1; + + if ((list2 = malloc(nmemb * size + PSIZE)) == NULL) + return (-1); + + list1 = base; + setup(list1, list2, nmemb, size, cmp); + last = list2 + nmemb * size; + i = big = 0; + while (*EVAL(list2) != last) { + l2 = list1; + p1 = EVAL(list1); + for (tp2 = p2 = list2; p2 != last; p1 = EVAL(l2)) { + p2 = *EVAL(p2); + f1 = l2; + f2 = l1 = list1 + (p2 - list2); + if (p2 != last) + p2 = *EVAL(p2); + l2 = list1 + (p2 - list2); + while (f1 < l1 && f2 < l2) { + if ((*cmp)(f1, f2) <= 0) { + q = f2; + b = f1, t = l1; + sense = -1; + } else { + q = f1; + b = f2, t = l2; + sense = 0; + } + if (!big) { /* here i = 0 */ + while ((b += size) < t && cmp(q, b) >sense) + if (++i == 6) { + big = 1; + goto EXPONENTIAL; + } + } else { +EXPONENTIAL: for (i = size; ; i <<= 1) + if ((p = (b + i)) >= t) { + if ((p = t - size) > b && + (*cmp)(q, p) <= sense) + t = p; + else + b = p; + break; + } else if ((*cmp)(q, p) <= sense) { + t = p; + if (i == size) + big = 0; + goto FASTCASE; + } else + b = p; + while (t > b+size) { + i = (((t - b) / size) >> 1) * size; + if ((*cmp)(q, p = b + i) <= sense) + t = p; + else + b = p; + } + goto COPY; +FASTCASE: while (i > size) + if ((*cmp)(q, + p = b + (i >>= 1)) <= sense) + t = p; + else + b = p; +COPY: b = t; + } + i = size; + if (q == f1) { + if (iflag) { + ICOPY_LIST(f2, tp2, b); + ICOPY_ELT(f1, tp2, i); + } else { + CCOPY_LIST(f2, tp2, b); + CCOPY_ELT(f1, tp2, i); + } + } else { + if (iflag) { + ICOPY_LIST(f1, tp2, b); + ICOPY_ELT(f2, tp2, i); + } else { + CCOPY_LIST(f1, tp2, b); + CCOPY_ELT(f2, tp2, i); + } + } + } + if (f2 < l2) { + if (iflag) + ICOPY_LIST(f2, tp2, l2); + else + CCOPY_LIST(f2, tp2, l2); + } else if (f1 < l1) { + if (iflag) + ICOPY_LIST(f1, tp2, l1); + else + CCOPY_LIST(f1, tp2, l1); + } + *p1 = l2; + } + tp2 = list1; /* swap list1, list2 */ + list1 = list2; + list2 = tp2; + last = list2 + nmemb*size; + } + if (base == list2) { + memmove(list2, list1, nmemb*size); + list2 = list1; + } + free(list2); + return (0); +} + +#define swap(a, b) { \ + s = b; \ + i = size; \ + do { \ + tmp = *a; *a++ = *s; *s++ = tmp; \ + } while (--i); \ + a -= size; \ + } +#define reverse(bot, top) { \ + s = top; \ + do { \ + i = size; \ + do { \ + tmp = *bot; *bot++ = *s; *s++ = tmp; \ + } while (--i); \ + s -= size2; \ + } while(bot < s); \ +} + +/* + * Optional hybrid natural/pairwise first pass. Eats up list1 in runs of + * increasing order, list2 in a corresponding linked list. Checks for runs + * when THRESHOLD/2 pairs compare with same sense. (Only used when NATURAL + * is defined. Otherwise simple pairwise merging is used.) + */ +void +setup(list1, list2, n, size, cmp) + size_t n, size; + int (*cmp)(const void *, const void *); + u_char *list1, *list2; +{ + size_t i, size2; + int length, tmp, sense; + u_char *f1, *f2, *s, *l2, *last, *p2; + + size2 = size*2; + if (n <= 5) { + insertionsort(list1, n, size, cmp); + *EVAL(list2) = (u_char*) list2 + n*size; + return; + } + /* + * Avoid running pointers out of bounds; limit n to evens + * for simplicity. + */ + i = 4 + (n & 1); + insertionsort(list1 + (n - i) * size, i, size, cmp); + last = list1 + size * (n - i); + *EVAL(list2 + (last - list1)) = list2 + n * size; + +#ifdef NATURAL + p2 = list2; + f1 = list1; + sense = (cmp(f1, f1 + size) > 0); + for (; f1 < last; sense = !sense) { + length = 2; + /* Find pairs with same sense. */ + for (f2 = f1 + size2; f2 < last; f2 += size2) { + if ((cmp(f2, f2+ size) > 0) != sense) + break; + length += 2; + } + if (length < THRESHOLD) { /* Pairwise merge */ + do { + p2 = *EVAL(p2) = f1 + size2 - list1 + list2; + if (sense > 0) + swap (f1, f1 + size); + } while ((f1 += size2) < f2); + } else { /* Natural merge */ + l2 = f2; + for (f2 = f1 + size2; f2 < l2; f2 += size2) { + if ((cmp(f2-size, f2) > 0) != sense) { + p2 = *EVAL(p2) = f2 - list1 + list2; + if (sense > 0) + reverse(f1, f2-size); + f1 = f2; + } + } + if (sense > 0) + reverse (f1, f2-size); + f1 = f2; + if (f2 < last || cmp(f2 - size, f2) > 0) + p2 = *EVAL(p2) = f2 - list1 + list2; + else + p2 = *EVAL(p2) = list2 + n*size; + } + } +#else /* pairwise merge only. */ + for (f1 = list1, p2 = list2; f1 < last; f1 += size2) { + p2 = *EVAL(p2) = p2 + size2; + if (cmp (f1, f1 + size) > 0) + swap(f1, f1 + size); + } +#endif /* NATURAL */ +} + +/* + * This is to avoid out-of-bounds addresses in sorting the + * last 4 elements. + */ +static void +insertionsort(a, n, size, cmp) + u_char *a; + size_t n, size; + int (*cmp)(const void *, const void *); +{ + u_char *ai, *s, *t, *u, tmp; + int i; + + for (ai = a+size; --n >= 1; ai += size) + for (t = ai; t > a; t -= size) { + u = t - size; + if (cmp(u, t) <= 0) + break; + swap(u, t); + } +} +#pragma clang diagnostic pop diff --git a/stdlib/FreeBSD/merge_b.c b/stdlib/FreeBSD/merge_b.c new file mode 100644 index 0000000..e437910 --- /dev/null +++ b/stdlib/FreeBSD/merge_b.c @@ -0,0 +1,356 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Peter McIlroy. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcomma" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/merge.c,v 1.8 2007/01/09 00:28:10 imp Exp $"); + +/* + * Hybrid exponential search/linear search merge sort with hybrid + * natural/pairwise first pass. Requires about .3% more comparisons + * for random data than LSMS with pairwise first pass alone. + * It works for objects as small as two bytes. + */ + +#define NATURAL +#define THRESHOLD 16 /* Best choice for natural merge cut-off. */ + +/* #define NATURAL to get hybrid natural merge. + * (The default is pairwise merging.) + */ + +#include + +#include +#include +#include + +static void setup(u_char *, u_char *, size_t, size_t, + int (^)(const void *, const void *)); +static void insertionsort(u_char *, size_t, size_t, + int (^)(const void *, const void *)); + +#define ISIZE sizeof(int) +#define PSIZE sizeof(u_char *) +#define ICOPY_LIST(src, dst, last) \ + do \ + *(int*)dst = *(int*)src, src += ISIZE, dst += ISIZE; \ + while(src < last) +#define ICOPY_ELT(src, dst, i) \ + do \ + *(int*) dst = *(int*) src, src += ISIZE, dst += ISIZE; \ + while (i -= ISIZE) + +#define CCOPY_LIST(src, dst, last) \ + do \ + *dst++ = *src++; \ + while (src < last) +#define CCOPY_ELT(src, dst, i) \ + do \ + *dst++ = *src++; \ + while (i -= 1) + +/* + * Find the next possible pointer head. (Trickery for forcing an array + * to do double duty as a linked list when objects do not align with word + * boundaries. + */ +/* Assumption: PSIZE is a power of 2. */ +#define EVAL(p) (u_char **) \ + ((u_char *)0 + \ + (((u_char *)p + PSIZE - 1 - (u_char *) 0) & ~(PSIZE - 1))) + +/* + * Arguments are as for qsort. + */ +int +mergesort_b(base, nmemb, size, cmp) + void *base; + size_t nmemb; + size_t size; + int (^cmp)(const void *, const void *); +{ + size_t i; + int sense; + int big, iflag; + u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2; + u_char *list2, *list1, *p2, *p, *last, **p1; + + if (size < PSIZE / 2) { /* Pointers must fit into 2 * size. */ + errno = EINVAL; + return (-1); + } + + if (nmemb == 0) + return (0); + + /* + * XXX + * Stupid subtraction for the Cray. + */ + iflag = 0; + if (!(size % ISIZE) && !(((char *)base - (char *)0) % ISIZE)) + iflag = 1; + + if ((list2 = malloc(nmemb * size + PSIZE)) == NULL) + return (-1); + + list1 = base; + setup(list1, list2, nmemb, size, cmp); + last = list2 + nmemb * size; + i = big = 0; + while (*EVAL(list2) != last) { + l2 = list1; + p1 = EVAL(list1); + for (tp2 = p2 = list2; p2 != last; p1 = EVAL(l2)) { + p2 = *EVAL(p2); + f1 = l2; + f2 = l1 = list1 + (p2 - list2); + if (p2 != last) + p2 = *EVAL(p2); + l2 = list1 + (p2 - list2); + while (f1 < l1 && f2 < l2) { + if (cmp(f1, f2) <= 0) { + q = f2; + b = f1, t = l1; + sense = -1; + } else { + q = f1; + b = f2, t = l2; + sense = 0; + } + if (!big) { /* here i = 0 */ + while ((b += size) < t && cmp(q, b) >sense) + if (++i == 6) { + big = 1; + goto EXPONENTIAL; + } + } else { +EXPONENTIAL: for (i = size; ; i <<= 1) + if ((p = (b + i)) >= t) { + if ((p = t - size) > b && + cmp(q, p) <= sense) + t = p; + else + b = p; + break; + } else if (cmp(q, p) <= sense) { + t = p; + if (i == size) + big = 0; + goto FASTCASE; + } else + b = p; + while (t > b+size) { + i = (((t - b) / size) >> 1) * size; + if (cmp(q, p = b + i) <= sense) + t = p; + else + b = p; + } + goto COPY; +FASTCASE: while (i > size) + if (cmp(q, + p = b + (i >>= 1)) <= sense) + t = p; + else + b = p; +COPY: b = t; + } + i = size; + if (q == f1) { + if (iflag) { + ICOPY_LIST(f2, tp2, b); + ICOPY_ELT(f1, tp2, i); + } else { + CCOPY_LIST(f2, tp2, b); + CCOPY_ELT(f1, tp2, i); + } + } else { + if (iflag) { + ICOPY_LIST(f1, tp2, b); + ICOPY_ELT(f2, tp2, i); + } else { + CCOPY_LIST(f1, tp2, b); + CCOPY_ELT(f2, tp2, i); + } + } + } + if (f2 < l2) { + if (iflag) + ICOPY_LIST(f2, tp2, l2); + else + CCOPY_LIST(f2, tp2, l2); + } else if (f1 < l1) { + if (iflag) + ICOPY_LIST(f1, tp2, l1); + else + CCOPY_LIST(f1, tp2, l1); + } + *p1 = l2; + } + tp2 = list1; /* swap list1, list2 */ + list1 = list2; + list2 = tp2; + last = list2 + nmemb*size; + } + if (base == list2) { + memmove(list2, list1, nmemb*size); + list2 = list1; + } + free(list2); + return (0); +} + +#define swap(a, b) { \ + s = b; \ + i = size; \ + do { \ + tmp = *a; *a++ = *s; *s++ = tmp; \ + } while (--i); \ + a -= size; \ + } +#define reverse(bot, top) { \ + s = top; \ + do { \ + i = size; \ + do { \ + tmp = *bot; *bot++ = *s; *s++ = tmp; \ + } while (--i); \ + s -= size2; \ + } while(bot < s); \ +} + +/* + * Optional hybrid natural/pairwise first pass. Eats up list1 in runs of + * increasing order, list2 in a corresponding linked list. Checks for runs + * when THRESHOLD/2 pairs compare with same sense. (Only used when NATURAL + * is defined. Otherwise simple pairwise merging is used.) + */ +void +setup(list1, list2, n, size, cmp) + size_t n, size; + int (^cmp)(const void *, const void *); + u_char *list1, *list2; +{ + size_t i, size2; + int length, tmp, sense; + u_char *f1, *f2, *s, *l2, *last, *p2; + + size2 = size*2; + if (n <= 5) { + insertionsort(list1, n, size, cmp); + *EVAL(list2) = (u_char*) list2 + n*size; + return; + } + /* + * Avoid running pointers out of bounds; limit n to evens + * for simplicity. + */ + i = 4 + (n & 1); + insertionsort(list1 + (n - i) * size, i, size, cmp); + last = list1 + size * (n - i); + *EVAL(list2 + (last - list1)) = list2 + n * size; + +#ifdef NATURAL + p2 = list2; + f1 = list1; + sense = (cmp(f1, f1 + size) > 0); + for (; f1 < last; sense = !sense) { + length = 2; + /* Find pairs with same sense. */ + for (f2 = f1 + size2; f2 < last; f2 += size2) { + if ((cmp(f2, f2+ size) > 0) != sense) + break; + length += 2; + } + if (length < THRESHOLD) { /* Pairwise merge */ + do { + p2 = *EVAL(p2) = f1 + size2 - list1 + list2; + if (sense > 0) + swap (f1, f1 + size); + } while ((f1 += size2) < f2); + } else { /* Natural merge */ + l2 = f2; + for (f2 = f1 + size2; f2 < l2; f2 += size2) { + if ((cmp(f2-size, f2) > 0) != sense) { + p2 = *EVAL(p2) = f2 - list1 + list2; + if (sense > 0) + reverse(f1, f2-size); + f1 = f2; + } + } + if (sense > 0) + reverse (f1, f2-size); + f1 = f2; + if (f2 < last || cmp(f2 - size, f2) > 0) + p2 = *EVAL(p2) = f2 - list1 + list2; + else + p2 = *EVAL(p2) = list2 + n*size; + } + } +#else /* pairwise merge only. */ + for (f1 = list1, p2 = list2; f1 < last; f1 += size2) { + p2 = *EVAL(p2) = p2 + size2; + if (cmp (f1, f1 + size) > 0) + swap(f1, f1 + size); + } +#endif /* NATURAL */ +} + +/* + * This is to avoid out-of-bounds addresses in sorting the + * last 4 elements. + */ +static void +insertionsort(a, n, size, cmp) + u_char *a; + size_t n, size; + int (^cmp)(const void *, const void *); +{ + u_char *ai, *s, *t, *u, tmp; + int i; + + for (ai = a+size; --n >= 1; ai += size) + for (t = ai; t > a; t -= size) { + u = t - size; + if (cmp(u, t) <= 0) + break; + swap(u, t); + } +} +#pragma clang diagnostic push diff --git a/stdlib/FreeBSD/psort.3 b/stdlib/FreeBSD/psort.3 new file mode 100644 index 0000000..e5572fc --- /dev/null +++ b/stdlib/FreeBSD/psort.3 @@ -0,0 +1,177 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/qsort.3,v 1.17 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd Nov 25, 2008 +.Dt PSORT 3 +.Os "Mac OS X" +.Sh NAME +.Nm psort , +#ifdef UNIFDEF_BLOCKS +.Nm psort_b , +#endif +.Nm psort_r +.Nd parallel sort functions +.Sh SYNOPSIS +.In stdlib.h +.Ft void +.Fo psort +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +#ifdef UNIFDEF_BLOCKS +.Ft void +.Fo psort_b +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +#endif +.Ft void +.Fo psort_r +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "void *thunk" +.Fa "int \*[lp]*compar\*[rp]\*[lp]void *, const void *, const void *\*[rp]" +.Fc +.Sh DESCRIPTION +The +#ifdef UNIFDEF_BLOCKS +.Fn psort , +.Fn psort_b , +#else +.Fn psort +#endif +and +.Fn psort_r +functions are parallel sort routines that are drop-in compatible with the +corresponding +.Fn qsort +function (see +.Xr qsort 3 +for a description of the arguments). +On multiprocessor machines, multiple threads may be created to simultaneously +perform the sort calculations, resulting in an overall faster sort result. +Overhead in managing the threads limits the maximum speed improvement to +somewhat less that the number of processors available. +For example, on a 4-processor machine, a typical sort on a large array might +result in 3.2 times faster sorting than a regular +.Fn qsort . +.Sh RESTRICTIONS +Because of the multi-threaded nature of the sort, the comparison function +is expected to perform its own synchronization that might be required for +data physically +.Em outside +the two objects passed to the comparison function. +However, no synchronization is required for the two +object themselves, unless some third party is also accessing those objects. +.Pp +Additional memory is temporary allocated to deal with the parallel nature +of the computation. +.Pp +Because of the overhead of maintaining multiple threads, the +.Fn psort +family of routines may choose to just call +.Xr qsort 3 +when there is no advantage to parallelizing (for example, when the number of +objects in the array is too small, or only one processor is available). +.Pp +Like +.Xr qsort 3 , +the sort is not stable. +.Sh RETURN VALUES +The +#ifdef UNIFDEF_BLOCKS +.Fn psort , +.Fn psort_b +#else +.Fn psort +#endif +and +.Fn psort_r +functions +return no value. +.Sh SEE ALSO +.Xr qsort 3 +.Sh SEE ALSO +.Xr sort 1 , +.Xr radixsort 3 +.Rs +.%A Hoare, C.A.R. +.%D 1962 +.%T "Quicksort" +.%J "The Computer Journal" +.%V 5:1 +.%P pp. 10-15 +.Re +.Rs +.%A Williams, J.W.J +.%D 1964 +.%T "Heapsort" +.%J "Communications of the ACM" +.%V 7:1 +.%P pp. 347-348 +.Re +.Rs +.%A Knuth, D.E. +.%D 1968 +.%B "The Art of Computer Programming" +.%V Vol. 3 +.%T "Sorting and Searching" +.%P pp. 114-123, 145-149 +.Re +.Rs +.%A McIlroy, P.M. +.%T "Optimistic Sorting and Information Theoretic Complexity" +.%J "Fourth Annual ACM-SIAM Symposium on Discrete Algorithms" +.%V January 1992 +.Re +.Rs +.%A Bentley, J.L. +.%A McIlroy, M.D. +.%T "Engineering a Sort Function" +.%J "Software--Practice and Experience" +.%V Vol. 23(11) +.%P pp. 1249-1265 +.%D November\ 1993 +.Re +.Sh STANDARDS +The +.Fn qsort +function +conforms to +.St -isoC . diff --git a/stdlib/FreeBSD/psort.c b/stdlib/FreeBSD/psort.c new file mode 100644 index 0000000..e9251ab --- /dev/null +++ b/stdlib/FreeBSD/psort.c @@ -0,0 +1,431 @@ +/****************************************************************************/ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/qsort.c,v 1.15 2008/01/14 09:21:34 das Exp $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define __APPLE_API_PRIVATE +#include + +#ifdef I_AM_PSORT_R +typedef int cmp_t(void *, const void *, const void *); +#else +typedef int cmp_t(const void *, const void *); +#endif +#ifdef I_AM_PSORT_B +static inline char *med3(char *, char *, char *, cmp_t ^, void *) __attribute__((always_inline)); +#else +static inline char *med3(char *, char *, char *, cmp_t *, void *) __attribute__((always_inline)); +#endif +static inline void swapfunc(char *, char *, int, int) __attribute__((always_inline)); + +#define min(a, b) (a) < (b) ? a : b + +#define NARGS ((PAGESIZE - offsetof(struct page, args)) / sizeof(union args)) +#define PAGESIZE 4096 +#define PARALLEL_MIN_SIZE 2000 /* determine heuristically */ + +struct shared; /* forward reference */ +union args { + union args *next; + struct { + struct shared *shared; + void *a; + size_t n; + int depth_limit; + } /* anonymous */; +}; + +struct page { + struct page *next; + union args args[0]; +}; + +struct shared { + char *who; + union args *freelist; + struct page *pagelist; +#ifdef I_AM_PSORT_R + void *thunk; +#endif +#ifdef I_AM_PSORT_B + cmp_t ^cmp; +#else + cmp_t *cmp; +#endif + size_t es; + size_t turnoff; + dispatch_queue_t queue; + dispatch_group_t group; + os_unfair_lock sharedlock; +}; + +static union args * +getargs(struct shared *shared) +{ + union args *args; + + os_unfair_lock_lock(&shared->sharedlock); + if(!shared->freelist) { + struct page *page; + union args *prev; + int i; + if((page = (struct page *)mmap(NULL, PAGESIZE, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0)) == NULL) + return NULL; + page->next = shared->pagelist; + shared->pagelist = page; + prev = NULL; + for(args = page->args, i = NARGS; i > 0; args++, i--) { + args->next = prev; + prev = args; + } + shared->freelist = prev; + } + args = shared->freelist; + shared->freelist = args->next; + os_unfair_lock_unlock(&shared->sharedlock); + return args; +} + +static void +returnargs(struct shared *shared, union args *args) +{ + os_unfair_lock_lock(&shared->sharedlock); + args->next = shared->freelist; + shared->freelist = args; + os_unfair_lock_unlock(&shared->sharedlock); +} + +/* + * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". + */ +#define swapcode(TYPE, parmi, parmj, n) { \ + long i = (n) / sizeof (TYPE); \ + TYPE *pi = (TYPE *) (parmi); \ + TYPE *pj = (TYPE *) (parmj); \ + do { \ + TYPE t = *pi; \ + *pi++ = *pj; \ + *pj++ = t; \ + } while (--i > 0); \ +} + +#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ + es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; + +static inline void +swapfunc(a, b, n, swaptype) + char *a, *b; + int n, swaptype; +{ + if(swaptype <= 1) + swapcode(long, a, b, n) + else + swapcode(char, a, b, n) +} + +#define swap(a, b) \ + if (swaptype == 0) { \ + long t = *(long *)(a); \ + *(long *)(a) = *(long *)(b); \ + *(long *)(b) = t; \ + } else \ + swapfunc(a, b, es, swaptype) + +#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) + +#ifdef I_AM_PSORT_R +#define CMP(t, x, y) (cmp((t), (x), (y))) +#else +#define CMP(t, x, y) (cmp((x), (y))) +#endif + +static inline char * +med3(char *a, char *b, char *c, +#ifdef I_AM_PSORT_B +cmp_t ^cmp, +#else +cmp_t *cmp, +#endif +void *thunk +#ifndef I_AM_PSORT_R +__unused +#endif +) +{ + return CMP(thunk, a, b) < 0 ? + (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a )) + :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c )); +} + +#ifdef __LP64__ +#define DEPTH(x) (2 * (flsl((long)(x)) - 1)) +#else /* !__LP64__ */ +#define DEPTH(x) (2 * (fls((int)(x)) - 1)) +#endif /* __LP64__ */ + +#ifdef I_AM_PSORT_R +int __heapsort_r(void *, size_t, size_t, void *, int (*)(void *, const void *, const void *)); +#endif + +static void _psort_parallel(void *x); + +static void +_psort(void *a, size_t n, size_t es, +#ifdef I_AM_PSORT_R +void *thunk, +#else +#define thunk NULL +#endif +#ifdef I_AM_PSORT_B +cmp_t ^cmp, +#else +cmp_t *cmp, +#endif +int depth_limit, struct shared *shared) +{ + char *pa, *pb, *pc, *pd, *pl, *pm, *pn; + size_t d, r; + int cmp_result; + int swaptype, swap_cnt; + +loop: + if (depth_limit-- <= 0) { +#ifdef I_AM_PSORT_B + heapsort_b(a, n, es, cmp); +#elif defined(I_AM_PSORT_R) + __heapsort_r(a, n, es, thunk, cmp); +#else + heapsort(a, n, es, cmp); +#endif + return; + } + SWAPINIT(a, es); + swap_cnt = 0; + if (n < 7) { + for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) + for (pl = pm; + pl > (char *)a && CMP(thunk, pl - es, pl) > 0; + pl -= es) + swap(pl, pl - es); + return; + } + pm = (char *)a + (n / 2) * es; + if (n > 7) { + pl = a; + pn = (char *)a + (n - 1) * es; + if (n > 40) { + d = (n / 8) * es; + pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk); + pm = med3(pm - d, pm, pm + d, cmp, thunk); + pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk); + } + pm = med3(pl, pm, pn, cmp, thunk); + } + swap(a, pm); + pa = pb = (char *)a + es; + + pc = pd = (char *)a + (n - 1) * es; + for (;;) { + while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) { + if (cmp_result == 0) { + swap_cnt = 1; + swap(pa, pb); + pa += es; + } + pb += es; + } + while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) { + if (cmp_result == 0) { + swap_cnt = 1; + swap(pc, pd); + pd -= es; + } + pc -= es; + } + if (pb > pc) + break; + swap(pb, pc); + swap_cnt = 1; + pb += es; + pc -= es; + } + + pn = (char *)a + n * es; + r = min(pa - (char *)a, pb - pa); + vecswap(a, pb - r, r); + r = min(pd - pc, pn - pd - es); + vecswap(pb, pn - r, r); + + if (swap_cnt == 0) { /* Switch to insertion sort */ + r = 1 + n / 4; /* n >= 7, so r >= 2 */ + for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) + for (pl = pm; + pl > (char *)a && CMP(thunk, pl - es, pl) > 0; + pl -= es) { + swap(pl, pl - es); + if (++swap_cnt > r) goto nevermind; + } + return; + } + +nevermind: + if ((r = pb - pa) > es) { + r /= es; + if (shared && r > shared->turnoff) { + union args *args = getargs(shared); + + if (args == NULL) + LIBC_ABORT("%s: getargs: %s", shared->who, strerror(errno)); + args->shared = shared; + args->a = a; + args->n = r; + args->depth_limit = depth_limit; + dispatch_group_async_f(shared->group, shared->queue, args, + _psort_parallel); + } else { +#ifdef I_AM_PSORT_R + _psort(a, r, es, thunk, cmp, depth_limit, NULL); +#else + _psort(a, r, es, cmp, depth_limit, NULL); +#endif + } + } + if ((r = pd - pc) > es) { + /* Iterate rather than recurse to save stack space */ + a = pn - r; + n = r / es; + goto loop; + } +/* psort(pn - r, r / es, es, cmp);*/ +} + +static void +_psort_parallel(void *x) +{ + union args *args = (union args *)x; + struct shared *shared = args->shared; + + _psort(args->a, args->n, shared->es, +#ifdef I_AM_PSORT_R + shared->thunk, +#endif + shared->cmp, args->depth_limit, shared); + returnargs(shared, args); +} + +/* fast, approximate integer square root */ +static size_t +isqrt(size_t x) +{ + size_t s = 1L << (flsl(x) / 2); + return (s + x / s) / 2; +} + +void +#ifdef I_AM_PSORT_R +psort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp) +#elif defined(I_AM_PSORT_B) +psort_b(void *a, size_t n, size_t es, cmp_t ^cmp) +#else +psort(void *a, size_t n, size_t es, cmp_t *cmp) +#endif +{ + if (n >= PARALLEL_MIN_SIZE && _NumCPUs() > 1) { + struct shared shared; + union args *args; + + bzero(&shared, sizeof(shared)); + shared.sharedlock = OS_UNFAIR_LOCK_INIT; + if ((args = getargs(&shared)) != NULL) { + struct page *p, *pp; +#ifdef I_AM_PSORT_R + shared.who = "psort_r"; + shared.thunk = thunk; +#elif defined(I_AM_PSORT_B) + shared.who = "psort_b"; +#else + shared.who = "psort"; +#endif + shared.cmp = cmp; + shared.es = es; + shared.queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + shared.group = dispatch_group_create(); + args->a = a; + args->n = n; + args->depth_limit = DEPTH(n); + args->shared = &shared; + /* + * The turnoff value is the size of a partition that, + * below which, we stop doing in parallel, and just do + * in the current thread. The value of sqrt(n) was + * determined heuristically. There is a smaller + * dependence on the slowness of the comparison + * function, and there might be a dependence on the + * number of processors, but the algorithm has not been + * determined. Because the sensitivity to the turnoff + * value is relatively low, we use a fast, approximate + * integer square root routine that is good enough for + * this purpose. + */ + shared.turnoff = isqrt(n); + _psort_parallel(args); + + /* wait for queue to drain */ + dispatch_group_wait(shared.group, DISPATCH_TIME_FOREVER); + dispatch_release(shared.group); + for(p = shared.pagelist; p; p = pp) { + pp = p->next; + munmap(p, PAGESIZE); + } + return; + } + } + /* Just call qsort */ +#ifdef I_AM_PSORT_R + qsort_r(a, n, es, thunk, cmp); +#elif defined(I_AM_PSORT_B) + qsort_b(a, n, es, cmp); +#else + qsort(a, n, es, cmp); +#endif +} diff --git a/stdlib/FreeBSD/psort_b.c b/stdlib/FreeBSD/psort_b.c new file mode 100644 index 0000000..e9251ab --- /dev/null +++ b/stdlib/FreeBSD/psort_b.c @@ -0,0 +1,431 @@ +/****************************************************************************/ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/qsort.c,v 1.15 2008/01/14 09:21:34 das Exp $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define __APPLE_API_PRIVATE +#include + +#ifdef I_AM_PSORT_R +typedef int cmp_t(void *, const void *, const void *); +#else +typedef int cmp_t(const void *, const void *); +#endif +#ifdef I_AM_PSORT_B +static inline char *med3(char *, char *, char *, cmp_t ^, void *) __attribute__((always_inline)); +#else +static inline char *med3(char *, char *, char *, cmp_t *, void *) __attribute__((always_inline)); +#endif +static inline void swapfunc(char *, char *, int, int) __attribute__((always_inline)); + +#define min(a, b) (a) < (b) ? a : b + +#define NARGS ((PAGESIZE - offsetof(struct page, args)) / sizeof(union args)) +#define PAGESIZE 4096 +#define PARALLEL_MIN_SIZE 2000 /* determine heuristically */ + +struct shared; /* forward reference */ +union args { + union args *next; + struct { + struct shared *shared; + void *a; + size_t n; + int depth_limit; + } /* anonymous */; +}; + +struct page { + struct page *next; + union args args[0]; +}; + +struct shared { + char *who; + union args *freelist; + struct page *pagelist; +#ifdef I_AM_PSORT_R + void *thunk; +#endif +#ifdef I_AM_PSORT_B + cmp_t ^cmp; +#else + cmp_t *cmp; +#endif + size_t es; + size_t turnoff; + dispatch_queue_t queue; + dispatch_group_t group; + os_unfair_lock sharedlock; +}; + +static union args * +getargs(struct shared *shared) +{ + union args *args; + + os_unfair_lock_lock(&shared->sharedlock); + if(!shared->freelist) { + struct page *page; + union args *prev; + int i; + if((page = (struct page *)mmap(NULL, PAGESIZE, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0)) == NULL) + return NULL; + page->next = shared->pagelist; + shared->pagelist = page; + prev = NULL; + for(args = page->args, i = NARGS; i > 0; args++, i--) { + args->next = prev; + prev = args; + } + shared->freelist = prev; + } + args = shared->freelist; + shared->freelist = args->next; + os_unfair_lock_unlock(&shared->sharedlock); + return args; +} + +static void +returnargs(struct shared *shared, union args *args) +{ + os_unfair_lock_lock(&shared->sharedlock); + args->next = shared->freelist; + shared->freelist = args; + os_unfair_lock_unlock(&shared->sharedlock); +} + +/* + * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". + */ +#define swapcode(TYPE, parmi, parmj, n) { \ + long i = (n) / sizeof (TYPE); \ + TYPE *pi = (TYPE *) (parmi); \ + TYPE *pj = (TYPE *) (parmj); \ + do { \ + TYPE t = *pi; \ + *pi++ = *pj; \ + *pj++ = t; \ + } while (--i > 0); \ +} + +#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ + es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; + +static inline void +swapfunc(a, b, n, swaptype) + char *a, *b; + int n, swaptype; +{ + if(swaptype <= 1) + swapcode(long, a, b, n) + else + swapcode(char, a, b, n) +} + +#define swap(a, b) \ + if (swaptype == 0) { \ + long t = *(long *)(a); \ + *(long *)(a) = *(long *)(b); \ + *(long *)(b) = t; \ + } else \ + swapfunc(a, b, es, swaptype) + +#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) + +#ifdef I_AM_PSORT_R +#define CMP(t, x, y) (cmp((t), (x), (y))) +#else +#define CMP(t, x, y) (cmp((x), (y))) +#endif + +static inline char * +med3(char *a, char *b, char *c, +#ifdef I_AM_PSORT_B +cmp_t ^cmp, +#else +cmp_t *cmp, +#endif +void *thunk +#ifndef I_AM_PSORT_R +__unused +#endif +) +{ + return CMP(thunk, a, b) < 0 ? + (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a )) + :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c )); +} + +#ifdef __LP64__ +#define DEPTH(x) (2 * (flsl((long)(x)) - 1)) +#else /* !__LP64__ */ +#define DEPTH(x) (2 * (fls((int)(x)) - 1)) +#endif /* __LP64__ */ + +#ifdef I_AM_PSORT_R +int __heapsort_r(void *, size_t, size_t, void *, int (*)(void *, const void *, const void *)); +#endif + +static void _psort_parallel(void *x); + +static void +_psort(void *a, size_t n, size_t es, +#ifdef I_AM_PSORT_R +void *thunk, +#else +#define thunk NULL +#endif +#ifdef I_AM_PSORT_B +cmp_t ^cmp, +#else +cmp_t *cmp, +#endif +int depth_limit, struct shared *shared) +{ + char *pa, *pb, *pc, *pd, *pl, *pm, *pn; + size_t d, r; + int cmp_result; + int swaptype, swap_cnt; + +loop: + if (depth_limit-- <= 0) { +#ifdef I_AM_PSORT_B + heapsort_b(a, n, es, cmp); +#elif defined(I_AM_PSORT_R) + __heapsort_r(a, n, es, thunk, cmp); +#else + heapsort(a, n, es, cmp); +#endif + return; + } + SWAPINIT(a, es); + swap_cnt = 0; + if (n < 7) { + for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) + for (pl = pm; + pl > (char *)a && CMP(thunk, pl - es, pl) > 0; + pl -= es) + swap(pl, pl - es); + return; + } + pm = (char *)a + (n / 2) * es; + if (n > 7) { + pl = a; + pn = (char *)a + (n - 1) * es; + if (n > 40) { + d = (n / 8) * es; + pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk); + pm = med3(pm - d, pm, pm + d, cmp, thunk); + pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk); + } + pm = med3(pl, pm, pn, cmp, thunk); + } + swap(a, pm); + pa = pb = (char *)a + es; + + pc = pd = (char *)a + (n - 1) * es; + for (;;) { + while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) { + if (cmp_result == 0) { + swap_cnt = 1; + swap(pa, pb); + pa += es; + } + pb += es; + } + while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) { + if (cmp_result == 0) { + swap_cnt = 1; + swap(pc, pd); + pd -= es; + } + pc -= es; + } + if (pb > pc) + break; + swap(pb, pc); + swap_cnt = 1; + pb += es; + pc -= es; + } + + pn = (char *)a + n * es; + r = min(pa - (char *)a, pb - pa); + vecswap(a, pb - r, r); + r = min(pd - pc, pn - pd - es); + vecswap(pb, pn - r, r); + + if (swap_cnt == 0) { /* Switch to insertion sort */ + r = 1 + n / 4; /* n >= 7, so r >= 2 */ + for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) + for (pl = pm; + pl > (char *)a && CMP(thunk, pl - es, pl) > 0; + pl -= es) { + swap(pl, pl - es); + if (++swap_cnt > r) goto nevermind; + } + return; + } + +nevermind: + if ((r = pb - pa) > es) { + r /= es; + if (shared && r > shared->turnoff) { + union args *args = getargs(shared); + + if (args == NULL) + LIBC_ABORT("%s: getargs: %s", shared->who, strerror(errno)); + args->shared = shared; + args->a = a; + args->n = r; + args->depth_limit = depth_limit; + dispatch_group_async_f(shared->group, shared->queue, args, + _psort_parallel); + } else { +#ifdef I_AM_PSORT_R + _psort(a, r, es, thunk, cmp, depth_limit, NULL); +#else + _psort(a, r, es, cmp, depth_limit, NULL); +#endif + } + } + if ((r = pd - pc) > es) { + /* Iterate rather than recurse to save stack space */ + a = pn - r; + n = r / es; + goto loop; + } +/* psort(pn - r, r / es, es, cmp);*/ +} + +static void +_psort_parallel(void *x) +{ + union args *args = (union args *)x; + struct shared *shared = args->shared; + + _psort(args->a, args->n, shared->es, +#ifdef I_AM_PSORT_R + shared->thunk, +#endif + shared->cmp, args->depth_limit, shared); + returnargs(shared, args); +} + +/* fast, approximate integer square root */ +static size_t +isqrt(size_t x) +{ + size_t s = 1L << (flsl(x) / 2); + return (s + x / s) / 2; +} + +void +#ifdef I_AM_PSORT_R +psort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp) +#elif defined(I_AM_PSORT_B) +psort_b(void *a, size_t n, size_t es, cmp_t ^cmp) +#else +psort(void *a, size_t n, size_t es, cmp_t *cmp) +#endif +{ + if (n >= PARALLEL_MIN_SIZE && _NumCPUs() > 1) { + struct shared shared; + union args *args; + + bzero(&shared, sizeof(shared)); + shared.sharedlock = OS_UNFAIR_LOCK_INIT; + if ((args = getargs(&shared)) != NULL) { + struct page *p, *pp; +#ifdef I_AM_PSORT_R + shared.who = "psort_r"; + shared.thunk = thunk; +#elif defined(I_AM_PSORT_B) + shared.who = "psort_b"; +#else + shared.who = "psort"; +#endif + shared.cmp = cmp; + shared.es = es; + shared.queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + shared.group = dispatch_group_create(); + args->a = a; + args->n = n; + args->depth_limit = DEPTH(n); + args->shared = &shared; + /* + * The turnoff value is the size of a partition that, + * below which, we stop doing in parallel, and just do + * in the current thread. The value of sqrt(n) was + * determined heuristically. There is a smaller + * dependence on the slowness of the comparison + * function, and there might be a dependence on the + * number of processors, but the algorithm has not been + * determined. Because the sensitivity to the turnoff + * value is relatively low, we use a fast, approximate + * integer square root routine that is good enough for + * this purpose. + */ + shared.turnoff = isqrt(n); + _psort_parallel(args); + + /* wait for queue to drain */ + dispatch_group_wait(shared.group, DISPATCH_TIME_FOREVER); + dispatch_release(shared.group); + for(p = shared.pagelist; p; p = pp) { + pp = p->next; + munmap(p, PAGESIZE); + } + return; + } + } + /* Just call qsort */ +#ifdef I_AM_PSORT_R + qsort_r(a, n, es, thunk, cmp); +#elif defined(I_AM_PSORT_B) + qsort_b(a, n, es, cmp); +#else + qsort(a, n, es, cmp); +#endif +} diff --git a/stdlib/FreeBSD/psort_r.c b/stdlib/FreeBSD/psort_r.c new file mode 100644 index 0000000..e9251ab --- /dev/null +++ b/stdlib/FreeBSD/psort_r.c @@ -0,0 +1,431 @@ +/****************************************************************************/ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/qsort.c,v 1.15 2008/01/14 09:21:34 das Exp $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define __APPLE_API_PRIVATE +#include + +#ifdef I_AM_PSORT_R +typedef int cmp_t(void *, const void *, const void *); +#else +typedef int cmp_t(const void *, const void *); +#endif +#ifdef I_AM_PSORT_B +static inline char *med3(char *, char *, char *, cmp_t ^, void *) __attribute__((always_inline)); +#else +static inline char *med3(char *, char *, char *, cmp_t *, void *) __attribute__((always_inline)); +#endif +static inline void swapfunc(char *, char *, int, int) __attribute__((always_inline)); + +#define min(a, b) (a) < (b) ? a : b + +#define NARGS ((PAGESIZE - offsetof(struct page, args)) / sizeof(union args)) +#define PAGESIZE 4096 +#define PARALLEL_MIN_SIZE 2000 /* determine heuristically */ + +struct shared; /* forward reference */ +union args { + union args *next; + struct { + struct shared *shared; + void *a; + size_t n; + int depth_limit; + } /* anonymous */; +}; + +struct page { + struct page *next; + union args args[0]; +}; + +struct shared { + char *who; + union args *freelist; + struct page *pagelist; +#ifdef I_AM_PSORT_R + void *thunk; +#endif +#ifdef I_AM_PSORT_B + cmp_t ^cmp; +#else + cmp_t *cmp; +#endif + size_t es; + size_t turnoff; + dispatch_queue_t queue; + dispatch_group_t group; + os_unfair_lock sharedlock; +}; + +static union args * +getargs(struct shared *shared) +{ + union args *args; + + os_unfair_lock_lock(&shared->sharedlock); + if(!shared->freelist) { + struct page *page; + union args *prev; + int i; + if((page = (struct page *)mmap(NULL, PAGESIZE, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0)) == NULL) + return NULL; + page->next = shared->pagelist; + shared->pagelist = page; + prev = NULL; + for(args = page->args, i = NARGS; i > 0; args++, i--) { + args->next = prev; + prev = args; + } + shared->freelist = prev; + } + args = shared->freelist; + shared->freelist = args->next; + os_unfair_lock_unlock(&shared->sharedlock); + return args; +} + +static void +returnargs(struct shared *shared, union args *args) +{ + os_unfair_lock_lock(&shared->sharedlock); + args->next = shared->freelist; + shared->freelist = args; + os_unfair_lock_unlock(&shared->sharedlock); +} + +/* + * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". + */ +#define swapcode(TYPE, parmi, parmj, n) { \ + long i = (n) / sizeof (TYPE); \ + TYPE *pi = (TYPE *) (parmi); \ + TYPE *pj = (TYPE *) (parmj); \ + do { \ + TYPE t = *pi; \ + *pi++ = *pj; \ + *pj++ = t; \ + } while (--i > 0); \ +} + +#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ + es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; + +static inline void +swapfunc(a, b, n, swaptype) + char *a, *b; + int n, swaptype; +{ + if(swaptype <= 1) + swapcode(long, a, b, n) + else + swapcode(char, a, b, n) +} + +#define swap(a, b) \ + if (swaptype == 0) { \ + long t = *(long *)(a); \ + *(long *)(a) = *(long *)(b); \ + *(long *)(b) = t; \ + } else \ + swapfunc(a, b, es, swaptype) + +#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) + +#ifdef I_AM_PSORT_R +#define CMP(t, x, y) (cmp((t), (x), (y))) +#else +#define CMP(t, x, y) (cmp((x), (y))) +#endif + +static inline char * +med3(char *a, char *b, char *c, +#ifdef I_AM_PSORT_B +cmp_t ^cmp, +#else +cmp_t *cmp, +#endif +void *thunk +#ifndef I_AM_PSORT_R +__unused +#endif +) +{ + return CMP(thunk, a, b) < 0 ? + (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a )) + :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c )); +} + +#ifdef __LP64__ +#define DEPTH(x) (2 * (flsl((long)(x)) - 1)) +#else /* !__LP64__ */ +#define DEPTH(x) (2 * (fls((int)(x)) - 1)) +#endif /* __LP64__ */ + +#ifdef I_AM_PSORT_R +int __heapsort_r(void *, size_t, size_t, void *, int (*)(void *, const void *, const void *)); +#endif + +static void _psort_parallel(void *x); + +static void +_psort(void *a, size_t n, size_t es, +#ifdef I_AM_PSORT_R +void *thunk, +#else +#define thunk NULL +#endif +#ifdef I_AM_PSORT_B +cmp_t ^cmp, +#else +cmp_t *cmp, +#endif +int depth_limit, struct shared *shared) +{ + char *pa, *pb, *pc, *pd, *pl, *pm, *pn; + size_t d, r; + int cmp_result; + int swaptype, swap_cnt; + +loop: + if (depth_limit-- <= 0) { +#ifdef I_AM_PSORT_B + heapsort_b(a, n, es, cmp); +#elif defined(I_AM_PSORT_R) + __heapsort_r(a, n, es, thunk, cmp); +#else + heapsort(a, n, es, cmp); +#endif + return; + } + SWAPINIT(a, es); + swap_cnt = 0; + if (n < 7) { + for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) + for (pl = pm; + pl > (char *)a && CMP(thunk, pl - es, pl) > 0; + pl -= es) + swap(pl, pl - es); + return; + } + pm = (char *)a + (n / 2) * es; + if (n > 7) { + pl = a; + pn = (char *)a + (n - 1) * es; + if (n > 40) { + d = (n / 8) * es; + pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk); + pm = med3(pm - d, pm, pm + d, cmp, thunk); + pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk); + } + pm = med3(pl, pm, pn, cmp, thunk); + } + swap(a, pm); + pa = pb = (char *)a + es; + + pc = pd = (char *)a + (n - 1) * es; + for (;;) { + while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) { + if (cmp_result == 0) { + swap_cnt = 1; + swap(pa, pb); + pa += es; + } + pb += es; + } + while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) { + if (cmp_result == 0) { + swap_cnt = 1; + swap(pc, pd); + pd -= es; + } + pc -= es; + } + if (pb > pc) + break; + swap(pb, pc); + swap_cnt = 1; + pb += es; + pc -= es; + } + + pn = (char *)a + n * es; + r = min(pa - (char *)a, pb - pa); + vecswap(a, pb - r, r); + r = min(pd - pc, pn - pd - es); + vecswap(pb, pn - r, r); + + if (swap_cnt == 0) { /* Switch to insertion sort */ + r = 1 + n / 4; /* n >= 7, so r >= 2 */ + for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) + for (pl = pm; + pl > (char *)a && CMP(thunk, pl - es, pl) > 0; + pl -= es) { + swap(pl, pl - es); + if (++swap_cnt > r) goto nevermind; + } + return; + } + +nevermind: + if ((r = pb - pa) > es) { + r /= es; + if (shared && r > shared->turnoff) { + union args *args = getargs(shared); + + if (args == NULL) + LIBC_ABORT("%s: getargs: %s", shared->who, strerror(errno)); + args->shared = shared; + args->a = a; + args->n = r; + args->depth_limit = depth_limit; + dispatch_group_async_f(shared->group, shared->queue, args, + _psort_parallel); + } else { +#ifdef I_AM_PSORT_R + _psort(a, r, es, thunk, cmp, depth_limit, NULL); +#else + _psort(a, r, es, cmp, depth_limit, NULL); +#endif + } + } + if ((r = pd - pc) > es) { + /* Iterate rather than recurse to save stack space */ + a = pn - r; + n = r / es; + goto loop; + } +/* psort(pn - r, r / es, es, cmp);*/ +} + +static void +_psort_parallel(void *x) +{ + union args *args = (union args *)x; + struct shared *shared = args->shared; + + _psort(args->a, args->n, shared->es, +#ifdef I_AM_PSORT_R + shared->thunk, +#endif + shared->cmp, args->depth_limit, shared); + returnargs(shared, args); +} + +/* fast, approximate integer square root */ +static size_t +isqrt(size_t x) +{ + size_t s = 1L << (flsl(x) / 2); + return (s + x / s) / 2; +} + +void +#ifdef I_AM_PSORT_R +psort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp) +#elif defined(I_AM_PSORT_B) +psort_b(void *a, size_t n, size_t es, cmp_t ^cmp) +#else +psort(void *a, size_t n, size_t es, cmp_t *cmp) +#endif +{ + if (n >= PARALLEL_MIN_SIZE && _NumCPUs() > 1) { + struct shared shared; + union args *args; + + bzero(&shared, sizeof(shared)); + shared.sharedlock = OS_UNFAIR_LOCK_INIT; + if ((args = getargs(&shared)) != NULL) { + struct page *p, *pp; +#ifdef I_AM_PSORT_R + shared.who = "psort_r"; + shared.thunk = thunk; +#elif defined(I_AM_PSORT_B) + shared.who = "psort_b"; +#else + shared.who = "psort"; +#endif + shared.cmp = cmp; + shared.es = es; + shared.queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + shared.group = dispatch_group_create(); + args->a = a; + args->n = n; + args->depth_limit = DEPTH(n); + args->shared = &shared; + /* + * The turnoff value is the size of a partition that, + * below which, we stop doing in parallel, and just do + * in the current thread. The value of sqrt(n) was + * determined heuristically. There is a smaller + * dependence on the slowness of the comparison + * function, and there might be a dependence on the + * number of processors, but the algorithm has not been + * determined. Because the sensitivity to the turnoff + * value is relatively low, we use a fast, approximate + * integer square root routine that is good enough for + * this purpose. + */ + shared.turnoff = isqrt(n); + _psort_parallel(args); + + /* wait for queue to drain */ + dispatch_group_wait(shared.group, DISPATCH_TIME_FOREVER); + dispatch_release(shared.group); + for(p = shared.pagelist; p; p = pp) { + pp = p->next; + munmap(p, PAGESIZE); + } + return; + } + } + /* Just call qsort */ +#ifdef I_AM_PSORT_R + qsort_r(a, n, es, thunk, cmp); +#elif defined(I_AM_PSORT_B) + qsort_b(a, n, es, cmp); +#else + qsort(a, n, es, cmp); +#endif +} diff --git a/stdlib/FreeBSD/putenv.c b/stdlib/FreeBSD/putenv.c new file mode 100644 index 0000000..6458d63 --- /dev/null +++ b/stdlib/FreeBSD/putenv.c @@ -0,0 +1,109 @@ +/*- + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)putenv.c 8.2 (Berkeley) 3/27/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/putenv.c,v 1.6 2007/05/01 16:02:41 ache Exp $"); + +#include +#include +#include +#include +#include +#include + +extern struct owned_ptr *__env_owned; + +#ifdef LEGACY_CRT1_ENVIRON +extern char **_saved_environ; +#endif /* LEGACY_CRT1_ENVIRON */ + +__private_extern__ int __init__env_owned_locked(int); +__private_extern__ int __setenv_locked(const char *, const char *, int, int, char ***, struct owned_ptr *); +__private_extern__ void __environ_lock(void); +__private_extern__ void __environ_unlock(void); + +#ifndef BUILDING_VARIANT +/* + * _putenvp -- SPI using an arbitrary pointer to string array (the array must + * have been created with malloc) and an env state, created by _allocenvstate(). + * Returns ptr to value associated with name, if any, else NULL. + */ +int +_putenvp(char *str, char ***envp, void *state) +{ + __environ_lock(); + if (__init__env_owned_locked(1)) { + __environ_unlock(); + return (-1); + } + int ret = __setenv_locked(str, NULL, 1, 0, envp, + (state ? (struct owned_ptr *)state : __env_owned)); + __environ_unlock(); + return ret; +} +#endif /* BUILDING_VARIANT */ + +int +putenv(str) + char *str; +{ + int ret; + int copy; + +#if __DARWIN_UNIX03 + if (str == NULL || *str == 0 || index(str, '=') == NULL) { + errno = EINVAL; + return (-1); + } +#else /* !__DARWIN_UNIX03 */ + if (index(str, '=') == NULL) + return (-1); +#endif /* __DARWIN_UNIX03 */ + +#if __DARWIN_UNIX03 + copy = 0; +#else /* !__DARWIN_UNIX03 */ + copy = -1; +#endif /* __DARWIN_UNIX03 */ + + __environ_lock(); + if (__init__env_owned_locked(1)) { + __environ_unlock(); + return (-1); + } + ret = __setenv_locked(str, NULL, 1, copy, _NSGetEnviron(), __env_owned); +#ifdef LEGACY_CRT1_ENVIRON + _saved_environ = *_NSGetEnviron(); +#endif /* LEGACY_CRT1_ENVIRON */ + __environ_unlock(); + return ret; +} diff --git a/stdlib/FreeBSD/qsort.3 b/stdlib/FreeBSD/qsort.3 new file mode 100644 index 0000000..f137a8d --- /dev/null +++ b/stdlib/FreeBSD/qsort.3 @@ -0,0 +1,364 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/qsort.3,v 1.17 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd September 30, 2003 +.Dt QSORT 3 +.Os +.Sh NAME +.Nm heapsort , +#ifdef UNIFDEF_BLOCKS +.Nm heapsort_b , +#endif +.Nm mergesort , +#ifdef UNIFDEF_BLOCKS +.Nm mergesort_b , +#endif +.Nm qsort , +#ifdef UNIFDEF_BLOCKS +.Nm qsort_b , +#endif +.Nm qsort_r +.Nd sort functions +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fo heapsort +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +#ifdef UNIFDEF_BLOCKS +.Ft int +.Fo heapsort_b +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +#endif +.Ft int +.Fo mergesort +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +#ifdef UNIFDEF_BLOCKS +.Ft int +.Fo mergesort_b +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +#endif +.Ft void +.Fo qsort +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +#ifdef UNIFDEF_BLOCKS +.Ft void +.Fo qsort_b +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +#endif +.Ft void +.Fo qsort_r +.Fa "void *base" +.Fa "size_t nel" +.Fa "size_t width" +.Fa "void *thunk" +.Fa "int \*[lp]*compar\*[rp]\*[lp]void *, const void *, const void *\*[rp]" +.Fc +.Sh DESCRIPTION +The +.Fn qsort +function is a modified partition-exchange sort, or quicksort. +The +.Fn heapsort +function is a modified selection sort. +The +.Fn mergesort +function is a modified merge sort with exponential search, +intended for sorting data with pre-existing order. +.Pp +The +.Fn qsort +and +.Fn heapsort +functions sort an array of +.Fa nel +objects, the initial member of which is pointed to by +.Fa base . +The size of each object is specified by +.Fa width . +The +.Fn mergesort +function +behaves similarly, but +.Em requires +that +.Fa width +be greater than or equal to +.Dq "sizeof(void *) / 2" . +.Pp +The contents of the array +.Fa base +are sorted in ascending order according to +a comparison function pointed to by +.Fa compar , +which requires two arguments pointing to the objects being +compared. +.Pp +The comparison function must return an integer less than, equal to, or +greater than zero if the first argument is considered to be respectively +less than, equal to, or greater than the second. +.Pp +The +.Fn qsort_r +function behaves identically to +.Fn qsort , +except that it takes an additional argument, +.Fa thunk , +which is passed unchanged as the first argument to function pointed to +.Fa compar . +This allows the comparison function to access additional +data without using global variables, and thus +.Fn qsort_r +is suitable for use in functions which must be reentrant. +.Pp +The algorithms implemented by +.Fn qsort , +.Fn qsort_r , +and +.Fn heapsort +are +.Em not +stable; that is, if two members compare as equal, their order in +the sorted array is undefined. +The +.Fn mergesort +algorithm is stable. +.Pp +The +.Fn qsort +and +.Fn qsort_r +functions are an implementation of C.A.R. +Hoare's +.Dq quicksort +algorithm, +a variant of partition-exchange sorting; in particular, see +.An D.E. Knuth Ns 's +.%T "Algorithm Q" . +.Sy Quicksort +takes O N lg N average time. +This implementation uses median selection to avoid its +O N**2 worst-case behavior. +.Pp +The +.Fn heapsort +function is an implementation of +.An "J.W.J. William" Ns 's +.Dq heapsort +algorithm, +a variant of selection sorting; in particular, see +.An "D.E. Knuth" Ns 's +.%T "Algorithm H" . +.Sy Heapsort +takes O N lg N worst-case time. +Its +.Em only +advantage over +.Fn qsort +is that it uses almost no additional memory; while +.Fn qsort +does not allocate memory, it is implemented using recursion. +.Pp +The function +.Fn mergesort +requires additional memory of size +.Fa nel * +.Fa width +bytes; it should be used only when space is not at a premium. +The +.Fn mergesort +function +is optimized for data with pre-existing order; its worst case +time is O N lg N; its best case is O N. +.Pp +Normally, +.Fn qsort +is faster than +.Fn mergesort +which is faster than +.Fn heapsort . +Memory availability and pre-existing order in the data can make this +untrue. +#ifdef UNIFDEF_BLOCKS +.Pp +The +.Fn heapsort_b , +.Fn mergesort_b , +and +.Fn qsort_b +routines are like the corresponding routines without the _b suffix, expect +that the +.Fa compar +callback is a block pointer instead of a function pointer. +#endif +.Sh RETURN VALUES +The +#ifdef UNIFDEF_BLOCKS +.Fn qsort , +.Fn qsort_b +#else +.Fn qsort +#endif +and +.Fn qsort_r +functions +return no value. +.Pp +#ifdef UNIFDEF_BLOCKS +.ds HEAPSORT_B heapsort_b +.ds MERGESORT_B mergesort_b +#endif +.Rv -std heapsort \*[HEAPSORT_B] mergesort \*[MERGESORT_B] +.Sh COMPATIBILITY +Previous versions of +.Fn qsort +did not permit the comparison routine itself to call +.Fn qsort 3 . +This is no longer true. +.Sh ERRORS +The +#ifdef UNIFDEF_BLOCKS +.Fn heapsort , +.Fn heapsort_b , +.Fn mergesort , +and +.Fn mergesort_b +#else +.Fn heapsort +and +.Fn mergesort +#endif +functions succeed unless: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa width +argument is zero, or, +the +.Fa width +argument to +.Fn mergesort +#ifdef UNIFDEF_BLOCKS +or +.Fn mergesort_b +#endif +is less than +.Dq "sizeof(void *) / 2" . +.It Bq Er ENOMEM +The +#ifdef UNIFDEF_BLOCKS +.Fn heapsort , +.Fn heapsort_b , +.Fn mergesort , +or +.Fn mergesort_b +#else +.Fn heapsort +or +.Fn mergesort +#endif +functions +were unable to allocate memory. +.El +.Sh SEE ALSO +.Xr sort 1 , +.Xr radixsort 3 +.Rs +.%A Hoare, C.A.R. +.%D 1962 +.%T "Quicksort" +.%J "The Computer Journal" +.%V 5:1 +.%P pp. 10-15 +.Re +.Rs +.%A Williams, J.W.J +.%D 1964 +.%T "Heapsort" +.%J "Communications of the ACM" +.%V 7:1 +.%P pp. 347-348 +.Re +.Rs +.%A Knuth, D.E. +.%D 1968 +.%B "The Art of Computer Programming" +.%V Vol. 3 +.%T "Sorting and Searching" +.%P pp. 114-123, 145-149 +.Re +.Rs +.%A McIlroy, P.M. +.%T "Optimistic Sorting and Information Theoretic Complexity" +.%J "Fourth Annual ACM-SIAM Symposium on Discrete Algorithms" +.%V January 1992 +.Re +.Rs +.%A Bentley, J.L. +.%A McIlroy, M.D. +.%T "Engineering a Sort Function" +.%J "Software--Practice and Experience" +.%V Vol. 23(11) +.%P pp. 1249-1265 +.%D November\ 1993 +.Re +.Sh STANDARDS +The +.Fn qsort +function +conforms to +.St -isoC . diff --git a/stdlib/FreeBSD/qsort.c b/stdlib/FreeBSD/qsort.c new file mode 100644 index 0000000..b1c5257 --- /dev/null +++ b/stdlib/FreeBSD/qsort.c @@ -0,0 +1,321 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#ifdef I_AM_QSORT_R +typedef int cmp_t(void *, const void *, const void *); +#else +typedef int cmp_t(const void *, const void *); +#endif +static inline char *med3(char *, char *, char *, cmp_t *, void *); +static inline void swapfunc(char *, char *, size_t, int, int); + +#define MIN(a, b) ((a) < (b) ? a : b) + +/* + * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". + */ +#define swapcode(TYPE, parmi, parmj, n) { \ + size_t i = (n) / sizeof (TYPE); \ + TYPE *pi = (TYPE *) (parmi); \ + TYPE *pj = (TYPE *) (parmj); \ + do { \ + TYPE t = *pi; \ + *pi++ = *pj; \ + *pj++ = t; \ + } while (--i > 0); \ +} + +#define SWAPINIT(TYPE, a, es) swaptype_ ## TYPE = \ + ((char *)a - (char *)0) % sizeof(TYPE) || \ + es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1; + +static inline void +swapfunc(char *a, char *b, size_t n, int swaptype_long, int swaptype_int) +{ + if (swaptype_long <= 1) + swapcode(long, a, b, n) + else if (swaptype_int <= 1) + swapcode(int, a, b, n) + else + swapcode(char, a, b, n) +} + +#define swap(a, b) \ + if (swaptype_long == 0) { \ + long t = *(long *)(a); \ + *(long *)(a) = *(long *)(b); \ + *(long *)(b) = t; \ + } else if (swaptype_int == 0) { \ + int t = *(int *)(a); \ + *(int *)(a) = *(int *)(b); \ + *(int *)(b) = t; \ + } else \ + swapfunc(a, b, es, swaptype_long, swaptype_int) + +#define vecswap(a, b, n) \ + if ((n) > 0) swapfunc(a, b, n, swaptype_long, swaptype_int) + +#ifdef I_AM_QSORT_R +#define CMP(t, x, y) (cmp((t), (x), (y))) +#else +#define CMP(t, x, y) (cmp((x), (y))) +#endif + +/* + * Find the median of 3 elements + */ +static inline char * +med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk +#ifndef I_AM_QSORT_R +__unused +#endif +) +{ + return CMP(thunk, a, b) < 0 ? + (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a )) + :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c )); +} + +#ifdef __LP64__ +#define DEPTH(x) (2 * (flsl((long)(x)) - 1)) +#else /* !__LP64__ */ +#define DEPTH(x) (2 * (fls((int)(x)) - 1)) +#endif /* __LP64__ */ + +#ifdef I_AM_QSORT_R +int __heapsort_r(void *, size_t, size_t, void *, int (*)(void *, const void *, const void *)); +#endif + +/* + * Simple insertion sort routine. + */ +static bool +_isort(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp, int swap_limit, int swaptype_long, int swaptype_int) +{ + int swap_cnt = 0; + for (char *pm = (char *)a + es; pm < (char *)a + n * es; pm += es) { + for (char *pl = pm; pl > (char *)a && CMP(thunk, pl - es, pl) > 0; + pl -= es) { + swap(pl, pl - es); + if (swap_limit && ++swap_cnt > swap_limit) return false; + } + } + return true; +} + +#ifdef I_AM_QSORT_R +static void +_qsort(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp, int depth_limit) +#else +#define thunk NULL +static void +_qsort(void *a, size_t n, size_t es, cmp_t *cmp, int depth_limit) +#endif +{ + char *pa, *pb, *pc, *pd, *pl, *pm, *pn; + size_t d1, d2; + int cmp_result; + int swaptype_long, swaptype_int, swap_cnt; + +loop: + SWAPINIT(long, a, es); + SWAPINIT(int, a, es); + swap_cnt = 0; + + if (depth_limit-- <= 0) { + /* + * We've hit our recursion limit, switch to heapsort + */ +#ifdef I_AM_QSORT_R + __heapsort_r(a, n, es, thunk, cmp); +#else + heapsort(a, n, es, cmp); +#endif + return; + } + + if (n <= 7) { + /* + * For sufficiently small inputs, we'll just insertion sort. + * + * Pass 0 as swap limit, since this must complete. + */ + _isort(a, n, es, thunk, cmp, 0, swaptype_long, swaptype_int); + return; + } + + /* + * Compute the pseudomedian. Small arrays use 3 samples, large ones use 9. + */ + pl = a; + pm = (char *)a + (n / 2) * es; + pn = (char *)a + (n - 1) * es; + if (n > 40) { + size_t d = (n / 8) * es; + + pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk); + pm = med3(pm - d, pm, pm + d, cmp, thunk); + pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk); + } + pm = med3(pl, pm, pn, cmp, thunk); + + /* + * Pull the median to the front, starting us with: + * + * +-+-------------+ + * |=| ? | + * +-+-------------+ + * a pa,pb pc,pd + */ + swap(a, pm); + pa = pb = (char *)a + es; + pc = pd = (char *)a + (n - 1) * es; + + for (;;) { + /* + * - Move b forward while it's less than the median + * - Move c backwards while it's greater than the median + * - When equal to the median, swap to the outside + */ + while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) { + if (cmp_result == 0) { + swap_cnt = 1; + swap(pa, pb); + pa += es; + } + pb += es; + } + while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) { + if (cmp_result == 0) { + swap_cnt = 1; + swap(pc, pd); + pd -= es; + } + pc -= es; + } + if (pb > pc) + break; + swap(pb, pc); + swap_cnt = 1; + pb += es; + pc -= es; + } + + /* + * Now we've got: + * + * +---+-----+-----+---+ + * | = | < | > | = | + * +---+-----+-----+---+ + * a pa pc,pb pd pn + * + * So swap the '=' into the middle + */ + + pn = (char *)a + n * es; + d1 = MIN(pa - (char *)a, pb - pa); + vecswap(a, pb - d1, d1); + d1 = MIN(pd - pc, pn - pd - es); + vecswap(pb, pn - d1, d1); + + /* + * +-----+---+---+-----+ + * | < | = | > | + * +-----+---+---+-----+ + * a pn + */ + + if (swap_cnt == 0) { /* Switch to insertion sort */ + int r = 1 + n / 4; /* n > 7, so r >= 2 */ + if (!_isort(a, n, es, thunk, cmp, r, swaptype_long, swaptype_int)) { + goto nevermind; + } + return; + } +nevermind: + + d1 = pb - pa; + d2 = pd - pc; + if (d1 <= d2) { + /* Recurse on left partition, then iterate on right partition */ + if (d1 > es) { +#ifdef I_AM_QSORT_R + _qsort(a, d1 / es, es, thunk, cmp, depth_limit); +#else + _qsort(a, d1 / es, es, cmp, depth_limit); +#endif + } + if (d2 > es) { + /* Iterate rather than recurse to save stack space */ + /* qsort(pn - d2, d2 / es, es, cmp); */ + a = pn - d2; + n = d2 / es; + goto loop; + } + } else { + /* Recurse on right partition, then iterate on left partition */ + if (d2 > es) { +#ifdef I_AM_QSORT_R + _qsort(pn - d2, d2 / es, es, thunk, cmp, depth_limit); +#else + _qsort(pn - d2, d2 / es, es, cmp, depth_limit); +#endif + } + if (d1 > es) { + /* Iterate rather than recurse to save stack space */ + /* qsort(a, d1 / es, es, cmp); */ + n = d1 / es; + goto loop; + } + } +} + +void +#ifdef I_AM_QSORT_R +qsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp) +#else +qsort(void *a, size_t n, size_t es, cmp_t *cmp) +#endif +{ + _qsort(a, n, es, +#ifdef I_AM_QSORT_R + thunk, +#endif + cmp, DEPTH(n)); +} diff --git a/stdlib/FreeBSD/qsort_r.c b/stdlib/FreeBSD/qsort_r.c new file mode 100644 index 0000000..f7c0e54 --- /dev/null +++ b/stdlib/FreeBSD/qsort_r.c @@ -0,0 +1,8 @@ +/* + * This file is in the public domain. Originally written by Garrett + * A. Wollman. + * + * $FreeBSD: src/lib/libc/stdlib/qsort_r.c,v 1.1 2002/09/10 02:04:49 wollman Exp $ + */ +#define I_AM_QSORT_R +#include "qsort.c" diff --git a/stdlib/FreeBSD/radixsort.3 b/stdlib/FreeBSD/radixsort.3 new file mode 100644 index 0000000..9dc2286 --- /dev/null +++ b/stdlib/FreeBSD/radixsort.3 @@ -0,0 +1,160 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)radixsort.3 8.2 (Berkeley) 1/27/94 +.\" $FreeBSD: src/lib/libc/stdlib/radixsort.3,v 1.12 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd January 27, 1994 +.Dt RADIXSORT 3 +.Os +.Sh NAME +.Nm radixsort , sradixsort +.Nd radix sort +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In limits.h +.In stdlib.h +.Ft int +.Fn radixsort "const unsigned char **base" "int nmemb" "const unsigned char *table" "unsigned endbyte" +.Ft int +.Fn sradixsort "const unsigned char **base" "int nmemb" "const unsigned char *table" "unsigned endbyte" +.Sh DESCRIPTION +The +.Fn radixsort +and +.Fn sradixsort +functions +are implementations of radix sort. +.Pp +These functions sort an array of pointers to byte strings, the initial +member of which is referenced by +.Fa base . +The byte strings may contain any values; the end of each string +is denoted by the user-specified value +.Fa endbyte . +.Pp +Applications may specify a sort order by providing the +.Fa table +argument. +If +.Pf non- Dv NULL , +.Fa table +must reference an array of +.Dv UCHAR_MAX ++ 1 bytes which contains the sort +weight of each possible byte value. +The end-of-string byte must have a sort weight of 0 or 255 +(for sorting in reverse order). +More than one byte may have the same sort weight. +The +.Fa table +argument +is useful for applications which wish to sort different characters +equally, for example, providing a table with the same weights +for A-Z as for a-z will result in a case-insensitive sort. +If +.Fa table +is NULL, the contents of the array are sorted in ascending order +according to the +.Tn ASCII +order of the byte strings they reference and +.Fa endbyte +has a sorting weight of 0. +.Pp +The +.Fn sradixsort +function is stable, that is, if two elements compare as equal, their +order in the sorted array is unchanged. +The +.Fn sradixsort +function uses additional memory sufficient to hold +.Fa nmemb +pointers. +.Pp +The +.Fn radixsort +function is not stable, but uses no additional memory. +.Pp +These functions are variants of most-significant-byte radix sorting; in +particular, see +.An "D.E. Knuth" Ns 's +.%T "Algorithm R" +and section 5.2.5, exercise 10. +They take linear time relative to the number of bytes in the strings. +.Sh RETURN VALUES +.Rv -std radixsort +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +The value of the +.Fa endbyte +element of +.Fa table +is not 0 or 255. +.El +.Pp +Additionally, the +.Fn sradixsort +function +may fail and set +.Va errno +for any of the errors specified for the library routine +.Xr malloc 3 . +.Sh SEE ALSO +.Xr sort 1 , +.Xr qsort 3 +.Pp +.Rs +.%A Knuth, D.E. +.%D 1968 +.%B "The Art of Computer Programming" +.%T "Sorting and Searching" +.%V Vol. 3 +.%P pp. 170-178 +.Re +.Rs +.%A Paige, R. +.%D 1987 +.%T "Three Partition Refinement Algorithms" +.%J "SIAM J. Comput." +.%V Vol. 16 +.%N No. 6 +.Re +.Rs +.%A McIlroy, P. +.%D 1993 +.%B "Engineering Radix Sort" +.%T "Computing Systems" +.%V Vol. 6:1 +.%P pp. 5-27 +.Re +.Sh HISTORY +The +.Fn radixsort +function first appeared in +.Bx 4.4 . diff --git a/stdlib/FreeBSD/radixsort.c b/stdlib/FreeBSD/radixsort.c new file mode 100644 index 0000000..5208ce9 --- /dev/null +++ b/stdlib/FreeBSD/radixsort.c @@ -0,0 +1,352 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Peter McIlroy and by Dan Bernstein at New York University, + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)radixsort.c 8.2 (Berkeley) 4/28/95"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/radixsort.c,v 1.8 2007/01/09 00:28:10 imp Exp $"); + +/* + * Radixsort routines. + * + * Program r_sort_a() is unstable but uses O(logN) extra memory for a stack. + * Use radixsort(a, n, trace, endchar) for this case. + * + * For stable sorting (using N extra pointers) use sradixsort(), which calls + * r_sort_b(). + * + * For a description of this code, see D. McIlroy, P. McIlroy, K. Bostic, + * "Engineering Radix Sort". + */ + +#include +#include +#include +#include +#include + +typedef struct { + const u_char **sa; + int sn, si; +} stack; + +static inline void simplesort +(const u_char **, int, int, const u_char *, u_int) __attribute__((always_inline)); +static void r_sort_a(const u_char **, int, int, const u_char *, u_int); +static void r_sort_b(const u_char **, const u_char **, int, int, + const u_char *, u_int); + +static int *r_sort_a_count; +static int *r_sort_b_count; + +static void r_sort_count_allocate(void); +static pthread_once_t r_sort_count_control = PTHREAD_ONCE_INIT; + +#define THRESHOLD 20 /* Divert to simplesort(). */ +#define SIZE 512 /* Default stack size. */ + +#define SETUP { \ + if (tab == NULL) { \ + tr = tr0; \ + for (c = 0; c < endch; c++) \ + tr0[c] = c + 1; \ + tr0[c] = 0; \ + for (c++; c < 256; c++) \ + tr0[c] = c; \ + endch = 0; \ + } else { \ + endch = tab[endch]; \ + tr = tab; \ + if (endch != 0 && endch != 255) { \ + errno = EINVAL; \ + return (-1); \ + } \ + } \ +} + +int +radixsort(a, n, tab, endch) + const u_char **a, *tab; + int n; + u_int endch; +{ + const u_char *tr; + int c; + u_char tr0[256]; + + SETUP; + r_sort_a(a, n, 0, tr, endch); + return (0); +} + +int +sradixsort(a, n, tab, endch) + const u_char **a, *tab; + int n; + u_int endch; +{ + const u_char *tr, **ta; + int c; + u_char tr0[256]; + + SETUP; + if (n < THRESHOLD) + simplesort(a, n, 0, tr, endch); + else { + if ((ta = malloc(n * sizeof(a))) == NULL) + return (-1); + r_sort_b(a, ta, n, 0, tr, endch); + free(ta); + } + return (0); +} + +static void r_sort_count_allocate(void) +{ + r_sort_a_count = calloc(256, sizeof(int)); + r_sort_b_count = calloc(256, sizeof(int)); +} + +#define empty(s) (s >= sp) +#define pop(a, n, i) a = (--sp)->sa, n = sp->sn, i = sp->si +#define push(a, n, i) sp->sa = a, sp->sn = n, (sp++)->si = i +#define swap(a, b, t) t = a, a = b, b = t + +/* Unstable, in-place sort. */ +static void +r_sort_a(a, n, i, tr, endch) + const u_char **a; + int n, i; + const u_char *tr; + u_int endch; +{ + static int *count, nc, bmin; + int c; + const u_char **ak, *r; + stack s[SIZE], *sp, *sp0, *sp1, temp; + int *cp, bigc; + const u_char **an, *t, **aj, **top[256]; + + if (pthread_once(&r_sort_count_control, r_sort_count_allocate)) { + return; + } + + count = r_sort_a_count; + + /* Set up stack. */ + sp = s; + push(a, n, i); + while (!empty(s)) { + pop(a, n, i); + if (n < THRESHOLD) { + simplesort(a, n, i, tr, endch); + continue; + } + an = a + n; + + /* Make character histogram. */ + if (nc == 0) { + bmin = 255; /* First occupied bin, excluding eos. */ + for (ak = a; ak < an;) { + c = tr[(*ak++)[i]]; + if (++count[c] == 1 && c != endch) { + if (c < bmin) + bmin = c; + nc++; + } + } + if (sp + nc > s + SIZE) { /* Get more stack. */ + r_sort_a(a, n, i, tr, endch); + continue; + } + } + + /* + * Special case: if all strings have the same + * character at position i, move on to the next + * character. + */ + if (nc == 1 && count[bmin] == n) { + push(a, n, i+1); + nc = count[bmin] = 0; + continue; + } + + /* + * Set top[]; push incompletely sorted bins onto stack. + * top[] = pointers to last out-of-place element in bins. + * count[] = counts of elements in bins. + * Before permuting: top[c-1] + count[c] = top[c]; + * during deal: top[c] counts down to top[c-1]. + */ + sp0 = sp1 = sp; /* Stack position of biggest bin. */ + bigc = 2; /* Size of biggest bin. */ + if (endch == 0) /* Special case: set top[eos]. */ + top[0] = ak = a + count[0]; + else { + ak = a; + top[255] = an; + } + for (cp = count + bmin; nc > 0; cp++) { + while (*cp == 0) /* Find next non-empty pile. */ + cp++; + if (*cp > 1) { + if (*cp > bigc) { + bigc = *cp; + sp1 = sp; + } + push(ak, *cp, i+1); + } + top[cp-count] = ak += *cp; + nc--; + } + swap(*sp0, *sp1, temp); /* Play it safe -- biggest bin last. */ + + /* + * Permute misplacements home. Already home: everything + * before aj, and in bin[c], items from top[c] on. + * Inner loop: + * r = next element to put in place; + * ak = top[r[i]] = location to put the next element. + * aj = bottom of 1st disordered bin. + * Outer loop: + * Once the 1st disordered bin is done, ie. aj >= ak, + * aj<-aj + count[c] connects the bins in a linked list; + * reset count[c]. + */ + for (aj = a; aj < an; *aj = r, aj += count[c], count[c] = 0) + for (r = *aj; aj < (ak = --top[c = tr[r[i]]]);) + swap(*ak, r, t); + } +} + +/* Stable sort, requiring additional memory. */ +static void +r_sort_b(a, ta, n, i, tr, endch) + const u_char **a, **ta; + int n, i; + const u_char *tr; + u_int endch; +{ + static int *count, nc, bmin; + int c; + const u_char **ak, **ai; + stack s[512], *sp, *sp0, *sp1, temp; + const u_char **top[256]; + int *cp, bigc; + + if (pthread_once(&r_sort_count_control, r_sort_count_allocate)) { + return; + } + + count = r_sort_b_count; + + sp = s; + push(a, n, i); + while (!empty(s)) { + pop(a, n, i); + if (n < THRESHOLD) { + simplesort(a, n, i, tr, endch); + continue; + } + + if (nc == 0) { + bmin = 255; + for (ak = a + n; --ak >= a;) { + c = tr[(*ak)[i]]; + if (++count[c] == 1 && c != endch) { + if (c < bmin) + bmin = c; + nc++; + } + } + if (sp + nc > s + SIZE) { + r_sort_b(a, ta, n, i, tr, endch); + continue; + } + } + + sp0 = sp1 = sp; + bigc = 2; + if (endch == 0) { + top[0] = ak = a + count[0]; + count[0] = 0; + } else { + ak = a; + top[255] = a + n; + count[255] = 0; + } + for (cp = count + bmin; nc > 0; cp++) { + while (*cp == 0) + cp++; + if ((c = *cp) > 1) { + if (c > bigc) { + bigc = c; + sp1 = sp; + } + push(ak, c, i+1); + } + top[cp-count] = ak += c; + *cp = 0; /* Reset count[]. */ + nc--; + } + swap(*sp0, *sp1, temp); + + for (ak = ta + n, ai = a+n; ak > ta;) /* Copy to temp. */ + *--ak = *--ai; + for (ak = ta+n; --ak >= ta;) /* Deal to piles. */ + *--top[tr[(*ak)[i]]] = *ak; + } +} + +static inline void +simplesort(a, n, b, tr, endch) /* insertion sort */ + const u_char **a; + int n, b; + const u_char *tr; + u_int endch; +{ + u_char ch; + const u_char **ak, **ai, *s, *t; + + for (ak = a+1; --n >= 1; ak++) + for (ai = ak; ai > a; ai--) { + for (s = ai[0] + b, t = ai[-1] + b; + (ch = tr[*s]) != endch; s++, t++) + if (ch != tr[*t]) + break; + if (ch >= tr[*t]) + break; + swap(ai[0], ai[-1], s); + } +} diff --git a/stdlib/FreeBSD/rand.3 b/stdlib/FreeBSD/rand.3 new file mode 100644 index 0000000..278a682 --- /dev/null +++ b/stdlib/FreeBSD/rand.3 @@ -0,0 +1,126 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)rand.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/rand.3,v 1.16 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd May 25, 1999 +.Dt RAND 3 +.Os +.Sh NAME +.Nm rand , +.Nm rand_r , +.Nm srand , +.Nm sranddev +.Nd bad random number generator +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fo rand +.Fa void +.Fc +.Ft int +.Fo rand_r +.Fa "unsigned *seed" +.Fc +.Ft void +.Fo srand +.Fa "unsigned seed" +.Fc +.Ft void +.Fo sranddev +.Fa void +.Fc +.Sh DESCRIPTION +.Bf -symbolic +These interfaces are obsoleted by +.Xr arc4random 3 . +.Ef +.Pp +The +.Fn rand +function computes a sequence of pseudo-random integers in the range +of 0 to +.Dv RAND_MAX +(as defined by the header file +.In stdlib.h ) . +.Pp +The +.Fn srand +function sets its argument +.Fa seed +as the seed for a new sequence of +pseudo-random numbers to be returned by +.Fn rand . +These sequences are repeatable by calling +.Fn srand +with the same seed value. +.Pp +If no +.Fa seed +value is provided, the functions are automatically +seeded with a value of 1. +.Pp +The +.Fn sranddev +function initializes a seed, using the +.Xr random 4 +random number device which returns good random numbers. +However, the +.Fn rand +function still remains unsuitable for cryptographic use. +.Pp +The +.Fn rand_r +function +provides the same functionality as +.Fn rand . +A pointer to the context value +.Fa seed +must be supplied by the caller. +.Sh SEE ALSO +.Xr arc4random 3 , +.Xr random 3 , +.Xr random 4 +.Sh STANDARDS +The +.Fn rand +and +.Fn srand +functions +conform to +.St -isoC . +.Pp +The +.Fn rand_r +function is as proposed in the POSIX.4a Draft #6 document. diff --git a/stdlib/FreeBSD/rand.c b/stdlib/FreeBSD/rand.c new file mode 100644 index 0000000..7090acc --- /dev/null +++ b/stdlib/FreeBSD/rand.c @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Posix rand_r function added May 1999 by Wes Peters . + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rand.c 8.1 (Berkeley) 6/14/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include /* for sranddev() */ +#include +#include /* for sranddev() */ +#include +#include /* for sranddev() */ +#include "un-namespace.h" + +#ifdef TEST +#include +#endif /* TEST */ + +static int +do_rand(unsigned long *ctx) +{ +#ifdef USE_WEAK_SEEDING +/* + * Historic implementation compatibility. + * The random sequences do not vary much with the seed, + * even with overflowing. + */ + return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); +#else /* !USE_WEAK_SEEDING */ +/* + * Compute x = (7^5 * x) mod (2^31 - 1) + * without overflowing 31 bits: + * (2^31 - 1) = 127773 * (7^5) + 2836 + * From "Random number generators: good ones are hard to find", + * Park and Miller, Communications of the ACM, vol. 31, no. 10, + * October 1988, p. 1195. + */ + long hi, lo, x; + + /* Can't be initialized with 0, so use another value. */ + if (*ctx == 0) + *ctx = 123459876; + hi = *ctx / 127773; + lo = *ctx % 127773; + x = 16807 * lo - 2836 * hi; + if (x < 0) + x += 0x7fffffff; + return ((*ctx = x) % ((u_long)RAND_MAX + 1)); +#endif /* !USE_WEAK_SEEDING */ +} + + +int +rand_r(unsigned int *ctx) +{ + u_long val = (u_long) *ctx; + int r = do_rand(&val); + + *ctx = (unsigned int) val; + return (r); +} + + +static u_long next = 1; + +int +rand() +{ + return (do_rand(&next)); +} + +void +srand(seed) +u_int seed; +{ + next = seed; +} + + +/* + * sranddev: + * + * Many programs choose the seed value in a totally predictable manner. + * This often causes problems. We seed the generator using the much more + * secure random(4) interface. + */ +void +sranddev(void) +{ + int fd, done; + + done = 0; + fd = _open("/dev/random", O_RDONLY | O_CLOEXEC, 0); + if (fd >= 0) { + if (_read(fd, (void *) &next, sizeof(next)) == sizeof(next)) + done = 1; + _close(fd); + } + + if (!done) { + struct timeval tv; + + gettimeofday(&tv, NULL); + srand((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec); + } +} + + +#ifdef TEST + +main() +{ + int i; + unsigned myseed; + + printf("seeding rand with 0x19610910: \n"); + srand(0x19610910); + + printf("generating three pseudo-random numbers:\n"); + for (i = 0; i < 3; i++) + { + printf("next random number = %d\n", rand()); + } + + printf("generating the same sequence with rand_r:\n"); + myseed = 0x19610910; + for (i = 0; i < 3; i++) + { + printf("next random number = %d\n", rand_r(&myseed)); + } + + return 0; +} + +#endif /* TEST */ + diff --git a/stdlib/FreeBSD/random.3 b/stdlib/FreeBSD/random.3 new file mode 100644 index 0000000..84c8755 --- /dev/null +++ b/stdlib/FreeBSD/random.3 @@ -0,0 +1,236 @@ +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)random.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/random.3,v 1.22 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt RANDOM 3 +.Os +.Sh NAME +.Nm initstate , +.Nm random , +.Nm setstate , +.Nm srandom , +.Nm srandomdev +.Nd better random number generator; routines for changing generators +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft char * +.Fo initstate +.Fa "unsigned seed" +.Fa "char *state" +.Fa "size_t size" +.Fc +.Ft long +.Fo random +.Fa void +.Fc +.Ft char * +.Fo setstate +.Fa "const char *state" +.Fc +.Ft void +.Fo srandom +.Fa "unsigned seed" +.Fc +.Ft void +.Fo srandomdev +.Fa void +.Fc +.Sh DESCRIPTION +The +.Fn random +function +uses a non-linear, additive feedback, random number generator, employing a +default table of size 31 long integers. +It returns successive pseudo-random +numbers in the range from 0 to +.if t 2\u\s731\s10\d\(mi1. +.if n (2**31)\(mi1. +The period of this random number generator is very large, approximately +.if t 16\(mu(2\u\s731\s10\d\(mi1). +.if n 16*((2**31)\(mi1). +.Pp +The +.Fn random +and +.Fn srandom +functions have (almost) the same calling sequence and initialization properties as the +.Xr rand 3 +and +.Xr srand 3 +functions. +The difference is that +.Xr rand 3 +produces a much less random sequence \(em in fact, the low dozen bits +generated by rand go through a cyclic pattern. +All of the bits generated by +.Fn random +are usable. +For example, +.Sq Li random()&01 +will produce a random binary +value. +.Pp +Like +.Xr srand 3 , +.Fn srandom +sets the initial seed value for future calls to +.Fn random . +Like +.Xr rand 3 , +.Fn random +will by default produce a sequence of numbers that can be duplicated +by calling +.Fn srandom +with the same seed. +.Pp +The +.Fn srandomdev +routine initializes a state array, using the +.Xr random 4 +random number device which returns good random numbers, +suitable for cryptographic use. +Note that this particular seeding +procedure can generate states which are impossible to reproduce by +calling +.Fn srandom +with any value, since the succeeding terms in the +state buffer are no longer derived from the LC algorithm applied to +a fixed seed. +.Pp +The +.Fn initstate +routine allows a state array, passed in as an argument, to be initialized +for future use. +The size of the state array (in bytes) is used by +.Fn initstate +to decide how sophisticated a random number generator it should use \(em the +more state, the better the random numbers will be. +(Current "optimal" values for the amount of state information are +8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to +the nearest known amount. +Using less than 8 bytes will cause an error.) +The seed for the initialization (which specifies a starting point for +the random number sequence and provides for restarting at the same +point) is also an argument. +The +.Fn initstate +function +returns a pointer to the previous state information array. +.Pp +Once a state has been initialized, the +.Fn setstate +routine provides for rapid switching between states. +The +.Fn setstate +function +returns a pointer to the previous state array; its +argument state array is used for further random number generation +until the next call to +.Fn initstate +or +.Fn setstate . +.Pp +Once a state array has been initialized, it may be restarted at a +different point either by calling +.Fn initstate +(with the desired seed, the state array, and its size) or by calling +both +.Fn setstate +(with the state array) and +.Fn srandom +(with the desired seed). +The advantage of calling both +.Fn setstate +and +.Fn srandom +is that the size of the state array does not have to be remembered after +it is initialized. +.Pp +With 256 bytes of state information, the period of the random number +generator is greater than +.if t 2\u\s769\s10\d, +.if n 2**69 , +which should be sufficient for most purposes. +.Sh DIAGNOSTICS +If +.Fn initstate +is called with less than 8 bytes of state information, or if +.Fn setstate +detects that the state information has been garbled, error +messages are printed on the standard error output. +.Sh LEGACY SYNOPSIS +.Fd #include +.Pp +.Ft char * +.br +.Fo initstate +.Fa "unsigned long seed" +.Fa "char *state" +.Fa "long size" +.Fc ; +.Pp +.Ft char * +.br +.Fo setstate +.Fa "char *state" +.Fc ; +.Pp +.Ft void +.br +.Fo srandom +.Fa "unsigned long seed" +.Fc ; +.Pp +The type of each parameter is different in the legacy version. +.Sh SEE ALSO +.Xr arc4random 3 , +.Xr rand 3 , +.Xr srand 3 , +.Xr random 4 , +.Xr compat 5 +.Sh HISTORY +These +functions appeared in +.Bx 4.2 . +.Sh AUTHORS +.An Earl T. Cohen +.Sh BUGS +About 2/3 the speed of +.Xr rand 3 . +.Pp +The historical implementation used to have a very weak seeding; the +random sequence did not vary much with the seed. +The current implementation employs a better pseudo-random number +generator for the initial state calculation. +.Pp +Applications requiring cryptographic quality randomness should use +.Xr arc4random 3 . diff --git a/stdlib/FreeBSD/random.c b/stdlib/FreeBSD/random.c new file mode 100644 index 0000000..1ca75ed --- /dev/null +++ b/stdlib/FreeBSD/random.c @@ -0,0 +1,511 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); + +#ifdef __APPLE__ +// Always compile with __DARWIN_UNIX03=1 prototypes. +// Applications using legacy interfaces (i386 only) use types of the same size: +// sizeof(int) == sizeof(long) == sizeof(size_t) +#undef __DARWIN_UNIX03 +#define __DARWIN_UNIX03 1 +#endif // __APPLE__ + +#include "namespace.h" +#include "namespace.h" +#include /* for srandomdev() */ +#include /* for srandomdev() */ +#include +#include +#include +#include /* for srandomdev() */ +#include "un-namespace.h" + +/* + * random.c: + * + * An improved random number generation package. In addition to the standard + * rand()/srand() like interface, this package also has a special state info + * interface. The initstate() routine is called with a seed, an array of + * bytes, and a count of how many bytes are being passed in; this array is + * then initialized to contain information for random number generation with + * that much state information. Good sizes for the amount of state + * information are 32, 64, 128, and 256 bytes. The state can be switched by + * calling the setstate() routine with the same array as was initiallized + * with initstate(). By default, the package runs with 128 bytes of state + * information and generates far better random numbers than a linear + * congruential generator. If the amount of state information is less than + * 32 bytes, a simple linear congruential R.N.G. is used. + * + * Internally, the state information is treated as an array of uint32_t's; the + * zeroeth element of the array is the type of R.N.G. being used (small + * integer); the remainder of the array is the state information for the + * R.N.G. Thus, 32 bytes of state information will give 7 ints worth of + * state information, which will allow a degree seven polynomial. (Note: + * the zeroeth word of state information also has some other information + * stored in it -- see setstate() for details). + * + * The random number generation technique is a linear feedback shift register + * approach, employing trinomials (since there are fewer terms to sum up that + * way). In this approach, the least significant bit of all the numbers in + * the state table will act as a linear feedback shift register, and will + * have period 2^deg - 1 (where deg is the degree of the polynomial being + * used, assuming that the polynomial is irreducible and primitive). The + * higher order bits will have longer periods, since their values are also + * influenced by pseudo-random carries out of the lower bits. The total + * period of the generator is approximately deg*(2**deg - 1); thus doubling + * the amount of state information has a vast influence on the period of the + * generator. Note: the deg*(2**deg - 1) is an approximation only good for + * large deg, when the period of the shift is the dominant factor. + * With deg equal to seven, the period is actually much longer than the + * 7*(2**7 - 1) predicted by this formula. + * + * Modified 28 December 1994 by Jacob S. Rosenberg. + * The following changes have been made: + * All references to the type u_int have been changed to unsigned long. + * All references to type int have been changed to type long. Other + * cleanups have been made as well. A warning for both initstate and + * setstate has been inserted to the effect that on Sparc platforms + * the 'arg_state' variable must be forced to begin on word boundaries. + * This can be easily done by casting a long integer array to char *. + * The overall logic has been left STRICTLY alone. This software was + * tested on both a VAX and Sun SpacsStation with exactly the same + * results. The new version and the original give IDENTICAL results. + * The new version is somewhat faster than the original. As the + * documentation says: "By default, the package runs with 128 bytes of + * state information and generates far better random numbers than a linear + * congruential generator. If the amount of state information is less than + * 32 bytes, a simple linear congruential R.N.G. is used." For a buffer of + * 128 bytes, this new version runs about 19 percent faster and for a 16 + * byte buffer it is about 5 percent faster. + */ + +/* + * For each of the currently supported random number generators, we have a + * break value on the amount of state information (you need at least this + * many bytes of state info to support this random number generator), a degree + * for the polynomial (actually a trinomial) that the R.N.G. is based on, and + * the separation between the two lower order coefficients of the trinomial. + */ +#define TYPE_0 0 /* linear congruential */ +#define BREAK_0 8 +#define DEG_0 0 +#define SEP_0 0 + +#define TYPE_1 1 /* x**7 + x**3 + 1 */ +#define BREAK_1 32 +#define DEG_1 7 +#define SEP_1 3 + +#define TYPE_2 2 /* x**15 + x + 1 */ +#define BREAK_2 64 +#define DEG_2 15 +#define SEP_2 1 + +#define TYPE_3 3 /* x**31 + x**3 + 1 */ +#define BREAK_3 128 +#define DEG_3 31 +#define SEP_3 3 + +#define TYPE_4 4 /* x**63 + x + 1 */ +#define BREAK_4 256 +#define DEG_4 63 +#define SEP_4 1 + +/* + * Array versions of the above information to make code run faster -- + * relies on fact that TYPE_i == i. + */ +#define MAX_TYPES 5 /* max number of types above */ + +#ifdef USE_WEAK_SEEDING +#define NSHUFF 0 +#else /* !USE_WEAK_SEEDING */ +#define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ +#endif /* !USE_WEAK_SEEDING */ + +static const int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; +static const int seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; + +/* + * Initially, everything is set up as if from: + * + * initstate(1, randtbl, 128); + * + * Note that this initialization takes advantage of the fact that srandom() + * advances the front and rear pointers 10*rand_deg times, and hence the + * rear pointer which starts at 0 will also end up at zero; thus the zeroeth + * element of the state information, which contains info about the current + * position of the rear pointer is just + * + * MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3. + */ + +static uint32_t randtbl[DEG_3 + 1] = { + TYPE_3, +#ifdef USE_WEAK_SEEDING +/* Historic implementation compatibility */ +/* The random sequences do not vary much with the seed */ + 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5, + 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd, + 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88, + 0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, + 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b, + 0x27fb47b9, +#else /* !USE_WEAK_SEEDING */ + 0x991539b1, 0x16a5bce3, 0x6774a4cd, 0x3e01511e, 0x4e508aaa, 0x61048c05, + 0xf5500617, 0x846b7115, 0x6a19892c, 0x896a97af, 0xdb48f936, 0x14898454, + 0x37ffd106, 0xb58bff9c, 0x59e17104, 0xcf918a49, 0x09378c83, 0x52c7a471, + 0x8d293ea9, 0x1f4fc301, 0xc3db71be, 0x39b44e1c, 0xf8a44ef9, 0x4c8b80b1, + 0x19edc328, 0x87bf4bdd, 0xc9b240e5, 0xe9ee4b1b, 0x4382aee7, 0x535b6b41, + 0xf3bec5da +#endif /* !USE_WEAK_SEEDING */ +}; + +/* + * fptr and rptr are two pointers into the state info, a front and a rear + * pointer. These two pointers are always rand_sep places aparts, as they + * cycle cyclically through the state information. (Yes, this does mean we + * could get away with just one pointer, but the code for random() is more + * efficient this way). The pointers are left positioned as they would be + * from the call + * + * initstate(1, randtbl, 128); + * + * (The position of the rear pointer, rptr, is really 0 (as explained above + * in the initialization of randtbl) because the state table pointer is set + * to point to randtbl[1] (as explained below). + */ +static uint32_t *fptr = &randtbl[SEP_3 + 1]; +static uint32_t *rptr = &randtbl[1]; + +/* + * The following things are the pointer to the state information table, the + * type of the current generator, the degree of the current polynomial being + * used, and the separation between the two pointers. Note that for efficiency + * of random(), we remember the first location of the state information, not + * the zeroeth. Hence it is valid to access state[-1], which is used to + * store the type of the R.N.G. Also, we remember the last location, since + * this is more efficient than indexing every time to find the address of + * the last element to see if the front and rear pointers have wrapped. + */ +static uint32_t *state = &randtbl[1]; +static int rand_type = TYPE_3; +static int rand_deg = DEG_3; +static int rand_sep = SEP_3; +static uint32_t *end_ptr = &randtbl[DEG_3 + 1]; + +static inline uint32_t +good_rand(int32_t x) +{ +#ifdef USE_WEAK_SEEDING +/* + * Historic implementation compatibility. + * The random sequences do not vary much with the seed, + * even with overflowing. + */ + return (1103515245 * x + 12345); +#else /* !USE_WEAK_SEEDING */ +/* + * Compute x = (7^5 * x) mod (2^31 - 1) + * wihout overflowing 31 bits: + * (2^31 - 1) = 127773 * (7^5) + 2836 + * From "Random number generators: good ones are hard to find", + * Park and Miller, Communications of the ACM, vol. 31, no. 10, + * October 1988, p. 1195. + */ + int32_t hi, lo; + + /* Can't be initialized with 0, so use another value. */ + if (x == 0) + x = 123459876; + hi = x / 127773; + lo = x % 127773; + x = 16807 * lo - 2836 * hi; + if (x < 0) + x += 0x7fffffff; + return (x); +#endif /* !USE_WEAK_SEEDING */ +} + +/* + * srandom: + * + * Initialize the random number generator based on the given seed. If the + * type is the trivial no-state-information type, just remember the seed. + * Otherwise, initializes state[] based on the given "seed" via a linear + * congruential generator. Then, the pointers are set to known locations + * that are exactly rand_sep places apart. Lastly, it cycles the state + * information a given number of times to get rid of any initial dependencies + * introduced by the L.C.R.N.G. Note that the initialization of randtbl[] + * for default usage relies on values produced by this routine. + */ +void +#ifdef __APPLE__ +srandom(unsigned int x) +#else +srandom(unsigned long x) +#endif +{ + int i, lim; + + state[0] = (uint32_t)x; + if (rand_type == TYPE_0) + lim = NSHUFF; + else { + for (i = 1; i < rand_deg; i++) + state[i] = good_rand(state[i - 1]); + fptr = &state[rand_sep]; + rptr = &state[0]; + lim = 10 * rand_deg; + } + for (i = 0; i < lim; i++) + (void)random(); +} + +/* + * srandomdev: + * + * Many programs choose the seed value in a totally predictable manner. + * This often causes problems. We seed the generator using the much more + * secure random(4) interface. Note that this particular seeding + * procedure can generate states which are impossible to reproduce by + * calling srandom() with any value, since the succeeding terms in the + * state buffer are no longer derived from the LC algorithm applied to + * a fixed seed. + */ +void +srandomdev(void) +{ + int fd, done; + size_t len; + + if (rand_type == TYPE_0) + len = sizeof state[0]; + else + len = rand_deg * sizeof state[0]; + + done = 0; + fd = _open("/dev/random", O_RDONLY | O_CLOEXEC, 0); + if (fd >= 0) { + if (_read(fd, (void *) state, len) == (ssize_t) len) + done = 1; + _close(fd); + } + + if (!done) { + struct timeval tv; + + gettimeofday(&tv, NULL); + srandom((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec); + return; + } + + if (rand_type != TYPE_0) { + fptr = &state[rand_sep]; + rptr = &state[0]; + } +} + +/* + * initstate: + * + * Initialize the state information in the given array of n bytes for future + * random number generation. Based on the number of bytes we are given, and + * the break values for the different R.N.G.'s, we choose the best (largest) + * one we can and set things up for it. srandom() is then called to + * initialize the state information. + * + * Note that on return from srandom(), we set state[-1] to be the type + * multiplexed with the current value of the rear pointer; this is so + * successive calls to initstate() won't lose this information and will be + * able to restart with setstate(). + * + * Note: the first thing we do is save the current state, if any, just like + * setstate() so that it doesn't matter when initstate is called. + * + * Returns a pointer to the old state. + * + * Note: The Sparc platform requires that arg_state begin on an int + * word boundary; otherwise a bus error will occur. Even so, lint will + * complain about mis-alignment, but you should disregard these messages. + */ +char * +#ifdef __APPLE__ +initstate(unsigned int seed, char *arg_state, size_t n) +#else +initstate(unsigned long seed, char *arg_state, long n) +#endif +{ + char *ostate = (char *)(&state[-1]); + uint32_t *int_arg_state = (uint32_t *)arg_state; + + if (rand_type == TYPE_0) + state[-1] = rand_type; + else + state[-1] = MAX_TYPES * (rptr - state) + rand_type; + if (n < BREAK_0) { + (void)fprintf(stderr, + "random: not enough state (%ld bytes); ignored.\n", n); + return (0); + } + if (n < BREAK_1) { + rand_type = TYPE_0; + rand_deg = DEG_0; + rand_sep = SEP_0; + } else if (n < BREAK_2) { + rand_type = TYPE_1; + rand_deg = DEG_1; + rand_sep = SEP_1; + } else if (n < BREAK_3) { + rand_type = TYPE_2; + rand_deg = DEG_2; + rand_sep = SEP_2; + } else if (n < BREAK_4) { + rand_type = TYPE_3; + rand_deg = DEG_3; + rand_sep = SEP_3; + } else { + rand_type = TYPE_4; + rand_deg = DEG_4; + rand_sep = SEP_4; + } + state = int_arg_state + 1; /* first location */ + end_ptr = &state[rand_deg]; /* must set end_ptr before srandom */ + srandom(seed); + if (rand_type == TYPE_0) + int_arg_state[0] = rand_type; + else + int_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type; + return (ostate); +} + +/* + * setstate: + * + * Restore the state from the given state array. + * + * Note: it is important that we also remember the locations of the pointers + * in the current state information, and restore the locations of the pointers + * from the old state information. This is done by multiplexing the pointer + * location into the zeroeth word of the state information. + * + * Note that due to the order in which things are done, it is OK to call + * setstate() with the same state as the current state. + * + * Returns a pointer to the old state information. + * + * Note: The Sparc platform requires that arg_state begin on an int + * word boundary; otherwise a bus error will occur. Even so, lint will + * complain about mis-alignment, but you should disregard these messages. + */ +char * +setstate(const char *arg_state) +{ + uint32_t *new_state = (uint32_t *)arg_state; + uint32_t type = new_state[0] % MAX_TYPES; + uint32_t rear = new_state[0] / MAX_TYPES; + char *ostate = (char *)(&state[-1]); + + if (rand_type == TYPE_0) + state[-1] = rand_type; + else + state[-1] = MAX_TYPES * (rptr - state) + rand_type; + switch(type) { + case TYPE_0: + case TYPE_1: + case TYPE_2: + case TYPE_3: + case TYPE_4: + rand_type = type; + rand_deg = degrees[type]; + rand_sep = seps[type]; + break; + default: + (void)fprintf(stderr, + "random: state info corrupted; not changed.\n"); + } + state = new_state + 1; + if (rand_type != TYPE_0) { + rptr = &state[rear]; + fptr = &state[(rear + rand_sep) % rand_deg]; + } + end_ptr = &state[rand_deg]; /* set end_ptr too */ + return (ostate); +} + +/* + * random: + * + * If we are using the trivial TYPE_0 R.N.G., just do the old linear + * congruential bit. Otherwise, we do our fancy trinomial stuff, which is + * the same in all the other cases due to all the global variables that have + * been set up. The basic operation is to add the number at the rear pointer + * into the one at the front pointer. Then both pointers are advanced to + * the next location cyclically in the table. The value returned is the sum + * generated, reduced to 31 bits by throwing away the "least random" low bit. + * + * Note: the code takes advantage of the fact that both the front and + * rear pointers can't wrap on the same call by not testing the rear + * pointer if the front one has wrapped. + * + * Returns a 31-bit random number. + */ +long +random(void) +{ + uint32_t i; + uint32_t *f, *r; + + if (rand_type == TYPE_0) { + i = state[0]; + state[0] = i = (good_rand(i)) & 0x7fffffff; + } else { + /* + * Use local variables rather than static variables for speed. + */ + f = fptr; r = rptr; + *f += *r; + i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */ + if (++f >= end_ptr) { + f = state; + ++r; + } + else if (++r >= end_ptr) { + r = state; + } + + fptr = f; rptr = r; + } + return ((long)i); +} diff --git a/stdlib/FreeBSD/reallocf.c b/stdlib/FreeBSD/reallocf.c new file mode 100644 index 0000000..a85b5a3 --- /dev/null +++ b/stdlib/FreeBSD/reallocf.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 1998, M. Warner Losh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +void * +reallocf(void *ptr, size_t size) +{ + void *nptr; + + nptr = realloc(ptr, size); + + /* + * When the System V compatibility option (malloc "V" flag) is + * in effect, realloc(ptr, 0) frees the memory and returns NULL. + * So, to avoid double free, call free() only when size != 0. + * realloc(ptr, 0) can't fail when ptr != NULL. + */ + if (!nptr && ptr && size != 0) + free(ptr); + return (nptr); +} diff --git a/stdlib/FreeBSD/realpath.3 b/stdlib/FreeBSD/realpath.3 new file mode 100644 index 0000000..740857b --- /dev/null +++ b/stdlib/FreeBSD/realpath.3 @@ -0,0 +1,160 @@ +.\" Copyright (c) 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Jan-Simon Pendry. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)realpath.3 8.2 (Berkeley) 2/16/94 +.\" $FreeBSD: src/lib/libc/stdlib/realpath.3,v 1.14 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd April 5, 2008 +.Dt REALPATH 3 +.Os +.Sh NAME +.Nm realpath +.Nd returns the canonicalized absolute pathname +.\" .Sh LIBRARY +.\" .Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft "char *" +.Fo realpath +.Fa "const char *restrict file_name" +.Fa "char *restrict resolved_name" +.Fc +.Sh DESCRIPTION +The +.Fn realpath +function resolves all symbolic links, extra +.Dq / +characters, and references to +.Pa /./ +and +.Pa /../ +in +.Fa file_name . +If the +.Fa resolved_name +argument +is non-NULL, the resulting absolute pathname is copied there (it +.Em must +refer to a buffer capable of storing at least +.Dv PATH_MAX +characters). +.Pp +As a permitted extension to the standard, if +.Fa resolved_name +is NULL, +memory is allocated for the resulting absolute pathname, and is returned by +.Fn realpath . +This memory should be freed by a call to +.Xr free 3 +when no longer needed. +.Pp +The +.Fn realpath +function will resolve both absolute and relative paths +and return the absolute pathname corresponding to +.Fa file_name . +All components of +.Fa file_name +must exist when +.Fn realpath +is called. +.Sh "RETURN VALUES" +On success, the +.Fn realpath +function returns the address of the resulting absolute pathname, which is +.Fa resolved_name +if it was non-NULL, or the address of newly allocated memory. +If an error occurs, +.Fn realpath +returns +.Dv NULL . +If +.Fa resolved_name +was non-NULL, it will +contain the pathname which caused the problem. +.Sh VARIANTS +Defining +.Dv _DARWIN_C_SOURCE +or +.Dv _DARWIN_BETTER_REALPATH +before including stdio.h will cause the provided implementation of +.Fn realpath +to use F_GETPATH from +.Xr fcntl 2 +to discover the path. +.Sh ERRORS +The function +.Fn realpath +may fail and set the external variable +.Va errno +for any of the errors specified for the library functions +.Xr alloca 3 , +.Xr getattrlist 2 , +.Xr getcwd 3 , +.Xr lstat 2 , +.Xr readlink 2 , +.Xr stat 2 , +and +.Xr strdup 3 . +.\" .Sh CAVEATS +.\" This implementation of +.\" .Fn realpath +.\" differs slightly from the Solaris implementation. +.\" The +.\" .Bx 4.4 +.\" version always returns absolute pathnames, +.\" whereas the Solaris implementation will, +.\" under certain circumstances, return a relative +.\" .Fa resolved_name +.\" when given a relative +.\" .Fa file_name . +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/param.h +is necessary. +.Sh LEGACY DESCRIPTION +In legacy mode, +the last component of +.Fa file_name +does not need to exist when +.Fn realpath +is called. +.Sh "SEE ALSO" +.Xr free 3 , +.Xr getcwd 3 , +.Xr compat 5 +.Sh HISTORY +The +.Fn realpath +function first appeared in +.Bx 4.4 . diff --git a/stdlib/FreeBSD/realpath.c b/stdlib/FreeBSD/realpath.c new file mode 100644 index 0000000..15cf79e --- /dev/null +++ b/stdlib/FreeBSD/realpath.c @@ -0,0 +1,381 @@ +/* + * Copyright (c) 2003 Constantin S. Svintsoff + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)realpath.c 8.1 (Berkeley) 2/16/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/realpath.c,v 1.20 2003/05/28 08:23:01 fjoe Exp $"); + +#include "namespace.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + + +struct attrs { + u_int32_t len; + attrreference_t name; + dev_t dev; + fsobj_type_t type; + fsobj_id_t id; + char buf[PATH_MAX]; +}; + +#ifndef BUILDING_VARIANT +__private_extern__ const struct attrlist _rp_alist = { + ATTR_BIT_MAP_COUNT, + 0, + ATTR_CMN_NAME | ATTR_CMN_DEVID | ATTR_CMN_OBJTYPE | ATTR_CMN_OBJID, + 0, + 0, + 0, + 0, +}; +#else /* BUILDING_VARIANT */ +extern const struct attrlist _rp_alist; +#endif /* BUILDING_VARIANT */ + +extern char * __private_getcwd(char *, size_t, int); + +/* + * char *realpath(const char *path, char resolved[PATH_MAX]); + * + * Find the real name of path, by removing all ".", ".." and symlink + * components. Returns (resolved) on success, or (NULL) on failure, + * in which case the path which caused trouble is left in (resolved). + */ +char * +realpath(const char *path, char inresolved[PATH_MAX]) +{ + struct attrs attrs; + struct stat sb; + char *p, *q; + size_t left_len, resolved_len, save_resolved_len, next_token_len; + unsigned symlinks; + int serrno, useattrs, islink; + ssize_t slen; + char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX]; + dev_t dev, lastdev; + struct statfs sfs; + static dev_t rootdev; + static int rootdev_inited = 0; + ino_t inode; + char *resolved; + + if (path == NULL) { + errno = EINVAL; + return (NULL); + } +#if __DARWIN_UNIX03 + if (*path == 0) { + errno = ENOENT; + return (NULL); + } +#endif /* __DARWIN_UNIX03 */ + + /* + * Extension to the standard; if inresolved == NULL, allocate memory + */ + if (!inresolved) { + if ((resolved = malloc(PATH_MAX)) == NULL) return (NULL); + } else { + resolved = inresolved; + } + if (!rootdev_inited) { + rootdev_inited = 1; + if (stat("/", &sb) < 0) { +error_return: + if (!inresolved) { + int e = errno; + free(resolved); + errno = e; + } + return (NULL); + } + rootdev = sb.st_dev; + } + serrno = errno; + symlinks = 0; + if (path[0] == '/') { + resolved[0] = '/'; + resolved[1] = '\0'; + if (path[1] == '\0') { + return (resolved); + } + resolved_len = 1; + left_len = strlcpy(left, path + 1, sizeof(left)); + } else { +#if !defined(VARIANT_DARWINEXTSN) && __DARWIN_UNIX03 + /* 4447159: don't use GETPATH, so this will fail if */ + /* if parent directories are not readable, as per POSIX */ + if (__private_getcwd(resolved, PATH_MAX, 0) == NULL) +#else /* VARIANT_DARWINEXTSN || !__DARWIN_UNIX03 */ + if (__private_getcwd(resolved, PATH_MAX, 1) == NULL) +#endif /* !VARIANT_DARWINEXTSN && __DARWIN_UNIX03 */ + { + strlcpy(resolved, ".", PATH_MAX); + goto error_return; + } + resolved_len = strlen(resolved); + left_len = strlcpy(left, path, sizeof(left)); + } + if (left_len >= sizeof(left) || resolved_len >= PATH_MAX) { + errno = ENAMETOOLONG; + goto error_return; + } + if (resolved_len > 1) { + if (stat(resolved, &sb) < 0) { + goto error_return; + } + lastdev = sb.st_dev; + } else + lastdev = rootdev; + + /* + * Iterate over path components in `left'. + */ + while (left_len != 0) { + /* + * Extract the next path component and adjust `left' + * and its length. + */ + p = strchr(left, '/'); + next_token_len = p ? p - left : left_len; + memcpy(next_token, left, next_token_len); + next_token[next_token_len] = '\0'; + + if (p != NULL) { + left_len -= next_token_len + 1; + memmove(left, p + 1, left_len + 1); + } else { + left[0] = '\0'; + left_len = 0; + } + + if (resolved[resolved_len - 1] != '/') { + if (resolved_len + 1 >= PATH_MAX) { + errno = ENAMETOOLONG; + goto error_return; + } + resolved[resolved_len++] = '/'; + resolved[resolved_len] = '\0'; + } + if (next_token[0] == '\0') { + /* Handle consequential slashes. */ + continue; + } else if (strcmp(next_token, ".") == 0) { + continue; + } else if (strcmp(next_token, "..") == 0) { + /* + * Strip the last path component except when we have + * single "/" + */ + if (resolved_len > 1) { + resolved[resolved_len - 1] = '\0'; + q = strrchr(resolved, '/') + 1; + *q = '\0'; + resolved_len = q - resolved; + } + continue; + } + + /* + * Save resolved_len, so that we can later null out + * the the appended next_token, and replace with the + * real name (matters on case-insensitive filesystems). + */ + save_resolved_len = resolved_len; + + /* + * Append the next path component and lstat() it. If + * lstat() fails we still can return successfully if + * there are no more path components left. + */ + resolved_len = strlcat(resolved, next_token, PATH_MAX); + if (resolved_len >= PATH_MAX) { + errno = ENAMETOOLONG; + goto error_return; + } + if (getattrlist(resolved, (void *)&_rp_alist, &attrs, sizeof(attrs), FSOPT_NOFOLLOW) == 0) { + useattrs = 1; + islink = (attrs.type == VLNK); + dev = attrs.dev; + inode = attrs.id.fid_objno; + } else if (errno == ENOTSUP || errno == EINVAL) { + if ((useattrs = lstat(resolved, &sb)) == 0) { + islink = S_ISLNK(sb.st_mode); + dev = sb.st_dev; + inode = sb.st_ino; + } + } else + useattrs = -1; + if (useattrs < 0) { +#if !__DARWIN_UNIX03 + if (errno == ENOENT && p == NULL) { + errno = serrno; + return (resolved); + } +#endif /* !__DARWIN_UNIX03 */ + goto error_return; + } + if (dev != lastdev) { + /* + * We have crossed a mountpoint. For volumes like UDF + * the getattrlist name may not match the actual + * mountpoint, so we just copy the mountpoint directly. + * (3703138). However, the mountpoint may not be + * accessible, as when chroot-ed, so check first. + * There may be a file on the chroot-ed volume with + * the same name as the mountpoint, so compare device + * and inode numbers. + */ + lastdev = dev; + if (statfs(resolved, &sfs) == 0 && lstat(sfs.f_mntonname, &sb) == 0 && dev == sb.st_dev && inode == sb.st_ino) { + /* + * However, it's possible that the mountpoint + * path matches, even though it isn't the real + * path in the chroot-ed environment, so check + * that each component of the mountpoint + * is a directory (and not a symlink) + */ + char temp[sizeof(sfs.f_mntonname)]; + char *cp; + int ok = 1; + + strcpy(temp, sfs.f_mntonname); + for(;;) { + if ((cp = strrchr(temp, '/')) == NULL) { + ok = 0; + break; + } + if (cp <= temp) + break; + *cp = 0; + if (lstat(temp, &sb) < 0 || (sb.st_mode & S_IFMT) != S_IFDIR) { + ok = 0; + break; + } + } + if (ok) { + resolved_len = strlcpy(resolved, sfs.f_mntonname, PATH_MAX); + continue; + } + } + /* if we fail, use the other methods. */ + } + if (islink) { + if (symlinks++ > MAXSYMLINKS) { + errno = ELOOP; + goto error_return; + } + slen = readlink(resolved, symlink, sizeof(symlink)); + if (slen <= 0 || slen >= sizeof(symlink)) { + if (slen < 0) + ; /* keep errno from readlink(2) call */ + else if (slen == 0) + errno = ENOENT; + else + errno = ENAMETOOLONG; + goto error_return; + } + symlink[slen] = '\0'; + if (symlink[0] == '/') { + resolved[1] = 0; + resolved_len = 1; + lastdev = rootdev; + } else { + /* Strip the last path component. */ + q = strrchr(resolved, '/') + 1; + *q = '\0'; + resolved_len = q - resolved; + } + + /* + * If there are any path components left, then + * append them to symlink. The result is placed + * in `left'. + */ + if (p != NULL) { + if (symlink[slen - 1] != '/') { + if (slen + 1 >= sizeof(symlink)) { + errno = ENAMETOOLONG; + goto error_return; + } + symlink[slen] = '/'; + symlink[slen + 1] = 0; + } + left_len = strlcat(symlink, left, sizeof(symlink)); + if (left_len >= sizeof(symlink)) { + errno = ENAMETOOLONG; + goto error_return; + } + } + left_len = strlcpy(left, symlink, sizeof(left)); + } else if (useattrs) { + /* + * attrs already has the real name. + */ + + resolved[save_resolved_len] = '\0'; + resolved_len = strlcat(resolved, (const char *)&attrs.name + attrs.name.attr_dataoffset, PATH_MAX); + if (resolved_len >= PATH_MAX) { + errno = ENAMETOOLONG; + goto error_return; + } + } + /* + * For the case of useattrs == 0, we could scan the directory + * and try to match the inode. There are many problems with + * this: (1) the directory may not be readable, (2) for multiple + * hard links, we would find the first, but not necessarily + * the one specified in the path, (3) we can't try to do + * a case-insensitive search to match the right one in (2), + * because the underlying filesystem may do things like + * decompose composed characters. For most cases, doing + * nothing is the right thing when useattrs == 0, so we punt + * for now. + */ + } + + /* + * Remove trailing slash except when the resolved pathname + * is a single "/". + */ + if (resolved_len > 1 && resolved[resolved_len - 1] == '/') + resolved[resolved_len - 1] = '\0'; + return (resolved); +} diff --git a/stdlib/FreeBSD/remque.c b/stdlib/FreeBSD/remque.c new file mode 100644 index 0000000..068a75f --- /dev/null +++ b/stdlib/FreeBSD/remque.c @@ -0,0 +1,30 @@ +/* + * Initial implementation: + * Copyright (c) 2002 Robert Drehmel + * All rights reserved. + * + * As long as the above copyright statement and this notice remain + * unchanged, you can do what ever you want with this file. + */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/remque.c,v 1.3 2003/01/04 07:34:41 tjr Exp $"); + +#define _SEARCH_PRIVATE +#include +#include /* for NULL */ + +void +remque(void *element) +{ + struct que_elem *prev, *next, *elem; + + elem = (struct que_elem *)element; + + prev = elem->prev; + next = elem->next; + + if (prev != NULL) + prev->next = next; + if (next != NULL) + next->prev = prev; +} diff --git a/stdlib/FreeBSD/setenv.c b/stdlib/FreeBSD/setenv.c new file mode 100644 index 0000000..7f08fca --- /dev/null +++ b/stdlib/FreeBSD/setenv.c @@ -0,0 +1,529 @@ +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setenv.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/setenv.c,v 1.14 2007/05/01 16:02:41 ache Exp $"); + +#include +#include +#include +#include +#include +#include +#include + +struct owned_ptr; +extern char *__findenv_locked(const char *, int *, char **); +extern int __setenv_locked(const char *, const char *, int, int, char ***, struct owned_ptr *); +extern void __unsetenv_locked(const char *, char **, struct owned_ptr *); + +extern void __environ_lock(void); +extern void __environ_unlock(void); + +extern struct owned_ptr *__env_owned; +extern int __init__env_owned_locked(int); + +/* + * _cthread_init_routine used to be called from crt1.o to initialize threads. + * This is no longer needed, as initialization happens in dylib initializers, + * but is provided to maintain backwards compatibility. Normally, for 10.5 + * or greater, _cthread_init_routine does nothing. + * + * Before 10.5, the _start routine in crt1.o clobbers environ with the original + * stack value, which effectively undoes any environment changes made in + * initializers. When LEGACY_CRT1_ENVIRON is defined, we replace the + * do-nothing routine with one that attempts to restore the environ value. + * But this only works if the setenv (and family) routines were used + * exclusively, (no direct manipulation of environ). Note that according to + * SUSv3, direct manipulation of environ may result in undefined behavior in + * setenv and family, so we don't support that (on less than 10.5). + */ +#ifdef BUILDING_VARIANT +# ifdef LEGACY_CRT1_ENVIRON +extern char **_saved_environ; +# endif /* LEGACY_CRT1_ENVIRON */ +#else /* !BUILDING_VARIANT */ +# ifdef LEGACY_CRT1_ENVIRON +__private_extern__ char **_saved_environ = NULL; + +static int +_legacy_crt1_environ(void) +{ + if (_saved_environ) *_NSGetEnviron() = _saved_environ; + return 0; +} +int (*_cthread_init_routine)(void) = _legacy_crt1_environ; + +# else /* !LEGACY_CRT1_ENVIRON */ +static int _do_nothing(void) { return 0; } +int (*_cthread_init_routine)(void) = _do_nothing; +# endif /* !LEGACY_CRT1_ENVIRON */ + +__private_extern__ struct owned_ptr *__env_owned = NULL; + +/* + * The owned_ptr structure is a table of pointers that we own, and can + * realloc/free as we choose. table[0] is always NULL, so it is always + * less that any real pointer. "used" is the number of table entries in use + * (including the initial NULL), while "size" is the allocated size of the + * table (used to enlarge the size of the table when needed). + */ +struct owned_ptr { + const void **table; + int used; + int size; +}; + +#define OWNED_PTR_INITIAL_SIZE 8 + +__private_extern__ int _owned_ptr_search(struct owned_ptr * __restrict, const void * __restrict, int * __restrict); + +__private_extern__ void +_owned_ptr_add(struct owned_ptr * __restrict owned, const void * __restrict ptr) +{ + int index; + + if (_owned_ptr_search(owned, ptr, &index) == 0) return; /* already there */ + if (owned->used >= owned->size) { + int new_size = 2 * owned->size; + const void **new_table = (const void **)realloc(owned->table, + new_size * sizeof(const void *)); + if (!new_table) { + /* no memory to enlarge the table, so just drop */ + return; + } + owned->table = new_table; + owned->size = new_size; + } + memmove(owned->table + index + 2, owned->table + index + 1, + sizeof(void *) * (owned->used - index - 1)); + owned->table[index + 1] = ptr; + owned->used++; +} + +__private_extern__ struct owned_ptr * +_owned_ptr_alloc(void) +{ + struct owned_ptr *owned; + + owned = (struct owned_ptr *)malloc(sizeof(struct owned_ptr)); + if (!owned) return NULL; + owned->table = (const void **)malloc(OWNED_PTR_INITIAL_SIZE * + sizeof(const void *)); + if (!owned->table) { + int save = errno; + free(owned); + errno = save; + return NULL; + } + owned->table[0] = NULL; + owned->used = 1; + owned->size = OWNED_PTR_INITIAL_SIZE; + return owned; +} + +__private_extern__ void +_owned_ptr_delete(struct owned_ptr *owned, int index) +{ + if (!index || index >= owned->used) return; + memmove(owned->table + index, owned->table + index + 1, + sizeof(void *) * (owned->used - index - 1)); + owned->used--; +} + +__private_extern__ void +_owned_ptr_free(struct owned_ptr *owned) +{ + free(owned->table); + free(owned); +} + +/* + * Search owned->table for "ptr". Zero is returned if found, non-zero means + * not found. If "result" is non-NULL, the found index is returned in it, or + * if not found, the index of the immediate lower value (ptr can be inserted + * after this index). + */ +__private_extern__ int +_owned_ptr_search(struct owned_ptr * __restrict owned, const void * __restrict ptr, int * __restrict result) +{ + int low = 0; + int high = owned->used - 1; + int cur; + + if (owned->table[high] < ptr) { + if (result) *result = high; + return -1; + } else if (owned->table[high] == ptr) { + if (result) *result = high; + return 0; + } + while (high - low > 1) { + cur = (low + high) / 2; + if (ptr > owned->table[cur]) { + low = cur; + } else if (ptr < owned->table[cur]) { + high = cur; + } else { + /* match found */ + if (result) *result = cur; + return 0; + } + } + /* no match found; *result will be the insert-after position */ + if (result) *result = low; + return -1; +} + +/* + * Initialize the process's __env_owned structure + */ +__private_extern__ int +__init__env_owned_locked(int should_set_errno) +{ + int save; + + if (__env_owned) return 0; + + if (!should_set_errno) + save = errno; + __env_owned = _owned_ptr_alloc(); + if (!__env_owned) { + if (!should_set_errno) + errno = save; + return -1; + } + return 0; +} + +/* + * The copy flag may have 3 values: + * 1 - make a copy of the name/value pair + * 0 - take the name as a user-supplied name=value string + * -1 - like 0, except we copy of the name=value string in name + */ +__private_extern__ int +__setenv_locked(name, value, rewrite, copy, environp, owned) + const char *name; + const char *value; + int rewrite, copy; + char ***environp; + struct owned_ptr *owned; +{ + char *c; + int offset; + int oindex; + + if ((c = __findenv_locked(name, &offset, *environp))) { /* find if already exists */ + char *e; + if (!rewrite) + return (0); + /* + * In UNIX03, we can overwrite only if we allocated the + * string. Then we can realloc it if it is too small. + */ + e = (*environp)[offset]; + if (_owned_ptr_search(owned, e, &oindex) == 0) { + if (copy > 0) { + size_t l_value = strlen(value); + if (strlen(c) < l_value) { /* old smaller; resize*/ + char *r; + size_t len = c - e; + if ((r = realloc(e, l_value + len + 1)) == NULL) + return (-1); + if (r != e) { + (*environp)[offset] = r; + c = r + len; + _owned_ptr_delete(owned, oindex); + _owned_ptr_add(owned, r); + } + } + while ( (*c++ = *value++) ); + return (0); + } + /* Free up the slot for later use (putenv) */ + _owned_ptr_delete(owned, oindex); + free(e); + } + } else { /* create new slot */ + int cnt; + char **p; + + for (p = *environp, cnt = 0; *p; ++p, ++cnt); + if (_owned_ptr_search(owned, *environp, &oindex) == 0) { /* just increase size */ + p = (char **)realloc((char *)*environp, + (size_t)(sizeof(char *) * (cnt + 2))); + if (!p) + return (-1); + if (*environp != p) { + _owned_ptr_delete(owned, oindex); + _owned_ptr_add(owned, p); + *environp = p; + } + } + else { /* get new space */ + /* copy old entries into it */ + p = malloc((size_t)(sizeof(char *) * (cnt + 2))); + if (!p) + return (-1); + _owned_ptr_add(owned, p); + bcopy(*environp, p, cnt * sizeof(char *)); + *environp = p; + } + (*environp)[cnt + 1] = NULL; + offset = cnt; + } + /* For non Unix03, or UnixO3 setenv(), we make a copy of the user's + * strings. For Unix03 putenv(), we put the string directly in + * the environment. */ + if (copy > 0) { + for (c = (char *)name; *c && *c != '='; ++c); /* no `=' in name */ + if (!((*environp)[offset] = /* name + `=' + value */ + malloc((size_t)((int)(c - name) + strlen(value) + 2)))) + return (-1); + _owned_ptr_add(owned, (*environp)[offset]); + for (c = (*environp)[offset]; (*c = *name++) && *c != '='; ++c); + for (*c++ = '='; (*c++ = *value++); ); + } else { + /* the legacy behavior copies the string */ + if (copy < 0) { + size_t len = strlen(name); + if((c = malloc(len + 1)) == NULL) + return (-1); + _owned_ptr_add(owned, c); + memcpy(c, name, len + 1); + name = c; + } + (*environp)[offset] = (char *)name; + } + return (0); +} + +__private_extern__ void +__unsetenv_locked(const char *name, char **environ, struct owned_ptr *owned) +{ + char **p; + int offset; + int oindex; + + while (__findenv_locked(name, &offset, environ)) { /* if set multiple times */ + /* if we malloc-ed it, free it first */ + if (_owned_ptr_search(owned, environ[offset], &oindex) == 0) { + _owned_ptr_delete(owned, oindex); + free(environ[offset]); + } + for (p = &environ[offset];; ++p) + if (!(*p = *(p + 1))) + break; + } +} + +/****************************************************************************/ +/* + * _allocenvstate -- SPI that creates a new state (opaque) + */ +void * +_allocenvstate(void) +{ + return _owned_ptr_alloc(); +} + +/* + * _copyenv -- SPI that copies a NULL-tereminated char * array in a newly + * allocated buffer, compatible with the other SPI env routines. If env + * is NULL, a char * array composed of a single NULL is returned. NULL + * is returned on error. (This isn't needed anymore, as __setenv_locked will + * automatically make a copy.) + */ +char ** +_copyenv(char **env) +{ + char **p; + int cnt = 1; + + if (env) + for (p = env; *p; ++p, ++cnt); + p = (char **)malloc((size_t)(sizeof(char *) * cnt)); + if (!p) + return (NULL); + if (env) + bcopy(env, p, cnt * sizeof(char *)); + else + *p = NULL; + return p; +} + +/* + * _deallocenvstate -- SPI that frees all the memory associated with the state + * and all allocated strings, including the environment array itself if it + * was copied. + */ +int +_deallocenvstate(void *state) +{ + struct owned_ptr *owned; + + if (!(owned = (struct owned_ptr *)state) || owned == __env_owned) { + errno = EINVAL; + return -1; + } + _owned_ptr_free(owned); + return 0; +} + +/* + * setenvp -- SPI using an arbitrary pointer to string array and an env state, + * created by _allocenvstate(). Initial checking is not done. + * + * Set the value of the environmental variable "name" to be + * "value". If rewrite is set, replace any current value. + */ +int +_setenvp(const char *name, const char *value, int rewrite, char ***envp, void *state) +{ + __environ_lock(); + if (__init__env_owned_locked(1)) { + __environ_unlock(); + return (-1); + } + int ret = __setenv_locked(name, value, rewrite, 1, envp, + (state ? (struct owned_ptr *)state : __env_owned)); + __environ_unlock(); + return ret; +} + +/* + * unsetenv(name) -- SPI using an arbitrary pointer to string array and an env + * state, created by _allocenvstate(). Initial checking is not done. + * + * Delete environmental variable "name". + */ +int +_unsetenvp(const char *name, char ***envp, void *state) +{ + __environ_lock(); + if (__init__env_owned_locked(1)) { + __environ_unlock(); + return (-1); + } + __unsetenv_locked(name, *envp, (state ? (struct owned_ptr *)state : __env_owned)); + __environ_unlock(); + return 0; +} + +#endif /* !BUILD_VARIANT */ + +/* + * setenv -- + * Set the value of the environmental variable "name" to be + * "value". If rewrite is set, replace any current value. + */ +int +setenv(name, value, rewrite) + const char *name; + const char *value; + int rewrite; +{ + int ret; + + /* no null ptr or empty str */ + if(name == NULL || *name == 0) { + errno = EINVAL; + return (-1); + } + +#if __DARWIN_UNIX03 + /* no '=' in name */ + if (strchr(name, '=')) { + errno = EINVAL; + return (-1); + } +#endif /* __DARWIN_UNIX03 */ + + __environ_lock(); + if (__init__env_owned_locked(1)) { + __environ_unlock(); + return (-1); + } + ret = __setenv_locked(name, value, rewrite, 1, _NSGetEnviron(), __env_owned); +#ifdef LEGACY_CRT1_ENVIRON + _saved_environ = *_NSGetEnviron(); +#endif /* !LEGACY_CRT1_ENVIRON */ + __environ_unlock(); + + return ret; +} + +static inline __attribute__((always_inline)) int +_unsetenv(const char *name, int should_set_errno) +{ + __environ_lock(); + if (__init__env_owned_locked(should_set_errno)) { + __environ_unlock(); + return (-1); + } + __unsetenv_locked(name, *_NSGetEnviron(), __env_owned); + __environ_unlock(); + return 0; +} + +/* + * unsetenv(name) -- + * Delete environmental variable "name". + */ +#if __DARWIN_UNIX03 +int +unsetenv(const char *name) +{ + /* no null ptr or empty str */ + if(name == NULL || *name == 0) { + errno = EINVAL; + return (-1); + } + + /* no '=' in name */ + if (strchr(name, '=')) { + errno = EINVAL; + return (-1); + } + return _unsetenv(name, 1); +} +#else /* !__DARWIN_UNIX03 */ +void +unsetenv(const char *name) +{ + /* no null ptr or empty str */ + if(name == NULL || *name == 0) + return; + _unsetenv(name, 0); +} +#endif /* __DARWIN_UNIX03 */ diff --git a/stdlib/FreeBSD/strhash.c b/stdlib/FreeBSD/strhash.c new file mode 100644 index 0000000..1d361b6 --- /dev/null +++ b/stdlib/FreeBSD/strhash.c @@ -0,0 +1,410 @@ +/* + * + * Copyright 1990 + * Terry Jones & Jordan Hubbard + * + * PCS Computer Systeme, GmbH. + * Munich, West Germany + * + * + * All rights reserved. + * + * This is unsupported software and is subject to change without notice. + * the author makes no representations about the suitability of this software + * for any purpose. It is supplied "as is" without express or implied + * warranty. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of the author not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. + * + */ + +/* + * This is a fairly simple open addressing hash scheme. + * Terry did all the code, I just did the spec. + * Thanks again, you crazy Aussie.. + * + */ + +/* + * $Log: strhash.c,v $ + * Revision 2.0 90/03/26 01:44:26 jkh + * pre-beta check-in + * + * Revision 1.8 90/03/09 19:22:35 jkh + * Fixed bogus comment. + * + * Revision 1.7 90/03/09 19:01:08 jkh + * Added comments, GPL. + * + * Revision 1.6 90/03/08 17:55:58 terry + * Rearranged hash_purge to be a tiny bit more efficient. + * Added verbose option to hash_stats. + * + * Revision 1.5 90/03/08 17:19:54 terry + * Added hash_purge. Added arg to hash_traverse. Changed all + * void * to Generic. + * + * Revision 1.4 90/03/08 12:02:35 terry + * Fixed problems with allocation that I screwed up last night. + * Changed bucket lists to be singly linked. Thanks to JKH, my hero. + * + * Revision 1.3 90/03/07 21:33:33 terry + * Cleaned up a few decls to keep gcc -Wall quiet. + * + * Revision 1.2 90/03/07 21:14:53 terry + * Comments. Added HASH_STATS define. Removed hash_find() + * and new_node(). + * + * Revision 1.1 90/03/07 20:49:45 terry + * Initial revision + * + * + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strhash.c,v 1.10 2002/03/22 21:53:10 obrien Exp $"); + +#include +#include +#include +#include +#include + +#define HASH_NULL (hash_table *)0 +#define NODE_NULL (hash_node *)0 +#define GENERIC_NULL (void *)0 + +#define HASH_SZ 97 + + +static int _hash(int size, char *key); +static hash_node *list_find(caddr_t key, hash_node *head); +static int assign_key(char *key, hash_node *node); + + +/* + * hash_create() + * + * Malloc room for a new hash table and then room for its + * bucket pointers. Then set all the buckets to + * point to 0. Return the address of the new table. + */ +hash_table * +hash_create(int size) +{ + int i; + hash_table *new = (hash_table *)malloc(sizeof(hash_table)); + + if (!new || size < 0){ + return HASH_NULL; + } + + if (size == 0){ + size = HASH_SZ; + } + + if (!(new->buckets = (hash_node **)malloc(size * sizeof(hash_node *)))){ + return HASH_NULL; + } + + for (i = 0; i < size; i++){ + new->buckets[i] = NODE_NULL; + } + new->size = size; + + return new; +} + + +/* + * list_find() + * + * Find the key in the linked list pointed to by head. + */ +static hash_node * +list_find(caddr_t key, hash_node *head) +{ + while (head){ + if (!strcmp(head->key, key)){ + return head; + } + head = head->next; + } + return NODE_NULL; +} + + +/* + * _hash() + * + * Compute the hash value for the given key. + */ +static int +_hash(int size, char *key) +{ + unsigned int h = 0x0; + + while (*key){ + h = (h << 1) ^ (h ^ (unsigned char) *key++); + } + + h %= size; + return h; +} + +/* + * hash_destroy() + * + * Find the key and (if it's there) remove it entirely. + * The function (*nukefunc)() is in charge of disposing + * of the storage help by the data associated with the node. + */ +void +hash_destroy(hash_table *table, char *key, void (*nukefunc)()) +{ + int bucket = _hash(table->size, key); + hash_node *found = table->buckets[bucket]; + hash_node *to_free = NODE_NULL; + + if (!found) { + return; + } + + if (!strcmp(found->key, key)) { + /* + * It was the head of the list. + */ + table->buckets[bucket] = found->next; + to_free = found; + } + else { + /* + * Walk the list, looking one ahead. + */ + while (found->next) { + if (!strcmp(found->next->key, key)) { + to_free = found->next; + found->next = found->next->next; + break; + } + found = found->next; + } + + if (!to_free){ + return; + } + } + + if (nukefunc) + (*nukefunc)(to_free->key, to_free->data); + free(to_free); + return; +} + + +/* + * hash_search() + * + * Search the table for the given key. Then: + * + * 1) If you find it and there is no replacement function, just + * return what you found. (This is a simple search). + * 2) If you find it and there is a replacement function, run + * the function on the data you found, and replace the old + * data with whatever is passed in datum. Return 0. + * 3) If you don't find it and there is some datum, insert a + * new item into the table. Insertions go at the front of + * the bucket. Return 0. + * 4) Otherwise just return 0. + * + */ +void * +hash_search(hash_table *table, caddr_t key, void *datum, + void (*replace_func)()) +{ + int bucket = _hash(table->size, key); + hash_node *found = list_find(key, table->buckets[bucket]); + + if (found){ + if (!replace_func){ + return found->data; + } + else{ + (*replace_func)(found->data); + found->data = datum; + } + } + else{ + if (datum){ + + hash_node *new = (hash_node *)malloc(sizeof(hash_node)); + + if (!new || !assign_key(key, new)){ + return GENERIC_NULL; + } + new->data = datum; + new->next = table->buckets[bucket]; + table->buckets[bucket] = new; + return new; + } + } + return GENERIC_NULL; +} + + +/* + * assign_key() + * + * Set the key value of a node to be 'key'. Get some space from + * malloc and copy it in etc. Return 1 if all is well, 0 otherwise. + */ +static int +assign_key(char *key, hash_node *node) +{ + if (!node || !key){ + return 0; + } + + if (!(node->key = (char *)malloc(strlen(key) + 1))){ + return 0; + } + + node->key[0] = '\0'; + strcat(node->key, key); + return 1; +} + +/* + * hash_traverse() + * + * Traverse the hash table and run the function func on the + * data found at each node and the argument we're passed for it. + */ +void +hash_traverse(hash_table *table, int (*func)(), void *arg) +{ + int i; + int size = table->size; + + if (!func) + return; + + for (i = 0; i < size; i++) { + hash_node *n = table->buckets[i]; + while (n) { + if ((*func)(n->key, n->data, arg) == 0) + return; + n = n->next; + } + } + return; +} + +/* + * hash_purge() + * + * Run through the entire hash table. Call purge_func + * on the data found at each node, and then free the node. + * Set all the bucket pointers to 0. + */ +void +hash_purge(hash_table *table, void (*purge_func)(char *p1, void *p2)) +{ + int i; + int size = table->size; + + for (i = 0; i < size; i++) { + hash_node *n = table->buckets[i]; + if (n) { + do { + hash_node *to_free = n; + if (purge_func) { + (*purge_func)(n->key, n->data); + } + n = n->next; + free(to_free); + } while (n); + table->buckets[i] = NODE_NULL; + } + } +} + +#undef min +#define min(a, b) (a) < (b) ? (a) : (b) + +/* + * hash_stats() + * + * Print statistics about the current table allocation to stdout. + */ +void +hash_stats(hash_table *table, int verbose) +{ + int i; + int total_elements = 0; + int non_empty_buckets = 0; + int max_count = 0; + int max_repeats = 0; + int *counts; + int size = table->size; + + if (!(counts = (int *)malloc(size * sizeof(int)))){ + fprintf(stderr, "malloc returns 0\n"); + exit(1); + } + + for (i = 0; i < size; i++){ + int x = 0; + hash_node *n = table->buckets[i]; + counts[i] = 0; + while (n){ + if (!x){ + x = 1; + non_empty_buckets++; + if (verbose){ + printf("bucket %2d: ", i); + } + } + if (verbose){ + printf(" %s", n->key); + } + counts[i]++; + n = n->next; + } + + total_elements += counts[i]; + if (counts[i] > max_count){ + max_count = counts[i]; + max_repeats = 1; + } + else if (counts[i] == max_count){ + max_repeats++; + } + + if (counts[i] && verbose){ + printf(" (%d)\n", counts[i]); + } + } + + printf("\n"); + printf("%d element%s in storage.\n", total_elements, total_elements == 1 ? "" : "s"); + + if (total_elements){ + printf("%d of %d (%.2f%%) buckets are in use\n", non_empty_buckets, size, + (double)100 * (double)non_empty_buckets / (double)(size)); + printf("the maximum number of elements in a bucket is %d (%d times)\n", max_count, max_repeats); + printf("average per bucket is %f\n", (double)total_elements / (double)non_empty_buckets); + printf("optimal would be %f\n", (double)total_elements / (double)(min(size, total_elements))); + } + return; +} +#pragma clang diagnostic pop diff --git a/stdlib/FreeBSD/strtod.3 b/stdlib/FreeBSD/strtod.3 new file mode 100644 index 0000000..463553d --- /dev/null +++ b/stdlib/FreeBSD/strtod.3 @@ -0,0 +1,216 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strtod.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/strtod.3,v 1.22 2007/12/16 21:19:28 das Exp $ +.\" +.Dd March 2, 2003 +.Dt STRTOD 3 +.Os +.Sh NAME +.Nm strtod , strtof , strtold +.Nd convert +.Tn ASCII +string to floating point +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft double +.Fo strtod +.Fa "const char *restrict nptr" +.Fa "char **restrict endptr" +.Fc +.Ft float +.Fo strtof +.Fa "const char *restrict nptr" +.Fa "char **restrict endptr" +.Fc +.Ft "long double" +.Fo strtold +.Fa "const char *restrict nptr" +.Fa "char **restrict endptr" +.Fc +.Sh DESCRIPTION +These conversion +functions convert the initial portion of the string +pointed to by +.Fa nptr +to +.Vt double , +.Vt float , +and +.Vt "long double" +representation, respectively. +.Pp +The expected form of the string +is an optional plus (``+'') or minus (``\-'') sign, +followed by either: +.Bl -bullet +.It +a decimal significand, consisting of a sequence of decimal digits +(optionally containing a decimal-point character) or +.It +a hexadecimal significand, consisting of a ``0X'' or ``0x'' followed +by a sequence of hexadecimal digits +(optionally containing a decimal-point character). +.El +.Pp +In both cases, the significand may be optionally followed by an +exponent. +An exponent consists of an ``E'' or ``e'' (for decimal +constants) or a ``P'' or ``p'' (for hexadecimal constants), +followed by an optional plus or minus sign, followed by a +sequence of decimal digits. +For decimal constants, the exponent indicates the power of 10 by +which the significand should be scaled. +For hexadecimal constants, the scaling is instead done by powers +of 2. +.Pp +Alternatively, if the portion of the string following the optional +plus or minus sign begins with +.Dq INFINITY +or +.Dq NAN , +ignoring case, it is interpreted as an infinity or a quiet \*(Na, +respectively. +The syntax +.Dq Xo Pf NAN( Ar "s" ) Xc , +where +.Ar s +is an alphanumeric string, produces the same value as the call +.Fo nan +.Qq Ar s Ns +.Fc +(respectively, +.Fo nanf +.Qq Ar s Ns +.Fc +and +.Fo nanl +.Qq Ar s Ns +.Fc . ) +.Pp +In any of the above cases, leading white-space characters in the +string (as defined by the +.Xr isspace 3 +function) are skipped. +The decimal point +character is defined in the program's locale (category +.Dv LC_NUMERIC ) . +.Pp +Extended locale versions of these functions are documented in +.Xr strtod_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn strtod , +.Fn strtof , +and +.Fn strtold +functions return the converted value, if any. +.Pp +If +.Fa endptr +is not +.Dv NULL , +a pointer to the character after the last character used +in the conversion is stored in the location referenced by +.Fa endptr . +.Pp +If no conversion is performed, zero is returned and the value of +.Fa nptr +is stored in the location referenced by +.Fa endptr . +.Pp +If the correct value would cause overflow, plus or minus +.Dv HUGE_VAL , +.Dv HUGE_VALF , +or +.Dv HUGE_VALL +is returned (according to the sign and type of the return value), and +.Er ERANGE +is stored in +.Va errno . +If the correct value would cause underflow, zero is +returned and +.Er ERANGE +is stored in +.Va errno . +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er ERANGE +Overflow or underflow occurred. +.El +.Sh SEE ALSO +.Xr atof 3 , +.Xr atoi 3 , +.Xr atol 3 , +.Xr nan 3 , +.Xr strtod_l 3 , +.Xr strtol 3 , +.Xr strtoul 3 , +.Xr wcstod 3 +.Sh STANDARDS +The +.Fn strtod +function +conforms to +.St -isoC-99 . +.Sh AUTHORS +The author of this software is +.An David M. Gay . +.Pp +.Bd -literal +Copyright (c) 1998 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +.Ed diff --git a/stdlib/FreeBSD/strtoimax.c b/stdlib/FreeBSD/strtoimax.c new file mode 100644 index 0000000..0c4c994 --- /dev/null +++ b/stdlib/FreeBSD/strtoimax.c @@ -0,0 +1,150 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "from @(#)strtol.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoimax.c,v 1.12 2007/01/09 00:28:10 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include + +/* + * Convert a string to an intmax_t integer. + * + * Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +intmax_t +strtoimax_l(const char * __restrict nptr, char ** __restrict endptr, int base, + locale_t loc) +{ + const char *s; + uintmax_t acc; + char c; + uintmax_t cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + s = nptr; + do { + c = *s++; + } while (isspace_l((unsigned char)c, loc)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X') && + ((s[1] >= '0' && s[1] <= '9') || + (s[1] >= 'A' && s[1] <= 'F') || + (s[1] >= 'a' && s[1] <= 'f'))) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + /* + * Compute the cutoff value between legal numbers and illegal + * numbers. That is the largest legal value, divided by the + * base. An input number that is greater than this value, if + * followed by a legal input character, is too big. One that + * is equal to this value may be valid or not; the limit + * between valid and invalid numbers is then based on the last + * digit. For instance, if the range for intmax_t is + * [-9223372036854775808..9223372036854775807] and the input base + * is 10, cutoff will be set to 922337203685477580 and cutlim to + * either 7 (neg==0) or 8 (neg==1), meaning that if we have + * accumulated a value > 922337203685477580, or equal but the + * next digit is > 7 (or 8), the number is too big, and we will + * return a range error. + * + * Set 'any' if any `digits' consumed; make it negative to indicate + * overflow. + */ + cutoff = neg ? (uintmax_t)-(INTMAX_MIN + INTMAX_MAX) + INTMAX_MAX + : INTMAX_MAX; + cutlim = cutoff % base; + cutoff /= base; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? INTMAX_MIN : INTMAX_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + +intmax_t +strtoimax(const char * __restrict nptr, char ** __restrict endptr, int base) +{ + return strtoimax_l(nptr, endptr, base, __current_locale()); +} diff --git a/stdlib/FreeBSD/strtol.3 b/stdlib/FreeBSD/strtol.3 new file mode 100644 index 0000000..6a6c99e --- /dev/null +++ b/stdlib/FreeBSD/strtol.3 @@ -0,0 +1,257 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strtol.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/strtol.3,v 1.23 2007/04/10 11:17:00 ru Exp $ +.\" +.Dd November 28, 2001 +.Dt STRTOL 3 +.Os +.Sh NAME +.Nm strtoimax , +.Nm strtol , +.Nm strtoll , +.Nm strtoq +.Nd "convert a string value to a" +.Vt long , "long long" , intmax_t +or +.Vt quad_t +integer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In inttypes.h +.Ft intmax_t +.Fo strtoimax +.Fa "const char *restrict str" +.Fa "char **restrict endptr" +.Fa "int base" +.Fc +.In stdlib.h +.Ft long +.Fo strtol +.Fa "const char *restrict str" +.Fa "char **restrict endptr" +.Fa "int base" +.Fc +.Ft long long +.Fo strtoll +.Fa "const char *restrict str" +.Fa "char **restrict endptr" +.Fa "int base" +.Fc +.In sys/types.h +.In stdlib.h +.In limits.h +.Ft quad_t +.Fo strtoq +.Fa "const char *str" +.Fa "char **endptr" +.Fa "int base" +.Fc +.Sh DESCRIPTION +The +.Fn strtol +function +converts the string in +.Fa str +to a +.Vt long +value. +The +.Fn strtoll +function +converts the string in +.Fa str +to a +.Vt "long long" +value. +The +.Fn strtoimax +function +converts the string in +.Fa str +to an +.Vt intmax_t +value. +The +.Fn strtoq +function +converts the string in +.Fa str +to a +.Vt quad_t +value. +The conversion is done according to the given +.Fa base , +which must be between 2 and 36 inclusive, +or be the special value 0. +.Pp +The string may begin with an arbitrary amount of white space +(as determined by +.Xr isspace 3 ) +followed by a single optional +.Ql + +or +.Ql - +sign. +If +.Fa base +is zero or 16, +the string may then include a +.Dq Li 0x +prefix, +and the number will be read in base 16; otherwise, a zero +.Fa base +is taken as 10 (decimal) unless the next character is +.Ql 0 , +in which case it is taken as 8 (octal). +.Pp +The remainder of the string is converted to a +.Vt long , "long long" , intmax_t +or +.Vt quad_t +value in the obvious manner, +stopping at the first character which is not a valid digit +in the given base. +(In bases above 10, the letter +.Ql A +in either upper or lower case +represents 10, +.Ql B +represents 11, and so forth, with +.Ql Z +representing 35.) +.Pp +If +.Fa endptr +is not +.Dv NULL , +.Fn strtol +stores the address of the first invalid character in +.Fa *endptr . +If there were no digits at all, however, +.Fn strtol +stores the original value of +.Fa str +in +.Fa *endptr . +(Thus, if +.Fa *str +is not +.Ql \e0 +but +.Fa **endptr +is +.Ql \e0 +on return, the entire string was valid.) +.Pp +Extended locale versions of these functions are documented in +.Xr strtol_l 3 . +See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn strtol , +.Fn strtoll , +.Fn strtoimax , +and +.Fn strtoq +functions +return the result of the conversion, +unless the value would underflow or overflow. +If no conversion could be performed, 0 is returned and +the global variable +.Va errno +is set to +.Er EINVAL +(the last feature is not portable across all platforms). +If an overflow or underflow occurs, +.Va errno +is set to +.Er ERANGE +and the function return value is clamped according +to the following table. +.Bl -column -offset indent ".Fn strtoimax" ".Dv INTMAX_MIN" ".Dv INTMAX_MAX" +.It Sy Function Ta Sy underflow Ta Sy overflow +.It Fn strtol Ta Dv LONG_MIN Ta Dv LONG_MAX +.It Fn strtoll Ta Dv LLONG_MIN Ta Dv LLONG_MAX +.It Fn strtoimax Ta Dv INTMAX_MIN Ta Dv INTMAX_MAX +.It Fn strtoq Ta Dv LLONG_MIN Ta Dv LLONG_MAX +.El +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +The value of +.Fa base +is not supported or +no conversion could be performed +(the last feature is not portable across all platforms). +.It Bq Er ERANGE +The given string was out of range; the value converted has been clamped. +.El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +.In limits.h +is necessary for the +.Fn strtol +and +.Fn strtoll +functions. +.Sh SEE ALSO +.Xr atof 3 , +.Xr atoi 3 , +.Xr atol 3 , +.Xr strtod 3 , +.Xr strtol_l 3 , +.Xr strtoul 3 , +.Xr wcstol 3 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn strtol +function +conforms to +.St -isoC . +The +.Fn strtoll +and +.Fn strtoimax +functions +conform to +.St -isoC-99 . +The +.Bx +.Fn strtoq +function is deprecated. diff --git a/stdlib/FreeBSD/strtol.c b/stdlib/FreeBSD/strtol.c new file mode 100644 index 0000000..cac93b2 --- /dev/null +++ b/stdlib/FreeBSD/strtol.c @@ -0,0 +1,150 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtol.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtol.c,v 1.20 2007/01/09 00:28:10 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include + + +/* + * Convert a string to a long integer. + * + * Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +long +strtol_l(const char * __restrict nptr, char ** __restrict endptr, int base, + locale_t loc) +{ + const char *s; + unsigned long acc; + char c; + unsigned long cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + s = nptr; + do { + c = *s++; + } while (isspace_l((unsigned char)c, loc)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X') && + ((s[1] >= '0' && s[1] <= '9') || + (s[1] >= 'A' && s[1] <= 'F') || + (s[1] >= 'a' && s[1] <= 'f'))) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + /* + * Compute the cutoff value between legal numbers and illegal + * numbers. That is the largest legal value, divided by the + * base. An input number that is greater than this value, if + * followed by a legal input character, is too big. One that + * is equal to this value may be valid or not; the limit + * between valid and invalid numbers is then based on the last + * digit. For instance, if the range for longs is + * [-2147483648..2147483647] and the input base is 10, + * cutoff will be set to 214748364 and cutlim to either + * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated + * a value > 214748364, or equal but the next digit is > 7 (or 8), + * the number is too big, and we will return a range error. + * + * Set 'any' if any `digits' consumed; make it negative to indicate + * overflow. + */ + cutoff = neg ? (unsigned long)-(LONG_MIN + LONG_MAX) + LONG_MAX + : LONG_MAX; + cutlim = cutoff % base; + cutoff /= base; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? LONG_MIN : LONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + +long +strtol(const char * __restrict nptr, char ** __restrict endptr, int base) +{ + return strtol_l(nptr, endptr, base, __current_locale()); +} diff --git a/stdlib/FreeBSD/strtoll.c b/stdlib/FreeBSD/strtoll.c new file mode 100644 index 0000000..f7e11f3 --- /dev/null +++ b/stdlib/FreeBSD/strtoll.c @@ -0,0 +1,150 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtoq.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoll.c,v 1.22 2007/01/09 00:28:10 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include + +/* + * Convert a string to a long long integer. + * + * Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +long long +strtoll_l(const char * __restrict nptr, char ** __restrict endptr, int base, + locale_t loc) +{ + const char *s; + unsigned long long acc; + char c; + unsigned long long cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + s = nptr; + do { + c = *s++; + } while (isspace_l((unsigned char)c, loc)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X') && + ((s[1] >= '0' && s[1] <= '9') || + (s[1] >= 'A' && s[1] <= 'F') || + (s[1] >= 'a' && s[1] <= 'f'))) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + /* + * Compute the cutoff value between legal numbers and illegal + * numbers. That is the largest legal value, divided by the + * base. An input number that is greater than this value, if + * followed by a legal input character, is too big. One that + * is equal to this value may be valid or not; the limit + * between valid and invalid numbers is then based on the last + * digit. For instance, if the range for quads is + * [-9223372036854775808..9223372036854775807] and the input base + * is 10, cutoff will be set to 922337203685477580 and cutlim to + * either 7 (neg==0) or 8 (neg==1), meaning that if we have + * accumulated a value > 922337203685477580, or equal but the + * next digit is > 7 (or 8), the number is too big, and we will + * return a range error. + * + * Set 'any' if any `digits' consumed; make it negative to indicate + * overflow. + */ + cutoff = neg ? (unsigned long long)-(LLONG_MIN + LLONG_MAX) + LLONG_MAX + : LLONG_MAX; + cutlim = cutoff % base; + cutoff /= base; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? LLONG_MIN : LLONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + +long long +strtoll(const char * __restrict nptr, char ** __restrict endptr, int base) +{ + return strtoll_l(nptr, endptr, base, __current_locale()); +} diff --git a/stdlib/FreeBSD/strtoq.c b/stdlib/FreeBSD/strtoq.c new file mode 100644 index 0000000..9dd03e2 --- /dev/null +++ b/stdlib/FreeBSD/strtoq.c @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtoq.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoq.c,v 1.12 2007/01/09 00:28:10 imp Exp $"); + +#include "xlocale_private.h" + +#include + +#include + +/* + * Convert a string to a quad integer. + */ +quad_t +strtoq(const char *nptr, char **endptr, int base) +{ + + return strtoll_l(nptr, endptr, base, __current_locale()); +} + +quad_t +strtoq_l(const char *nptr, char **endptr, int base, locale_t loc) +{ + + /* no need to call NORMALIZE_LOCALE(loc) because strtoll_l will */ + return strtoll_l(nptr, endptr, base, loc); +} diff --git a/stdlib/FreeBSD/strtoul.3 b/stdlib/FreeBSD/strtoul.3 new file mode 100644 index 0000000..91c759e --- /dev/null +++ b/stdlib/FreeBSD/strtoul.3 @@ -0,0 +1,254 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strtoul.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/strtoul.3,v 1.23 2007/01/09 00:28:10 imp Exp $ +.\" +.Dd November 28, 2001 +.Dt STRTOUL 3 +.Os +.Sh NAME +.Nm strtoul , +.Nm strtoull , +.Nm strtoumax , +.Nm strtouq +.Nd "convert a string to an" +.Vt "unsigned long" , "unsigned long long" , uintmax_t , +or +.Vt u_quad_t +integer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft "unsigned long" +.Fo strtoul +.Fa "const char *restrict str" +.Fa "char **restrict endptr" +.Fa "int base" +.Fc +.Ft "unsigned long long" +.Fo strtoull +.Fa "const char *restrict str" +.Fa "char **restrict endptr" +.Fa "int base" +.Fc +.In inttypes.h +.Ft uintmax_t +.Fo strtoumax +.Fa "const char *restrict str" +.Fa "char **restrict endptr" +.Fa "int base" +.Fc +.In sys/types.h +.In stdlib.h +.In limits.h +.Ft u_quad_t +.Fo strtouq +.Fa "const char *str" +.Fa "char **endptr" +.Fa "int base" +.Fc +.Sh DESCRIPTION +The +.Fn strtoul +function +converts the string in +.Fa str +to an +.Vt "unsigned long" +value. +The +.Fn strtoull +function +converts the string in +.Fa str +to an +.Vt "unsigned long long" +value. +The +.Fn strtoumax +function +converts the string in +.Fa str +to an +.Vt uintmax_t +value. +The +.Fn strtouq +function +converts the string in +.Fa str +to a +.Vt u_quad_t +value. +The conversion is done according to the given +.Fa base , +which must be between 2 and 36 inclusive, +or be the special value 0. +.Pp +The string may begin with an arbitrary amount of white space +(as determined by +.Xr isspace 3 ) +followed by a single optional +.Ql + +or +.Ql - +sign. +If +.Fa base +is zero or 16, +the string may then include a +.Dq Li 0x +prefix, +and the number will be read in base 16; otherwise, a zero +.Fa base +is taken as 10 (decimal) unless the next character is +.Ql 0 , +in which case it is taken as 8 (octal). +.Pp +The remainder of the string is converted to an +.Vt "unsigned long" +value in the obvious manner, +stopping at the end of the string +or at the first character that does not produce a valid digit +in the given base. +(In bases above 10, the letter +.Ql A +in either upper or lower case +represents 10, +.Ql B +represents 11, and so forth, with +.Ql Z +representing 35.) +.Pp +If +.Fa endptr +is not +.Dv NULL , +.Fn strtoul +stores the address of the first invalid character in +.Fa *endptr . +If there were no digits at all, however, +.Fn strtoul +stores the original value of +.Fa str +in +.Fa *endptr . +(Thus, if +.Fa *str +is not +.Ql \e0 +but +.Fa **endptr +is +.Ql \e0 +on return, the entire string was valid.) +.Sh RETURN VALUES +The +.Fn strtoul , +.Fn strtoull , +.Fn strtoumax +and +.Fn strtouq +functions +return either the result of the conversion +or, if there was a leading minus sign, +the negation of the result of the conversion, +unless the original (non-negated) value would overflow; +in the latter case, +.Fn strtoul +returns +.Dv ULONG_MAX , +.Fn strtoull +returns +.Dv ULLONG_MAX , +.Fn strtoumax +returns +.Dv UINTMAX_MAX , +and +.Fn strtouq +returns +.Dv ULLONG_MAX . +In all cases, +.Va errno +is set to +.Er ERANGE . +If no conversion could be performed, 0 is returned and +the global variable +.Va errno +is set to +.Er EINVAL +(the last feature is not portable across all platforms). +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +The value of +.Fa base +is not supported or +no conversion could be performed +(the last feature is not portable across all platforms). +.It Bq Er ERANGE +The given string was out of range; the value converted has been clamped. +.El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +.In limits.h +is necessary for the +.Fn strtoul +and +.Fn strtoull +functions. +.Sh SEE ALSO +.Xr strtol 3 , +.Xr strtol_l 3 , +.Xr strtonum 3 , +.Xr wcstoul 3 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn strtoul +function +conforms to +.St -isoC . +The +.Fn strtoull +and +.Fn strtoumax +functions +conform to +.St -isoC-99 . +The +.Bx +.Fn strtouq +function is deprecated. diff --git a/stdlib/FreeBSD/strtoul.c b/stdlib/FreeBSD/strtoul.c new file mode 100644 index 0000000..c7b5967 --- /dev/null +++ b/stdlib/FreeBSD/strtoul.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoul.c,v 1.19 2007/01/09 00:28:10 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include + +/* + * Convert a string to an unsigned long integer. + * + * Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long +strtoul_l(const char * __restrict nptr, char ** __restrict endptr, int base, + locale_t loc) +{ + const char *s; + unsigned long acc; + char c; + unsigned long cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * See strtol for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (isspace_l((unsigned char)c, loc)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X') && + ((s[1] >= '0' && s[1] <= '9') || + (s[1] >= 'A' && s[1] <= 'F') || + (s[1] >= 'a' && s[1] <= 'f'))) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = ULONG_MAX / base; + cutlim = ULONG_MAX % base; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + +unsigned long +strtoul(const char * __restrict nptr, char ** __restrict endptr, int base) +{ + return strtoul_l(nptr, endptr, base, __current_locale()); +} diff --git a/stdlib/FreeBSD/strtoull.c b/stdlib/FreeBSD/strtoull.c new file mode 100644 index 0000000..8f2fd94 --- /dev/null +++ b/stdlib/FreeBSD/strtoull.c @@ -0,0 +1,128 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtouq.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoull.c,v 1.21 2007/01/09 00:28:10 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include + +/* + * Convert a string to an unsigned long long integer. + * + * Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long long +strtoull_l(const char * __restrict nptr, char ** __restrict endptr, int base, + locale_t loc) +{ + const char *s; + unsigned long long acc; + char c; + unsigned long long cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * See strtoq for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (isspace_l((unsigned char)c, loc)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X') && + ((s[1] >= '0' && s[1] <= '9') || + (s[1] >= 'A' && s[1] <= 'F') || + (s[1] >= 'a' && s[1] <= 'f'))) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = ULLONG_MAX / base; + cutlim = ULLONG_MAX % base; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULLONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + +unsigned long long +strtoull(const char * __restrict nptr, char ** __restrict endptr, int base) +{ + return strtoull_l(nptr, endptr, base, __current_locale()); +} diff --git a/stdlib/FreeBSD/strtoumax.c b/stdlib/FreeBSD/strtoumax.c new file mode 100644 index 0000000..22400a5 --- /dev/null +++ b/stdlib/FreeBSD/strtoumax.c @@ -0,0 +1,128 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "from @(#)strtoul.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoumax.c,v 1.11 2007/01/09 00:28:10 imp Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include + +/* + * Convert a string to a uintmax_t integer. + * + * Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +uintmax_t +strtoumax_l(const char * __restrict nptr, char ** __restrict endptr, int base, + locale_t loc) +{ + const char *s; + uintmax_t acc; + char c; + uintmax_t cutoff; + int neg, any, cutlim; + + NORMALIZE_LOCALE(loc); + /* + * See strtoimax for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (isspace_l((unsigned char)c, loc)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X') && + ((s[1] >= '0' && s[1] <= '9') || + (s[1] >= 'A' && s[1] <= 'F') || + (s[1] >= 'a' && s[1] <= 'f'))) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = UINTMAX_MAX / base; + cutlim = UINTMAX_MAX % base; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = UINTMAX_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + +uintmax_t +strtoumax(const char * __restrict nptr, char ** __restrict endptr, int base) +{ + return strtoumax_l(nptr, endptr, base, __current_locale()); +} diff --git a/stdlib/FreeBSD/strtouq.c b/stdlib/FreeBSD/strtouq.c new file mode 100644 index 0000000..29f0f13 --- /dev/null +++ b/stdlib/FreeBSD/strtouq.c @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtouq.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtouq.c,v 1.12 2007/01/09 00:28:10 imp Exp $"); + +#include "xlocale_private.h" + +#include + +#include + +/* + * Convert a string to an unsigned quad integer. + */ +u_quad_t +strtouq(const char *nptr, char **endptr, int base) +{ + + return strtoull_l(nptr, endptr, base, __current_locale()); +} + +u_quad_t +strtouq_l(const char *nptr, char **endptr, int base, locale_t loc) +{ + + /* no need to call NORMALIZE_LOCALE(loc) because strtoull_l will */ + return strtoull_l(nptr, endptr, base, loc); +} diff --git a/stdlib/FreeBSD/system.3 b/stdlib/FreeBSD/system.3 new file mode 100644 index 0000000..72bc6cb --- /dev/null +++ b/stdlib/FreeBSD/system.3 @@ -0,0 +1,99 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)system.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/system.3,v 1.13 2008/06/26 08:24:59 danger Exp $ +.\" +.Dd June 4, 1993 +.Dt SYSTEM 3 +.Os +.Sh NAME +.Nm system +.Nd pass a command to the shell +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fn system "const char *command" +.Sh DESCRIPTION +The +.Fn system +function +hands the argument +.Fa command +to the command interpreter +.Xr sh 1 . +The calling process waits for the shell +to finish executing the command, +ignoring +.Dv SIGINT +and +.Dv SIGQUIT , +and blocking +.Dv SIGCHLD . +.Pp +If +.Fa command +is a +.Dv NULL +pointer, +.Fn system +will return non-zero if the command interpreter +.Xr sh 1 +is available, and zero if it is not. +.Sh RETURN VALUES +The +.Fn system +function +returns the exit status of the shell as returned by +.Xr waitpid 2 , +or \-1 if an error occurred when invoking +.Xr fork 2 +or +.Xr waitpid 2 . +A return value of 127 means the execution of the shell +failed. +.Sh SEE ALSO +.Xr sh 1 , +.Xr execve 2 , +.Xr fork 2 , +.Xr waitpid 2 , +.Xr popen 3 +.Sh STANDARDS +The +.Fn system +function +conforms to +.St -isoC +and is expected to be +.St -p1003.2 +compatible. diff --git a/stdlib/FreeBSD/system.c b/stdlib/FreeBSD/system.c new file mode 100644 index 0000000..8ab1eca --- /dev/null +++ b/stdlib/FreeBSD/system.c @@ -0,0 +1,163 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)system.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdlib/system.c,v 1.11 2007/01/09 00:28:10 imp Exp $"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +#include +#define environ (*_NSGetEnviron()) + +#include + +#if __DARWIN_UNIX03 +#include + +#if !(TARGET_OS_IPHONE && (TARGET_OS_SIMULATOR || !TARGET_OS_IOS)) +static pthread_mutex_t __systemfn_mutex = PTHREAD_MUTEX_INITIALIZER; +#endif +extern int __unix_conforming; +#endif /* __DARWIN_UNIX03 */ + +int +__system(command) + const char *command; +{ +#if TARGET_OS_IPHONE && (TARGET_OS_SIMULATOR || !TARGET_OS_IOS) + // Don't abort() on iOS for now + LIBC_ABORT("system() is not supported on this platform."); +#else + pid_t pid, savedpid; + int pstat, err; + struct sigaction ign, intact, quitact; + sigset_t newsigblock, oldsigblock, defaultsig; + posix_spawnattr_t attr; + short flags = POSIX_SPAWN_SETSIGMASK; + const char *argv[] = {"sh", "-c", command, NULL}; + +#if __DARWIN_UNIX03 + if (__unix_conforming == 0) + __unix_conforming = 1; +#ifdef VARIANT_CANCELABLE + pthread_testcancel(); +#endif /* VARIANT_CANCELABLE */ +#endif /* __DARWIN_UNIX03 */ + + if (!command) { /* just checking... */ +#if TARGET_OS_IPHONE + return(0); +#else + if (access(_PATH_BSHELL, F_OK) == -1) /* if no sh or no access */ + return(0); + else + return(1); +#endif + } + + if ((err = posix_spawnattr_init(&attr)) != 0) { + errno = err; + return -1; + } + (void)sigemptyset(&defaultsig); + +#if __DARWIN_UNIX03 + pthread_mutex_lock(&__systemfn_mutex); +#endif /* __DARWIN_UNIX03 */ + /* + * Ignore SIGINT and SIGQUIT, block SIGCHLD. Remember to save + * existing signal dispositions. + */ + ign.sa_handler = SIG_IGN; + (void)sigemptyset(&ign.sa_mask); + ign.sa_flags = 0; + (void)_sigaction(SIGINT, &ign, &intact); + if (intact.sa_handler != SIG_IGN) { + sigaddset(&defaultsig, SIGINT); + flags |= POSIX_SPAWN_SETSIGDEF; + } + (void)_sigaction(SIGQUIT, &ign, &quitact); + if (quitact.sa_handler != SIG_IGN) { + sigaddset(&defaultsig, SIGQUIT); + flags |= POSIX_SPAWN_SETSIGDEF; + } + (void)sigemptyset(&newsigblock); + (void)sigaddset(&newsigblock, SIGCHLD); + (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); + (void)posix_spawnattr_setsigmask(&attr, &oldsigblock); + if (flags & POSIX_SPAWN_SETSIGDEF) { + (void)posix_spawnattr_setsigdefault(&attr, &defaultsig); + } + (void)posix_spawnattr_setflags(&attr, flags); + + err = posix_spawn(&pid, _PATH_BSHELL, NULL, &attr, (char *const *)argv, environ); + (void)posix_spawnattr_destroy(&attr); + if (err == 0) { + savedpid = pid; + do { + pid = _wait4(savedpid, &pstat, 0, (struct rusage *)0); + } while (pid == -1 && errno == EINTR); + if (pid == -1) pstat = -1; + } else if (err == ENOMEM || err == EAGAIN) { /* as if fork failed */ + pstat = -1; + } else { + pstat = W_EXITCODE(127, 0); /* couldn't exec shell */ + } + + (void)_sigaction(SIGINT, &intact, NULL); + (void)_sigaction(SIGQUIT, &quitact, NULL); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); +#if __DARWIN_UNIX03 + pthread_mutex_unlock(&__systemfn_mutex); +#endif /* __DARWIN_UNIX03 */ + return(pstat); +#endif /* TARGET_OS_IPHONE && (TARGET_OS_SIMULATOR || !TARGET_OS_IOS) */ +} + +__weak_reference(__system, system); +__weak_reference(__system, _system); + +#pragma clang diagnostic pop diff --git a/stdlib/FreeBSD/tdelete.c b/stdlib/FreeBSD/tdelete.c new file mode 100644 index 0000000..7fb6893 --- /dev/null +++ b/stdlib/FreeBSD/tdelete.c @@ -0,0 +1,71 @@ +/* $NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $ */ + +/* + * Tree search generalized from Knuth (6.2.2) Algorithm T just like + * the AT&T man page says. + * + * The node_t structure is for internal use only, lint doesn't grok it. + * + * Written by reading the System V Interface Definition, not the code. + * + * Totally public domain. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/stdlib/tdelete.c,v 1.6 2003/01/05 02:43:18 tjr Exp $"); + +#define _SEARCH_PRIVATE +#include +#include + + +/* + * delete node with given key + * + * vkey: key to be deleted + * vrootp: address of the root of the tree + * compar: function to carry out node comparisons + */ +void * +tdelete(const void * __restrict vkey, void ** __restrict vrootp, + int (*compar)(const void *, const void *)) +{ + node_t **rootp = (node_t **)vrootp; + node_t *p, *q, *r; + int cmp; + + if (rootp == NULL || (p = *rootp) == NULL) + return NULL; + + while ((cmp = (*compar)(vkey, (*rootp)->key)) != 0) { + p = *rootp; + rootp = (cmp < 0) ? + &(*rootp)->llink : /* follow llink branch */ + &(*rootp)->rlink; /* follow rlink branch */ + if (*rootp == NULL) + return NULL; /* key not found */ + } + r = (*rootp)->rlink; /* D1: */ + if ((q = (*rootp)->llink) == NULL) /* Left NULL? */ + q = r; + else if (r != NULL) { /* Right link is NULL? */ + if (r->llink == NULL) { /* D2: Find successor */ + r->llink = q; + q = r; + } else { /* D3: Find NULL link */ + for (q = r->llink; q->llink != NULL; q = r->llink) + r = q; + r->llink = q->rlink; + q->llink = (*rootp)->llink; + q->rlink = (*rootp)->rlink; + } + } + free(*rootp); /* D4: Free node */ + *rootp = q; /* link parent to new node */ + return p; +} diff --git a/stdlib/FreeBSD/tfind.c b/stdlib/FreeBSD/tfind.c new file mode 100644 index 0000000..b58ed88 --- /dev/null +++ b/stdlib/FreeBSD/tfind.c @@ -0,0 +1,48 @@ +/* $NetBSD: tfind.c,v 1.2 1999/09/16 11:45:37 lukem Exp $ */ + +/* + * Tree search generalized from Knuth (6.2.2) Algorithm T just like + * the AT&T man page says. + * + * The node_t structure is for internal use only, lint doesn't grok it. + * + * Written by reading the System V Interface Definition, not the code. + * + * Totally public domain. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: tfind.c,v 1.2 1999/09/16 11:45:37 lukem Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/stdlib/tfind.c,v 1.5 2003/01/05 02:43:18 tjr Exp $"); + +#define _SEARCH_PRIVATE +#include +#include + +/* find a node, or return 0 */ +void * +tfind(vkey, vrootp, compar) + const void *vkey; /* key to be found */ + void * const *vrootp; /* address of the tree root */ + int (*compar)(const void *, const void *); +{ + node_t **rootp = (node_t **)vrootp; + + if (rootp == NULL) + return NULL; + + while (*rootp != NULL) { /* T1: */ + int r; + + if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */ + return *rootp; /* key found */ + rootp = (r < 0) ? + &(*rootp)->llink : /* T3: follow left branch */ + &(*rootp)->rlink; /* T4: follow right branch */ + } + return NULL; +} diff --git a/stdlib/FreeBSD/tsearch.3 b/stdlib/FreeBSD/tsearch.3 new file mode 100644 index 0000000..9d7a863 --- /dev/null +++ b/stdlib/FreeBSD/tsearch.3 @@ -0,0 +1,181 @@ +.\" $NetBSD$ +.\" Copyright (c) 1997 Todd C. Miller +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" OpenBSD: tsearch.3,v 1.2 1998/06/21 22:13:49 millert Exp +.\" $FreeBSD: src/lib/libc/stdlib/tsearch.3,v 1.15 2006/06/23 13:36:33 keramida Exp $ +.\" +.Dd June 15, 1997 +.Dt TSEARCH 3 +.Os +.Sh NAME +.Nm tdelete , +.Nm tfind , +.Nm tsearch , +.Nm twalk +.Nd manipulate binary search trees +.Sh SYNOPSIS +.In search.h +.Ft void * +.Fo tdelete +.Fa "const void *restrict key" +.Fa "void **restrict rootp" +.Fa "int (*compar) (const void *key1, const void *key2)" +.Fc +.Ft void * +.Fo tfind +.Fa "const void *key" +.Fa "void *const *rootp" +.Fa "int (*compar) (const void *key1, const void *key2)" +.Fc +.Ft void * +.Fo tsearch +.Fa "const void *key" +.Fa "void **rootp" +.Fa "int (*compar) (const void *key1, const void *key2)" +.Fc +.Ft void +.Fo twalk +.Fa "const void *root" +.Fa "void (*action) (const void *node, VISIT order, int level)" +.Fc +.Sh DESCRIPTION +The +.Fn tdelete , +.Fn tfind , +.Fn tsearch , +and +.Fn twalk +functions manage binary search trees, based on algorithms T and D +from Knuth (6.2.2). +The comparison function passed in by +the user takes two arguments, each of which is a key +pointer. +This function has the same style of return values as +.Xr strcmp 3 . +.Pp +The +.Fn tfind +function +searches for a node whose key matches the argument +.Fa key +in the binary tree rooted at +.Fa rootp , +returning a pointer to the node if it is found and NULL +if it is not. +.Pp +Note that a node is itself a pointer to the key of the node. +Thus, you should generally cast this result to a +double pointer to the data type stored in the tree, for example +(struct myType **), and use double indirection to retrieve the +original key value. +.Pp +The +.Fn tsearch +function is identical to +.Fn tfind +except that, if no match is found, +it inserts a new node for the +.Fa key +into the tree and returns a pointer to the node. +If +.Fa rootp +points to a NULL value, a new binary search tree is created. +.Pp +The +.Fn tdelete +function deletes a node from the specified binary search tree +and returns a pointer to the parent of the node that was deleted. +It takes the same arguments as +.Fn tfind +and +.Fn tsearch . +If the node to be deleted is the root of the binary search tree, +.Fa rootp +will be adjusted. +.Pp +The +.Fn twalk +function walks the binary search tree rooted in +.Fa root +and calls the function +.Fa action +on each node. +The +.Fa action +function is called with three arguments: a pointer to the current node, +a value from the enum +.Sy "typedef enum { preorder, postorder, endorder, leaf } VISIT;" +specifying the traversal type, and a node level (where level +zero is the root of the tree). +.Pp +As +.Fn twalk +traverses the tree, it calls the +.Fa action +function with the traversal type "preorder" +before visiting the left subtree of the +.Fa node , +with the +traversal type "postorder" before visiting the right subtree +of the +.Fa node , +and with the traversal type "endorder" after +visiting the right subtree of the +.Fa node . +.Pp. +The +.Fa action +function is called only once for a leaf-node, with the +traversal type "leaf." +.Pp +Note: the names for the traversal types differ somewhat from +common parlance. The traversal type "postorder" corresponds +to what would typically be referred to as in-order, and the +traversal type "endorder" corresponds to what would typically +be referred to as post-order. +.Sh RETURN VALUES +The +.Fn tsearch +function returns NULL if allocation of a new node fails (usually +due to a lack of free memory). +.Pp +The +.Fn tfind , +.Fn tsearch , +and +.Fn tdelete +functions +return NULL if +.Fa rootp +is NULL or the node cannot be found. +.Pp +The +.Fn twalk +function returns no value. +.Sh SEE ALSO +.Xr bsearch 3 , +.Xr hsearch 3 , +.Xr lsearch 3 diff --git a/stdlib/FreeBSD/tsearch.c b/stdlib/FreeBSD/tsearch.c new file mode 100644 index 0000000..edeccde --- /dev/null +++ b/stdlib/FreeBSD/tsearch.c @@ -0,0 +1,58 @@ +/* $NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $ */ + +/* + * Tree search generalized from Knuth (6.2.2) Algorithm T just like + * the AT&T man page says. + * + * The node_t structure is for internal use only, lint doesn't grok it. + * + * Written by reading the System V Interface Definition, not the code. + * + * Totally public domain. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/stdlib/tsearch.c,v 1.4 2003/01/05 02:43:18 tjr Exp $"); + +#define _SEARCH_PRIVATE +#include +#include + +/* find or insert datum into search tree */ +void * +tsearch(vkey, vrootp, compar) + const void *vkey; /* key to be located */ + void **vrootp; /* address of tree root */ + int (*compar)(const void *, const void *); +{ + node_t *q; + node_t **rootp = (node_t **)vrootp; + + if (rootp == NULL) + return NULL; + + while (*rootp != NULL) { /* Knuth's T1: */ + int r; + + if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */ + return *rootp; /* we found it! */ + + rootp = (r < 0) ? + &(*rootp)->llink : /* T3: follow left branch */ + &(*rootp)->rlink; /* T4: follow right branch */ + } + + q = malloc(sizeof(node_t)); /* T5: key not found */ + if (q != 0) { /* make new node */ + *rootp = q; /* link new node to old */ + /* LINTED const castaway ok */ + q->key = (void *)vkey; /* initialize new node */ + q->llink = q->rlink = NULL; + } + return q; +} diff --git a/stdlib/FreeBSD/twalk.c b/stdlib/FreeBSD/twalk.c new file mode 100644 index 0000000..516ef44 --- /dev/null +++ b/stdlib/FreeBSD/twalk.c @@ -0,0 +1,58 @@ +/* $NetBSD: twalk.c,v 1.1 1999/02/22 10:33:16 christos Exp $ */ + +/* + * Tree search generalized from Knuth (6.2.2) Algorithm T just like + * the AT&T man page says. + * + * The node_t structure is for internal use only, lint doesn't grok it. + * + * Written by reading the System V Interface Definition, not the code. + * + * Totally public domain. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: twalk.c,v 1.1 1999/02/22 10:33:16 christos Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/stdlib/twalk.c,v 1.5 2003/01/05 02:43:18 tjr Exp $"); + +#define _SEARCH_PRIVATE +#include +#include + +static void trecurse(const node_t *, + void (*action)(const void *, VISIT, int), int level); + +/* Walk the nodes of a tree */ +static void +trecurse(root, action, level) + const node_t *root; /* Root of the tree to be walked */ + void (*action)(const void *, VISIT, int); + int level; +{ + + if (root->llink == NULL && root->rlink == NULL) + (*action)(root, leaf, level); + else { + (*action)(root, preorder, level); + if (root->llink != NULL) + trecurse(root->llink, action, level + 1); + (*action)(root, postorder, level); + if (root->rlink != NULL) + trecurse(root->rlink, action, level + 1); + (*action)(root, endorder, level); + } +} + +/* Walk the nodes of a tree */ +void +twalk(vroot, action) + const void *vroot; /* Root of the tree to be walked */ + void (*action)(const void *, VISIT, int); +{ + if (vroot != NULL && action != NULL) + trecurse(vroot, action, 0); +} diff --git a/stdlib/NetBSD/strfmon.3 b/stdlib/NetBSD/strfmon.3 new file mode 100644 index 0000000..6b6976f --- /dev/null +++ b/stdlib/NetBSD/strfmon.3 @@ -0,0 +1,208 @@ +.\" $NetBSD: strfmon.3,v 1.3 2005/04/04 08:19:00 wiz Exp $ +.\" +.\" Copyright (c) 2001 Jeroen Ruigrok van der Werven +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From: FreeBSD: Id: strfmon.3,v 1.7 2003/01/06 06:21:25 tjr Exp +.\" +.Dd October 12, 2002 +.Dt STRFMON 3 +.Os +.Sh NAME +.Nm strfmon , +.Nm strfmon_l +.Nd convert monetary value to string +.\" .Sh LIBRARY +.\" .Lb libc +.Sh SYNOPSIS +.In monetary.h +.Ft ssize_t +.Fo strfmon +.Fa "char *restrict s" +.Fa "size_t maxsize" +.Fa "const char *restrict format" +.Fa "..." +.Fc +.In monetary.h +.In xlocale.h +.Ft ssize_t +.Fo strfmon_l +.Fa "char *restrict s" +.Fa "size_t maxsize" +.Fa "locale_t loc" +.Fa "const char *restrict format" +.Fa "..." +.Fc +.Sh DESCRIPTION +The +.Fn strfmon +function places characters into the array pointed to by +.Fa s , +as controlled by the string pointed to by +.Fa format . +No more than +.Fa maxsize +bytes are placed into the array. +.Pp +While the +.Fn strfmon +function uses the current locale, the +.Fn strfmon_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Pp +The format string is composed of zero or more directives: +ordinary characters (not +.Cm % ) , +which are copied unchanged to the output stream; and conversion +specifications, each of which results in fetching zero or more subsequent +arguments. +Each conversion specification is introduced by the +.Cm % +character. +After the +.Cm % , +the following appear in sequence: +.Bl -bullet +.It +Zero or more of the following flags: +.Bl -tag -width "XXX" +.It Cm = Ns Ar f +A +.Sq Cm = +character followed by another character +.Ar f +which is used as the numeric fill character. +.It Cm ^ +Do not use grouping characters, regardless of the current locale default. +.It Cm + +Represent positive values by prefixing them with a positive sign, +and negative values by prefixing them with a negative sign. +This is the default. +.It Cm \&( +Enclose negative values in parentheses. +.It Cm \&! +Do not include a currency symbol in the output. +.It Cm \- +Left justify the result. +Only valid when a field width is specified. +.El +.It +An optional minimum field width as a decimal number. +By default, there is no minimum width. +.It +A +.Sq Cm # +sign followed by a decimal number specifying the maximum +expected number of digits after the radix character. +.It +A +.Sq Cm \&. +character followed by a decimal number specifying the number +of digits after the radix character. +.It +One of the following conversion specifiers: +.Bl -tag -width "XXX" +.It Cm i +The +.Vt double +argument is formatted as an international monetary amount. +.It Cm n +The +.Vt double +argument is formatted as a national monetary amount. +.It Cm % +A +.Sq Li % +character is written. +.El +.El +.Sh RETURN VALUES +If the total number of resulting bytes, including the terminating +.Dv NULL +byte, is not more than +.Fa maxsize , +.Fn strfmon +returns the number of bytes placed into the array pointed to by +.Fa s , +not including the terminating +.Dv NULL +byte. +Otherwise, \-1 is returned, +the contents of the array are indeterminate, +and +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn strfmon +function will fail if: +.Bl -tag -width Er +.It Bq Er E2BIG +Conversion stopped due to lack of space in the buffer. +.It Bq Er EINVAL +The format string is invalid. +.It Bq Er ENOMEM +Not enough memory for temporary buffers. +.El +.Sh EXAMPLE +.Bd -literal -offset indent -compact + #include + #include + #include + + int main() { + char buf[200]; + setlocale(LC_ALL, "en_US"); + (void)strfmon (buf, sizeof(buf)-1, "%n" , 123456.78); + printf("%s\n", buf); + } +.Ed +.Pp +.Sh SEE ALSO +.Xr localeconv 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn strfmon +function +conforms to +.St -p1003.1-2001 . +.Sh AUTHORS +.An -nosplit +The +.Fn strfmon +function was implemented by +.An Alexey Zelkin Aq phantom@FreeBSD.org . +.Pp +This manual page was written by +.An Jeroen Ruigrok van der Werven Aq asmodai@FreeBSD.org +based on the standard's text. +.Sh BUGS +The +.Fn strfmon +function does not correctly handle multibyte characters in the +.Fa format +argument. diff --git a/stdlib/NetBSD/strfmon.c b/stdlib/NetBSD/strfmon.c new file mode 100644 index 0000000..8ee41da --- /dev/null +++ b/stdlib/NetBSD/strfmon.c @@ -0,0 +1,659 @@ +/* $NetBSD: strfmon.c,v 1.7 2009/01/30 23:46:03 lukem Exp $ */ + +/*- + * Copyright (c) 2001 Alexey Zelkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strfmon.c,v 1.14 2003/03/20 08:18:55 ache Exp $"); +#else +__RCSID("$NetBSD: strfmon.c,v 1.7 2009/01/30 23:46:03 lukem Exp $"); +#endif +#endif /* LIBC_SCCS and not lint */ + +#if defined(__NetBSD__) +#include "namespace.h" +#include +#endif + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* internal flags */ +#define NEED_GROUPING 0x01 /* print digits grouped (default) */ +#define SIGN_POSN_USED 0x02 /* '+' or '(' usage flag */ +#define LOCALE_POSN 0x04 /* use locale defined +/- (default) */ +#define PARENTH_POSN 0x08 /* enclose negative amount in () */ +#define SUPRESS_CURR_SYMBOL 0x10 /* supress the currency from output */ +#define LEFT_JUSTIFY 0x20 /* left justify */ +#define USE_INTL_CURRENCY 0x40 /* use international currency symbol */ +#define IS_NEGATIVE 0x80 /* is argument value negative ? */ + +/* internal macros */ +#define PRINT(CH) do { \ + if (dst >= s + maxsize) \ + goto e2big_error; \ + *dst++ = CH; \ +} while (/* CONSTCOND */ 0) + +#define PRINTS(STR) do { \ + const char *tmps = STR; \ + while (*tmps != '\0') \ + PRINT(*tmps++); \ +} while (/* CONSTCOND */ 0) + +#define GET_NUMBER(VAR,LOC) do { \ + VAR = 0; \ + while (isdigit_l((unsigned char)*fmt, (LOC))) { \ + VAR *= 10; \ + VAR += *fmt - '0'; \ + if (VAR > 0x00ffffff) \ + goto e2big_error; \ + fmt++; \ + } \ +} while (/* CONSTCOND */ 0) + +#define GRPCPY(howmany) do { \ + int i = howmany; \ + while (i-- > 0) { \ + avalue_size--; \ + *--bufend = *(avalue+avalue_size+padded); \ + } \ +} while (/* CONSTCOND */ 0) + +#define GRPSEP do { \ + *--bufend = thousands_sep; \ + groups++; \ +} while (/* CONSTCOND */ 0) + +static void __setup_vars(int, char *, char *, char *, const char **, struct lconv *); +static int __calc_left_pad(int, char *, struct lconv *); +static char *__format_grouped_double(double, int *, int, int, int, struct lconv *, locale_t); + +static ssize_t +_strfmon(char * __restrict s, size_t maxsize, locale_t loc, const char * __restrict format, va_list ap) +{ + char *dst; /* output destination pointer */ + const char *fmt; /* current format poistion pointer */ + struct lconv *lc; /* pointer to lconv structure */ + char *asciivalue; /* formatted double pointer */ + + int flags; /* formatting options */ + int pad_char; /* padding character */ + int pad_size; /* pad size */ + int width; /* field width */ + int left_prec; /* left precision */ + int right_prec; /* right precision */ + double value; /* just value */ + char space_char = ' '; /* space after currency */ + + char cs_precedes, /* values gathered from struct lconv */ + sep_by_space, + sign_posn, + *currency_symbol; + const char *signstr; + + char *tmpptr; /* temporary vars */ + int sverrno; + + lc = localeconv_l(loc); + dst = s; + fmt = format; + asciivalue = NULL; + currency_symbol = NULL; + pad_size = 0; + + while (*fmt) { + /* pass nonformating characters AS IS */ + if (*fmt != '%') + goto literal; + + /* '%' found ! */ + + /* "%%" mean just '%' */ + if (*(fmt+1) == '%') { + fmt++; + literal: + PRINT(*fmt++); + continue; + } + + /* set up initial values */ + flags = (NEED_GROUPING|LOCALE_POSN); + pad_char = ' '; /* padding character is "space" */ + left_prec = -1; /* no left precision specified */ + right_prec = -1; /* no right precision specified */ + width = -1; /* no width specified */ + value = 0; /* we have no value to print now */ + + /* Flags */ + while (/* CONSTCOND */ 1) { + switch (*++fmt) { + case '=': /* fill character */ + pad_char = *++fmt; + if (pad_char == '\0') + goto format_error; + continue; + case '^': /* not group currency */ + flags &= ~(NEED_GROUPING); + continue; + case '+': /* use locale defined signs */ + if (flags & SIGN_POSN_USED) + goto format_error; + flags |= (SIGN_POSN_USED|LOCALE_POSN); + continue; + case '(': /* enclose negatives with () */ + if (flags & SIGN_POSN_USED) + goto format_error; + flags |= (SIGN_POSN_USED|PARENTH_POSN); + continue; + case '!': /* suppress currency symbol */ + flags |= SUPRESS_CURR_SYMBOL; + continue; + case '-': /* alignment (left) */ + flags |= LEFT_JUSTIFY; + continue; + default: + break; + } + break; + } + + /* field Width */ + if (isdigit_l((unsigned char)*fmt, loc)) { + ptrdiff_t d = dst - s; + GET_NUMBER(width, loc); + /* Do we have enough space to put number with + * required width ? + */ + + if ((size_t)(d + width) >= maxsize) + goto e2big_error; + } + + /* Left precision */ + if (*fmt == '#') { + if (!isdigit_l((unsigned char)*++fmt, loc)) + goto format_error; + GET_NUMBER(left_prec, loc); + } + + /* Right precision */ + if (*fmt == '.') { + if (!isdigit_l((unsigned char)*++fmt, loc)) + goto format_error; + GET_NUMBER(right_prec, loc); + } + + /* Conversion Characters */ + switch (*fmt++) { + case 'i': /* use internaltion currency format */ + flags |= USE_INTL_CURRENCY; + break; + case 'n': /* use national currency format */ + flags &= ~(USE_INTL_CURRENCY); + break; + default: /* required character is missing or + premature EOS */ + goto format_error; + } + + if (currency_symbol) + free(currency_symbol); + if (flags & USE_INTL_CURRENCY) { + currency_symbol = strdup(lc->int_curr_symbol); + if (currency_symbol != NULL) { + space_char = *(currency_symbol+3); + currency_symbol[3] = '\0'; + } + } else + currency_symbol = strdup(lc->currency_symbol); + + if (currency_symbol == NULL) + goto end_error; /* ENOMEM. */ + + /* value itself */ + value = va_arg(ap, double); + + /* detect sign */ + if (value < 0) { + flags |= IS_NEGATIVE; + value = -value; + } + + /* fill left_prec with amount of padding chars */ + if (left_prec >= 0) { + pad_size = __calc_left_pad((flags ^ IS_NEGATIVE), + currency_symbol, lc) - + __calc_left_pad(flags, currency_symbol, lc); + if (pad_size < 0) + pad_size = 0; + } + + asciivalue = __format_grouped_double(value, &flags, + left_prec, right_prec, pad_char, lc, loc); + if (asciivalue == NULL) + goto end_error; /* errno already set */ + /* to ENOMEM by malloc() */ + + /* set some variables for later use */ + __setup_vars(flags, &cs_precedes, &sep_by_space, + &sign_posn, &signstr, lc); + + /* + * Description of some LC_MONETARY's values: + * + * p_cs_precedes & n_cs_precedes + * + * = 1 - $currency_symbol precedes the value + * for a monetary quantity with a non-negative value + * = 0 - symbol succeeds the value + * + * p_sep_by_space & n_sep_by_space + * + * = 0 - no space separates $currency_symbol + * from the value for a monetary quantity with a + * non-negative value + * = 1 - space separates the symbol from the value + * = 2 - space separates the symbol and the sign string, + * if adjacent. + * + * p_sign_posn & n_sign_posn + * + * = 0 - parentheses enclose the quantity and the + * $currency_symbol + * = 1 - the sign string precedes the quantity and the + * $currency_symbol + * = 2 - the sign string succeeds the quantity and the + * $currency_symbol + * = 3 - the sign string precedes the $currency_symbol + * = 4 - the sign string succeeds the $currency_symbol + * + */ + + tmpptr = dst; + + while (pad_size-- > 0) + PRINT(' '); + + if (sign_posn == 0 && (flags & IS_NEGATIVE)) + PRINT('('); + + if (cs_precedes == 1) { + if (sign_posn == 1 || sign_posn == 3) { + PRINTS(signstr); + if (sep_by_space == 2) /* XXX: ? */ + PRINT(' '); + } + + if (!(flags & SUPRESS_CURR_SYMBOL)) { + PRINTS(currency_symbol); + + if (sign_posn == 4) { + if (sep_by_space == 2) + PRINT(space_char); + PRINTS(signstr); + if (sep_by_space == 1) + PRINT(' '); + } else if (sep_by_space == 1) + PRINT(space_char); + } + } else if (sign_posn == 1) { + PRINTS(signstr); + if (sep_by_space == 2) + PRINT(' '); + } + + PRINTS(asciivalue); + + if (cs_precedes == 0) { + if (sign_posn == 3) { + if (sep_by_space == 1) + PRINT(' '); + PRINTS(signstr); + } + + if (!(flags & SUPRESS_CURR_SYMBOL)) { + if ((sign_posn == 3 && sep_by_space == 2) + || (sep_by_space == 1 + && (sign_posn == 0 + || sign_posn == 1 + || sign_posn == 2 + || sign_posn == 4))) + PRINT(space_char); + PRINTS(currency_symbol); /* XXX: len */ + if (sign_posn == 4) { + if (sep_by_space == 2) + PRINT(' '); + PRINTS(signstr); + } + } + } + + if (sign_posn == 2) { + if (sep_by_space == 2) + PRINT(' '); + PRINTS(signstr); + } + + if (sign_posn == 0) { + if (flags & IS_NEGATIVE) + PRINT(')'); + else if (left_prec >= 0) + PRINT(' '); + } + + if (dst - tmpptr < width) { + if (flags & LEFT_JUSTIFY) { + while (dst - tmpptr < width) + PRINT(' '); + } else { + pad_size = dst-tmpptr; + memmove(tmpptr + width-pad_size, tmpptr, + (size_t) pad_size); + memset(tmpptr, ' ', (size_t) width-pad_size); + dst += width-pad_size; + } + } + } + + PRINT('\0'); + free(asciivalue); + free(currency_symbol); + return (dst - s - 1); /* return size of put data except trailing '\0' */ + +e2big_error: + errno = E2BIG; + goto end_error; + +format_error: + errno = EINVAL; + +end_error: + sverrno = errno; + if (asciivalue != NULL) + free(asciivalue); + if (currency_symbol != NULL) + free(currency_symbol); + errno = sverrno; + return (-1); +} + +static void +__setup_vars(int flags, char *cs_precedes, char *sep_by_space, + char *sign_posn, const char **signstr, struct lconv *lc) { + + if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) { + *cs_precedes = lc->int_n_cs_precedes; + *sep_by_space = lc->int_n_sep_by_space; + *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn; + *signstr = (lc->negative_sign == '\0') ? "-" + : lc->negative_sign; + } else if (flags & USE_INTL_CURRENCY) { + *cs_precedes = lc->int_p_cs_precedes; + *sep_by_space = lc->int_p_sep_by_space; + *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_p_sign_posn; + *signstr = lc->positive_sign; + } else if (flags & IS_NEGATIVE) { + *cs_precedes = lc->n_cs_precedes; + *sep_by_space = lc->n_sep_by_space; + *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn; + *signstr = (lc->negative_sign == '\0') ? "-" + : lc->negative_sign; + } else { + *cs_precedes = lc->p_cs_precedes; + *sep_by_space = lc->p_sep_by_space; + *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->p_sign_posn; + *signstr = lc->positive_sign; + } + + /* Set defult values for unspecified information. */ + if (*cs_precedes != 0) + *cs_precedes = 1; + if (*sep_by_space == CHAR_MAX) + *sep_by_space = 0; + if (*sign_posn == CHAR_MAX) + *sign_posn = 0; +} + +static int +__calc_left_pad(int flags, char *cur_symb, struct lconv *lc) { + + char cs_precedes, sep_by_space, sign_posn; + const char *signstr; + int left_chars = 0; + + __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, &signstr, lc); + + if (cs_precedes != 0) { + left_chars += strlen(cur_symb); + if (sep_by_space != 0) + left_chars++; + } + + switch (sign_posn) { + case 0: + if (flags & IS_NEGATIVE) + left_chars++; + break; + case 1: + left_chars += strlen(signstr); + break; + case 3: + case 4: + if (cs_precedes != 0) + left_chars += strlen(signstr); + } + return (left_chars); +} + +static int +get_groups(int size, const char *grouping) { + + int chars = 0; + + if (*grouping == CHAR_MAX || *grouping <= 0) /* no grouping ? */ + return (0); + + while (size > (int)*grouping) { + chars++; + size -= (int)*grouping++; + /* no more grouping ? */ + if (*grouping == CHAR_MAX) + break; + /* rest grouping with same value ? */ + if (*grouping == 0) { + chars += (size - 1) / *(grouping - 1); + break; + } + } + return (chars); +} + +/* convert double to ASCII */ +__private_extern__ const char *__fix_nogrouping(const char *); + +static char * +__format_grouped_double(double value, int *flags, + int left_prec, int right_prec, int pad_char, struct lconv *lc, locale_t loc) { + + char *rslt; + char *avalue; + int avalue_size; + char fmt[32]; + + size_t bufsize; + char *bufend; + + int padded; + + const char *grouping; + char decimal_point; + char thousands_sep; + + int groups = 0; + + grouping = __fix_nogrouping(lc->mon_grouping); + decimal_point = *lc->mon_decimal_point; + if (decimal_point == '\0') + decimal_point = *lc->decimal_point; + thousands_sep = *lc->mon_thousands_sep; + if (thousands_sep == '\0') + thousands_sep = *lc->thousands_sep; + + /* fill left_prec with default value */ + if (left_prec == -1) + left_prec = 0; + + /* fill right_prec with default value */ + if (right_prec == -1) { + if (*flags & USE_INTL_CURRENCY) + right_prec = lc->int_frac_digits; + else + right_prec = lc->frac_digits; + + if (right_prec == CHAR_MAX) /* POSIX locale ? */ + right_prec = 2; + } + + if (*flags & NEED_GROUPING) + left_prec += get_groups(left_prec, grouping); + + /* convert to string */ + snprintf_l(fmt, sizeof(fmt), loc, "%%%d.%df", left_prec + right_prec + 1, + right_prec); + avalue_size = asprintf_l(&avalue, loc, fmt, value); + if (avalue_size < 0) + return (NULL); + + /* make sure that we've enough space for result string */ + bufsize = strlen(avalue)*2+1; + rslt = malloc(bufsize); + if (rslt == NULL) { + free(avalue); + return (NULL); + } + memset(rslt, 0, bufsize); + bufend = rslt + bufsize - 1; /* reserve space for trailing '\0' */ + + /* skip spaces at beggining */ + padded = 0; + while (avalue[padded] == ' ') { + padded++; + avalue_size--; + } + + if (right_prec > 0) { + bufend -= right_prec; + memcpy(bufend, avalue + avalue_size+padded-right_prec, + (size_t) right_prec); + *--bufend = decimal_point; + avalue_size -= (right_prec + 1); + } + + if ((*flags & NEED_GROUPING) && + thousands_sep != '\0' && /* XXX: need investigation */ + *grouping != CHAR_MAX && + *grouping > 0) { + while (avalue_size > (int)*grouping) { + GRPCPY(*grouping); + GRPSEP; + grouping++; + + /* no more grouping ? */ + if (*grouping == CHAR_MAX) + break; + + /* rest grouping with same value ? */ + if (*grouping == 0) { + grouping--; + while (avalue_size > *grouping) { + GRPCPY(*grouping); + GRPSEP; + } + } + } + if (avalue_size != 0) + GRPCPY(avalue_size); + padded -= groups; + + } else { + bufend -= avalue_size; + memcpy(bufend, avalue+padded, (size_t) avalue_size); + if (right_prec == 0) + padded--; /* decrease assumed $decimal_point */ + } + + /* do padding with pad_char */ + if (padded > 0) { + bufend -= padded; + memset(bufend, pad_char, (size_t) padded); + } + + bufsize = bufsize - (bufend - rslt) + 1; + memmove(rslt, bufend, bufsize); + free(avalue); + return (rslt); +} + +ssize_t +strfmon(char * __restrict s, size_t maxsize, const char * __restrict format, + ...) +{ + ssize_t ret; + va_list ap; + + va_start(ap, format); + ret = _strfmon(s, maxsize, __current_locale(), format, ap); + va_end(ap); + return ret; +} + +ssize_t +strfmon_l(char * __restrict s, size_t maxsize, locale_t loc, + const char * __restrict format, ...) +{ + ssize_t ret; + va_list ap; + + NORMALIZE_LOCALE(loc); + va_start(ap, format); + ret = _strfmon(s, maxsize, loc, format, ap); + va_end(ap); + return ret; +} diff --git a/stdlib/OpenBSD/ecvt.3 b/stdlib/OpenBSD/ecvt.3 new file mode 100644 index 0000000..d8d663e --- /dev/null +++ b/stdlib/OpenBSD/ecvt.3 @@ -0,0 +1,165 @@ +.\" $OpenBSD: ecvt.3,v 1.8 2007/05/31 19:19:31 jmc Exp $ +.\" +.\" Copyright (c) 2002 Todd C. Miller +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" Sponsored in part by the Defense Advanced Research Projects +.\" Agency (DARPA) and Air Force Research Laboratory, Air Force +.\" Materiel Command, USAF, under agreement number F39502-99-1-0512. +.\" +.Dd $Mdocdate: May 31 2007 $ +.Dt ECVT 3 +.Os +.Sh NAME +.Nm ecvt , +.Nm fcvt , +.Nm gcvt +.Nd convert double to +.Tn ASCII +string +.Sh SYNOPSIS +.Fd #include +.Ft char * +.Fn ecvt "double value" "int ndigit" "int * restrict decpt" "int * restrict sign" +.Ft char * +.Fn fcvt "double value" "int ndigit" "int * restrict decpt" "int * restrict sign" +.Ft char * +.Fn gcvt "double value" "int ndigit" "char *buf" +.Sh DESCRIPTION +.Bf -symbolic +These functions are provided for compatibility with legacy code. +New code should use the +.Xr snprintf 3 +function for improved safety and portability. +.Ef +.Pp +The +.Fn ecvt , +.Fn fcvt +and +.Fn gcvt +functions convert the double precision floating-point number +.Fa value +to a NUL-terminated +.Tn ASCII +string. +.Pp +The +.Fn ecvt +function converts +.Fa value +to a NUL-terminated string of exactly +.Fa ndigit +digits and returns a pointer to that string. +The result is padded with zeroes from left to right as needed. +There are no leading zeroes unless +.Fa value +itself is 0. +The least significant digit is rounded in an implementation-dependent manner. +The position of the decimal point relative to the beginning of the string +is stored in +.Fa decpt . +A negative value indicates that the decimal point is located +to the left of the returned digits (this occurs when there is no +whole number component to +.Fa value ) . +If +.Fa value +is zero, it is unspecified whether the integer pointed to by +.Fa decpt +will be 0 or 1. +The decimal point itself is not included in the returned string. +If the sign of the result is negative, the integer pointed to by +.Fa sign +is non-zero; otherwise, it is 0. +.Pp +If the converted value is out of range or is not representable, +the contents of the returned string are unspecified. +.Pp +The +.Fn fcvt +function is identical to +.Fn ecvt +with the exception that +.Fa ndigit +specifies the number of digits after the decimal point (zero-padded as +needed). +.Pp +The +.Fn gcvt +function converts +.Fa value +to a NUL-terminated string similar to the %g +.Xr printf 3 +format specifier and stores the result in +.Fa buf . +It produces +.Fa ndigit +significant digits similar to the %f +.Xr printf 3 +format specifier where possible. +If +.Fa ndigit +does allow sufficient precision, the result is stored in +exponential notation similar to the %e +.Xr printf 3 +format specifier. +If +.Fa value +is less than zero, +.Fa buf +will be prefixed with a minus sign. +A decimal point is included in the returned string if +.Fa value +is not a whole number. +Unlike the +.Fn ecvt +and +.Fn fcvt +functions, +.Fa buf +is not zero-padded. +.Sh RETURN VALUES +The +.Fn ecvt , +.Fn fcvt +and +.Fn gcvt +functions return a NUL-terminated string representation of +.Fa value . +.Sh WARNINGS +The +.Fn ecvt +and +.Fn fcvt +functions return a pointer to internal storage space that will be +overwritten by subsequent calls to either function. +.Pp +The maximum possible precision of the return value is limited by the +precision of a double and may not be the same on all architectures. +.Pp +The +.Xr snprintf 3 +function is preferred over these functions for new code. +.Sh SEE ALSO +.Xr printf 3 , +.Xr strtod 3 +.Sh STANDARDS +The +.Fn ecvt , +.Fn fcvt +and +.Fn gcvt +functions conform to +.St -p1003.1-2001 . diff --git a/stdlib/OpenBSD/ecvt.c b/stdlib/OpenBSD/ecvt.c new file mode 100644 index 0000000..869674e --- /dev/null +++ b/stdlib/OpenBSD/ecvt.c @@ -0,0 +1,108 @@ +/* $OpenBSD: ecvt.c,v 1.7 2009/10/16 12:15:03 martynas Exp $ */ + +/* + * Copyright (c) 2002, 2006 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ + +#include +#include +#include +#include + +extern char *__dtoa(double, int, int, int *, int *, char **); +extern void __freedtoa(char *); +static char *__cvt(double, int, int *, int *, int, int); + +static char * +__cvt(double value, int ndigit, int * __restrict decpt, int * __restrict sign, int fmode, int pad) +{ + static char *s; + char *p, *rve, c; + size_t siz; + + if (ndigit == 0) { + *sign = value < 0.0; + *decpt = 0; + return (""); + } + + if (s) { + free(s); + s = NULL; + } + + if (ndigit < 0) + siz = -ndigit + 1; + else + siz = ndigit + 1; + + + /* __dtoa() doesn't allocate space for 0 so we do it by hand */ + if (value == 0.0) { + *decpt = 1 - fmode; /* 1 for 'e', 0 for 'f' */ + *sign = 0; + if ((rve = s = (char *)malloc(siz)) == NULL) + return(NULL); + *rve++ = '0'; + *rve = '\0'; + } else { + p = __dtoa(value, fmode + 2, ndigit, decpt, sign, &rve); + if (p == NULL) + return (NULL); + if (*decpt == 9999) { + /* Infinity or Nan, convert to inf or nan like printf */ + *decpt = 0; + c = *p; + __freedtoa(p); + return(c == 'I' ? "inf" : "nan"); + } + /* Make a local copy and adjust rve to be in terms of s */ + if (pad && fmode) + siz += *decpt; + if ((s = (char *)malloc(siz)) == NULL) { + __freedtoa(p); + return(NULL); + } + (void) strlcpy(s, p, siz); + rve = s + (rve - p); + __freedtoa(p); + } + + /* Add trailing zeros */ + if (pad) { + siz -= rve - s; + while (--siz) + *rve++ = '0'; + *rve = '\0'; + } + + return(s); +} + +char * +ecvt(double value, int ndigit, int * __restrict decpt, int * __restrict sign) +{ + return(__cvt(value, ndigit, decpt, sign, 0, 1)); +} + +char * +fcvt(double value, int ndigit, int * __restrict decpt, int * __restrict sign) +{ + return(__cvt(value, ndigit, decpt, sign, 1, 1)); +} diff --git a/stdlib/OpenBSD/gcvt.c b/stdlib/OpenBSD/gcvt.c new file mode 100644 index 0000000..703f783 --- /dev/null +++ b/stdlib/OpenBSD/gcvt.c @@ -0,0 +1,113 @@ +/* $OpenBSD: gcvt.c,v 1.11 2009/10/16 12:15:03 martynas Exp $ */ + +/* + * Copyright (c) 2002, 2003, 2006 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ + +#include +#include +#include +#include + +extern char *__dtoa(double, int, int, int *, int *, char **); +extern void __freedtoa(char *); + +char * +gcvt(double value, int ndigit, char *buf) +{ + char *digits, *dst, *src; + int i, decpt, sign; + struct lconv *lconv; + + lconv = localeconv(); + if (ndigit == 0) { + buf[0] = '\0'; + return (buf); + } + + digits = __dtoa(value, 2, ndigit, &decpt, &sign, NULL); + if (digits == NULL) + return (NULL); + if (decpt == 9999) { + /* + * Infinity or NaN, convert to inf or nan with sign. + * We assume the buffer is at least ndigit long. + */ + snprintf(buf, ndigit + 1, "%s%s", sign ? "-" : "", + *digits == 'I' ? "inf" : "nan"); + __freedtoa(digits); + return (buf); + } + + dst = buf; + if (sign) + *dst++ = '-'; + + if (decpt < 0 || decpt > ndigit) { + /* exponential format (e.g. 1.2345e+13) */ + if (--decpt < 0) { + sign = 1; + decpt = -decpt; + } else + sign = 0; + src = digits; + *dst++ = *src++; + dst = stpcpy(dst, lconv->decimal_point); + while (*src != '\0') + *dst++ = *src++; + *dst++ = 'e'; + if (sign) + *dst++ = '-'; + else + *dst++ = '+'; + if (decpt < 10) { + *dst++ = '0'; + *dst++ = '0' + decpt; + *dst = '\0'; + } else { + /* XXX - optimize */ + for (sign = decpt, i = 0; (sign /= 10) != 0; i++) + continue; + dst[i + 1] = '\0'; + while (decpt != 0) { + dst[i--] = '0' + decpt % 10; + decpt /= 10; + } + } + } else { + /* standard format */ + for (i = 0, src = digits; i < decpt; i++) { + if (*src != '\0') + *dst++ = *src++; + else + *dst++ = '0'; + } + if (*src != '\0') { + if (src == digits) + *dst++ = '0'; /* zero before decimal point */ + dst = stpcpy(dst, lconv->decimal_point); + for (i = decpt; digits[i] != '\0'; i++) { + *dst++ = digits[i]; + } + } + *dst = '\0'; + } + __freedtoa(digits); + return (buf); +} diff --git a/stdlib/a64l.3 b/stdlib/a64l.3 new file mode 100644 index 0000000..0ce2da8 --- /dev/null +++ b/stdlib/a64l.3 @@ -0,0 +1,144 @@ +.\" Copyright (c) 1997 Todd C. Miller +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $OpenBSD: a64l.3,v 1.5 2000/04/20 13:50:01 aaron Exp $ +.\" +.Dd August 17, 1997 +.Dt A64L 3 +.Os +.Sh NAME +.Nm a64l , +.Nm l64a +.Nd convert between 32-bit integer and radix-64 ASCII string +.Sh SYNOPSIS +.Fd #include +.Ft long +.Fn a64l "const char *s" +.Ft char * +.Fn l64a "long value" +.Sh DESCRIPTION +The +.Fn a64l +and +.Fn l64a +functions are used to maintain numbers stored in radix-64 +.Tn ASCII +characters. +This is a notation by which 32-bit integers +can be represented by up to six characters; each character represents a +.Dq digit +in a radix-64 notation. +.Pp +The characters used to represent digits are +.Ql \&. +for 0, +.Ql / +for 1, +.Ql 0 +through +.Ql 9 +for 2-11, +.Ql A +through +.Ql Z +for 12-37, and +.Ql a +through +.Ql z +for 38-63. +.Pp +The +.Fn a64l +function takes a pointer to a null-terminated radix-64 representation +and returns a corresponding 32-bit value. +If the string pointed to by +.Fa s +contains more than six characters, +.Fn a64l +will use the first six. +.Fn a64l +scans the character string from left to right, decoding +each character as a 6-bit radix-64 number. +If a long integer is +larger than 32 bits, the return value will be sign-extended. +.Pp +.Fn l64a +takes a long integer argument +.Fa value +and returns a pointer to the corresponding radix-64 representation. +.Sh RETURN VALUES +On success, +.Fn a64l +returns a 32-bit representation of +.Fa s . +If +.Fa s +is a null pointer or if it contains digits other than those described above. +.Fn a64l +returns \-1 and sets the global variable +.Va errno +to +.Er EINVAL . +.Pp +On success, +.Fn l64a +returns a pointer to a string containing the radix-64 representation of +.Fa value . +If +.Fa value +is 0, +.Fn l64a +returns a pointer to the empty string. +If +.Fa value +is negative, +.Fn l64a +returns a null pointer and sets the global variable +.Va errno +to +.Er EINVAL . +.Sh WARNINGS +The value returned by +.Fn l64a +is a pointer into a static buffer, the contents of which +will be overwritten by subsequent calls. +.Pp +The value returned by +.Fn a64l +may be incorrect if the value is too large; for that reason, only strings +that resulted from a call to +.Fn l64a +should be used to call +.Fn a64l . +.Pp +If a long integer is larger than 32 bits, only the low-order +32 bits are used. +.Sh STANDARDS +The +.Fn a64l +and +.Fn l64a +functions conform to +.St -xpg4.2 . diff --git a/stdlib/a64l.c b/stdlib/a64l.c new file mode 100644 index 0000000..b60b26e --- /dev/null +++ b/stdlib/a64l.c @@ -0,0 +1,47 @@ +/* + * Written by J.T. Conklin . + * Public domain. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char *rcsid = "$OpenBSD: a64l.c,v 1.3 1997/08/17 22:58:34 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +long +a64l(s) + const char *s; +{ + int value, digit, shift; + int i; + + if (s == NULL) { + errno = EINVAL; + return(-1L); + } + + value = 0; + shift = 0; + for (i = 0; *s && i < 6; i++, s++) { + if (*s >= '.' && *s <= '/') + digit = *s - '.'; + else if (*s >= '0' && *s <= '9') + digit = *s - '0' + 2; + else if (*s >= 'A' && *s <= 'Z') + digit = *s - 'A' + 12; + else if (*s >= 'a' && *s <= 'z') + digit = *s - 'a' + 38; + else { + errno = EINVAL; + return(-1L); + } + + value |= digit << shift; + shift += 6; + } + + return(value); +} + diff --git a/stdlib/grantpt.3 b/stdlib/grantpt.3 new file mode 100644 index 0000000..2f8c189 --- /dev/null +++ b/stdlib/grantpt.3 @@ -0,0 +1,281 @@ +.\" +.\" Copyright (c) 2002 The FreeBSD Project, Inc. +.\" All rights reserved. +.\" +.\" This software includes code contributed to the FreeBSD Project +.\" by Ryan Younce of North Carolina State University. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the FreeBSD Project nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +.\" PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT +.\" OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +.\" TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +.\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/stdlib/grantpt.3,v 1.3 2003/09/14 13:41:57 ru Exp $ +.\" +.Dd February 2, 2005 +.Os +.Dt GRANTPT 3 +.Sh NAME +.Nm grantpt , +.Nm posix_openpt , +.Nm ptsname , +.Nm ptsname_r , +.Nm unlockpt +.Nd pseudo-terminal access functions +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fo grantpt +.Fa "int fildes" +.Fc +.Ft "char *" +.Fo ptsname +.Fa "int fildes" +.Fc +.Ft "int" +.Fo ptsname_r +.Fa "int fildes" +.Fa "char *buffer" +.Fa "size_t buflen" +.Fc +.Ft int +.Fo unlockpt +.Fa "int fildes" +.Fc +.In stdlib.h +.In fcntl.h +.Ft int +.Fo posix_openpt +.Fa "int oflag" +.Fc +.Sh DESCRIPTION +The +.Fn grantpt , +.Fn ptsname , +.Fn ptsname_r , +.Fn unlockpt , +and +.Fn posix_openpt +functions allow access to pseudo-terminal devices. +The first four functions accept a file descriptor +that references the master half of a pseudo-terminal pair. +This file descriptor is created with +.Fn posix_openpt . +.Pp +The +.Fn grantpt +function is used to establish ownership and permissions +of the slave device counterpart to the master device +specified with +.Fa fildes . +The slave device's ownership is set to the real user ID +of the calling process; its permissions are set to +user readable-writable and group writable. +The group owner of the slave device is also set to the group +.Dq Li tty +if it exists on the system; otherwise, it +is left untouched. +.Pp +The +.Fn ptsname +and +.Fn ptsname_r +functions return the full pathname of the slave device +counterpart to the master device specified with +.Fa fildes . +This value can be used +to subsequently open the appropriate slave after +.Fn posix_openpt +and +.Fn grantpt +have been called. The +.Fn ptsname +function is not guaranteed to be reentrant or thread safe. The +.Fn ptsname_r +function takes a buffer and length as arguments to avoid this problem. +.Pp +The +.Fn unlockpt +function unlocks the slave pseudo-terminal device associated +with the master device to which +.Fa fildes +refers. +.Pp +The +.Fn posix_openpt +function opens the first available master pseudo-terminal +device and returns a descriptor to it. +The +.Fa oflag +argument +specifies the flags used for opening the device: +.Bl -tag -width ".Dv O_NOCTTY" +.It Dv O_RDWR +Open for reading and writing. +.It Dv O_NOCTTY +If set, do not allow the terminal to become +the controlling terminal for the calling process. +.El +.Sh RETURN VALUES +.Rv -std grantpt unlockpt +.Pp +The +.Fn ptsname +function returns a pointer to the name +of the slave device on success; otherwise a +.Dv NULL +pointer is returned and the global variable +.Va errno +is set to indicate the error. +.Pp +The +.Fn ptsname_r +function returns 0 if successful. On failure, it returns -1 and the global variable +.Va errno +is set to indicate the error. +.Pp +The +.Fn posix_openpt +function returns a file descriptor to the first +available master pseudo-terminal device on success; +otherwise \-1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn grantpt , +.Fn ptsname , +.Fn ptsname_r , +and +.Fn unlockpt +functions may fail and set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er EINVAL +.Fa fildes +is not a master pseudo-terminal device. +.El +.Pp +In addition, the +.Fn ptsname_r +function may set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Va buffer +argument is NULL. +.El +.Bl -tag -width Er +.It Bq Er ERANGE +The +.Va bufsize +argument is smaller than the length of the string to be returned. +.El +.Pp +In addition, the +.Fn grantpt +function may set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er EACCES +The slave pseudo-terminal device could not be accessed. +.El +.Pp +The +.Fn posix_openpt +function may fail and set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er EINVAL +.Fa oflag +consists of an invalid mode bit. +.It Bq Er EAGAIN +The system has no available pseudo-terminal devices. +.El +.Pp +The +.Fn grantpt , +.Fn ptsname , +.Fn ptsname_r , +and +.Fn unlockpt +functions may also fail and set +.Va errno +for any of the errors specified for the +.Xr fstat 2 +system call. +.Pp +The +.Fn posix_openpt +function may also fail and set +.Va errno +for any of the errors specified for the +.Xr open 2 +system call. +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +.Ft int +.br +.Fo grantpt +.Fa "int fildes" +.Fc ; +.Pp +.Ft "char *" +.br +.Fo ptsname +.Fa "int fildes" +.Fc ; +.Pp +.Ft int +.br +.Fo unlockpt +.Fa "int fildes" +.Fc ; +.Pp +.Fd #include +.Pp +.Ft int +.br +.Fo posix_openpt +.Fa "int oflag" +.Fc ; +.Sh SEE ALSO +.Xr open 2 , +.Xr pty 4 , +.Xr tty 4 , +.Xr compat 5 +.Sh STANDARDS +The +.Fn grantpt , +.Fn ptsname , +.Fn unlockpt , +and +.Fn posix_openpt +functions conform to +.St -p1003.1-2001 . diff --git a/stdlib/grantpt.c b/stdlib/grantpt.c new file mode 100644 index 0000000..bbc52cb --- /dev/null +++ b/stdlib/grantpt.c @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * posix_openpt call for cloning pty implementation. + * + * Just open /dev/ptmx + */ +int +posix_openpt(int flags) +{ + int fd = open("/dev/ptmx", flags); + if (fd >= 0) + return fd; + return -1; +} + +/* + * grantpt call for cloning pty implementation. + * + * Change UID and GID of slave pty associated with master pty whose + * fd is provided, to the real UID and real GID of the calling thread. + */ +int +grantpt(int fd) +{ + return ioctl(fd, TIOCPTYGRANT); +} + +// defined by TIOCPTYGNAME +#define PTSNAME_MAX_SIZE 128 + +static pthread_key_t ptsname_buffer_specific_key; +static os_once_t ptsname_once; + +static void +ptsname_once_init(void *ctx __unused) +{ + int ret = pthread_key_create(&ptsname_buffer_specific_key, free); + os_assert_zero(ret); +} + +/* + * ptsname call for cloning pty implementation. + * + * NOTE: Returns a pointer to a static buffer, which will be overwritten on + * subsequent calls. + */ +char * +ptsname(int fd) +{ + os_once(&ptsname_once, NULL, ptsname_once_init); + char *ptsnamebuf = pthread_getspecific(ptsname_buffer_specific_key); + + if (ptsnamebuf == NULL) { + ptsnamebuf = malloc(PTSNAME_MAX_SIZE); + os_assert(ptsnamebuf); + + int error = pthread_setspecific(ptsname_buffer_specific_key, ptsnamebuf); + os_assert_zero(error); + } + + int error = ptsname_r(fd, ptsnamebuf, PTSNAME_MAX_SIZE); + + return error ? NULL : ptsnamebuf; +} + +int +ptsname_r(int fd, char *buffer, size_t buflen) +{ + int error; + struct stat sbuf; + char ptsnamebuf[PTSNAME_MAX_SIZE]; + + if (!buffer) { + errno = EINVAL; + return -1; + } + + error = ioctl(fd, TIOCPTYGNAME, ptsnamebuf); + if (error) { + return -1; + } + + /* + * XXX TSD + * + * POSIX: Handle device rename test case, which is expected + * to fail if the pty has been renamed. + */ + error = stat(ptsnamebuf, &sbuf); + if (error) { + return -1; + } + + size_t len = strlen(ptsnamebuf) + 1; + if (buflen < len) { + errno = ERANGE; + return -1; + } + + memcpy(buffer, ptsnamebuf, len); + + return 0; +} + +/* + * unlockpt call for cloning pty implementation. + * + * Unlock the slave pty associated with the master to which fd refers. + */ +int +unlockpt(int fd) +{ + return ioctl(fd, TIOCPTYUNLK); +} diff --git a/stdlib/l64a.c b/stdlib/l64a.c new file mode 100644 index 0000000..32b904b --- /dev/null +++ b/stdlib/l64a.c @@ -0,0 +1,57 @@ +/* + * Written by J.T. Conklin . + * Public domain. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char *rcsid = "$OpenBSD: l64a.c,v 1.3 1997/08/17 22:58:34 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +char * +#ifdef __LP64__ +l64a(v) + long v; +#else /* !__LP64__ */ +l64a(value) + long value; +#endif /* __LP64__ */ +{ + static char buf[8]; +#ifdef __LP64__ + int value = v; +#endif /* __LP64__ */ + char *s = buf; + int digit; + int i; + +#ifndef __LP64__ + if (value < 0) { + errno = EINVAL; + return(NULL); + } +#endif /* __LP64__ */ + + for (i = 0; value != 0 && i < 6; i++) { + digit = value & 0x3f; + + if (digit < 2) + *s = digit + '.'; + else if (digit < 12) + *s = digit + '0' - 2; + else if (digit < 38) + *s = digit + 'A' - 12; + else + *s = digit + 'a' - 38; + + value >>= 6; + s++; + } + + *s = '\0'; + + return(buf); +} + diff --git a/stdlib/qsort_b.c b/stdlib/qsort_b.c new file mode 100644 index 0000000..9645c97 --- /dev/null +++ b/stdlib/qsort_b.c @@ -0,0 +1,17 @@ +#include +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wimplicit-function-declaration" +#pragma clang diagnostic ignored "-Wstrict-prototypes" +#pragma clang diagnostic ignored "-Wint-conversion" + +typedef int cmp_t(const void *, const void *); + +void +qsort_b(void *base, size_t nel, size_t width, cmp_t ^cmp_b) +{ + void *cmp_f = ((struct Block_layout *)cmp_b)->invoke; + qsort_r(base, nel, width, cmp_b, (void*)cmp_f); +} +#pragma clang diagnostic pop diff --git a/stdlib/strtod_l.3 b/stdlib/strtod_l.3 new file mode 100644 index 0000000..a27ed4f --- /dev/null +++ b/stdlib/strtod_l.3 @@ -0,0 +1,75 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strtod.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/strtod.3,v 1.19 2003/05/22 13:02:28 ru Exp $ +.\" +.Dd March 11, 2005 +.Dt STRTOD_L 3 +.Os +.Sh NAME +.Nm strtod_l , strtof_l , strtold_l +.Nd convert +.Tn ASCII +string to floating point +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.In xlocale.h +.Ft double +.Fn strtod_l "const char * restrict nptr" "char ** restrict endptr" "locale_t loc" +.Ft float +.Fn strtof_l "const char * restrict nptr" "char ** restrict endptr" "locale_t loc" +.Ft "long double" +.Fn strtold_l "const char * restrict nptr" "char ** restrict endptr" "locale_t loc" +.Sh DESCRIPTION +The +.Fn strtod_l , +.Fn strtof_l , +and +.Fn strtold_l +functions are extended locale versions of the +.Fn strtod , +.Fn strtof , +and +.Fn strtold +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr strtod 3 , +.Xr xlocale 3 diff --git a/stdlib/strtol_l.3 b/stdlib/strtol_l.3 new file mode 100644 index 0000000..ab992a3 --- /dev/null +++ b/stdlib/strtol_l.3 @@ -0,0 +1,107 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strtol.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdlib/strtol.3,v 1.19 2002/10/10 04:31:57 tjr Exp $ +.\" +.Dd March 11, 2005 +.Dt STRTOL_L 3 +.Os +.Sh NAME +.Nm strtol_l , strtoll_l , strtoimax_l , strtoq_l , +.Nm strtoul_l , strtoull_l , strtoumax_l , strtouq_l +.Nd "convert a string value to a" +.Vt long , "long long" , intmax_t , quad_t +.Vt "unsigned long" , "unsigned long long" , uintmax_t , +or +.Vt u_quad_t +integer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.In limits.h +.In xlocale.h +.Ft long +.Fn strtol_l "const char * restrict nptr" "char ** restrict endptr" "int base" "locale_t loc" +.Ft long long +.Fn strtoll_l "const char * restrict nptr" "char ** restrict endptr" "int base" "locale_t loc" +.Ft "unsigned long" +.Fn strtoul_l "const char * restrict nptr" "char ** restrict endptr" "int base" "locale_t loc" +.Ft "unsigned long long" +.Fn strtoull_l "const char * restrict nptr" "char ** restrict endptr" "int base" "locale_t loc" +.In inttypes.h +.In xlocale.h +.Ft intmax_t +.Fn strtoimax_l "const char * restrict nptr" "char ** restrict endptr" "int base" "locale_t loc" +.Ft uintmax_t +.Fn strtoumax_l "const char * restrict nptr" "char ** restrict endptr" "int base" "locale_t loc" +.In sys/types.h +.In stdlib.h +.In limits.h +.In xlocale.h +.Ft quad_t +.Fn strtoq_l "const char *nptr" "char **endptr" "int base" "locale_t loc" +.Ft u_quad_t +.Fn strtouq_l "const char *nptr" "char **endptr" "int base" "locale_t loc" +.Sh DESCRIPTION +The +.Fn strtol_l , +.Fn strtoll_l , +.Fn strtoimax_l , +.Fn strtoq_l , +.Fn strtoul_l , +.Fn strtoull_l , +.Fn strtoumax_l , +and +.Fn strtouq_l +functions are extended locale versions of the +.Fn strtol , +.Fn strtoll , +.Fn strtoimax , +.Fn strtoq , +.Fn strtoul , +.Fn strtoull , +.Fn strtoumax , +and +.Fn strtouq +functions, respectively. +Refer to their manual pages for details. +Also, see +.Xr xlocale 3 for more information about extended locales. +.Sh SEE ALSO +.Xr strtol 3 , +.Xr strtoul 3 , +.Xr xlocale 3 diff --git a/stdtime/CMakeLists.txt b/stdtime/CMakeLists.txt new file mode 100644 index 0000000..04b2d96 --- /dev/null +++ b/stdtime/CMakeLists.txt @@ -0,0 +1,35 @@ +project(libc-stdtime) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -include stdbool.h") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") + +set(stdtime_sources getdate.c timezone_unix03.c) + +set(stdtime_sources ${stdtime_sources} + FreeBSD/asctime.c + FreeBSD/difftime.c + FreeBSD/ftime.c + FreeBSD/localtime.c + FreeBSD/strftime.c + FreeBSD/strptime.c + FreeBSD/time32.c + FreeBSD/timelocal.c +) + +SET_SOURCE_FILES_PROPERTIES(FreeBSD/localtime.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_MKTIME") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/strftime.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_STRFTIME -DLIBC_ALIAS_STRFTIME_L") +SET_SOURCE_FILES_PROPERTIES(FreeBSD/strptime.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_STRPTIME -DLIBC_ALIAS_STRPTIME_L") + +add_darling_object_library(libc-stdtime ${stdtime_sources}) + +# Legacy variant +if (TARGET_i386) + set(stdtime-legacy_sources + FreeBSD/localtime.c + FreeBSD/strftime.c + FreeBSD/strptime.c) + add_library(libc-stdtime_legacy OBJECT ${stdtime-legacy_sources}) + SET_TARGET_PROPERTIES(libc-stdtime_legacy PROPERTIES COMPILE_DEFINITIONS "BUILDING_VARIANT;VARIANT_LEGACY") +endif (TARGET_i386) diff --git a/stdtime/FreeBSD/asctime.c b/stdtime/FreeBSD/asctime.c new file mode 100644 index 0000000..c96c408 --- /dev/null +++ b/stdtime/FreeBSD/asctime.c @@ -0,0 +1,141 @@ +/* +** This file is in the public domain, so clarified as of +** 1996-06-05 by Arthur David Olson. +*/ + +/* +** Avoid the temptation to punt entirely to strftime; +** the output of strftime is supposed to be locale specific +** whereas the output of asctime is supposed to be constant. +*/ + +#include +#include +#ifndef lint +#ifndef NOID +static char elsieid[] __unused = "@(#)asctime.c 8.2"; +#endif /* !defined NOID */ +#endif /* !defined lint */ +__FBSDID("$FreeBSD: src/lib/libc/stdtime/asctime.c,v 1.13 2009/05/23 06:31:50 edwin Exp $"); + +/*LINTLIBRARY*/ + +#include "namespace.h" +#include "private.h" +#include "un-namespace.h" +#include "tzfile.h" + +/* +** Some systems only handle "%.2d"; others only handle "%02d"; +** "%02.2d" makes (most) everybody happy. +** At least some versions of gcc warn about the %02.2d; +** we conditionalize below to avoid the warning. +*/ +/* +** All years associated with 32-bit time_t values are exactly four digits long; +** some years associated with 64-bit time_t values are not. +** Vintage programs are coded for years that are always four digits long +** and may assume that the newline always lands in the same place. +** For years that are less than four digits, we pad the output with +** leading zeroes to get the newline in the traditional place. +** The -4 ensures that we get four characters of output even if +** we call a strftime variant that produces fewer characters for some years. +** The ISO C 1999 and POSIX 1003.1-2004 standards prohibit padding the year, +** but many implementations pad anyway; most likely the standards are buggy. +*/ +#ifdef __GNUC__ +#define ASCTIME_FMT "%.3s %.3s%3d %2.2d:%2.2d:%2.2d %-4s\n" +#else /* !defined __GNUC__ */ +#define ASCTIME_FMT "%.3s %.3s%3d %02.2d:%02.2d:%02.2d %-4s\n" +#endif /* !defined __GNUC__ */ +/* +** For years that are more than four digits we put extra spaces before the year +** so that code trying to overwrite the newline won't end up overwriting +** a digit within a year and truncating the year (operating on the assumption +** that no output is better than wrong output). +*/ +#ifdef __GNUC__ +#define ASCTIME_FMT_B "%.3s %.3s%3d %2.2d:%2.2d:%2.2d %s\n" +#else /* !defined __GNUC__ */ +#define ASCTIME_FMT_B "%.3s %.3s%3d %02.2d:%02.2d:%02.2d %s\n" +#endif /* !defined __GNUC__ */ + +#define STD_ASCTIME_BUF_SIZE 26 +/* +** Big enough for something such as +** ??? ???-2147483648 -2147483648:-2147483648:-2147483648 -2147483648\n +** (two three-character abbreviations, five strings denoting integers, +** seven explicit spaces, two explicit colons, a newline, +** and a trailing ASCII nul). +** The values above are for systems where an int is 32 bits and are provided +** as an example; the define below calculates the maximum for the system at +** hand. +*/ +#define MAX_ASCTIME_BUF_SIZE (2*3+5*INT_STRLEN_MAXIMUM(int)+7+2+1+1) + +static char buf_asctime[MAX_ASCTIME_BUF_SIZE]; + +/* +** A la ISO/IEC 9945-1, ANSI/IEEE Std 1003.1, 2004 Edition. +*/ + +char * +asctime_r(const struct tm * __restrict timeptr, char * __restrict buf) +{ + static const char wday_name[][3] = { + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + }; + static const char mon_name[][3] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; + const char * wn; + const char * mn; + char year[INT_STRLEN_MAXIMUM(int) + 2]; + char result[MAX_ASCTIME_BUF_SIZE]; + + if (timeptr->tm_wday < 0 || timeptr->tm_wday >= DAYSPERWEEK) + wn = "???"; + else wn = wday_name[timeptr->tm_wday]; + if (timeptr->tm_mon < 0 || timeptr->tm_mon >= MONSPERYEAR) + mn = "???"; + else mn = mon_name[timeptr->tm_mon]; + /* + ** Use strftime's %Y to generate the year, to avoid overflow problems + ** when computing timeptr->tm_year + TM_YEAR_BASE. + ** Assume that strftime is unaffected by other out-of-range members + ** (e.g., timeptr->tm_mday) when processing "%Y". + */ + (void) strftime_l(year, sizeof(year), "%Y", timeptr, NULL); + /* + ** We avoid using snprintf since it's not available on all systems. + */ + (void) sprintf(result, + ((strlen(year) <= 4) ? ASCTIME_FMT : ASCTIME_FMT_B), + wn, mn, + timeptr->tm_mday, timeptr->tm_hour, + timeptr->tm_min, timeptr->tm_sec, + year); + if (strlen(result) < STD_ASCTIME_BUF_SIZE || buf == buf_asctime) { + (void) strcpy(buf, result); + return buf; + } else { +#ifdef EOVERFLOW + errno = EOVERFLOW; +#else /* !defined EOVERFLOW */ + errno = EINVAL; +#endif /* !defined EOVERFLOW */ + return NULL; + } +} + +/* +** A la ISO/IEC 9945-1, ANSI/IEEE Std 1003.1, 2004 Edition. +*/ + +char * +asctime(timeptr) +const struct tm * timeptr; +{ + return asctime_r(timeptr, buf_asctime); +} diff --git a/stdtime/FreeBSD/ctime.3 b/stdtime/FreeBSD/ctime.3 new file mode 100644 index 0000000..65dd91f --- /dev/null +++ b/stdtime/FreeBSD/ctime.3 @@ -0,0 +1,395 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Arthur Olson. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdtime/ctime.3,v 1.24 2007/01/09 00:28:11 imp Exp $ +.\" +.Dd January 2, 1999 +.Dt CTIME 3 +.Os +.Sh NAME +.Nm asctime , +.Nm asctime_r , +.Nm ctime , +.Nm ctime_r , +.Nm difftime , +.Nm gmtime , +.Nm gmtime_r , +.Nm localtime , +.Nm localtime_r , +.Nm mktime , +.Nm timegm , +.Nm timelocal +.Nd transform binary date and time values +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Vt extern char *tzname[2] ; +.Ft char * +.Fn asctime "const struct tm *timeptr" +.Ft char * +.Fn asctime_r "const struct tm *restrict timeptr" "char *restrict buf" +.Ft char * +.Fn ctime "const time_t *clock" +.Ft char * +.Fn ctime_r "const time_t *clock" "char *buf" +.Ft double +.Fn difftime "time_t time1" "time_t time0" +.Ft struct tm * +.Fn gmtime "const time_t *clock" +.Ft struct tm * +.Fn gmtime_r "const time_t *clock" "struct tm *result" +.Ft struct tm * +.Fn localtime "const time_t *clock" +.Ft struct tm * +.Fn localtime_r "const time_t *clock" "struct tm *result" +.Ft time_t +.Fn mktime "struct tm *timeptr" +.Ft time_t +.Fn timegm "struct tm *timeptr" +.Ft time_t +.Fn timelocal "struct tm *timeptr" +.Sh DESCRIPTION +The functions +.Fn ctime , +.Fn gmtime , +and +.Fn localtime +all take as an argument a time value representing the time in seconds since +the Epoch (00:00:00 +.Tn UTC , +January 1, 1970; see +.Xr time 3 ) . +When encountering an error, these functions return +.Dv NULL +and set +.Dv errno +to an appropriate value. +.Pp +The function +.Fn localtime +converts the time value pointed at by +.Fa clock . +It returns a pointer to a +.Dq Fa struct tm +(described below), which contains +the broken-out time information for the value after adjusting for the current +time zone (and any other factors such as Daylight Saving Time). +Time zone adjustments are performed as specified by the +.Ev TZ +environment variable (see +.Xr tzset 3 ) . +The function +.Fn localtime +uses +.Xr tzset 3 +to initialize time conversion information, if +.Xr tzset 3 +has not already been called by the process. +.Pp +After filling in the tm structure, +.Fn localtime +sets the +.Fa tm_isdst Ns 'th +element of +.Fa tzname +to a pointer to an +.Tn ASCII +string containing the time zone abbreviation to be +used with +.Fn localtime Ns 's +return value. +.Pp +The function +.Fn gmtime +also converts the time value, but makes no time zone adjustment. +It returns a pointer to a tm structure (described below). +.Pp +The +.Fn ctime +function +adjusts the time value for the current time zone, in the same manner as +.Fn localtime . +It returns a pointer to a 26-character string of the form: +.Bd -literal -offset indent +Thu Nov 24 18:22:48 1986\en\e0 +.Ed +.Pp +All of the fields have constant width. +.Pp +The +.Fn ctime_r +function +provides the same functionality as +.Fn ctime , +except that the caller must provide the output buffer +.Fa buf +(which must be at least 26 characters long) to store the result. +The +.Fn localtime_r +and +.Fn gmtime_r +functions +provide the same functionality as +.Fn localtime +and +.Fn gmtime , +respectively, except the caller must provide the output buffer +.Fa result . +.Pp +The +.Fn asctime +function +converts the broken-out time in the structure +.Fa tm +(pointed at by +.Fa *timeptr ) +to the form +shown in the example above. +.Pp +The +.Fn asctime_r +function +provides the same functionality as +.Fn asctime , +except that the caller provides the output buffer +.Fa buf +(which must be at least 26 characters long) to store the result. +.Pp +The functions +.Fn mktime +and +.Fn timegm +convert the broken-out time +(in the structure pointed to by +.Fa *timeptr ) +into a time value with the same encoding as that of the +values returned by the +.Xr time 3 +function (that is, seconds from the Epoch, +.Tn UTC ) . +The +.Fn mktime +function +interprets the input structure according to the current timezone setting +(see +.Xr tzset 3 ) . +The +.Fn timegm +function interprets the input structure +as representing Universal Coordinated Time +.Pq Tn UTC . +.Pp +The +.Fn timelocal +function is like +.Fn timegm , +but uses the current timezone setting. +This makes +.Fn timelocal +equivalent to +.Fn mktime . +.Pp +The original values of the +.Fa tm_wday +and +.Fa tm_yday +components of the structure are ignored. The original values of the +other components are not restricted to their normal ranges and will be +normalized, if need be. +For example, +October 40 is changed into November 9, +a +.Fa tm_hour +of \-1 means 1 hour before midnight, +.Fa tm_mday +of 0 means the day preceding the current month, and +.Fa tm_mon +of \-2 means 2 months before January of +.Fa tm_year . +(A positive or zero value for +.Fa tm_isdst +causes +.Fn mktime +to presume initially that summer time (for example, Daylight Saving Time) +is or is not (respectively) in effect for the specified time. +A negative value for +.Fa tm_isdst +causes the +.Fn mktime +function to attempt to divine whether summer time is in effect for the +specified time. +The +.Fa tm_isdst +and +.Fa tm_gmtoff +members are forced to zero by +.Fn timegm . ) +.Pp +On successful completion, the values of the +.Fa tm_wday +and +.Fa tm_yday +components of the structure are set appropriately, and the other components +are set to represent the specified calendar time, but with their values +forced to their normal ranges; the final value of +.Fa tm_mday +is not set until +.Fa tm_mon +and +.Fa tm_year +are determined. +The +.Fn mktime +function +returns the specified calendar time; if the calendar time cannot be +represented, it returns \-1; +.Pp +The +.Fn difftime +function +returns the difference between two calendar times, +.Pf ( Fa time1 +- +.Fa time0 ) , +expressed in seconds. +.Pp +External declarations, as well as the tm structure definition, +are contained in the +.In time.h +include file. +The tm structure includes at least the following fields: +.Bd -literal -offset indent +int tm_sec; /\(** seconds (0 - 60) \(**/ +int tm_min; /\(** minutes (0 - 59) \(**/ +int tm_hour; /\(** hours (0 - 23) \(**/ +int tm_mday; /\(** day of month (1 - 31) \(**/ +int tm_mon; /\(** month of year (0 - 11) \(**/ +int tm_year; /\(** year \- 1900 \(**/ +int tm_wday; /\(** day of week (Sunday = 0) \(**/ +int tm_yday; /\(** day of year (0 - 365) \(**/ +int tm_isdst; /\(** is summer time in effect? \(**/ +char \(**tm_zone; /\(** abbreviation of timezone name \(**/ +long tm_gmtoff; /\(** offset from UTC in seconds \(**/ +.Ed +.Pp +The +field +.Fa tm_isdst +is non-zero if summer (i.e., Daylight Saving) time is in effect. +.Pp +The field +.Fa tm_gmtoff +is the offset (in seconds) of the time represented from +.Tn UTC , +with positive +values indicating locations east of the Prime Meridian. +.Sh SEE ALSO +.Xr date 1 , +.Xr gettimeofday 2 , +.Xr getenv 3 , +.Xr time 3 , +.Xr tzset 3 , +.Xr tzfile 5 +.Sh STANDARDS +The +.Fn asctime , +.Fn ctime , +.Fn difftime , +.Fn gmtime , +.Fn localtime , +and +.Fn mktime +functions conform to +.St -isoC , +and conform to +.St -p1003.1-96 +provided the selected local timezone does not contain a leap-second table +(see +.Xr zic 8 ) . +.Pp +The +.Fn asctime_r , +.Fn ctime_r , +.Fn gmtime_r , +and +.Fn localtime_r +functions are expected to conform to +.St -p1003.1-96 +(again provided the selected local timezone does not contain a leap-second +table). +.Pp +The +.Fn timegm +function is not specified by any standard; its function cannot be +completely emulated using the standard functions described above. +.Sh HISTORY +This manual page is derived from +the time package contributed to Berkeley by +.An Arthur Olson +and which appeared in +.Bx 4.3 . +.Sh BUGS +Except for +.Fn difftime , +.Fn mktime , +and the +.Fn \&_r +variants of the other functions, +these functions leaves their result in an internal static object and return +a pointer to that object. +Subsequent calls to these +function will modify the same object. +.Pp +The C Standard provides no mechanism for a program to modify its current +local timezone setting, and the +.Tn POSIX Ns No \&-standard +method is not reentrant. +(However, thread-safe implementations are provided +in the +.Tn POSIX +threaded environment.) +.Pp +The +.Va tm_zone +field of a returned +.Vt tm +structure points to a static array of characters, +which will also be overwritten by any subsequent calls (as well as by +subsequent calls to +.Xr tzset 3 +and +.Xr tzsetwall 3 ) . +.Pp +Use of the external variable +.Fa tzname +is discouraged; the +.Fa tm_zone +entry in the tm structure is preferred. diff --git a/stdtime/FreeBSD/difftime.c b/stdtime/FreeBSD/difftime.c new file mode 100644 index 0000000..8d51ae0 --- /dev/null +++ b/stdtime/FreeBSD/difftime.c @@ -0,0 +1,73 @@ +/* +** This file is in the public domain, so clarified as of +** 1996-06-05 by Arthur David Olson. +*/ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" + +#include +#ifndef lint +#ifndef NOID +static char elsieid[] __unused = "@(#)difftime.c 8.1"; +#endif /* !defined NOID */ +#endif /* !defined lint */ +__FBSDID("$FreeBSD: src/lib/libc/stdtime/difftime.c,v 1.9 2009/05/23 06:31:50 edwin Exp $"); + +/*LINTLIBRARY*/ + +#include "namespace.h" +#include "private.h" /* for time_t, TYPE_INTEGRAL, and TYPE_SIGNED */ +#include "un-namespace.h" + +double +difftime(time1, time0) +const time_t time1; +const time_t time0; +{ + /* + ** If (sizeof (double) > sizeof (time_t)) simply convert and subtract + ** (assuming that the larger type has more precision). + ** This is the common real-world case circa 2004. + */ + if (sizeof (double) > sizeof (time_t)) + return (double) time1 - (double) time0; + if (!TYPE_INTEGRAL(time_t)) { + /* + ** time_t is floating. + */ + return time1 - time0; + } + if (!TYPE_SIGNED(time_t)) { + /* + ** time_t is integral and unsigned. + ** The difference of two unsigned values can't overflow + ** if the minuend is greater than or equal to the subtrahend. + */ + if (time1 >= time0) + return time1 - time0; + else return -((double) (time0 - time1)); + } + /* + ** time_t is integral and signed. + ** Handle cases where both time1 and time0 have the same sign + ** (meaning that their difference cannot overflow). + */ + if ((time1 < 0) == (time0 < 0)) + return time1 - time0; + /* + ** time1 and time0 have opposite signs. + ** Punt if unsigned long is too narrow. + */ + if (sizeof (unsigned long) < sizeof (time_t)) + return (double) time1 - (double) time0; + /* + ** Stay calm...decent optimizers will eliminate the complexity below. + */ + if (time1 >= 0 /* && time0 < 0 */) + return (unsigned long) time1 + + (unsigned long) (-(time0 + 1)) + 1; + return -(double) ((unsigned long) time0 + + (unsigned long) (-(time1 + 1)) + 1); +} +#pragma clang diagnostic pop diff --git a/stdtime/FreeBSD/ftime.3 b/stdtime/FreeBSD/ftime.3 new file mode 100644 index 0000000..4676bd8 --- /dev/null +++ b/stdtime/FreeBSD/ftime.3 @@ -0,0 +1,93 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ftime.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: /repoman/r/ncvs/src/lib/libcompat/4.1/ftime.3,v 1.11 2001/10/01 16:09:14 ru Exp $ +.\" +.Dd June 4, 1993 +.Dt FTIME 3 +.Os +.Sh NAME +.Nm ftime +.Nd get date and time +.Sh SYNOPSIS +.In sys/timeb.h +.Ft int +.Fo ftime +.Fa "struct timeb *tp" +.Fc +.Sh DESCRIPTION +.Bf -symbolic +This interface is obsoleted by +.Xr gettimeofday 2 . +.Ef +.Pp +The +.Fn ftime +routine fills in a structure pointed to by its argument, +as defined by +.Aq Pa sys/timeb.h : +.Bd -literal -offset indent +/* + * Structure returned by ftime system call + */ +struct timeb +{ + time_t time; + unsigned short millitm; + short timezone; + short dstflag; +}; +.Ed +.Pp +The structure contains the time since the epoch, in seconds; +up to 1000 milliseconds of more-precise interval; +the local time zone (measured in minutes of time westward from Greenwich); +and a flag that, if nonzero, indicates that +Daylight Saving time applies locally during the appropriate part of the year. +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/types.h +is necessary. +.Sh SEE ALSO +.Xr gettimeofday 2 , +.Xr settimeofday 2 , +.Xr ctime 3 , +.Xr time 3 , +.Xr compat 5 +.Sh HISTORY +The +.Nm +function appeared in +.Bx 4.2 . diff --git a/stdtime/FreeBSD/ftime.c b/stdtime/FreeBSD/ftime.c new file mode 100644 index 0000000..7e3195d --- /dev/null +++ b/stdtime/FreeBSD/ftime.c @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1994 Christopher G. Demetriou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if 0 +static char rcsid[] = "$FreeBSD: /repoman/r/ncvs/src/lib/libcompat/4.1/ftime.c,v 1.5 1999/08/28 00:04:12 peter Exp $"; +#endif /* not lint */ + +#include +#include +#include + +int +ftime(tbp) + struct timeb *tbp; +{ + struct timezone tz; + struct timeval t; + + if (gettimeofday(&t, &tz) < 0) + return (-1); + tbp->millitm = t.tv_usec / 1000; + tbp->time = t.tv_sec; + tbp->timezone = tz.tz_minuteswest; + tbp->dstflag = tz.tz_dsttime; + + return (0); +} diff --git a/stdtime/FreeBSD/localtime.c b/stdtime/FreeBSD/localtime.c new file mode 100644 index 0000000..ab37c66 --- /dev/null +++ b/stdtime/FreeBSD/localtime.c @@ -0,0 +1,2816 @@ +/* +** This file is in the public domain, so clarified as of +** 1996-06-05 by Arthur David Olson. +*/ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" + +#include +#ifndef lint +#ifndef NOID +static char elsieid[] __unused = "@(#)localtime.c 8.14"; +#endif /* !defined NOID */ +#endif /* !defined lint */ +__FBSDID("$FreeBSD: head/contrib/tzcode/stdtime/localtime.c 289027 2015-10-08 11:42:15Z rodrigc $"); + +/* +** Leap second handling from Bradley White. +** POSIX-style TZ environment variable handling from Guy Harris. +*/ + +/*LINTLIBRARY*/ + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#ifdef NOTIFY_TZ +//#define NOTIFY_TZ_DEBUG +//#define NOTIFY_TZ_DEBUG_FILE "/var/log/localtime.debug" +//#define NOTIFY_TZ_LOG "/var/log/localtime.log" +/* force ALL_STATE if NOTIFY_TZ is set */ +#ifndef ALL_STATE +#define ALL_STATE +#endif /* ALL_STATE */ +#include +#include +#include +#endif /* NOTIFY_TZ */ +#include "private.h" +#include "un-namespace.h" + +#include "tzfile.h" +#include "float.h" /* for FLT_MAX and DBL_MAX */ + +#ifndef TZ_ABBR_MAX_LEN +/* UNIX03 requires this to be the same as sysconf(_SC_TZNAME_MAX) */ +#define TZ_ABBR_MAX_LEN 255 +#endif /* !defined TZ_ABBR_MAX_LEN */ + +#ifndef TZ_ABBR_CHAR_SET +#define TZ_ABBR_CHAR_SET \ + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 :+-._" +#endif /* !defined TZ_ABBR_CHAR_SET */ + +#ifndef TZ_ABBR_ERR_CHAR +#define TZ_ABBR_ERR_CHAR '_' +#endif /* !defined TZ_ABBR_ERR_CHAR */ + +#include "libc_private.h" + +#define _MUTEX_LOCK(x) if (__isthreaded) _pthread_mutex_lock(x) +#define _MUTEX_UNLOCK(x) if (__isthreaded) _pthread_mutex_unlock(x) + +#define _RWLOCK_RDLOCK(x) \ + do { \ + if (__isthreaded) _pthread_rwlock_rdlock(x); \ + } while (0) + +#define _RWLOCK_WRLOCK(x) \ + do { \ + if (__isthreaded) _pthread_rwlock_wrlock(x); \ + } while (0) + +#define _RWLOCK_UNLOCK(x) \ + do { \ + if (__isthreaded) _pthread_rwlock_unlock(x); \ + } while (0) + +/* +** SunOS 4.1.1 headers lack O_BINARY. +*/ + +#ifdef O_BINARY +#define OPEN_MODE (O_RDONLY | O_BINARY) +#endif /* defined O_BINARY */ +#ifndef O_BINARY +#define OPEN_MODE O_RDONLY +#endif /* !defined O_BINARY */ + +#ifndef WILDABBR +/* +** Someone might make incorrect use of a time zone abbreviation: +** 1. They might reference tzname[0] before calling tzset (explicitly +** or implicitly). +** 2. They might reference tzname[1] before calling tzset (explicitly +** or implicitly). +** 3. They might reference tzname[1] after setting to a time zone +** in which Daylight Saving Time is never observed. +** 4. They might reference tzname[0] after setting to a time zone +** in which Standard Time is never observed. +** 5. They might reference tm.TM_ZONE after calling offtime. +** What's best to do in the above cases is open to debate; +** for now, we just set things up so that in any of the five cases +** WILDABBR is used. Another possibility: initialize tzname[0] to the +** string "tzname[0] used before set", and similarly for the other cases. +** And another: initialize tzname[0] to "ERA", with an explanation in the +** manual page of what this "time zone abbreviation" means (doing this so +** that tzname[0] has the "normal" length of three characters). +*/ +#define WILDABBR " " +#endif /* !defined WILDABBR */ + +__used static const char wildabbr[] = WILDABBR; + +/* + * In June 2004 it was decided UTC was a more appropriate default time + * zone than GMT. + */ + +__used static const char gmt[] = "UTC"; + +/* +** The DST rules to use if TZ has no rules and we can't load TZDEFRULES. +** We default to US rules as of 1999-08-17. +** POSIX 1003.1 section 8.1.1 says that the default DST rules are +** implementation dependent; for historical reasons, US rules are a +** common default. +*/ +#ifndef TZDEFRULESTRING +#define TZDEFRULESTRING ",M4.1.0,M10.5.0" +#endif /* !defined TZDEFDST */ + +struct ttinfo { /* time type information */ + long tt_gmtoff; /* UTC offset in seconds */ + int tt_isdst; /* used to set tm_isdst */ + int tt_abbrind; /* abbreviation list index */ + int tt_ttisstd; /* TRUE if transition is std time */ + int tt_ttisgmt; /* TRUE if transition is UTC */ +}; + +struct lsinfo { /* leap second information */ + time_t ls_trans; /* transition time */ + long ls_corr; /* correction to apply */ +}; + +#define BIGGEST(a, b) (((a) > (b)) ? (a) : (b)) + +#ifdef TZNAME_MAX +#define MY_TZNAME_MAX TZNAME_MAX +#endif /* defined TZNAME_MAX */ +#ifndef TZNAME_MAX +#define MY_TZNAME_MAX 255 +#endif /* !defined TZNAME_MAX */ + +struct state { + int leapcnt; + int timecnt; + int typecnt; + int charcnt; + int goback; + int goahead; + time_t ats[TZ_MAX_TIMES]; + unsigned char types[TZ_MAX_TIMES]; + struct ttinfo ttis[TZ_MAX_TYPES]; + char chars[BIGGEST(BIGGEST(TZ_MAX_CHARS + 1, sizeof gmt), + (2 * (MY_TZNAME_MAX + 1)))]; + struct lsinfo lsis[TZ_MAX_LEAPS]; +}; + +struct rule { + int r_type; /* type of rule--see below */ + int r_day; /* day number of rule */ + int r_week; /* week number of rule */ + int r_mon; /* month number of rule */ + long r_time; /* transition time of rule */ +}; + +#define JULIAN_DAY 0 /* Jn - Julian day */ +#define DAY_OF_YEAR 1 /* n - day of year */ +#define MONTH_NTH_DAY_OF_WEEK 2 /* Mm.n.d - month, week, day of week */ + +#ifdef NOTIFY_TZ +typedef struct { + int token; + int is_set; + int null_bootstrap; +} notify_tz_t; + +#define NOTIFY_TZ_NAME "com.apple.system.timezone" +#endif /* NOTIFY_TZ */ + +/* +** Prototypes for static functions. +*/ +#define localsub _st_localsub +#define time1 _st_time1 +#define tzset_basic _st_tzset_basic +__private_extern__ +#ifdef __LP64__ +struct tm * localsub(const time_t * timep, long offset, + struct tm * tmp); +#else /* !__LP64__ */ +void localsub(const time_t * timep, long offset, + struct tm * tmp); +#endif /* __LP64__ */ +__private_extern__ +time_t time1(struct tm * tmp, +#ifdef __LP64__ + struct tm *(*funcp) (const time_t *, + long, struct tm *), +#else /* !__LP64__ */ + void(*funcp) (const time_t *, + long, struct tm *), +#endif /* __LP64__ */ + long offset, + int unix03); +__private_extern__ +void tzset_basic(int); + +#if !BUILDING_VARIANT +static long detzcode(const char * codep); +static time_t detzcode64(const char * codep); +static int differ_by_repeat(time_t t1, time_t t0); +static const char * getzname(const char * strp, char **name, size_t *len); +static const char * getqzname(const char * strp, const int delim) + ATTRIBUTE_PURE; +static const char * getnum(const char * strp, int * nump, int min, + int max); +static const char * getsecs(const char * strp, long * secsp); +static const char * getoffset(const char * strp, long * offsetp); +static const char * getrule(const char * strp, struct rule * rulep); +#ifdef NOTIFY_TZ +static void gmtload(struct state * sp, char *path); +#else /* ! NOTIFY_TZ */ +static void gmtload(struct state * sp); +#endif /* NOTIFY_TZ */ +#ifdef __LP64__ +static struct tm * gmtsub(const time_t * timep, long offset, + struct tm * tmp); +#else /* !__LP64__ */ +static void gmtsub(const time_t * timep, long offset, + struct tm * tmp); +#endif /* __LP64__ */ +static int increment_overflow(int * number, int delta); +static int leaps_thru_end_of(int y) ATTRIBUTE_PURE; +static int long_increment_overflow(long * number, int delta); +static int long_normalize_overflow(long * tensptr, + int * unitsptr, int base); +static int normalize_overflow(int * tensptr, int * unitsptr, + int base); +#ifdef NOTIFY_TZ +static void notify_check_tz(notify_tz_t *p); +static void notify_register_tz(char *file, notify_tz_t *p); +#endif /* NOTIFY_TZ */ +static void settzname(void); +static time_t time2(struct tm *tmp, +#ifdef __LP64__ + struct tm *(*funcp) (const time_t *, + long, struct tm*), +#else /* !__LP64__ */ + void(*funcp) (const time_t *, + long, struct tm*), +#endif /* __LP64__ */ + long offset, int * okayp, int unix03); +static time_t time2sub(struct tm *tmp, +#ifdef __LP64__ + struct tm *(*funcp) (const time_t *, + long, struct tm*), +#else /* !__LP64__ */ + void(*funcp) (const time_t *, + long, struct tm*), +#endif /* __LP64__ */ + long offset, int * okayp, int do_norm_secs, + int unix03); +#ifdef __LP64__ +static struct tm * timesub(const time_t * timep, long offset, + const struct state * sp, struct tm * tmp); +#else /* !__LP64__ */ +static void timesub(const time_t * timep, long offset, + const struct state * sp, struct tm * tmp); +#endif /* __LP64__ */ +static int tmcomp(const struct tm * atmp, + const struct tm * btmp); +static time_t transtime(time_t janfirst, int year, + const struct rule * rulep, long offset) + ATTRIBUTE_PURE; +static int typesequiv(const struct state * sp, int a, int b); +#ifdef NOTIFY_TZ +static int tzload(const char * name, struct state * sp, char *path, int doextend); +#else /* ! NOTIFY_TZ */ +static int tzload(const char * name, struct state * sp, int doextend); +#endif /* NOTIFY_TZ */ +static int tzparse(const char * name, struct state * sp, + int lastditch); + +#ifdef ALL_STATE +static struct state * lclptr; +static struct state * gmtptr; +#endif /* defined ALL_STATE */ + +#ifndef ALL_STATE +static struct state lclmem; +static struct state gmtmem; +#define lclptr (&lclmem) +#define gmtptr (&gmtmem) +#endif /* State Farm */ + +#ifndef TZ_STRLEN_MAX +#define TZ_STRLEN_MAX 255 +#endif /* !defined TZ_STRLEN_MAX */ + +static char lcl_TZname[TZ_STRLEN_MAX + 1]; +#ifdef NOTIFY_TZ +#define lcl_is_set (lcl_notify.is_set) +#define gmt_is_set (gmt_notify.is_set) +#else /* ! NOTIFY_TZ */ +static int lcl_is_set; +#endif /* NOTIFY_TZ */ +static pthread_once_t gmt_once = PTHREAD_ONCE_INIT; +__private_extern__ pthread_rwlock_t lcl_rwlock = PTHREAD_RWLOCK_INITIALIZER; +static pthread_once_t gmtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t gmtime_key; +static int gmtime_key_error; +static pthread_once_t localtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t localtime_key; +static int localtime_key_error; + +char * tzname[2] = { + (char *)wildabbr, + (char *)wildabbr +}; + +/* +** Section 4.12.3 of X3.159-1989 requires that +** Except for the strftime function, these functions [asctime, +** ctime, gmtime, localtime] return values in one of two static +** objects: a broken-down time structure and an array of char. +** Thanks to Paul Eggert for noting this. +*/ + +static struct tm tm; + +#define USG_COMPAT +#define ALTZONE +#ifdef USG_COMPAT +int daylight = 0; +__private_extern__ void _st_set_timezone(long); +#endif /* defined USG_COMPAT */ + +#ifdef ALTZONE +__private_extern__ long __darwin_altzone = 0; +#define altzone __darwin_altzone +#endif /* defined ALTZONE */ + +#ifdef NOTIFY_TZ +#ifdef NOTIFY_TZ_DEBUG +#ifdef NOTIFY_TZ_DEBUG_FILE +#define NOTIFY_TZ_PRINTF(fmt, args...) \ +{ \ + FILE *_notify_tz_fp_; \ + if((_notify_tz_fp_ = fopen(NOTIFY_TZ_DEBUG_FILE, "a")) != NULL) { \ + fprintf(_notify_tz_fp_, "%d: " fmt, getpid(), ## args); \ + fclose(_notify_tz_fp_); \ + } \ +} +#else /* ! NOTIFY_TZ_DEBUG_FILE */ +#define NOTIFY_TZ_PRINTF(args...) fprintf(stdout, ## args) +#endif /* NOTIFY_TZ_DEBUG_FILE */ +#endif /* NOTIFY_TZ_DEBUG */ +#ifdef NOTIFY_TZ_LOG +#define NOTIFY_LOG(fmt, args...) \ +{ \ + FILE *_notify_log_fp_; \ + if((_notify_log_fp_ = fopen(NOTIFY_TZ_LOG, "a")) != NULL) { \ + fprintf(_notify_log_fp_, "%d: " fmt, getpid(), ## args); \ + fclose(_notify_log_fp_); \ + } \ +} +#endif /* NOTIFY_TZ_LOG */ + +static notify_tz_t gmt_notify = {-1, 0, 0}; +static notify_tz_t lcl_notify = {-1, 0, 0}; +static const char notify_tz_name[] = NOTIFY_TZ_NAME; +#endif /* NOTIFY_TZ */ + +static long +detzcode(const char *const codep) +{ + long result; + int i; + + result = (codep[0] & 0x80) ? ~0L : 0; + for (i = 0; i < 4; ++i) + result = (result << 8) | (codep[i] & 0xff); + return result; +} + +static time_t +detzcode64(const char *const codep) +{ + register time_t result; + register int i; + + result = (codep[0] & 0x80) ? (~(int_fast64_t) 0) : 0; + for (i = 0; i < 8; ++i) + result = result * 256 + (codep[i] & 0xff); + return result; +} + +static void +settzname(void) +{ + struct state * sp = lclptr; + int i, need; + unsigned char * types; +#define NEED_STD 1 +#define NEED_DST 2 +#define NEED_DAYLIGHT 4 +#define NEED_ALL (NEED_STD | NEED_DST | NEED_DAYLIGHT) + + tzname[0] = (char *)wildabbr; + tzname[1] = (char *)wildabbr; +#ifdef USG_COMPAT + daylight = 0; + _st_set_timezone(0); +#endif /* defined USG_COMPAT */ +#ifdef ALTZONE + altzone = 0; +#endif /* defined ALTZONE */ +#ifdef ALL_STATE + if (sp == NULL) { + tzname[0] = tzname[1] = (char *)gmt; + return; + } +#endif /* defined ALL_STATE */ + /* + * PR-3765457: The original settzname went sequentially through the ttis + * array, rather than correctly indexing via the types array, to get + * the real order of the timezone changes. In addition, as a speed up, + * we start at the end of the changes, and work back, so that most of + * the time, we don't have to look through the entire array. + */ + if (sp->timecnt == 0 && sp->typecnt == 1) { + /* + * Unfortunately, there is an edge case when typecnt == 1 and + * timecnt == 0, which would cause the loop to never run. So + * in that case, we fudge things up so that it is as if + * timecnt == 1. + */ + i = 0; + types = (unsigned char *)""; /* we use the null as index */ + } else { + /* the usual case */ + i = sp->timecnt - 1; + types = sp->types; + } + need = NEED_ALL; + for (; i >= 0 && need; --i) { + const struct ttinfo * const ttisp = &sp->ttis[types[i]]; + +#ifdef USG_COMPAT + if ((need & NEED_DAYLIGHT) && ttisp->tt_isdst) { + need &= ~NEED_DAYLIGHT; + daylight = 1; + } +#endif /* defined USG_COMPAT */ + if (ttisp->tt_isdst) { + if (need & NEED_DST) { + need &= ~NEED_DST; + tzname[1] = &sp->chars[ttisp->tt_abbrind]; +#ifdef ALTZONE + altzone = -(ttisp->tt_gmtoff); +#endif /* defined ALTZONE */ + } + } else if (need & NEED_STD) { + need &= ~NEED_STD; + tzname[0] = &sp->chars[ttisp->tt_abbrind]; +#ifdef USG_COMPAT + _st_set_timezone(-(ttisp->tt_gmtoff)); +#endif /* defined USG_COMPAT */ + } +#if defined(ALTZONE) || defined(USG_COMPAT) + if (i == 0) { +#endif /* defined(ALTZONE) || defined(USG_COMPAT) */ +#ifdef ALTZONE + if (need & NEED_DST) + altzone = -(ttisp->tt_gmtoff); +#endif /* defined ALTZONE */ +#ifdef USG_COMPAT + if (need & NEED_STD) + _st_set_timezone(-(ttisp->tt_gmtoff)); +#endif /* defined USG_COMPAT */ +#if defined(ALTZONE) || defined(USG_COMPAT) + } +#endif /* defined(ALTZONE) || defined(USG_COMPAT) */ + } + /* + ** Finally, scrub the abbreviations. + ** First, replace bogus characters. + */ + for (i = 0; i < sp->charcnt; ++i) + if (strchr(TZ_ABBR_CHAR_SET, sp->chars[i]) == NULL) + sp->chars[i] = TZ_ABBR_ERR_CHAR; + /* + ** Second, truncate long abbreviations. + */ + for (i = 0; i < sp->typecnt; ++i) { + register const struct ttinfo * const ttisp = &sp->ttis[i]; + register char * cp = &sp->chars[ttisp->tt_abbrind]; + + if (strlen(cp) > TZ_ABBR_MAX_LEN && + strcmp(cp, GRANDPARENTED) != 0) + *(cp + TZ_ABBR_MAX_LEN) = '\0'; + } +} + +#ifdef NOTIFY_TZ +static int +do_null_bootstrap_check(notify_tz_t *p) +{ + /* + * If we're running in a null bootstrap context (e.g. the bootstrap server), + * we will not be able to contact the notify server. In this case we want to + * avoid opening /etc/localtime every time the process does a asctime_r(3) + * or similar. But we have to do this once to get the right time zone. + * + * So first time through, we set a bit to indicate that we're in the null + * bootstrap context. The second time through, we force the "set" bit in the + * notify_tz_t structure to -1 and avoid the path where it can be set to + * zero (which would trigger opening and reloading the timezone file). + */ + if (bootstrap_port != MACH_PORT_NULL) { + return -1; + } + + if (!p->null_bootstrap) { + p->null_bootstrap = 1; + p->is_set = 0; + return -1; + } + + p->is_set = -1; + return 0; +} + +static void +notify_check_tz(notify_tz_t *p) +{ + unsigned int nstat; + int ncheck; + + if (p->token < 0) + return; + if (do_null_bootstrap_check(p) == 0) { + return; + } + nstat = notify_check(p->token, &ncheck); + if (nstat || ncheck) { + p->is_set = 0; +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("notify_check_tz: %s changed\n", (p == &lcl_notify) ? "lcl" : "gmt"); +#endif /* NOTIFY_TZ_DEBUG */ + } +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("notify_check_tz: %s unchanged\n", (p == &lcl_notify) ? "lcl" : "gmt"); +#endif /* NOTIFY_TZ_DEBUG */ +} + +extern uint32_t notify_monitor_file(int token, char *path, int flags); + +static void +notify_register_tz(char *file, notify_tz_t *p) +{ + char *name; + unsigned int nstat; + int ncheck; + + if (do_null_bootstrap_check(p) == 0) { + return; + } + + /*---------------------------------------------------------------- + * Since we don't record the last time zone filename, just cancel + * (which should remove the file monitor) and setup from scratch + *----------------------------------------------------------------*/ + if (p->token >= 0) + notify_cancel(p->token); + if (!file || *file == 0) { + /* no time zone file to monitor */ + p->token = -1; + return; + } + /*---------------------------------------------------------------- + * Just use com.apple.system.timezone if the path is /etc/localtime. + * Otherwise use com.apple.system.timezone. + *----------------------------------------------------------------*/ + if (TZDEFAULT && strcmp(file, TZDEFAULT) == 0) + name = (char *)notify_tz_name; + else { + name = alloca(sizeof(notify_tz_name) + strlen(file) + 1); + if (name == NULL) { + p->token = -1; + return; + } + strcpy(name, notify_tz_name); + strcat(name, "."); + strcat(name, file); + } +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("notify_register_tz: file=%s name=%s\n", file, name); +#endif /* NOTIFY_TZ_DEBUG */ + nstat = notify_register_check(name, &p->token); + if (nstat != 0) { + p->token = -1; + p->is_set = 0; +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("***notify_register_tz: notify_register_check failed: %u\n", nstat); +#endif /* NOTIFY_TZ_DEBUG */ +#ifdef NOTIFY_TZ_LOG + NOTIFY_LOG("notify_register_check(%s) failed: %u\n", name, nstat); +#endif /* NOTIFY_TZ_LOG */ + return; + } + /* don't need to request monitoring /etc/localtime */ + if (name != notify_tz_name) { +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("notify_register_tz: monitor %s\n", file); +#endif /* NOTIFY_TZ_DEBUG */ + nstat = notify_monitor_file(p->token, file, 0); + if (nstat != 0) { + notify_cancel(p->token); + p->token = -1; + p->is_set = 0; +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("***notify_register_tz: notify_monitor_file failed: %u\n", nstat); +#endif /* NOTIFY_TZ_DEBUG */ +#ifdef NOTIFY_TZ_LOG + NOTIFY_LOG("notify_monitor_file(%s) failed: %u\n", file, nstat); +#endif /* NOTIFY_TZ_LOG */ + return; + } + } + notify_check(p->token, &ncheck); /* this always returns true */ +} +#endif /* NOTIFY_TZ */ + +static int +differ_by_repeat(const time_t t1, const time_t t0) +{ + int_fast64_t _t0 = t0; + int_fast64_t _t1 = t1; + + if (TYPE_INTEGRAL(time_t) && + TYPE_BIT(time_t) - TYPE_SIGNED(time_t) < SECSPERREPEAT_BITS) + return 0; + //turn ((int_fast64_t)(t1 - t0) == SECSPERREPEAT); + return _t1 - _t0 == SECSPERREPEAT; +} + +static int +#ifdef NOTIFY_TZ +tzload(name, sp, path, doextend) +#else /* ! NOTIFY_TZ */ +tzload(name, sp, doextend) +#endif /* NOTIFY_TZ */ +const char * name; +struct state * const sp; +#ifdef NOTIFY_TZ +char * path; /* copy full path if non-NULL */ +#endif /* NOTIFY_TZ */ +register const int doextend; +{ + const char * p; + int i; + int fid; + int stored; + int nread; + int res; + union { + struct tzhead tzhead; + char buf[2 * sizeof(struct tzhead) + + 2 * sizeof *sp + + 4 * TZ_MAX_TIMES]; + } *u; + + u = NULL; + res = -1; + sp->goback = sp->goahead = FALSE; + +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("tzload: name=%s\n", name); +#endif /* NOTIFY_TZ_DEBUG */ + /* XXX The following is from OpenBSD, and I'm not sure it is correct */ + if (name != NULL && issetugid() != 0) + if ((name[0] == ':' && name[1] == '/') || + name[0] == '/' || strchr(name, '.')) + name = NULL; +#ifdef NOTIFY_TZ + if (path) + *path = 0; /* default to empty string on error */ +#endif /* NOTIFY_TZ */ + if (name == NULL && (name = TZDEFAULT) == NULL) + return -1; + { + int doaccess; + struct stat stab; + /* + ** Section 4.9.1 of the C standard says that + ** "FILENAME_MAX expands to an integral constant expression + ** that is the size needed for an array of char large enough + ** to hold the longest file name string that the implementation + ** guarantees can be opened." + */ + char *fullname; + + fullname = malloc(FILENAME_MAX + 1); + if (fullname == NULL) + goto out; + + if (name[0] == ':') + ++name; + doaccess = name[0] == '/'; + if (!doaccess) { + if ((p = TZDIR) == NULL) { + free(fullname); + return -1; + } + if (strlen(p) + 1 + strlen(name) >= FILENAME_MAX) { + free(fullname); + return -1; + } + (void) strcpy(fullname, p); + (void) strcat(fullname, "/"); + (void) strcat(fullname, name); + /* + ** Set doaccess if '.' (as in "../") shows up in name. + */ + if (strchr(name, '.') != NULL) + doaccess = TRUE; + name = fullname; + } +#ifdef NOTIFY_TZ + if (path) { + if (strlen(name) > FILENAME_MAX) + return -1; + strcpy(path, name); + } +#endif /* NOTIFY_TZ */ + if (doaccess && access(name, R_OK) != 0) { + free(fullname); + return -1; + } + if ((fid = _open(name, OPEN_MODE)) == -1) { + free(fullname); + return -1; + } + if ((_fstat(fid, &stab) < 0) || !S_ISREG(stab.st_mode)) { + free(fullname); + _close(fid); + return -1; + } + free(fullname); + } + u = malloc(sizeof(*u)); + if (u == NULL) + goto out; +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("tzload: reading %s\n", name); +#endif /* NOTIFY_TZ_DEBUG */ + nread = _read(fid, u->buf, sizeof u->buf); + if (_close(fid) < 0 || nread <= 0) + goto out; + for (stored = 4; stored <= 8; stored *= 2) { + int ttisstdcnt; + int ttisgmtcnt; + + ttisstdcnt = (int) detzcode(u->tzhead.tzh_ttisstdcnt); + ttisgmtcnt = (int) detzcode(u->tzhead.tzh_ttisgmtcnt); + sp->leapcnt = (int) detzcode(u->tzhead.tzh_leapcnt); + sp->timecnt = (int) detzcode(u->tzhead.tzh_timecnt); + sp->typecnt = (int) detzcode(u->tzhead.tzh_typecnt); + sp->charcnt = (int) detzcode(u->tzhead.tzh_charcnt); + p = u->tzhead.tzh_charcnt + sizeof u->tzhead.tzh_charcnt; + if (sp->leapcnt < 0 || sp->leapcnt > TZ_MAX_LEAPS || + sp->typecnt <= 0 || sp->typecnt > TZ_MAX_TYPES || + sp->timecnt < 0 || sp->timecnt > TZ_MAX_TIMES || + sp->charcnt < 0 || sp->charcnt > TZ_MAX_CHARS || + (ttisstdcnt != sp->typecnt && ttisstdcnt != 0) || + (ttisgmtcnt != sp->typecnt && ttisgmtcnt != 0)) + goto out; + if (nread - (p - u->buf) < + sp->timecnt * stored + /* ats */ + sp->timecnt + /* types */ + sp->typecnt * 6 + /* ttinfos */ + sp->charcnt + /* chars */ + sp->leapcnt * (stored + 4) + /* lsinfos */ + ttisstdcnt + /* ttisstds */ + ttisgmtcnt) /* ttisgmts */ + goto out; + for (i = 0; i < sp->timecnt; ++i) { + sp->ats[i] = (stored == 4) ? + detzcode(p) : detzcode64(p); + p += stored; + } + for (i = 0; i < sp->timecnt; ++i) { + sp->types[i] = (unsigned char) *p++; + if (sp->types[i] >= sp->typecnt) + goto out; + } + for (i = 0; i < sp->typecnt; ++i) { + struct ttinfo * ttisp; + + ttisp = &sp->ttis[i]; + ttisp->tt_gmtoff = detzcode(p); + p += 4; + ttisp->tt_isdst = (unsigned char) *p++; + if (ttisp->tt_isdst != 0 && ttisp->tt_isdst != 1) + goto out; + ttisp->tt_abbrind = (unsigned char) *p++; + if (ttisp->tt_abbrind < 0 || + ttisp->tt_abbrind > sp->charcnt) + goto out; + } + for (i = 0; i < sp->charcnt; ++i) + sp->chars[i] = *p++; + sp->chars[i] = '\0'; /* ensure '\0' at end */ + for (i = 0; i < sp->leapcnt; ++i) { + struct lsinfo * lsisp; + + lsisp = &sp->lsis[i]; + lsisp->ls_trans = (stored == 4) ? + detzcode(p) : detzcode64(p); + p += stored; + lsisp->ls_corr = detzcode(p); + p += 4; + } + for (i = 0; i < sp->typecnt; ++i) { + struct ttinfo * ttisp; + + ttisp = &sp->ttis[i]; + if (ttisstdcnt == 0) + ttisp->tt_ttisstd = FALSE; + else { + ttisp->tt_ttisstd = *p++; + if (ttisp->tt_ttisstd != TRUE && + ttisp->tt_ttisstd != FALSE) + goto out; + } + } + for (i = 0; i < sp->typecnt; ++i) { + struct ttinfo * ttisp; + + ttisp = &sp->ttis[i]; + if (ttisgmtcnt == 0) + ttisp->tt_ttisgmt = FALSE; + else { + ttisp->tt_ttisgmt = *p++; + if (ttisp->tt_ttisgmt != TRUE && + ttisp->tt_ttisgmt != FALSE) + goto out; + } + } + /* + ** Out-of-sort ats should mean we're running on a + ** signed time_t system but using a data file with + ** unsigned values (or vice versa). + */ + for (i = 0; i < sp->timecnt - 2; ++i) + if (sp->ats[i] > sp->ats[i + 1]) { + ++i; + if (TYPE_SIGNED(time_t)) { + /* + ** Ignore the end (easy). + */ + sp->timecnt = i; + } else { + /* + ** Ignore the beginning (harder). + */ + register int j; + + for (j = 0; j + i < sp->timecnt; ++j) { + sp->ats[j] = sp->ats[j + i]; + sp->types[j] = sp->types[j + i]; + } + sp->timecnt = j; + } + break; + } + /* + ** If this is an old file, we're done. + */ + if (u->tzhead.tzh_version[0] == '\0') + break; + nread -= p - u->buf; + for (i = 0; i < nread; ++i) + u->buf[i] = p[i]; + /* + ** If this is a narrow integer time_t system, we're done. + */ + if (stored >= (int) sizeof(time_t) && TYPE_INTEGRAL(time_t)) + break; + } + if (doextend && nread > 2 && + u->buf[0] == '\n' && u->buf[nread - 1] == '\n' && + sp->typecnt + 2 <= TZ_MAX_TYPES) { + struct state *ts; + register int result; + + ts = malloc(sizeof(*ts)); + if (ts == NULL) + goto out; + u->buf[nread - 1] = '\0'; + result = tzparse(&u->buf[1], ts, FALSE); + if (result == 0 && ts->typecnt == 2 && + sp->charcnt + ts->charcnt <= TZ_MAX_CHARS) { + for (i = 0; i < 2; ++i) + ts->ttis[i].tt_abbrind += + sp->charcnt; + for (i = 0; i < ts->charcnt; ++i) + sp->chars[sp->charcnt++] = + ts->chars[i]; + i = 0; + while (i < ts->timecnt && + ts->ats[i] <= + sp->ats[sp->timecnt - 1]) + ++i; + while (i < ts->timecnt && + sp->timecnt < TZ_MAX_TIMES) { + sp->ats[sp->timecnt] = + ts->ats[i]; + sp->types[sp->timecnt] = + sp->typecnt + + ts->types[i]; + ++sp->timecnt; + ++i; + } + sp->ttis[sp->typecnt++] = ts->ttis[0]; + sp->ttis[sp->typecnt++] = ts->ttis[1]; + } + free(ts); + } + if (sp->timecnt > 1) { + for (i = 1; i < sp->timecnt; ++i) + if (typesequiv(sp, sp->types[i], sp->types[0]) && + differ_by_repeat(sp->ats[i], sp->ats[0])) { + sp->goback = TRUE; + break; + } + for (i = sp->timecnt - 2; i >= 0; --i) + if (typesequiv(sp, sp->types[sp->timecnt - 1], + sp->types[i]) && + differ_by_repeat(sp->ats[sp->timecnt - 1], + sp->ats[i])) { + sp->goahead = TRUE; + break; + } + } + res = 0; +out: + free(u); + return (res); +} + +static int +typesequiv(sp, a, b) +const struct state * const sp; +const int a; +const int b; +{ + register int result; + + if (sp == NULL || + a < 0 || a >= sp->typecnt || + b < 0 || b >= sp->typecnt) + result = FALSE; + else { + register const struct ttinfo * ap = &sp->ttis[a]; + register const struct ttinfo * bp = &sp->ttis[b]; + result = ap->tt_gmtoff == bp->tt_gmtoff && + ap->tt_isdst == bp->tt_isdst && + ap->tt_ttisstd == bp->tt_ttisstd && + ap->tt_ttisgmt == bp->tt_ttisgmt && + strcmp(&sp->chars[ap->tt_abbrind], + &sp->chars[bp->tt_abbrind]) == 0; + } + return result; +} + +static const int mon_lengths[2][MONSPERYEAR] = { + { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, + { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } +}; + +static const int year_lengths[2] = { + DAYSPERNYEAR, DAYSPERLYEAR +}; + +/* +** Given a pointer into a time zone string, scan until a character that is not +** a valid character in a zone name is found. Return a pointer to that +** character. +*/ + +static const char * +getzname(strp, name, len) +const char * strp; +char ** name; +size_t * len; +{ + char c; + char * ket; + + if (*strp == '<' && (ket = strchr(strp, '>')) != NULL) { + *name = (char *)(strp + 1); + *len = ket - strp - 1; + return ket + 1; + } + *name = (char *)strp; + while ((c = *strp) != '\0' && !is_digit(c) && c != ',' && c != '-' && + c != '+') + ++strp; + *len = strp - *name; + return strp; +} + +/* +** Given a pointer into an extended time zone string, scan until the ending +** delimiter of the zone name is located. Return a pointer to the delimiter. +** +** As with getzname above, the legal character set is actually quite +** restricted, with other characters producing undefined results. +** We don't do any checking here; checking is done later in common-case code. +*/ + +static const char * +getqzname(register const char *strp, const int delim) +{ + register int c; + + while ((c = *strp) != '\0' && c != delim) + ++strp; + return strp; +} + +/* +** Given a pointer into a time zone string, extract a number from that string. +** Check that the number is within a specified range; if it is not, return +** NULL. +** Otherwise, return a pointer to the first character not part of the number. +*/ + +static const char * +getnum(strp, nump, min, max) +const char * strp; +int * const nump; +const int min; +const int max; +{ + char c; + int num; + + if (strp == NULL || !is_digit(c = *strp)) + return NULL; + num = 0; + do { + num = num * 10 + (c - '0'); + if (num > max) + return NULL; /* illegal value */ + c = *++strp; + } while (is_digit(c)); + if (num < min) + return NULL; /* illegal value */ + *nump = num; + return strp; +} + +/* +** Given a pointer into a time zone string, extract a number of seconds, +** in hh[:mm[:ss]] form, from the string. +** If any error occurs, return NULL. +** Otherwise, return a pointer to the first character not part of the number +** of seconds. +*/ + +static const char * +getsecs(strp, secsp) +const char * strp; +long * const secsp; +{ + int num; + + /* + ** `HOURSPERDAY * DAYSPERWEEK - 1' allows quasi-Posix rules like + ** "M10.4.6/26", which does not conform to Posix, + ** but which specifies the equivalent of + ** ``02:00 on the first Sunday on or after 23 Oct''. + */ + strp = getnum(strp, &num, 0, HOURSPERDAY * DAYSPERWEEK - 1); + if (strp == NULL) + return NULL; + *secsp = num * (long) SECSPERHOUR; + if (*strp == ':') { + ++strp; + strp = getnum(strp, &num, 0, MINSPERHOUR - 1); + if (strp == NULL) + return NULL; + *secsp += num * SECSPERMIN; + if (*strp == ':') { + ++strp; + /* `SECSPERMIN' allows for leap seconds. */ + strp = getnum(strp, &num, 0, SECSPERMIN); + if (strp == NULL) + return NULL; + *secsp += num; + } + } + return strp; +} + +/* +** Given a pointer into a time zone string, extract an offset, in +** [+-]hh[:mm[:ss]] form, from the string. +** If any error occurs, return NULL. +** Otherwise, return a pointer to the first character not part of the time. +*/ + +static const char * +getoffset(strp, offsetp) +const char * strp; +long * const offsetp; +{ + int neg = 0; + + if (*strp == '-') { + neg = 1; + ++strp; + } else if (*strp == '+') + ++strp; + strp = getsecs(strp, offsetp); + if (strp == NULL) + return NULL; /* illegal time */ + if (neg) + *offsetp = -*offsetp; + return strp; +} + +/* +** Given a pointer into a time zone string, extract a rule in the form +** date[/time]. See POSIX section 8 for the format of "date" and "time". +** If a valid rule is not found, return NULL. +** Otherwise, return a pointer to the first character not part of the rule. +*/ + +static const char * +getrule(strp, rulep) +const char * strp; +struct rule * const rulep; +{ + if (*strp == 'J') { + /* + ** Julian day. + */ + rulep->r_type = JULIAN_DAY; + ++strp; + strp = getnum(strp, &rulep->r_day, 1, DAYSPERNYEAR); + } else if (*strp == 'M') { + /* + ** Month, week, day. + */ + rulep->r_type = MONTH_NTH_DAY_OF_WEEK; + ++strp; + strp = getnum(strp, &rulep->r_mon, 1, MONSPERYEAR); + if (strp == NULL) + return NULL; + if (*strp++ != '.') + return NULL; + strp = getnum(strp, &rulep->r_week, 1, 5); + if (strp == NULL) + return NULL; + if (*strp++ != '.') + return NULL; + strp = getnum(strp, &rulep->r_day, 0, DAYSPERWEEK - 1); + } else if (is_digit(*strp)) { + /* + ** Day of year. + */ + rulep->r_type = DAY_OF_YEAR; + strp = getnum(strp, &rulep->r_day, 0, DAYSPERLYEAR - 1); + } else return NULL; /* invalid format */ + if (strp == NULL) + return NULL; + if (*strp == '/') { + /* + ** Time specified. + */ + ++strp; + strp = getsecs(strp, &rulep->r_time); + } else rulep->r_time = 2 * SECSPERHOUR; /* default = 2:00:00 */ + return strp; +} + +/* +** Given the Epoch-relative time of January 1, 00:00:00 UTC, in a year, the +** year, a rule, and the offset from UTC at the time that rule takes effect, +** calculate the Epoch-relative time that rule takes effect. +*/ + +static time_t +transtime(janfirst, year, rulep, offset) +const time_t janfirst; +const int year; +const struct rule * const rulep; +const long offset; +{ + int leapyear; + time_t value; + int i; + int d, m1, yy0, yy1, yy2, dow; + + INITIALIZE(value); + leapyear = isleap(year); + switch (rulep->r_type) { + + case JULIAN_DAY: + /* + ** Jn - Julian day, 1 == January 1, 60 == March 1 even in leap + ** years. + ** In non-leap years, or if the day number is 59 or less, just + ** add SECSPERDAY times the day number-1 to the time of + ** January 1, midnight, to get the day. + */ + value = janfirst + (rulep->r_day - 1) * SECSPERDAY; + if (leapyear && rulep->r_day >= 60) + value += SECSPERDAY; + break; + + case DAY_OF_YEAR: + /* + ** n - day of year. + ** Just add SECSPERDAY times the day number to the time of + ** January 1, midnight, to get the day. + */ + value = janfirst + rulep->r_day * SECSPERDAY; + break; + + case MONTH_NTH_DAY_OF_WEEK: + /* + ** Mm.n.d - nth "dth day" of month m. + */ + value = janfirst; + for (i = 0; i < rulep->r_mon - 1; ++i) + value += mon_lengths[leapyear][i] * SECSPERDAY; + + /* + ** Use Zeller's Congruence to get day-of-week of first day of + ** month. + */ + m1 = (rulep->r_mon + 9) % 12 + 1; + yy0 = (rulep->r_mon <= 2) ? (year - 1) : year; + yy1 = yy0 / 100; + yy2 = yy0 % 100; + dow = ((26 * m1 - 2) / 10 + + 1 + yy2 + yy2 / 4 + yy1 / 4 - 2 * yy1) % 7; + if (dow < 0) + dow += DAYSPERWEEK; + + /* + ** "dow" is the day-of-week of the first day of the month. Get + ** the day-of-month (zero-origin) of the first "dow" day of the + ** month. + */ + d = rulep->r_day - dow; + if (d < 0) + d += DAYSPERWEEK; + for (i = 1; i < rulep->r_week; ++i) { + if (d + DAYSPERWEEK >= + mon_lengths[leapyear][rulep->r_mon - 1]) + break; + d += DAYSPERWEEK; + } + + /* + ** "d" is the day-of-month (zero-origin) of the day we want. + */ + value += d * SECSPERDAY; + break; + } + + /* + ** "value" is the Epoch-relative time of 00:00:00 UTC on the day in + ** question. To get the Epoch-relative time of the specified local + ** time on that day, add the transition time and the current offset + ** from UTC. + */ + return value + rulep->r_time + offset; +} + +/* +** Given a POSIX section 8-style TZ string, fill in the rule tables as +** appropriate. +*/ + +static int +tzparse(name, sp, lastditch) +const char * name; +struct state * const sp; +const int lastditch; +{ + const char * stdname; + const char * dstname; + size_t stdlen; + size_t dstlen; + long stdoffset; + long dstoffset; + time_t * atp; + unsigned char * typep; + char * cp; + int load_result; + + INITIALIZE(dstname); + if (lastditch) { + stdname = name; + stdlen = strlen(name); /* length of standard zone name */ + name += stdlen; + if (stdlen >= sizeof sp->chars) + stdlen = (sizeof sp->chars) - 1; + stdoffset = 0; + } else { + name = getzname(name, (char **)&stdname, &stdlen); + if (*name == '\0') + return -1; /* was "stdoffset = 0;" */ + else { + name = getoffset(name, &stdoffset); + if (name == NULL) + return -1; + } + } +#ifdef NOTIFY_TZ + load_result = tzload(TZDEFRULES, sp, NULL, FALSE); +#else /* !NOTIFY_TZ */ + load_result = tzload(TZDEFRULES, sp, FALSE); +#endif /* NOTIFY_TZ */ + if (load_result != 0) + sp->leapcnt = 0; /* so, we're off a little */ + if (*name != '\0') { + if (*name == '<') { + dstname = ++name; + name = getqzname(name, '>'); + if (*name != '>') + return -1; + dstlen = name - dstname; + name++; + } else { + dstname = name; + name = getzname(name, (char **)&dstname, &dstlen); + } + if (*name != '\0' && *name != ',' && *name != ';') { + name = getoffset(name, &dstoffset); + if (name == NULL) + return -1; + } else dstoffset = stdoffset - SECSPERHOUR; + if (*name == '\0' && load_result != 0) + name = TZDEFRULESTRING; + if (*name == ',' || *name == ';') { + struct rule start; + struct rule end; + int year; + time_t janfirst; + time_t starttime; + time_t endtime; + + ++name; + if ((name = getrule(name, &start)) == NULL) + return -1; + if (*name++ != ',') + return -1; + if ((name = getrule(name, &end)) == NULL) + return -1; + if (*name != '\0') + return -1; + sp->typecnt = 2; /* standard time and DST */ + /* + ** Two transitions per year, from EPOCH_YEAR forward. + */ + sp->ttis[0].tt_gmtoff = -dstoffset; + sp->ttis[0].tt_isdst = 1; + sp->ttis[0].tt_abbrind = stdlen + 1; + sp->ttis[1].tt_gmtoff = -stdoffset; + sp->ttis[1].tt_isdst = 0; + sp->ttis[1].tt_abbrind = 0; + atp = sp->ats; + typep = sp->types; + janfirst = 0; + sp->timecnt = 0; + for (year = EPOCH_YEAR; + sp->timecnt + 2 <= TZ_MAX_TIMES; + ++year) { + time_t newfirst; + + starttime = transtime(janfirst, year, &start, + stdoffset); + endtime = transtime(janfirst, year, &end, + dstoffset); + if (starttime > endtime) { + *atp++ = endtime; + *typep++ = 1; /* DST ends */ + *atp++ = starttime; + *typep++ = 0; /* DST begins */ + } else { + *atp++ = starttime; + *typep++ = 0; /* DST begins */ + *atp++ = endtime; + *typep++ = 1; /* DST ends */ + } + sp->timecnt += 2; + newfirst = janfirst; + newfirst += year_lengths[isleap(year)] * + SECSPERDAY; + if (newfirst <= janfirst) + break; + janfirst = newfirst; + } + } else { + long theirstdoffset; + long theirdstoffset; + long theiroffset; + int isdst; + int i; + int j; + + if (*name != '\0') + return -1; + /* + ** Initial values of theirstdoffset and theirdstoffset. + */ + theirstdoffset = 0; + for (i = 0; i < sp->timecnt; ++i) { + j = sp->types[i]; + if (!sp->ttis[j].tt_isdst) { + theirstdoffset = + -sp->ttis[j].tt_gmtoff; + break; + } + } + theirdstoffset = 0; + for (i = 0; i < sp->timecnt; ++i) { + j = sp->types[i]; + if (sp->ttis[j].tt_isdst) { + theirdstoffset = + -sp->ttis[j].tt_gmtoff; + break; + } + } + /* + ** Initially we're assumed to be in standard time. + */ + isdst = FALSE; + theiroffset = theirstdoffset; + /* + ** Now juggle transition times and types + ** tracking offsets as you do. + */ + for (i = 0; i < sp->timecnt; ++i) { + j = sp->types[i]; + sp->types[i] = sp->ttis[j].tt_isdst; + if (sp->ttis[j].tt_ttisgmt) { + /* No adjustment to transition time */ + } else { + /* + ** If summer time is in effect, and the + ** transition time was not specified as + ** standard time, add the summer time + ** offset to the transition time; + ** otherwise, add the standard time + ** offset to the transition time. + */ + /* + ** Transitions from DST to DDST + ** will effectively disappear since + ** POSIX provides for only one DST + ** offset. + */ + if (isdst && !sp->ttis[j].tt_ttisstd) { + sp->ats[i] += dstoffset - + theirdstoffset; + } else { + sp->ats[i] += stdoffset - + theirstdoffset; + } + } + theiroffset = -sp->ttis[j].tt_gmtoff; + if (sp->ttis[j].tt_isdst) + theirdstoffset = theiroffset; + else theirstdoffset = theiroffset; + } + /* + ** Finally, fill in ttis. + ** ttisstd and ttisgmt need not be handled. + */ + sp->ttis[0].tt_gmtoff = -stdoffset; + sp->ttis[0].tt_isdst = FALSE; + sp->ttis[0].tt_abbrind = 0; + sp->ttis[1].tt_gmtoff = -dstoffset; + sp->ttis[1].tt_isdst = TRUE; + sp->ttis[1].tt_abbrind = stdlen + 1; + sp->typecnt = 2; + } + } else { + dstlen = 0; + sp->typecnt = 1; /* only standard time */ + sp->timecnt = 0; + sp->ttis[0].tt_gmtoff = -stdoffset; + sp->ttis[0].tt_isdst = 0; + sp->ttis[0].tt_abbrind = 0; + } + sp->charcnt = stdlen + 1; + if (dstlen != 0) + sp->charcnt += dstlen + 1; + if ((size_t) sp->charcnt > sizeof sp->chars) + return -1; + cp = sp->chars; + (void) strncpy(cp, stdname, stdlen); + cp += stdlen; + *cp++ = '\0'; + if (dstlen != 0) { + (void) strncpy(cp, dstname, dstlen); + *(cp + dstlen) = '\0'; + } + return 0; +} + +static void +#ifdef NOTIFY_TZ +gmtload(sp, path) +#else /* ! NOTIFY_TZ */ +gmtload(sp) +#endif /* NOTIFY_TZ */ +struct state * const sp; +#ifdef NOTIFY_TZ +char *path; +#endif /* NOTIFY_TZ */ +{ +#ifdef NOTIFY_TZ + if (tzload(gmt, sp, path, TRUE) != 0) +#else /* ! NOTIFY_TZ */ + if (tzload(gmt, sp, TRUE) != 0) +#endif /* NOTIFY_TZ */ + (void) tzparse(gmt, sp, TRUE); +} + +static void +tzsetwall_basic(int rdlocked) +{ +#ifdef NOTIFY_TZ + notify_check_tz(&lcl_notify); +#else + if (TZDEFAULT) { + static struct timespec last_mtimespec = {0, 0}; + struct stat statbuf; + + if (lstat(TZDEFAULT, &statbuf) == 0) { + if (statbuf.st_mtimespec.tv_sec > last_mtimespec.tv_sec || + (statbuf.st_mtimespec.tv_sec == last_mtimespec.tv_sec && + statbuf.st_mtimespec.tv_nsec > last_mtimespec.tv_nsec)) { + /* Trigger resetting the local TZ */ + lcl_is_set = 0; + } + last_mtimespec = statbuf.st_mtimespec; + } + } +#endif /* NOTIFY_TZ */ + if (!rdlocked) + _RWLOCK_RDLOCK(&lcl_rwlock); + if (lcl_is_set < 0) { +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("tzsetwall_basic lcl_is_set < 0\n"); +#endif + if (!rdlocked) + _RWLOCK_UNLOCK(&lcl_rwlock); + return; + } +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("tzsetwall_basic not set\n"); +#endif + _RWLOCK_UNLOCK(&lcl_rwlock); + + _RWLOCK_WRLOCK(&lcl_rwlock); + lcl_is_set = -1; + +#ifdef ALL_STATE + if (lclptr == NULL) { + lclptr = calloc(1, sizeof *lclptr); + if (lclptr == NULL) { + settzname(); /* all we can do */ + _RWLOCK_UNLOCK(&lcl_rwlock); + if (rdlocked) + _RWLOCK_RDLOCK(&lcl_rwlock); + return; + } + } +#endif /* defined ALL_STATE */ +#ifdef NOTIFY_TZ + { + char fullname[FILENAME_MAX + 1]; + if (tzload((char *) NULL, lclptr, fullname, TRUE) != 0) + /* + * If fullname is empty (an error occurred) then + * default to the UTC path + */ + gmtload(lclptr, *fullname ? NULL : fullname); + notify_register_tz(fullname, &lcl_notify); + } +#else /* ! NOTIFY_TZ */ + if (tzload((char *) NULL, lclptr, TRUE) != 0) + gmtload(lclptr); +#endif /* NOTIFY_TZ */ + settzname(); + _RWLOCK_UNLOCK(&lcl_rwlock); + + if (rdlocked) + _RWLOCK_RDLOCK(&lcl_rwlock); +} + +void +tzsetwall(void) +{ +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("tzsetwall called\n"); +#endif /* NOTIFY_TZ_DEBUG */ + tzsetwall_basic(0); +} + +__private_extern__ void +tzset_basic(int rdlocked) +{ + const char * name; + + name = getenv("TZ"); + if (name == NULL) { + tzsetwall_basic(rdlocked); + return; + } + +#ifdef NOTIFY_TZ + notify_check_tz(&lcl_notify); +#endif /* NOTIFY_TZ */ + if (!rdlocked) + _RWLOCK_RDLOCK(&lcl_rwlock); + if (lcl_is_set > 0 && strcmp(lcl_TZname, name) == 0) { + if (!rdlocked) + _RWLOCK_UNLOCK(&lcl_rwlock); +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("tzset_basic matched %s\n", lcl_TZname); +#endif + return; + } + _RWLOCK_UNLOCK(&lcl_rwlock); + + _RWLOCK_WRLOCK(&lcl_rwlock); + lcl_is_set = strlen(name) < sizeof lcl_TZname; + if (lcl_is_set) + (void) strcpy(lcl_TZname, name); + +#ifdef ALL_STATE + if (lclptr == NULL) { + lclptr = (struct state *) calloc(1, sizeof *lclptr); + if (lclptr == NULL) { + settzname(); /* all we can do */ + _RWLOCK_UNLOCK(&lcl_rwlock); + if (rdlocked) + _RWLOCK_RDLOCK(&lcl_rwlock); + return; + } + } +#endif /* defined ALL_STATE */ + if (*name == '\0') { + /* + ** User wants it fast rather than right. + */ + lclptr->leapcnt = 0; /* so, we're off a little */ + lclptr->timecnt = 0; + lclptr->typecnt = 0; + lclptr->ttis[0].tt_isdst = 0; + lclptr->ttis[0].tt_gmtoff = 0; + lclptr->ttis[0].tt_abbrind = 0; + (void) strcpy(lclptr->chars, gmt); +#ifdef NOTIFY_TZ + notify_register_tz(NULL, &lcl_notify); +#endif /* NOTIFY_TZ */ + } else +#ifdef NOTIFY_TZ + { + char fullname[FILENAME_MAX + 1]; + /* + * parsedOK indicates whether tzparse() was called and + * succeeded. This means that TZ is a time conversion + * specification, so we don't need to register for + * notifications. + */ + int parsedOK = FALSE; + if (tzload(name, lclptr, fullname, TRUE) != 0) + if (name[0] == ':' || !(parsedOK = tzparse(name, lclptr, FALSE) == 0)) + /* + * If fullname is empty (an error occurred) then + * default to the UTC path + */ + (void) gmtload(lclptr, *fullname ? NULL : fullname); + notify_register_tz(parsedOK ? NULL : fullname, &lcl_notify); + } +#else /* ! NOTIFY_TZ */ + if (tzload(name, lclptr, TRUE) != 0) + if (name[0] == ':' || tzparse(name, lclptr, FALSE) != 0) + (void) gmtload(lclptr); +#endif /* NOTIFY_TZ */ + settzname(); + _RWLOCK_UNLOCK(&lcl_rwlock); + + if (rdlocked) + _RWLOCK_RDLOCK(&lcl_rwlock); +} + +void +tzset(void) +{ +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("tzset called TZ=%s\n", getenv("TZ")); +#endif /* NOTIFY_TZ_DEBUG */ + tzset_basic(0); +} + +/* +** The easy way to behave "as if no library function calls" localtime +** is to not call it--so we drop its guts into "localsub", which can be +** freely called. (And no, the PANS doesn't require the above behavior-- +** but it *is* desirable.) +** +** The unused offset argument is for the benefit of mktime variants. +*/ + +/*ARGSUSED*/ +#ifdef __LP64__ +__private_extern__ struct tm * +#else /* !__LP64__ */ +__private_extern__ void +#endif /* __LP64__ */ +localsub(const time_t *const timep, const long offset, struct tm *const tmp) +{ + struct state * sp; + const struct ttinfo * ttisp; + int i; +#ifdef __LP64__ + struct tm * result; +#endif /* __LP64__ */ + const time_t t = *timep; + +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("localsub called\n"); +#endif /* NOTIFY_TZ_DEBUG */ + sp = lclptr; +#ifdef ALL_STATE + if (sp == NULL) { +#ifdef __LP64__ + return gmtsub(timep, offset, tmp); +#else /* !__LP64__ */ + gmtsub(timep, offset, tmp); + return; +#endif /* __LP64__ */ + } +#endif /* defined ALL_STATE */ + if ((sp->goback && t < sp->ats[0]) || + (sp->goahead && t > sp->ats[sp->timecnt - 1])) { + time_t newt = t; + register time_t seconds; + register time_t tcycles; + register int_fast64_t icycles; + + if (t < sp->ats[0]) + seconds = sp->ats[0] - t; + else seconds = t - sp->ats[sp->timecnt - 1]; + --seconds; + tcycles = seconds / YEARSPERREPEAT / AVGSECSPERYEAR; + ++tcycles; + icycles = tcycles; + if (tcycles - icycles >= 1 || icycles - tcycles >= 1) { +#ifdef __LP64__ + return NULL; +#else /* !__LP64__ */ + return; +#endif /* __LP64__ */ + } + seconds = icycles; + seconds *= YEARSPERREPEAT; + seconds *= AVGSECSPERYEAR; + if (t < sp->ats[0]) + newt += seconds; + else newt -= seconds; + if (newt < sp->ats[0] || + newt > sp->ats[sp->timecnt - 1]) +#ifdef __LP64__ + return NULL; /* "cannot happen" */ + result = localsub(&newt, offset, tmp); + if (result == tmp) { +#else /* !__LP64__ */ + return; + localsub(&newt, offset, tmp); + { +#endif /* __LP64__ */ + register time_t newy; + + newy = tmp->tm_year; + if (t < sp->ats[0]) + newy -= icycles * YEARSPERREPEAT; + else newy += icycles * YEARSPERREPEAT; + tmp->tm_year = newy; + if (tmp->tm_year != newy) +#ifdef __LP64__ + return NULL; + } + return result; +#else /* !__LP64__ */ + return; + } + return; +#endif /* __LP64__ */ + } + if (sp->timecnt == 0 || t < sp->ats[0]) { + i = 0; + while (sp->ttis[i].tt_isdst) + if (++i >= sp->typecnt) { + i = 0; + break; + } + } else { + register int lo = 1; + register int hi = sp->timecnt; + + while (lo < hi) { + register int mid = (lo + hi) >> 1; + + if (t < sp->ats[mid]) + hi = mid; + else lo = mid + 1; + } + i = (int) sp->types[lo - 1]; + } + ttisp = &sp->ttis[i]; + /* + ** To get (wrong) behavior that's compatible with System V Release 2.0 + ** you'd replace the statement below with + ** t += ttisp->tt_gmtoff; + ** timesub(&t, 0L, sp, tmp); + */ +#ifdef __LP64__ + result = timesub(&t, ttisp->tt_gmtoff, sp, tmp); + if (result == NULL) + return NULL; +#else /* !__LP64__ */ + timesub(&t, ttisp->tt_gmtoff, sp, tmp); +#endif /* __LP64__ */ + tmp->tm_isdst = ttisp->tt_isdst; + tzname[tmp->tm_isdst] = &sp->chars[ttisp->tt_abbrind]; +#ifdef TM_ZONE + tmp->TM_ZONE = &sp->chars[ttisp->tt_abbrind]; +#endif /* defined TM_ZONE */ +#ifdef __LP64__ + return result; +#endif /* __LP64__ */ +} + +static void +localtime_key_init(void) +{ + + localtime_key = __LIBC_PTHREAD_KEY_LOCALTIME; + localtime_key_error = pthread_key_init_np(localtime_key, free); +} + +struct tm * +localtime(const time_t *const timep) +{ + struct tm *p_tm; + + if (__isthreaded != 0) { + _pthread_once(&localtime_once, localtime_key_init); + if (localtime_key_error != 0) { + errno = localtime_key_error; + return(NULL); + } + p_tm = _pthread_getspecific(localtime_key); + if (p_tm == NULL) { + if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) + == NULL) + return(NULL); + _pthread_setspecific(localtime_key, p_tm); + } + _RWLOCK_RDLOCK(&lcl_rwlock); + tzset_basic(1); +#ifdef __LP64__ + p_tm = localsub(timep, 0L, p_tm); +#else /* !__LP64__ */ + localsub(timep, 0L, p_tm); +#endif /* __LP64__ */ + _RWLOCK_UNLOCK(&lcl_rwlock); + return(p_tm); + } else { + tzset_basic(0); +#ifdef __LP64__ + return localsub(timep, 0L, &tm); +#else /* !__LP64__ */ + localsub(timep, 0L, &tm); + return(&tm); +#endif /* __LP64__ */ + } +} + +/* +** Re-entrant version of localtime. +*/ + +struct tm * +localtime_r(const time_t *const __restrict timep, struct tm * __restrict tmp) +{ + _RWLOCK_RDLOCK(&lcl_rwlock); + tzset_basic(1); +#ifdef __LP64__ + tmp = localsub(timep, 0L, tmp); +#else /* !__LP64__ */ + localsub(timep, 0L, tmp); +#endif /* __LP64__ */ + _RWLOCK_UNLOCK(&lcl_rwlock); + return tmp; +} + +static void +gmt_init(void) +{ + +#ifdef ALL_STATE +#ifdef NOTIFY_TZ + if (gmtptr == NULL) +#endif /* NOTIFY_TZ */ + gmtptr = (struct state *) calloc(1, sizeof *gmtptr); + if (gmtptr != NULL) +#endif /* defined ALL_STATE */ +#ifdef NOTIFY_TZ + { + char fullname[FILENAME_MAX + 1]; + gmtload(gmtptr, fullname); + notify_register_tz(fullname, &gmt_notify); + } +#else /* ! NOTIFY_TZ */ + gmtload(gmtptr); +#endif /* NOTIFY_TZ */ +} + +/* +** gmtsub is to gmtime as localsub is to localtime. +*/ + +#ifdef __LP64__ +static struct tm * +#else /* !__LP64__ */ +static void +#endif /* __LP64__ */ +gmtsub(timep, offset, tmp) +const time_t * const timep; +const long offset; +struct tm * const tmp; +{ +#ifdef __LP64__ + register struct tm * result; +#endif /* __LP64__ */ + +#ifdef NOTIFY_TZ_DEBUG + NOTIFY_TZ_PRINTF("gmtsub called\n"); +#endif /* NOTIFY_TZ_DEBUG */ +#ifdef NOTIFY_TZ + notify_check_tz(&gmt_notify); +#endif /* NOTIFY_TZ */ + pthread_once(&gmt_once, gmt_init); +#ifdef __LP64__ + result = timesub(timep, offset, gmtptr, tmp); + if (result == NULL) + return NULL; +#else /* !__LP64__ */ + timesub(timep, offset, gmtptr, tmp); +#endif /* __LP64__ */ +#ifdef TM_ZONE + /* + ** Could get fancy here and deliver something such as + ** "UTC+xxxx" or "UTC-xxxx" if offset is non-zero, + ** but this is no time for a treasure hunt. + */ + if (offset != 0) + tmp->TM_ZONE = (char*)wildabbr; + else { +#ifdef ALL_STATE + if (gmtptr == NULL) + tmp->TM_ZONE = (char *)gmt; + else tmp->TM_ZONE = gmtptr->chars; +#endif /* defined ALL_STATE */ +#ifndef ALL_STATE + tmp->TM_ZONE = gmtptr->chars; +#endif /* State Farm */ + } +#endif /* defined TM_ZONE */ +#ifdef __LP64__ + return result; +#endif /* __LP64__ */ +} + +static void +gmtime_key_init(void) +{ + + gmtime_key = __LIBC_PTHREAD_KEY_GMTIME; + gmtime_key_error = pthread_key_init_np(gmtime_key, free); +} + +struct tm * +gmtime(const time_t *const timep) +{ + struct tm *p_tm; + + if (__isthreaded != 0) { + _pthread_once(&gmtime_once, gmtime_key_init); + if (gmtime_key_error != 0) { + errno = gmtime_key_error; + return(NULL); + } + /* + * Changed to follow POSIX.1 threads standard, which + * is what BSD currently has. + */ + if ((p_tm = _pthread_getspecific(gmtime_key)) == NULL) { + if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) + == NULL) { + return(NULL); + } + _pthread_setspecific(gmtime_key, p_tm); + } +#ifdef __LP64__ + return gmtsub(timep, 0L, p_tm); +#else /* !__LP64__ */ + gmtsub(timep, 0L, p_tm); + return(p_tm); +#endif /* __LP64__ */ + } + else { +#ifdef __LP64__ + return gmtsub(timep, 0L, &tm); +#else /* !__LP64__ */ + gmtsub(timep, 0L, &tm); + return(&tm); +#endif /* __LP64__ */ + } +} + +/* +* Re-entrant version of gmtime. +*/ + +struct tm * +gmtime_r(const time_t *const timep, struct tm *tmp) +{ + +#ifdef __LP64__ + return gmtsub(timep, 0L, tmp); +#else /* !__LP64__ */ + gmtsub(timep, 0L, tmp); + return tmp; +#endif /* __LP64__ */ +} + +#ifdef STD_INSPIRED + +struct tm * +offtime(const time_t *const timep, const long offset) +{ +#ifdef __LP64__ + return gmtsub(timep, offset, &tm); +#else /* !__LP64__ */ + gmtsub(timep, offset, &tm); + return &tm; +#endif /* __LP64__ */ +} + +#endif /* defined STD_INSPIRED */ + +/* +** Return the number of leap years through the end of the given year +** where, to make the math easy, the answer for year zero is defined as zero. +*/ + +__unused static int +leaps_thru_end_of(y) +register const int y; +{ +#ifdef __LP64__ + return (y >= 0) ? (y / 4 - y / 100 + y / 400) : + -(leaps_thru_end_of(-(y + 1)) + 1); +#else /* !__LP64__ */ + return (y / 4 - y / 100 + y / 400); +#endif /* __LP64__ */ +} + +#ifdef __LP64__ +static struct tm * +#else /* !__LP64__ */ +static void +#endif /* __LP64__ */ +timesub(timep, offset, sp, tmp) +const time_t * const timep; +const long offset; +const struct state * const sp; +struct tm * const tmp; +{ + const struct lsinfo * lp; + long days; + long rem; + long y; + int yleap; + const int * ip; + long corr; + int hit; + int i; + + corr = 0; + hit = 0; +#ifdef ALL_STATE + i = (sp == NULL) ? 0 : sp->leapcnt; +#endif /* defined ALL_STATE */ +#ifndef ALL_STATE + i = sp->leapcnt; +#endif /* State Farm */ + while (--i >= 0) { + lp = &sp->lsis[i]; + if (*timep >= lp->ls_trans) { + if (*timep == lp->ls_trans) { + hit = ((i == 0 && lp->ls_corr > 0) || + lp->ls_corr > sp->lsis[i - 1].ls_corr); + if (hit) + while (i > 0 && + sp->lsis[i].ls_trans == + sp->lsis[i - 1].ls_trans + 1 && + sp->lsis[i].ls_corr == + sp->lsis[i - 1].ls_corr + 1) { + ++hit; + --i; + } + } + corr = lp->ls_corr; + break; + } + } + days = *timep / SECSPERDAY; + rem = *timep % SECSPERDAY; +#ifdef mc68k + if (*timep == 0x80000000) { + /* + ** A 3B1 muffs the division on the most negative number. + */ + days = -24855; + rem = -11648; + } +#endif /* defined mc68k */ + rem += (offset - corr); + while (rem < 0) { + rem += SECSPERDAY; + --days; + } + while (rem >= SECSPERDAY) { + rem -= SECSPERDAY; + ++days; + } + tmp->tm_hour = (int) (rem / SECSPERHOUR); + rem = rem % SECSPERHOUR; + tmp->tm_min = (int) (rem / SECSPERMIN); + /* + ** A positive leap second requires a special + ** representation. This uses "... ??:59:60" et seq. + */ + tmp->tm_sec = (int) (rem % SECSPERMIN) + hit; + tmp->tm_wday = (int) ((EPOCH_WDAY + days) % DAYSPERWEEK); + if (tmp->tm_wday < 0) + tmp->tm_wday += DAYSPERWEEK; + y = EPOCH_YEAR; +#define _LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400) +#ifdef __LP64__ +#define LEAPS_THRU_END_OF(y) ((y) >= 0 ? _LEAPS_THRU_END_OF(y) : _LEAPS_THRU_END_OF((y) + 1) - 1) +#else /* !__LP64__ */ +#define LEAPS_THRU_END_OF(y) _LEAPS_THRU_END_OF(y) +#endif /* __LP64__ */ + while (days < 0 || days >= (long) year_lengths[yleap = isleap(y)]) { + long newy; + + newy = y + days / DAYSPERNYEAR; + if (days < 0) + --newy; + days -= (newy - y) * DAYSPERNYEAR + + LEAPS_THRU_END_OF(newy - 1) - + LEAPS_THRU_END_OF(y - 1); + y = newy; + } +#ifdef __LP64__ + y -= TM_YEAR_BASE; + if (y < INT_MIN || y > INT_MAX) { + errno = EOVERFLOW; + return NULL; + } + tmp->tm_year = y; +#else /* !__LP64__ */ + tmp->tm_year = y - TM_YEAR_BASE; +#endif /* __LP64__ */ + tmp->tm_yday = (int) days; + ip = mon_lengths[yleap]; + for (tmp->tm_mon = 0; days >= (long) ip[tmp->tm_mon]; ++(tmp->tm_mon)) + days = days - (long) ip[tmp->tm_mon]; + tmp->tm_mday = (int) (days + 1); + tmp->tm_isdst = 0; +#ifdef TM_GMTOFF + tmp->TM_GMTOFF = offset; +#endif /* defined TM_GMTOFF */ +#ifdef __LP64__ + return tmp; +#endif /* __LP64__ */ +} + +char * +ctime(const time_t *const timep) +{ +/* +** Section 4.12.3.2 of X3.159-1989 requires that +** The ctime function converts the calendar time pointed to by timer +** to local time in the form of a string. It is equivalent to +** asctime(localtime(timer)) +*/ +#ifdef __LP64__ + /* + * In 64-bit, the timep value may produce a time value with a year + * that exceeds 32-bits in size (won't fit in struct tm), so localtime + * will return NULL. + */ + struct tm *tm = localtime(timep); + + if (tm == NULL) + return NULL; + return asctime(tm); +#else /* !__LP64__ */ + return asctime(localtime(timep)); +#endif /* __LP64__ */ +} + +char * +ctime_r(const time_t *const timep, char *buf) +{ + struct tm mytm; + +#ifdef __LP64__ + /* + * In 64-bit, the timep value may produce a time value with a year + * that exceeds 32-bits in size (won't fit in struct tm), so localtime_r + * will return NULL. + */ + if (localtime_r(timep, &mytm) == NULL) + return NULL; + return asctime_r(&mytm, buf); +#else /* !__LP64__ */ + return asctime_r(localtime_r(timep, &mytm), buf); +#endif /* __LP64__ */ +} + +/* +** Adapted from code provided by Robert Elz, who writes: +** The "best" way to do mktime I think is based on an idea of Bob +** Kridle's (so its said...) from a long time ago. +** It does a binary search of the time_t space. Since time_t's are +** just 32 bits, its a max of 32 iterations (even at 64 bits it +** would still be very reasonable). +*/ + +#ifndef WRONG +#define WRONG (-1) +#endif /* !defined WRONG */ + +/* +** Simplified normalize logic courtesy Paul Eggert. +*/ + +static int +increment_overflow(number, delta) +int * number; +int delta; +{ + int number0; + + number0 = *number; + *number += delta; + return (*number < number0) != (delta < 0); +} + +static int +long_increment_overflow(number, delta) +long * number; +int delta; +{ + long number0; + + number0 = *number; + *number += delta; + return (*number < number0) != (delta < 0); +} + +static int +normalize_overflow(int *const tensptr, int *const unitsptr, const int base) +{ + int tensdelta; + + tensdelta = (*unitsptr >= 0) ? + (*unitsptr / base) : + (-1 - (-1 - *unitsptr) / base); + *unitsptr -= tensdelta * base; + return increment_overflow(tensptr, tensdelta); +} + +static int +long_normalize_overflow(long *const tensptr, int *const unitsptr, const int base) +{ + register int tensdelta; + + tensdelta = (*unitsptr >= 0) ? + (*unitsptr / base) : + (-1 - (-1 - *unitsptr) / base); + *unitsptr -= tensdelta * base; + return long_increment_overflow(tensptr, tensdelta); +} + +static int +tmcomp(atmp, btmp) +const struct tm * const atmp; +const struct tm * const btmp; +{ + int result; + + /* + * Assume that atmp and btmp point to normalized tm strutures. + * So only arithmetic with tm_year could overflow in 64-bit. + */ + if (atmp->tm_year != btmp->tm_year) { + return (atmp->tm_year > btmp->tm_year ? 1 : -1); + } + if ((result = (atmp->tm_mon - btmp->tm_mon)) == 0 && + (result = (atmp->tm_mday - btmp->tm_mday)) == 0 && + (result = (atmp->tm_hour - btmp->tm_hour)) == 0 && + (result = (atmp->tm_min - btmp->tm_min)) == 0) + result = atmp->tm_sec - btmp->tm_sec; + return result; +} + +static time_t +time2sub(struct tm *const tmp, +#ifdef __LP64__ + struct tm *(*const funcp)(const time_t *, long, struct tm *), +#else /* !__LP64__ */ + void(*funcp) (const time_t *, long, struct tm*), +#endif /* __LP64__ */ + const long offset, + int *const okayp, + const int do_norm_secs, + int unix03) +{ + const struct state * sp; + int dir; + int i, j; + int saved_seconds; + long li; + time_t lo; + time_t hi; + long y; + time_t newt; + time_t t; + struct tm yourtm, mytm; + + *okayp = FALSE; + yourtm = *tmp; + if (do_norm_secs) { + if (normalize_overflow(&yourtm.tm_min, &yourtm.tm_sec, + SECSPERMIN)) + return WRONG; + } + if (normalize_overflow(&yourtm.tm_hour, &yourtm.tm_min, MINSPERHOUR)) + return WRONG; + if (normalize_overflow(&yourtm.tm_mday, &yourtm.tm_hour, HOURSPERDAY)) + return WRONG; + y = yourtm.tm_year; + if (long_normalize_overflow(&y, &yourtm.tm_mon, MONSPERYEAR)) + return WRONG; + /* + ** Turn y into an actual year number for now. + ** It is converted back to an offset from TM_YEAR_BASE later. + */ + if (long_increment_overflow(&y, TM_YEAR_BASE)) + return WRONG; + while (yourtm.tm_mday <= 0) { + if (long_increment_overflow(&y, -1)) + return WRONG; + li = y + (1 < yourtm.tm_mon); + yourtm.tm_mday += year_lengths[isleap(li)]; + } + while (yourtm.tm_mday > DAYSPERLYEAR) { + li = y + (1 < yourtm.tm_mon); + yourtm.tm_mday -= year_lengths[isleap(li)]; + if (long_increment_overflow(&y, 1)) + return WRONG; + } + for ( ; ; ) { + i = mon_lengths[isleap(y)][yourtm.tm_mon]; + if (yourtm.tm_mday <= i) + break; + yourtm.tm_mday -= i; + if (++yourtm.tm_mon >= MONSPERYEAR) { + yourtm.tm_mon = 0; + if (long_increment_overflow(&y, 1)) + return WRONG; + } + } + if (long_increment_overflow(&y, -TM_YEAR_BASE)) + return WRONG; + yourtm.tm_year = y; + if (yourtm.tm_year != y) + return WRONG; + /* Don't go below 1900 for POLA */ + if (yourtm.tm_year < 0) + return WRONG; + if (yourtm.tm_sec >= 0 && yourtm.tm_sec < SECSPERMIN) + saved_seconds = 0; + else if (y + TM_YEAR_BASE < EPOCH_YEAR) { + /* + ** We can't set tm_sec to 0, because that might push the + ** time below the minimum representable time. + ** Set tm_sec to 59 instead. + ** This assumes that the minimum representable time is + ** not in the same minute that a leap second was deleted from, + ** which is a safer assumption than using 58 would be. + */ + if (increment_overflow(&yourtm.tm_sec, 1 - SECSPERMIN)) + return WRONG; + saved_seconds = yourtm.tm_sec; + yourtm.tm_sec = SECSPERMIN - 1; + } else { + saved_seconds = yourtm.tm_sec; + yourtm.tm_sec = 0; + } + /* + ** Do a binary search (this works whatever time_t's type is). + */ + if (!TYPE_SIGNED(time_t)) { + lo = 0; + hi = lo - 1; + } else if (!TYPE_INTEGRAL(time_t)) { + if (sizeof(time_t) > sizeof(float)) + hi = (time_t) DBL_MAX; + else hi = (time_t) FLT_MAX; + lo = -hi; + } else { + lo = 1; + for (i = 0; i < (int) TYPE_BIT(time_t) - 1; ++i) + lo *= 2; + hi = -(lo + 1); + } + for ( ; ; ) { + t = lo / 2 + hi / 2; + if (t < lo) + t = lo; + else if (t > hi) + t = hi; +#ifdef __LP64__ + if ((*funcp)(&t, offset, &mytm) == NULL) { + /* + ** Assume that t is too extreme to be represented in + ** a struct tm; arrange things so that it is less + ** extreme on the next pass. + */ + dir = (t > 0) ? 1 : -1; + } else dir = tmcomp(&mytm, &yourtm); +#else /* !__LP64__ */ + (*funcp)(&t, offset, &mytm); + dir = tmcomp(&mytm, &yourtm); + // If we have searched the entire space without a match, exit + if (dir != 0 && t == lo && t == hi) + return WRONG; +#endif /* __LP64__ */ + if (dir != 0) { + if (t == lo) { + ++t; + if (t <= lo) + return WRONG; + ++lo; + } else if (t == hi) { + --t; + if (t >= hi) + return WRONG; + --hi; + } + if (lo > hi) + return WRONG; + if (dir > 0) + hi = t; + else lo = t; + continue; + } + sp = (funcp == localsub) ? lclptr : gmtptr; + if (unix03 && sp->typecnt == 1 && yourtm.tm_isdst > 0) + yourtm.tm_isdst = 0; /* alternative time does not apply */ + if (yourtm.tm_isdst < 0 || mytm.tm_isdst == yourtm.tm_isdst) + break; + /* + ** Right time, wrong type. + ** Hunt for right time, right type. + ** It's okay to guess wrong since the guess + ** gets checked. + */ +#ifdef ALL_STATE + if (sp == NULL) + return WRONG; +#endif /* defined ALL_STATE */ + for (i = sp->typecnt - 1; i >= 0; --i) { + if (sp->ttis[i].tt_isdst != yourtm.tm_isdst) + continue; + for (j = sp->typecnt - 1; j >= 0; --j) { + if (sp->ttis[j].tt_isdst == yourtm.tm_isdst) + continue; + newt = t + sp->ttis[j].tt_gmtoff - + sp->ttis[i].tt_gmtoff; +#ifdef __LP64__ + if ((*funcp)(&newt, offset, &mytm) == NULL) + continue; +#else /* !__LP64__ */ + (*funcp)(&newt, offset, &mytm); +#endif /* __LP64__ */ + if (tmcomp(&mytm, &yourtm) != 0) + continue; + if (mytm.tm_isdst != yourtm.tm_isdst) + continue; + /* + ** We have a match. + */ + t = newt; + goto label; + } + } + return WRONG; + } +label: + newt = t + saved_seconds; + if ((newt < t) != (saved_seconds < 0)) + return WRONG; + t = newt; +#ifdef __LP64__ + if ((*funcp)(&t, offset, tmp) == NULL) + return WRONG; +#else /* !__LP64__ */ + (*funcp)(&t, offset, tmp); +#endif /* __LP64__ */ + *okayp = TRUE; + return t; +} + +static time_t +time2(struct tm * const tmp, +#ifdef __LP64__ + struct tm * (*const funcp)(const time_t *, long, struct tm *), +#else /* !__LP64__ */ + void (*const funcp)(const time_t *, long, struct tm *), +#endif /* __LP64__ */ + const long offset, + int *const okayp, + int unix03) +{ + time_t t; + + /* + ** First try without normalization of seconds + ** (in case tm_sec contains a value associated with a leap second). + ** If that fails, try with normalization of seconds. + */ + t = time2sub(tmp, funcp, offset, okayp, FALSE, unix03); + return *okayp ? t : time2sub(tmp, funcp, offset, okayp, TRUE, unix03); +} + +__private_extern__ time_t +time1(tmp, funcp, offset, unix03) +struct tm * const tmp; +#ifdef __LP64__ +struct tm * (* const funcp)(const time_t *, long, struct tm *); +#else /* !__LP64__ */ +void (* const funcp)(const time_t *, long, struct tm *); +#endif /* __LP64__ */ +const long offset; +int unix03; +{ + time_t t; + const struct state * sp; + int samei, otheri; + int sameind, otherind; + int i; + int nseen; + int seen[TZ_MAX_TYPES]; + int types[TZ_MAX_TYPES]; + int okay; + + if (tmp == NULL) { + errno = EINVAL; + return WRONG; + } + + if (tmp->tm_isdst > 1) + tmp->tm_isdst = 1; + t = time2(tmp, funcp, offset, &okay, unix03); +#ifdef PCTS + /* + ** PCTS code courtesy Grant Sullivan. + */ + if (okay) + return t; + if (tmp->tm_isdst < 0) + tmp->tm_isdst = 0; /* reset to std and try again */ +#endif /* defined PCTS */ +#ifndef PCTS + if (okay || tmp->tm_isdst < 0) + return t; +#endif /* !defined PCTS */ + /* + ** We're supposed to assume that somebody took a time of one type + ** and did some math on it that yielded a "struct tm" that's bad. + ** We try to divine the type they started from and adjust to the + ** type they need. + */ + sp = (const struct state *) ((funcp == localsub) ? lclptr : gmtptr); +#ifdef ALL_STATE + if (sp == NULL) + return WRONG; +#endif /* defined ALL_STATE */ + for (i = 0; i < sp->typecnt; ++i) + seen[i] = FALSE; + nseen = 0; + for (i = sp->timecnt - 1; i >= 0; --i) + if (!seen[sp->types[i]]) { + seen[sp->types[i]] = TRUE; + types[nseen++] = sp->types[i]; + } + for (sameind = 0; sameind < nseen; ++sameind) { + samei = types[sameind]; + if (sp->ttis[samei].tt_isdst != tmp->tm_isdst) + continue; + for (otherind = 0; otherind < nseen; ++otherind) { + otheri = types[otherind]; + if (sp->ttis[otheri].tt_isdst == tmp->tm_isdst) + continue; + tmp->tm_sec += sp->ttis[otheri].tt_gmtoff - + sp->ttis[samei].tt_gmtoff; + tmp->tm_isdst = !tmp->tm_isdst; + t = time2(tmp, funcp, offset, &okay, unix03); + if (okay) + return t; + tmp->tm_sec -= sp->ttis[otheri].tt_gmtoff - + sp->ttis[samei].tt_gmtoff; + tmp->tm_isdst = !tmp->tm_isdst; + } + } + return WRONG; +} +#else /* BUILDING_VARIANT */ +extern pthread_rwlock_t lcl_rwlock; +#endif /* BUILDING_VARIANT */ + +time_t +mktime(struct tm *const tmp) +{ + time_t mktime_return_value; + int serrno = errno; + _RWLOCK_RDLOCK(&lcl_rwlock); + tzset_basic(1); + mktime_return_value = time1(tmp, localsub, 0L, __DARWIN_UNIX03); + _RWLOCK_UNLOCK(&lcl_rwlock); + errno = serrno; + return(mktime_return_value); +} + +#if !BUILDING_VARIANT +#ifdef STD_INSPIRED + +time_t +timelocal(struct tm *const tmp) +{ + if (tmp != NULL) + tmp->tm_isdst = -1; /* in case it wasn't initialized */ + return mktime(tmp); +} + +time_t +timegm(struct tm *const tmp) +{ + if (tmp != NULL) + tmp->tm_isdst = 0; + return time1(tmp, gmtsub, 0L, __DARWIN_UNIX03); +} + +time_t +timeoff(struct tm *const tmp, const long offset) +{ + if (tmp != NULL) + tmp->tm_isdst = 0; + return time1(tmp, gmtsub, offset, __DARWIN_UNIX03); +} + +#endif /* defined STD_INSPIRED */ + +#ifdef CMUCS + +/* +** The following is supplied for compatibility with +** previous versions of the CMUCS runtime library. +*/ + +long +gtime(struct tm *const tmp) +{ + const time_t t = mktime(tmp); + + if (t == WRONG) + return -1; + return t; +} + +#endif /* defined CMUCS */ + +/* +** XXX--is the below the right way to conditionalize?? +*/ + +#ifdef STD_INSPIRED + +/* +** IEEE Std 1003.1-1988 (POSIX) legislates that 536457599 +** shall correspond to "Wed Dec 31 23:59:59 UTC 1986", which +** is not the case if we are accounting for leap seconds. +** So, we provide the following conversion routines for use +** when exchanging timestamps with POSIX conforming systems. +*/ + +static long +leapcorr(time_t *timep) +{ + struct state * sp; + struct lsinfo * lp; + int i; + + sp = lclptr; + i = sp->leapcnt; + while (--i >= 0) { + lp = &sp->lsis[i]; + if (*timep >= lp->ls_trans) + return lp->ls_corr; + } + return 0; +} + +time_t +time2posix(time_t t) +{ + tzset(); + return t - leapcorr(&t); +} + +time_t +posix2time(time_t t) +{ + time_t x; + time_t y; + + tzset(); + /* + ** For a positive leap second hit, the result + ** is not unique. For a negative leap second + ** hit, the corresponding time doesn't exist, + ** so we return an adjacent second. + */ + x = t + leapcorr(&t); + y = x - leapcorr(&x); + if (y < t) { + do { + x++; + y = x - leapcorr(&x); + } while (y < t); + if (t != y) + return x - 1; + } else if (y > t) { + do { + --x; + y = x - leapcorr(&x); + } while (y > t); + if (t != y) + return x + 1; + } + return x; +} + +#endif /* defined STD_INSPIRED */ +#endif /* !BUILDING_VARIANT */ +#pragma clang diagnostic pop diff --git a/stdtime/FreeBSD/private.h b/stdtime/FreeBSD/private.h new file mode 100644 index 0000000..3a54608 --- /dev/null +++ b/stdtime/FreeBSD/private.h @@ -0,0 +1,327 @@ +#ifndef PRIVATE_H + +#define PRIVATE_H + +/* +** This file is in the public domain, so clarified as of +** 1996-06-05 by Arthur David Olson. +** +** $FreeBSD: head/contrib/tzcode/stdtime/private.h 289027 2015-10-08 11:42:15Z rodrigc $ +*/ + +/* Stuff moved from Makefile.inc to reduce clutter */ +#ifndef TM_GMTOFF +#define TM_GMTOFF tm_gmtoff +#define TM_ZONE tm_zone +#define STD_INSPIRED 1 +#define PCTS 1 +#define HAVE_LONG_DOUBLE 1 +#define HAVE_STRERROR 1 +#define HAVE_UNISTD_H 1 +#define LOCALE_HOME _PATH_LOCALE +/* #define TZDIR "/usr/share/zoneinfo" */ +#endif /* ndef TM_GMTOFF */ + +/* +** This header is for use ONLY with the time conversion code. +** There is no guarantee that it will remain unchanged, +** or that it will remain at all. +** Do NOT copy it to any system include directory. +** Thank you! +*/ + +/* +** ID +*/ + +#ifndef lint +#ifndef NOID +/* +static char privatehid[] = "@(#)private.h 8.6"; +*/ +#endif /* !defined NOID */ +#endif /* !defined lint */ + +#define GRANDPARENTED "Local time zone must be set--see zic manual page" + +/* +** Defaults for preprocessor symbols. +** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'. +*/ + +#ifndef HAVE_ADJTIME +#define HAVE_ADJTIME 1 +#endif /* !defined HAVE_ADJTIME */ + +#ifndef HAVE_GETTEXT +#define HAVE_GETTEXT 0 +#endif /* !defined HAVE_GETTEXT */ + +#ifndef HAVE_INCOMPATIBLE_CTIME_R +#define HAVE_INCOMPATIBLE_CTIME_R 0 +#endif /* !defined INCOMPATIBLE_CTIME_R */ + +#ifndef HAVE_SETTIMEOFDAY +#define HAVE_SETTIMEOFDAY 3 +#endif /* !defined HAVE_SETTIMEOFDAY */ + +#ifndef HAVE_SYMLINK +#define HAVE_SYMLINK 1 +#endif /* !defined HAVE_SYMLINK */ + +#ifndef HAVE_SYS_STAT_H +#define HAVE_SYS_STAT_H 1 +#endif /* !defined HAVE_SYS_STAT_H */ + +#ifndef HAVE_SYS_WAIT_H +#define HAVE_SYS_WAIT_H 1 +#endif /* !defined HAVE_SYS_WAIT_H */ + +#ifndef HAVE_UNISTD_H +#define HAVE_UNISTD_H 1 +#endif /* !defined HAVE_UNISTD_H */ + +#ifndef HAVE_UTMPX_H +#define HAVE_UTMPX_H 0 +#endif /* !defined HAVE_UTMPX_H */ + +#ifndef LOCALE_HOME +#define LOCALE_HOME "/usr/lib/locale" +#endif /* !defined LOCALE_HOME */ + +#if HAVE_INCOMPATIBLE_CTIME_R +#define asctime_r _incompatible_asctime_r +#define ctime_r _incompatible_ctime_r +#endif /* HAVE_INCOMPATIBLE_CTIME_R */ + +/* +** Nested includes +*/ + +#include "sys/types.h" /* for time_t */ +#include "stdio.h" +#include "errno.h" +#include "string.h" +#include "limits.h" /* for CHAR_BIT et al. */ +#include "time.h" +#include "stdlib.h" + +#if HAVE_GETTEXT +#include "libintl.h" +#endif /* HAVE_GETTEXT */ + +#if HAVE_SYS_WAIT_H +#include /* for WIFEXITED and WEXITSTATUS */ +#endif /* HAVE_SYS_WAIT_H */ + +#ifndef WIFEXITED +#define WIFEXITED(status) (((status) & 0xff) == 0) +#endif /* !defined WIFEXITED */ +#ifndef WEXITSTATUS +#define WEXITSTATUS(status) (((status) >> 8) & 0xff) +#endif /* !defined WEXITSTATUS */ + +#if HAVE_UNISTD_H +#include "unistd.h" /* for F_OK, R_OK, and other POSIX goodness */ +#endif /* HAVE_UNISTD_H */ + +#if !(HAVE_UNISTD_H) +#ifndef F_OK +#define F_OK 0 +#endif /* !defined F_OK */ +#ifndef R_OK +#define R_OK 4 +#endif /* !defined R_OK */ +#endif /* !(HAVE_UNISTD_H) */ + +/* Unlike 's isdigit, this also works if c < 0 | c > UCHAR_MAX. */ +#define is_digit(c) ((unsigned)(c) - '0' <= 9) + +/* +** Define HAVE_STDINT_H's default value here, rather than at the +** start, since __GLIBC__'s value depends on previously-included +** files. +** (glibc 2.1 and later have stdint.h, even with pre-C99 compilers.) +*/ +#ifndef HAVE_STDINT_H +#define HAVE_STDINT_H \ + (199901 <= __STDC_VERSION__ || \ + 2 < (__GLIBC__ + (0 < __GLIBC_MINOR__))) +#endif /* !defined HAVE_STDINT_H */ + +#if HAVE_STDINT_H +#include "stdint.h" +#endif /* !HAVE_STDINT_H */ + +#ifndef INT_FAST64_MAX +/* Pre-C99 GCC compilers define __LONG_LONG_MAX__ instead of LLONG_MAX. */ +#if defined LLONG_MAX || defined __LONG_LONG_MAX__ +typedef long long int_fast64_t; +#else /* ! (defined LLONG_MAX || defined __LONG_LONG_MAX__) */ +#if (LONG_MAX >> 31) < 0xffffffff +Please use a compiler that supports a 64-bit integer type (or wider); +you may need to compile with "-DHAVE_STDINT_H". +#endif /* (LONG_MAX >> 31) < 0xffffffff */ +typedef long int_fast64_t; +#endif /* ! (defined LLONG_MAX || defined __LONG_LONG_MAX__) */ +#endif /* !defined INT_FAST64_MAX */ + +#ifndef INT32_MAX +#define INT32_MAX 0x7fffffff +#endif /* !defined INT32_MAX */ +#ifndef INT32_MIN +#define INT32_MIN (-1 - INT32_MAX) +#endif /* !defined INT32_MIN */ + +#if 2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__) +# define ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define ATTRIBUTE_PURE /* empty */ +#endif + +/* +** Workarounds for compilers/systems. +*/ + +/* +** Some time.h implementations don't declare asctime_r. +** Others might define it as a macro. +** Fix the former without affecting the latter. +*/ + +#ifndef asctime_r +extern char * asctime_r(struct tm const *, char *); +#endif + +/* +** Private function declarations. +*/ + +char * icatalloc(char * old, const char * new); +char * icpyalloc(const char * string); +const char * scheck(const char * string, const char * format); + +/* +** Finally, some convenience items. +*/ + +#ifndef TRUE +#define TRUE 1 +#endif /* !defined TRUE */ + +#ifndef FALSE +#define FALSE 0 +#endif /* !defined FALSE */ + +#ifndef TYPE_BIT +#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT) +#endif /* !defined TYPE_BIT */ + +#ifndef TYPE_SIGNED +#define TYPE_SIGNED(type) (((type) -1) < 0) +#endif /* !defined TYPE_SIGNED */ + +/* +** Since the definition of TYPE_INTEGRAL contains floating point numbers, +** it cannot be used in preprocessor directives. +*/ + +#ifndef TYPE_INTEGRAL +#define TYPE_INTEGRAL(type) (((type) 0.5) != 0.5) +#endif /* !defined TYPE_INTEGRAL */ + +/* +** Since the definition of TYPE_INTEGRAL contains floating point numbers, +** it cannot be used in preprocessor directives. +*/ + +#ifndef TYPE_INTEGRAL +#define TYPE_INTEGRAL(type) (((type) 0.5) != 0.5) +#endif /* !defined TYPE_INTEGRAL */ + +#ifndef INT_STRLEN_MAXIMUM +/* +** 302 / 1000 is log10(2.0) rounded up. +** Subtract one for the sign bit if the type is signed; +** add one for integer division truncation; +** add one more for a minus sign if the type is signed. +*/ +#define INT_STRLEN_MAXIMUM(type) \ + ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + \ + 1 + TYPE_SIGNED(type)) +#endif /* !defined INT_STRLEN_MAXIMUM */ + +/* +** INITIALIZE(x) +*/ + +#ifndef GNUC_or_lint +#ifdef lint +#define GNUC_or_lint +#endif /* defined lint */ +#ifndef lint +#ifdef __GNUC__ +#define GNUC_or_lint +#endif /* defined __GNUC__ */ +#endif /* !defined lint */ +#endif /* !defined GNUC_or_lint */ + +#ifndef INITIALIZE +#ifdef GNUC_or_lint +#define INITIALIZE(x) ((x) = 0) +#endif /* defined GNUC_or_lint */ +#ifndef GNUC_or_lint +#define INITIALIZE(x) +#endif /* !defined GNUC_or_lint */ +#endif /* !defined INITIALIZE */ + +/* +** For the benefit of GNU folk... +** `_(MSGID)' uses the current locale's message library string for MSGID. +** The default is to use gettext if available, and use MSGID otherwise. +*/ + +#ifndef _ +#if HAVE_GETTEXT +#define _(msgid) gettext(msgid) +#else /* !HAVE_GETTEXT */ +#define _(msgid) msgid +#endif /* !HAVE_GETTEXT */ +#endif /* !defined _ */ + +#ifndef TZ_DOMAIN +#define TZ_DOMAIN "tz" +#endif /* !defined TZ_DOMAIN */ + +#if HAVE_INCOMPATIBLE_CTIME_R +#undef asctime_r +#undef ctime_r +char *asctime_r(struct tm const *, char *); +char *ctime_r(time_t const *, char *); +#endif /* HAVE_INCOMPATIBLE_CTIME_R */ + +#ifndef YEARSPERREPEAT +#define YEARSPERREPEAT 400 /* years before a Gregorian repeat */ +#endif /* !defined YEARSPERREPEAT */ + +/* +** The Gregorian year averages 365.2425 days, which is 31556952 seconds. +*/ + +#ifndef AVGSECSPERYEAR +#define AVGSECSPERYEAR 31556952L +#endif /* !defined AVGSECSPERYEAR */ + +#ifndef SECSPERREPEAT +#define SECSPERREPEAT ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR) +#endif /* !defined SECSPERREPEAT */ + +#ifndef SECSPERREPEAT_BITS +#define SECSPERREPEAT_BITS 34 /* ceil(log2(SECSPERREPEAT)) */ +#endif /* !defined SECSPERREPEAT_BITS */ + +/* +** UNIX was a registered trademark of The Open Group in 2003. +*/ + +#endif /* !defined PRIVATE_H */ diff --git a/stdtime/FreeBSD/strftime.3 b/stdtime/FreeBSD/strftime.3 new file mode 100644 index 0000000..5454a07 --- /dev/null +++ b/stdtime/FreeBSD/strftime.3 @@ -0,0 +1,299 @@ +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strftime.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/stdtime/strftime.3,v 1.40 2008/05/16 04:33:04 grog Exp $ +.\" +.Dd November 4, 2004 +.Dt STRFTIME 3 +.Os +.Sh NAME +.Nm strftime , +.Nm strftime_l +.Nd format date and time +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft size_t +.Fo strftime +.Fa "char *restrict s" +.Fa "size_t maxsize" +.Fa "const char *restrict format" +.Fa "const struct tm *restrict timeptr" +.Fc +.In time.h +.In xlocale.h +.Ft size_t +.Fo strftime_l +.Fa "char *restrict s" +.Fa "size_t maxsize" +.Fa "const char *restrict format" +.Fa "const struct tm *restrict timeptr" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn strftime +function formats the information from +.Fa timeptr +into the buffer +.Fa s , +according to the string pointed to by +.Fa format . +.Pp +The +.Fa format +string consists of zero or more conversion specifications and +ordinary characters. +All ordinary characters are copied directly into the buffer. +A conversion specification consists of a percent sign +.Dq Ql % +and one other character. +.Pp +No more than +.Fa maxsize +characters will be placed into the array. +If the total number of resulting characters, including the terminating +NUL character, is not more than +.Fa maxsize , +.Fn strftime +returns the number of characters in the array, not counting the +terminating NUL. +Otherwise, zero is returned and the buffer contents are indeterminate. +.Pp +Although the +.Fn strftime +function uses the current locale, the +.Fn strftime_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Pp +The conversion specifications are copied to the buffer after expansion +as follows:- +.Bl -tag -width "xxxx" +.It Cm \&%A +is replaced by national representation of the full weekday name. +.It Cm %a +is replaced by national representation of +the abbreviated weekday name. +.It Cm \&%B +is replaced by national representation of the full month name. +.It Cm %b +is replaced by national representation of +the abbreviated month name. +.It Cm \&%C +is replaced by (year / 100) as decimal number; single +digits are preceded by a zero. +.It Cm %c +is replaced by national representation of time and date. +.It Cm \&%D +is equivalent to +.Dq Li %m/%d/%y . +.It Cm %d +is replaced by the day of the month as a decimal number (01-31). +.It Cm %E* %O* +POSIX locale extensions. +The sequences +%Ec %EC %Ex %EX %Ey %EY +%Od %Oe %OH %OI %Om %OM +%OS %Ou %OU %OV %Ow %OW %Oy +are supposed to provide alternate +representations. +.Pp +Additionally %OB implemented +to represent alternative months names +(used standalone, without day mentioned). +.It Cm %e +is replaced by the day of the month as a decimal number (1-31); single +digits are preceded by a blank. +.It Cm \&%F +is equivalent to +.Dq Li %Y-%m-%d . +.It Cm \&%G +is replaced by a year as a decimal number with century. +This year is the one that contains the greater part of +the week (Monday as the first day of the week). +.It Cm %g +is replaced by the same year as in +.Dq Li %G , +but as a decimal number without century (00-99). +.It Cm \&%H +is replaced by the hour (24-hour clock) as a decimal number (00-23). +.It Cm %h +the same as +.Cm %b . +.It Cm \&%I +is replaced by the hour (12-hour clock) as a decimal number (01-12). +.It Cm %j +is replaced by the day of the year as a decimal number (001-366). +.It Cm %k +is replaced by the hour (24-hour clock) as a decimal number (0-23); +single digits are preceded by a blank. +.It Cm %l +is replaced by the hour (12-hour clock) as a decimal number (1-12); +single digits are preceded by a blank. +.It Cm \&%M +is replaced by the minute as a decimal number (00-59). +.It Cm %m +is replaced by the month as a decimal number (01-12). +.It Cm %n +is replaced by a newline. +.It Cm %O* +the same as +.Cm %E* . +.It Cm %p +is replaced by national representation of either +"ante meridiem" (a.m.) +or +"post meridiem" (p.m.) +as appropriate. +.It Cm \&%R +is equivalent to +.Dq Li %H:%M . +.It Cm %r +is equivalent to +.Dq Li %I:%M:%S %p . +.It Cm \&%S +is replaced by the second as a decimal number (00-60). +.It Cm %s +is replaced by the number of seconds since the Epoch, UTC (see +.Xr mktime 3 ) . +.It Cm \&%T +is equivalent to +.Dq Li %H:%M:%S . +.It Cm %t +is replaced by a tab. +.It Cm \&%U +is replaced by the week number of the year (Sunday as the first day of +the week) as a decimal number (00-53). +.It Cm %u +is replaced by the weekday (Monday as the first day of the week) +as a decimal number (1-7). +.It Cm \&%V +is replaced by the week number of the year (Monday as the first day of +the week) as a decimal number (01-53). +If the week containing January +1 has four or more days in the new year, then it is week 1; otherwise +it is the last week of the previous year, and the next week is week 1. +.It Cm %v +is equivalent to +.Dq Li %e-%b-%Y . +.It Cm \&%W +is replaced by the week number of the year (Monday as the first day of +the week) as a decimal number (00-53). +.It Cm %w +is replaced by the weekday (Sunday as the first day of the week) +as a decimal number (0-6). +.It Cm \&%X +is replaced by national representation of the time. +.It Cm %x +is replaced by national representation of the date. +.It Cm \&%Y +is replaced by the year with century as a decimal number. +.It Cm %y +is replaced by the year without century as a decimal number (00-99). +.It Cm \&%Z +is replaced by the time zone name. +.It Cm %z +is replaced by the time zone offset from UTC; a leading plus sign stands for +east of UTC, a minus sign for west of UTC, hours and minutes follow +with two digits each and no delimiter between them (common form for +RFC 822 date headers). +.It Cm %+ +is replaced by national representation of the date and time +(the format is similar to that produced by +.Xr date 1 ) . +.It Cm %-* +GNU libc extension. +Do not do any padding when performing numerical outputs. +.It Cm %_* +GNU libc extension. +Explicitly specify space for padding. +.It Cm %0* +GNU libc extension. +Explicitly specify zero for padding. +.It Cm %% +is replaced by +.Ql % . +.El +.Sh SEE ALSO +.Xr date 1 , +.Xr printf 1 , +.Xr ctime 3 , +.Xr printf 3 , +.Xr strptime 3 , +.Xr wcsftime 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn strftime +function +conforms to +.St -isoC +with a lot of extensions including +.Ql %C , +.Ql \&%D , +.Ql %E* , +.Ql %e , +.Ql %G , +.Ql %g , +.Ql %h , +.Ql %k , +.Ql %l , +.Ql %n , +.Ql %O* , +.Ql \&%R , +.Ql %r , +.Ql %s , +.Ql \&%T , +.Ql %t , +.Ql %u , +.Ql \&%V , +.Ql %z , +and +.Ql %+ . +.Pp +The peculiar week number and year in the replacements of +.Ql %G , +.Ql %g , +and +.Ql \&%V +are defined in ISO 8601: 1988. +.Sh BUGS +There is no conversion specification for the phase of the moon. +.Pp +The +.Fn strftime +function does not correctly handle multibyte characters in the +.Fa format +argument. diff --git a/stdtime/FreeBSD/strftime.c b/stdtime/FreeBSD/strftime.c new file mode 100644 index 0000000..0300e2b --- /dev/null +++ b/stdtime/FreeBSD/strftime.c @@ -0,0 +1,663 @@ +/* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" + +#if 0 +static const char elsieid[] = "@(#)strftime.3 8.3"; +/* +** Based on the UCB version with the ID appearing below. +** This is ANSIish only when "multibyte character == plain character". +*/ +#endif + +#include "xlocale_private.h" + +#include "namespace.h" +#include "private.h" + +#if defined(LIBC_SCCS) && !defined(lint) +static const char sccsid[] = "@(#)strftime.c 5.4 (Berkeley) 3/14/89"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/stdtime/strftime.c,v 1.44 2009/06/09 09:02:58 delphij Exp $"); + +#include "tzfile.h" +#include +#include +#include +#include "un-namespace.h" +#include "timelocal.h" + +#if !BUILDING_VARIANT +static char * _add(const char *, char *, const char *); +static char * _conv(int, const char *, char *, const char *, locale_t); +static char * _yconv(int, int, int, int, char *, const char *, locale_t); +#endif +#define _fmt _st_fmt +__private_extern__ char * _fmt(const char *, const struct tm *, char *, const char *, + int *, struct lc_time_T *, locale_t); + +extern char * tzname[]; +extern long __darwin_altzone; /* DST timezone offset */ +#define altzone __darwin_altzone +__private_extern__ long _st_get_timezone(void); + +#ifndef YEAR_2000_NAME +#define YEAR_2000_NAME "CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS" +#endif /* !defined YEAR_2000_NAME */ + +#define IN_NONE 0 +#define IN_SOME 1 +#define IN_THIS 2 +#define IN_ALL 3 + +#define PAD_DEFAULT 0 +#define PAD_LESS 1 +#define PAD_SPACE 2 +#define PAD_ZERO 3 + +#ifndef BUILDING_VARIANT +static const char * const fmt_padding[][4] = { + /* DEFAULT, LESS, SPACE, ZERO */ +#define PAD_FMT_MONTHDAY 0 +#define PAD_FMT_HMS 0 +#define PAD_FMT_CENTURY 0 +#define PAD_FMT_SHORTYEAR 0 +#define PAD_FMT_MONTH 0 +#define PAD_FMT_WEEKOFYEAR 0 +#define PAD_FMT_DAYOFMONTH 0 + { "%02d", "%d", "%2d", "%02d" }, +#define PAD_FMT_SDAYOFMONTH 1 +#define PAD_FMT_SHMS 1 + { "%2d", "%d", "%2d", "%02d" }, +#define PAD_FMT_DAYOFYEAR 2 + { "%03d", "%d", "%3d", "%03d" }, +#define PAD_FMT_YEAR 3 + { "%04d", "%d", "%4d", "%04d" } +}; +#endif + +#define USG_COMPAT +#define ALTZONE + +size_t +strftime_l(char * __restrict s, size_t maxsize, const char * __restrict format, + const struct tm * __restrict t, locale_t loc) +{ + char * p; + int warn; + + NORMALIZE_LOCALE(loc); + tzset(); + warn = IN_NONE; + p = _fmt(((format == NULL) ? "%c" : format), t, s, s + maxsize, &warn, __get_current_time_locale(loc), loc); +#ifndef NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU + if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) { + (void) fputs("\n", stderr); + if (format == NULL) + (void) fputs("NULL strftime format ", stderr); + else (void) fprintf_l(stderr, loc, "strftime format \"%s\" ", + format); + (void) fputs("yields only two digits of years in ", stderr); + if (warn == IN_SOME) + (void) fputs("some locales", stderr); + else if (warn == IN_THIS) + (void) fputs("the current locale", stderr); + else (void) fputs("all locales", stderr); + (void) fputs("\n", stderr); + } +#endif /* !defined NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU */ + if (p == s + maxsize) + return 0; + *p = '\0'; + return p - s; +} + +size_t +strftime(char * __restrict s, size_t maxsize, const char * __restrict format, + const struct tm * __restrict t) +{ + return strftime_l(s, maxsize, format, t, __current_locale()); +} + +#ifndef BUILDING_VARIANT +__private_extern__ char * +_fmt(format, t, pt, ptlim, warnp, tptr, loc) +const char * format; +const struct tm * const t; +char * pt; +const char * const ptlim; +int * warnp; +struct lc_time_T * tptr; +locale_t loc; +{ + int Ealternative, Oalternative, PadIndex; + + for ( ; *format; ++format) { + if (*format == '%') { + Ealternative = 0; + Oalternative = 0; + PadIndex = PAD_DEFAULT; +label: + switch (*++format) { + case '\0': + --format; + break; + case 'A': + pt = _add((t->tm_wday < 0 || + t->tm_wday >= DAYSPERWEEK) ? + "?" : tptr->weekday[t->tm_wday], + pt, ptlim); + continue; + case 'a': + pt = _add((t->tm_wday < 0 || + t->tm_wday >= DAYSPERWEEK) ? + "?" : tptr->wday[t->tm_wday], + pt, ptlim); + continue; + case 'B': + pt = _add((t->tm_mon < 0 || + t->tm_mon >= MONSPERYEAR) ? + "?" : (Oalternative ? tptr->alt_month : + tptr->month)[t->tm_mon], + pt, ptlim); + continue; + case 'b': + case 'h': + pt = _add((t->tm_mon < 0 || + t->tm_mon >= MONSPERYEAR) ? + "?" : tptr->mon[t->tm_mon], + pt, ptlim); + continue; + case 'C': + /* + ** %C used to do a... + ** _fmt("%a %b %e %X %Y", t, tptr, loc); + ** ...whereas now POSIX 1003.2 calls for + ** something completely different. + ** (ado, 1993-05-24) + */ + pt = _yconv(t->tm_year, TM_YEAR_BASE, 1, 0, + pt, ptlim, loc); + continue; + case 'c': + { + int warn2 = IN_SOME; + + pt = _fmt(tptr->c_fmt, t, pt, ptlim, &warn2, tptr, loc); + if (warn2 == IN_ALL) + warn2 = IN_THIS; + if (warn2 > *warnp) + *warnp = warn2; + } + continue; + case 'D': + pt = _fmt("%m/%d/%y", t, pt, ptlim, warnp, tptr, loc); + continue; + case 'd': + pt = _conv(t->tm_mday, fmt_padding[PAD_FMT_DAYOFMONTH][PadIndex], + pt, ptlim, loc); + continue; + case 'E': + if (Ealternative || Oalternative) + break; + Ealternative++; + goto label; + case 'O': + /* + ** C99 locale modifiers. + ** The sequences + ** %Ec %EC %Ex %EX %Ey %EY + ** %Od %oe %OH %OI %Om %OM + ** %OS %Ou %OU %OV %Ow %OW %Oy + ** are supposed to provide alternate + ** representations. + ** + ** FreeBSD extension + ** %OB + */ + if (Ealternative || Oalternative) + break; + Oalternative++; + goto label; + case 'e': + pt = _conv(t->tm_mday, + fmt_padding[PAD_FMT_SDAYOFMONTH][PadIndex], pt, ptlim, loc); + continue; + case 'F': + pt = _fmt("%Y-%m-%d", t, pt, ptlim, warnp, tptr, loc); + continue; + case 'H': + pt = _conv(t->tm_hour, fmt_padding[PAD_FMT_HMS][PadIndex], + pt, ptlim, loc); + continue; + case 'I': + pt = _conv((t->tm_hour % 12) ? + (t->tm_hour % 12) : 12, + fmt_padding[PAD_FMT_HMS][PadIndex], pt, ptlim, loc); + continue; + case 'j': + pt = _conv(t->tm_yday + 1, + fmt_padding[PAD_FMT_DAYOFYEAR][PadIndex], pt, ptlim, loc); + continue; + case 'k': + /* + ** This used to be... + ** _conv(t->tm_hour % 12 ? + ** t->tm_hour % 12 : 12, 2, ' ', loc); + ** ...and has been changed to the below to + ** match SunOS 4.1.1 and Arnold Robbins' + ** strftime version 3.0. That is, "%k" and + ** "%l" have been swapped. + ** (ado, 1993-05-24) + */ + pt = _conv(t->tm_hour, fmt_padding[PAD_FMT_SHMS][PadIndex], + pt, ptlim, loc); + continue; +#ifdef KITCHEN_SINK + case 'K': + /* + ** After all this time, still unclaimed! + */ + pt = _add("kitchen sink", pt, ptlim); + continue; +#endif /* defined KITCHEN_SINK */ + case 'l': + /* + ** This used to be... + ** _conv(t->tm_hour, 2, ' '); + ** ...and has been changed to the below to + ** match SunOS 4.1.1 and Arnold Robbin's + ** strftime version 3.0. That is, "%k" and + ** "%l" have been swapped. + ** (ado, 1993-05-24) + */ + pt = _conv((t->tm_hour % 12) ? + (t->tm_hour % 12) : 12, + fmt_padding[PAD_FMT_SHMS][PadIndex], pt, ptlim, loc); + continue; + case 'M': + pt = _conv(t->tm_min, fmt_padding[PAD_FMT_HMS][PadIndex], + pt, ptlim, loc); + continue; + case 'm': + pt = _conv(t->tm_mon + 1, + fmt_padding[PAD_FMT_MONTH][PadIndex], pt, ptlim, loc); + continue; + case 'n': + pt = _add("\n", pt, ptlim); + continue; + case 'p': + pt = _add((t->tm_hour >= (HOURSPERDAY / 2)) ? + tptr->pm : + tptr->am, + pt, ptlim); + continue; + case 'R': + pt = _fmt("%H:%M", t, pt, ptlim, warnp, tptr, loc); + continue; + case 'r': + pt = _fmt(tptr->ampm_fmt, t, pt, ptlim, + warnp, tptr, loc); + continue; + case 'S': + pt = _conv(t->tm_sec, fmt_padding[PAD_FMT_HMS][PadIndex], + pt, ptlim, loc); + continue; + case 's': + { + struct tm tm; + char buf[INT_STRLEN_MAXIMUM( + time_t) + 1]; + time_t mkt; + + tm = *t; + mkt = mktime(&tm); + if (TYPE_SIGNED(time_t)) + (void) sprintf_l(buf, loc, "%ld", + (long) mkt); + else (void) sprintf_l(buf, loc, "%lu", + (unsigned long) mkt); + pt = _add(buf, pt, ptlim); + } + continue; + case 'T': + pt = _fmt("%H:%M:%S", t, pt, ptlim, warnp, tptr, loc); + continue; + case 't': + pt = _add("\t", pt, ptlim); + continue; + case 'U': + pt = _conv((t->tm_yday + DAYSPERWEEK - + t->tm_wday) / DAYSPERWEEK, + fmt_padding[PAD_FMT_WEEKOFYEAR][PadIndex], pt, ptlim, loc); + continue; + case 'u': + /* + ** From Arnold Robbins' strftime version 3.0: + ** "ISO 8601: Weekday as a decimal number + ** [1 (Monday) - 7]" + ** (ado, 1993-05-24) + */ + pt = _conv((t->tm_wday == 0) ? + DAYSPERWEEK : t->tm_wday, + "%d", pt, ptlim, loc); + continue; + case 'V': /* ISO 8601 week number */ + case 'G': /* ISO 8601 year (four digits) */ + case 'g': /* ISO 8601 year (two digits) */ +/* +** From Arnold Robbins' strftime version 3.0: "the week number of the +** year (the first Monday as the first day of week 1) as a decimal number +** (01-53)." +** (ado, 1993-05-24) +** +** From "http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html" by Markus Kuhn: +** "Week 01 of a year is per definition the first week which has the +** Thursday in this year, which is equivalent to the week which contains +** the fourth day of January. In other words, the first week of a new year +** is the week which has the majority of its days in the new year. Week 01 +** might also contain days from the previous year and the week before week +** 01 of a year is the last week (52 or 53) of the previous year even if +** it contains days from the new year. A week starts with Monday (day 1) +** and ends with Sunday (day 7). For example, the first week of the year +** 1997 lasts from 1996-12-30 to 1997-01-05..." +** (ado, 1996-01-02) +*/ + { + int year; + int base; + int yday; + int wday; + int w; + + year = t->tm_year; + base = TM_YEAR_BASE; + yday = t->tm_yday; + wday = t->tm_wday; + for ( ; ; ) { + int len; + int bot; + int top; + + len = isleap_sum(year, base) ? + DAYSPERLYEAR : + DAYSPERNYEAR; + /* + ** What yday (-3 ... 3) does + ** the ISO year begin on? + */ + bot = ((yday + 11 - wday) % + DAYSPERWEEK) - 3; + /* + ** What yday does the NEXT + ** ISO year begin on? + */ + top = bot - + (len % DAYSPERWEEK); + if (top < -3) + top += DAYSPERWEEK; + top += len; + if (yday >= top) { + ++base; + w = 1; + break; + } + if (yday >= bot) { + w = 1 + ((yday - bot) / + DAYSPERWEEK); + break; + } + --base; + yday += isleap_sum(year, base) ? + DAYSPERLYEAR : + DAYSPERNYEAR; + } +#ifdef XPG4_1994_04_09 + if ((w == 52 && + t->tm_mon == TM_JANUARY) || + (w == 1 && + t->tm_mon == TM_DECEMBER)) + w = 53; +#endif /* defined XPG4_1994_04_09 */ + if (*format == 'V') + pt = _conv(w, fmt_padding[PAD_FMT_WEEKOFYEAR][PadIndex], + pt, ptlim, loc); + else if (*format == 'g') { + *warnp = IN_ALL; + pt = _yconv(year, base, 0, 1, + pt, ptlim, loc); + } else pt = _yconv(year, base, 1, 1, + pt, ptlim, loc); + } + continue; + case 'v': + /* + ** From Arnold Robbins' strftime version 3.0: + ** "date as dd-bbb-YYYY" + ** (ado, 1993-05-24) + */ + pt = _fmt("%e-%b-%Y", t, pt, ptlim, warnp, tptr, loc); + continue; + case 'W': + pt = _conv((t->tm_yday + DAYSPERWEEK - + (t->tm_wday ? + (t->tm_wday - 1) : + (DAYSPERWEEK - 1))) / DAYSPERWEEK, + fmt_padding[PAD_FMT_WEEKOFYEAR][PadIndex], pt, ptlim, loc); + continue; + case 'w': + pt = _conv(t->tm_wday, "%d", pt, ptlim, loc); + continue; + case 'X': + pt = _fmt(tptr->X_fmt, t, pt, ptlim, warnp, tptr, loc); + continue; + case 'x': + { + int warn2 = IN_SOME; + + pt = _fmt(tptr->x_fmt, t, pt, ptlim, &warn2, tptr, loc); + if (warn2 == IN_ALL) + warn2 = IN_THIS; + if (warn2 > *warnp) + *warnp = warn2; + } + continue; + case 'y': + *warnp = IN_ALL; + pt = _yconv(t->tm_year, TM_YEAR_BASE, 0, 1, + pt, ptlim, loc); + continue; + case 'Y': + pt = _yconv(t->tm_year, TM_YEAR_BASE, 1, 1, + pt, ptlim, loc); + continue; + case 'Z': +#ifdef TM_ZONE + if (t->TM_ZONE != NULL) + pt = _add(t->TM_ZONE, pt, ptlim); + else +#endif /* defined TM_ZONE */ + if (t->tm_isdst >= 0) + pt = _add(tzname[t->tm_isdst != 0], + pt, ptlim); + /* + ** C99 says that %Z must be replaced by the + ** empty string if the time zone is not + ** determinable. + */ + continue; + case 'z': + { + int diff; + char const * sign; + + if (t->tm_isdst < 0) + continue; +#if defined(TM_GMTOFF) && !__DARWIN_UNIX03 + diff = t->TM_GMTOFF; +#else /* !defined TM_GMTOFF || __DARWIN_UNIX03 */ + /* + ** C99 says that the UTC offset must + ** be computed by looking only at + ** tm_isdst. This requirement is + ** incorrect, since it means the code + ** must rely on magic (in this case + ** altzone and timezone), and the + ** magic might not have the correct + ** offset. Doing things correctly is + ** tricky and requires disobeying C99; + ** see GNU C strftime for details. + ** For now, punt and conform to the + ** standard, even though it's incorrect. + ** + ** C99 says that %z must be replaced by the + ** empty string if the time zone is not + ** determinable, so output nothing if the + ** appropriate variables are not available. + */ + if (t->tm_isdst == 0) +#ifdef USG_COMPAT + diff = -_st_get_timezone(); +#else /* !defined USG_COMPAT */ + continue; +#endif /* !defined USG_COMPAT */ + else +#ifdef ALTZONE + diff = -altzone; +#else /* !defined ALTZONE */ + continue; +#endif /* !defined ALTZONE */ +#endif /* !defined TM_GMTOFF || __DARWIN_UNIX03 */ + if (diff < 0) { + sign = "-"; + diff = -diff; + } else sign = "+"; + pt = _add(sign, pt, ptlim); + diff /= SECSPERMIN; + diff = (diff / MINSPERHOUR) * 100 + + (diff % MINSPERHOUR); + pt = _conv(diff, + fmt_padding[PAD_FMT_YEAR][PadIndex], pt, ptlim, loc); + } + continue; + case '+': + pt = _fmt(tptr->date_fmt, t, pt, ptlim, + warnp, tptr, loc); + continue; + case '-': + if (PadIndex != PAD_DEFAULT) + break; + PadIndex = PAD_LESS; + goto label; + case '_': + if (PadIndex != PAD_DEFAULT) + break; + PadIndex = PAD_SPACE; + goto label; + case '0': + if (PadIndex != PAD_DEFAULT) + break; + PadIndex = PAD_ZERO; + goto label; + case '%': + /* + ** X311J/88-090 (4.12.3.5): if conversion char is + ** undefined, behavior is undefined. Print out the + ** character itself as printf(3) also does. + */ + default: + break; + } + } + if (pt == ptlim) + break; + *pt++ = *format; + } + return pt; +} + +static char * +_conv(n, format, pt, ptlim, loc) +const int n; +const char * const format; +char * const pt; +const char * const ptlim; +locale_t loc; +{ + char buf[INT_STRLEN_MAXIMUM(int) + 1]; + + (void) sprintf_l(buf, loc, format, n); + return _add(buf, pt, ptlim); +} + +static char * +_add(str, pt, ptlim) +const char * str; +char * pt; +const char * const ptlim; +{ + while (pt < ptlim && (*pt = *str++) != '\0') + ++pt; + return pt; +} + +/* +** POSIX and the C Standard are unclear or inconsistent about +** what %C and %y do if the year is negative or exceeds 9999. +** Use the convention that %C concatenated with %y yields the +** same output as %Y, and that %Y contains at least 4 bytes, +** with more only if necessary. +*/ + +static char * +_yconv(a, b, convert_top, convert_yy, pt, ptlim, loc) +const int a; +const int b; +const int convert_top; +const int convert_yy; +char * pt; +const char * const ptlim; +locale_t loc; +{ + register int lead; + register int trail; + +#define DIVISOR 100 + trail = a % DIVISOR + b % DIVISOR; + lead = a / DIVISOR + b / DIVISOR + trail / DIVISOR; + trail %= DIVISOR; + if (trail < 0 && lead > 0) { + trail += DIVISOR; + --lead; + } else if (lead < 0 && trail > 0) { + trail -= DIVISOR; + ++lead; + } + if (convert_top) { + if (lead == 0 && trail < 0) + pt = _add("-0", pt, ptlim); + else pt = _conv(lead, "%02d", pt, ptlim, loc); + } + if (convert_yy) + pt = _conv(((trail < 0) ? -trail : trail), "%02d", pt, ptlim, loc); + return pt; +} +#endif /* !BUILDING_VARIANT */ +#pragma clang diagnostic pop diff --git a/stdtime/FreeBSD/strptime.3 b/stdtime/FreeBSD/strptime.3 new file mode 100644 index 0000000..eb8c16c --- /dev/null +++ b/stdtime/FreeBSD/strptime.3 @@ -0,0 +1,189 @@ +.\" +.\" Copyright (c) 1997 Joerg Wunsch +.\" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" " +.Dd October 2, 2014 +.Dt STRPTIME 3 +.Os +.Sh NAME +.Nm strptime , +.Nm strptime_l +.Nd parse date and time string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft char * +.Fo strptime +.Fa "const char * restrict buf" +.Fa "const char * restrict format" +.Fa "struct tm * restrict timeptr" +.Fc +.In time.h +.In xlocale.h +.Ft char * +.Fn strptime_l "const char * restrict buf" "const char * restrict format" "struct tm * restrict timeptr" "locale_t loc" +.Sh DESCRIPTION +The +.Fn strptime +function parses the string in the buffer +.Fa buf +according to the string pointed to by +.Fa format , +and fills in the elements of the structure pointed to by +.Fa timeptr . +The resulting values will be relative to the local time zone. +Thus, it can be considered the reverse operation of +.Xr strftime 3 . +The +.Fn strptime_l +function does the same as +.Fn strptime , +but takes an explicit locale rather than using the current locale. +.Pp +The +.Fa format +string consists of zero or more conversion specifications and +ordinary characters. +All ordinary characters are matched exactly with the buffer, where +white space in the format string will match any amount of white space +in the buffer. +All conversion specifications are identical to those described in +.Xr strftime 3 . +.Pp +Two-digit year values, including formats +.Fa %y +and +.Fa \&%D , +are now interpreted as beginning at 1969 per POSIX requirements. +Years 69-00 are interpreted in the 20th century (1969-2000), years +01-68 in the 21st century (2001-2068). +The +.Fa \&%U +and +.Fa %W +format specifiers accept any value within the range 00 to 53. +.Pp +If the +.Fa format +string does not contain enough conversion specifications to completely +specify the resulting +.Vt struct tm , +the unspecified members of +.Va timeptr +are left untouched. +For example, if +.Fa format +is +.Dq Li "%H:%M:%S" , +only +.Va tm_hour , +.Va tm_sec +and +.Va tm_min +will be modified. +If time relative to today is desired, initialize the +.Fa timeptr +structure with today's date before passing it to +.Fn strptime . +.Sh RETURN VALUES +Upon successful completion, +.Fn strptime +returns the pointer to the first character in +.Fa buf +that has not been required to satisfy the specified conversions in +.Fa format . +It returns +.Dv NULL +if one of the conversions failed. +.Fn strptime_l +returns the same values as +.Fn strptime . +.Sh LEGACY DESCRIPTION +In legacy mode, the +.Fa %Y +format specifier expects exactly 4 digits (leaving any trailing digits for the +next specifier). +.Sh SEE ALSO +.Xr date 1 , +.Xr scanf 3 , +.Xr strftime 3 , +.Xr xlocale 3 +.Sh HISTORY +The +.Fn strptime +function appeared in +.Fx 3.0 . +.Sh AUTHORS +The +.Fn strptime +function has been contributed by Powerdog Industries. +.Pp +This man page was written by +.An J\(:org Wunsch . +.Sh BUGS +Both the +.Fa %e +and +.Fa %l +format specifiers may incorrectly scan one too many digits +if the intended values comprise only a single digit +and that digit is followed immediately by another digit. +Both specifiers accept zero-padded values, +even though they are both defined as taking unpadded values. +.Pp +The +.Fa %p +format specifier has no effect unless it is parsed +.Em after +hour-related specifiers. +Specifying +.Fa %l +without +.Fa %p +will produce undefined results. +Note that 12AM +(ante meridiem) +is taken as midnight +and 12PM +(post meridiem) +is taken as noon. +.Pp +The +.Fa %Z +format specifier only accepts time zone abbreviations of the local time zone, +or the value "GMT". +This limitation is because of ambiguity due to of the over loading of time +zone abbreviations. +One such example is +.Fa EST +which is both Eastern Standard Time and Eastern Australia Summer Time. +.Pp +The +.Fn strptime +function does not correctly handle multibyte characters in the +.Fa format +argument. diff --git a/stdtime/FreeBSD/strptime.c b/stdtime/FreeBSD/strptime.c new file mode 100644 index 0000000..ab0731d --- /dev/null +++ b/stdtime/FreeBSD/strptime.c @@ -0,0 +1,820 @@ +/*- + * Copyright (c) 2014 Gary Mills + * Copyright 2011, Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 1994 Powerdog Industries. All rights reserved. + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY POWERDOG INDUSTRIES ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE POWERDOG INDUSTRIES BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation + * are those of the authors and should not be interpreted as representing + * official policies, either expressed or implied, of Powerdog Industries. + */ + +#include +#ifndef lint +#ifndef NOID +static char copyright[] __unused = +"@(#) Copyright (c) 1994 Powerdog Industries. All rights reserved."; +static char sccsid[] __unused = "@(#)strptime.c 0.1 (Powerdog) 94/03/27"; +#endif /* !defined NOID */ +#endif /* not lint */ +__FBSDID("$FreeBSD$"); + +#include "xlocale_private.h" + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "timelocal.h" +#include "tzfile.h" + +time_t _mktime(struct tm *, const char *); + +#define asizeof(a) (sizeof(a) / sizeof((a)[0])) + +enum {CONVERT_NONE, CONVERT_GMT, CONVERT_ZONE}; +enum week_kind { WEEK_U = 'U', WEEK_V = 'V', WEEK_W = 'W'}; + +#define _strptime(b,f,t,c,l) _strptime0(b,f,t,c,l,FLAG_NONE,0,WEEK_U) + +#define FLAG_NONE 0x01 +#define FLAG_YEAR 0x02 +#define FLAG_MONTH 0x04 +#define FLAG_YDAY 0x08 +#define FLAG_MDAY 0x10 +#define FLAG_WDAY 0x20 +#define FLAG_WEEK 0x40 +#define FLAG_CENTURY 0x100 +#define FLAG_YEAR_IN_CENTURY 0x200 + +/* + * Calculate the week day of the first day of a year. Valid for + * the Gregorian calendar, which began Sept 14, 1752 in the UK + * and its colonies. Ref: + * http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week + */ + +static int +first_wday_of(int year) +{ + return (((2 * (3 - (year / 100) % 4)) + (year % 100) + + ((year % 100) / 4) + (isleap(year) ? 6 : 0) + 1) % 7); +} + +static inline bool is_plus(char c) { + return c == '+'; +} + +static inline bool is_minus(char c) { + return c == '-'; +} + +static inline bool is_zero(char c) { + return c == '0'; +} + +static char * +_strptime0(const char *buf, const char *fmt, struct tm *tm, int *convp, locale_t locale, int flags, int week_number, enum week_kind week_kind) +{ + char c; + const char *ptr; + int wday_offset; + int i, len; + bool negative; + int Ealternative, Oalternative; + const struct lc_time_T *tptr = __get_current_time_locale(locale); + static int start_of_month[2][13] = { + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, + {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} + }; + + ptr = fmt; + while (*ptr != 0) { + int field_width = 0; + c = *ptr++; + + if (c != '%') { + if (isspace_l((unsigned char)c, locale)) + while (*buf != 0 && + isspace_l((unsigned char)*buf, locale)) + buf++; + else if (c != *buf++) + return (NULL); + continue; + } + + Ealternative = 0; + Oalternative = 0; +label: + c = *ptr++; + if (is_zero(c)) { + // Leading '0' is to be ignored. + c = *ptr++; + } else if (is_plus(c)) { + // POSIX sats leading '+' should be ignored, but FreeBSD interprets + // "%+" to mean locale-specific date format. Try to handle both by + // checking the next character. + char next = *ptr; + if (next != '\0' && next != '%' && !isspace_l(next, locale)) { + // Use POSIX interpretation. + c = *ptr++; + } + } + + if (isdigit_l(c, locale)) { + // Field width + field_width = c - '0'; + while (*ptr != '\0' && isdigit_l(*ptr, locale)) { + field_width *= 10; + field_width += *ptr++ - '0'; + } + c = *ptr++; + } + switch (c) { + case '%': + if (*buf++ != '%') + return (NULL); + break; + + case '+': + buf = _strptime(buf, tptr->date_fmt, tm, convp, locale); + if (buf == NULL) + return (NULL); + flags |= FLAG_WDAY | FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; + break; + + case 'C': + if (!isdigit_l((unsigned char)*buf, locale) && !is_plus(*buf) && !is_minus(*buf)) + return (NULL); + + /* XXX This will break for 3-digit centuries. */ + negative = false; + len = field_width ? field_width : 2; + if (is_plus(*buf)) { + len--; + buf++; + } else if (is_minus(*buf)) { + len--; + negative = true; + buf++; + } + for (i = 0; len && *buf != 0 && + isdigit_l((unsigned char)*buf, locale); buf++) { + i *= 10; + i += *buf - '0'; + len--; + } + + if (negative) { + i = -i; + } + + if (flags & FLAG_YEAR_IN_CENTURY) { + tm->tm_year = i * 100 + (tm->tm_year % 100) - TM_YEAR_BASE; + flags &= ~FLAG_YEAR_IN_CENTURY; + } else { + tm->tm_year = i * 100 - TM_YEAR_BASE; + flags |= FLAG_YEAR; + flags |= FLAG_CENTURY; + } + + break; + + case 'c': + buf = _strptime(buf, tptr->c_fmt, tm, convp, locale); + if (buf == NULL) + return (NULL); + flags |= FLAG_WDAY | FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; + flags &= ~(FLAG_CENTURY | FLAG_YEAR_IN_CENTURY); + break; + + case 'D': + buf = _strptime(buf, "%m/%d/%y", tm, convp, locale); + if (buf == NULL) + return (NULL); + flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; + flags &= ~(FLAG_CENTURY | FLAG_YEAR_IN_CENTURY); + break; + + case 'E': + if (Ealternative || Oalternative) + break; + Ealternative++; + if (*ptr == '%') return (NULL); + goto label; + + case 'O': + if (Ealternative || Oalternative) + break; + Oalternative++; + if (*ptr == '%') return (NULL); + goto label; + + case 'F': + buf = _strptime(buf, "%Y-%m-%d", tm, convp, locale); + if (buf == NULL) + return (NULL); + flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; + flags &= ~(FLAG_CENTURY | FLAG_YEAR_IN_CENTURY); + break; + + case 'R': + buf = _strptime(buf, "%H:%M", tm, convp, locale); + if (buf == NULL) + return (NULL); + break; + + case 'r': + buf = _strptime(buf, tptr->ampm_fmt, tm, convp, locale); + if (buf == NULL) + return (NULL); + break; + + case 'T': + buf = _strptime(buf, "%H:%M:%S", tm, convp, locale); + if (buf == NULL) + return (NULL); + break; + + case 'X': + buf = _strptime(buf, tptr->X_fmt, tm, convp, locale); + if (buf == NULL) + return (NULL); + break; + + case 'x': + buf = _strptime(buf, tptr->x_fmt, tm, convp, locale); + if (buf == NULL) + return (NULL); + flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; + flags &= ~(FLAG_CENTURY | FLAG_YEAR_IN_CENTURY); + break; + + case 'j': + if (!isdigit_l((unsigned char)*buf, locale)) + return (NULL); + + len = field_width ? field_width : 3; + for (i = 0; len && *buf != 0 && + isdigit_l((unsigned char)*buf, locale); buf++){ + i *= 10; + i += *buf - '0'; + len--; + } + if (i < 1 || i > 366) + return (NULL); + + tm->tm_yday = i - 1; + flags |= FLAG_YDAY; + + break; + + case 'M': + case 'S': + if (*buf == 0 || + isspace_l((unsigned char)*buf, locale)) + break; + + if (!isdigit_l((unsigned char)*buf, locale)) + return (NULL); + + len = field_width ? field_width : 2; + for (i = 0; len && *buf != 0 && + isdigit_l((unsigned char)*buf, locale); buf++){ + i *= 10; + i += *buf - '0'; + len--; + } + + if (c == 'M') { + if (i > 59) + return (NULL); + tm->tm_min = i; + } else { + if (i > 60) + return (NULL); + tm->tm_sec = i; + } + + break; + + case 'H': + case 'I': + case 'k': + case 'l': + /* + * Of these, %l is the only specifier explicitly + * documented as not being zero-padded. However, + * there is no harm in allowing zero-padding. + * + * XXX The %l specifier may gobble one too many + * digits if used incorrectly. + */ + if (!isdigit_l((unsigned char)*buf, locale)) + return (NULL); + + len = field_width ? field_width : 2; + for (i = 0; len && *buf != 0 && + isdigit_l((unsigned char)*buf, locale); buf++) { + i *= 10; + i += *buf - '0'; + len--; + } + if (c == 'H' || c == 'k') { + if (i > 23) + return (NULL); + } else if (i > 12) + return (NULL); + + tm->tm_hour = i; + + break; + + case 'p': + /* + * XXX This is bogus if parsed before hour-related + * specifiers. + */ + if (tm->tm_hour > 12) + return (NULL); + + len = (int)strlen(tptr->am); + if (strncasecmp_l(buf, tptr->am, len, locale) == 0) { + if (tm->tm_hour == 12) + tm->tm_hour = 0; + buf += len; + break; + } + + len = (int)strlen(tptr->pm); + if (strncasecmp_l(buf, tptr->pm, len, locale) == 0) { + if (tm->tm_hour != 12) + tm->tm_hour += 12; + buf += len; + break; + } + + return (NULL); + + case 'A': + case 'a': + for (i = 0; i < asizeof(tptr->weekday); i++) { + len = (int)strlen(tptr->weekday[i]); + if (strncasecmp_l(buf, tptr->weekday[i], + len, locale) == 0) + break; + len = (int)strlen(tptr->wday[i]); + if (strncasecmp_l(buf, tptr->wday[i], + len, locale) == 0) + break; + } + if (i == asizeof(tptr->weekday)) + return (NULL); + + buf += len; + tm->tm_wday = i; + flags |= FLAG_WDAY; + break; + + case 'U': /* Sunday week */ + case 'V': /* ISO 8601 week */ + case 'W': /* Monday week */ + if (!isdigit_l((unsigned char)*buf, locale)) + return (NULL); + + len = field_width ? field_width : 2; + for (i = 0; len && *buf != 0 && + isdigit_l((unsigned char)*buf, locale); buf++) { + i *= 10; + i += *buf - '0'; + len--; + } + if (i > 53) + return (NULL); + if (c == WEEK_V && i < 1) + return (NULL); + + week_number = i; + week_kind = c; + flags |= FLAG_WEEK; + + break; + + case 'u': /* [1,7] */ + case 'w': /* [0,6] */ + if (!isdigit_l((unsigned char)*buf, locale)) + return (NULL); + + i = *buf - '0'; + if (i < 0 || i > 7 || (c == 'u' && i < 1) || + (c == 'w' && i > 6)) + return (NULL); + + tm->tm_wday = i % 7; + flags |= FLAG_WDAY; + buf++; + + break; + + case 'e': + /* + * With %e format, our strftime(3) adds a blank space + * before single digits. + */ + if (*buf != 0 && + isspace_l((unsigned char)*buf, locale)) + buf++; + /* FALLTHROUGH */ + case 'd': + /* + * The %e specifier was once explicitly documented as + * not being zero-padded but was later changed to + * equivalent to %d. There is no harm in allowing + * such padding. + * + * XXX The %e specifier may gobble one too many + * digits if used incorrectly. + */ + /* Leading space is ok if date is single digit */ + len = field_width ? field_width : 2; + if (isspace_l((unsigned char)buf[0], locale) && + isdigit_l((unsigned char)buf[1], locale) && + !isdigit_l((unsigned char)buf[2], locale)) { + len = 1; + buf++; + } + if (!isdigit_l((unsigned char)*buf, locale)) + return (NULL); + + for (i = 0; len && *buf != 0 && + isdigit_l((unsigned char)*buf, locale); buf++) { + i *= 10; + i += *buf - '0'; + len--; + } + if (i > 31) + return (NULL); + + tm->tm_mday = i; + flags |= FLAG_MDAY; + + break; + + case 'B': + case 'b': + case 'h': + for (i = 0; i < asizeof(tptr->month); i++) { + if (Oalternative) { + if (c == 'B') { + len = (int)strlen(tptr->alt_month[i]); + if (strncasecmp_l(buf, + tptr->alt_month[i], + len, locale) == 0) + break; + } + } else { + len = (int)strlen(tptr->month[i]); + if (strncasecmp_l(buf, tptr->month[i], + len, locale) == 0) + break; + } + } + /* + * Try the abbreviated month name if the full name + * wasn't found and Oalternative was not requested. + */ + if (i == asizeof(tptr->month) && !Oalternative) { + for (i = 0; i < asizeof(tptr->month); i++) { + len = (int)strlen(tptr->mon[i]); + if (strncasecmp_l(buf, tptr->mon[i], + len, locale) == 0) + break; + } + } + if (i == asizeof(tptr->month)) + return (NULL); + + tm->tm_mon = i; + buf += len; + flags |= FLAG_MONTH; + + break; + + case 'm': + if (!isdigit_l((unsigned char)*buf, locale)) + return (NULL); + + len = field_width ? field_width : 2; + for (i = 0; len && *buf != 0 && + isdigit_l((unsigned char)*buf, locale); buf++) { + i *= 10; + i += *buf - '0'; + len--; + } + if (i < 1 || i > 12) + return (NULL); + + tm->tm_mon = i - 1; + flags |= FLAG_MONTH; + + break; + + case 's': + { + char *cp; + int sverrno; + long n; + time_t t; + + sverrno = errno; + errno = 0; + n = strtol_l(buf, &cp, 10, locale); + if (errno == ERANGE || (long)(t = n) != n) { + errno = sverrno; + return (NULL); + } + errno = sverrno; + buf = cp; + if (gmtime_r(&t, tm) == NULL) + return (NULL); + *convp = CONVERT_GMT; + flags |= FLAG_YDAY | FLAG_WDAY | FLAG_MONTH | + FLAG_MDAY | FLAG_YEAR; + flags &= ~(FLAG_CENTURY | FLAG_YEAR_IN_CENTURY); + } + break; + + case 'Y': + case 'y': + if (*buf == 0 || + isspace_l((unsigned char)*buf, locale)) + break; + + if (!isdigit_l((unsigned char)*buf, locale) && !is_plus(*buf) + && !is_minus(*buf)) + return (NULL); + + len = field_width ? field_width : ((c == 'Y') ? 4 : 2); + negative = false; + if (is_plus(*buf)) { + len--; + buf++; + } else if (is_minus(*buf)) { + len--; + buf++; + negative = true; + } + for (i = 0; len && *buf != 0 && + isdigit_l((unsigned char)*buf, locale); buf++) { + i *= 10; + i += *buf - '0'; + len--; + } + + if (i < 0) + return (NULL); + + if (negative) { + i = -i; + } + + if (c == 'Y'){ + i -= TM_YEAR_BASE; + } else if (c == 'y' && flags & FLAG_CENTURY) { + i = tm->tm_year + (i % 100); + flags &= ~FLAG_CENTURY; + } else if (c == 'y'){ + if (i < 69) i += 100; + flags |= FLAG_YEAR_IN_CENTURY; + } + + tm->tm_year = i; + flags |= FLAG_YEAR; + if (c == 'Y'){ + flags &= ~(FLAG_CENTURY | FLAG_YEAR_IN_CENTURY); + } + + break; + + case 'Z': + { + const char *cp; + size_t tzlen, len; + + for (cp = buf; *cp && + isupper_l((unsigned char)*cp, locale); ++cp) { + /*empty*/ + } + len = field_width ? field_width : cp - buf; + if (len == 3 && strncmp(buf, "GMT", 3) == 0) { + *convp = CONVERT_GMT; + buf += len; + break; + } + + tzset(); + tzlen = strlen(tzname[0]); + if (len == tzlen && strncmp(buf, tzname[0], tzlen) == 0) { + tm->tm_isdst = 0; + buf += len; + break; + } + tzlen = strlen(tzname[1]); + if (len == tzlen && strncmp(buf, tzname[1], tzlen) == 0) { + tm->tm_isdst = 1; + buf += len; + break; + } + return (NULL); + } + + case 'z': + { + char sign; + int hr, min; + if ((buf[0] != '+' && buf[0] != '-') + || !isdigit_l((unsigned char)buf[1], locale) + || !isdigit_l((unsigned char)buf[2], locale) + || !isdigit_l((unsigned char)buf[3], locale) + || !isdigit_l((unsigned char)buf[4], locale)) + return 0; + sscanf(buf, "%c%2d%2d", &sign, &hr, &min); + *convp = CONVERT_ZONE; + tm->tm_gmtoff = 60 * (60 * hr + min); + if (sign == '-') + tm->tm_gmtoff = -tm->tm_gmtoff; + buf += 5; + } + break; + + case 'n': + case 't': + if (!isspace((unsigned char)*buf)) + return 0; + while (isspace_l((unsigned char)*buf, locale)) + buf++; + break; + + default: + return (NULL); + } + } + + if (!(flags & FLAG_YDAY) && (flags & FLAG_YEAR)) { + if ((flags & (FLAG_MONTH | FLAG_MDAY)) == + (FLAG_MONTH | FLAG_MDAY)) { + tm->tm_yday = start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)][tm->tm_mon] + (tm->tm_mday - 1); + flags |= FLAG_YDAY; + } else if (flags & FLAG_WEEK){ + int day_offset = week_kind == WEEK_U ? TM_SUNDAY : TM_MONDAY; + int fwo = first_wday_of(tm->tm_year + TM_YEAR_BASE); + + /* No incomplete week (week 0). */ + if (week_number == 0 && fwo == day_offset) + return (NULL); + + if (!(flags & FLAG_WDAY)) { + /* + * Set the date to the first Sunday (or Monday) + * of the specified week of the year. + */ + tm->tm_wday = day_offset; + flags |= FLAG_WDAY; + } + + /* + * Start our yday at the first day of the relevant week type. + */ + int tmpyday = (7 - fwo + day_offset) % 7; + + /* + * ISO Weeks start counting from the first week with at least + * four days. If our first week had that, subtract off a week. + */ + if (week_kind == WEEK_V && fwo > TM_MONDAY && fwo <= TM_THURSDAY) { + tmpyday -= 7; + } + /* Advance the relevant number of weeks */ + tmpyday += (week_number - 1) * 7; + /* And go to the right day of week */ + tmpyday += (tm->tm_wday - day_offset + 7) % 7; + + /* Impossible yday for incomplete week (week 0). */ + if (tmpyday < 0) { + if (flags & FLAG_WDAY) + return (NULL); + tmpyday = 0; + } + tm->tm_yday = tmpyday; + flags |= FLAG_YDAY; + } + } + + if ((flags & (FLAG_YEAR | FLAG_YDAY)) == (FLAG_YEAR | FLAG_YDAY)) { + if (!(flags & FLAG_MONTH)) { + i = 0; + while (tm->tm_yday >= + start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)][i]) + i++; + if (i > 12) { + i = 1; + tm->tm_yday -= + start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)][12]; + tm->tm_year++; + } + tm->tm_mon = i - 1; + flags |= FLAG_MONTH; + } + if (!(flags & FLAG_MDAY)) { + tm->tm_mday = tm->tm_yday - + start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)] + [tm->tm_mon] + 1; + flags |= FLAG_MDAY; + } + if (!(flags & FLAG_WDAY)) { + wday_offset = first_wday_of(tm->tm_year + TM_YEAR_BASE); + tm->tm_wday = (wday_offset + tm->tm_yday) % 7; + flags |= FLAG_WDAY; + } + } + + return ((char *)buf); +} + + +char * +strptime(const char * __restrict buf, const char * __restrict fmt, + struct tm * __restrict tm) +{ + return strptime_l(buf, fmt, tm, __current_locale()); +} + +extern time_t timeoff(struct tm *, long); + +char * +strptime_l(const char * __restrict buf, const char * __restrict fmt, + struct tm * __restrict tm, locale_t loc) +{ + char *ret; + int conv; + + NORMALIZE_LOCALE(loc); + conv = CONVERT_NONE; + tm->tm_zone = NULL; + ret = _strptime(buf, fmt, tm, &conv, loc); + if (ret) { + time_t t; + + switch(conv) { + case CONVERT_GMT: + t = timegm(tm); + localtime_r(&t, tm); + break; + case CONVERT_ZONE: + { + long offset = tm->tm_gmtoff; + tm->tm_gmtoff = 0; + t = timeoff(tm, offset); + localtime_r(&t, tm); + break; + } + } + } + + return (ret); +} diff --git a/stdtime/FreeBSD/time2posix.3 b/stdtime/FreeBSD/time2posix.3 new file mode 100644 index 0000000..9beca36 --- /dev/null +++ b/stdtime/FreeBSD/time2posix.3 @@ -0,0 +1,123 @@ +.\" $FreeBSD: src/lib/libc/stdtime/time2posix.3,v 1.17 2009/05/27 12:18:39 edwin Exp $ +.\" +.Dd September 11, 2005 +.Dt TIME2POSIX 3 +.Os +.Sh NAME +.Nm time2posix , +.Nm posix2time +.Nd convert seconds since the Epoch +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft time_t +.Fn time2posix "time_t t" +.Ft time_t +.Fn posix2time "time_t t" +.Sh DESCRIPTION +.St -p1003.1-88 +legislates that a time_t value of +536457599 shall correspond to "Wed Dec 31 23:59:59 GMT 1986." +This effectively implies that POSIX time_t's cannot include leap +seconds and, +therefore, +that the system time must be adjusted as each leap occurs. +.Pp +If the time package is configured with leap-second support +enabled, +however, +no such adjustment is needed and +time_t values continue to increase over leap events +(as a true `seconds since...' value). +This means that these values will differ from those required by POSIX +by the net number of leap seconds inserted since the Epoch. +.Pp +Typically this is not a problem as the type time_t is intended +to be +(mostly) +opaque\(emtime_t values should only be obtained-from and +passed-to functions such as +.Xr time 3 , +.Xr localtime 3 , +.Xr mktime 3 +and +.Xr difftime 3 . +However, +.St -p1003.1-88 +gives an arithmetic +expression for directly computing a time_t value from a given date/time, +and the same relationship is assumed by some +(usually older) +applications. +Any programs creating/dissecting time_t's +using such a relationship will typically not handle intervals +over leap seconds correctly. +.Pp +The +.Fn time2posix +and +.Fn posix2time +functions are provided to address this time_t mismatch by converting +between local time_t values and their POSIX equivalents. +This is done by accounting for the number of time-base changes that +would have taken place on a POSIX system as leap seconds were inserted +or deleted. +These converted values can then be used in lieu of correcting the older +applications, +or when communicating with POSIX-compliant systems. +.Pp +The +.Fn time2posix +function is single-valued. +That is, +every local time_t +corresponds to a single POSIX time_t. +The +.Fn posix2time +function is less well-behaved: +for a positive leap second hit the result is not unique, +and for a negative leap second hit the corresponding +POSIX time_t does not exist so an adjacent value is returned. +Both of these are good indicators of the inferiority of the +POSIX representation. +.Pp +The following table summarizes the relationship between time_t +and its conversion to, +and back from, +the POSIX representation over the leap second inserted at the end of June, +1993. +.Bl -column "93/06/30" "23:59:59" "A+0" "X=time2posix(T)" +.It Sy "DATE TIME T X=time2posix(T) posix2time(X)" +.It "93/06/30 23:59:59 A+0 B+0 A+0" +.It "93/06/30 23:59:60 A+1 B+1 A+1 or A+2" +.It "93/07/01 00:00:00 A+2 B+1 A+1 or A+2" +.It "93/07/01 00:00:01 A+3 B+2 A+3" +.El +.Pp +A leap second deletion would look like... +.Bl -column "??/06/30" "23:59:58" "A+0" "X=time2posix(T)" +.It Sy "DATE TIME T X=time2posix(T) posix2time(X)" +.It "??/06/30 23:59:58 A+0 B+0 A+0" +.It "??/07/01 00:00:00 A+1 B+2 A+1" +.It "??/07/01 00:00:01 A+2 B+3 A+2" +.El +.Pp +.D1 No "[Note: posix2time(B+1) => A+0 or A+1]" +.Pp +If leap-second support is not enabled, +local time_t's and +POSIX time_t's are equivalent, +and both +.Fn time2posix +and +.Fn posix2time +degenerate to the identity function. +.Sh "SEE ALSO" +.Xr difftime 3 , +.Xr localtime 3 , +.Xr mktime 3 , +.Xr time 3 +.\" @(#)time2posix.3 8.2 +.\" This file is in the public domain, so clarified as of +.\" 1996-06-05 by Arthur David Olson. diff --git a/stdtime/FreeBSD/time32.c b/stdtime/FreeBSD/time32.c new file mode 100644 index 0000000..5085dd7 --- /dev/null +++ b/stdtime/FreeBSD/time32.c @@ -0,0 +1,100 @@ +/*- + * Copyright (c) 2001 FreeBSD Inc. + * All rights reserved. + * + * These routines are for converting time_t to fixed-bit representations + * for use in protocols or storage. When converting time to a larger + * representation of time_t these routines are expected to assume temporal + * locality and use the 50-year rule to properly set the msb bits. XXX + * + * Redistribution and use under the terms of the COPYRIGHT file at the + * base of the source tree. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdtime/time32.c,v 1.5 2002/06/17 01:42:29 wollman Exp $"); + +#include +#include + +/* + * Convert a 32 bit representation of time_t into time_t. XXX needs to + * implement the 50-year rule to handle post-2038 conversions. + */ +time_t +_time32_to_time(__int32_t t32) +{ + return((time_t)t32); +} + +/* + * Convert time_t to a 32 bit representation. If time_t is 64 bits we can + * simply chop it down. The resulting 32 bit representation can be + * converted back to a temporally local 64 bit time_t using time32_to_time. + */ +__int32_t +_time_to_time32(time_t t) +{ + return((__int32_t)t); +} + +/* + * Convert a 64 bit representation of time_t into time_t. If time_t is + * represented as 32 bits we can simply chop it and not support times + * past 2038. + */ +time_t +_time64_to_time(__int64_t t64) +{ + return((time_t)t64); +} + +/* + * Convert time_t to a 64 bit representation. If time_t is represented + * as 32 bits we simply sign-extend and do not support times past 2038. + */ +__int64_t +_time_to_time64(time_t t) +{ + return((__int64_t)t); +} + +/* + * Convert to/from 'long'. Depending on the sizeof(long) this may or + * may not require using the 50-year rule. + */ +long +_time_to_long(time_t t) +{ + if (sizeof(long) == sizeof(__int64_t)) + return(_time_to_time64(t)); + return((long)t); +} + +time_t +_long_to_time(long tlong) +{ + if (sizeof(long) == sizeof(__int32_t)) + return(_time32_to_time(tlong)); + return((time_t)tlong); +} + +/* + * Convert to/from 'int'. Depending on the sizeof(int) this may or + * may not require using the 50-year rule. + */ +int +_time_to_int(time_t t) +{ + if (sizeof(int) == sizeof(__int64_t)) + return(_time_to_time64(t)); + return((int)t); +} + +time_t +_int_to_time(int tint) +{ + if (sizeof(int) == sizeof(__int32_t)) + return(_time32_to_time(tint)); + return((time_t)tint); +} diff --git a/stdtime/FreeBSD/timelocal.c b/stdtime/FreeBSD/timelocal.c new file mode 100644 index 0000000..e3673be --- /dev/null +++ b/stdtime/FreeBSD/timelocal.c @@ -0,0 +1,154 @@ +/*- + * Copyright (c) 2001 Alexey Zelkin + * Copyright (c) 1997 FreeBSD Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/stdtime/timelocal.c,v 1.25 2003/06/13 00:14:07 jkh Exp $"); + +#include "xlocale_private.h" + +#include +#include + +#include "ldpart.h" +#include "timelocal.h" + +#define LCTIME_SIZE (sizeof(struct lc_time_T) / sizeof(char *)) + +static const struct lc_time_T _C_time_locale = { + { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }, { + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" + }, { + "Sun", "Mon", "Tue", "Wed", + "Thu", "Fri", "Sat" + }, { + "Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday" + }, + + /* X_fmt */ + "%H:%M:%S", + + /* + * x_fmt + * Since the C language standard calls for + * "date, using locale's date format," anything goes. + * Using just numbers (as here) makes Quakers happier; + * it's also compatible with SVR4. + */ + "%m/%d/%y", + + /* + * c_fmt + */ + "%a %b %e %H:%M:%S %Y", + + /* am */ + "AM", + + /* pm */ + "PM", + + /* date_fmt */ + "%a %b %e %H:%M:%S %Z %Y", + + /* alt_month + * Standalone months forms for %OB + */ + { + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" + }, + + /* md_order + * Month / day order in dates + */ + "md", + + /* ampm_fmt + * To determine 12-hour clock format time (empty, if N/A) + */ + "%I:%M:%S %p" +}; + +__private_extern__ struct lc_time_T * +__get_current_time_locale(locale_t loc) +{ + return (loc->_time_using_locale + ? &loc->__lc_time->_time_locale + : (struct lc_time_T *)&_C_time_locale); +} + +__private_extern__ int +__time_load_locale(const char *name, locale_t loc) +{ + int ret; + struct __xlocale_st_time *xp; + static struct __xlocale_st_time *cache = NULL; + + /* 'name' must be already checked. */ + if (strcmp(name, "C") == 0 || strcmp(name, "POSIX") == 0) { + loc->_time_using_locale = 0; + XL_RELEASE(loc->__lc_time); + loc->__lc_time = NULL; + return (_LDP_CACHE); + } + + /* + * If the locale name is the same as our cache, use the cache. + */ + if (cache && cache->_time_locale_buf && strcmp(name, cache->_time_locale_buf) == 0) { + loc->_time_using_locale = 1; + XL_RELEASE(loc->__lc_time); + loc->__lc_time = cache; + XL_RETAIN(loc->__lc_time); + return (_LDP_CACHE); + } + if ((xp = (struct __xlocale_st_time *)malloc(sizeof(*xp))) == NULL) + return _LDP_ERROR; + xp->__refcount = 1; + xp->__free_extra = (__free_extra_t)__ldpart_free_extra; + xp->_time_locale_buf = NULL; + + ret = __part_load_locale(name, &loc->_time_using_locale, + &xp->_time_locale_buf, "LC_TIME", + LCTIME_SIZE, LCTIME_SIZE, + (const char **)&xp->_time_locale); + if (ret == _LDP_LOADED) { + XL_RELEASE(loc->__lc_time); + loc->__lc_time = xp; + XL_RELEASE(cache); + cache = xp; + XL_RETAIN(cache); + } else if (ret == _LDP_ERROR) + free(xp); + + return (ret); +} diff --git a/stdtime/FreeBSD/timelocal.h b/stdtime/FreeBSD/timelocal.h new file mode 100644 index 0000000..02806e8 --- /dev/null +++ b/stdtime/FreeBSD/timelocal.h @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 1997-2002 FreeBSD Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/stdtime/timelocal.h,v 1.11 2002/01/24 15:07:44 phantom Exp $ + */ + +#ifndef _TIMELOCAL_H_ +#define _TIMELOCAL_H_ + +#include + +/* + * Private header file for the strftime and strptime localization + * stuff. + */ +struct lc_time_T { + const char *mon[12]; + const char *month[12]; + const char *wday[7]; + const char *weekday[7]; + const char *X_fmt; + const char *x_fmt; + const char *c_fmt; + const char *am; + const char *pm; + const char *date_fmt; + const char *alt_month[12]; + const char *md_order; + const char *ampm_fmt; +}; + +struct lc_time_T *__get_current_time_locale(locale_t); +int __time_load_locale(const char *, locale_t); + +#endif /* !_TIMELOCAL_H_ */ diff --git a/stdtime/FreeBSD/tzfile.5 b/stdtime/FreeBSD/tzfile.5 new file mode 100644 index 0000000..60187eb --- /dev/null +++ b/stdtime/FreeBSD/tzfile.5 @@ -0,0 +1,152 @@ +.\" $FreeBSD: head/contrib/tzcode/stdtime/tzfile.5 259446 2013-12-16 01:58:12Z bjk $ +.Dd September 13, 1994 +.Dt TZFILE 5 +.Os +.Sh NAME +.Nm tzfile +.Nd timezone information +.Sh SYNOPSIS +.In tzfile.h +.Sh DESCRIPTION +The time zone information files used by +.Xr tzset 3 +begin with the magic characters +.Dq Li TZif +to identify them as +time zone information files, +followed by a character identifying the version of the file's format +(as of 2005, either an ASCII NUL or a '2') +followed by fifteen bytes containing zeroes reserved for future use, +followed by four four-byte values +written in a ``standard'' byte order +(the high-order byte of the value is written first). +These values are, +in order: +.Pp +.Bl -tag -compact -width tzh_ttisstdcnt +.It Va tzh_ttisgmtcnt +The number of UTC/local indicators stored in the file. +.It Va tzh_ttisstdcnt +The number of standard/wall indicators stored in the file. +.It Va tzh_leapcnt +The number of leap seconds for which data is stored in the file. +.It Va tzh_timecnt +The number of ``transition times'' for which data is stored +in the file. +.It Va tzh_typecnt +The number of ``local time types'' for which data is stored +in the file (must not be zero). +.It Va tzh_charcnt +The number of characters of ``time zone abbreviation strings'' +stored in the file. +.El +.Pp +The above header is followed by +.Va tzh_timecnt +four-byte values of type +.Fa long , +sorted in ascending order. +These values are written in ``standard'' byte order. +Each is used as a transition time (as returned by +.Xr time 3 ) +at which the rules for computing local time change. +Next come +.Va tzh_timecnt +one-byte values of type +.Fa "unsigned char" ; +each one tells which of the different types of ``local time'' types +described in the file is associated with the same-indexed transition time. +These values serve as indices into an array of +.Fa ttinfo +structures (with +.Fa tzh_typecnt +entries) that appears next in the file; +these structures are defined as follows: +.Pp +.Bd -literal -offset indent +struct ttinfo { + long tt_gmtoff; + int tt_isdst; + unsigned int tt_abbrind; +}; +.Ed +.Pp +Each structure is written as a four-byte value for +.Va tt_gmtoff +of type +.Fa long , +in a standard byte order, followed by a one-byte value for +.Va tt_isdst +and a one-byte value for +.Va tt_abbrind . +In each structure, +.Va tt_gmtoff +gives the number of seconds to be added to UTC, +.Li tt_isdst +tells whether +.Li tm_isdst +should be set by +.Xr localtime 3 +and +.Va tt_abbrind +serves as an index into the array of time zone abbreviation characters +that follow the +.Li ttinfo +structure(s) in the file. +.Pp +Then there are +.Va tzh_leapcnt +pairs of four-byte values, written in standard byte order; +the first value of each pair gives the time +(as returned by +.Xr time 3 ) +at which a leap second occurs; +the second gives the +.Em total +number of leap seconds to be applied after the given time. +The pairs of values are sorted in ascending order by time. +.Pp +Then there are +.Va tzh_ttisstdcnt +standard/wall indicators, each stored as a one-byte value; +they tell whether the transition times associated with local time types +were specified as standard time or wall clock time, +and are used when a time zone file is used in handling POSIX-style +time zone environment variables. +.Pp +Finally there are +.Va tzh_ttisgmtcnt +UTC/local indicators, each stored as a one-byte value; +they tell whether the transition times associated with local time types +were specified as UTC or local time, +and are used when a time zone file is used in handling POSIX-style +time zone environment variables. +.Pp +.Nm localtime +uses the first standard-time +.Li ttinfo +structure in the file +(or simply the first +.Li ttinfo +structure in the absence of a standard-time structure) +if either +.Li tzh_timecnt +is zero or the time argument is less than the first transition time recorded +in the file. +.Pp +For version-2-format time zone files, +the above header and data is followed by a second header and data, +identical in format except that eight bytes are used for each +transition time or leap second time. +After the second header and data comes a newline-enclosed, +POSIX-TZ-environment-variable-style string for use in handling instants +after the last transition time stored in the file +(with nothing between the newlines if there is no POSIX representation for +such instants). +.Sh SEE ALSO +.Xr ctime 3 , +.Xr time2posix 3 , +.Xr zic 8 +.\" @(#)tzfile.5 8.3 +.\" This file is in the public domain, so clarified as of +.\" 1996-06-05 by Arthur David Olson. diff --git a/stdtime/FreeBSD/tzfile.h b/stdtime/FreeBSD/tzfile.h new file mode 100644 index 0000000..1128133 --- /dev/null +++ b/stdtime/FreeBSD/tzfile.h @@ -0,0 +1,200 @@ +#ifndef TZFILE_H +#define TZFILE_H + + +/* +** This file is in the public domain, so clarified as of +** 1996-06-05 by Arthur David Olson. +** +** $FreeBSD: head/contrib/tzcode/stdtime/tzfile.h 192625 2009-05-23 06:31:50Z edwin $ +*/ + +/* +** This header is for use ONLY with the time conversion code. +** There is no guarantee that it will remain unchanged, +** or that it will remain at all. +** Do NOT copy it to any system include directory. +** Thank you! +*/ + +/* +** ID +*/ + +#ifndef lint +#ifndef NOID +/* +static char tzfilehid[] = "@(#)tzfile.h 8.1"; +*/ +#endif /* !defined NOID */ +#endif /* !defined lint */ + +/* +** Information about time zone files. +*/ + +#include +#include + +/* Time zone object file directory */ +#ifndef TZDIR +# if TARGET_OS_SIMULATOR || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_13) +# define TZDIR "/usr/share/zoneinfo" +# else +# define TZDIR "/var/db/timezone/zoneinfo" +# endif +#endif + +/* No gurantee is made that the TZDEFAULT symlink will have TZDIR as a prefix. + * However, clients can assume that the final path component of the prefix will + * be "zoneinfo" + */ +#ifndef TZDEFAULT +# if TARGET_OS_SIMULATOR || TARGET_OS_OSX +# define TZDEFAULT "/etc/localtime" +# else +# define TZDEFAULT "/var/db/timezone/localtime" +# endif +#endif + +#ifndef TZDEFRULES +#define TZDEFRULES "posixrules" +#endif /* !defined TZDEFRULES */ + +/* +** Each file begins with. . . +*/ + +#define TZ_MAGIC "TZif" + +struct tzhead { + char tzh_magic[4]; /* TZ_MAGIC */ + char tzh_version[1]; /* '\0' or '2' as of 2005 */ + char tzh_reserved[15]; /* reserved--must be zero */ + char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */ + char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */ + char tzh_leapcnt[4]; /* coded number of leap seconds */ + char tzh_timecnt[4]; /* coded number of transition times */ + char tzh_typecnt[4]; /* coded number of local time types */ + char tzh_charcnt[4]; /* coded number of abbr. chars */ +}; + +/* +** . . .followed by. . . +** +** tzh_timecnt (char [4])s coded transition times a la time(2) +** tzh_timecnt (unsigned char)s types of local time starting at above +** tzh_typecnt repetitions of +** one (char [4]) coded UTC offset in seconds +** one (unsigned char) used to set tm_isdst +** one (unsigned char) that's an abbreviation list index +** tzh_charcnt (char)s '\0'-terminated zone abbreviations +** tzh_leapcnt repetitions of +** one (char [4]) coded leap second transition times +** one (char [4]) total correction after above +** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition +** time is standard time, if FALSE, +** transition time is wall clock time +** if absent, transition times are +** assumed to be wall clock time +** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition +** time is UTC, if FALSE, +** transition time is local time +** if absent, transition times are +** assumed to be local time +*/ + +/* +** If tzh_version is '2' or greater, the above is followed by a second instance +** of tzhead and a second instance of the data in which each coded transition +** time uses 8 rather than 4 chars, +** then a POSIX-TZ-environment-variable-style string for use in handling +** instants after the last transition time stored in the file +** (with nothing between the newlines if there is no POSIX representation for +** such instants). +*/ + +/* +** In the current implementation, "tzset()" refuses to deal with files that +** exceed any of the limits below. +*/ + +#ifndef TZ_MAX_TIMES +#define TZ_MAX_TIMES 1200 +#endif /* !defined TZ_MAX_TIMES */ + +#ifndef TZ_MAX_TYPES +#ifndef NOSOLAR +#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */ +#endif /* !defined NOSOLAR */ +#ifdef NOSOLAR +/* +** Must be at least 14 for Europe/Riga as of Jan 12 1995, +** as noted by Earl Chew. +*/ +#define TZ_MAX_TYPES 20 /* Maximum number of local time types */ +#endif /* !defined NOSOLAR */ +#endif /* !defined TZ_MAX_TYPES */ + +#ifndef TZ_MAX_CHARS +#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ + /* (limited by what unsigned chars can hold) */ +#endif /* !defined TZ_MAX_CHARS */ + +#ifndef TZ_MAX_LEAPS +#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */ +#endif /* !defined TZ_MAX_LEAPS */ + +#define SECSPERMIN 60 +#define MINSPERHOUR 60 +#define HOURSPERDAY 24 +#define DAYSPERWEEK 7 +#define DAYSPERNYEAR 365 +#define DAYSPERLYEAR 366 +#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) +#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY) +#define MONSPERYEAR 12 + +#define TM_SUNDAY 0 +#define TM_MONDAY 1 +#define TM_TUESDAY 2 +#define TM_WEDNESDAY 3 +#define TM_THURSDAY 4 +#define TM_FRIDAY 5 +#define TM_SATURDAY 6 + +#define TM_JANUARY 0 +#define TM_FEBRUARY 1 +#define TM_MARCH 2 +#define TM_APRIL 3 +#define TM_MAY 4 +#define TM_JUNE 5 +#define TM_JULY 6 +#define TM_AUGUST 7 +#define TM_SEPTEMBER 8 +#define TM_OCTOBER 9 +#define TM_NOVEMBER 10 +#define TM_DECEMBER 11 + +#define TM_YEAR_BASE 1900 + +#define EPOCH_YEAR 1970 +#define EPOCH_WDAY TM_THURSDAY + +#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) + +/* +** Since everything in isleap is modulo 400 (or a factor of 400), we know that +** isleap(y) == isleap(y % 400) +** and so +** isleap(a + b) == isleap((a + b) % 400) +** or +** isleap(a + b) == isleap(a % 400 + b % 400) +** This is true even if % means modulo rather than Fortran remainder +** (which is allowed by C89 but not C99). +** We use this to avoid addition overflow problems. +*/ + +#define isleap_sum(a, b) isleap((a) % 400 + (b) % 400) + +#endif /* !defined TZFILE_H */ diff --git a/stdtime/getdate.3 b/stdtime/getdate.3 new file mode 100644 index 0000000..eb8c99f --- /dev/null +++ b/stdtime/getdate.3 @@ -0,0 +1,401 @@ +'\" t +.Dd January 3, 2004 +.Dt GETDATE 3 +.Os +.Sh NAME +.Nm getdate +.Nd convert user format date and time +.Sh SYNOPSIS +.In time.h +.Vt extern int getdate_err ; +.Ft struct tm * +.Fn getdate "const char *string" +.Sh DESCRIPTION +The +.Fn getdate +function converts user-definable date and/or +time specifications pointed to by +.Fa string +to a +.Vt tm +structure. +The +.Vt tm +structure is defined in the +.Aq Pa time.h +header. +.Pp +User-supplied templates are used to parse and interpret the +input string. +The templates are text files created by the +user and identified via the environment variable +.Ev DATEMSK . +Each line in the template represents an acceptable date +and/or time specification using conversion specifications +similar to those used by +.Xr strftime 3 +and +.Xr strptime 3 . +Dates before 1902 and after 2037 are illegal. +The first line +in the template that matches the input specification is used +for interpretation and conversion into the internal time +format. +.Pp +.Ss "Conversion Specifications" +The following conversion specifications are supported: +.Bl -tag -width "xxxx" +.It Cm \&%% +Same as %. +.It Cm \&%a +Locale's abbreviated weekday name. +.It Cm \&%A +Locale's full weekday name. +.It Cm \&%b +Locale's abbreviated month name. +.It Cm \&%B +Locale's full month name. +.It Cm \&%c +Locale's appropriate date and time representation. +.It Cm \&%C +Century number (the year divided by 100 and truncated +to an integer as a decimal number [1,99]); single +digits are preceded by 0. +If used +without the %y specifier, this format specifier will +assume the current year offset in whichever century is +specified. The only valid years are between 1902-2037. +.It Cm \&%d +day of month [01,31]; leading zero is permitted but +not required. +.It Cm \&%D +Date as %m/%d/%y. +.It Cm \&%e +Same as %d. +.It Cm \&%h +Locale's abbreviated month name. +.It Cm \&%H +Hour (24-hour clock) [0,23]; leading zero is permitted +but not required. +.It Cm \&%I +Hour (12-hour clock) [1,12]; leading zero is permitted +but not required. +.It Cm \&%j +Day number of the year [1,366]; leading zeros are permitted but not required. +.It Cm \&%m +Month number [1,12]; leading zero is permitted but not +required. +.It Cm \&%M +Minute [0,59]; leading zero is permitted but not +required. +.It Cm \&%n +Any white space. +.It Cm \&%p +Locale's equivalent of either a.m. or p.m. +.It Cm \&%r +Appropriate time representation in the 12-hour clock +format with %p. +.It Cm \&%R +Time as %H:%M. +.It Cm \&%S +Seconds [0,61]; leading zero is permitted but not +required. The range of values is [00,61] rather than +[00,59] to allow for the occasional leap second and +even more occasional double leap second. +.It Cm \&%t +Any white space. +.It Cm \&%T +Time as %H:%M:%S. +.It Cm \&%U +Week number of the year as a decimal number [0,53], +with Sunday as the first day of the week; leading zero +is permitted but not required. +.It Cm \&%w +Weekday as a decimal number [0,6], with 0 representing +Sunday. +.It Cm \&%W +Week number of the year as a decimal number [0,53], +with Monday as the first day of the week; leading zero +is permitted but not required. +.It Cm \&%x +Locale's appropriate date representation. +.It Cm \&%X +Locale's appropriate time representation. +.It Cm \&%y +Year within century. When a century is not otherwise +specified, values in the range 69-99 refer to years in +the twentieth century (1969 to 1999 inclusive); values +in the range 00-68 refer to years in the twenty-first +century (2000 to 2068 inclusive). +.It Cm \&%Y +Year, including the century (for example, 1993). +.It Cm \&%Z +Time zone name or no characters if no time zone +exists. +.El +.Ss "Modified Conversion Specifications" +Some conversion specifications can be modified by the E and +O modifier characters to indicate that an alternative format +or specification should be used rather than the one normally +used by the unmodified specification. +If the alternative +format or specification does not exist in the current +locale, the behavior be as if the unmodified conversion +specification were used. +.Bl -tag -width "xxxx" +.It Cm \&%Ec +Locale's alternative appropriate date and time +representation. +.It Cm \&%EC +Name of the base year (period) in the locale's alternative representation. +.It Cm \&%Ex +Locale's alternative date representation. +.It Cm \&%EX +Locale's alternative time representation. +.It Cm \&%Ey +Offset from %EC (year only) in the locale's alternative representation. +.It Cm \&%EY +Full alternative year representation. +.It Cm \&%Od +Day of the month using the locale's alternative +numeric symbols; leading zeros are permitted but not +required. +.It Cm \&%Oe +Same as %Od. +.It Cm \&%OH +Hour (24-hour clock) using the locale's alternative +numeric symbols. +.It Cm \&%OI +Hour (12-hour clock) using the locale's alternative +numeric symbols. +.It Cm \&%Om +Month using the locale's alternative numeric symbols. +.It Cm \&%OM +Minutes using the locale's alternative numeric symbols. +.It Cm \&%OS +Seconds using the locale's alternative numeric symbols. +.It Cm \&%OU +Week number of the year (Sunday as the first day of +the week) using the locale's alternative numeric symbols. +.It Cm \&%Ow +Number of the weekday (Sunday=0) using the locale's +alternative numeric symbols. +.It Cm \&%OW +Week number of the year (Monday as the first day of +the week) using the locale's alternative numeric symbols. +.It Cm \&%Oy +Year (offset from %C) in the locale's alternative +representation and using the locale's alternative +numeric symbols. +.El +.Ss "Internal Format Conversion" +The following rules are applied for converting the input +specification into the internal format: +.Bl -bullet -offset indent +.It +If only the weekday is given, today is assumed if the +given day is equal to the current day and next week if +it is less. +.It +If only the month is given, the current month is +assumed if the given month is equal to the current +month and next year if it is less and no year is +given. +(The first day of month is assumed if no day is +given.) +.It +If only the year is given, the values of the tm_mon, +tm_mday, tm_yday, tm_wday, and tm_isdst members of the +returned tm structure are not specified. +.It +If the century is given, but the year within the century is not given, +the current year within the century +is assumed. +.It +If no hour, minute, and second are given, the current +hour, minute, and second are assumed. +.It +If no date is given, today is assumed if the given +hour is greater than the current hour and tomorrow is +assumed if it is less. +.El +.Ss "General Specifications" +A conversion specification that is an ordinary character is +executed by scanning the next character from the buffer. +If the character scanned from the buffer differs from the one +comprising the conversion specification, the specification +fails, and the differing and subsequent characters remain +unscanned. +.Pp +A series of conversion specifications composed of +.Ql %n , +.Ql %t , +white space characters, or any combination is executed by +scanning up to the first character that is not white space +(which remains unscanned), or until no more characters can +be scanned. +.Pp +Any other conversion specification is executed by scanning +characters until a character matching the next conversion +specification is scanned, or until no more characters can be +scanned. +These characters, except the one matching the next +conversion specification, are then compared to the locale +values associated with the conversion specifier. +If a match is found, values for the appropriate +.Vt tm +structure members +are set to values corresponding to the locale information. +If no match is found, +.Fn getdate +fails and no more characters are scanned. +.Pp +The month names, weekday names, era names, and alternative +numeric symbols can consist of any combination of upper and +lower case letters. +The user can request that the input +date or time specification be in a specific language by setting the +.Ev LC_TIME +category using +.Xr setlocale 3 . +.Sh RETURN VALUES +If successful, +.Fn getdate +returns a pointer to a +.Vt tm +structure; otherwise, it returns +.Dv NULL +and sets the global variable +.Va getdate_err +to indicate the error. +Subsequent calls to +.Fn getdate +alter the contents of +.Va getdate_err . +.Pp +The following is a complete list of the +.Va getdate_err +settings and their meanings: +.Bl -tag -width "xxx" +.It 1 +The DATEMSK environment variable is null or undefined. +.It 2 +The template file cannot be opened for reading. +.It 3 +Failed to get file status information. +.It 4 +The template file is not a regular file. +.It 5 +An error is encountered while reading the template +file. +.It 6 +The +.Xr malloc 3 +function failed (not enough memory is +available). +.It 7 +There is no line in the template that matches the +input. +.It 8 +The input specification is invalid (for example, +February 31). +.El +.Sh USAGE +The +.Fn getdate +function makes explicit use of macros +described on the +.Xr ctype 3 +manual page. +.Sh EXAMPLES +Example 1: Examples of the +.Fn getdate +function. +.Pp +The following example shows the possible contents of a template: +.Bd -literal +%m +%A %B %d %Y, %H:%M:%S +%A +%B +%m/%d/%y %I %p +%d,%m,%Y %H:%M +at %A the %dst of %B in %Y +run job at %I %p,%B %dnd +%A den %d. %B %Y %H.%M Uhr +.Ed +.Pp +The following are examples of valid input specifications for +the above template: +.Bd -literal +getdate("10/1/87 4 PM") +getdate("Friday") +getdate("Friday September 19 1987, 10:30:30") +getdate("24,9,1986 10:30") +getdate("at monday the 1st of december in 1986") +getdate("run job at 3 PM, december 2nd") +.Pp +.Ed +If the +.Ev LANG +environment variable is set to de (German), the +following is valid: +.Bd -literal +getdate("freitag den 10. oktober 1986 10.30 Uhr") +.Ed +.Pp +Local time and date specification are also supported. +The following examples show how local date and time specification +can be defined in the template. +.Pp +.Bf -literal +.TS +box; +c | c +l | l . +Invocation Line in Template +getdate("11/27/86") %m/%d/%y +getdate("27.11.86") %d.%m.%y +getdate("86-11-27") %y-%m-%d +getdate("Friday 12:00:00") %A %H:%M:%S +.TE +.Ef +.Pp +The following examples illustrate the Internal Format +Conversion rules. +Assume that the current date is +.Li Mon Sep 22 12:19:47 EDT 1986 +and the +.Ev LANG +environment variable is not set. +.Pp +.Bf -literal +.TS +box; +c | c | c +l | l | l . +Input Template Line Date +Mon %a Mon Sep 22 12:19:48 EDT 1986 +Sun %a Sun Sep 28 12:19:49 EDT 1986 +Fri %a Fri Sep 26 12:19:49 EDT 1986 +September %B Mon Sep 1 12:19:49 EDT 1986 +January %B Thu Jan 1 12:19:49 EST 1987 +December %B Mon Dec 1 12:19:49 EDT 1986 +Sep Mon %b %a Mon Sep 1 12:19:50 EDT 1986 +Jan Fri %b %a Fri Jan 2 12:19:50 EST 1987 +Dec Mon %b %a Mon Dec 1 12:19:50 EST 1986 +Jan Wed 1989 %b %a %Y Wed Jan 4 12:19:51 EST 1989 +Fri 9 %a %H Fri Sep 26 09:00:00 EDT 1986 +Feb 10:30 %b %H:%S Sun Feb 1 10:00:30 EST 1987 +10:30 %H:%M Tue Sep 23 10:30:00 EDT 1986 +13:30 %H:%M Mon Sep 22 13:30:00 EDT 1986 +.TE +.Ef +.Pp +.Sh "SEE ALSO" +.Xr ctype 3 , +.Xr mktime 3 , +.Xr setlocale 3 , +.Xr strftime 3 , +.Xr strptime 3 , +.Xr environ 5 diff --git a/stdtime/getdate.c b/stdtime/getdate.c new file mode 100644 index 0000000..e8e1ff5 --- /dev/null +++ b/stdtime/getdate.c @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include +#include + +enum { + DATEMSK_NOT_DEFINED = 1, + CANT_OPEN, + CANT_FSTAT, + NOT_FILE, + IO_ERROR, + OUT_OF_MEMORY, + NO_MATCH, + INVALID_DATE +}; + +#define DATEMSK "DATEMSK" +#define TM_SEC_SET 0x01 +#define TM_MIN_SET 0x02 +#define TM_HOUR_SET 0x04 +#define TM_MDAY_SET 0x01 +#define TM_MON_SET 0x02 +#define TM_YEAR_SET 0x04 +#define UNDEFINED -1 + +static const struct tm tmundef = { + UNDEFINED, + UNDEFINED, + UNDEFINED, + UNDEFINED, + UNDEFINED, + UNDEFINED, + UNDEFINED +}; + +int getdate_err; + +/* + * getdate + * + * Call strptime() on each line of the DATEMSK file, and manipulate the + * resulting tm structure. + */ +struct tm * +getdate(const char *str) +{ + static struct tm tm; + struct tm *now, *result = NULL; + time_t t; + FILE *fp; + int bufsiz, offset, len, dateset, timeset, saveerrno, wday_set, save_mon; + char *buf; + struct stat st; + char *file = getenv(DATEMSK); + + if(!file || !*file) { + getdate_err = DATEMSK_NOT_DEFINED; + return NULL; + } + saveerrno = errno; + if((fp = fopen(file, "r")) == NULL) { + getdate_err = CANT_OPEN; + errno = saveerrno; + return NULL; + } + do { + if(fstat(fileno(fp), &st) < 0) { + getdate_err = CANT_FSTAT; + break; + } + if((st.st_mode & S_IFMT) != S_IFREG) { + getdate_err = NOT_FILE; + break; + } + if((buf = malloc(bufsiz = BUFSIZ)) == NULL) { + getdate_err = OUT_OF_MEMORY; + break; + } + do { + offset = 0; + for(;;) { + if(fgets(buf + offset, bufsiz - offset, fp) == NULL) { + if(ferror(fp)) { + getdate_err = IO_ERROR; + break; + } + if(offset == 0) { + getdate_err = NO_MATCH; + break; + } + len = strlen(buf); + } else if((len = strlen(buf)) == bufsiz - 1 + && buf[len - 1] != '\n') { + char *newptr = realloc(buf, (bufsiz += BUFSIZ)); + if(newptr == NULL) { + getdate_err = OUT_OF_MEMORY; + break; + } + buf = newptr; + offset = len; + continue; + } + if(buf[len - 1] == '\n') + buf[len - 1] = 0; + tm = tmundef; + if(strptime(str, buf, &tm) == NULL) { + offset = 0; + continue; + } + time(&t); + now = localtime(&t); + dateset = timeset = 0; + if(tm.tm_sec != UNDEFINED) + timeset |= TM_SEC_SET; + if(tm.tm_min != UNDEFINED) + timeset |= TM_MIN_SET; + if(tm.tm_hour != UNDEFINED) + timeset |= TM_HOUR_SET; + if(tm.tm_mday != UNDEFINED) + dateset |= TM_MDAY_SET; + if(tm.tm_mon != UNDEFINED) + dateset |= TM_MON_SET; + if(tm.tm_year != UNDEFINED) + dateset |= TM_YEAR_SET; + wday_set = tm.tm_wday; + + switch(timeset) { + case 0: + tm.tm_sec = now->tm_sec; + tm.tm_min = now->tm_min; + tm.tm_hour = now->tm_hour; + break; + + case TM_SEC_SET: + tm.tm_hour = now->tm_hour; + tm.tm_min = now->tm_min; + if(tm.tm_sec < now->tm_sec) + tm.tm_min++; + break; + + case TM_MIN_SET: + tm.tm_hour = now->tm_hour; + if(tm.tm_min < now->tm_min) + tm.tm_hour++; + tm.tm_sec = 0; + break; + + case TM_MIN_SET | TM_SEC_SET: + tm.tm_hour = now->tm_hour; + if((60 * tm.tm_min + tm.tm_sec) + < (60 * now->tm_min + now->tm_sec)) + tm.tm_hour++; + break; + + case TM_HOUR_SET: + tm.tm_min = 0; + tm.tm_sec = 0; + break; + + case TM_HOUR_SET | TM_SEC_SET: + tm.tm_min = 0; + break; + + case TM_HOUR_SET | TM_MIN_SET: + tm.tm_sec = 0; + break; + } + + switch(dateset) { + case 0: + tm.tm_mday = now->tm_mday; + if(tm.tm_hour < now->tm_hour) + tm.tm_mday++; + tm.tm_mon = now->tm_mon; + tm.tm_year = now->tm_year; + break; + + case TM_MDAY_SET: + tm.tm_year = now->tm_year; + tm.tm_mon = now->tm_mon; + if(tm.tm_mday < now->tm_mday) + tm.tm_mon++; + break; + + case TM_MON_SET: + case TM_MON_SET | TM_MDAY_SET: + tm.tm_year = now->tm_year; + if(tm.tm_mon < now->tm_mon) + tm.tm_year++; + if(!(dateset & TM_MDAY_SET)) + tm.tm_mday = 1; + break; + + case TM_YEAR_SET: + case TM_YEAR_SET | TM_MON_SET: + if(!(dateset & TM_MON_SET)) + tm.tm_mon = 0; + tm.tm_mday = 1; + break; + + case TM_YEAR_SET | TM_MDAY_SET: + tm.tm_mon = now->tm_mon; + if(tm.tm_mday < now->tm_mday) + tm.tm_mon++; + break; + } + + tm.tm_wday = now->tm_wday; + tm.tm_gmtoff = now->tm_gmtoff; /* XXX: can't grok timezones */ + tm.tm_isdst = -1; + save_mon = tm.tm_mon; + if(mktime(&tm) == (time_t)-1) { + getdate_err = INVALID_DATE; + break; + } else if ((dateset & TM_MON_SET) && (tm.tm_mon != save_mon)) { /* Did mktime fixup an overflow date? */ + getdate_err = INVALID_DATE; + break; + } + if(wday_set != UNDEFINED && + (dateset != (TM_YEAR_SET | TM_MON_SET | TM_MDAY_SET))) { + /* + * We got back a week day, but not enough information to resolve it + * to a specific day, so we need to push forward the time to the + * correct wday. + */ + int delta = wday_set - tm.tm_wday; + if(delta < 0) { + delta += 7; + } + tm.tm_mday += delta; + if(mktime(&tm) == (time_t)-1) { + getdate_err = INVALID_DATE; + break; + } + } + result = &tm; + break; + } + } while(0); + + free(buf); + } while(0); + + fclose(fp); + errno = saveerrno; + return result; +} diff --git a/stdtime/timezone_unix03.c b/stdtime/timezone_unix03.c new file mode 100644 index 0000000..ad15a78 --- /dev/null +++ b/stdtime/timezone_unix03.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include + +long timezone = 0; + +__private_extern__ long +_st_get_timezone(void) +{ + return timezone; +} + +__private_extern__ void +_st_set_timezone(long tz) +{ + timezone = tz; +} diff --git a/string/CMakeLists.txt b/string/CMakeLists.txt new file mode 100644 index 0000000..8d70ec5 --- /dev/null +++ b/string/CMakeLists.txt @@ -0,0 +1,99 @@ +project(libc-string) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_SECURE__STRING_H_") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../fbsdcompat/_fbsd_compat_.h") + +add_definitions(-D__STDC_WANT_LIB_EXT1__=1) + +set(string_sources + bcopy.c + stpcpy.c + stpncpy.c + strcat.c + strncat.c +) + +set(string_sources ${string_sources} + FreeBSD/memmem.c + FreeBSD/rindex.c + FreeBSD/rpmatch.c + FreeBSD/strcasecmp.c + FreeBSD/strcasestr.c + FreeBSD/strcoll.c + FreeBSD/strcspn.c + FreeBSD/strdup.c + FreeBSD/strerror.c + FreeBSD/strmode.c + FreeBSD/strndup.c + FreeBSD/strnstr.c + FreeBSD/strpbrk.c + FreeBSD/strrchr.c + FreeBSD/strsep.c + FreeBSD/strsignal.c + FreeBSD/strspn.c + FreeBSD/strtok.c + FreeBSD/strxfrm.c + FreeBSD/swab.c + FreeBSD/timingsafe_bcmp.c + FreeBSD/wcpcpy.c + FreeBSD/wcpncpy.c + FreeBSD/wcscasecmp.c + FreeBSD/wcscat.c + FreeBSD/wcscmp.c + FreeBSD/wcscoll.c + FreeBSD/wcscpy.c + FreeBSD/wcscspn.c + FreeBSD/wcsdup.c + FreeBSD/wcschr.c + FreeBSD/wcslcat.c + FreeBSD/wcslcpy.c + FreeBSD/wcslen.c + FreeBSD/wcsncasecmp.c + FreeBSD/wcsncat.c + FreeBSD/wcsncmp.c + FreeBSD/wcsncpy.c + FreeBSD/wcsnlen.c + FreeBSD/wcspbrk.c + FreeBSD/wcsrchr.c + FreeBSD/wcsspn.c + FreeBSD/wcsstr.c + FreeBSD/wcstok.c + FreeBSD/wcswidth.c + FreeBSD/wcsxfrm.c + FreeBSD/wmemcmp.c + FreeBSD/wmemcpy.c + FreeBSD/wmemchr.c + FreeBSD/wmemmove.c + FreeBSD/wmemset.c + NetBSD/memset_s.c +) + +SET_SOURCE_FILES_PROPERTIES(FreeBSD/strerror.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_STRERROR") + +add_darling_object_library(libc-string ${string_sources}) + +# Legacy variant +if (TARGET_i386) + set(string-legacy_sources + FreeBSD/strerror.c) + add_library(libc-string_legacy OBJECT ${string-legacy_sources}) + SET_TARGET_PROPERTIES(libc-string_legacy PROPERTIES COMPILE_FLAGS "-DBUILDING_VARIANT -DVARIANT_LEGACY -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0 -U__DARWIN_64_BIT_INO_T -D_DARWIN_NO_64_BIT_INODE") +endif (TARGET_i386) + +# DYLD variant +add_library(libc-string_dyld OBJECT + strcat.c + strncat.c + FreeBSD/strdup.c + FreeBSD/strrchr.c + FreeBSD/strtok.c + FreeBSD/wcscpy.c + FreeBSD/wcslen.c + FreeBSD/wcsncmp.c + FreeBSD/wcsncpy.c + FreeBSD/strerror.c +) +SET_TARGET_PROPERTIES(libc-string_dyld PROPERTIES COMPILE_FLAGS "-UBUILDING_VARIANT -DVARIANT_DYLD -DVARIANT_CANCELABLE -DVARIANT_DARWINEXTSN") + diff --git a/string/FreeBSD/bcmp.3 b/string/FreeBSD/bcmp.3 new file mode 100644 index 0000000..e2d4063 --- /dev/null +++ b/string/FreeBSD/bcmp.3 @@ -0,0 +1,78 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)bcmp.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd August 15, 2016 +.Dt BCMP 3 +.Os +.Sh NAME +.Nm bcmp +.Nd compare byte string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In strings.h +.Ft int +.Fn bcmp "const void *b1" "const void *b2" "size_t len" +.Sh DESCRIPTION +The +.Fn bcmp +function +compares byte string +.Fa b1 +against byte string +.Fa b2 , +returning zero if they are identical, non-zero otherwise. +Both strings are assumed to be +.Fa len +bytes long. +Zero-length strings are always identical. +.Pp +The strings may overlap. +.Sh SEE ALSO +.Xr memcmp 3 , +.Xr strcasecmp 3 , +.Xr strcmp 3 , +.Xr strcoll 3 , +.Xr strxfrm 3 , +.Xr timingsafe_bcmp 3 +.Sh HISTORY +A +.Fn bcmp +function first appeared in +.Bx 4.2 . +Its prototype existed previously in +.In string.h +before it was moved to +.In strings.h +for +.St -p1003.1-2001 +compliance. diff --git a/string/FreeBSD/bcopy.3 b/string/FreeBSD/bcopy.3 new file mode 100644 index 0000000..3cfa002 --- /dev/null +++ b/string/FreeBSD/bcopy.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)bcopy.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/bcopy.3,v 1.10 2007/01/09 00:28:11 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt BCOPY 3 +.Os +.Sh NAME +.Nm bcopy +.Nd copy byte string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In strings.h +.Ft void +.Fn bcopy "const void *src" "void *dst" "size_t len" +.Sh DESCRIPTION +The +.Fn bcopy +function +copies +.Fa len +bytes from string +.Fa src +to string +.Fa dst . +The two strings may overlap. +If +.Fa len +is zero, no bytes are copied. +.Sh SEE ALSO +.Xr memccpy 3 , +.Xr memcpy 3 , +.Xr memmove 3 , +.Xr strcpy 3 , +.Xr strncpy 3 +.Sh HISTORY +A +.Fn bcopy +function appeared in +.Bx 4.2 . +Its prototype existed previously in +.In string.h +before it was moved to +.In strings.h +for +.St -p1003.1-2001 +compliance. +.Pp +.Fn bcopy +was deprecated in +.St -p1003.1-2001 +and removed in +.St -p1003.1-2008 . diff --git a/string/FreeBSD/bstring.3 b/string/FreeBSD/bstring.3 new file mode 100644 index 0000000..4b34387 --- /dev/null +++ b/string/FreeBSD/bstring.3 @@ -0,0 +1,152 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)bstring.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/bstring.3,v 1.8 2007/01/09 00:28:11 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt BSTRING 3 +.Os +.Sh NAME +.Nm bcmp , +.Nm bcopy , +.Nm bzero , +.Nm memccpy , +.Nm memchr , +.Nm memcmp , +.Nm memcpy , +.Nm memmove , +.Nm memset +.Nd byte string operations +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In strings.h +.Ft int +.Fo bcmp +.Fa "const void *s1" +.Fa "const void *s2" +.Fa "size_t n" +.Fc +.Ft void +.Fo bcopy +.Fa "const void *s1" +.Fa "void *s2" +.Fa "size_t n" +.Fc +.Ft void +.Fo bzero +.Fa "void *s" +.Fa "size_t n" +.Fc +.In string.h +.Ft void * +.Fo memccpy +.Fa "void *restrict s1" +.Fa "const void *restrict s2" +.Fa "int c" +.Fa "size_t n" +.Fc +.Ft void * +.Fo memchr +.Fa "const void *s" +.Fa "int c" +.Fa "size_t n" +.Fc +.Ft int +.Fo memcmp +.Fa "const void *s1" +.Fa "const void *s2" +.Fa "size_t n" +.Fc +.Ft void * +.Fo memcpy +.Fa "void *restrict s1" +.Fa "const void *restrict s2" +.Fa "size_t n" +.Fc +.Ft void * +.Fo memmove +.Fa "void *s1" +.Fa "const void *s2" +.Fa "size_t n" +.Fc +.Ft void * +.Fo memset +.Fa "void *s" +.Fa "int c" +.Fa "size_t n" +.Fc +.Sh DESCRIPTION +These functions operate on variable length strings of bytes. +They do not check for terminating null bytes, as the routines +listed in +.Xr string 3 +do. +.Pp +See the specific manual pages for more information. +.Sh LEGACY SYNOPSIS +.Fd #include +.Pp +The include file +.In string.h +is necessary and sufficient for all functions. +.Sh SEE ALSO +.Xr bcmp 3 , +.Xr bcopy 3 , +.Xr bzero 3 , +.Xr memccpy 3 , +.Xr memchr 3 , +.Xr memcmp 3 , +.Xr memcpy 3 , +.Xr memmove 3 , +.Xr memset 3 , +.Xr compat 5 +.Sh STANDARDS +The functions +.Fn memchr , +.Fn memcmp , +.Fn memcpy , +.Fn memmove , +and +.Fn memset +conform to +.St -isoC . +.Sh HISTORY +The functions +.Fn bzero +and +.Fn memccpy +appeared in +.Bx 4.3 ; +the functions +.Fn bcmp , +.Fn bcopy , +appeared in +.Bx 4.2 . diff --git a/string/FreeBSD/bzero.3 b/string/FreeBSD/bzero.3 new file mode 100644 index 0000000..04c82de --- /dev/null +++ b/string/FreeBSD/bzero.3 @@ -0,0 +1,80 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)bzero.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/bzero.3,v 1.10 2007/01/09 00:28:11 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt BZERO 3 +.Os +.Sh NAME +.Nm bzero +.Nd write zeroes to a byte string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In strings.h +.Ft void +.Fn bzero "void *s" "size_t n" +.Sh DESCRIPTION +The +.Fn bzero +function +writes +.Fa n +zeroed bytes to the string +.Fa s . +If +.Fa n +is zero, +.Fn bzero +does nothing. +.Sh SEE ALSO +.Xr memset 3 , +.Xr swab 3 +.Sh HISTORY +A +.Fn bzero +function +appeared in +.Bx 4.3 . +Its prototype existed previously in +.In string.h +before it was moved to +.In strings.h +for +.St -p1003.1-2001 +compliance. +.Pp +.Fn bzero +was deprecated in +.St -p1003.1-2001 +and removed in +.St -p1003.1-2008 . diff --git a/string/FreeBSD/index.3 b/string/FreeBSD/index.3 new file mode 100644 index 0000000..ecbbb63 --- /dev/null +++ b/string/FreeBSD/index.3 @@ -0,0 +1,102 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)index.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/index.3,v 1.12 2007/01/09 00:28:12 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt INDEX 3 +.Os +.Sh NAME +.Nm index , rindex +.Nd locate character in string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In strings.h +.Ft "char *" +.Fn index "const char *s" "int c" +.Ft "char *" +.Fn rindex "const char *s" "int c" +.Sh DESCRIPTION +The +.Fn index +function +locates the first occurrence of +.Fa c +(converted to a +.Vt char ) +in the string pointed to by +.Fa s . +The terminating null character is considered to be part of the string; +therefore, if +.Fa c +is +.Ql \e0 , +the functions locate the terminating +.Ql \e0 . +.Pp +The +.Fn rindex +function is identical to +.Fn index , +except that it locates the last occurrence of +.Fa c . +.Sh RETURN VALUES +The functions +.Fn index +and +.Fn rindex +return a pointer to the located character, or +.Dv NULL +if the character does not appear in the string. +.Sh SEE ALSO +.Xr memchr 3 , +.Xr strchr 3 , +.Xr strcspn 3 , +.Xr strpbrk 3 , +.Xr strrchr 3 , +.Xr strsep 3 , +.Xr strspn 3 , +.Xr strstr 3 , +.Xr strtok 3 +.Sh HISTORY +The +.Fn index +and +.Fn rindex +functions appeared in +.At v6 . +Their prototypes existed previously in +.In string.h +before they were moved to +.In strings.h +for +.St -p1003.1-2001 +compliance. diff --git a/string/FreeBSD/memccpy.3 b/string/FreeBSD/memccpy.3 new file mode 100644 index 0000000..80db44f --- /dev/null +++ b/string/FreeBSD/memccpy.3 @@ -0,0 +1,80 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)memccpy.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/string/memccpy.3,v 1.7 2007/01/09 00:28:12 imp Exp $ +.\" +.Dd June 9, 1993 +.Dt MEMCCPY 3 +.Os +.Sh NAME +.Nm memccpy +.Nd copy string until character found +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft void * +.Fo memccpy +.Fa "void *restrict dst" +.Fa "const void *restrict src" +.Fa "int c" +.Fa "size_t n" +.Fc +.Sh DESCRIPTION +The +.Fn memccpy +function +copies bytes from string +.Fa src +to string +.Fa dst . +If the character +.Fa c +(as converted to an unsigned char) occurs in the string +.Fa src , +the copy stops and a pointer to the byte after the copy of +.Fa c +in the string +.Fa dst +is returned. +Otherwise, +.Fa n +bytes are copied, and a NULL pointer is returned. +.Pp +The source and destination strings should not overlap, as the +behavior is undefined. +.Sh SEE ALSO +.Xr bcopy 3 , +.Xr memcpy 3 , +.Xr memmove 3 , +.Xr strcpy 3 +.Sh HISTORY +The +.Fn memccpy +function first appeared in +.Bx 4.4 . diff --git a/string/FreeBSD/memchr.3 b/string/FreeBSD/memchr.3 new file mode 100644 index 0000000..430441b --- /dev/null +++ b/string/FreeBSD/memchr.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)memchr.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/memchr.3,v 1.12 2009/04/23 08:37:56 brueffer Exp $ +.\" +.Dd April 9, 2008 +.Dt MEMCHR 3 +.Os +.Sh NAME +.Nm memchr +.Nd locate byte in byte string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft void * +.Fo memchr +.Fa "const void *s" +.Fa "int c" +.Fa "size_t n" +.Fc +.Sh DESCRIPTION +The +.Fn memchr +function +locates the first occurrence of +.Fa c +(converted to an unsigned char) +in string +.Fa s . +.Sh RETURN VALUES +The +.Fn memchr +function +returns a pointer to the byte located, +or NULL if no such byte exists within +.Fa n +bytes. +.Sh SEE ALSO +.Xr strchr 3 , +.Xr strcspn 3 , +.Xr strpbrk 3 , +.Xr strrchr 3 , +.Xr strsep 3 , +.Xr strspn 3 , +.Xr strstr 3 , +.Xr strtok 3 , +.Xr wmemchr 3 +.Sh STANDARDS +The +.Fn memchr +function +conforms to +.St -isoC . diff --git a/string/FreeBSD/memcmp.3 b/string/FreeBSD/memcmp.3 new file mode 100644 index 0000000..892efbe --- /dev/null +++ b/string/FreeBSD/memcmp.3 @@ -0,0 +1,90 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)memcmp.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd June 4, 1993 +.Dt MEMCMP 3 +.Os +.Sh NAME +.Nm memcmp +.Nd compare byte string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft int +.Fo memcmp +.Fa "const void *s1" +.Fa "const void *s2" +.Fa "size_t n" +.Fc +.Sh DESCRIPTION +The +.Fn memcmp +function +compares byte string +.Fa s1 +against byte string +.Fa s2 . +Both strings are assumed to be +.Fa n +bytes long. +.Sh RETURN VALUES +The +.Fn memcmp +function +returns zero if the two strings are identical, +otherwise returns the difference between the first two differing bytes +(treated as +.Vt "unsigned char" +values, so that +.Sq Li \e200 +is greater than +.Sq Li \&\e0 , +for example). +Zero-length strings are always identical. +This behavior is not required by C and portable code should only depend on the +sign of the returned value. +.Sh SEE ALSO +.Xr bcmp 3 , +.Xr strcasecmp 3 , +.Xr strcmp 3 , +.Xr strcoll 3 , +.Xr strxfrm 3 , +.Xr wmemcmp 3 +.Sh STANDARDS +The +.Fn memcmp +function +conforms to +.St -isoC . diff --git a/string/FreeBSD/memcpy.3 b/string/FreeBSD/memcpy.3 new file mode 100644 index 0000000..a58e8da --- /dev/null +++ b/string/FreeBSD/memcpy.3 @@ -0,0 +1,90 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)memcpy.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/memcpy.3,v 1.9 2009/04/07 13:42:53 trasz Exp $ +.\" +.Dd June 4, 1993 +.Dt MEMCPY 3 +.Os +.Sh NAME +.Nm memcpy +.Nd copy memory area +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft void * +.Fo memcpy +.Fa "void *restrict dst" +.Fa "const void *restrict src" +.Fa "size_t n" +.Fc +.Sh DESCRIPTION +The +.Fn memcpy +function +copies +.Fa n +bytes from memory area +.Fa src +to memory area +.Fa dst . +If +.Fa dst +and +.Fa src +overlap, behavior is undefined. +Applications in which +.Fa dst +and +.Fa src +might overlap should use +.Xr memmove 3 +instead. +.Sh RETURN VALUES +The +.Fn memcpy +function +returns the original value of +.Fa dst . +.Sh SEE ALSO +.Xr bcopy 3 , +.Xr memccpy 3 , +.Xr memmove 3 , +.Xr strcpy 3 , +.Xr wmemcpy 3 +.Sh STANDARDS +The +.Fn memcpy +function +conforms to +.St -isoC . diff --git a/string/FreeBSD/memmem.3 b/string/FreeBSD/memmem.3 new file mode 100644 index 0000000..c55c525 --- /dev/null +++ b/string/FreeBSD/memmem.3 @@ -0,0 +1,86 @@ +.\" Copyright (c) 2005 Pascal Gloor +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior written +.\" permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/string/memmem.3,v 1.3 2005/11/24 06:56:21 ru Exp $ +.\" +.Dd August 24, 2005 +.Dt MEMMEM 3 +.Os +.Sh NAME +.Nm memmem +.Nd "locate a byte substring in a byte string" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft "void *" +.Fo memmem +.Fa "const void *big" "size_t big_len" +.Fa "const void *little" "size_t little_len" +.Fc +.Sh DESCRIPTION +The +.Fn memmem +function +locates the first occurrence of the byte string +.Fa little +in the byte string +.Fa big . +.Sh RETURN VALUES +If +.Fa big_len +is smaller than +.Fa little_len , +if +.Fa little_len +is 0, if +.Fa big_len +is 0 or if +.Fa little +occurs nowhere in +.Fa big , +.Dv NULL +is returned; +otherwise a pointer to the first character of the first occurrence of +.Fa little +is returned. +.Sh SEE ALSO +.Xr memchr 3 , +.Xr strchr 3 , +.Xr strstr 3 +.Sh CONFORMING TO +.Fn memmem +is a GNU extension. +.Sh HISTORY +The +.Fn memmem +function first appeared in +.Fx 6.0 . +.Sh AUTHORS +.An Pascal Gloor Aq pascal.gloor@spale.com +.Sh BUGS +This function was broken in Linux libc up to and including version 5.0.9 +and in GNU libc prior to version 2.1. diff --git a/string/FreeBSD/memmem.c b/string/FreeBSD/memmem.c new file mode 100644 index 0000000..8dba6fb --- /dev/null +++ b/string/FreeBSD/memmem.c @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2005 Pascal Gloor + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/memmem.c,v 1.2 2009/02/03 17:58:20 danger Exp $"); + +#include + +/* + * Find the first occurrence of the byte string s in byte string l. + */ + +void * +memmem(const void *l, size_t l_len, const void *s, size_t s_len) +{ + register char *cur, *last; + const char *cl = (const char *)l; + const char *cs = (const char *)s; + + /* we need something to compare */ + if (l_len == 0 || s_len == 0) + return NULL; + + /* "s" must be smaller or equal to "l" */ + if (l_len < s_len) + return NULL; + + /* special case where s_len == 1 */ + if (s_len == 1) + return memchr(l, (int)*cs, l_len); + + /* the last position where its possible to find "s" in "l" */ + last = (char *)cl + l_len - s_len; + + for (cur = (char *)cl; cur <= last; cur++) + if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0) + return cur; + + return NULL; +} diff --git a/string/FreeBSD/memmove.3 b/string/FreeBSD/memmove.3 new file mode 100644 index 0000000..6cac604 --- /dev/null +++ b/string/FreeBSD/memmove.3 @@ -0,0 +1,75 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)memmove.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/memmove.3,v 1.8 2009/04/07 13:42:53 trasz Exp $ +.\" +.Dd June 4, 1993 +.Dt MEMMOVE 3 +.Os +.Sh NAME +.Nm memmove +.Nd copy byte string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft void * +.Fn memmove "void *dst" "const void *src" "size_t len" +.Sh DESCRIPTION +The +.Fn memmove +function +copies +.Fa len +bytes from string +.Fa src +to string +.Fa dst . +The two strings may overlap; +the copy is always done in a non-destructive manner. +.Sh RETURN VALUES +The +.Fn memmove +function returns the original value of +.Fa dst . +.Sh SEE ALSO +.Xr bcopy 3 , +.Xr memccpy 3 , +.Xr memcpy 3 , +.Xr strcpy 3 , +.Xr wmemmove 3 +.Sh STANDARDS +The +.Fn memmove +function +conforms to +.St -isoC . diff --git a/string/FreeBSD/memset.3 b/string/FreeBSD/memset.3 new file mode 100644 index 0000000..2c96f50 --- /dev/null +++ b/string/FreeBSD/memset.3 @@ -0,0 +1,74 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)memset.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/memset.3,v 1.10 2010/02/04 11:23:28 ru Exp $ +.\" +.Dd June 4, 1993 +.Dt MEMSET 3 +.Os +.Sh NAME +.Nm memset +.Nd fill a byte string with a byte value +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft void * +.Fn memset "void *b" "int c" "size_t len" +.Sh DESCRIPTION +The +.Fn memset +function +writes +.Fa len +bytes of value +.Fa c +(converted to an +.Vt "unsigned char" ) +to the string +.Fa b . +.Sh RETURN VALUES +The +.Fn memset +function returns its first argument. +.Sh SEE ALSO +.Xr bzero 3 , +.Xr memset_pattern 3 , +.Xr memset_s.3 , +.Xr swab 3 , +.Xr wmemset 3 +.Sh STANDARDS +The +.Fn memset +function +conforms to +.St -isoC . diff --git a/string/FreeBSD/rindex.3 b/string/FreeBSD/rindex.3 new file mode 100644 index 0000000..f1a80e1 --- /dev/null +++ b/string/FreeBSD/rindex.3 @@ -0,0 +1,92 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)rindex.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/rindex.3,v 1.8 2002/12/18 13:33:03 ru Exp $ +.\" +.Dd June 4, 1993 +.Dt RINDEX 3 +.Os +.Sh NAME +.Nm rindex +.Nd locate character in string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In strings.h +.Ft char * +.Fn rindex "const char *s" "int c" +.Sh DESCRIPTION +The +.Fn rindex +function +locates the last character +matching +.Fa c +(converted to a +.Vt char ) +in the null-terminated string +.Fa s . +.Sh RETURN VALUES +A pointer to the character is returned if it is found; +otherwise, NULL is returned. +If +.Fa c +is +.Ql \e0 , +.Fn rindex +locates the terminating +.Ql \e0 . +.Sh SEE ALSO +.Xr index 3 , +.Xr memchr 3 , +.Xr strchr 3 , +.Xr strcspn 3 , +.Xr strpbrk 3 , +.Xr strrchr 3 , +.Xr strsep 3 , +.Xr strspn 3 , +.Xr strstr 3 , +.Xr strtok 3 +.Sh HISTORY +A +.Fn rindex +function appeared in +.At v6 . +Its prototype existed previously in +.Aq Pa string.h +before it was moved to +.Aq Pa strings.h +for +.St -p1003.1-2001 +compliance. diff --git a/string/FreeBSD/rindex.c b/string/FreeBSD/rindex.c new file mode 100644 index 0000000..b687b18 --- /dev/null +++ b/string/FreeBSD/rindex.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rindex.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/rindex.c,v 1.8 2007/01/09 00:28:12 imp Exp $"); + +#include + +#ifdef STRRCHR +#include + +char * +strrchr +#else +#include + +char * +rindex +#endif +(const char *p, int ch) +{ + char *save; + char c; + + c = ch; + for (save = NULL;; ++p) { + if (*p == c) + save = (char *)p; + if (*p == '\0') + return (save); + } + /* NOTREACHED */ +} diff --git a/string/FreeBSD/rpmatch.3 b/string/FreeBSD/rpmatch.3 new file mode 100644 index 0000000..8c77530 --- /dev/null +++ b/string/FreeBSD/rpmatch.3 @@ -0,0 +1,65 @@ +.\" +.\" Copyright (c) 2005 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 21, 2005 +.Dt RPMATCH 3 +.Os +.Sh NAME +.Nm rpmatch +.Nd "determine whether the response to a question is affirmative or negative" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fn rpmatch "const char *response" +.Sh DESCRIPTION +The +.Fn rpmatch +function determines whether the +.Fa response +argument is an affirmative or negative response to a question +according to the current locale. +.Sh RETURN VALUES +The +.Fn rpmatch +functions returns: +.Bl -tag -width indent +.It 1 +The response is affirmative. +.It 0 +The response is negative. +.It \&-1 +The response is not recognized. +.El +.Sh SEE ALSO +.Xr nl_langinfo 3 , +.Xr setlocale 3 +.Sh HISTORY +The +.Fn rpmatch +function appeared in macOS 10.15. diff --git a/string/FreeBSD/rpmatch.c b/string/FreeBSD/rpmatch.c new file mode 100644 index 0000000..e4c366a --- /dev/null +++ b/string/FreeBSD/rpmatch.c @@ -0,0 +1,57 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2004-2005 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +int +rpmatch(const char *response) +{ + regex_t yes, no; + int ret; + + if (regcomp(&yes, nl_langinfo(YESEXPR), REG_EXTENDED|REG_NOSUB) != 0) + return (-1); + if (regcomp(&no, nl_langinfo(NOEXPR), REG_EXTENDED|REG_NOSUB) != 0) { + regfree(&yes); + return (-1); + } + if (regexec(&yes, response, 0, NULL, 0) == 0) + ret = 1; + else if (regexec(&no, response, 0, NULL, 0) == 0) + ret = 0; + else + ret = -1; + regfree(&yes); + regfree(&no); + return (ret); +} diff --git a/string/FreeBSD/strcasecmp.3 b/string/FreeBSD/strcasecmp.3 new file mode 100644 index 0000000..0d686a6 --- /dev/null +++ b/string/FreeBSD/strcasecmp.3 @@ -0,0 +1,137 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/string/strcasecmp.3,v 1.13 2009/04/07 13:42:53 trasz Exp $ +.\" +.Dd June 9, 1993 +.Dt STRCASECMP 3 +.Os +.Sh NAME +.Nm strcasecmp , +.Nm strcasecmp_l , +.Nm strncasecmp , +.Nm strncasecmp_l +.Nd compare strings, ignoring case +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In strings.h +.Ft int +.Fo strcasecmp +.Fa "const char *s1" +.Fa "const char *s2" +.Fc +.Ft int +.Fo strncasecmp +.Fa "const char *s1" +.Fa "const char *s2" +.Fa "size_t n" +.Fc +.In strings.h +.In xlocale.h +.Ft int +.Fo strcasecmp_l +.Fa "const char *s1" +.Fa "const char *s2" +.Fa "locale_t loc" +.Fc +.Ft int +.Fo strncasecmp_l +.Fa "const char *s1" +.Fa "const char *s2" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn strcasecmp +and +.Fn strncasecmp +functions +compare the null-terminated strings +.Fa s1 +and +.Fa s2 . +.Pp +The +.Fn strncasecmp +compares at most +.Fa n +characters. +.Pp +Although the +.Fn strcasecmp +and +.Fn strncasecmp +functions use the current locale, the +.Fn strcasecmp_l +and +.Fn strncasecmp_l +functions may be passed locales directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn strcasecmp +and +.Fn strncasecmp +return an integer greater than, equal to, or less than 0, +according as +.Fa s1 +is lexicographically greater than, equal to, or less than +.Fa s2 +after translation of each corresponding character to lower-case. +The strings themselves are not modified. +The comparison is done using unsigned characters, so that +.Sq Li \e200 +is greater than +.Ql \e0 . +.Sh SEE ALSO +.Xr bcmp 3 , +.Xr memcmp 3 , +.Xr strcmp 3 , +.Xr strcoll 3 , +.Xr strxfrm 3 , +.Xr tolower 3 , +.Xr xlocale 3 +.Sh HISTORY +The +.Fn strcasecmp +and +.Fn strncasecmp +functions first appeared in +.Bx 4.4 . +Their prototypes existed previously in +.In string.h +before they were moved to +.In strings.h +for +.St -p1003.1-2001 +compliance. diff --git a/string/FreeBSD/strcasecmp.c b/string/FreeBSD/strcasecmp.c new file mode 100644 index 0000000..8299c16 --- /dev/null +++ b/string/FreeBSD/strcasecmp.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strcasecmp.c,v 1.8 2009/02/03 17:58:20 danger Exp $"); + +#include "xlocale_private.h" + +#include +#include + +typedef unsigned char u_char; + +int +strcasecmp_l(s1, s2, loc) + const char *s1, *s2; + locale_t loc; +{ + const u_char + *us1 = (const u_char *)s1, + *us2 = (const u_char *)s2; + + NORMALIZE_LOCALE(loc); + while (tolower_l(*us1, loc) == tolower_l(*us2++, loc)) + if (*us1++ == '\0') + return (0); + return (tolower_l(*us1, loc) - tolower_l(*--us2, loc)); +} + +int +strcasecmp(const char *s1, const char *s2) +{ + return strcasecmp_l(s1, s2, __current_locale()); +} + +int +strncasecmp_l(s1, s2, n, loc) + const char *s1, *s2; + size_t n; + locale_t loc; +{ + NORMALIZE_LOCALE(loc); + if (n != 0) { + const u_char + *us1 = (const u_char *)s1, + *us2 = (const u_char *)s2; + + do { + if (tolower_l(*us1, loc) != tolower_l(*us2++, loc)) + return (tolower_l(*us1, loc) - tolower_l(*--us2, loc)); + if (*us1++ == '\0') + break; + } while (--n != 0); + } + return (0); +} + +int +strncasecmp(const char *s1, const char *s2, size_t n) +{ + return strncasecmp_l(s1, s2, n, __current_locale()); +} diff --git a/string/FreeBSD/strcasestr.c b/string/FreeBSD/strcasestr.c new file mode 100644 index 0000000..e8f576f --- /dev/null +++ b/string/FreeBSD/strcasestr.c @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strcasestr.c,v 1.5 2009/02/03 17:58:20 danger Exp $"); + +#include "xlocale_private.h" + +#include +#include + +/* + * Find the first occurrence of find in s, ignore case. + */ +char * +strcasestr_l(s, find, loc) + const char *s, *find; + locale_t loc; +{ + char c, sc; + size_t len; + + NORMALIZE_LOCALE(loc); + if ((c = *find++) != 0) { + c = tolower_l((unsigned char)c, loc); + len = strlen(find); + do { + do { + if ((sc = *s++) == 0) + return (NULL); + } while ((char)tolower_l((unsigned char)sc, loc) != c); + } while (strncasecmp_l(s, find, len, loc) != 0); + s--; + } + return ((char *)s); +} + +char * +strcasestr(const char *s, const char *find) +{ + return strcasestr_l(s, find, __current_locale()); +} diff --git a/string/FreeBSD/strcat.3 b/string/FreeBSD/strcat.3 new file mode 100644 index 0000000..9eb86ec --- /dev/null +++ b/string/FreeBSD/strcat.3 @@ -0,0 +1,167 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strcat.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/strcat.3,v 1.17 2009/12/01 07:28:56 brueffer Exp $ +.\" +.Dd December 1, 2009 +.Dt STRCAT 3 +.Os +.Sh NAME +.Nm strcat , +.Nm strncat +.Nd concatenate strings +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft char * +.Fo strcat +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fc +.Ft char * +.Fo strncat +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fa "size_t n" +.Fc +.Sh DESCRIPTION +The +.Fn strcat +and +.Fn strncat +functions +append a copy of the null-terminated string +.Fa s2 +to the end of the null-terminated string +.Fa s1 , +then add a terminating +.Ql \e0 . +The string +.Fa s1 +must have sufficient space to hold the result. +.Pp +The +.Fn strncat +function +appends not more than +.Fa n +characters from +.Fa s2 , +and then adds a terminating +.Ql \e0 . +.Pp +The source and destination strings should not overlap, as the +behavior is undefined. +.Sh RETURN VALUES +The +.Fn strcat +and +.Fn strncat +functions +return the pointer +.Fa s1 . +.Sh SECURITY CONSIDERATIONS +The +.Fn strcat +function is easily misused in a manner +which enables malicious users to arbitrarily change +a running program's functionality through a buffer overflow attack. +(See +the FSA.) +.Pp +Avoid using +.Fn strcat . +Instead, use +.Fn strncat +or +.Fn strlcat +and ensure that no more characters are copied to the destination buffer +than it can hold. +.Pp +Note that +.Fn strncat +can also be problematic. +It may be a security concern for a string to be truncated at all. +Since the truncated string will not be as long as the original, +it may refer to a completely different resource +and usage of the truncated resource +could result in very incorrect behavior. +Example: +.Bd -literal +void +foo(const char *arbitrary_string) +{ + char onstack[8] = ""; + +#if defined(BAD) + /* + * This first strcat is bad behavior. Do not use strcat! + */ + (void)strcat(onstack, arbitrary_string); /* BAD! */ +#elif defined(BETTER) + /* + * The following two lines demonstrate better use of + * strncat(). + */ + (void)strncat(onstack, arbitrary_string, + sizeof(onstack) - strlen(onstack) - 1); +#elif defined(BEST) + /* + * These lines are even more robust due to testing for + * truncation. + */ + if (strlen(arbitrary_string) + 1 > + sizeof(onstack) - strlen(onstack)) + err(1, "onstack would be truncated"); + (void)strncat(onstack, arbitrary_string, + sizeof(onstack) - strlen(onstack) - 1); +#endif +} +.Ed +.Sh SEE ALSO +.Xr bcopy 3 , +.Xr memccpy 3 , +.Xr memcpy 3 , +.Xr memmove 3 , +.Xr strcpy 3 , +.Xr strlcat 3 , +.Xr strlcpy 3 , +.Xr wcscat 3 +.Sh STANDARDS +The +.Fn strcat +and +.Fn strncat +functions +conform to +.St -isoC . diff --git a/string/FreeBSD/strchr.3 b/string/FreeBSD/strchr.3 new file mode 100644 index 0000000..512bc6f --- /dev/null +++ b/string/FreeBSD/strchr.3 @@ -0,0 +1,102 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strchr.3 8.2 (Berkeley) 4/19/94 +.\" $FreeBSD: src/lib/libc/string/strchr.3,v 1.14 2009/04/07 13:42:53 trasz Exp $ +.\" +.Dd April 19, 1994 +.Dt STRCHR 3 +.Os +.Sh NAME +.Nm strchr , strrchr +.Nd locate character in string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft "char *" +.Fo strchr +.Fa "const char *s" +.Fa "int c" +.Fc +.Ft "char *" +.Fo strrchr +.Fa "const char *s" +.Fa "int c" +.Fc +.Sh DESCRIPTION +The +.Fn strchr +function locates the first occurrence of +.Fa c +(converted to a +.Vt char ) +in the string pointed to by +.Fa s . +The terminating null character is considered to be part of the string; +therefore if +.Fa c +is +.Ql \e0 , +the functions locate the terminating +.Ql \e0 . +.Pp +The +.Fn strrchr +function is identical to +.Fn strchr , +except it locates the last occurrence of +.Fa c . +.Sh RETURN VALUES +The functions +.Fn strchr +and +.Fn strrchr +return a pointer to the located character, or +.Dv NULL +if the character does not appear in the string. +.Sh SEE ALSO +.Xr memchr 3 , +.Xr memmem 3 , +.Xr strcspn 3 , +.Xr strpbrk 3 , +.Xr strsep 3 , +.Xr strspn 3 , +.Xr strstr 3 , +.Xr strtok 3 , +.Xr wcschr 3 +.Sh STANDARDS +The functions +.Fn strchr +and +.Fn strrchr +conform to +.St -isoC . diff --git a/string/FreeBSD/strcmp.3 b/string/FreeBSD/strcmp.3 new file mode 100644 index 0000000..e04b4dd --- /dev/null +++ b/string/FreeBSD/strcmp.3 @@ -0,0 +1,108 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strcmp.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/strcmp.3,v 1.13 2009/12/04 09:20:20 trhodes Exp $ +.\" +.Dd October 11, 2001 +.Dt STRCMP 3 +.Os +.Sh NAME +.Nm strcmp , +.Nm strncmp +.Nd compare strings +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft int +.Fo strcmp +.Fa "const char *s1" +.Fa "const char *s2" +.Fc +.Ft int +.Fo strncmp +.Fa "const char *s1" +.Fa "const char *s2" +.Fa "size_t n" +.Fc +.Sh DESCRIPTION +The +.Fn strcmp +and +.Fn strncmp +functions +lexicographically compare the null-terminated strings +.Fa s1 +and +.Fa s2 . +.Pp +The +.Fn strncmp +function +compares not more than +.Fa n +characters. +Because +.Fn strncmp +is designed for comparing strings rather than binary data, +characters that appear after a +.Ql \e0 +character are not compared. +.Sh RETURN VALUES +The +.Fn strcmp +and +.Fn strncmp +functions return an integer greater than, equal to, or less than 0, according +as the string +.Fa s1 +is greater than, equal to, or less than the string +.Fa s2 . +The comparison is done using unsigned characters, so that +.Ql \e200 +is greater than +.Ql \e0 . +.Sh SEE ALSO +.Xr bcmp 3 , +.Xr memcmp 3 , +.Xr strcasecmp 3 , +.Xr strcoll 3 , +.Xr strxfrm 3 , +.Xr wcscmp 3 +.Sh STANDARDS +The +.Fn strcmp +and +.Fn strncmp +functions +conform to +.St -isoC . diff --git a/string/FreeBSD/strcoll.3 b/string/FreeBSD/strcoll.3 new file mode 100644 index 0000000..fcbbbe1 --- /dev/null +++ b/string/FreeBSD/strcoll.3 @@ -0,0 +1,96 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strcoll.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/strcoll.3,v 1.14 2007/01/09 00:28:12 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt STRCOLL 3 +.Os +.Sh NAME +.Nm strcoll , +.Nm strcoll_l +.Nd compare strings, according to current collation +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft int +.Fo strcoll +.Fa "const char *s1" +.Fa "const char *s2" +.Fc +.In string.h +.In xlocale.h +.Ft int +.Fo strcoll_l +.Fa "const char *s1" +.Fa "const char *s2" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn strcoll +function +lexicographically compares the null-terminated strings +.Fa s1 +and +.Fa s2 +according to the current locale collation +and returns an integer greater than, equal to, or less than 0, +according as +.Fa s1 +is greater than, equal to, or less than +.Fa s2 . +If information about the current locale collation is not available, +the value of +.Fn strcmp s1 s2 +is returned. +.Pp +Although the +.Fn strcoll +function uses the current locale, the +.Fn strcoll_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh SEE ALSO +.Xr setlocale 3 , +.Xr strcmp 3 , +.Xr strxfrm 3 , +.Xr wcscoll 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn strcoll +function +conforms to +.St -isoC . diff --git a/string/FreeBSD/strcoll.c b/string/FreeBSD/strcoll.c new file mode 100644 index 0000000..3128289 --- /dev/null +++ b/string/FreeBSD/strcoll.c @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 1995 Alex Tatmanjants + * at Electronni Visti IA, Kiev, Ukraine. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strcoll.c,v 1.14 2009/02/03 17:58:20 danger Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "collate.h" + +int +strcoll_l(const char *s, const char *s2, locale_t loc) +{ + int ret; + const wchar_t *t = NULL, *t2 = NULL; + int sverrno; + + NORMALIZE_LOCALE(loc); + if (loc->__collate_load_error || (t = __collate_mbstowcs(s, loc)) == NULL || (t2 = __collate_mbstowcs(s2, loc)) == NULL) { + sverrno = errno; + free((void *)t); + free((void *)t2); + errno = sverrno; + return strcmp(s, s2); + } + + ret = wcscoll_l(t, t2, loc); + sverrno = errno; + free((void *)t); + free((void *)t2); + errno = sverrno; + + return ret; +} + +int +strcoll(const char *s, const char *s2) +{ + return strcoll_l(s, s2, __current_locale()); +} diff --git a/string/FreeBSD/strcpy.3 b/string/FreeBSD/strcpy.3 new file mode 100644 index 0000000..fda6eb4 --- /dev/null +++ b/string/FreeBSD/strcpy.3 @@ -0,0 +1,215 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strcpy.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd February 28, 2009 +.Dt STRCPY 3 +.Os +.Sh NAME +.Nm stpcpy, stpncpy, strcpy , strncpy +.Nd copy strings +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft char * +.Fn stpcpy "char * dst" "const char * src" +.Ft char * +.Fn stpncpy "char * dst" "const char * src" "size_t len" +.Ft char * +.Fn strcpy "char * dst" "const char * src" +.Ft char * +.Fn strncpy "char * dst" "const char * src" "size_t len" +.Sh DESCRIPTION +The +.Fn stpcpy +and +.Fn strcpy +functions +copy the string +.Fa src +to +.Fa dst +(including the terminating +.Ql \e0 +character.) +.Pp +The +.Fn stpncpy +and +.Fn strncpy +functions copy at most +.Fa len +characters from +.Fa src +into +.Fa dst . +If +.Fa src +is less than +.Fa len +characters long, +the remainder of +.Fa dst +is filled with +.Ql \e0 +characters. +Otherwise, +.Fa dst +is +.Em not +terminated. +.Pp +The source and destination strings should not overlap, as the +behavior is undefined. +.Sh RETURN VALUES +The +.Fn strcpy +and +.Fn strncpy +functions +return +.Fa dst . +The +.Fn stpcpy +and +.Fn stpncpy +functions return a pointer to the terminating +.Ql \e0 +character of +.Fa dst . +If +.Fn stpncpy +does not terminate +.Fa dst +with a +.Dv NUL +character, it instead returns a pointer to +.Li dst[n] +(which does not necessarily refer to a valid memory location.) +.Sh EXAMPLES +The following sets +.Va chararray +to +.Dq Li abc\e0\e0\e0 : +.Bd -literal -offset indent +char chararray[6]; + +(void)strncpy(chararray, "abc", sizeof(chararray)); +.Ed +.Pp +The following sets +.Va chararray +to +.Dq Li abcdef : +.Bd -literal -offset indent +char chararray[6]; + +(void)strncpy(chararray, "abcdefgh", sizeof(chararray)); +.Ed +.Pp +Note that it does +.Em not +.Tn NUL +terminate +.Va chararray +because the length of the source string is greater than or equal +to the length argument. +.Pp +The following copies as many characters from +.Va input +to +.Va buf +as will fit and +.Tn NUL +terminates the result. +Because +.Fn strncpy +does +.Em not +guarantee to +.Tn NUL +terminate the string itself, this must be done explicitly. +.Bd -literal -offset indent +char buf[1024]; + +(void)strncpy(buf, input, sizeof(buf) - 1); +buf[sizeof(buf) - 1] = '\e0'; +.Ed +.Pp +This could be better achieved using +.Xr strlcpy 3 , +as shown in the following example: +.Pp +.Dl "(void)strlcpy(buf, input, sizeof(buf));" +.Pp +Note that because +.Xr strlcpy 3 +is not defined in any standards, it should +only be used when portability is not a concern. +.Sh SEE ALSO +.Xr bcopy 3 , +.Xr memccpy 3 , +.Xr memcpy 3 , +.Xr memmove 3 , +.Xr strlcpy 3 , +.Xr wcscpy 3 +.Sh STANDARDS +The +.Fn strcpy +and +.Fn strncpy +functions +conform to +.St -isoC . +The +.Fn stpcpy +and +.Fn stpncpy +functions conform to +.St -p1003.1-2008 . +.Sh HISTORY +The +.Fn stpcpy +function first appeared in +.Fx 4.4 , +and +.Fn stpncpy +was added in +.Fx 8.0 . +.Sh SECURITY CONSIDERATIONS +The +.Fn strcpy +function is easily misused in a manner which enables malicious users +to arbitrarily change a running program's functionality through a +buffer overflow attack. diff --git a/string/FreeBSD/strcspn.c b/string/FreeBSD/strcspn.c new file mode 100644 index 0000000..55acb8b --- /dev/null +++ b/string/FreeBSD/strcspn.c @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2005 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strcspn.c,v 1.5 2005/04/02 18:52:44 das Exp $"); + +#include +#include +#include + +#define IDX(c) ((u_char)(c) / LONG_BIT) +#define BIT(c) ((u_long)1 << ((u_char)(c) % LONG_BIT)) + +size_t +strcspn(const char *s, const char *charset) +{ + /* + * NB: idx and bit are temporaries whose use causes gcc 3.4.2 to + * generate better code. Without them, gcc gets a little confused. + */ + const char *s1; + u_long bit; + u_long tbl[(UCHAR_MAX + 1) / LONG_BIT]; + int idx; + + if(*s == '\0') + return (0); + +#if LONG_BIT == 64 /* always better to unroll on 64-bit architectures */ + tbl[0] = 1; + tbl[3] = tbl[2] = tbl[1] = 0; +#else + for (tbl[0] = idx = 1; idx < sizeof(tbl) / sizeof(tbl[0]); idx++) + tbl[idx] = 0; +#endif + for (; *charset != '\0'; charset++) { + idx = IDX(*charset); + bit = BIT(*charset); + tbl[idx] |= bit; + } + + for(s1 = s; ; s1++) { + idx = IDX(*s1); + bit = BIT(*s1); + if ((tbl[idx] & bit) != 0) + break; + } + return (s1 - s); +} diff --git a/string/FreeBSD/strdup.3 b/string/FreeBSD/strdup.3 new file mode 100644 index 0000000..688d317 --- /dev/null +++ b/string/FreeBSD/strdup.3 @@ -0,0 +1,88 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strdup.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/string/strdup.3,v 1.15 2009/04/07 13:42:53 trasz Exp $ +.\" +.Dd December 5, 2008 +.Dt STRDUP 3 +.Os +.Sh NAME +.Nm strdup , +.Nm strndup +.Nd save a copy of a string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft char * +.Fo strdup +.Fa "const char *s1" +.Fc +.Ft char * +.Fo strndup +.Fa "const char *s1" +.Fa "size_t n" +.Fc +.Sh DESCRIPTION +The +.Fn strdup +function +allocates sufficient memory for a copy +of the string +.Fa s1 , +does the copy, and returns a pointer to it. +The pointer may subsequently be used as an +argument to the function +.Xr free 3 . +.Pp +If insufficient memory is available, NULL is returned and +.Va errno +is set to +.Er ENOMEM . +.Pp +The +.Fn strndup +function copies at most +.Fa n +characters from the string +.Fa s1 +always +.Dv NUL +terminating the copied string. +.Sh SEE ALSO +.Xr free 3 , +.Xr malloc 3 +.Sh HISTORY +The +.Fn strdup +function first appeared in +.Bx 4.4 . +The +.Fn strndup +function was added in +.Fx 7.2 . diff --git a/string/FreeBSD/strdup.c b/string/FreeBSD/strdup.c new file mode 100644 index 0000000..3043a3b --- /dev/null +++ b/string/FreeBSD/strdup.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strdup.c,v 1.6 2009/02/03 17:58:20 danger Exp $"); + +#include +#include +#include + +char * +strdup(const char *str) +{ + size_t len; + char *copy; + + len = strlen(str) + 1; + if ((copy = malloc(len)) == NULL) + return (NULL); + memcpy(copy, str, len); + return (copy); +} diff --git a/string/FreeBSD/strerror.3 b/string/FreeBSD/strerror.3 new file mode 100644 index 0000000..f6f7510 --- /dev/null +++ b/string/FreeBSD/strerror.3 @@ -0,0 +1,194 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strerror.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/string/strerror.3,v 1.24 2007/01/09 00:28:12 imp Exp $ +.\" +.Dd October 12, 2004 +.Dt STRERROR 3 +.Os +.Sh NAME +.Nm perror , +.Nm strerror , +.Nm strerror_r , +.Nm sys_errlist , +.Nm sys_nerr +.Nd system error messages +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft void +.Fo perror +.Fa "const char *s" +.Fc +.Vt extern const char * const sys_errlist[] ; +.Vt extern const int sys_nerr ; +.In string.h +.Ft "char *" +.Fo strerror +.Fa "int errnum" +.Fc +.Ft int +.Fo strerror_r +.Fa "int errnum" +.Fa "char *strerrbuf" +.Fa "size_t buflen" +.Fc +.Sh DESCRIPTION +The +.Fn strerror , +.Fn strerror_r , +and +.Fn perror +functions look up the error message string corresponding to an +error number. +.Pp +The +.Fn strerror +function accepts an error number argument +.Fa errnum +and returns a pointer to the corresponding +message string. +.Pp +The +.Fn strerror_r +function renders the same result into +.Fa strerrbuf +for a maximum of +.Fa buflen +characters and returns 0 upon success. +.Pp +The +.Fn perror +function finds the error message corresponding to the current +value of the global variable +.Va errno +.Pq Xr intro 2 +and writes it, followed by a newline, to the +standard error file descriptor. +If the argument +.Fa s +is +.Pf non- Dv NULL +and does not point to the null character, +this string is prepended to the message +string and separated from it by +a colon and space +.Pq Dq Li ":\ " ; +otherwise, only the error message string is printed. +.Pp +If the error number is not recognized, these functions return an error message +string containing +.Dq Li "Unknown error:\ " +followed by the error number in decimal. +The +.Fn strerror +and +.Fn strerror_r +functions return +.Er EINVAL +as a warning. +Error numbers recognized by this implementation fall in +the range 0 <= +.Fa errnum +< +.Fa sys_nerr . +.Pp +If insufficient storage is provided in +.Fa strerrbuf +(as specified in +.Fa buflen ) +to contain the error string, +.Fn strerror_r +returns +.Er ERANGE +and +.Fa strerrbuf +will contain an error message that has been truncated and +.Dv NUL +terminated to fit the length specified by +.Fa buflen . +.Pp +The message strings can be accessed directly using the external +array +.Va sys_errlist . +The external value +.Va sys_nerr +contains a count of the messages in +.Va sys_errlist . +The use of these variables is deprecated; +.Fn strerror +or +.Fn strerror_r +should be used instead. +.Sh SEE ALSO +.Xr intro 2 , +.Xr psignal 3 +.Sh STANDARDS +The +.Fn perror +and +.Fn strerror +functions conform to +.St -isoC-99 . +The +.Fn strerror_r +function conforms to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn strerror +and +.Fn perror +functions first appeared in +.Bx 4.4 . +The +.Fn strerror_r +function was implemented in +.Fx 4.4 +by +.An Wes Peters Aq wes@FreeBSD.org . +.Sh BUGS +For unknown error numbers, the +.Fn strerror +function will return its result in a static buffer which +may be overwritten by subsequent calls. +.Pp +The return type for +.Fn strerror +is missing a type-qualifier; it should actually be +.Vt const char * . +.Pp +Programs that use the deprecated +.Va sys_errlist +variable often fail to compile because they declare it +inconsistently. diff --git a/string/FreeBSD/strerror.c b/string/FreeBSD/strerror.c new file mode 100644 index 0000000..8455ec1 --- /dev/null +++ b/string/FreeBSD/strerror.c @@ -0,0 +1,149 @@ +/*- + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strerror.c,v 1.16 2007/01/09 00:28:12 imp Exp $"); + +#if defined(NLS) +#include +#endif + +#include +#include +#include +#include +#include + +#define UPREFIX "Unknown error" + +/* + * Define a buffer size big enough to describe a 64-bit signed integer + * converted to ASCII decimal (19 bytes), with an optional leading sign + * (1 byte); finally, we get the prefix, delimiter (": ") and a trailing + * NUL from UPREFIX. + */ +#define EBUFSIZE (20 + 2 + sizeof(UPREFIX)) + +#if defined(DARLING) && defined(VARIANT_LEGACY) +// these can't be included in the legacy variant because they're already +// included in the regular variant (and they're exactly the same in both versions, +// both in terms of symbol naming and functionality) +__private_extern__ void __errstr(int num, char *uprefix, char *buf, size_t len); +extern int strerror_r(int errnum, char *strerrbuf, size_t buflen); +#else +/* + * Doing this by hand instead of linking with stdio(3) avoids bloat for + * statically linked binaries. + */ +__private_extern__ void +__errstr(int num, char *uprefix, char *buf, size_t len) +{ + char *t; + unsigned int uerr; + char tmp[EBUFSIZE]; + + t = tmp + sizeof(tmp); + *--t = '\0'; + uerr = (num >= 0) ? num : -num; + do { + *--t = "0123456789"[uerr % 10]; + } while (uerr /= 10); + if (num < 0) + *--t = '-'; + *--t = ' '; + *--t = ':'; + strlcpy(buf, uprefix, len); + strlcat(buf, t, len); +} + +int +strerror_r(int errnum, char *strerrbuf, size_t buflen) +{ + int retval = 0; +#if defined(NLS) + int saved_errno = errno; + nl_catd catd; + catd = catopen("libc", NL_CAT_LOCALE); +#endif + + if (errnum < 0 || errnum >= sys_nerr) { + __errstr(errnum, +#if defined(NLS) + catgets(catd, 1, 0xffff, UPREFIX), +#else + UPREFIX, +#endif + strerrbuf, buflen); + retval = EINVAL; + } else { + if (strlcpy(strerrbuf, +#if defined(NLS) + catgets(catd, 1, errnum, sys_errlist[errnum]), +#else + sys_errlist[errnum], +#endif + buflen) >= buflen) + retval = ERANGE; + } + +#if defined(NLS) + catclose(catd); + errno = saved_errno; +#endif + + return (retval); +} +#endif + +static char *__strerror_ebuf = NULL; + +char * +strerror(int num) +{ +#if !defined(NLS) + if (num >= 0 && num < sys_nerr) { + return (char*)sys_errlist[num]; + } +#endif + + if (__strerror_ebuf == NULL) { + __strerror_ebuf = calloc(1, NL_TEXTMAX); + if (__strerror_ebuf == NULL) { + return NULL; + } + } + + if (strerror_r(num, __strerror_ebuf, NL_TEXTMAX) != 0) { + errno = EINVAL; + } + return __strerror_ebuf; +} diff --git a/string/FreeBSD/string.3 b/string/FreeBSD/string.3 new file mode 100644 index 0000000..7f8f9ad --- /dev/null +++ b/string/FreeBSD/string.3 @@ -0,0 +1,223 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)string.3 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD: src/lib/libc/string/string.3,v 1.14 2007/01/09 00:28:12 imp Exp $ +.\" +.Dd December 11, 1993 +.Dt STRING 3 +.Os +.Sh NAME +.Nm index , +.Nm rindex , +.Nm stpcpy , +.Nm strcasecmp , +.Nm strcat , +.Nm strchr , +.Nm strcmp , +.Nm strcpy , +.Nm strcspn , +.Nm strerror , +.Nm strlen , +.Nm strncasecmp , +.Nm strncat , +.Nm strncmp , +.Nm strncpy , +.Nm strpbrk , +.Nm strrchr , +.Nm strsep , +.Nm strspn , +.Nm strstr , +.Nm strtok +.Nd string specific functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In strings.h +.Ft char * +.Fo index +.Fa "const char *s" +.Fa "int c" +.Fc +.Ft char * +.Fo rindex +.Fa "const char *s" +.Fa "int c" +.Fc +.Ft int +.Fo strcasecmp +.Fa "const char *s1" +.Fa "const char *s2" +.Fc +.Ft int +.Fo strncasecmp +.Fa "const char *s1" +.Fa "const char *s2" +.Fa "size_t n" +.Fc +.In string.h +.Ft char * +.Fo stpcpy +.Fa "char *dst" +.Fa "const char *src" +.Fc +.Ft char * +.Fo strcat +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fc +.Ft char * +.Fo strchr +.Fa "const char *s" +.Fa "int c" +.Fc +.Ft int +.Fo strcmp +.Fa "const char *s1" +.Fa "const char *s2" +.Fc +.Ft char * +.Fo strcpy +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fc +.Ft size_t +.Fo strcspn +.Fa "const char *s1" +.Fa "const char *s2" +.Fc +.Ft char * +.Fo strerror +.Fa "int errnum" +.Fc +.Ft size_t +.Fo strlen +.Fa "const char *s" +.Fc +.Ft char * +.Fo strncat +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fa "size_t n" +.Fc +.Ft int +.Fo strncmp +.Fa "const char *s1" +.Fa "const char *s2" +.Fa "size_t n" +.Fc +.Ft char * +.Fo strncpy +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fa "size_t n" +.Fc +.Ft char * +.Fo strpbrk +.Fa "const char *s1" +.Fa "const char *s2" +.Fc +.Ft char * +.Fo strrchr +.Fa "const char *s" +.Fa "int c" +.Fc +.Ft char * +.Fo strsep +.Fa "char **stringp" +.Fa "const char *delim" +.Fc +.Ft size_t +.Fo strspn +.Fa "const char *s1" +.Fa "const char *s2" +.Fc +.Ft char * +.Fo strstr +.Fa "const char *s1" +.Fa "const char *s2" +.Fc +.Ft char * +.Fo strtok +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fc +.Sh DESCRIPTION +The string +functions manipulate strings that are terminated by a +null byte. +.Pp +See the specific manual pages for more information. +For manipulating variable length generic objects as byte +strings (without the null byte check), see +.Xr bstring 3 . +.Pp +Except as noted in their specific manual pages, +the string functions do not test the destination +for size limitations. +.Sh SEE ALSO +.Xr bstring 3 , +.Xr index 3 , +.Xr rindex 3 , +.Xr stpcpy 3 , +.Xr strcasecmp 3 , +.Xr strcat 3 , +.Xr strchr 3 , +.Xr strcmp 3 , +.Xr strcpy 3 , +.Xr strcspn 3 , +.Xr strerror 3 , +.Xr strlen 3 , +.Xr strpbrk 3 , +.Xr strrchr 3 , +.Xr strsep 3 , +.Xr strspn 3 , +.Xr strstr 3 , +.Xr strtok 3 +.Sh STANDARDS +The +.Fn strcat , +.Fn strncat , +.Fn strchr , +.Fn strrchr , +.Fn strcmp , +.Fn strncmp , +.Fn strcpy , +.Fn strncpy , +.Fn strerror , +.Fn strlen , +.Fn strpbrk , +.Fn strspn , +.Fn strcspn , +.Fn strstr , +and +.Fn strtok +functions +conform to +.St -isoC . diff --git a/string/FreeBSD/strlcpy.3 b/string/FreeBSD/strlcpy.3 new file mode 100644 index 0000000..30a7588 --- /dev/null +++ b/string/FreeBSD/strlcpy.3 @@ -0,0 +1,200 @@ +.\" $OpenBSD: strlcpy.3,v 1.26 2013/09/30 12:02:35 millert Exp $ +.\" +.\" Copyright (c) 1998, 2000 Todd C. Miller +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 26, 2016 +.Dt STRLCPY 3 +.Os +.Sh NAME +.Nm strlcpy , +.Nm strlcat +.Nd size-bounded string copying and concatenation +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft size_t +.Fn strlcpy "char * restrict dst" "const char * restrict src" "size_t dstsize" +.Ft size_t +.Fn strlcat "char * restrict dst" "const char * restrict src" "size_t dstsize" +.Sh DESCRIPTION +The +.Fn strlcpy +and +.Fn strlcat +functions copy and concatenate strings with the +same input parameters and output result as +.Xr snprintf 3 . +They are designed to be safer, more consistent, and less error +prone replacements for the easily misused functions +.Xr strncpy 3 +and +.Xr strncat 3 . +.Pp +.Fn strlcpy +and +.Fn strlcat +take the full size of the destination buffer and guarantee +NUL-termination if there is room. +Note that room for the NUL should be included in +.Fa dstsize . +.Pp +.Fn strlcpy +copies up to +.Fa dstsize +\- 1 characters from the string +.Fa src +to +.Fa dst , +NUL-terminating the result if +.Fa dstsize +is not 0. +.Pp +.Fn strlcat +appends string +.Fa src +to the end of +.Fa dst . +It will append at most +.Fa dstsize +\- strlen(dst) \- 1 characters. +It will then NUL-terminate, unless +.Fa dstsize +is 0 or the original +.Fa dst +string was longer than +.Fa dstsize +(in practice this should not happen +as it means that either +.Fa dstsize +is incorrect or that +.Fa dst +is not a proper string). +.Pp +If the +.Fa src +and +.Fa dst +strings overlap, the behavior is undefined. +.Sh RETURN VALUES +Besides quibbles over the return type +.Pf ( Va size_t +versus +.Va int ) +and signal handler safety +.Pf ( Xr snprintf 3 +is not entirely safe on some systems), the +following two are equivalent: +.Bd -literal -offset indent +n = strlcpy(dst, src, len); +n = snprintf(dst, len, "%s", src); +.Ed +.Pp +Like +.Xr snprintf 3 , +the +.Fn strlcpy +and +.Fn strlcat +functions return the total length of the string they tried to create. +For +.Fn strlcpy +that means the length of +.Fa src . +For +.Fn strlcat +that means the initial length of +.Fa dst +plus +the length of +.Fa src . +.Pp +If the return value is +.Cm >= +.Va dstsize , +the output string has been truncated. +It is the caller's responsibility to handle this. +.Sh EXAMPLES +The following code fragment illustrates the simple case: +.Bd -literal -offset indent +char *s, *p, buf[BUFSIZ]; + +\&... + +(void)strlcpy(buf, s, sizeof(buf)); +(void)strlcat(buf, p, sizeof(buf)); +.Ed +.Pp +To detect truncation, perhaps while building a pathname, something +like the following might be used: +.Bd -literal -offset indent +char *dir, *file, pname[MAXPATHLEN]; + +\&... + +if (strlcpy(pname, dir, sizeof(pname)) >= sizeof(pname)) + goto toolong; +if (strlcat(pname, file, sizeof(pname)) >= sizeof(pname)) + goto toolong; +.Ed +.Pp +Since it is known how many characters were copied the first time, things +can be sped up a bit by using a copy instead of an append: +.Bd -literal -offset indent +char *dir, *file, pname[MAXPATHLEN]; +size_t n; + +\&... + +n = strlcpy(pname, dir, sizeof(pname)); +if (n >= sizeof(pname)) + goto toolong; +if (strlcpy(pname + n, file, sizeof(pname) - n) >= sizeof(pname) - n) + goto toolong; +.Ed +.Pp +However, one may question the validity of such optimizations, as they +defeat the whole purpose of +.Fn strlcpy +and +.Fn strlcat . +As a matter of fact, the first version of this manual page got it wrong. +.Sh SEE ALSO +.Xr snprintf 3 , +.Xr strncat 3 , +.Xr strncpy 3 , +.Xr wcslcpy 3 +.Sh HISTORY +The +.Fn strlcpy +and +.Fn strlcat +functions first appeared in +.Ox 2.4 , +and +.Fx 3.3 . diff --git a/string/FreeBSD/strlen.3 b/string/FreeBSD/strlen.3 new file mode 100644 index 0000000..031f450 --- /dev/null +++ b/string/FreeBSD/strlen.3 @@ -0,0 +1,92 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strlen.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/strlen.3,v 1.9 2009/04/07 13:42:53 trasz Exp $ +.\" +.Dd February 28, 2009 +.Dt STRLEN 3 +.Os +.Sh NAME +.Nm strlen, strnlen +.Nd find length of string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft size_t +.Fn strlen "const char *s" +.Ft size_t +.Fn strnlen "const char *s" "size_t maxlen" +.Sh DESCRIPTION +The +.Fn strlen +function +computes the length of the string +.Fa s . +The +.Fn strnlen +function attempts to compute the length of +.Fa s , +but never scans beyond the first +.Fa maxlen +bytes of +.Fa s . +.Sh RETURN VALUES +The +.Fn strlen +function +returns +the number of characters that precede the +terminating +.Dv NUL +character. +The +.Fn strnlen +function returns either the same result as +.Fn strlen +or +.Fa maxlen , +whichever is smaller. +.Sh SEE ALSO +.Xr string 3 , +.Xr wcslen 3 , +.Xr wcswidth 3 +.Sh STANDARDS +The +.Fn strlen +function +conforms to +.St -isoC . +The +.Fn strnlen +function conforms to +.St -p1003.1-2008 . diff --git a/string/FreeBSD/strmode.3 b/string/FreeBSD/strmode.3 new file mode 100644 index 0000000..704224e --- /dev/null +++ b/string/FreeBSD/strmode.3 @@ -0,0 +1,145 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strmode.3 8.3 (Berkeley) 7/28/94 +.\" $FreeBSD: src/lib/libc/string/strmode.3,v 1.11 2009/04/14 11:39:56 trasz Exp $ +.\" +.Dd July 28, 1994 +.Dt STRMODE 3 +.Os +.Sh NAME +.Nm strmode +.Nd convert inode status information into a symbolic string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft void +.Fo strmode +.Fa "int mode" +.Fa "char *bp" +.Fc +.Sh DESCRIPTION +The +.Fn strmode +function +converts a file +.Fa mode +(the type and permission information associated with an inode, see +.Xr stat 2 ) +into a symbolic string which is stored in the location referenced by +.Fa bp . +This stored string is eleven characters in length plus a trailing +.Dv NUL . +.Pp +The first character is the inode type, and will be one of the following: +.Pp +.Bl -tag -width flag -offset indent -compact +.It \- +regular file +.It b +block special +.It c +character special +.It d +directory +.It l +symbolic link +.It p +fifo +.It s +socket +.It w +whiteout +.It ? +unknown inode type +.El +.Pp +The next nine characters encode three sets of permissions, in three +characters each. +The first three characters are the permissions for the owner of the +file, the second three for the group the file belongs to, and the +third for the ``other'', or default, set of users. +.Pp +Permission checking is done as specifically as possible. +If read permission is denied to the owner of a file in the first set +of permissions, the owner of the file will not be able to read the file. +This is true even if the owner is in the file's group and the group +permissions allow reading or the ``other'' permissions allow reading. +.Pp +If the first character of the three character set is an ``r'', the file is +readable for that set of users; if a dash ``\-'', it is not readable. +.Pp +If the second character of the three character set is a ``w'', the file is +writable for that set of users; if a dash ``\-'', it is not writable. +.Pp +The third character is the first of the following characters that apply: +.Bl -tag -width xxxx +.It S +If the character is part of the owner permissions and the file is not +executable or the directory is not searchable by the owner, and the +set-user-id bit is set. +.It S +If the character is part of the group permissions and the file is not +executable or the directory is not searchable by the group, and the +set-group-id bit is set. +.It T +If the character is part of the other permissions and the file is not +executable or the directory is not searchable by others, and the ``sticky'' +.Pq Dv S_ISVTX +bit is set. +.It s +If the character is part of the owner permissions and the file is +executable or the directory searchable by the owner, and the set-user-id +bit is set. +.It s +If the character is part of the group permissions and the file is +executable or the directory searchable by the group, and the set-group-id +bit is set. +.It t +If the character is part of the other permissions and the file is +executable or the directory searchable by others, and the ``sticky'' +.Pq Dv S_ISVTX +bit is set. +.It x +The file is executable or the directory is searchable. +.It \- +None of the above apply. +.El +.Pp +The last character will always be a space. +.Sh SEE ALSO +.Xr chmod 1 , +.Xr find 1 , +.Xr stat 2 , +.Xr getmode 3 , +.Xr setmode 3 +.Sh HISTORY +The +.Fn strmode +function first appeared in +.Bx 4.4 . diff --git a/string/FreeBSD/strmode.c b/string/FreeBSD/strmode.c new file mode 100644 index 0000000..3375e64 --- /dev/null +++ b/string/FreeBSD/strmode.c @@ -0,0 +1,148 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strmode.c,v 1.8 2009/04/14 11:39:56 trasz Exp $"); + +#include +#include +#include + +void +strmode(/* mode_t */ int mode, char *p) +{ + /* print type */ + switch (mode & S_IFMT) { + case S_IFDIR: /* directory */ + *p++ = 'd'; + break; + case S_IFCHR: /* character special */ + *p++ = 'c'; + break; + case S_IFBLK: /* block special */ + *p++ = 'b'; + break; + case S_IFREG: /* regular */ + *p++ = '-'; + break; + case S_IFLNK: /* symbolic link */ + *p++ = 'l'; + break; + case S_IFSOCK: /* socket */ + *p++ = 's'; + break; +#ifdef S_IFIFO + case S_IFIFO: /* fifo */ + *p++ = 'p'; + break; +#endif +#ifdef S_IFWHT + case S_IFWHT: /* whiteout */ + *p++ = 'w'; + break; +#endif + default: /* unknown */ + *p++ = '?'; + break; + } + /* usr */ + if (mode & S_IRUSR) + *p++ = 'r'; + else + *p++ = '-'; + if (mode & S_IWUSR) + *p++ = 'w'; + else + *p++ = '-'; + switch (mode & (S_IXUSR | S_ISUID)) { + case 0: + *p++ = '-'; + break; + case S_IXUSR: + *p++ = 'x'; + break; + case S_ISUID: + *p++ = 'S'; + break; + case S_IXUSR | S_ISUID: + *p++ = 's'; + break; + } + /* group */ + if (mode & S_IRGRP) + *p++ = 'r'; + else + *p++ = '-'; + if (mode & S_IWGRP) + *p++ = 'w'; + else + *p++ = '-'; + switch (mode & (S_IXGRP | S_ISGID)) { + case 0: + *p++ = '-'; + break; + case S_IXGRP: + *p++ = 'x'; + break; + case S_ISGID: + *p++ = 'S'; + break; + case S_IXGRP | S_ISGID: + *p++ = 's'; + break; + } + /* other */ + if (mode & S_IROTH) + *p++ = 'r'; + else + *p++ = '-'; + if (mode & S_IWOTH) + *p++ = 'w'; + else + *p++ = '-'; + switch (mode & (S_IXOTH | S_ISVTX)) { + case 0: + *p++ = '-'; + break; + case S_IXOTH: + *p++ = 'x'; + break; + case S_ISVTX: + *p++ = 'T'; + break; + case S_IXOTH | S_ISVTX: + *p++ = 't'; + break; + } + *p++ = ' '; + *p = '\0'; +} diff --git a/string/FreeBSD/strndup.c b/string/FreeBSD/strndup.c new file mode 100644 index 0000000..c63f6a3 --- /dev/null +++ b/string/FreeBSD/strndup.c @@ -0,0 +1,53 @@ +/* $NetBSD: strndup.c,v 1.3 2007/01/14 23:41:24 cbiere Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strndup.c,v 1.1 2008/12/06 09:37:54 kib Exp $"); + +#include +#include +#include + +char * +strndup(const char *str, size_t n) +{ + size_t len; + char *copy; + + for (len = 0; len < n && str[len]; len++) + continue; + + if ((copy = malloc(len + 1)) == NULL) + return (NULL); + memcpy(copy, str, len); + copy[len] = '\0'; + return (copy); +} diff --git a/string/FreeBSD/strnstr.c b/string/FreeBSD/strnstr.c new file mode 100644 index 0000000..ca12ba1 --- /dev/null +++ b/string/FreeBSD/strnstr.c @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2001 Mike Barcroft + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strstr.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strnstr.c,v 1.5 2009/02/03 17:58:20 danger Exp $"); + +#include + +/* + * Find the first occurrence of find in s, where the search is limited to the + * first slen characters of s. + */ +char * +strnstr(const char *s, const char *find, size_t slen) +{ + char c, sc; + size_t len; + + if ((c = *find++) != '\0') { + len = strlen(find); + do { + do { + if (slen-- < 1 || (sc = *s++) == '\0') + return (NULL); + } while (sc != c); + if (len > slen) + return (NULL); + } while (strncmp(s, find, len) != 0); + s--; + } + return ((char *)s); +} diff --git a/string/FreeBSD/strpbrk.3 b/string/FreeBSD/strpbrk.3 new file mode 100644 index 0000000..bfa5099 --- /dev/null +++ b/string/FreeBSD/strpbrk.3 @@ -0,0 +1,77 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strpbrk.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd June 4, 1993 +.Dt STRPBRK 3 +.Os +.Sh NAME +.Nm strpbrk +.Nd locate multiple characters in string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft char * +.Fn strpbrk "const char *s" "const char *charset" +.Sh DESCRIPTION +The +.Fn strpbrk +function +locates in the null-terminated string +.Fa s +the first occurrence of any character in the string +.Fa charset +and returns a pointer to this character. +If no characters from +.Fa charset +occur anywhere in +.Fa s +.Fn strpbrk +returns NULL. +.Sh SEE ALSO +.Xr memchr 3 , +.Xr strchr 3 , +.Xr strcspn 3 , +.Xr strrchr 3 , +.Xr strsep 3 , +.Xr strspn 3 , +.Xr strstr 3 , +.Xr strtok 3 , +.Xr wcspbrk 3 +.Sh STANDARDS +The +.Fn strpbrk +function +conforms to +.St -isoC . diff --git a/string/FreeBSD/strpbrk.c b/string/FreeBSD/strpbrk.c new file mode 100644 index 0000000..b4a0354 --- /dev/null +++ b/string/FreeBSD/strpbrk.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1985, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strpbrk.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strpbrk.c,v 1.6 2009/02/03 17:58:20 danger Exp $"); + +#include + +/* + * Find the first occurrence in s1 of a character in s2 (excluding NUL). + */ +char * +strpbrk(const char *s1, const char *s2) +{ + const char *scanp; + int c, sc; + + while ((c = *s1++) != 0) { + for (scanp = s2; (sc = *scanp++) != '\0';) + if (sc == c) + return ((char *)(s1 - 1)); + } + return (NULL); +} diff --git a/string/FreeBSD/strrchr.c b/string/FreeBSD/strrchr.c new file mode 100644 index 0000000..b8c0500 --- /dev/null +++ b/string/FreeBSD/strrchr.c @@ -0,0 +1,5 @@ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strrchr.c,v 1.2 2002/03/22 21:53:19 obrien Exp $"); + +#define STRRCHR +#include "rindex.c" diff --git a/string/FreeBSD/strsep.3 b/string/FreeBSD/strsep.3 new file mode 100644 index 0000000..ae0259a --- /dev/null +++ b/string/FreeBSD/strsep.3 @@ -0,0 +1,135 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strsep.3 8.1 (Berkeley) 6/9/93 +.\" $FreeBSD: src/lib/libc/string/strsep.3,v 1.16 2008/12/05 15:50:59 pjd Exp $ +.\" +.Dd December 5, 2008 +.Dt STRSEP 3 +.Os +.Sh NAME +.Nm strsep +.Nd separate strings +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft char * +.Fn strsep "char **stringp" "const char *delim" +.Sh DESCRIPTION +The +.Fn strsep +function locates, in the string referenced by +.Fa *stringp , +the first occurrence of any character in the string +.Fa delim +(or the terminating +.Ql \e0 +character) and replaces it with a +.Ql \e0 . +The location of the next character after the delimiter character +(or NULL, if the end of the string was reached) is stored in +.Fa *stringp . +The original value of +.Fa *stringp +is returned. +.Pp +An +.Dq empty +field (i.e., a character in the string +.Fa delim +occurs as the first character of +.Fa *stringp ) +can be detected by comparing the location referenced by the returned pointer +to +.Ql \e0 . +.Pp +If +.Fa *stringp +is initially +.Dv NULL , +.Fn strsep +returns +.Dv NULL . +.Sh EXAMPLES +The following uses +.Fn strsep +to parse a string, and prints each token in separate line: +.Bd -literal -offset indent +char *token, *string, *tofree; + +tofree = string = strdup("abc,def,ghi"); +assert(string != NULL); + +while ((token = strsep(&string, ",")) != NULL) + printf("%s\en", token); + +free(tofree); +.Ed +.Pp +The following uses +.Fn strsep +to parse a string, containing tokens delimited by white space, into an +argument vector: +.Bd -literal -offset indent +char **ap, *argv[10], *inputstring; + +for (ap = argv; (*ap = strsep(&inputstring, " \et")) != NULL;) + if (**ap != '\e0') + if (++ap >= &argv[10]) + break; +.Ed +.Sh SEE ALSO +.Xr memchr 3 , +.Xr strchr 3 , +.Xr strcspn 3 , +.Xr strpbrk 3 , +.Xr strrchr 3 , +.Xr strspn 3 , +.Xr strstr 3 , +.Xr strtok 3 +.Sh HISTORY +The +.Fn strsep +function +is intended as a replacement for the +.Fn strtok +function. +While the +.Fn strtok +function should be preferred for portability reasons (it conforms to +.St -isoC ) +it is unable to handle empty fields, i.e., detect fields delimited by +two adjacent delimiter characters, or to be used for more than a single +string at a time. +The +.Fn strsep +function first appeared in +.Bx 4.4 . diff --git a/string/FreeBSD/strsep.c b/string/FreeBSD/strsep.c new file mode 100644 index 0000000..34b7d29 --- /dev/null +++ b/string/FreeBSD/strsep.c @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strsep.c,v 1.7 2009/02/03 17:58:20 danger Exp $"); + +#include +#include + +/* + * Get next token from string *stringp, where tokens are possibly-empty + * strings separated by characters from delim. + * + * Writes NULs into the string at *stringp to end tokens. + * delim need not remain constant from call to call. + * On return, *stringp points past the last NUL written (if there might + * be further tokens), or is NULL (if there are definitely no more tokens). + * + * If *stringp is NULL, strsep returns NULL. + */ +char * +strsep(char **stringp, const char *delim) +{ + char *s; + const char *spanp; + int c, sc; + char *tok; + + if ((s = *stringp) == NULL) + return (NULL); + for (tok = s;;) { + c = *s++; + spanp = delim; + do { + if ((sc = *spanp++) == c) { + if (c == 0) + s = NULL; + else + s[-1] = 0; + *stringp = s; + return (tok); + } + } while (sc != 0); + } + /* NOTREACHED */ +} diff --git a/string/FreeBSD/strsignal.c b/string/FreeBSD/strsignal.c new file mode 100644 index 0000000..7806d63 --- /dev/null +++ b/string/FreeBSD/strsignal.c @@ -0,0 +1,148 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strsignal.c,v 1.9 2010/01/24 10:35:26 ume Exp $"); + +#include "namespace.h" +#if defined(NLS) +#include +#endif +#include +#include +#include +#include +#include +#include "reentrant.h" +#include "un-namespace.h" + +#define UPREFIX "Unknown signal" + +static once_t sig_init_once = ONCE_INITIALIZER; +static thread_key_t sig_key; +static int sig_keycreated = 0; + +static void +sig_keycreate(void) +{ + sig_keycreated = (thr_keycreate(&sig_key, free) == 0); +} + +static char * +sig_tlsalloc(void) +{ + char *ebuf = NULL; + + if (thr_once(&sig_init_once, sig_keycreate) != 0 || + !sig_keycreated) + goto thr_err; + if ((ebuf = thr_getspecific(sig_key)) == NULL) { + if ((ebuf = malloc(NL_TEXTMAX * sizeof(char))) == NULL) + goto thr_err; + if (thr_setspecific(sig_key, ebuf) != 0) { + free(ebuf); + ebuf = NULL; + goto thr_err; + } + } +thr_err: + return (ebuf); +} + +/* XXX: negative 'num' ? (REGR) */ +char * +strsignal(int num) +{ + char *ebuf; + char tmp[20]; + size_t n; + int signum; + char *t, *p; + +#if defined(NLS) + int saved_errno = errno; + nl_catd catd; + catd = catopen("libc", NL_CAT_LOCALE); +#endif + + ebuf = sig_tlsalloc(); + if(ebuf == NULL) { + errno = ENOMEM; + return NULL; + } + + if (num > 0 && num < NSIG) { + n = strlcpy(ebuf, +#if defined(NLS) + catgets(catd, 2, num, sys_siglist[num]), +#else + sys_siglist[num], +#endif + NL_TEXTMAX * sizeof(char)); + } else { + n = strlcpy(ebuf, +#if defined(NLS) + catgets(catd, 2, 0xffff, UPREFIX), +#else + UPREFIX, +#endif + NL_TEXTMAX * sizeof(char)); + } + + signum = num; + if (num < 0) + signum = -signum; + + t = tmp; + do { + *t++ = "0123456789"[signum % 10]; + } while (signum /= 10); + if (num < 0) + *t++ = '-'; + + p = (ebuf + n); + *p++ = ':'; + *p++ = ' '; + + for (;;) { + *p++ = *--t; + if (t <= tmp) + break; + } + *p = '\0'; + +#if defined(NLS) + catclose(catd); + errno = saved_errno; +#endif + return (ebuf); +} diff --git a/string/FreeBSD/strspn.3 b/string/FreeBSD/strspn.3 new file mode 100644 index 0000000..4a8e3f4 --- /dev/null +++ b/string/FreeBSD/strspn.3 @@ -0,0 +1,111 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strspn.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd May 24, 2014 +.Dt STRSPN 3 +.Os +.Sh NAME +.Nm strspn , +.Nm strcspn +.Nd span a string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft size_t +.Fn strspn "const char *s" "const char *charset" +.Ft size_t +.Fn strcspn "const char *s" "const char *charset" +.Sh DESCRIPTION +The +.Fn strspn +function +spans the initial part of the null-terminated string +.Fa s +as long as the characters from +.Fa s +occur in the null-terminated string +.Fa charset . +In other words, it computes the string array index +of the first character of +.Fa s +which is not in +.Fa charset , +else the index of the first null character. +.Pp +The +.Fn strcspn +function +spans the initial part of the null-terminated string +.Fa s +as long as the characters from +.Fa s +.Sy do not +occur in the null-terminated string +.Fa charset +.Po it spans the +.Sy complement +of +.Fa charset +.Pc . +In other words, it computes the string array index +of the first character of +.Fa s +which is also in +.Fa charset , +else the index of the first null character. +.Sh RETURN VALUES +The +.Fn strspn +and +.Fn strcspn +functions +return the number of characters spanned. +.Sh SEE ALSO +.Xr memchr 3 , +.Xr strchr 3 , +.Xr strpbrk 3 , +.Xr strrchr 3 , +.Xr strsep 3 , +.Xr strstr 3 , +.Xr strtok 3 , +.Xr wcsspn 3 +.Sh STANDARDS +The +.Fn strspn +and +.Fn strcspn +functions +conform to +.St -isoC . diff --git a/string/FreeBSD/strspn.c b/string/FreeBSD/strspn.c new file mode 100644 index 0000000..3b96365 --- /dev/null +++ b/string/FreeBSD/strspn.c @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2005 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strspn.c,v 1.5 2005/04/02 18:52:44 das Exp $"); + +#include +#include +#include + +#define IDX(c) ((u_char)(c) / LONG_BIT) +#define BIT(c) ((u_long)1 << ((u_char)(c) % LONG_BIT)) + +size_t +strspn(const char *s, const char *charset) +{ + /* + * NB: idx and bit are temporaries whose use causes gcc 3.4.2 to + * generate better code. Without them, gcc gets a little confused. + */ + const char *s1; + u_long bit; + u_long tbl[(UCHAR_MAX + 1) / LONG_BIT]; + int idx; + + if(*s == '\0') + return (0); + +#if LONG_BIT == 64 /* always better to unroll on 64-bit architectures */ + tbl[3] = tbl[2] = tbl[1] = tbl[0] = 0; +#else + for (idx = 0; idx < sizeof(tbl) / sizeof(tbl[0]); idx++) + tbl[idx] = 0; +#endif + for (; *charset != '\0'; charset++) { + idx = IDX(*charset); + bit = BIT(*charset); + tbl[idx] |= bit; + } + + for(s1 = s; ; s1++) { + idx = IDX(*s1); + bit = BIT(*s1); + if ((tbl[idx] & bit) == 0) + break; + } + return (s1 - s); +} diff --git a/string/FreeBSD/strstr.3 b/string/FreeBSD/strstr.3 new file mode 100644 index 0000000..a87044f --- /dev/null +++ b/string/FreeBSD/strstr.3 @@ -0,0 +1,158 @@ +.\" Copyright (c) 2001 Mike Barcroft +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strstr.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd October 11, 2001 +.Dt STRSTR 3 +.Os +.Sh NAME +.Nm strstr , strcasestr , strnstr +.Nd locate a substring in a string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft char * +.Fn strstr "const char *haystack" "const char *needle" +.Ft char * +.Fn strcasestr "const char *haystack" "const char *needle" +.Ft char * +.Fn strnstr "const char *haystack" "const char *needle" "size_t len" +.In string.h +.In xlocale.h +.Ft char * +.Fn strcasestr_l "const char *haystack" "const char *needle" "locale_t loc" +.Sh DESCRIPTION +The +.Fn strstr +function +locates the first occurrence of the null-terminated string +.Fa needle +in the null-terminated string +.Fa haystack . +.Pp +The +.Fn strcasestr +function is similar to +.Fn strstr , +but ignores the case of both strings. +.Pp +The +.Fn strnstr +function +locates the first occurrence of the null-terminated string +.Fa needle +in the string +.Fa haystack , +where not more than +.Fa len +characters are searched. +Characters that appear after a +.Ql \e0 +character are not searched. +Since the +.Fn strnstr +function is a +.Fx +specific API, it should only be used when portability is not a concern. +.Pp +While the +.Fn strcasestr +function uses the current locale, the +.Fn strcasestr_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +If +.Fa needle +is an empty string, +.Fa haystack +is returned; +if +.Fa needle +occurs nowhere in +.Fa haystack , +.Dv NULL +is returned; +otherwise a pointer to the first character of the first occurrence of +.Fa needle +is returned. +.Sh EXAMPLES +The following sets the pointer +.Va ptr +to the +.Qq Li Bar Baz +portion of +.Va largestring : +.Bd -literal -offset indent +const char *largestring = "Foo Bar Baz"; +const char *smallstring = "Bar"; +char *ptr; + +ptr = strstr(largestring, smallstring); +.Ed +.Pp +The following sets the pointer +.Va ptr +to +.Dv NULL , +because only the first 4 characters of +.Va largestring +are searched: +.Bd -literal -offset indent +const char *largestring = "Foo Bar Baz"; +const char *smallstring = "Bar"; +char *ptr; + +ptr = strnstr(largestring, smallstring, 4); +.Ed +.Sh SEE ALSO +.Xr memchr 3 , +.Xr memmem 3 , +.Xr strchr 3 , +.Xr strcspn 3 , +.Xr strpbrk 3 , +.Xr strrchr 3 , +.Xr strsep 3 , +.Xr strspn 3 , +.Xr strtok 3 , +.Xr wcsstr 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn strstr +function +conforms to +.St -isoC . diff --git a/string/FreeBSD/strtok.3 b/string/FreeBSD/strtok.3 new file mode 100644 index 0000000..25b9179 --- /dev/null +++ b/string/FreeBSD/strtok.3 @@ -0,0 +1,179 @@ +.\" Copyright (c) 1998 Softweyr LLC. All rights reserved. +.\" +.\" strtok_r, from Berkeley strtok +.\" Oct 13, 1998 by Wes Peters +.\" +.\" Copyright (c) 1988, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notices, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above +.\" copyright notices, this list of conditions and the following +.\" disclaimer in the documentation and/or other materials provided +.\" with the distribution. +.\" +.\" 4. Neither the name of Softweyr LLC, the University nor the names +.\" of its contributors may be used to endorse or promote products +.\" derived from this software without specific prior written +.\" permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY SOFTWEYR LLC, THE REGENTS AND +.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL SOFTWEYR LLC, THE REGENTS, OR +.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strtok.3 8.2 (Berkeley) 2/3/94 +.\" $FreeBSD: src/lib/libc/string/strtok.3,v 1.26 2007/12/12 18:33:06 wes Exp $ +.\" +.Dd November 27, 1998 +.Dt STRTOK 3 +.Os +.Sh NAME +.Nm strtok , strtok_r +.Nd string tokens +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft char * +.Fo strtok +.Fa "char *restrict str" +.Fa "const char *restrict sep" +.Fc +.Ft char * +.Fo strtok_r +.Fa "char *restrict str" +.Fa "const char *restrict sep" +.Fa "char **restrict lasts" +.Fc +.Sh DESCRIPTION +.Bf -symbolic +This interface is obsoleted by +.Xr strsep 3 . +.Ef +.Pp +The +.Fn strtok +function +is used to isolate sequential tokens in a null-terminated string, +.Fa str . +These tokens are separated in the string by at least one of the +characters in +.Fa sep . +The first time that +.Fn strtok +is called, +.Fa str +should be specified; subsequent calls, wishing to obtain further tokens +from the same string, should pass a null pointer instead. +The separator string, +.Fa sep , +must be supplied each time, and may change between calls. +.Pp +The implementation will behave as if no library function calls +.Fn strtok . +.Pp +The +.Fn strtok_r +function is a reentrant version of +.Fn strtok . +The context pointer +.Fa last +must be provided on each call. +The +.Fn strtok_r +function +may also be used to nest two parsing loops within one another, as +long as separate context pointers are used. +.Pp +The +.Fn strtok +and +.Fn strtok_r +functions +return a pointer to the beginning of each subsequent token in the string, +after replacing the token itself with a +.Dv NUL +character. +When no more tokens remain, a null pointer is returned. +.Sh EXAMPLES +The following uses +.Fn strtok_r +to parse two strings using separate contexts: +.Bd -literal +char test[80], blah[80]; +char *sep = "\e\e/:;=-"; +char *word, *phrase, *brkt, *brkb; + +strcpy(test, "This;is.a:test:of=the/string\e\etokenizer-function."); + +for (word = strtok_r(test, sep, &brkt); + word; + word = strtok_r(NULL, sep, &brkt)) +{ + strcpy(blah, "blah:blat:blab:blag"); + + for (phrase = strtok_r(blah, sep, &brkb); + phrase; + phrase = strtok_r(NULL, sep, &brkb)) + { + printf("So far we're at %s:%s\en", word, phrase); + } +} +.Ed +.Sh SEE ALSO +.Xr memchr 3 , +.Xr strchr 3 , +.Xr strcspn 3 , +.Xr strpbrk 3 , +.Xr strrchr 3 , +.Xr strsep 3 , +.Xr strspn 3 , +.Xr strstr 3 , +.Xr wcstok 3 +.Sh STANDARDS +The +.Fn strtok +function +conforms to +.St -isoC . +.Sh AUTHORS +.An Wes Peters , +Softweyr LLC: +.Aq wes@softweyr.com +.Pp +Based on the +.Fx 3.0 +implementation. +.Sh BUGS +The System V +.Fn strtok , +if handed a string containing only delimiter characters, +will not alter the next starting point, so that a call to +.Fn strtok +with a different (or empty) delimiter string +may return a +.Pf non- Dv NULL +value. +Since this implementation always alters the next starting point, +such a sequence of calls would always return +.Dv NULL . diff --git a/string/FreeBSD/strtok.c b/string/FreeBSD/strtok.c new file mode 100644 index 0000000..6fcd78e --- /dev/null +++ b/string/FreeBSD/strtok.c @@ -0,0 +1,136 @@ +/*- + * Copyright (c) 1998 Softweyr LLC. All rights reserved. + * + * strtok_r, from Berkeley strtok + * Oct 13, 1998 by Wes Peters + * + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notices, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notices, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY SOFTWEYR LLC, THE REGENTS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTWEYR LLC, THE + * REGENTS, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtok.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strtok.c,v 1.10 2007/12/12 18:33:06 wes Exp $"); + +#include +#ifdef DEBUG_STRTOK +#include +#endif +#include + +char *__strtok_r(char *, const char *, char **); + +__weak_reference(__strtok_r, strtok_r); + +char * +__strtok_r(char *s, const char *delim, char **last) +{ + char *spanp, *tok; + int c, sc; + + if (s == NULL && (s = *last) == NULL) + return (NULL); + + /* + * Skip (span) leading delimiters (s += strspn(s, delim), sort of). + */ +cont: + c = *s++; + for (spanp = (char *)delim; (sc = *spanp++) != 0;) { + if (c == sc) + goto cont; + } + + if (c == 0) { /* no non-delimiter characters */ + *last = NULL; + return (NULL); + } + tok = s - 1; + + /* + * Scan token (scan for delimiters: s += strcspn(s, delim), sort of). + * Note that delim must have one NUL; we stop if we see that, too. + */ + for (;;) { + c = *s++; + spanp = (char *)delim; + do { + if ((sc = *spanp++) == c) { + if (c == 0) + s = NULL; + else + s[-1] = '\0'; + *last = s; + return (tok); + } + } while (sc != 0); + } + /* NOTREACHED */ +} + +char * +strtok(char *s, const char *delim) +{ + static char *last; + + return (__strtok_r(s, delim, &last)); +} + +#ifdef DEBUG_STRTOK +/* + * Test the tokenizer. + */ +int +main(void) +{ + char blah[80], test[80]; + char *brkb, *brkt, *phrase, *sep, *word; + + sep = "\\/:;=-"; + phrase = "foo"; + + printf("String tokenizer test:\n"); + strcpy(test, "This;is.a:test:of=the/string\\tokenizer-function."); + for (word = strtok(test, sep); word; word = strtok(NULL, sep)) + printf("Next word is \"%s\".\n", word); + strcpy(test, "This;is.a:test:of=the/string\\tokenizer-function."); + + for (word = strtok_r(test, sep, &brkt); word; + word = strtok_r(NULL, sep, &brkt)) { + strcpy(blah, "blah:blat:blab:blag"); + + for (phrase = strtok_r(blah, sep, &brkb); phrase; + phrase = strtok_r(NULL, sep, &brkb)) + printf("So far we're at %s:%s\n", word, phrase); + } + + return (0); +} + +#endif /* DEBUG_STRTOK */ diff --git a/string/FreeBSD/strxfrm.3 b/string/FreeBSD/strxfrm.3 new file mode 100644 index 0000000..d6ded5b --- /dev/null +++ b/string/FreeBSD/strxfrm.3 @@ -0,0 +1,119 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strxfrm.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/strxfrm.3,v 1.18 2007/01/09 00:28:12 imp Exp $ +.\" +.Dd June 4, 1993 +.Dt STRXFRM 3 +.Os +.Sh NAME +.Nm strxfrm , +.Nm strxfrm_l +.Nd transform a string under locale +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft size_t +.Fo strxfrm +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fa "size_t n" +.Fc +.In string.h +.In xlocale.h +.Ft size_t +.Fo strxfrm_l +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn strxfrm +function transforms a null-terminated string pointed to by +.Fa s2 +according to the current locale collation if any, +then copies the transformed string +into +.Fa s1 . +Not more than +.Fa n +characters are copied into +.Fa s1 , +including the terminating null character added. +If +.Fa n +is set to 0 +(it helps to determine an actual size needed +for transformation), +.Fa s1 +is permitted to be a NULL pointer. +.Pp +Comparing two strings using +.Fn strcmp +after +.Fn strxfrm +is equal to comparing +two original strings with +.Fn strcoll . +.Pp +Although the +.Fn strxfrm +function uses the current locale, the +.Fn strxfrm_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +Upon successful completion, +.Fn strxfrm +returns the length of the transformed string not including +the terminating null character. +If this value is +.Fa n +or more, the contents of +.Fa s1 +are indeterminate. +.Sh SEE ALSO +.Xr setlocale 3 , +.Xr strcmp 3 , +.Xr strcoll 3 , +.Xr wcsxfrm 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn strxfrm +function +conforms to +.St -isoC . diff --git a/string/FreeBSD/strxfrm.c b/string/FreeBSD/strxfrm.c new file mode 100644 index 0000000..b1a70dd --- /dev/null +++ b/string/FreeBSD/strxfrm.c @@ -0,0 +1,145 @@ +/*- + * Copyright (c) 1995 Alex Tatmanjants + * at Electronni Visti IA, Kiev, Ukraine. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/strxfrm.c,v 1.17 2008/10/19 09:10:44 delphij Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "collate.h" + +/* + * In the non-POSIX case, we transform each character into a string of + * characters representing the character's priority. Since char is usually + * signed, we are limited by 7 bits per byte. To avoid zero, we need to add + * XFRM_OFFSET, so we can't use a full 7 bits. For simplicity, we choose 6 + * bits per byte. We choose 4 bytes per character as a good compromise + * between maximum coverage and minimum size. This gives 24 bits, or 16M + * priorities. So we choose COLLATE_MAX_PRIORITY to be (2^24 - 1). This + * this can be increased if more is needed. + */ + +#define XFRM_BYTES 4 +#define XFRM_OFFSET ('0') /* make all printable characters */ +#define XFRM_SHIFT 6 +#define XFRM_MASK ((1 << XFRM_SHIFT) - 1) + +static void +xfrm(unsigned char *p, int pri) +{ + + p[3] = (pri & XFRM_MASK) + XFRM_OFFSET; + pri >>= XFRM_SHIFT; + p[2] = (pri & XFRM_MASK) + XFRM_OFFSET; + pri >>= XFRM_SHIFT; + p[1] = (pri & XFRM_MASK) + XFRM_OFFSET; + pri >>= XFRM_SHIFT; + p[0] = (pri & XFRM_MASK) + XFRM_OFFSET; +} + +size_t +strxfrm_l(char * __restrict dest, const char * __restrict src, size_t len, + locale_t loc) +{ + size_t slen; + wchar_t *wcs, *xf[2]; + int sverrno; + + if (!*src && dest) { + if (len > 0) + *dest = '\0'; + return 0; + } + + NORMALIZE_LOCALE(loc); + if (loc->__collate_load_error || (wcs = __collate_mbstowcs(src, loc)) == NULL) + return strlcpy(dest, src, len); + + __collate_xfrm(wcs, xf, loc); + + slen = wcslen(xf[0]) * XFRM_BYTES; + if (xf[1]) + slen += (wcslen(xf[1]) + 1) * XFRM_BYTES; + if (len > 0) { + wchar_t *w = xf[0]; + int b = 0; + unsigned char buf[XFRM_BYTES]; + unsigned char *bp; + while (len > 1) { + if (!b) { + if (!*w) + break; + xfrm(bp = buf, *w++); + b = XFRM_BYTES; + } + *dest++ = *(char *)bp++; + b--; + len--; + } + if ((w = xf[1]) != NULL) { + xfrm(bp = buf, 0); + b = XFRM_BYTES; + while (len > 1) { + if (!b) + break; + *dest++ = *(char *)bp++; + b--; + len--; + } + b = 0; + while (len > 1) { + if (!b) { + if (!*w) + break; + xfrm(bp = buf, *w++); + b = XFRM_BYTES; + } + *dest++ = *(char *)bp++; + b--; + len--; + } + } + *dest = 0; + } + sverrno = errno; + free(wcs); + free(xf[0]); + free(xf[1]); + errno = sverrno; + + return slen; +} + +size_t +strxfrm(char * __restrict dest, const char * __restrict src, size_t len) +{ + return strxfrm_l(dest, src, len, __current_locale()); +} diff --git a/string/FreeBSD/swab.3 b/string/FreeBSD/swab.3 new file mode 100644 index 0000000..82468db --- /dev/null +++ b/string/FreeBSD/swab.3 @@ -0,0 +1,81 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)swab.3 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD: src/lib/libc/string/swab.3,v 1.10 2007/01/09 00:28:12 imp Exp $ +.\" +.Dd February 24, 2010 +.Dt SWAB 3 +.Os +.Sh NAME +.Nm swab +.Nd swap adjacent bytes +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft void +.Fo swab +.Fa "const void *restrict src" +.Fa "void *restrict dest" +.Fa "ssize_t nbytes" +.Fc +.Sh DESCRIPTION +The function +.Fn swab +copies +.Fa nbytes +bytes from the location referenced by +.Fa src +to the location referenced by +.Fa dest , +swapping adjacent bytes. +.Pp +The argument +.Fa nbytes +should be an even number. If +.Fa nbytes +is odd, +.Fn swab +copies and exchanges +.Fa nbytes +-1 bytes and the disposition of the last byte is unspecified. +If copying takes place between objects that overlap, +the behavior is undefined. If +.Fa nbytes +is negative, +.Fn swab +does nothing. +.Sh SEE ALSO +.Xr bzero 3 , +.Xr memset 3 , +.Xr compat 5 +.Sh HISTORY +A +.Fn swab +function appeared in +.At v7 . diff --git a/string/FreeBSD/swab.c b/string/FreeBSD/swab.c new file mode 100644 index 0000000..1d55327 --- /dev/null +++ b/string/FreeBSD/swab.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Jeffrey Mogul. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)swab.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/swab.c,v 1.7 2007/01/09 00:28:12 imp Exp $"); + +#include + +void +swab(const void * __restrict from, void * __restrict to, ssize_t len) +{ + unsigned long temp; + int n; + char *fp, *tp; + + if (len <= 0) + return; + n = len >> 1; + fp = (char *)from; + tp = (char *)to; +#define STEP temp = *fp++,*tp++ = *fp++,*tp++ = temp + /* round to multiple of 8 */ + for (; n & 0x7; --n) + STEP; + for (n >>= 3; n > 0; --n) { + STEP; STEP; STEP; STEP; + STEP; STEP; STEP; STEP; + } +} diff --git a/string/FreeBSD/timingsafe_bcmp.3 b/string/FreeBSD/timingsafe_bcmp.3 new file mode 100644 index 0000000..22a3961 --- /dev/null +++ b/string/FreeBSD/timingsafe_bcmp.3 @@ -0,0 +1,65 @@ +.\" $OpenBSD: timingsafe_bcmp.3,v 1.2 2014/06/21 20:22:15 tedu Exp $ +.\" +.\" Copyright (c) 2014 Google Inc. +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.Dd August 15, 2016 +.Dt TIMINGSAFE_BCMP 3 +.Os +.Sh NAME +.Nm timingsafe_bcmp +.Nd timing-safe byte sequence comparisons +.Sh SYNOPSIS +.In string.h +.Ft int +.Fn timingsafe_bcmp "const void *b1" "const void *b2" "size_t len" +.Sh DESCRIPTION +The +.Fn timingsafe_bcmp +function compares the first +.Fa len +bytes pointed to by +.Fa b1 +and +.Fa b2 . +.Pp +Additionally, the running time is independent of the byte sequences compared, +making it safe to use for comparing secret values such as cryptographic MACs. +In contrast, +.Xr bcmp 3 +and +.Xr memcmp 3 +may short-circuit after finding the first differing byte. +.Sh RETURN VALUES +The +.Fn timingsafe_bcmp +function returns 0 or not zero if the byte sequence pointed to by +.Fa b1 +compares equal to or not equal to (respectively) +the byte sequence pointed to by +.Fa b2 . +.Sh SEE ALSO +.Xr bcmp 3 +.Sh STANDARDS +The +.Fn timingsafe_bcmp +function is a non-standard extension. +.Sh HISTORY +The +.Fn timingsafe_bcmp +function first appeared in +.Ox 4.9 , +.Fx 12.0 , +and macOS 10.12.1. diff --git a/string/FreeBSD/timingsafe_bcmp.c b/string/FreeBSD/timingsafe_bcmp.c new file mode 100644 index 0000000..f47cf44 --- /dev/null +++ b/string/FreeBSD/timingsafe_bcmp.c @@ -0,0 +1,35 @@ +/* $OpenBSD: timingsafe_bcmp.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */ +/* + * Copyright (c) 2010 Damien Miller. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +int +timingsafe_bcmp(const void *b1, const void *b2, size_t n) +{ + const unsigned char *p1 = b1, *p2 = b2; + unsigned char ret = 0; + + for (; n > 0; n--) { + ret |= *p1++ ^ *p2++; + } + + /* map zero to zero and nonzero to one */ + return (ret + 0xff) >> 8; +} diff --git a/string/FreeBSD/wcpcpy.c b/string/FreeBSD/wcpcpy.c new file mode 100644 index 0000000..aff2bad --- /dev/null +++ b/string/FreeBSD/wcpcpy.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1999 + * David E. O'Brien + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcpy.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcpcpy.c,v 1.1 2009/03/04 06:01:27 das Exp $"); + +#include + +wchar_t * +wcpcpy(wchar_t * __restrict to, const wchar_t * __restrict from) +{ + + for (; (*to = *from); ++from, ++to); + return(to); +} diff --git a/string/FreeBSD/wcpncpy.c b/string/FreeBSD/wcpncpy.c new file mode 100644 index 0000000..625b531 --- /dev/null +++ b/string/FreeBSD/wcpncpy.c @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2009 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcpncpy.c,v 1.1 2009/03/04 06:01:27 das Exp $"); + +#include + +wchar_t * +wcpncpy(wchar_t * __restrict dst, const wchar_t * __restrict src, size_t n) +{ + + for (; n--; dst++, src++) { + if (!(*dst = *src)) { + wchar_t *ret = dst; + while (n--) + *++dst = L'\0'; + return (ret); + } + } + return (dst); +} diff --git a/string/FreeBSD/wcscasecmp.c b/string/FreeBSD/wcscasecmp.c new file mode 100644 index 0000000..f158b14 --- /dev/null +++ b/string/FreeBSD/wcscasecmp.c @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2009 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcscasecmp.c,v 1.1 2009/02/28 06:00:58 das Exp $"); + +#include "xlocale_private.h" + +#include +#include + +int +wcscasecmp_l(const wchar_t *s1, const wchar_t *s2, locale_t loc) +{ + wchar_t c1, c2; + + for (; *s1; s1++, s2++) { + c1 = towlower_l(*s1, loc); + c2 = towlower_l(*s2, loc); + if (c1 != c2) + return ((int)c1 - c2); + } + return (-*s2); +} + +int +wcscasecmp(const wchar_t *s1, const wchar_t *s2) { + return wcscasecmp_l(s1, s2, __current_locale()); +} + diff --git a/string/FreeBSD/wcscat.c b/string/FreeBSD/wcscat.c new file mode 100644 index 0000000..00cd361 --- /dev/null +++ b/string/FreeBSD/wcscat.c @@ -0,0 +1,51 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wcscat.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wcscat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcscat.c,v 1.9 2009/02/03 17:58:20 danger Exp $"); + +#include + +wchar_t * +wcscat(wchar_t * __restrict s1, const wchar_t * __restrict s2) +{ + wchar_t *cp; + + cp = s1; + while (*cp != L'\0') + cp++; + while ((*cp++ = *s2++) != L'\0') + ; + + return (s1); +} diff --git a/string/FreeBSD/wcschr.c b/string/FreeBSD/wcschr.c new file mode 100644 index 0000000..0fae132 --- /dev/null +++ b/string/FreeBSD/wcschr.c @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcschr.c,v 1.7 2002/10/23 10:47:47 tjr Exp $"); + +#include + +wchar_t * +wcschr(const wchar_t *s, wchar_t c) +{ + + while (*s != c && *s != L'\0') + s++; + if (*s == c) + return ((wchar_t *)s); + return (NULL); +} diff --git a/string/FreeBSD/wcscmp.c b/string/FreeBSD/wcscmp.c new file mode 100644 index 0000000..8d51347 --- /dev/null +++ b/string/FreeBSD/wcscmp.c @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcmp.c 8.1 (Berkeley) 6/4/93"; +#if 0 +__RCSID("$NetBSD: wcscmp.c,v 1.3 2001/01/05 12:13:12 itojun Exp $"); +#endif +#endif /* LIBC_SCCS and not lint */ +__FBSDID("$FreeBSD: src/lib/libc/string/wcscmp.c,v 1.9 2009/02/03 17:58:20 danger Exp $"); + +#include + +/* + * Compare strings. + */ +int +wcscmp(const wchar_t *s1, const wchar_t *s2) +{ + + while (*s1 == *s2++) + if (*s1++ == '\0') + return (0); + /* XXX assumes wchar_t = int */ + return (*(const unsigned int *)s1 - *(const unsigned int *)--s2); +} diff --git a/string/FreeBSD/wcscoll.3 b/string/FreeBSD/wcscoll.3 new file mode 100644 index 0000000..df534cb --- /dev/null +++ b/string/FreeBSD/wcscoll.3 @@ -0,0 +1,129 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strcoll.3 8.1 (Berkeley) 6/4/93 +.\" FreeBSD: src/lib/libc/string/strcoll.3,v 1.11 2001/10/01 16:09:00 ru Exp +.\" $FreeBSD: src/lib/libc/string/wcscoll.3,v 1.3 2007/01/09 00:28:12 imp Exp $ +.\" +.Dd October 4, 2002 +.Dt WCSCOLL 3 +.Os +.Sh NAME +.Nm wcscoll , +.Nm wcscoll_l +.Nd compare wide strings according to current collation +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft int +.Fo wcscoll +.Fa "const wchar_t *ws1" +.Fa "const wchar_t *ws2" +.Fc +.In wchar.h +.In xlocale.h +.Ft int +.Fo wcscoll_l +.Fa "const wchar_t *ws1" +.Fa "const wchar_t *ws2" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcscoll +function compares the null-terminated strings +.Fa ws1 +and +.Fa ws2 , +according to the current locale's collation order. +In the +.Dq Li C +locale, +.Fn wcscoll +is equivalent to +.Fn wcscmp . +.Pp +Although the +.Fn wcscoll +function uses the current locale, the +.Fn wcscoll_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn wcscoll +function +returns an integer greater than, equal to, or less than 0, +if +.Fa ws1 +is greater than, equal to, or less than +.Fa ws2 . +.Pp +No return value is reserved to indicate errors; +callers should set +.Va errno +to 0 before calling +.Fn wcscoll . +If it is non-zero upon return from +.Fn wcscoll , +an error has occurred. +.Sh ERRORS +The +.Fn wcscoll +function will fail if: +.Bl -tag -width Er +.It Bq Er EILSEQ +An invalid wide character code was specified. +.It Bq Er ENOMEM +Cannot allocate enough memory for temporary buffers. +.El +.Sh SEE ALSO +.Xr setlocale 3 , +.Xr strcoll 3 , +.Xr wcscmp 3 , +.Xr wcsxfrm 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn wcscoll +function +conforms to +.St -isoC-99 . +.Sh BUGS +The current implementation of +.Fn wcscoll +only works in single-byte +.Dv LC_CTYPE +locales, and falls back to using +.Fn wcscmp +in locales with extended character sets. diff --git a/string/FreeBSD/wcscoll.c b/string/FreeBSD/wcscoll.c new file mode 100644 index 0000000..68d9029 --- /dev/null +++ b/string/FreeBSD/wcscoll.c @@ -0,0 +1,247 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcscoll.c,v 1.3 2004/04/07 09:47:56 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "collate.h" + +#define NOTFORWARD (DIRECTIVE_BACKWARD | DIRECTIVE_POSITION) + +int +wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t loc) +{ + int sverrno; + int len, len2, prim, prim2, sec, sec2, ret, ret2; + const wchar_t *t, *t2; + wchar_t *tt = NULL, *tt2 = NULL; + wchar_t *tr = NULL, *tr2 = NULL; + struct __collate_st_info *info; + + NORMALIZE_LOCALE(loc); + if (loc->__collate_load_error) + /* + * Locale has no special collating order or could not be + * loaded, do a fast binary comparison. + */ + return (wcscmp(ws1, ws2)); + + info = &loc->__lc_collate->__info; + len = len2 = 1; + ret = ret2 = 0; + + if ((info->directive[0] & NOTFORWARD) || + (info->directive[1] & NOTFORWARD) || + (!(info->flags && COLLATE_SUBST_DUP) && + (info->subst_count[0] > 0 || info->subst_count[1] > 0))) { + int direc, pass; + for(pass = 0; pass < info->directive_count; pass++) { + direc = info->directive[pass]; + if (pass == 0 || !(info->flags & COLLATE_SUBST_DUP)) { + free(tt); + tt = __collate_substitute(ws1, pass, loc); + free(tt2); + tt2 = tt ? __collate_substitute(ws2, pass, loc) : NULL; + } + if (direc & DIRECTIVE_BACKWARD) { + wchar_t *bp, *fp, c; + tr = __collate_wcsdup(tt ? tt : ws1); + bp = tr; + fp = tr + wcslen(tr) - 1; + while(bp < fp) { + c = *bp; + *bp++ = *fp; + *fp-- = c; + } + tr2 = __collate_wcsdup(tt2 ? tt2 : ws2); + bp = tr2; + fp = tr2 + wcslen(tr2) - 1; + while(bp < fp) { + c = *bp; + *bp++ = *fp; + *fp-- = c; + } + t = (const wchar_t *)tr; + t2 = (const wchar_t *)tr2; + } else if (tt) { + t = (const wchar_t *)tt; + t2 = (const wchar_t *)tt2; + } else { + t = (const wchar_t *)ws1; + t2 = (const wchar_t *)ws2; + } + if(direc & DIRECTIVE_POSITION) { + while(*t && *t2) { + prim = prim2 = 0; + __collate_lookup_which(t, &len, &prim, pass, loc); + if (prim <= 0) { + if (prim < 0) { + errno = EINVAL; + ret = -1; + goto end; + } + prim = COLLATE_MAX_PRIORITY; + } + __collate_lookup_which(t2, &len2, &prim2, pass, loc); + if (prim2 <= 0) { + if (prim2 < 0) { + errno = EINVAL; + ret = -1; + goto end; + } + prim2 = COLLATE_MAX_PRIORITY; + } + if(prim != prim2) { + ret = prim - prim2; + goto end; + } + t += len; + t2 += len2; + } + } else { + while(*t && *t2) { + prim = prim2 = 0; + while(*t) { + __collate_lookup_which(t, &len, &prim, pass, loc); + if(prim > 0) + break; + if (prim < 0) { + errno = EINVAL; + ret = -1; + goto end; + } + t += len; + } + while(*t2) { + __collate_lookup_which(t2, &len2, &prim2, pass, loc); + if(prim2 > 0) + break; + if (prim2 < 0) { + errno = EINVAL; + ret = -1; + goto end; + } + t2 += len2; + } + if(!prim || !prim2) + break; + if(prim != prim2) { + ret = prim - prim2; + goto end; + } + t += len; + t2 += len2; + } + } + if(!*t) { + if(*t2) { + ret = -(int)*t2; + goto end; + } + } else { + ret = *t; + goto end; + } + } + ret = 0; + goto end; + } + + /* optimized common case: order_start forward;forward and duplicate + * (or no) substitute tables */ + tt = __collate_substitute(ws1, 0, loc); + if (tt == NULL) { + tt2 = NULL; + t = (const wchar_t *)ws1; + t2 = (const wchar_t *)ws2; + } else { + tt2 = __collate_substitute(ws2, 0, loc); + t = (const wchar_t *)tt; + t2 = (const wchar_t *)tt2; + } + while(*t && *t2) { + prim = prim2 = 0; + while(*t) { + __collate_lookup_l(t, &len, &prim, &sec, loc); + if (prim > 0) + break; + if (prim < 0) { + errno = EINVAL; + ret = -1; + goto end; + } + t += len; + } + while(*t2) { + __collate_lookup_l(t2, &len2, &prim2, &sec2, loc); + if (prim2 > 0) + break; + if (prim2 < 0) { + errno = EINVAL; + ret = -1; + goto end; + } + t2 += len2; + } + if(!prim || !prim2) + break; + if(prim != prim2) { + ret = prim - prim2; + goto end; + } + if(!ret2) + ret2 = sec - sec2; + t += len; + t2 += len2; + } + if(!*t && *t2) + ret = -(int)*t2; + else if(*t && !*t2) + ret = *t; + else if(!*t && !*t2) + ret = ret2; + end: + sverrno = errno; + free(tt); + free(tt2); + free(tr); + free(tr2); + errno = sverrno; + + return ret; +} + +int +wcscoll(const wchar_t *ws1, const wchar_t *ws2) +{ + return wcscoll_l(ws1, ws2, __current_locale()); +} diff --git a/string/FreeBSD/wcscpy.c b/string/FreeBSD/wcscpy.c new file mode 100644 index 0000000..d2f929a --- /dev/null +++ b/string/FreeBSD/wcscpy.c @@ -0,0 +1,49 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wcscpy.c,v 1.2 2000/12/21 04:51:09 itojun Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcscpy.c,v 1.9 2009/02/03 17:58:20 danger Exp $"); + +#include + +wchar_t * +wcscpy(wchar_t * __restrict s1, const wchar_t * __restrict s2) +{ + wchar_t *cp; + + cp = s1; + while ((*cp++ = *s2++) != L'\0') + ; + + return (s1); +} diff --git a/string/FreeBSD/wcscspn.c b/string/FreeBSD/wcscspn.c new file mode 100644 index 0000000..77dfa10 --- /dev/null +++ b/string/FreeBSD/wcscspn.c @@ -0,0 +1,58 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wcscspn.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wcscspn.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcscspn.c,v 1.7 2009/02/03 17:58:20 danger Exp $"); + +#include + +size_t +wcscspn(const wchar_t *s, const wchar_t *set) +{ + const wchar_t *p; + const wchar_t *q; + + p = s; + while (*p) { + q = set; + while (*q) { + if (*p == *q) + goto done; + q++; + } + p++; + } + +done: + return (p - s); +} diff --git a/string/FreeBSD/wcsdup.c b/string/FreeBSD/wcsdup.c new file mode 100644 index 0000000..4379da1 --- /dev/null +++ b/string/FreeBSD/wcsdup.c @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2005 Tim J. Robbins. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcsdup.c,v 1.1 2005/08/13 05:54:33 tjr Exp $"); + +#include +#include + +wchar_t * +wcsdup(const wchar_t *s) +{ + wchar_t *copy; + size_t len; + + len = wcslen(s) + 1; + if ((copy = malloc(len * sizeof(wchar_t))) == NULL) + return (NULL); + return (wmemcpy(copy, s, len)); +} diff --git a/string/FreeBSD/wcslcat.c b/string/FreeBSD/wcslcat.c new file mode 100644 index 0000000..7149a53 --- /dev/null +++ b/string/FreeBSD/wcslcat.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 1998 Todd C. Miller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * from OpenBSD: strlcat.c,v 1.3 2000/11/24 11:10:02 itojun Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wcslcat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcslcat.c,v 1.7 2009/02/03 17:58:20 danger Exp $"); + +#include +#include + +/* + * Appends src to string dst of size siz (unlike wcsncat, siz is the + * full size of dst, not space left). At most siz-1 characters + * will be copied. Always NUL terminates (unless siz == 0). + * Returns wcslen(initial dst) + wcslen(src); if retval >= siz, + * truncation occurred. + */ +size_t +wcslcat(wchar_t *dst, const wchar_t *src, size_t siz) +{ + wchar_t *d = dst; + const wchar_t *s = src; + size_t n = siz; + size_t dlen; + + /* Find the end of dst and adjust bytes left but don't go past end */ + while (*d != '\0' && n-- != 0) + d++; + dlen = d - dst; + n = siz - dlen; + + if (n == 0) + return(dlen + wcslen(s)); + while (*s != '\0') { + if (n != 1) { + *d++ = *s; + n--; + } + s++; + } + *d = '\0'; + + return(dlen + (s - src)); /* count does not include NUL */ +} diff --git a/string/FreeBSD/wcslcpy.c b/string/FreeBSD/wcslcpy.c new file mode 100644 index 0000000..d0ee113 --- /dev/null +++ b/string/FreeBSD/wcslcpy.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 1998 Todd C. Miller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wcslcpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcslcpy.c,v 1.7 2009/02/03 17:58:20 danger Exp $"); + +#include +#include + +/* + * Copy src to string dst of size siz. At most siz-1 characters + * will be copied. Always NUL terminates (unless siz == 0). + * Returns wcslen(src); if retval >= siz, truncation occurred. + */ +size_t +wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz) +{ + wchar_t *d = dst; + const wchar_t *s = src; + size_t n = siz; + + /* Copy as many bytes as will fit */ + if (n != 0 && --n != 0) { + do { + if ((*d++ = *s++) == 0) + break; + } while (--n != 0); + } + + /* Not enough room in dst, add NUL and traverse rest of src */ + if (n == 0) { + if (siz != 0) + *d = '\0'; /* NUL-terminate dst */ + while (*s++) + ; + } + + return(s - src - 1); /* count does not include NUL */ +} diff --git a/string/FreeBSD/wcslen.c b/string/FreeBSD/wcslen.c new file mode 100644 index 0000000..cff35ad --- /dev/null +++ b/string/FreeBSD/wcslen.c @@ -0,0 +1,49 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wcslen.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wcslen.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcslen.c,v 1.7 2009/02/03 17:58:20 danger Exp $"); + +#include + +size_t +wcslen(const wchar_t *s) +{ + const wchar_t *p; + + p = s; + while (*p) + p++; + + return p - s; +} diff --git a/string/FreeBSD/wcsncasecmp.c b/string/FreeBSD/wcsncasecmp.c new file mode 100644 index 0000000..167fac1 --- /dev/null +++ b/string/FreeBSD/wcsncasecmp.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2009 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcsncasecmp.c,v 1.1 2009/02/28 06:00:58 das Exp $"); + +#include "xlocale_private.h" + +#include +#include + +int +wcsncasecmp_l(const wchar_t *s1, const wchar_t *s2, size_t n, locale_t loc) +{ + wchar_t c1, c2; + + if (n == 0) + return (0); + for (; *s1; s1++, s2++) { + c1 = towlower_l(*s1, loc); + c2 = towlower_l(*s2, loc); + if (c1 != c2) + return ((int)c1 - c2); + if (--n == 0) + return (0); + } + return (-*s2); +} + +int +wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n) { + return wcsncasecmp_l(s1, s2, n, __current_locale()); +} + diff --git a/string/FreeBSD/wcsncat.c b/string/FreeBSD/wcsncat.c new file mode 100644 index 0000000..1a907da --- /dev/null +++ b/string/FreeBSD/wcsncat.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wcsncat.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wcsncat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcsncat.c,v 1.8 2009/02/03 17:58:20 danger Exp $"); + +#include + +wchar_t * +wcsncat(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n) +{ + wchar_t *p; + wchar_t *q; + const wchar_t *r; + + p = s1; + while (*p) + p++; + q = p; + r = s2; + while (*r && n) { + *q++ = *r++; + n--; + } + *q = '\0'; + return s1; +} diff --git a/string/FreeBSD/wcsncmp.c b/string/FreeBSD/wcsncmp.c new file mode 100644 index 0000000..2ef778c --- /dev/null +++ b/string/FreeBSD/wcsncmp.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strncmp.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: wcsncmp.c,v 1.3 2001/01/05 12:13:13 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcsncmp.c,v 1.9 2009/02/03 17:58:20 danger Exp $"); + +#include + +int +wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n) +{ + + if (n == 0) + return (0); + do { + if (*s1 != *s2++) { + /* XXX assumes wchar_t = int */ + return (*(const unsigned int *)s1 - + *(const unsigned int *)--s2); + } + if (*s1++ == 0) + break; + } while (--n != 0); + return (0); +} diff --git a/string/FreeBSD/wcsncpy.c b/string/FreeBSD/wcsncpy.c new file mode 100644 index 0000000..8c64d59 --- /dev/null +++ b/string/FreeBSD/wcsncpy.c @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strncpy.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#endif +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcsncpy.c,v 1.10 2007/01/09 00:28:12 imp Exp $"); + +#include + +/* + * Copy src to dst, truncating or null-padding to always copy n bytes. + * Return dst. + */ +wchar_t * +wcsncpy(wchar_t * __restrict dst, const wchar_t * __restrict src, size_t n) +{ + if (n != 0) { + wchar_t *d = dst; + const wchar_t *s = src; + + do { + if ((*d++ = *s++) == L'\0') { + /* NUL pad the remaining n-1 bytes */ + while (--n != 0) + *d++ = L'\0'; + break; + } + } while (--n != 0); + } + return (dst); +} diff --git a/string/FreeBSD/wcsnlen.c b/string/FreeBSD/wcsnlen.c new file mode 100644 index 0000000..2cf513e --- /dev/null +++ b/string/FreeBSD/wcsnlen.c @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2009 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcsnlen.c,v 1.1 2009/02/28 06:00:58 das Exp $"); + +#include + +size_t +wcsnlen(const wchar_t *s, size_t maxlen) +{ + size_t len; + + for (len = 0; len < maxlen; len++, s++) { + if (!*s) + break; + } + return (len); +} diff --git a/string/FreeBSD/wcspbrk.c b/string/FreeBSD/wcspbrk.c new file mode 100644 index 0000000..ef12064 --- /dev/null +++ b/string/FreeBSD/wcspbrk.c @@ -0,0 +1,58 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wcspbrk.c,v 1.2 2000/12/21 05:07:25 itojun Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wcspbrk.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcspbrk.c,v 1.7 2009/02/03 17:58:20 danger Exp $"); + +#include + +wchar_t * +wcspbrk(const wchar_t *s, const wchar_t *set) +{ + const wchar_t *p; + const wchar_t *q; + + p = s; + while (*p) { + q = set; + while (*q) { + if (*p == *q) { + /* LINTED interface specification */ + return (wchar_t *)p; + } + q++; + } + p++; + } + return NULL; +} diff --git a/string/FreeBSD/wcsrchr.c b/string/FreeBSD/wcsrchr.c new file mode 100644 index 0000000..093dd08 --- /dev/null +++ b/string/FreeBSD/wcsrchr.c @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcsrchr.c,v 1.7 2002/10/23 10:52:04 tjr Exp $"); + +#include + +wchar_t * +wcsrchr(const wchar_t *s, wchar_t c) +{ + const wchar_t *last; + + last = NULL; + for (;;) { + if (*s == c) + last = s; + if (*s == L'\0') + break; + s++; + } + + return ((wchar_t *)last); +} diff --git a/string/FreeBSD/wcsspn.c b/string/FreeBSD/wcsspn.c new file mode 100644 index 0000000..ff4dbfd --- /dev/null +++ b/string/FreeBSD/wcsspn.c @@ -0,0 +1,60 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wcsspn.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wcsspn.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcsspn.c,v 1.8 2009/02/03 17:58:20 danger Exp $"); + +#include + +size_t +wcsspn(const wchar_t *s, const wchar_t *set) +{ + const wchar_t *p; + const wchar_t *q; + + p = s; + while (*p) { + q = set; + while (*q) { + if (*p == *q) + break; + q++; + } + if (!*q) + goto done; + p++; + } + +done: + return (p - s); +} diff --git a/string/FreeBSD/wcsstr.c b/string/FreeBSD/wcsstr.c new file mode 100644 index 0000000..93cb149 --- /dev/null +++ b/string/FreeBSD/wcsstr.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strstr.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ +#endif +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcsstr.c,v 1.10 2009/02/03 17:58:20 danger Exp $"); + +#include + +/* + * Find the first occurrence of find in s. + */ +wchar_t * +wcsstr(const wchar_t * __restrict s, const wchar_t * __restrict find) +{ + wchar_t c, sc; + size_t len; + + if ((c = *find++) != L'\0') { + len = wcslen(find); + do { + do { + if ((sc = *s++) == L'\0') + return (NULL); + } while (sc != c); + } while (wcsncmp(s, find, len) != 0); + s--; + } + return ((wchar_t *)s); +} diff --git a/string/FreeBSD/wcstok.3 b/string/FreeBSD/wcstok.3 new file mode 100644 index 0000000..2b8de3f --- /dev/null +++ b/string/FreeBSD/wcstok.3 @@ -0,0 +1,137 @@ +.\" Copyright (c) 1998 Softweyr LLC. All rights reserved. +.\" +.\" strtok_r, from Berkeley strtok +.\" Oct 13, 1998 by Wes Peters +.\" +.\" Copyright (c) 1988, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notices, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above +.\" copyright notices, this list of conditions and the following +.\" disclaimer in the documentation and/or other materials provided +.\" with the distribution. +.\" +.\" 3. All advertising materials mentioning features or use of this +.\" software must display the following acknowledgement: +.\" +.\" This product includes software developed by Softweyr LLC, the +.\" University of California, Berkeley, and its contributors. +.\" +.\" 4. Neither the name of Softweyr LLC, the University nor the names +.\" of its contributors may be used to endorse or promote products +.\" derived from this software without specific prior written +.\" permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY SOFTWEYR LLC, THE REGENTS AND +.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL SOFTWEYR LLC, THE REGENTS, OR +.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/string/wcstok.3,v 1.4 2002/10/15 09:49:54 tjr Exp $ +.\" +.Dd October 3, 2002 +.Dt WCSTOK 3 +.Os +.Sh NAME +.Nm wcstok +.Nd split wide-character string into tokens +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft wchar_t * +.Fo wcstok +.Fa "wchar_t *restrict ws1" +.Fa "const wchar_t *restrict ws2" +.Fa "wchar_t **restrict ptr" +.Fc +.Sh DESCRIPTION +The +.Fn wcstok +function +is used to isolate sequential tokens in a null-terminated wide character +string, +.Fa ws1 . +These tokens are separated in the string by at least one of the +characters in +.Fa ws2 . +The first time that +.Fn wcstok +is called, +.Fa ws1 +should be specified; subsequent calls, wishing to obtain further tokens +from the same string, should pass a null pointer instead. +The separator string, +.Fa ws2 , +must be supplied each time, and may change between calls. +The context pointer, +.Fa ptr , +must be provided on each call. +.Pp +The +.Fn wcstok +function is the wide character counterpart of the +.Fn strtok_r +function. +.Sh RETURN VALUES +The +.Fn wcstok +function +returns a pointer to the beginning of each subsequent token in the string, +after replacing the token itself with a null wide character (L'\e0'). +When no more tokens remain, a null pointer is returned. +.Sh EXAMPLES +The following code fragment splits a wide character string on +.Tn ASCII +space, tab, and newline characters, +writing the resulting tokens to standard output: +.Bd -literal -offset indent +const wchar_t *seps = L" \et\en"; +wchar_t *last, *tok, text[] = L" \enone\ettwo\et\etthree \en"; + +for (tok = wcstok(text, seps, &last); tok != NULL; + tok = wcstok(NULL, seps, &last)) + wprintf(L"%ls\en", tok); +.Ed +.Sh COMPATIBILITY +Some early implementations of +.Fn wcstok +omit the +context pointer argument, +.Fa ptr , +and maintain state across calls in a static variable like +.Fn strtok +does. +.Sh SEE ALSO +.Xr strtok 3 , +.Xr wcschr 3 , +.Xr wcscspn 3 , +.Xr wcspbrk 3 , +.Xr wcsrchr 3 , +.Xr wcsspn 3 +.Sh STANDARDS +The +.Fn wcstok +function +conforms to +.St -isoC-99 . diff --git a/string/FreeBSD/wcstok.c b/string/FreeBSD/wcstok.c new file mode 100644 index 0000000..2258716 --- /dev/null +++ b/string/FreeBSD/wcstok.c @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 1998 Softweyr LLC. All rights reserved. + * + * strtok_r, from Berkeley strtok + * Oct 13, 1998 by Wes Peters + * + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notices, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notices, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY SOFTWEYR LLC, THE REGENTS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTWEYR LLC, THE + * REGENTS, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcstok.c,v 1.3 2007/12/12 18:33:06 wes Exp $"); + +#include + +wchar_t * +wcstok(wchar_t * __restrict s, const wchar_t * __restrict delim, + wchar_t ** __restrict last) +{ + const wchar_t *spanp; + wchar_t *tok; + wchar_t c, sc; + + if (s == NULL && (s = *last) == NULL) + return (NULL); + + /* + * Skip (span) leading delimiters (s += wcsspn(s, delim), sort of). + */ +cont: + c = *s++; + for (spanp = delim; (sc = *spanp++) != L'\0';) { + if (c == sc) + goto cont; + } + + if (c == L'\0') { /* no non-delimiter characters */ + *last = NULL; + return (NULL); + } + tok = s - 1; + + /* + * Scan token (scan for delimiters: s += wcscspn(s, delim), sort of). + * Note that delim must have one NUL; we stop if we see that, too. + */ + for (;;) { + c = *s++; + spanp = delim; + do { + if ((sc = *spanp++) == c) { + if (c == L'\0') + s = NULL; + else + s[-1] = L'\0'; + *last = s; + return (tok); + } + } while (sc != L'\0'); + } + /* NOTREACHED */ +} diff --git a/string/FreeBSD/wcswidth.3 b/string/FreeBSD/wcswidth.3 new file mode 100644 index 0000000..07eb058 --- /dev/null +++ b/string/FreeBSD/wcswidth.3 @@ -0,0 +1,83 @@ +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc/string/wcswidth.3,v 1.2 2002/12/09 14:04:05 ru Exp $ +.\" +.Dd August 20, 2002 +.Dt WCSWIDTH 3 +.Os +.Sh NAME +.Nm wcswidth , +.Nm wcswidth_l +.Nd "number of column positions in wide-character string" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft int +.Fo wcswidth +.Fa "const wchar_t *pwcs" +.Fa "size_t n" +.Fc +.In wchar.h +.In xlocale.h +.Ft int +.Fo wcswidth_l +.Fa "const wchar_t *pwcs" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcswidth +function determines the number of column positions required for the first +.Fa n +characters of +.Fa pwcs , +or until a null wide character (L'\e0') is encountered. +.Pp +Although the +.Fn wcswidth +function uses the current locale, the +.Fn wcswidth_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +The +.Fn wcswidth +function returns 0 if +.Fa pwcs +is an empty string (L""), +\-1 if a non-printing wide character is encountered; +otherwise, it returns the number of column positions occupied. +.Sh SEE ALSO +.Xr iswprint 3 , +.Xr wcwidth 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn wcswidth +function conforms to +.St -p1003.1-2001 . diff --git a/string/FreeBSD/wcswidth.c b/string/FreeBSD/wcswidth.c new file mode 100644 index 0000000..447c8e5 --- /dev/null +++ b/string/FreeBSD/wcswidth.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libc/string/wcswidth.c,v 1.7 2007/01/09 00:28:12 imp Exp $"); + +#include "xlocale_private.h" + +#include + +int +wcswidth_l(const wchar_t *pwcs, size_t n, locale_t loc) +{ + wchar_t wc; + int len, l; + + NORMALIZE_LOCALE(loc); + len = 0; + while (n-- > 0 && (wc = *pwcs++) != L'\0') { + if ((l = wcwidth_l(wc, loc)) < 0) + return (-1); + len += l; + } + return (len); +} + + +int +wcswidth(const wchar_t *pwcs, size_t n) +{ + return wcswidth_l(pwcs, n, __current_locale()); +} + diff --git a/string/FreeBSD/wcsxfrm.3 b/string/FreeBSD/wcsxfrm.3 new file mode 100644 index 0000000..038c7c7 --- /dev/null +++ b/string/FreeBSD/wcsxfrm.3 @@ -0,0 +1,144 @@ +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)strxfrm.3 8.1 (Berkeley) 6/4/93 +.\" FreeBSD: src/lib/libc/string/strxfrm.3,v 1.16 2002/09/06 11:24:06 tjr Exp +.\" $FreeBSD: src/lib/libc/string/wcsxfrm.3,v 1.3 2007/01/09 00:28:12 imp Exp $ +.\" +.Dd October 4, 2002 +.Dt WCSXFRM 3 +.Os +.Sh NAME +.Nm wcsxfrm , +.Nm wcsxfrm_l +.Nd transform a wide string under locale +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft size_t +.Fo wcsxfrm +.Fa "wchar_t *restrict ws1" +.Fa "const wchar_t *restrict ws2" +.Fa "size_t n" +.Fc +.In wchar.h +.In xlocale.h +.Ft size_t +.Fo wcsxfrm_l +.Fa "wchar_t *restrict ws1" +.Fa "const wchar_t *restrict ws2" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcsxfrm +function transforms a null-terminated wide character string pointed to by +.Fa ws2 , +according to the current locale's collation order, +then copies the transformed string into +.Fa ws1 . +No more than +.Fa n +wide characters are copied into +.Fa ws1 , +including the terminating null character. +If +.Fa n +is set to 0 +(it helps to determine an actual size needed +for transformation), +.Fa ws1 +is permitted to be a +.Dv NULL +pointer. +.Pp +Comparing two strings using +.Fn wcscmp +after +.Fn wcsxfrm +is equivalent to comparing +two original strings with +.Fn wcscoll . +.Pp +Although the +.Fn wcsxfrm +function uses the current locale, the +.Fn wcsxfrm_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Sh RETURN VALUES +Upon successful completion, +.Fn wcsxfrm +returns the length of the transformed string not including +the terminating null character. +If this value is +.Fa n +or more, the contents of +.Fa ws1 +are indeterminate. +.Sh SEE ALSO +.Xr setlocale 3 , +.Xr strxfrm 3 , +.Xr wcscmp 3 , +.Xr wcscoll 3 , +.Xr xlocale 3 +.Sh STANDARDS +The +.Fn wcsxfrm +function +conforms to +.St -isoC-99 . +.Sh BUGS +The current implementation of +.Fn wcsxfrm +only works in single-byte +.Dv LC_CTYPE +locales, and falls back to using +.Fn wcsncpy +in locales with extended character sets. +.Pp +Comparing two strings using +.Fn wcscmp +after +.Fn wcsxfrm +is +.Em not +always equivalent to comparison with +.Fn wcscoll ; +.Fn wcsxfrm +only stores information about primary collation weights into +.Fa ws1 , +whereas +.Fn wcscoll +compares characters using both primary and secondary weights. diff --git a/string/FreeBSD/wcsxfrm.c b/string/FreeBSD/wcsxfrm.c new file mode 100644 index 0000000..eae9360 --- /dev/null +++ b/string/FreeBSD/wcsxfrm.c @@ -0,0 +1,109 @@ +/*- + * Copyright (c) 1995 Alex Tatmanjants + * at Electronni Visti IA, Kiev, Ukraine. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#if 0 +__FBSDID("FreeBSD: src/lib/libc/string/strxfrm.c,v 1.15 2002/09/06 11:24:06 tjr Exp "); +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wcsxfrm.c,v 1.3 2004/04/07 09:47:56 tjr Exp $"); + +#include "xlocale_private.h" + +#include +#include +#include +#include +#include "collate.h" + +#define WCS_XFRM_OFFSET 1 + +size_t +wcsxfrm_l(wchar_t * __restrict dest, const wchar_t * __restrict src, size_t len, + locale_t loc) +{ + size_t slen; + wchar_t *xf[2]; + int sverrno; + + if (*src == L'\0') { + if (len != 0) + *dest = L'\0'; + return (0); + } + + NORMALIZE_LOCALE(loc); + if (loc->__collate_load_error) { + slen = wcslen(src); + if (len > 0) { + if (slen < len) + wcscpy(dest, src); + else { + wcsncpy(dest, src, len - 1); + dest[len - 1] = L'\0'; + } + } + return (slen); + } + + __collate_xfrm(src, xf, loc); + + slen = wcslen(xf[0]); + if (xf[1]) + slen += wcslen(xf[1]) + 1; + if (len > 0) { + wchar_t *w = xf[0]; + while (len > 1) { + if (!*w) + break; + *dest++ = *w++ + WCS_XFRM_OFFSET; + len--; + } + if ((w = xf[1]) != NULL) { + if (len > 1) + *dest++ = WCS_XFRM_OFFSET; + while (len > 1) { + if (!*w) + break; + *dest++ = *w++ + WCS_XFRM_OFFSET; + len--; + } + } + *dest = 0; + } + sverrno = errno; + free(xf[0]); + free(xf[1]); + errno = sverrno; + + return (slen); +} + +size_t +wcsxfrm(wchar_t * __restrict dest, const wchar_t * __restrict src, size_t len) +{ + return wcsxfrm_l(dest, src, len, __current_locale()); +} diff --git a/string/FreeBSD/wmemchr.3 b/string/FreeBSD/wmemchr.3 new file mode 100644 index 0000000..2e1d3ec --- /dev/null +++ b/string/FreeBSD/wmemchr.3 @@ -0,0 +1,186 @@ +.\" $NetBSD: wmemchr.3,v 1.4 2001/01/02 11:26:23 itojun Exp $ +.\" +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Chris Torek and the American National Standards Committee X3, +.\" on Information Processing Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" from: @(#)strcpy.3 8.1 (Berkeley) 6/4/93 +.\" +.\" $FreeBSD: src/lib/libc/string/wmemchr.3,v 1.10 2009/03/04 06:01:27 das Exp $ +.\" +.Dd March 4, 2009 +.Dt WMEMCHR 3 +.Os +.Sh NAME +.Nm wcpcpy , +.Nm wcpncpy , +.Nm wcscasecmp , +.Nm wcscat , +.Nm wcschr , +.Nm wcscmp , +.Nm wcscpy , +.Nm wcscspn , +.Nm wcsdup , +.Nm wcslcat , +.Nm wcslcpy , +.Nm wcslen , +.Nm wcsncasecmp , +.Nm wcsncat , +.Nm wcsncmp , +.Nm wcsncpy , +.Nm wcsnlen , +.Nm wcspbrk , +.Nm wcsrchr , +.Nm wcsspn , +.Nm wcsstr , +.Nm wmemchr , +.Nm wmemcmp , +.Nm wmemcpy , +.Nm wmemmove , +.Nm wmemset +.Nd wide character string manipulation operations +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wchar.h +.Ft wchar_t * +.Fn wcpcpy "wchar_t *s1" "wchar_t *s2" +.Ft wchar_t * +.Fn wcpncpy "wchar_t *s1" "wchar_t *s2" "size_t n" +.Ft int +.Fn wcscasecmp "const wchar_t *s1" "const wchar_t *s2" +.Ft wchar_t * +.Fn wcscat "wchar_t * restrict s1" "const wchar_t * restrict s2" +.Ft wchar_t * +.Fn wcschr "const wchar_t *s" "wchar_t c" +.Ft int +.Fn wcscmp "const wchar_t *s1" "const wchar_t *s2" +.Ft wchar_t * +.Fn wcscpy "wchar_t * restrict s1" "const wchar_t * restrict s2" +.Ft size_t +.Fn wcscspn "const wchar_t *s1" "const wchar_t *s2" +.Ft wchar_t * +.Fn wcsdup "const wchar_t *s" +.Ft size_t +.Fn wcslcat "wchar_t *s1" "const wchar_t *s2" "size_t n" +.Ft size_t +.Fn wcslcpy "wchar_t *s1" "const wchar_t *s2" "size_t n" +.Ft size_t +.Fn wcslen "const wchar_t *s" +.Ft int +.Fn wcsncasecmp "const wchar_t *s1" "const wchar_t *s2" "size_t n" +.Ft wchar_t * +.Fn wcsncat "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n" +.Ft int +.Fn wcsncmp "const wchar_t *s1" "const wchar_t * s2" "size_t n" +.Ft wchar_t * +.Fn wcsncpy "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n" +.Ft size_t +.Fn wcsnlen "const wchar_t *s" "size_t maxlen" +.Ft wchar_t * +.Fn wcspbrk "const wchar_t *s1" "const wchar_t *s2" +.Ft wchar_t * +.Fn wcsrchr "const wchar_t *s" "wchar_t c" +.Ft size_t +.Fn wcsspn "const wchar_t *s1" "const wchar_t *s2" +.Ft wchar_t * +.Fn wcsstr "const wchar_t * restrict s1" "const wchar_t * restrict s2" +.Ft wchar_t * +.Fn wmemchr "const wchar_t *s" "wchar_t c" "size_t n" +.Ft int +.Fn wmemcmp "const wchar_t *s1" "const wchar_t *s2" "size_t n" +.Ft wchar_t * +.Fn wmemcpy "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n" +.Ft wchar_t * +.Fn wmemmove "wchar_t *s1" "const wchar_t *s2" "size_t n" +.Ft wchar_t * +.Fn wmemset "wchar_t *s" "wchar_t c" "size_t n" +.In wchar.h +.In xlocale.h +.Ft int +.Fn wcscasecmp_l "const wchar_t *s1" "const wchar_t *s2" "locale_t loc" +.Ft int +.Fn wcsncasecmp_l "const wchar_t *s1" "const wchar_t *s2" "size_t n" "locale_t loc" +.Sh DESCRIPTION +The functions implement string manipulation operations over wide character +strings. +For a detailed description, refer to documents for the respective single-byte +counterpart, such as +.Xr memchr 3 . +.Sh SEE ALSO +.Xr memchr 3 , +.Xr memcmp 3 , +.Xr memcpy 3 , +.Xr memmove 3 , +.Xr memset 3 , +.Xr stpcpy 3 , +.Xr stpncpy 3 , +.Xr strcasecmp 3 , +.Xr strcasecmp_l 3 , +.Xr strcat 3 , +.Xr strchr 3 , +.Xr strcmp 3 , +.Xr strcpy 3 , +.Xr strcspn 3 , +.Xr strdup 3 , +.Xr strlcat 3 , +.Xr strlcpy 3 , +.Xr strlen 3 , +.Xr strncasecmp 3 , +.Xr strncasecmp_l 3 , +.Xr strncat 3 , +.Xr strncmp 3 , +.Xr strncpy 3 , +.Xr strnlen 3 , +.Xr strpbrk 3 , +.Xr strrchr 3 , +.Xr strspn 3 , +.Xr strstr 3 , +.Xr xlocale 3 +.Sh STANDARDS +These functions conform to +.St -isoC-99 , +with the exception of +.Fn wcpcpy , +.Fn wcpncpy , +.Fn wcscasecmp , +.Fn wcscasecmp_l , +.Fn wcsdup , +.Fn wcsncasecmp , +.Fn wcsncasecmp_l , +and +.Fn wcsnlen , +which conform to +.St -p1003.1-2008 ; +and +.Fn wcslcat +and +.Fn wcslcpy , +which are extensions. diff --git a/string/FreeBSD/wmemchr.c b/string/FreeBSD/wmemchr.c new file mode 100644 index 0000000..6678fe3 --- /dev/null +++ b/string/FreeBSD/wmemchr.c @@ -0,0 +1,52 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wmemchr.c,v 1.2 2000/12/20 14:08:31 itojun Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wmemchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wmemchr.c,v 1.7 2009/02/03 17:58:20 danger Exp $"); + +#include + +wchar_t * +wmemchr(const wchar_t *s, wchar_t c, size_t n) +{ + size_t i; + + for (i = 0; i < n; i++) { + if (*s == c) { + /* LINTED const castaway */ + return (wchar_t *)s; + } + s++; + } + return NULL; +} diff --git a/string/FreeBSD/wmemcmp.c b/string/FreeBSD/wmemcmp.c new file mode 100644 index 0000000..f6cdc6b --- /dev/null +++ b/string/FreeBSD/wmemcmp.c @@ -0,0 +1,53 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wmemcmp.c,v 1.2 2000/12/20 14:08:31 itojun Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wmemcmp.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wmemcmp.c,v 1.7 2009/02/03 17:58:20 danger Exp $"); + +#include + +int +wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n) +{ + size_t i; + + for (i = 0; i < n; i++) { + if (*s1 != *s2) { + /* wchar might be unsigned */ + return *s1 > *s2 ? 1 : -1; + } + s1++; + s2++; + } + return 0; +} diff --git a/string/FreeBSD/wmemcpy.c b/string/FreeBSD/wmemcpy.c new file mode 100644 index 0000000..523e48c --- /dev/null +++ b/string/FreeBSD/wmemcpy.c @@ -0,0 +1,44 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wmemcpy.c,v 1.2 2000/12/20 14:08:31 itojun Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wmemcpy.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wmemcpy.c,v 1.8 2009/02/03 17:58:20 danger Exp $"); + +#include +#include + +wchar_t * +wmemcpy(wchar_t * __restrict d, const wchar_t * __restrict s, size_t n) +{ + return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t)); +} diff --git a/string/FreeBSD/wmemmove.c b/string/FreeBSD/wmemmove.c new file mode 100644 index 0000000..161e357 --- /dev/null +++ b/string/FreeBSD/wmemmove.c @@ -0,0 +1,44 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wmemmove.c,v 1.2 2000/12/20 14:08:31 itojun Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wmemmove.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wmemmove.c,v 1.7 2009/02/03 17:58:20 danger Exp $"); + +#include +#include + +wchar_t * +wmemmove(wchar_t *d, const wchar_t *s, size_t n) +{ + return (wchar_t *)memmove(d, s, n * sizeof(wchar_t)); +} diff --git a/string/FreeBSD/wmemset.c b/string/FreeBSD/wmemset.c new file mode 100644 index 0000000..9d9b121 --- /dev/null +++ b/string/FreeBSD/wmemset.c @@ -0,0 +1,51 @@ +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * citrus Id: wmemset.c,v 1.2 2000/12/20 14:08:31 itojun Exp + */ + +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: wmemset.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD: src/lib/libc/string/wmemset.c,v 1.8 2009/02/03 20:25:36 imp Exp $"); + +#include + +wchar_t * +wmemset(wchar_t *s, wchar_t c, size_t n) +{ + size_t i; + wchar_t *p; + + p = (wchar_t *)s; + for (i = 0; i < n; i++) { + *p = c; + p++; + } + return s; +} diff --git a/string/NetBSD/memset_s.3 b/string/NetBSD/memset_s.3 new file mode 100644 index 0000000..3c25e7e --- /dev/null +++ b/string/NetBSD/memset_s.3 @@ -0,0 +1,147 @@ +.\" +.\" Copyright (c) 2012 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Alan Barrett +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $NetBSD$ +.\" +.Dd February 21, 2012 +.Dt MEMSET_S 3 +.Os +.Sh NAME +.Nm memset_s +.Nd copy a value to all bytes of a memory buffer +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.Fd "#define __STDC_WANT_LIB_EXT1__ 1 +.In string.h +.Ft errno_t +.Fn memset_s "void *s" "rsize_t smax" "int c" "rsize_t n" +.Sh DESCRIPTION +The +.Fn memset_s +function copies the value +.Fa c +(converted to an unsigned char) +into each of the first +.Fa n +bytes of the memory buffer whose starting address is given by +.Fa s . +.Pp +It is a runtime-constraints violation if +.Fa s +is a null pointer, +or if either of +.Fa smax +or +.Fa n +is larger than +.Dv RSIZE_MAX , +or if +.Fa smax +is smaller than +.Fa n . +If there is a runtime-constraints violation, and if +.Fa s +is not a null pointer, +and if +.Fa smax +is not larger than +.Dv RSIZE_MAX , +then, before reporting the runtime-constraints violation, +.Fn memset_s +copies +.Fa smax +bytes to the destination. +.Pp +In contrast to the +.Xr memset 3 +function, +calls to +.Fn memset_s +will never be +.Dq optimised away +by a compiler. +This property is required by the following sentences in +section K.3.7.4.1 of +.St -isoC-2011 : +.Bd -filled -offset indent +Unlike +.Fn memset , +any call to the +.Fn memset_s +function shall be evaluated strictly according to the rules of +the abstract machine as described in (5.1.2.3). +That is, any call to the +.Fn memset_s +function shall assume that the memory indicated by +.Fa s +and +.Fa n +may be accessible in the future and thus must contain +the values indicated by +.Fa c . +.Ed +.Sh RETURN VALUES +The +.Fn memset_s +function returns zero for success, or a non-zero error code +if there was a runtime-constraints violation. +.Sh ERRORS +.Fn memset_s +returns the following error codes. +It does not store the error code in the global +.Va errno +variable: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa s +argument was a null pointer. +.It Bq Er E2BIG +One or both of +.Fa smax +or +.Fa n +was larger than +.Dv RSIZE_MAX . +.It Bq Er EOVERFLOW +.Fa n +was larger than +.Fa smax . +.El +. +.Sh SEE ALSO +.Xr memset 3 . +.Sh STANDARDS +The +.Fn memset_s +function conforms to +.St -isoC-2011 , +except that the +.Fn set_constraint_handler_s +interface is not supported. diff --git a/string/NetBSD/memset_s.c b/string/NetBSD/memset_s.c new file mode 100644 index 0000000..f010ca7 --- /dev/null +++ b/string/NetBSD/memset_s.c @@ -0,0 +1,71 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Alan Barrett + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * ISO/IEC 9899:2011 section K.3.7.4.1 The memset_s function + */ + +#include + +__RCSID("$NetBSD$"); + +#define __STDC_WANT_LIB_EXT1__ 1 +#include +#include +#include + +#undef memset_s /* in case it was defined as a macro */ +#undef memset /* in case it was defined as a macro */ + +errno_t +memset_s(void *s, rsize_t smax, int c, rsize_t n) +{ + errno_t err = 0; + + if (s == NULL) + return EINVAL; + if (smax > RSIZE_MAX) + return E2BIG; + + if (n > RSIZE_MAX) { + err = E2BIG; + n = smax; + } + + if (n > smax) { + err = EOVERFLOW; + n = smax; + } + + memset(s, c, n); + + return err; +} diff --git a/string/bcopy.c b/string/bcopy.c new file mode 100644 index 0000000..fce9703 --- /dev/null +++ b/string/bcopy.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2013 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include + +void bcopy(const void *src, void *dst, size_t n) { + _platform_memmove(dst, src, n); +} diff --git a/string/memset_pattern.3 b/string/memset_pattern.3 new file mode 100644 index 0000000..df7150a --- /dev/null +++ b/string/memset_pattern.3 @@ -0,0 +1,43 @@ +.Dd October 14, 2005 +.Dt MEMSET_PATTERN 3 +.Os Darwin +.Sh NAME +.Nm memset_pattern4 , +.Nm memset_pattern8 , +.Nm memset_pattern16 +.Nd memset of a multi-byte pattern +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In string.h +.Ft void +.Fn memset_pattern4 "void *b" "const void *pattern4" "size_t len" +.Ft void +.Fn memset_pattern8 "void *b" "const void *pattern8" "size_t len" +.Ft void +.Fn memset_pattern16 "void *b" "const void *pattern16" "size_t len" +.Sh DESCRIPTION +These are analogous to +.Fn memset , +except that they +fill memory with a replicated pattern either 4, 8, or 16 bytes long. +.Fa b +points to a buffer of size +.Fa len +bytes which is to be filled. The second parameter points to the pattern. +If the buffer length is not an even multiple +of the pattern length, the last instance of the pattern will be truncated. +Neither the buffer nor the pattern pointer need be aligned. +.Sh EXAMPLES +The following example: +.Bd -literal -offset indent +char buf[10]; + +memset_pattern4( buf, "1234", sizeof(buf) ); +.Ed +.Pp +will set the buffer to the value "1234123412". +.Sh SEE ALSO +.Xr memset 3 +.Sh HISTORY +These functions first appeared in Mac OS 10.5. \ No newline at end of file diff --git a/string/stpcpy.c b/string/stpcpy.c new file mode 100644 index 0000000..4e909ac --- /dev/null +++ b/string/stpcpy.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2011 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include + +char * +stpcpy(char * restrict dst, const char * restrict src) { + const size_t length = strlen(src); + // The stpcpy() and strcpy() functions copy the string src to dst + // (including the terminating '\0' character). + memcpy(dst, src, length + 1); + // The stpcpy() and stpncpy() functions return a pointer to the + // terminating '\0' character of dst. + return dst + length; +} diff --git a/string/stpncpy.c b/string/stpncpy.c new file mode 100644 index 0000000..44c35bd --- /dev/null +++ b/string/stpncpy.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2011 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include + +char * +stpncpy(char * restrict dst, const char * restrict src, size_t maxlen) { + const size_t srclen = strnlen(src, maxlen); + if (srclen < maxlen) { + // The stpncpy() and strncpy() functions copy at most maxlen + // characters from src into dst. + memcpy(dst, src, srclen); + // If src is less than maxlen characters long, the remainder + // of dst is filled with '\0' characters. + memset(dst+srclen, 0, maxlen-srclen); + // The stpcpy() and stpncpy() functions return a pointer to the + // terminating '\0' character of dst. + return dst+srclen; + } else { + // The stpncpy() and strncpy() functions copy at most maxlen + // characters from src into dst. + memcpy(dst, src, maxlen); + // If stpncpy() does not terminate dst with a NUL character, it + // instead returns a pointer to src[maxlen] (which does not + // necessarily refer to a valid memory location.) + return dst+maxlen; + } +} diff --git a/string/strcat.c b/string/strcat.c new file mode 100644 index 0000000..4933817 --- /dev/null +++ b/string/strcat.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2011 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include + +char * +strcat(char *restrict dst, const char *restrict src) { + const size_t dstlen = strlen(dst); + const size_t srclen = strlen(src); + // The strcat() and strncat() functions append a copy of the null- + // terminated string src to the end of the null-terminated string dst, + // then add a terminating '\0'. The string dst must have sufficient + // space to hold the result. + memcpy(dst+dstlen, src, srclen+1); + // The strcat() and strncat() functions return dst. + return dst; +} diff --git a/string/strncat.c b/string/strncat.c new file mode 100644 index 0000000..ed88ee6 --- /dev/null +++ b/string/strncat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2011 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include + +char * +strncat(char *restrict dst, const char *restrict src, size_t maxlen) { + const size_t dstlen = strlen(dst); + const size_t srclen = strnlen(src, maxlen); + // The strcat() and strncat() functions append a copy of the null- + // terminated string src to the end of the null-terminated string dst, + // then add a terminating '\0'. The string dst must have sufficient + // space to hold the result. + // + // The strncat() function appends not more than maxlen characters + // from src, and then adds a terminating '\0'. + const size_t cpylen = srclen < maxlen ? srclen : maxlen; + memcpy(dst+dstlen, src, cpylen); + dst[dstlen+cpylen] = '\0'; + // The strcat() and strncat() functions return dst. + return dst; +} diff --git a/sys/CMakeLists.txt b/sys/CMakeLists.txt new file mode 100644 index 0000000..2750dcc --- /dev/null +++ b/sys/CMakeLists.txt @@ -0,0 +1,55 @@ +project(libc-sys) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") + +set(sys_sources + crt_externs.c + fork.c + getgroups.c + gettimeofday.c + chmodx_np.c + _libc_fork_child.c + _libc_init.c + msgctl.c + openx_np.c + OSMemoryNotification.c + OSThermalNotification.c + posix_spawn.c + semctl.c + settimeofday.c + shmctl.c + sigaction.c + statx_np.c + umaskx_np.c + OpenBSD/stack_protector.c +) + +#if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686") +# set(sys_sources ${sys_sources} context-stubs.c) +#endif() + +# flag explanations: +# - `-D_LIBC_NO_FEATURE_VERIFICATION` is needed because libc's `sys/cdefs.h` checks for correct features for the current platform/architecture +# however, it also includes the system `sys/cdefs.h`, which redefines `__DARWIN_ONLY_UNIX_CONFORMANCE` when `KERNEL` is defined (which it is here) +# so we need to set this flag to prevent the libc feature headers from generating an error on targets where `__DARWIN_ONLY_UNIX_CONFORMANCE` is expected to be enabled +SET_SOURCE_FILES_PROPERTIES(msgctl.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_MSGCTL -DKERNEL -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0 -D_LIBC_NO_FEATURE_VERIFICATION=1") +SET_SOURCE_FILES_PROPERTIES(semctl.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_SEMCTL -DKERNEL -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0 -D_LIBC_NO_FEATURE_VERIFICATION=1") +SET_SOURCE_FILES_PROPERTIES(shmctl.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLIBC_ALIAS_SHMCTL -DKERNEL -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0 -D_LIBC_NO_FEATURE_VERIFICATION=1") + +SET_SOURCE_FILES_PROPERTIES(sigtramp.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE") +SET_SOURCE_FILES_PROPERTIES(OpenBSD/stack_protector.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -fno-stack-protector") + +add_darling_object_library(libc-sys ${sys_sources}) + +# *** +# No-INODE64 variants +# *** +set(sys-noinode64_sources statx_np.c) +add_library(libc-sys_noinode64 OBJECT ${sys-noinode64_sources}) +SET_TARGET_PROPERTIES(libc-sys_noinode64 PROPERTIES COMPILE_FLAGS "-U__DARWIN_UNIX03 -U__DARWIN_64_BIT_INO_T -DVARIANT_INODE32 -DBUILDING_VARIANT -D_DARWIN_NO_64_BIT_INODE") + +add_library(libc-sys_dyld OBJECT gettimeofday.c crt_externs.c sigaction.c) +SET_TARGET_PROPERTIES(libc-sys_dyld PROPERTIES COMPILE_FLAGS "-UBUILDING_VARIANT -DVARIANT_DYLD -DVARIANT_CANCELABLE -DVARIANT_DARWINEXTSN") + diff --git a/sys/OSMemoryNotification.c b/sys/OSMemoryNotification.c new file mode 100644 index 0000000..9e94e4e --- /dev/null +++ b/sys/OSMemoryNotification.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +// Legacy symbols preserved for binary compatibility. + +const char *kOSMemoryNotificationName = "com.apple.system.memorystatus"; + +int OSMemoryNotificationCurrentLevel(void) +{ + return 0; // OSMemoryNotificationLevelNormal +} diff --git a/sys/OSThermalNotification.c b/sys/OSThermalNotification.c new file mode 100644 index 0000000..36b0042 --- /dev/null +++ b/sys/OSThermalNotification.c @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include + +#include + +#define OSThermalPressureLevelName "com.apple.system.thermalpressurelevel" +const char * const kOSThermalNotificationPressureLevelName = OSThermalPressureLevelName; + +#if TARGET_OS_IPHONE + +#include +#include + +#define OSThermalAlert "com.apple.system.thermalalert" +#define OSThermalDecision "com.apple.system.thermaldecision" +#define OSThermalStatusName "com.apple.system.thermalstatus" + +const char * const kOSThermalNotificationAlert = OSThermalAlert; +const char * const kOSThermalNotificationDecision = OSThermalDecision; +const char * const kOSThermalNotificationName = OSThermalStatusName; + +static const char * const kOSThermalMitigationNames[kOSThermalMitigationCount] = { + OSThermalStatusName, + "com.apple.system.thermalmitigation.70percenttorch", + "com.apple.system.thermalmitigation.70percentbacklight", + "com.apple.system.thermalmitigation.50percenttorch", + "com.apple.system.thermalmitigation.50percentbacklight", + "com.apple.system.thermalmitigation.disabletorch", + "com.apple.system.thermalmitigation.25percentbacklight", + "com.apple.system.thermalmitigation.disablemapshalo", + "com.apple.system.thermalmitigation.appterminate", + "com.apple.system.thermalmitigation.devicerestart", + "com.apple.system.thermalmitigation.thermaltableready" +}; + +static int tokens[kOSThermalMitigationCount]; +static dispatch_once_t predicates[kOSThermalMitigationCount]; +static bool thermalLevelsReady = false; + +OSThermalNotificationLevel _OSThermalNotificationLevelForBehavior(int behavior) +{ + uint64_t val = OSThermalNotificationLevelAny; + if (behavior >= 0 && behavior < kOSThermalMitigationCount) { + dispatch_once(&predicates[behavior], ^{ + (void)notify_register_check(kOSThermalMitigationNames[behavior], &tokens[behavior]); + }); + (void)notify_get_state(tokens[behavior], &val); + } + return (OSThermalNotificationLevel)val; +} + +void _OSThermalNotificationSetLevelForBehavior(int level, int behavior) +{ + uint64_t val = (uint64_t)level; + if (behavior >= 0 && behavior < kOSThermalMitigationCount) { + dispatch_once(&predicates[behavior], ^{ + (void)notify_register_check(kOSThermalMitigationNames[behavior], &tokens[behavior]); + }); + (void)notify_set_state(tokens[behavior], val); + + // Note: + // - We are ready when we program in the appterminate value. + // - Assumes that user programs kOSThermalMitigationNone level less than + // kOSThermalMitigationAppTerminate & kOSThermalMitigationDeviceRestart + if (behavior == kOSThermalMitigationAppTerminate) { + dispatch_once(&predicates[kOSThermalMitigationThermalTableReady], ^{ + (void)notify_register_check(kOSThermalMitigationNames[kOSThermalMitigationThermalTableReady], &tokens[kOSThermalMitigationThermalTableReady]); + }); + (void)notify_set_state(tokens[kOSThermalMitigationThermalTableReady], kOSThermalMitigationCount); + } + } +} + + +OSThermalNotificationLevel OSThermalNotificationCurrentLevel(void) +{ + if (thermalLevelsReady) { + return _OSThermalNotificationLevelForBehavior(kOSThermalMitigationNone); + } + + uint64_t tableReady = 0; + + dispatch_once(&predicates[kOSThermalMitigationThermalTableReady], ^{ + (void)notify_register_check(kOSThermalMitigationNames[kOSThermalMitigationThermalTableReady], &tokens[kOSThermalMitigationThermalTableReady]); + }); + (void)notify_get_state(tokens[kOSThermalMitigationThermalTableReady], &tableReady); + + // If we are ready then optimize this so we don't call dispatch everytime. + if (tableReady == kOSThermalMitigationCount) { + thermalLevelsReady = true; + return _OSThermalNotificationLevelForBehavior(kOSThermalMitigationNone); + } + else { + // Allow reset so we can dynamically change the table without thermal trap screen appearing. + thermalLevelsReady = false; + } + + // Not ready returns -1, which should not be equal or greater than any other thermal state. + return OSThermalNotificationLevelAny; +} + +#endif // TARGET_OS_IPHONE diff --git a/sys/OpenBSD/stack_protector.c b/sys/OpenBSD/stack_protector.c new file mode 100644 index 0000000..7ac7c7b --- /dev/null +++ b/sys/OpenBSD/stack_protector.c @@ -0,0 +1,132 @@ +/* $OpenBSD: stack_protector.c,v 1.10 2006/03/31 05:34:44 deraadt Exp $ */ + +/* + * Copyright (c) 2002 Hiroaki Etoh, Federico G. Schwindt, and Miodrag Vallat. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#if __has_include() +#include +#else +#define CRSetCrashLogMessage(...) +#endif +#include "libproc.h" +#include "_simple.h" + +#define GUARD_MAX 8 +long __stack_chk_guard[GUARD_MAX] = {0, 0, 0, 0, 0, 0, 0, 0}; +void __abort(void) __cold __dead2; +void __guard_setup(const char *apple[]) __attribute__ ((visibility ("hidden"))); +void __stack_chk_fail(void); + +static void +__guard_from_kernel(const char *str) +{ + unsigned long long val; + char tmp[20], *p; + int idx = 0; + + /* Skip over the 'stack_guard=' key to the list of values */ + str = strchr(str, '='); + if (str == NULL) + return; + str++; + + while (str && idx < GUARD_MAX) { + /* + * Pull the next numeric string out of the list and convert it to + * a real number. + */ + strlcpy(tmp, str, 20); + p = strchr(tmp, ','); + if (p) + *p = '\0'; + val = strtoull(tmp, NULL, 0); + __stack_chk_guard[idx] = (long)(val & ((unsigned long) -1)); + idx++; + if ((str = strchr(str, ',')) != NULL) + str++; + } +} + +void +__guard_setup(const char *apple[]) +{ + int fd; + size_t len; + const char **p; + + if (__stack_chk_guard[0] != 0) + return; + + for (p = apple; p && *p; p++) { + if (strstr(*p, "stack_guard") == *p) { + __guard_from_kernel(*p); + bzero((void*)*p, strlen(*p)); + if (__stack_chk_guard[0] != 0) { + return; + } + } + } + + fd = open ("/dev/urandom", 0); + if (fd != -1) { + len = read (fd, (char*)&__stack_chk_guard, sizeof(__stack_chk_guard)); + close(fd); + if (len == sizeof(__stack_chk_guard) && + *__stack_chk_guard != 0) + return; + } + + /* If If a random generator can't be used, the protector switches the guard + to the "terminator canary" */ + ((unsigned char *)__stack_chk_guard)[0] = 0; + ((unsigned char *)__stack_chk_guard)[1] = 0; + ((unsigned char *)__stack_chk_guard)[2] = '\n'; + ((unsigned char *)__stack_chk_guard)[3] = 255; +} + +static const char *stackoverflow_msg = "stack buffer overflow"; + +void +__stack_chk_fail() +{ + CRSetCrashLogMessage(stackoverflow_msg); + + /* This may fail on a chroot jail... */ + char prog[2*MAXCOMLEN+1] = {0}; + proc_name(getpid(), prog, 2*MAXCOMLEN); + prog[2*MAXCOMLEN] = 0; + _simple_asl_log_prog(ASL_LEVEL_CRIT, "user", stackoverflow_msg, prog); + + __abort(); +} diff --git a/sys/_libc_fork_child.c b/sys/_libc_fork_child.c new file mode 100644 index 0000000..e6c2b57 --- /dev/null +++ b/sys/_libc_fork_child.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * _libc_fork_child() is called from Libsystem's libSystem_atfork_child() + */ +#include +#if __has_include() +#include +#else +#define CRSetCrashLogMessage(...) +#endif + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +extern void _arc4_fork_child(); +extern void _init_clock_port(void); +extern void __environ_lock_fork_child(); + +void _libc_fork_child(void); // todo: private_extern? +void +_libc_fork_child(void) +{ + CRSetCrashLogMessage("crashed on child side of fork pre-exec"); + + _arc4_fork_child(); + _init_clock_port(); + __environ_lock_fork_child(); +} +#pragma clang diagnostic pop diff --git a/sys/_libc_init.c b/sys/_libc_init.c new file mode 100644 index 0000000..3f95640 --- /dev/null +++ b/sys/_libc_init.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2005-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * _libc_initializer() is called from libSystem_initializer() + */ + +#include +#include +#include +#include +#include +#include +#include +#include <_simple.h> + +#include "libc_private.h" + +extern void _program_vars_init(const struct ProgramVars *vars); +extern void _libc_fork_init(const struct _libc_functions *funcs); +extern void _arc4_init(void); +extern void __atexit_init(void); +extern void __confstr_init(const struct _libc_functions *funcs); +extern void _init_clock_port(void); +extern void __chk_init(void); +extern void __xlocale_init(void); +extern void __guard_setup(const char *apple[]); + +void +_libc_initializer(const struct _libc_functions *funcs, + const char *envp[], + const char *apple[], + const struct ProgramVars *vars) +{ + _program_vars_init(vars); + _libc_fork_init(funcs); + __confstr_init(funcs); + __atexit_init(); + _init_clock_port(); + __chk_init(); + __xlocale_init(); + __guard_setup(apple); +} + + +void +__libc_init(const struct ProgramVars *vars, + void (*atfork_prepare)(void), + void (*atfork_parent)(void), + void (*atfork_child)(void), + const char *apple[]) +{ + const struct _libc_functions funcs = { + .version = 1, + .atfork_prepare = atfork_prepare, + .atfork_parent = atfork_parent, + .atfork_child = atfork_child, + .dirhelper = NULL, + }; + + return _libc_initializer(&funcs, NULL, apple, vars); +} diff --git a/sys/chmodx_np.c b/sys/chmodx_np.c new file mode 100644 index 0000000..f03e3a1 --- /dev/null +++ b/sys/chmodx_np.c @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include +#include +#include +#include + +#if 1 /* for turdfile code only */ +#include +#include +#include +#include +#endif + +static int chmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl); +static int fchmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl); + +static int chmodx1(void *obj, + int (* chmod_syscall)(void *obj, uid_t fsowner, gid_t fsgrp, int mode, + kauth_filesec_t fsacl), + filesec_t fsec); + +/* + * Chmod interfaces. + */ +int +chmodx_np(const char *path, filesec_t fsec) +{ + return(chmodx1((void *)&path, chmodx_syscall, fsec)); +} + +int +fchmodx_np(int fd, filesec_t fsec) +{ + return(chmodx1((void *)&fd, fchmodx_syscall, fsec)); +} + +/* + * Chmod syscalls. + */ +extern int __chmod_extended(char *, uid_t, gid_t, int, kauth_filesec_t); +extern int __fchmod_extended(int, uid_t, gid_t, int, kauth_filesec_t); + +static int +chmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl) +{ + char *path = *(char **)obj; + + return(__chmod_extended(path, fsowner, fsgrp, mode, fsacl)); +} + +static int +fchmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl) +{ + int fd = *(int *)obj; + return(__fchmod_extended(fd, fsowner, fsgrp, mode, fsacl)); +} + +/* + * Chmod internals. + */ + +static int +chmodx1(void *obj, + int (chmod_syscall)(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl), + filesec_t fsec) +{ + uid_t fsowner = KAUTH_UID_NONE; + gid_t fsgrp = KAUTH_GID_NONE; + mode_t fsec_mode; + int fsmode = -1; + size_t size = 0; + int fsacl_used = 0; + int delete_acl = 0; + kauth_filesec_t fsacl = KAUTH_FILESEC_NONE; + struct kauth_filesec static_filesec; + + if (fsec == NULL) { + errno = EINVAL; + return(-1); + } + + /* regular properties */ + if ((filesec_get_property(fsec, FILESEC_OWNER, &fsowner) != 0) && (errno != ENOENT)) + return(-1); + if ((filesec_get_property(fsec, FILESEC_GROUP, &fsgrp) != 0) && (errno != ENOENT)) + return(-1); + if ((filesec_get_property(fsec, FILESEC_MODE, &fsec_mode)) != 0) { + if (errno != ENOENT) + return(-1); + } else { + /* cast up */ + fsmode = fsec_mode; + } + + /* + * We can set any or all of the ACL and UUIDs, but the two are transported in one + * structure. If we have an ACL, we'll use its allocated structure, otherwise we + * need our own. + */ + if (((filesec_get_property(fsec, FILESEC_ACL_RAW, &fsacl) != 0) || + (filesec_get_property(fsec, FILESEC_ACL_ALLOCSIZE, &size) != 0)) && + (errno != ENOENT)) + return(-1); + /* caller wants to delete ACL, must remember this */ + if (fsacl == _FILESEC_REMOVE_ACL) { + delete_acl = 1; + fsacl = 0; + } + + /* no ACL, use local filesec */ + if (fsacl == KAUTH_FILESEC_NONE) { + bzero(&static_filesec, sizeof(static_filesec)); + fsacl = &static_filesec; + fsacl->fsec_magic = KAUTH_FILESEC_MAGIC; + fsacl->fsec_entrycount = KAUTH_FILESEC_NOACL; + } else { + fsacl_used = 1; + } + + /* grab the owner and group UUID if present */ + if (filesec_get_property(fsec, FILESEC_UUID, &fsacl->fsec_owner) != 0) { + if (errno != ENOENT) + return(-1); + bzero(&fsacl->fsec_owner, sizeof(fsacl->fsec_owner)); + } else { + fsacl_used = 1; + } + if (filesec_get_property(fsec, FILESEC_GRPUUID, &fsacl->fsec_group) != 0) { + if (errno != ENOENT) + return(-1); + bzero(&fsacl->fsec_group, sizeof(fsacl->fsec_group)); + } else { + fsacl_used = 1; + } + + /* after all this, if we didn't find anything that needs it, don't pass it in */ + if (!fsacl_used) { + /* + * If the caller was trying to remove the ACL, and there are no UUIDs, + * we can tell the kernel to completely nuke the whole datastructure. + */ + if (delete_acl) { + fsacl = _FILESEC_REMOVE_ACL; + } else { + fsacl = KAUTH_FILESEC_NONE; + } + } + + return(chmod_syscall(obj, fsowner, fsgrp, fsmode, fsacl)); +} diff --git a/sys/crt_externs.c b/sys/crt_externs.c new file mode 100644 index 0000000..982e2db --- /dev/null +++ b/sys/crt_externs.c @@ -0,0 +1,152 @@ +/* + * Copyright (c) 1999-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* +** This file contains interfaces to the symbols defined int the crt modules. +** 3 April 1995 +** Matt Watson (mwatson@next.com) +** +*/ + +#if defined(__DYNAMIC__) +#include "mach-o/dyld.h" /* defines _dyld_lookup_and_bind() */ +#define DECLARE_VAR(var, type) \ + static type * var ## _pointer = 0 +#define DECLARE_PROGNAME(var, type) \ + static type * var ## _pointer = 0; \ + __unused static type _priv_ ## var = 0 +#define USE_VAR(var) (var ## _pointer) +#else +#define DECLARE_VAR(var, type) extern type var +#define DECLARE_PROGNAME(var, type) DECLARE_VAR(var, type) +#define USE_VAR(var) (& var) +#endif + +DECLARE_VAR(NXArgv, char **); +DECLARE_VAR(NXArgc, int); +DECLARE_VAR(environ, char **); +DECLARE_VAR(_mh_execute_header, struct mach_header); +DECLARE_PROGNAME(__progname, char *); + +char ***_NSGetArgv(void) { + return(USE_VAR(NXArgv)); +} + +int *_NSGetArgc(void) { + return(USE_VAR(NXArgc)); +} + +char ***_NSGetEnviron(void) { + return(USE_VAR(environ)); +} + +char **_NSGetProgname(void) { + return(USE_VAR(__progname)); +} + +struct mach_header *_NSGetMachExecuteHeader(void) { + return(USE_VAR(_mh_execute_header)); +} + +#if __DYNAMIC__ +struct ProgramVars +{ + void* mh; + int* NXArgcPtr; + char*** NXArgvPtr; + char*** environPtr; + char** __prognamePtr; +}; + + +#define SUPPORT_PRE_GM_10_5_EXECUTABLES (__ppc__ || __i386__) + + +/* + * dyld calls libSystem_initializer() and passes it a ProgramVars struct + * containing pointers to the main executable's NXArg* global variables. + * libSystem_initializer() calls _libc_initializer() which calls + * _program_vars_init() passing the ProgramVars parameter. + */ +void __attribute__((visibility("hidden"))) +_program_vars_init(const struct ProgramVars* vars) { +#if SUPPORT_PRE_GM_10_5_EXECUTABLES + // to support transitional 10.5 main executables that don't have extended __dyld section and instead call _NSSetProgramVars, + // don't overwrite values set by _NSSetProgramVars() + if ( NXArgv_pointer != NULL ) + return; +#endif + NXArgv_pointer = vars->NXArgvPtr; + NXArgc_pointer = vars->NXArgcPtr; + environ_pointer = vars->environPtr; + __progname_pointer = vars->__prognamePtr; + _mh_execute_header_pointer = vars->mh; +} + +#if SUPPORT_PRE_GM_10_5_EXECUTABLES +/* + * This is only called by main executables built with pre 10-5 GM crt1.10.5.o. In those programs, + * there is no extended __dyld section, dyld cannot tell _program_vars_init() where the real program + * variables are, so they get temp values and are set for real here. + */ +void _NSSetProgramVars(int* crt_argc, char*** crt_argv, char*** crt_environ, struct mach_header* crt_mh, char** crt_progname) { + NXArgv_pointer = crt_argv; + NXArgc_pointer = crt_argc; + environ_pointer = crt_environ; + __progname_pointer = crt_progname; + _mh_execute_header_pointer = crt_mh; +} +#endif +#endif /* __DYNAMIC__ */ + +#if __ppc__ +/* + * Fix for Radar bug 2200596 -- + * EH symbol definitions for gcc 2.7.2.x implementation of + * C++ exception handling. The problem: the EH implementation + * has "throw" store stuff into these pointers, and then as the + * stack is unwound, the code generated into each function (for + * checking whether this function contains a relevant "catch" + * clause and for calling destructors for local variables) looks + * at these globals to find the type and value thrown. + * + * The problem was that the compiler generated the symbols as + * "common" symbols, and common symbols cannot be placed in + * dynamic shared libraries. So we must put these guys as + * "data" symbols into crt0.o or the System Framework (library), + * and the compiler must generate code that defines the symbols + * as external references instead of common. + * + * I changed the symbol names (added the "_272") to be utterly + * paranoid about any possible future use of similar names by + * any future versions of gcc. + * -- D. Landauer, Jan. 1998 + */ + +void *__eh_pc_gcc_272 = (void *)0; +void *__eh_type_gcc_272 = (void *)0; +void *__eh_value_gcc_272 = (void *)0; + +/* This is what egcs uses for its global data pointer */ +void *__eh_global_dataptr = (void *)0; +#endif /* __ppc__ */ + diff --git a/sys/fork.c b/sys/fork.c new file mode 100644 index 0000000..6a83b53 --- /dev/null +++ b/sys/fork.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include +#include + +#include "libc_private.h" + +extern pid_t __fork(void); + +static void (*_libSystem_atfork_prepare)(void) = 0; +static void (*_libSystem_atfork_parent)(void) = 0; +static void (*_libSystem_atfork_child)(void) = 0; + +__private_extern__ +void _libc_fork_init(const struct _libc_functions *funcs) +{ + _libSystem_atfork_prepare = funcs->atfork_prepare; + _libSystem_atfork_parent = funcs->atfork_parent; + _libSystem_atfork_child = funcs->atfork_child; +} + +/* + * fork stub + */ +pid_t +fork(void) +{ + int ret; + + _libSystem_atfork_prepare(); + // Reader beware: this __fork() call is yet another wrapper around the actual syscall + // and lives inside libsyscall. The fork syscall needs some cuddling by asm before it's + // allowed to see the big wide C world. + ret = __fork(); + if (-1 == ret) + { + // __fork already set errno for us + _libSystem_atfork_parent(); + return ret; + } + + if (0 == ret) + { + // We're the child in this part. + _libSystem_atfork_child(); + return 0; + } + + _libSystem_atfork_parent(); + return ret; +} + diff --git a/sys/getgroups.c b/sys/getgroups.c new file mode 100644 index 0000000..f63bc28 --- /dev/null +++ b/sys/getgroups.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#define _DARWIN_C_SOURCE + +#include +#include +#include +#include + +int32_t getgroupcount(const char *name, gid_t basegid); + +/* + * getgroups extension; not limited by NGROUPS_MAX + */ +int +getgroups(int gidsetsize, gid_t grouplist[]) +{ + struct passwd *pw; + int n; + + if ((pw = getpwuid(getuid())) == NULL) { + errno = EINVAL; + return -1; + } + if (gidsetsize == 0) { + if ((n = getgroupcount(pw->pw_name, pw->pw_gid)) == 0) { + errno = EINVAL; + return -1; + } + return n; + } + n = gidsetsize; + if (getgrouplist(pw->pw_name, pw->pw_gid, (int *)grouplist, &n) < 0) { + errno = EINVAL; + return -1; + } + return n; +} diff --git a/sys/gettimeofday.c b/sys/gettimeofday.c new file mode 100644 index 0000000..95a8da3 --- /dev/null +++ b/sys/gettimeofday.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved + * + * File: libc/sys/gettimeofday.c + */ + +#include +#include +#include +#include +#include + +#define __APPLE_API_PRIVATE +#include +#undef __APPLE_API_PRIVATE + +extern int __gettimeofday(struct timeval *, struct timezone *); +extern int __commpage_gettimeofday(struct timeval *); + +int gettimeofday (struct timeval *tp, void *vtzp) +{ + static int validtz = 0; + static struct timezone cached_tz = {0}; + struct timezone *tzp = (struct timezone *)vtzp; + struct timeval atv; + + if (tp == NULL) { + if (tzp == NULL) + return (0); + tp = &atv; + } + + if (__commpage_gettimeofday(tp)) { /* first try commpage */ + if (__gettimeofday(tp, NULL) < 0) { /* if it fails, use syscall */ + return (-1); + } + } + + if (tzp) { + if (validtz == 0) { + struct tm *localtm = localtime ((time_t *)&tp->tv_sec); + cached_tz.tz_dsttime = localtm->tm_isdst; + cached_tz.tz_minuteswest = + (-localtm->tm_gmtoff / SECSPERMIN) + + (localtm->tm_isdst * MINSPERHOUR); + validtz = 1; + } + tzp->tz_dsttime = cached_tz.tz_dsttime; + tzp->tz_minuteswest = cached_tz.tz_minuteswest; + } + return (0); +} diff --git a/sys/msgctl.c b/sys/msgctl.c new file mode 100644 index 0000000..32a1ba2 --- /dev/null +++ b/sys/msgctl.c @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include + +/* + * Stub function to account for the differences in the ipc_perm structure, + * while maintaining binary backward compatibility. + * + * This is only the legacy behavior. + */ +extern int __msgctl(int, int, struct msqid_ds *); + +int +msgctl(int msqid, int cmd, struct msqid_ds *ds) +{ + struct __msqid_ds_old *ds_old = (struct __msqid_ds_old *)ds; + struct __msqid_ds_new ds2; + struct __msqid_ds_new *ds_new = &ds2; + int rv; + +#define _UP_CVT(x) ds_new-> x = ds_old-> x +#define _DN_CVT(x) ds_old-> x = ds_new-> x + + if (cmd == IPC_SET) { + /* convert before call */ + _UP_CVT(msg_perm.uid); + _UP_CVT(msg_perm.gid); + _UP_CVT(msg_perm.cuid); + _UP_CVT(msg_perm.cgid); + _UP_CVT(msg_perm.mode); + ds_new->msg_perm._seq = ds_old->msg_perm.seq; + ds_new->msg_perm._key = ds_old->msg_perm.key; + _UP_CVT(msg_first); + _UP_CVT(msg_last); + _UP_CVT(msg_cbytes); + _UP_CVT(msg_qnum); + _UP_CVT(msg_qbytes); + _UP_CVT(msg_lspid); + _UP_CVT(msg_lrpid); + _UP_CVT(msg_stime); + _UP_CVT(msg_pad1); /* binary compatibility */ + _UP_CVT(msg_rtime); + _UP_CVT(msg_pad2); /* binary compatibility */ + _UP_CVT(msg_ctime); + _UP_CVT(msg_pad3); /* binary compatibility */ + _UP_CVT(msg_pad4[0]); /* binary compatibility */ + _UP_CVT(msg_pad4[1]); /* binary compatibility */ + _UP_CVT(msg_pad4[2]); /* binary compatibility */ + _UP_CVT(msg_pad4[3]); /* binary compatibility */ + } + + rv = __msgctl(msqid, cmd, ds_new); + + if (cmd == IPC_STAT) { + /* convert after call */ + _DN_CVT(msg_perm.uid); /* warning! precision loss! */ + _DN_CVT(msg_perm.gid); /* warning! precision loss! */ + _DN_CVT(msg_perm.cuid); /* warning! precision loss! */ + _DN_CVT(msg_perm.cgid); /* warning! precision loss! */ + _DN_CVT(msg_perm.mode); + ds_old->msg_perm.seq = ds_new->msg_perm._seq; + ds_old->msg_perm.key = ds_new->msg_perm._key; + _DN_CVT(msg_first); + _DN_CVT(msg_last); + _DN_CVT(msg_cbytes); + _DN_CVT(msg_qnum); + _DN_CVT(msg_qbytes); + _DN_CVT(msg_lspid); + _DN_CVT(msg_lrpid); + _DN_CVT(msg_stime); + _DN_CVT(msg_pad1); /* binary compatibility */ + _DN_CVT(msg_rtime); + _DN_CVT(msg_pad2); /* binary compatibility */ + _DN_CVT(msg_ctime); + _DN_CVT(msg_pad3); /* binary compatibility */ + _DN_CVT(msg_pad4[0]); /* binary compatibility */ + _DN_CVT(msg_pad4[1]); /* binary compatibility */ + _DN_CVT(msg_pad4[2]); /* binary compatibility */ + _DN_CVT(msg_pad4[3]); /* binary compatibility */ + } + + return (rv); +} diff --git a/sys/nanosleep.2 b/sys/nanosleep.2 new file mode 100644 index 0000000..729527b --- /dev/null +++ b/sys/nanosleep.2 @@ -0,0 +1,105 @@ +.\" $FreeBSD: src/lib/libc/sys/nanosleep.2,v 1.8.2.4 2001/12/14 18:34:01 ru Exp $ +.\" $OpenBSD: nanosleep.2,v 1.1 1997/04/20 20:56:20 tholo Exp $ +.\" $NetBSD: nanosleep.2,v 1.1 1997/04/17 18:12:02 jtc Exp $ +.\" +.\" Copyright (c) 1986, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)sleep.3 8.1 (Berkeley) 6/4/93 +.\" +.Dd April 17, 1997 +.Dt NANOSLEEP 2 +.Os +.Sh NAME +.Nm nanosleep +.Nd suspend thread execution for an interval measured in nanoseconds +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft int +.Fo nanosleep +.Fa "const struct timespec *rqtp" +.Fa "struct timespec *rmtp" +.Fc +.Sh DESCRIPTION +The +.Fn nanosleep +function causes the calling thread to sleep +for the amount of time specified in +.Fa rqtp +(the actual time slept may be longer, due to system latencies +and possible limitations in the timer resolution of the hardware). +An unmasked signal will +cause +.Fn nanosleep +to terminate the sleep early, regardless of the +.Dv SA_RESTART +value on the interrupting signal. +.Sh RETURN VALUES +If +.Fn nanosleep +returns because the requested time has elapsed, +the value returned will be zero. +.Pp +If +.Fn nanosleep +returns due to the delivery of a signal, the value returned +will be the -1, and the global variable +.Va errno +will be set to indicate the interruption. +If +.Fa rmtp +is +.Pf non- Dv NULL , +the timespec structure it references is updated to contain the +unslept amount (the request time minus the time actually slept). +.Sh ERRORS +The +.Fn nanosleep +call fails if: +.Bl -tag -width Er +.It Bq Er EINTR +.Fn nanosleep +was interrupted by the delivery of a signal. +.It Bq Er EINVAL +.Fa rqtp +specified a nanosecond value less than zero +or greater than or equal to 1000 million. +.El +.Sh SEE ALSO +.Xr sigsuspend 2 , +.Xr sleep 3 +.Sh STANDARDS +The +.Fn nanosleep +function conforms to +.St -p1003.1b-93 . diff --git a/sys/openx_np.c b/sys/openx_np.c new file mode 100644 index 0000000..c71f4d0 --- /dev/null +++ b/sys/openx_np.c @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include +#include +#include +#include + +enum {OPENX, MKFIFOX, MKDIRX}; + +extern int __open_extended(const char *, int, uid_t, gid_t, int, struct kauth_filesec *); +extern int __mkfifo_extended(const char *, uid_t, gid_t, int, struct kauth_filesec *); +extern int __mkdir_extended(const char *, uid_t, gid_t, int, struct kauth_filesec *); + +static int +_mkfilex_np(int opcode, const char *path, int flags, filesec_t fsec) +{ + uid_t owner = KAUTH_UID_NONE; + gid_t group = KAUTH_GID_NONE; + mode_t mode = 0; + size_t size = 0; + int fsacl_used = 0; + struct kauth_filesec *fsacl = NULL; + struct kauth_filesec static_filesec; + + /* handle extended security data */ + if (fsec != NULL) { + /* fetch basic parameters */ + if ((filesec_get_property(fsec, FILESEC_OWNER, &owner) != 0) && (errno != ENOENT)) + return(-1); + if ((filesec_get_property(fsec, FILESEC_GROUP, &group) != 0) && (errno != ENOENT)) + return(-1); + if ((filesec_get_property(fsec, FILESEC_MODE, &mode) != 0) && (errno != ENOENT)) + return(-1); + + /* try to fetch the ACL */ + if (((filesec_get_property(fsec, FILESEC_ACL_RAW, &fsacl) != 0) || + (filesec_get_property(fsec, FILESEC_ACL_ALLOCSIZE, &size) != 0)) && + (errno != ENOENT)) + return(-1); + + /* only valid for chmod */ + if (fsacl == _FILESEC_REMOVE_ACL) { + errno = EINVAL; + return(-1); + } + + /* no ACL, use local filesec */ + if (fsacl == NULL) { + bzero(&static_filesec, sizeof(static_filesec)); + fsacl = &static_filesec; + fsacl->fsec_magic = KAUTH_FILESEC_MAGIC; + fsacl->fsec_entrycount = KAUTH_FILESEC_NOACL; + } else { + fsacl_used = 1; + } + + /* grab the owner and group UUID if present */ + if (filesec_get_property(fsec, FILESEC_UUID, &fsacl->fsec_owner) != 0) { + if (errno != ENOENT) + return(-1); + bzero(&fsacl->fsec_owner, sizeof(fsacl->fsec_owner)); + } else { + fsacl_used = 1; + } + if (filesec_get_property(fsec, FILESEC_GRPUUID, &fsacl->fsec_group) != 0) { + if (errno != ENOENT) + return(-1); + bzero(&fsacl->fsec_group, sizeof(fsacl->fsec_group)); + } else { + fsacl_used = 1; + } + + /* after all this, if we didn't find anything that needs it, don't pass it in */ + if (!fsacl_used) + fsacl = NULL; + } + + switch (opcode) { + case OPENX: + return(__open_extended(path, flags, owner, group, mode, fsacl)); + case MKFIFOX: + return(__mkfifo_extended(path, owner, group, mode, fsacl)); + case MKDIRX: + return(__mkdir_extended(path, owner, group, mode, fsacl)); + } + /* should never get here */ + errno = EINVAL; + return(-1); +} + +int +openx_np(const char *path, int flags, filesec_t fsec) +{ + /* optimise for the simple case */ + if (!(flags & O_CREAT) || (fsec == NULL)) + return(open(path, flags)); + return(_mkfilex_np(OPENX, path, flags, fsec)); +} + +int +mkfifox_np(const char *path, filesec_t fsec) +{ + return(_mkfilex_np(MKFIFOX, path, 0, fsec)); +} + +int +mkdirx_np(const char *path, filesec_t fsec) +{ + return(_mkfilex_np(MKDIRX, path, 0, fsec)); +} diff --git a/sys/posix_spawn.c b/sys/posix_spawn.c new file mode 100644 index 0000000..97efabf --- /dev/null +++ b/sys/posix_spawn.c @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2006-2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * [SPN] Support for _POSIX_SPAWN + */ + +#include +#include +#include +#include +#include +#include /* for OPEN_MAX, PATH_MAX */ +#include /* for strlcpy() */ +#include /* for _PATH_DEFPATH */ +#include /* for struct stat */ + +/* + * posix_spawnp + * + * Description: Create a new process from the process image corresponding to + * the supplied 'file' argument and the parent processes path + * environment. + * + * Parameters: pid Pointer to pid_t to receive the + * PID of the spawned process, if + * successful and 'pid' != NULL + * file Name of image file to spawn + * file_actions spawn file actions object which + * describes file actions to be + * performed during the spawn + * attrp spawn attributes object which + * describes attributes to be + * applied during the spawn + * argv argument vector array; NULL + * terminated + * envp environment vector array; NULL + * terminated + * + * Returns: 0 Success + * !0 An errno value indicating the + * cause of the failure to spawn + * + * Notes: Much of this function is derived from code from execvP() from + * exec.c in libc; this common code should be factored out at + * some point to prevent code duplication or desynchronization vs. + * bug fixes applied to one set of code but not the other. + */ +int +posix_spawnp(pid_t * __restrict pid, const char * __restrict file, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t * __restrict attrp, + char *const argv[ __restrict], char *const envp[ __restrict]) +{ + const char *env_path; + char *bp; + char *cur; + char *p; + char **memp; + int lp; + int ln; + int cnt; + int err = 0; + int eacces = 0; + struct stat sb; + char path_buf[PATH_MAX]; + + if ((env_path = getenv("PATH")) == NULL) + env_path = _PATH_DEFPATH; + + /* If it's an absolute or relative path name, it's easy. */ + if (index(file, '/')) { + bp = (char *)file; + cur = NULL; + goto retry; + } + bp = path_buf; + + /* If it's an empty path name, fail in the usual POSIX way. */ + if (*file == '\0') + return (ENOENT); + + if ((cur = alloca(strlen(env_path) + 1)) == NULL) + return ENOMEM; + strcpy(cur, env_path); + while ((p = strsep(&cur, ":")) != NULL) { + /* + * It's a SHELL path -- double, leading and trailing colons + * mean the current directory. + */ + if (*p == '\0') { + p = "."; + lp = 1; + } else { + lp = strlen(p); + } + ln = strlen(file); + + /* + * If the path is too long complain. This is a possible + * security issue; given a way to make the path too long + * the user may spawn the wrong program. + */ + if (lp + ln + 2 > sizeof(path_buf)) { + err = ENAMETOOLONG; + goto done; + } + bcopy(p, path_buf, lp); + path_buf[lp] = '/'; + bcopy(file, path_buf + lp + 1, ln); + path_buf[lp + ln + 1] = '\0'; + +retry: err = posix_spawn(pid, bp, file_actions, attrp, argv, envp); + switch (err) { + case E2BIG: + case ENOMEM: + case ETXTBSY: + goto done; + case ELOOP: + case ENAMETOOLONG: + case ENOENT: + case ENOTDIR: + break; + case ENOEXEC: + for (cnt = 0; argv[cnt]; ++cnt) + ; + memp = alloca((cnt + 2) * sizeof(char *)); + if (memp == NULL) { + /* errno = ENOMEM; XXX override ENOEXEC? */ + goto done; + } + memp[0] = "sh"; + memp[1] = bp; + bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); + err = posix_spawn(pid, _PATH_BSHELL, file_actions, attrp, memp, envp); + goto done; + default: + /* + * EACCES may be for an inaccessible directory or + * a non-executable file. Call stat() to decide + * which. This also handles ambiguities for EFAULT + * and EIO, and undocumented errors like ESTALE. + * We hope that the race for a stat() is unimportant. + */ + if (stat(bp, &sb) != 0) + break; + if (err == EACCES) { + eacces = 1; + continue; + } + goto done; + } + } + if (eacces) + err = EACCES; + else + err = ENOENT; +done: + return (err); +} diff --git a/sys/semctl.c b/sys/semctl.c new file mode 100644 index 0000000..494f3e0 --- /dev/null +++ b/sys/semctl.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include + +#include +/* + * Because KERNEL is defined, including errno.h doesn't define errno, so + * we have to do it ourselves. + */ +extern int * __error(void); +#define errno (*__error()) + +/* + * Legacy stub to account for the differences in the ipc_perm structure, + * while maintaining binary backward compatibility. + */ +extern int __semctl(int semid, int semnum, int cmd, void *); + +int +semctl(int semid, int semnum, int cmd, ...) +{ + va_list ap; + int rv; + int val = 0; + struct __semid_ds_new ds; + struct __semid_ds_new *ds_new = &ds; + struct __semid_ds_old *ds_old = NULL; + + va_start(ap, cmd); + if (cmd == SETVAL) + val = va_arg(ap, int); + else + ds_old = va_arg(ap, struct __semid_ds_old *); + va_end(ap); + +#define _UP_CVT(x) ds_new-> x = ds_old-> x +#define _DN_CVT(x) ds_old-> x = ds_new-> x + + if ((cmd == IPC_SET || cmd == IPC_STAT) && ds_old == NULL) { + /* Return EFAULT if ds_old is NULL (like the kernel would do) */ + errno = EFAULT; + return -1; + } + if (cmd == IPC_SET) { + /* convert before call */ + _UP_CVT(sem_perm.uid); + _UP_CVT(sem_perm.gid); + _UP_CVT(sem_perm.cuid); + _UP_CVT(sem_perm.cgid); + _UP_CVT(sem_perm.mode); + ds_new->sem_perm._seq = ds_old->sem_perm.seq; + ds_new->sem_perm._key = ds_old->sem_perm.key; + _UP_CVT(sem_base); + _UP_CVT(sem_nsems); + _UP_CVT(sem_otime); + _UP_CVT(sem_pad1); /* binary compatibility */ + _UP_CVT(sem_ctime); + _UP_CVT(sem_pad2); /* binary compatibility */ + _UP_CVT(sem_pad3[0]); /* binary compatibility */ + _UP_CVT(sem_pad3[1]); /* binary compatibility */ + _UP_CVT(sem_pad3[2]); /* binary compatibility */ + _UP_CVT(sem_pad3[3]); /* binary compatibility */ + } + switch (cmd) { + case SETVAL: + /* syscall must use LP64 quantities */ + rv = __semctl(semid, semnum, cmd, (void *)val); + break; + case IPC_SET: + case IPC_STAT: + rv = __semctl(semid, semnum, cmd, ds_new); + break; + default: + rv = __semctl(semid, semnum, cmd, ds_old); + break; + } + + if (cmd == IPC_STAT) { + /* convert after call */ + _DN_CVT(sem_perm.uid); /* warning! precision loss! */ + _DN_CVT(sem_perm.gid); /* warning! precision loss! */ + _DN_CVT(sem_perm.cuid); /* warning! precision loss! */ + _DN_CVT(sem_perm.cgid); /* warning! precision loss! */ + _DN_CVT(sem_perm.mode); + ds_old->sem_perm.seq = ds_new->sem_perm._seq; + ds_old->sem_perm.key = ds_new->sem_perm._key; + _DN_CVT(sem_base); + _DN_CVT(sem_nsems); + _DN_CVT(sem_otime); + _DN_CVT(sem_pad1); /* binary compatibility */ + _DN_CVT(sem_ctime); + _DN_CVT(sem_pad2); /* binary compatibility */ + _DN_CVT(sem_pad3[0]); /* binary compatibility */ + _DN_CVT(sem_pad3[1]); /* binary compatibility */ + _DN_CVT(sem_pad3[2]); /* binary compatibility */ + _DN_CVT(sem_pad3[3]); /* binary compatibility */ + } + + return (rv); +} diff --git a/sys/settimeofday.c b/sys/settimeofday.c new file mode 100644 index 0000000..50cddb6 --- /dev/null +++ b/sys/settimeofday.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#if !TARGET_OS_DRIVERKIT +#include +#include +#else +#define notify_post(...) +#endif +#include +#include +#include +#include "_simple.h" + +#ifndef kNotifyClockSet +#define kNotifyClockSet "com.apple.system.clock_set" +#endif + +int __settimeofday(const struct timeval *tp, const struct timezone *tzp); + +/* + * settimeofday stub, legacy version + */ +int +settimeofday(const struct timeval *tp, const struct timezone *tzp) +{ + int ret = __settimeofday(tp, tzp); + if (ret == 0) notify_post(kNotifyClockSet); + + if (tp) { + char *msg = NULL; + asprintf(&msg, "settimeofday({%#lx,%#x}) == %d", tp->tv_sec, tp->tv_usec, ret); + _simple_asl_log(ASL_LEVEL_NOTICE, "com.apple.settimeofday", msg); + free(msg); + } + + return ret; +} diff --git a/sys/shmctl.c b/sys/shmctl.c new file mode 100644 index 0000000..952d484 --- /dev/null +++ b/sys/shmctl.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include + +/* + * Stub function to account for the differences in the ipc_perm structure, + * while maintaining binary backward compatibility. + * + * This is only the legacy behavior. + */ +extern int __shmctl(int, int, void *); + +int +shmctl(int shmid, int cmd, struct shmid_ds *ds) +{ + struct __shmid_ds_old *ds_old = (struct __shmid_ds_old *)ds; + struct __shmid_ds_new ds2; + struct __shmid_ds_new *ds_new = &ds2; + int rv; + +#define _UP_CVT(x) ds_new-> x = ds_old-> x +#define _DN_CVT(x) ds_old-> x = ds_new-> x + + if (cmd == IPC_SET) { + /* convert before call */ + _UP_CVT(shm_perm.uid); + _UP_CVT(shm_perm.gid); + _UP_CVT(shm_perm.cuid); + _UP_CVT(shm_perm.cgid); + _UP_CVT(shm_perm.mode); + ds_new->shm_perm._seq = ds_old->shm_perm.seq; + ds_new->shm_perm._key = ds_old->shm_perm.key; + _UP_CVT(shm_segsz); + _UP_CVT(shm_lpid); + _UP_CVT(shm_cpid); + _UP_CVT(shm_nattch); + _UP_CVT(shm_atime); + _UP_CVT(shm_dtime); + _UP_CVT(shm_ctime); + _UP_CVT(shm_internal); + } + + rv = __shmctl(shmid, cmd, (void *)ds_new); + + if (cmd == IPC_STAT) { + /* convert after call */ + _DN_CVT(shm_perm.uid); /* warning! precision loss! */ + _DN_CVT(shm_perm.gid); /* warning! precision loss! */ + _DN_CVT(shm_perm.cuid); /* warning! precision loss! */ + _DN_CVT(shm_perm.cgid); /* warning! precision loss! */ + _DN_CVT(shm_perm.mode); + ds_old->shm_perm.seq = ds_new->shm_perm._seq; + ds_old->shm_perm.key = ds_new->shm_perm._key; + _DN_CVT(shm_segsz); + _DN_CVT(shm_lpid); + _DN_CVT(shm_cpid); + _DN_CVT(shm_nattch); + _DN_CVT(shm_atime); + _DN_CVT(shm_dtime); + _DN_CVT(shm_ctime); + _DN_CVT(shm_internal); + } + + return (rv); +} diff --git a/sys/sigaction.c b/sys/sigaction.c new file mode 100644 index 0000000..7b497d8 --- /dev/null +++ b/sys/sigaction.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1999-2017 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#if __has_include() +#include +#else +#define CRSetCrashLogMessage(...) +#endif +#include +#include +#include +#include +#include +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +extern int __platform_sigaction (int sig, + const struct sigaction * __restrict nsv, + struct sigaction * __restrict osv); + +int +sigaction (int sig, const struct sigaction * __restrict nsv, + struct sigaction * __restrict osv) +{ + int ret = __platform_sigaction(sig, nsv, osv); +#ifdef FEATURE_SIGNAL_RESTRICTION + // Note: The "sig != 0" here is to force the compiler to maintain that "sig" + // is live, and in a register, after __sigaction so it is visible in the + // crashing register state. + if (ret == -1 && errno == ENOTSUP && sig != 0) { + CRSetCrashLogMessage("sigaction on fatal signals is not supported"); + __builtin_trap(); + } +#endif + return ret; +} + +// XXX +#ifdef __DYNAMIC__ + +int +_sigaction_nobind (sig, nsv, osv) + int sig; + register const struct sigaction *nsv; + register struct sigaction *osv; +{ + return sigaction(sig, nsv, osv); +} +#endif + +#pragma clang diagnostic pop diff --git a/sys/sigwait.2 b/sys/sigwait.2 new file mode 100644 index 0000000..1ffc52c --- /dev/null +++ b/sys/sigwait.2 @@ -0,0 +1,87 @@ +.\" Copyright (C) 2000 Jason Evans . +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/lib/libc_r/man/sigwait.3,v 1.7 2001/10/01 16:09:09 ru Exp $ +.Dd April 27, 2000 +.Dt SIGWAIT 2 +.Os +.Sh NAME +.Nm sigwait +.Nd select a set of signals +.Sh SYNOPSIS +.In signal.h +.Ft int +.Fn sigwait "const sigset_t *restrict set" "int *restrict sig" +.Sh DESCRIPTION +The +.Fn sigwait +function selects a set of signals, specified by +.Fa set . +If none of the selected signals are pending, +.Fn sigwait +waits until one or more of the selected signals has been generated. +Then +.Fn sigwait +atomically clears one of the selected signals from the set of pending signals +for the process and sets the location pointed to by +.Fa sig +to the signal number that was cleared. +.Pp +The signals specified by +.Fa set +should be blocked, but not ignored, at the time of the call to +.Fn sigwait . +.Pp +Processes which call +.Fn sigwait +on ignored signals will wait indefinitely. Ignored +signals are dropped immediately by the system, before delivery +to a waiting process. +.Sh RETURN VALUES +If successful, +.Fn sigwait +returns 0 and sets the location pointed to by +.Fa sig +to the cleared signal number. +Otherwise, an error number is returned. +.Sh ERRORS +.Fn sigwait +will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +.Fa set +specifies one or more invalid signal numbers. +.El +.Sh SEE ALSO +.Xr pthread_sigmask 2 , +.Xr sigaction 2 , +.Xr sigpending 2 , +.Xr sigsuspend 2 , +.Xr pause 3 +.Sh STANDARDS +.Fn sigwait +conforms to ISO/IEC 9945-1:1996 (``POSIX.1'') diff --git a/sys/statx_np.c b/sys/statx_np.c new file mode 100644 index 0000000..3b2d9fb --- /dev/null +++ b/sys/statx_np.c @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2004, 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define ACL_MIN_SIZE_HEURISTIC (KAUTH_FILESEC_SIZE(16)) + +static int statx_syscall(void *obj, void *sbptr, void *fsacl, size_t *fsacl_size); +static int fstatx_syscall(void *obj, void *sbptr, void *fsacl, size_t *fsacl_size); +static int lstatx_syscall(void *obj, void *sbptr, void *fsacl, size_t *fsacl_size); + +static int statx1(void *obj, + int (* stat_syscall)(void *obj, void *sbptr, void *fsacl, size_t *fsacl_size), + void *sbptr, filesec_t fsec); + +/* + * Stat interfaces. + */ +int +statx_np(const char *path, struct stat *sb, filesec_t fsec) +{ + if (fsec == NULL) + return(stat(path, sb)); + return(statx1((void *)&path, statx_syscall, (void *)sb, fsec)); +} + +int +fstatx_np(int fd, struct stat *sb, filesec_t fsec) +{ + if (fsec == NULL) + return(fstat(fd, sb)); + return(statx1((void *)&fd, fstatx_syscall, (void *)sb, fsec)); +} + +int +lstatx_np(const char *path, struct stat *sb, filesec_t fsec) +{ + if (fsec == NULL) + return(lstat(path, sb)); + return(statx1((void *)&path, lstatx_syscall, (void *)sb, fsec)); +} + + +#if __DARWIN_64_BIT_INO_T && !__DARWIN_ONLY_64_BIT_INO_T +int +statx64_np(const char *path, struct stat64 *sb, filesec_t fsec) +{ + return(statx_np(path, (struct stat *)sb, fsec)); +} + +int +fstatx64_np(int fd, struct stat64 *sb, filesec_t fsec) +{ + return(fstatx_np(fd, (struct stat *)sb, fsec)); +} + +int +lstatx64_np(const char *path, struct stat64 *sb, filesec_t fsec) +{ + return(lstatx_np(path, (struct stat *)sb, fsec)); +} +#endif /* __DARWIN_64_BIT_INO_T && !__DARWIN_ONLY_64_BIT_INO_T */ + +/* + * Stat syscalls + */ +#if __DARWIN_64_BIT_INO_T +extern int __fstat64_extended(int, struct stat *, void *, size_t *); +extern int __lstat64_extended(const char *, struct stat *, void *, size_t *); +extern int __stat64_extended(const char *, struct stat *, void *, size_t *); +#else /* !__DARWIN_64_BIT_INO_T */ +extern int __fstat_extended(int, struct stat *, void *, size_t *); +extern int __lstat_extended(const char *, struct stat *, void *, size_t *); +extern int __stat_extended(const char *, struct stat *, void *, size_t *); +#endif /* __DARWIN_64_BIT_INO_T */ + +static int +statx_syscall(void *obj, void *sb, void *fsacl, size_t *fsacl_size) +{ + const char *path = *(const char **)obj; +#if __DARWIN_64_BIT_INO_T + return(__stat64_extended(path, (struct stat *)sb, fsacl, fsacl_size)); +#else /* !__DARWIN_64_BIT_INO_T */ + return(__stat_extended(path, (struct stat *)sb, fsacl, fsacl_size)); +#endif /* __DARWIN_64_BIT_INO_T */ +} + +static int +fstatx_syscall(void *obj, void *sb, void *fsacl, size_t *fsacl_size) +{ + int fd = *(int *)obj; +#if __DARWIN_64_BIT_INO_T + return(__fstat64_extended(fd, (struct stat *)sb, fsacl, fsacl_size)); +#else /* !__DARWIN_64_BIT_INO_T */ + return(__fstat_extended(fd, (struct stat *)sb, fsacl, fsacl_size)); +#endif /* __DARWIN_64_BIT_INO_T */ +} + +static int +lstatx_syscall(void *obj, void *sb, void *fsacl, size_t *fsacl_size) +{ + const char *path = *(const char **)obj; +#if __DARWIN_64_BIT_INO_T + return(__lstat64_extended(path, (struct stat *)sb, fsacl, fsacl_size)); +#else /* !__DARWIN_64_BIT_INO_T */ + return(__lstat_extended(path, (struct stat *)sb, fsacl, fsacl_size)); +#endif /* __DARWIN_64_BIT_INO_T */ +} + +/* + * Stat internals + */ +static int +statx1(void *obj, + int (* stat_syscall)(void *obj, void *sbptr, void *fsacl, size_t *fsacl_size), + void *sbptr, filesec_t fsec) +{ + kauth_filesec_t fsacl, ofsacl; + size_t fsacl_size, buffer_size; + int error; + struct stat * sb = (struct stat *)0; + + fsacl = NULL; + error = 0; + + sb = (struct stat *)sbptr; + + /* + * Allocate an initial buffer. + */ + if ((fsacl = malloc(ACL_MIN_SIZE_HEURISTIC)) == NULL) { + error = ENOMEM; + goto out; + } + buffer_size = ACL_MIN_SIZE_HEURISTIC; + + /* + * Loop until we have the ACL. + */ + for (;;) { + fsacl_size = buffer_size; + + if ((error = stat_syscall(obj, sbptr, fsacl, &fsacl_size)) != 0) + goto out; + + /* + * No error, did we get the ACL? + */ + if (fsacl_size <= buffer_size) + break; + + /* no, use supplied buffer size plus some padding */ + ofsacl = fsacl; + fsacl = realloc(fsacl, fsacl_size + sizeof(struct kauth_ace) * 2); + if (fsacl == NULL) { + fsacl = ofsacl; + errno = ENOMEM; + goto out; + } + buffer_size = fsacl_size; + } + + /* populate filesec with values from stat */ + filesec_set_property(fsec, FILESEC_OWNER, &(sb->st_uid)); + filesec_set_property(fsec, FILESEC_GROUP, &(sb->st_gid)); + filesec_set_property(fsec, FILESEC_MODE, &(sb->st_mode)); + + /* if we got a kauth_filesec, take values from there too */ + if (fsacl_size >= sizeof(struct kauth_filesec)) { + filesec_set_property(fsec, FILESEC_UUID, &fsacl->fsec_owner); + filesec_set_property(fsec, FILESEC_GRPUUID, &fsacl->fsec_group); + + /* check to see whether there's actually an ACL here */ + if (fsacl->fsec_acl.acl_entrycount != KAUTH_FILESEC_NOACL) { + filesec_set_property(fsec, FILESEC_ACL_ALLOCSIZE, &fsacl_size); + filesec_set_property(fsec, FILESEC_ACL_RAW, &fsacl); + fsacl = NULL; /* avoid freeing it below */ + } else { + filesec_set_property(fsec, FILESEC_ACL_ALLOCSIZE, NULL); + filesec_set_property(fsec, FILESEC_ACL_RAW, NULL); + } + } else { + filesec_set_property(fsec, FILESEC_UUID, NULL); + filesec_set_property(fsec, FILESEC_GRPUUID, NULL); + filesec_set_property(fsec, FILESEC_ACL_ALLOCSIZE, NULL); + filesec_set_property(fsec, FILESEC_ACL_RAW, NULL); + } +out: + if (fsacl != NULL) + free(fsacl); + return(error); +} diff --git a/sys/umaskx_np.c b/sys/umaskx_np.c new file mode 100644 index 0000000..478332c --- /dev/null +++ b/sys/umaskx_np.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include +#include +#include + +extern int __umask_extended(int, acl_t); + +int +umaskx_np(filesec_t fsec) +{ + acl_t acl = NULL; + size_t size = 0; + mode_t newmask = 0; + + if (fsec) + { + if ((filesec_get_property(fsec, FILESEC_MODE, &newmask) != 0) && (errno != ENOENT)) + return(-1); + + if (((filesec_get_property(fsec, FILESEC_ACL_RAW, &acl) != 0) || + (filesec_get_property(fsec, FILESEC_ACL_ALLOCSIZE, &size) != 0)) && + (errno != ENOENT)) + return(-1); + if (size == 0) + acl = NULL; + } + return __umask_extended(newmask, acl); +} diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt new file mode 100644 index 0000000..b2167e7 --- /dev/null +++ b/util/CMakeLists.txt @@ -0,0 +1,17 @@ +project(libc-util) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") + +set(util_sources + fparseln.c + login_tty.c + login.c + logout.c + logwtmp.c + mkpath_np.c + opendev.c + pty.c) + +add_darling_object_library(libc-util ${util_sources}) diff --git a/util/fparseln.3 b/util/fparseln.3 new file mode 100644 index 0000000..afb4688 --- /dev/null +++ b/util/fparseln.3 @@ -0,0 +1,156 @@ +.\" $NetBSD: fparseln.3,v 1.7 1999/07/02 15:49:12 simonb Exp $ +.\" $FreeBSD: src/lib/libutil/fparseln.3,v 1.9 2001/10/01 16:09:18 ru Exp $ +.\" +.\" Copyright (c) 1997 Christos Zoulas. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Christos Zoulas. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd December 1, 1997 +.Dt FPARSELN 3 +.Os +.Sh NAME +.Nm fparseln +.Nd return the next logical line from a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.In util.h +.Ft "char *" +.Fo fparseln +.Fa "FILE *stream" "size_t *len" "size_t *lineno" +.Fa "const char delim[3]" "int flags" +.Fc +.Sh DESCRIPTION +The +.Fn fparseln +function +returns a pointer to the next logical line from the stream referenced by +.Fa stream . +This string is +.Dv NUL +terminated and it is dynamically allocated on each invocation. +It is the +responsibility of the caller to free the pointer. +.Pp +By default, if a character is escaped, both it and the preceding escape +character will be present in the returned string. +Various +.Fa flags +alter this behaviour. +.Pp +The meaning of the arguments is as follows: +.Bl -tag -width "lineno" +.It Fa stream +The stream to read from. +.It Fa len +If not +.Dv NULL , +the length of the string is stored in the memory location to which it +points. +.It Fa lineno +If not +.Dv NULL , +the value of the memory location to which is pointed to, is incremented +by the number of lines actually read from the file. +.It Fa delim +Contains the escape, continuation, and comment characters. +If a character is +.Dv NUL +then processing for that character is disabled. +If +.Dv NULL , +all characters default to values specified below. +The contents of +.Fa delim +is as follows: +.Bl -tag -width "delim[0]" +.It Fa delim[0] +The escape character, which defaults to +.Cm \e , +is used to remove any special meaning from the next character. +.It Fa delim[1] +The continuation character, which defaults to +.Cm \e , +is used to indicate that the next line should be concatenated with the +current one if this character is the last character on the current line +and is not escaped. +.It Fa delim[2] +The comment character, which defaults to +.Cm # , +if not escaped indicates the beginning of a comment that extends until the +end of the current line. +.El +.It Fa flags +If non-zero, alter the operation of +.Fn fparseln . +The various flags, which may be +.Em or Ns -ed +together, are: +.Bl -tag -width "FPARSELN_UNESCCOMM" +.It Dv FPARSELN_UNESCCOMM +Remove escape preceding an escaped comment. +.It Dv FPARSELN_UNESCCONT +Remove escape preceding an escaped continuation. +.It Dv FPARSELN_UNESCESC +Remove escape preceding an escaped escape. +.It Dv FPARSELN_UNESCREST +Remove escape preceding any other character. +.It Dv FPARSELN_UNESCALL +All of the above. +.El +.Pp +.El +.Sh RETURN VALUES +Upon successful completion a pointer to the parsed line is returned; +otherwise, +.Dv NULL +is returned. +.Pp +The +.Fn fparseln +function uses internally +.Xr fgetln 3 , +so all error conditions that apply to +.Xr fgetln 3 , +apply to +.Fn fparseln . +In addition +.Fn fparseln +may set +.Va errno +to +.Er ENOMEM +and return +.Dv NULL +if it runs out of memory. +.Sh SEE ALSO +.Xr fgetln 3 +.Sh HISTORY +The +.Fn fparseln +function first appeared in +.Nx 1.4 . diff --git a/util/fparseln.c b/util/fparseln.c new file mode 100644 index 0000000..04aa82e --- /dev/null +++ b/util/fparseln.c @@ -0,0 +1,233 @@ +/* $NetBSD: fparseln.c,v 1.9 1999/09/20 04:48:06 lukem Exp $ */ + +/* + * Copyright (c) 1997 Christos Zoulas. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christos Zoulas. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: src/lib/libutil/fparseln.c,v 1.5 2002/03/21 23:52:49 obrien Exp $"); + +#include +#include +#include +#include +#include +#include +#include + +static int isescaped(const char *, const char *, int); + +/* isescaped(): + * Return true if the character in *p that belongs to a string + * that starts in *sp, is escaped by the escape character esc. + */ +static int +isescaped(sp, p, esc) + const char *sp, *p; + int esc; +{ + const char *cp; + size_t ne; + +#if 0 + _DIAGASSERT(sp != NULL); + _DIAGASSERT(p != NULL); +#endif + + /* No escape character */ + if (esc == '\0') + return 1; + + /* Count the number of escape characters that precede ours */ + for (ne = 0, cp = p; --cp >= sp && *cp == esc; ne++) + continue; + + /* Return true if odd number of escape characters */ + return (ne & 1) != 0; +} + + +/* fparseln(): + * Read a line from a file parsing continuations ending in \ + * and eliminating trailing newlines, or comments starting with + * the comment char. + */ +char * +fparseln(fp, size, lineno, str, flags) + FILE *fp; + size_t *size; + size_t *lineno; + const char str[3]; + int flags; +{ + static const char dstr[3] = { '\\', '\\', '#' }; + + size_t s, len; + char *buf; + char *ptr, *cp; + int cnt; + char esc, con, nl, com; + +#if 0 + _DIAGASSERT(fp != NULL); +#endif + + len = 0; + buf = NULL; + cnt = 1; + + if (str == NULL) + str = dstr; + + esc = str[0]; + con = str[1]; + com = str[2]; + /* + * XXX: it would be cool to be able to specify the newline character, + * but unfortunately, fgetln does not let us + */ + nl = '\n'; + + while (cnt) { + cnt = 0; + + if (lineno) + (*lineno)++; + + if ((ptr = fgetln(fp, &s)) == NULL) + break; + + if (s && com) { /* Check and eliminate comments */ + for (cp = ptr; cp < ptr + s; cp++) + if (*cp == com && !isescaped(ptr, cp, esc)) { + s = cp - ptr; + cnt = s == 0 && buf == NULL; + break; + } + } + + if (s && nl) { /* Check and eliminate newlines */ + cp = &ptr[s - 1]; + + if (*cp == nl) + s--; /* forget newline */ + } + + if (s && con) { /* Check and eliminate continuations */ + cp = &ptr[s - 1]; + + if (*cp == con && !isescaped(ptr, cp, esc)) { + s--; /* forget escape */ + cnt = 1; + } + } + + if (s == 0 && buf != NULL) + continue; + + if ((cp = realloc(buf, len + s + 1)) == NULL) { + free(buf); + return NULL; + } + buf = cp; + + (void) memcpy(buf + len, ptr, s); + len += s; + buf[len] = '\0'; + } + + if ((flags & FPARSELN_UNESCALL) != 0 && esc && buf != NULL && + strchr(buf, esc) != NULL) { + ptr = cp = buf; + while (cp[0] != '\0') { + int skipesc; + + while (cp[0] != '\0' && cp[0] != esc) + *ptr++ = *cp++; + if (cp[0] == '\0' || cp[1] == '\0') + break; + + skipesc = 0; + if (cp[1] == com) + skipesc += (flags & FPARSELN_UNESCCOMM); + if (cp[1] == con) + skipesc += (flags & FPARSELN_UNESCCONT); + if (cp[1] == esc) + skipesc += (flags & FPARSELN_UNESCESC); + if (cp[1] != com && cp[1] != con && cp[1] != esc) + skipesc = (flags & FPARSELN_UNESCREST); + + if (skipesc) + cp++; + else + *ptr++ = *cp++; + *ptr++ = *cp++; + } + *ptr = '\0'; + len = strlen(buf); + } + + if (size) + *size = len; + return buf; +} + +#ifdef TEST + +int main(int, char **); + +int +main(argc, argv) + int argc; + char **argv; +{ + char *ptr; + size_t size, line; + + line = 0; + while ((ptr = fparseln(stdin, &size, &line, NULL, + FPARSELN_UNESCALL)) != NULL) + printf("line %d (%d) |%s|\n", line, size, ptr); + return 0; +} + +/* + +# This is a test +line 1 +line 2 \ +line 3 # Comment +line 4 \# Not comment \\\\ + +# And a comment \ +line 5 \\\ +line 6 + +*/ + +#endif /* TEST */ diff --git a/util/login.3 b/util/login.3 new file mode 100644 index 0000000..a741beb --- /dev/null +++ b/util/login.3 @@ -0,0 +1,112 @@ +.\" Copyright (c) 1995 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software developed by the Computer Systems +.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract +.\" BG 91-66 and contributed to Berkeley. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd December 14, 1995 +.Dt LOGIN 3 +.Os +.Sh NAME +.Nm login , +.Nm logout , +.Nm logwtmp +.Nd login utility functions (DEPRECATED) +.Sh SYNOPSIS +.Fd #include +.Ft void +.Fn login "struct utmp *ut" +.Ft int +.Fn logout "const char *line" +.Ft void +.Fn logwtmp "const char *line" "const char *name" "const char *host" +.Sh DESCRIPTION +The +.Fn login , +.Fn logout , +and +.Fn logwtmp +functions are +.Sy DEPRECATED ; +use +.Xr pututxline 3 +instead. +.Pp +These functions operate on the database of current users in +.Pa /var/run/utmpx +and the system log file. +Superuser permission is required. +.Pp +The +.Fn login +function updates the +.Pa /var/run/utmpx +files with user information contained in +.Fa ut +(after converting to a struct utmpx, as described in +.Xr pututxline 3 ) . +.Pp +The +.Fn logout +function removes the entry from +.Pa /var/run/utmpx +corresponding to the device +.Fa line . +.Pp +The +.Fn logwtmp +function adds an entry to +the system log file. +Since +.Fn login +will add the appropriate entry +during a login, +.Fn logwtmp +is usually used for logouts. +.Sh RETURN VALUES +.Fn logout +returns non-zero if it was able to find and delete an entry for +.Fa line , +and zero if there is no entry for +.Fa line +in +.Pa /var/run/utmpx . +However, there is no error indication due to lack of permissions. +.Sh FILES +.Bl -tag -width /var/run/wtmp -compact +.It Pa /dev/\(** +.It Pa /var/run/utmpx +.El +.Sh SEE ALSO +.Xr pututxline 3 , +.Xr utmp 5 , +.Xr utmpx 5 diff --git a/util/login.c b/util/login.c new file mode 100644 index 0000000..c1599cd --- /dev/null +++ b/util/login.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +void +login(struct utmp *ut) +{ + struct utmpx ux; + + getutmpx(ut, &ux); + /* ut_id will automatically be calculated in the call to pututxline() */ + ux.ut_type |= UTMPX_AUTOFILL_MASK; + setutxent(); + pututxline(&ux); + endutxent(); +} + +#pragma clang diagnostic pop diff --git a/util/login_tty.c b/util/login_tty.c new file mode 100644 index 0000000..56e0372 --- /dev/null +++ b/util/login_tty.c @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-prototypes" + +int login_tty(fd) + int fd; +{ + (void) setsid(); + if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1) + return (-1); + (void) dup2(fd, 0); + (void) dup2(fd, 1); + (void) dup2(fd, 2); + if (fd > 2) + (void) close(fd); + return (0); +} +#pragma clang diagnostic pop diff --git a/util/logout.c b/util/logout.c new file mode 100644 index 0000000..428d41d --- /dev/null +++ b/util/logout.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 1999, 2005, 2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +#ifdef UTMP_COMPAT +#include +#endif /* UTMP_COMPAT */ +#include +#include +#include +#include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconstant-conversion" + +int +logout(char *line) +{ + struct utmpx *ux, utx; +#ifdef UTMP_COMPAT +#ifdef __LP64__ + struct utmp32 u; +#else /* __LP64__ */ + struct utmp u; +#endif /* __LP64__ */ + int which; +#endif /* UTMP_COMPAT */ + + struct _utmpx *def_utx = __default_utx(); + + bzero(&utx, sizeof(utx)); + strncpy(utx.ut_line, line, sizeof(utx.ut_line)); + utx.ut_type = UTMPX_AUTOFILL_MASK | UTMPX_DEAD_IF_CORRESPONDING_MASK | DEAD_PROCESS; + (void)gettimeofday(&utx.ut_tv, NULL); + UTMPX_LOCK(def_utx); + __setutxent(def_utx); + ux = __pututxline(def_utx, &utx); + __endutxent(def_utx); + if (!ux) { + UTMPX_UNLOCK(def_utx); + return 0; + } +#ifdef UTMP_COMPAT + if (__utx__.utfile_system) { /* only if we are using _PATH_UTMPX */ + which = _utmp_compat(ux, &u); + if (which & UTMP_COMPAT_UTMP0) + _write_utmp(&u, 0); + else if (which & UTMP_COMPAT_UTMP1) + _write_utmp(&u, 1); + } +#endif /* UTMP_COMPAT */ + UTMPX_UNLOCK(def_utx); + return 1; +} +#pragma clang diagnostic pop diff --git a/util/logwtmp.c b/util/logwtmp.c new file mode 100644 index 0000000..82dc503 --- /dev/null +++ b/util/logwtmp.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 1999, 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include + +#include +#include +#ifdef UTMP_COMPAT +#include +#endif /* UTMP_COMPAT */ +#include +#include + +void +logwtmp(char *line, char *name, char *host) +{ + struct utmpx utx; +#ifdef UTMP_COMPAT +#ifdef __LP64__ + struct utmp32 u; +#else /* __LP64__ */ + struct utmp u; +#endif /* __LP64__ */ + int which; +#endif /* UTMP_COMPAT */ + + bzero(&utx, sizeof(utx)); + /* + * line should never be "|" or "{", because this interface doesn't allow + * setting ut_tv. + */ + if (strcmp(line, "~") == 0) + utx.ut_type = strcmp(name, "reboot") == 0 ? BOOT_TIME : SHUTDOWN_TIME; + else { + strncpy(utx.ut_user, name, sizeof(utx.ut_user)); + strncpy(utx.ut_line, line, sizeof(utx.ut_line)); + utx.ut_pid = getpid(); + utx.ut_type = *name ? USER_PROCESS : DEAD_PROCESS; + strncpy(utx.ut_host, host, sizeof(utx.ut_host)); + } + (void)gettimeofday(&utx.ut_tv, NULL); + _utmpx_asl(&utx); +#ifdef UTMP_COMPAT + which = _utmp_compat(&utx, &u); + if (which & UTMP_COMPAT_WTMP) + _write_wtmp(&u); + if (which & UTMP_COMPAT_LASTLOG) + _write_lastlog(&u, NULL); +#endif /* UTMP_COMPAT */ +} diff --git a/util/mkpath_np.3 b/util/mkpath_np.3 new file mode 100644 index 0000000..b5be64b --- /dev/null +++ b/util/mkpath_np.3 @@ -0,0 +1,80 @@ +.\" Copyright (c) 2011 Apple Inc. All rights reserved. +.\" +.\" @APPLE_LICENSE_HEADER_START@ +.\" +.\" This file contains Original Code and/or Modifications of Original Code +.\" as defined in and that are subject to the Apple Public Source License +.\" Version 2.0 (the 'License'). You may not use this file except in +.\" compliance with the License. Please obtain a copy of the License at +.\" http://www.opensource.apple.com/apsl/ and read it before using this +.\" file. +.\" +.\" The Original Code and all software distributed under the License are +.\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +.\" Please see the License for the specific language governing rights and +.\" limitations under the License. +.\" +.\" @APPLE_LICENSE_HEADER_END@ +.\" +.Dd July 13, 2011 +.Dt mkpath_np 3 +.Os "Mac OS X" +.Sh NAME +.Nm mkpath_np +.Nd Auxiliary routine for efficiently creating paths +.Sh SYNOPSIS +.Fd #include +.\" +.Ft int +.Fo mkpath_np +.Fa "const char * path" +.Fa "mode_t omode" +.Fc +.Sh DESCRIPTION +This routine allows the caller to create a path, including intermediate +directories. It is equivalent to calling +.Xr mkdir 1 +with the -p command line argument. +.Pp +Intermediate directories are created with permission bits of rwxrwxrwx (0777) +as modified by the current umask, plus write and search permission for the +owner. +.Pp +The leaf directory is created with permission bits of +.Fa omode +as modified by the current umask. +.Sh RETURN VALUES +A 0 return value indicates success. If an error occurs, the return value is a +non-zero error code. Note that EEXIST is returned iff the leaf directory +already exists and is a directory, so under certain circumstances, this error +value may not indicate a failure state. +.Pp +This routine does NOT modify errno. +.Sh ERRORS +Any error code that can be returned by +.Xr mkdir 2 +can be returned by +.Fn mkpath_np , +but +.Fn mkpath_np +will return the error code rather than setting errno. +.Bl -tag -width Er +.\" ========== +.It Bq Er ENOTDIR +A component of the path is not a directory (in contrast to +.Xr mkdir 2 +which returns this based on the path prefix rather than the path). +.\" ========== +.It Bq Er EEXIST +The path already exists and is a directory. +.El +.Sh HISTORY +This function first appeared in +iOS 5.0. +.Sh SEE ALSO +.Xr mkdir 1 , +.Xr chmod 2 , +.Xr mkdir 2 diff --git a/util/mkpath_np.c b/util/mkpath_np.c new file mode 100644 index 0000000..b830b3f --- /dev/null +++ b/util/mkpath_np.c @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include +#include +#include +#include + +static int +_mkpath(int dfd, const char *path, mode_t omode, const char ** firstdir) +{ + char *apath = NULL, *opath = NULL, *s, *sn, *sl; + unsigned int depth = 0; + mode_t chmod_mode = 0; + int retval = 0; + int old_errno = errno; + struct stat sbuf; + + /* Try the trivial case first. */ + if (0 == mkdirat(dfd, path, omode)) { + if (firstdir) { + *firstdir = strdup(path); + } + goto mkpath_exit; + } + + /* Anything other than an ENOENT, EEXIST, or EISDIR indicates an + * error that we need to send back to the caller. ENOENT indicates + * that we need to try a lower level. + */ + switch (errno) { + case ENOENT: + break; + case EEXIST: + if (fstatat(dfd, path, &sbuf, 0) == 0) { + if (S_ISDIR(sbuf.st_mode)) { + retval = EEXIST; + } else { + retval = ENOTDIR; + } + } else { + retval = EIO; + } + goto mkpath_exit; + case EISDIR: /* */ + retval = EEXIST; + goto mkpath_exit; + default: + retval = errno; + goto mkpath_exit; + } + + apath = strdup(path); + if (apath == NULL) { + retval = ENOMEM; + goto mkpath_exit; + } + + sl = s = apath + strlen(apath) - 1; + do { + sn = s; + /* Strip off trailing /., see */ + if (s - 1 > apath && *s == '.' && *(s - 1) == '/') + s -= 2; + /* Strip off trailing /, see */ + if (s > apath && *s == '/') + s--; + } while (s < sn); + if (s < sl) { + s[1] = '\0'; + path = opath = strdup(apath); + if (opath == NULL) { + retval = ENOMEM; + goto mkpath_exit; + } + } + + /* Retry the trivial case after having stripped of trailing /. */ + if (0 == mkdirat(dfd, path, omode)) { + if (firstdir) { + *firstdir = strdup(path); + } + goto mkpath_exit; + } + + while (1) { + /* Increase our depth and try making that directory */ + s = strrchr(apath, '/'); + if (!s) { + /* We should never hit this under normal circumstances, + * but it can occur due to really unfortunate timing + */ + retval = ENOENT; + goto mkpath_exit; + } + *s = '\0'; + depth++; + + if (0 == mkdirat(dfd, apath, S_IRWXU | S_IRWXG | S_IRWXO)) { + /* Found our starting point */ + + /* POSIX 1003.2: + * For each dir operand that does not name an existing + * directory, effects equivalent to those cased by the + * following command shall occcur: + * + * mkdir -p -m $(umask -S),u+wx $(dirname dir) && + * mkdir [-m mode] dir + */ + + struct stat dirstat; + if (-1 == fstatat(dfd, apath, &dirstat, 0)) { + /* Really unfortunate timing ... */ + retval = ENOENT; + goto mkpath_exit; + } + + if ((dirstat.st_mode & (S_IWUSR | S_IXUSR)) != (S_IWUSR | S_IXUSR)) { + chmod_mode = dirstat.st_mode | S_IWUSR | S_IXUSR; + if (-1 == fchmodat(dfd, apath, chmod_mode, 0)) { + /* Really unfortunate timing ... */ + retval = ENOENT; + goto mkpath_exit; + } + } + + if (firstdir) { + *firstdir = strdup(apath); + } + break; + } else if (errno == EEXIST) { + /* Some other process won the race in creating this directory + * before we did. We will use this as our starting point. + * See: + */ + if (fstatat(dfd, apath, &sbuf, 0) == 0 && + S_ISDIR(sbuf.st_mode)) { + + if (firstdir) { + *firstdir = strdup(apath); + } + break; + } + + retval = ENOTDIR; + goto mkpath_exit; + } else if (errno != ENOENT) { + retval = errno; + goto mkpath_exit; + } + } + + while (depth > 1) { + /* Decrease our depth and make that directory */ + s = strrchr(apath, '\0'); + *s = '/'; + depth--; + + if (-1 == mkdirat(dfd, apath, S_IRWXU | S_IRWXG | S_IRWXO)) { + /* This handles "." and ".." added to the new section of path */ + if (errno == EEXIST) + continue; + retval = errno; + goto mkpath_exit; + } + + if (chmod_mode) { + if (-1 == fchmodat(dfd, apath, chmod_mode, 0)) { + /* Really unfortunate timing ... */ + retval = ENOENT; + goto mkpath_exit; + } + } + } + + if (-1 == mkdirat(dfd, path, omode)) { + retval = errno; + if (errno == EEXIST && + fstatat(dfd, path, &sbuf, 0) == 0 && + !S_ISDIR(sbuf.st_mode)) { + retval = ENOTDIR; + } + } + +mkpath_exit: + free(apath); + free(opath); + + errno = old_errno; + return retval; +} + +/* This extended version of mkpath_np is provided to help NSFileManager + * maintain binary compatibility. If firstdir is not NULL, *firstdir will be + * set to the path of the first created directory, and it is the caller's + * responsibility to free the returned string. This SPI is subject to removal + * once NSFileManager no longer has a need for it, and use in new code is + * highly discouraged. + * + * See: + */ + +int +_mkpath_np(const char *path, mode_t omode, const char ** firstdir) { + return _mkpath(AT_FDCWD, path, omode, firstdir); +} + +int mkpath_np(const char *path, mode_t omode) { + return _mkpath(AT_FDCWD, path, omode, NULL); +} + +int mkpathat_np(int dfd, const char *path, mode_t omode) { + return _mkpath(dfd, path, omode, NULL); +} diff --git a/util/opendev.3 b/util/opendev.3 new file mode 100644 index 0000000..81c5331 --- /dev/null +++ b/util/opendev.3 @@ -0,0 +1,104 @@ +.\" $OpenBSD: opendev.3,v 1.15 2002/05/01 08:03:30 mpech Exp $ +.\" +.\" Copyright (c) 2000, Todd C. Miller. All rights reserved. +.\" Copyright (c) 1996, Jason Downs. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS +.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd December 12, 2002 +.Dt OPENDEV 3 +.Os +.Sh NAME +.Nm opendev +.Nd short form device open routine +.Sh SYNOPSIS +.Fd #include +.Ft int +.Fn opendev "char *path" "int oflags" "int dflags" "char **realpath" +.Sh DESCRIPTION +The +.Fn opendev +function opens a device using the +.Dq short form +name. +This is typically +.Dq disk0s3 , +for instance, which will be expanded to +.Pa /dev/rdisk0s3 +on most architectures. +.Pp +Device name lookup is done by first checking +.Fa path +for a +.Dq / +and if one is found attempting to open that file. +Otherwise +.Fa /dev +is searched for a matching device. +.Pp +The +.Fa oflags +are the same as the +.Fa flags +passed to +.Xr open 2 . +.Pp +The +.Fa dflags +are specified by +.Tn OR Ns 'ing +the following values: +.Pp +.Bd -literal -offset indent -compact +OPENDEV_PART attempt to open the raw partition during expansion +OPENDEV_BLCK open the block device (default is character device) +.Ed +.Pp +The +.Dq raw +partition is defined as the partition which provides access to the entire +disk, regardless of the disk's partition map. +.Pp +If +.Fa realpath +is not +.Dv NULL , +it is modified to point at the fully expanded device name. +.Sh RETURN VALUES +The +.Fn opendev +return value and errors are the same as the return value and errors of +.Xr open 2 . +.Sh WARNINGS +If +.Fa realpath +is not +.Dv NULL , +on return it will point to internal +static storage space that will be overwritten by subsequent calls. +.Sh SEE ALSO +.Xr open 2 +.Sh HISTORY +The +.Fn opendev +function first appeared in +.Ox 1.2 . diff --git a/util/opendev.c b/util/opendev.c new file mode 100644 index 0000000..ee5c85b --- /dev/null +++ b/util/opendev.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2000, Todd C. Miller. All rights reserved. + * Copyright (c) 1996, Jason Downs. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "util.h" + +/* + * opendev(3) is an inherently non-thread-safe API, since + * it returns a buffer to global storage. However we can + * at least make sure the storage allocation is thread safe + * and does not leak memory in case of simultaneous + * initialization + */ +static pthread_once_t opendev_namebuf_once = PTHREAD_ONCE_INIT; +static char *namebuf = NULL; + +static void opendev_namebuf_init(void); + +int +opendev(path, oflags, dflags, realpath) + char *path; + int oflags; + int dflags; + char **realpath; +{ + int fd; + char *slash, *prefix; + + /* Initial state */ + if (realpath) + *realpath = path; + fd = -1; + errno = ENOENT; + + if (pthread_once(&opendev_namebuf_once, + opendev_namebuf_init) + || !namebuf) { + errno = ENOMEM; + return -1; + } + + if (dflags & OPENDEV_BLCK) + prefix = ""; /* block device */ + else + prefix = "r"; /* character device */ + + if ((slash = strchr(path, '/'))) + fd = open(path, oflags); + else if (dflags & OPENDEV_PART) { + if (snprintf(namebuf, PATH_MAX, "%s%s%s", + _PATH_DEV, prefix, path) < PATH_MAX) { + char *slice; + while ((slice = strrchr(namebuf, 's')) && + isdigit(*(slice-1))) *slice = '\0'; + fd = open(namebuf, oflags); + if (realpath) + *realpath = namebuf; + } else + errno = ENAMETOOLONG; + } + if (!slash && fd == -1 && errno == ENOENT) { + if (snprintf(namebuf, PATH_MAX, "%s%s%s", + _PATH_DEV, prefix, path) < PATH_MAX) { + fd = open(namebuf, oflags); + if (realpath) + *realpath = namebuf; + } else + errno = ENAMETOOLONG; + } + return (fd); +} + +static void opendev_namebuf_init(void) +{ + namebuf = malloc(PATH_MAX); +} diff --git a/util/openpty.3 b/util/openpty.3 new file mode 100644 index 0000000..8973562 --- /dev/null +++ b/util/openpty.3 @@ -0,0 +1,159 @@ +.\" $OpenBSD: openpty.3,v 1.3 1996/11/24 23:53:12 millert Exp $ +.\" Copyright (c) 1995 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software developed by the Computer Systems +.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract +.\" BG 91-66 and contributed to Berkeley. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd April 5, 2008 +.Dt OPENPTY 3 +.Os +.Sh NAME +.Nm openpty , +.Nm login_tty , +.Nm forkpty +.Nd tty utility functions +.Sh SYNOPSIS +.Fd #include +.Ft int +.Fn openpty "int *amaster" "int *aslave" "char *name" "struct termios *termp" "struct winsize *winp" +.Ft int +.Fn login_tty "int fd" +.Ft pid_t +.Fn forkpty "int *amaster" "char *name" "struct termios *termp" "struct winsize *winp" +.Sh DESCRIPTION +The +.Fn openpty , +.Fn login_tty , +and +.Fn forkpty +functions perform manipulations on ttys and pseudo-ttys. +.Pp +The +.Fn openpty +function allocates a pseudo-tty and returns file descriptors +for the master and slave in +.Fa amaster +and +.Fa aslave . +If +.Fa name +is non-null, the filename of the slave is returned in +.Fa name . +If +.Fa termp +is non-null, the terminal parameters of the slave will be set to the +values in +.Fa termp . +If +.Fa winp +is non-null, the window size of the slave will be set to the values in +.Fa winp . +.Pp +The +.Fn login_tty +function prepares for a login on the tty +.Fa fd +(which may be a real tty device, or the slave of a pseudo-tty as +returned by +.Fn openpty ) +by creating a new session, making +.Fa fd +the controlling terminal for the current process, setting +.Fa fd +to be the standard input, output, and error streams of the current +process, and closing +.Fa fd . +.Pp +The +.Fn forkpty +function combines +.Fn openpty , +.Fn fork , +and +.Fn login_tty +to creates a new process operating in a pseudo-tty. The file +descriptor of the master side of the pseudo-tty is returned in +.Fa amaster , +and the filename of the slave in +.Fa name +if it is non-null. The +.Fa termp +and +.Fa winp +parameters, if non-null, will determine the terminal attributes and +window size of the slave side of the pseudo-tty. +.Sh RETURN VALUES +If a call to +.Fn openpty , +.Fn login_tty , +or +.Fn forkpty +is not successful, -1 is returned and +.Va errno +is set to indicate the error. Otherwise, +.Fn openpty , +.Fn login_tty , +and the child process of +.Fn forkpty +return 0, and the parent process of +.Fn forkpty +returns the process ID of the child process. +.Sh ERRORS +.Fn openpty +will fail if: +.Bl -tag -width Er +.It Bq Er EAGAIN +There are no available pseudo-ttys. +.El +.Pp +.Fn login_tty +will fail if +.Fn ioctl +fails to set +.Fa fd +to the controlling terminal of the current process. +.Fn forkpty +will fail if either +.Fn openpty +or +.Fn fork +fails. +.Sh FILES +.Bl -tag -width /dev/ttys[0-9][0-9][0-9] -compact +.It Pa /dev/ptmx +cloning pseudo-tty device +.It Pa /dev/ttys[0-9][0-9][0-9] +slave pseudo-tty devices +.El +.Sh SEE ALSO +.Xr fork 2 diff --git a/util/pty.c b/util/pty.c new file mode 100644 index 0000000..1b7a3bd --- /dev/null +++ b/util/pty.c @@ -0,0 +1,140 @@ +/* + * Copyright (c) 1999, 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int openpty(amaster, aslave, name, termp, winp) + int *amaster, *aslave; + char *name; + struct termios *termp; + struct winsize *winp; +{ + int master, slave; + char sname[128]; + + if ((master = posix_openpt(O_RDWR|O_NOCTTY)) < 0) + return -1; + if (grantpt(master) < 0 || unlockpt(master) < 0 + || ptsname_r(master, sname, sizeof(sname)) == -1 + || (slave = open(sname, O_RDWR|O_NOCTTY, 0)) < 0) { + (void) close(master); + return -1; + } + *amaster = master; + *aslave = slave; + if (name) + strcpy(name, sname); + if (termp) + (void) tcsetattr(slave, TCSAFLUSH, termp); + if (winp) + (void) ioctl(slave, TIOCSWINSZ, (char *)winp); + return (0); +} + +int +forkpty(amaster, name, termp, winp) + int *amaster; + char *name; + struct termios *termp; + struct winsize *winp; +{ + int master, slave, pid; + + if (openpty(&master, &slave, name, termp, winp) == -1) + return (-1); + switch (pid = fork()) { + case -1: + return (-1); + case 0: + /* + * child + */ + (void) close(master); + /* + * 4300297: login_tty() may fail to set the controlling tty. + * Since we have already forked, the best we can do is to + * dup the slave as if login_tty() succeeded. + */ + if (login_tty(slave) < 0) { + syslog(LOG_ERR, "forkpty: login_tty could't make controlling tty"); + (void) dup2(slave, 0); + (void) dup2(slave, 1); + (void) dup2(slave, 2); + if (slave > 2) + (void) close(slave); + } + return (0); + } + /* + * parent + */ + *amaster = master; + (void) close(slave); + return (pid); +} diff --git a/uuid/CMakeLists.txt b/uuid/CMakeLists.txt new file mode 100644 index 0000000..77a84f1 --- /dev/null +++ b/uuid/CMakeLists.txt @@ -0,0 +1,19 @@ +project(libc-uuid) + +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}") + +set(uuid_sources + uuidsrc/clear.c + uuidsrc/compare.c + uuidsrc/copy.c + uuidsrc/gen_uuid.c + uuidsrc/pack.c + uuidsrc/parse.c + uuidsrc/isnull.c + uuidsrc/unpack.c + uuidsrc/unparse.c) + +add_darling_object_library(libc-uuid ${uuid_sources}) diff --git a/uuid/namespace.h b/uuid/namespace.h new file mode 100644 index 0000000..014e402 --- /dev/null +++ b/uuid/namespace.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _UUID_NAMESPACES_H_ +#define _UUID_NAMESPACES_H_ + +#include + +UUID_DEFINE( kFSUUIDNamespaceSHA1, 0xB3, 0xE2, 0x0F, 0x39, 0xF2, 0x92, 0x11, 0xD6, 0x97, 0xA4, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC ); + +#endif /* _UUID_NAMESPACES_H_ */ diff --git a/uuid/uuid-config.h b/uuid/uuid-config.h new file mode 100644 index 0000000..080ce54 --- /dev/null +++ b/uuid/uuid-config.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +// MacOS-specific settings for uuid +#define HAVE_NETINET_IN_H +#define HAVE_NET_IF_DL_H +#define HAVE_NET_IF_H +#define HAVE_SA_LEN +#define HAVE_SRANDOM +#define HAVE_STDINT_H +#define HAVE_STDLIB_H +#define HAVE_SYS_IOCTL_H +#define HAVE_SYS_SOCKET_H +#define HAVE_SYS_SOCKIO_H +#define HAVE_UNISTD_H +#define UUID_UNPARSE_DEFAULT_UPPER diff --git a/uuid/uuidman.sed b/uuid/uuidman.sed new file mode 100644 index 0000000..9730238 --- /dev/null +++ b/uuid/uuidman.sed @@ -0,0 +1,3 @@ +s/@E2FSPROGS_MONTH@/April/g +s/@E2FSPROGS_YEAR@/2004/g +s/@E2FSPROGS_VERSION@/1.36/g diff --git a/uuid/uuidsrc/clear.c b/uuid/uuidsrc/clear.c new file mode 100644 index 0000000..f3a1005 --- /dev/null +++ b/uuid/uuidsrc/clear.c @@ -0,0 +1,43 @@ +/* + * clear.c -- Clear a UUID + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +#include "string.h" + +#include "uuidP.h" + +void uuid_clear(uuid_t uu) +{ + memset(uu, 0, 16); +} + diff --git a/uuid/uuidsrc/compare.c b/uuid/uuidsrc/compare.c new file mode 100644 index 0000000..a9c505c --- /dev/null +++ b/uuid/uuidsrc/compare.c @@ -0,0 +1,55 @@ +/* + * compare.c --- compare whether or not two UUID's are the same + * + * Returns 0 if the two UUID's are different, and 1 if they are the same. + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +#include "uuidP.h" +#include + +#define UUCMP(u1,u2) if (u1 != u2) return((u1 < u2) ? -1 : 1); + +int uuid_compare(const uuid_t uu1, const uuid_t uu2) +{ + struct uuid uuid1, uuid2; + + uuid_unpack(uu1, &uuid1); + uuid_unpack(uu2, &uuid2); + + UUCMP(uuid1.time_low, uuid2.time_low); + UUCMP(uuid1.time_mid, uuid2.time_mid); + UUCMP(uuid1.time_hi_and_version, uuid2.time_hi_and_version); + UUCMP(uuid1.clock_seq, uuid2.clock_seq); + return memcmp(uuid1.node, uuid2.node, 6); +} + diff --git a/uuid/uuidsrc/copy.c b/uuid/uuidsrc/copy.c new file mode 100644 index 0000000..963bc81 --- /dev/null +++ b/uuid/uuidsrc/copy.c @@ -0,0 +1,45 @@ +/* + * copy.c --- copy UUIDs + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +#include "uuidP.h" + +void uuid_copy(uuid_t dst, const uuid_t src) +{ + unsigned char *cp1; + const unsigned char *cp2; + int i; + + for (i=0, cp1 = dst, cp2 = src; i < 16; i++) + *cp1++ = *cp2++; +} diff --git a/uuid/uuidsrc/gen_uuid.c b/uuid/uuidsrc/gen_uuid.c new file mode 100644 index 0000000..c56c8c9 --- /dev/null +++ b/uuid/uuidsrc/gen_uuid.c @@ -0,0 +1,257 @@ +/* + * gen_uuid.c --- generate a DCE-compatible uuid + * + * Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +/* + * Force inclusion of SVID stuff since we need it if we're compiling in + * gcc-wall wall mode + */ +#define _SVID_SOURCE + +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_IOCTL_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_SYS_SOCKIO_H +#include +#endif +#ifdef HAVE_NET_IF_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NET_IF_DL_H +#include +#endif + +#include "uuidP.h" + +#define get_random_bytes(a,b) arc4random_buf((a),(b)) + +/* + * Get the ethernet hardware address, if we can find it... + */ +static int get_node_id(unsigned char *node_id) +{ +#ifdef HAVE_NET_IF_H + int sd; + struct ifreq ifr, *ifrp; + struct ifconf ifc; + char buf[1024]; + int n, i; + unsigned char *a; +#ifdef AF_LINK + struct sockaddr_dl *sdlp; +#endif + +/* + * BSD 4.4 defines the size of an ifreq to be + * max(sizeof(ifreq), sizeof(ifreq.ifr_name)+ifreq.ifr_addr.sa_len + * However, under earlier systems, sa_len isn't present, so the size is + * just sizeof(struct ifreq) + */ +#ifdef HAVE_SA_LEN +#ifndef max +#define max(a,b) ((a) > (b) ? (a) : (b)) +#endif +#define ifreq_size(i) max(sizeof(struct ifreq),\ + sizeof((i).ifr_name)+(i).ifr_addr.sa_len) +#else +#define ifreq_size(i) sizeof(struct ifreq) +#endif /* HAVE_SA_LEN*/ + + sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); + if (sd < 0) { + return -1; + } + memset(buf, 0, sizeof(buf)); + ifc.ifc_len = sizeof(buf); + ifc.ifc_buf = buf; + if (ioctl (sd, SIOCGIFCONF, (char *)&ifc) < 0) { + close(sd); + return -1; + } + n = ifc.ifc_len; + for (i = 0; i < n; i+= ifreq_size(*ifrp) ) { + ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i); + strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); +#ifdef SIOCGIFHWADDR + if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0) + continue; + a = (unsigned char *) &ifr.ifr_hwaddr.sa_data; +#else +#ifdef SIOCGENADDR + if (ioctl(sd, SIOCGENADDR, &ifr) < 0) + continue; + a = (unsigned char *) ifr.ifr_enaddr; +#else +#ifdef AF_LINK + sdlp = (struct sockaddr_dl *) &ifrp->ifr_addr; + if ((sdlp->sdl_family != AF_LINK) || (sdlp->sdl_alen != 6)) + continue; + a = (unsigned char *) &sdlp->sdl_data[sdlp->sdl_nlen]; +#else + /* + * XXX we don't have a way of getting the hardware + * address + */ + close(sd); + return 0; +#endif /* AF_LINK */ +#endif /* SIOCGENADDR */ +#endif /* SIOCGIFHWADDR */ + /* + * Skip interfaces that return either 00:00:00:00:00:00 or + * 02:00:00:00:00:00. + */ + if ((!a[0] || a[0] == 0x02) && !a[1] && !a[2] && !a[3] && !a[4] && !a[5]) + continue; + if (node_id) { + memcpy(node_id, a, 6); + close(sd); + return 1; + } + } + close(sd); +#endif + return 0; +} + +/* Assume that the gettimeofday() has microsecond granularity */ +#define MAX_ADJUSTMENT 10 + +static int get_clock(uint32_t *clock_high, uint32_t *clock_low, uint16_t *ret_clock_seq) +{ + static int adjustment = 0; + static struct timeval last = {0, 0}; + static uint16_t clock_seq; + struct timeval tv; + unsigned long long clock_reg; + +try_again: + gettimeofday(&tv, 0); + if ((last.tv_sec == 0) && (last.tv_usec == 0)) { + get_random_bytes(&clock_seq, sizeof(clock_seq)); + clock_seq &= 0x3FFF; + last = tv; + last.tv_sec--; + } + if ((tv.tv_sec < last.tv_sec) || + ((tv.tv_sec == last.tv_sec) && + (tv.tv_usec < last.tv_usec))) { + clock_seq = (clock_seq+1) & 0x3FFF; + adjustment = 0; + last = tv; + } else if ((tv.tv_sec == last.tv_sec) && + (tv.tv_usec == last.tv_usec)) { + if (adjustment >= MAX_ADJUSTMENT) + goto try_again; + adjustment++; + } else { + adjustment = 0; + last = tv; + } + + clock_reg = tv.tv_usec*10 + adjustment; + clock_reg += ((unsigned long long) tv.tv_sec)*10000000; + clock_reg += (((unsigned long long) 0x01B21DD2) << 32) + 0x13814000; + + *clock_high = clock_reg >> 32; + *clock_low = clock_reg; + *ret_clock_seq = clock_seq; + return 0; +} + +void uuid_generate_time(uuid_t out) +{ + static unsigned char node_id[6]; + static int has_init = 0; + struct uuid uu; + uint32_t clock_mid; + + if (!has_init) { + if (get_node_id(node_id) <= 0) { + get_random_bytes(node_id, 6); + /* + * Set multicast bit, to prevent conflicts + * with IEEE 802 addresses obtained from + * network cards + */ + node_id[0] |= 0x01; + } + has_init = 1; + } + get_clock(&clock_mid, &uu.time_low, &uu.clock_seq); + uu.clock_seq |= 0x8000; + uu.time_mid = (uint16_t) clock_mid; + uu.time_hi_and_version = ((clock_mid >> 16) & 0x0FFF) | 0x1000; + memcpy(uu.node, node_id, 6); + uuid_pack(&uu, out); +} + +void uuid_generate_random(uuid_t out) +{ + uuid_t buf; + struct uuid uu; + + get_random_bytes(buf, sizeof(buf)); + uuid_unpack(buf, &uu); + + uu.clock_seq = (uu.clock_seq & 0x3FFF) | 0x8000; + uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x4000; + uuid_pack(&uu, out); +} + +/* + * This is the generic front-end + */ +void uuid_generate(uuid_t out) +{ + uuid_generate_random(out); +} diff --git a/uuid/uuidsrc/isnull.c b/uuid/uuidsrc/isnull.c new file mode 100644 index 0000000..54a8300 --- /dev/null +++ b/uuid/uuidsrc/isnull.c @@ -0,0 +1,48 @@ +/* + * isnull.c --- Check whether or not the UUID is null + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +#include "uuidP.h" + +/* Returns 1 if the uuid is the NULL uuid */ +int uuid_is_null(const uuid_t uu) +{ + const unsigned char *cp; + int i; + + for (i=0, cp = uu; i < 16; i++) + if (*cp++) + return 0; + return 1; +} + diff --git a/uuid/uuidsrc/libuuid.3.in b/uuid/uuidsrc/libuuid.3.in new file mode 100644 index 0000000..a06d8e6 --- /dev/null +++ b/uuid/uuidsrc/libuuid.3.in @@ -0,0 +1,66 @@ +.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca) +.\" +.\" %Begin-Header% +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, and the entire permission notice in its entirety, +.\" including the disclaimer of warranties. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +.\" WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +.\" USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +.\" DAMAGE. +.\" %End-Header% +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "@E2FSPROGS_VERSION@" +.SH NAME +uuid \- DCE compatible Universally Unique Identifier library +.SH SYNOPSIS +.B #include +.SH DESCRIPTION +The +UUID +library is used to generate unique identifiers for objects that may be +accessible beyond the local system. This library +generates UUIDs compatible with those created by the Open Software +Foundation (OSF) Distributed Computing Environment (DCE) utility +.BR uuidgen . +.sp +The UUIDs generated by this library can be reasonably expected to be +unique within a system, and unique across all systems. They could +be used, for instance, to generate unique HTTP cookies across multiple +web servers without communication between the servers, and without fear +of a name clash. +.SH "CONFORMING TO" +OSF DCE 1.1 +.SH AUTHOR +Theodore Y. Ts'o +.SH AVAILABILITY +.UR http://e2fsprogs.sourceforge.net/ +http://e2fsprogs.sourceforge.net/ +.UE +.SH "SEE ALSO" +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3), +.BR uuid_parse (3), +.BR uuid_unparse (3) diff --git a/uuid/uuidsrc/pack.c b/uuid/uuidsrc/pack.c new file mode 100644 index 0000000..348d432 --- /dev/null +++ b/uuid/uuidsrc/pack.c @@ -0,0 +1,69 @@ +/* + * Internal routine for packing UUID's + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +#include +#include "uuidP.h" + +void uuid_pack(const struct uuid *uu, uuid_t ptr) +{ + uint32_t tmp; + unsigned char *out = ptr; + + tmp = uu->time_low; + out[3] = (unsigned char) tmp; + tmp >>= 8; + out[2] = (unsigned char) tmp; + tmp >>= 8; + out[1] = (unsigned char) tmp; + tmp >>= 8; + out[0] = (unsigned char) tmp; + + tmp = uu->time_mid; + out[5] = (unsigned char) tmp; + tmp >>= 8; + out[4] = (unsigned char) tmp; + + tmp = uu->time_hi_and_version; + out[7] = (unsigned char) tmp; + tmp >>= 8; + out[6] = (unsigned char) tmp; + + tmp = uu->clock_seq; + out[9] = (unsigned char) tmp; + tmp >>= 8; + out[8] = (unsigned char) tmp; + + memcpy(out+10, uu->node, 6); +} + diff --git a/uuid/uuidsrc/parse.c b/uuid/uuidsrc/parse.c new file mode 100644 index 0000000..07b894d --- /dev/null +++ b/uuid/uuidsrc/parse.c @@ -0,0 +1,79 @@ +/* + * parse.c --- UUID parsing + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +#include +#include +#include +#include + +#include "uuidP.h" + +int uuid_parse(const char *in, uuid_t uu) +{ + struct uuid uuid; + int i; + const char *cp; + char buf[3]; + + if (strlen(in) != 36) + return -1; + for (i=0, cp = in; i <= 36; i++,cp++) { + if ((i == 8) || (i == 13) || (i == 18) || + (i == 23)) { + if (*cp == '-') + continue; + else + return -1; + } + if (i== 36) + if (*cp == 0) + continue; + if (!isxdigit(*cp)) + return -1; + } + uuid.time_low = strtoul(in, NULL, 16); + uuid.time_mid = strtoul(in+9, NULL, 16); + uuid.time_hi_and_version = strtoul(in+14, NULL, 16); + uuid.clock_seq = strtoul(in+19, NULL, 16); + cp = in+24; + buf[2] = 0; + for (i=0; i < 6; i++) { + buf[0] = *cp++; + buf[1] = *cp++; + uuid.node[i] = strtoul(buf, NULL, 16); + } + + uuid_pack(&uuid, uu); + return 0; +} diff --git a/uuid/uuidsrc/unpack.c b/uuid/uuidsrc/unpack.c new file mode 100644 index 0000000..9502fc2 --- /dev/null +++ b/uuid/uuidsrc/unpack.c @@ -0,0 +1,63 @@ +/* + * Internal routine for unpacking UUID + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +#include +#include "uuidP.h" + +void uuid_unpack(const uuid_t in, struct uuid *uu) +{ + const uint8_t *ptr = in; + uint32_t tmp; + + tmp = *ptr++; + tmp = (tmp << 8) | *ptr++; + tmp = (tmp << 8) | *ptr++; + tmp = (tmp << 8) | *ptr++; + uu->time_low = tmp; + + tmp = *ptr++; + tmp = (tmp << 8) | *ptr++; + uu->time_mid = tmp; + + tmp = *ptr++; + tmp = (tmp << 8) | *ptr++; + uu->time_hi_and_version = tmp; + + tmp = *ptr++; + tmp = (tmp << 8) | *ptr++; + uu->clock_seq = tmp; + + memcpy(uu->node, ptr, 6); +} + diff --git a/uuid/uuidsrc/unparse.c b/uuid/uuidsrc/unparse.c new file mode 100644 index 0000000..dd7814a --- /dev/null +++ b/uuid/uuidsrc/unparse.c @@ -0,0 +1,86 @@ +/* + * unparse.c -- convert a UUID to string + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +#include + +#include "uuidP.h" + +static const char *fmt_lower = + "0123456789abcdef"; + +static const char *fmt_upper = + "0123456789ABCDEF"; + +#ifdef UUID_UNPARSE_DEFAULT_UPPER +#define FMT_DEFAULT fmt_upper +#else +#define FMT_DEFAULT fmt_lower +#endif + +static void uuid_unparse_x(const uuid_t uu, char *out, const char *fmt) +{ + const uint8_t *uuid_array = (const uint8_t *)uu; + int uuid_index; + + for ( uuid_index = 0; uuid_index < sizeof(uuid_t); ++uuid_index ) { + // insert '-' after the 4th, 6th, 8th, and 10th uuid byte + switch (uuid_index) { + case 4: + case 6: + case 8: + case 10: + *out++ = '-'; + break; + } + // insert uuid byte as two hex characters + *out++ = fmt[*uuid_array >> 4]; + *out++ = fmt[*uuid_array++ & 0xF]; + } + *out = 0; +} + +void uuid_unparse_lower(const uuid_t uu, char *out) +{ + uuid_unparse_x(uu, out, fmt_lower); +} + +void uuid_unparse_upper(const uuid_t uu, char *out) +{ + uuid_unparse_x(uu, out, fmt_upper); +} + +void uuid_unparse(const uuid_t uu, char *out) +{ + uuid_unparse_x(uu, out, FMT_DEFAULT); +} diff --git a/uuid/uuidsrc/uuidP.h b/uuid/uuidsrc/uuidP.h new file mode 100644 index 0000000..a75e45a --- /dev/null +++ b/uuid/uuidsrc/uuidP.h @@ -0,0 +1,78 @@ +/* + * uuid.h -- private header file for uuids + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * %End-Header% + */ + +#ifdef HAVE_STDINT_H +#include +#else +#include +#endif +#include +#include +#include + +#include + +/* + * Offset between 15-Oct-1582 and 1-Jan-70 + */ +#define TIME_OFFSET_HIGH 0x01B21DD2 +#define TIME_OFFSET_LOW 0x13814000 + +struct uuid { + uint32_t time_low; + uint16_t time_mid; + uint16_t time_hi_and_version; + uint16_t clock_seq; + uint8_t node[6]; +}; + +/* UUID Variant definitions */ +#define UUID_VARIANT_NCS 0 +#define UUID_VARIANT_DCE 1 +#define UUID_VARIANT_MICROSOFT 2 +#define UUID_VARIANT_OTHER 3 + +/* UUID Type definitions */ +#define UUID_TYPE_DCE_TIME 1 +#define UUID_TYPE_DCE_RANDOM 4 + +/* + * prototypes + */ +void uuid_pack(const struct uuid *uu, uuid_t ptr); +void uuid_unpack(const uuid_t in, struct uuid *uu); + +time_t uuid_time(const uuid_t uu, struct timeval *ret_tv); +int uuid_type(const uuid_t uu); +int uuid_variant(const uuid_t uu); diff --git a/uuid/uuidsrc/uuid_clear.3.in b/uuid/uuidsrc/uuid_clear.3.in new file mode 100644 index 0000000..a853e68 --- /dev/null +++ b/uuid/uuidsrc/uuid_clear.3.in @@ -0,0 +1,60 @@ +.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca) +.\" +.\" %Begin-Header% +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, and the entire permission notice in its entirety, +.\" including the disclaimer of warranties. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +.\" WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +.\" USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +.\" DAMAGE. +.\" %End-Header% +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_CLEAR 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "@E2FSPROGS_VERSION@" +.SH NAME +uuid_clear \- reset value of UUID variable to the NULL value +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void uuid_clear(uuid_t " uu ); +.fi +.SH DESCRIPTION +The +.B uuid_clear +function sets the value of the supplied uuid variable +.I uu +to the NULL value. +.SH AUTHOR +Theodore Y. Ts'o +.SH AVAILABILITY +.UR http://e2fsprogs.sourceforge.net/ +http://e2fsprogs.sourceforge.net/ +.UE +.SH "SEE ALSO" +.BR uuid (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3), +.BR uuid_parse (3), +.BR uuid_unparse (3) diff --git a/uuid/uuidsrc/uuid_compare.3.in b/uuid/uuidsrc/uuid_compare.3.in new file mode 100644 index 0000000..642d970 --- /dev/null +++ b/uuid/uuidsrc/uuid_compare.3.in @@ -0,0 +1,66 @@ +.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca) +.\" +.\" %Begin-Header% +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, and the entire permission notice in its entirety, +.\" including the disclaimer of warranties. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +.\" WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +.\" USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +.\" DAMAGE. +.\" %End-Header% +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_COMPARE 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "@E2FSPROGS_VERSION@" +.SH NAME +uuid_compare \- compare whether two UUIDs are the same +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int uuid_compare(uuid_t " uu1 ", uuid_t " uu2) +.fi +.SH DESCRIPTION +The +.B uuid_compare +function compares the two supplied uuid variables +.IR uu1 " and " uu2 +to each other. +.SH RETURN VALUE +Returns an integer less than, equal to, or greater than zero if +.I uu1 +is found, respectively, to be lexigraphically less than, equal, or +greater than +.IR uu2 . +.SH AUTHOR +Theodore Y. Ts'o +.SH AVAILABILITY +.UR http://e2fsprogs.sourceforge.net/ +http://e2fsprogs.sourceforge.net/ +.UE +.SH "SEE ALSO" +.BR uuid (3), +.BR uuid_clear (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3), +.BR uuid_parse (3), +.BR uuid_unparse (3) diff --git a/uuid/uuidsrc/uuid_copy.3.in b/uuid/uuidsrc/uuid_copy.3.in new file mode 100644 index 0000000..efad12b --- /dev/null +++ b/uuid/uuidsrc/uuid_copy.3.in @@ -0,0 +1,62 @@ +.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca) +.\" +.\" %Begin-Header% +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, and the entire permission notice in its entirety, +.\" including the disclaimer of warranties. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +.\" WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +.\" USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +.\" DAMAGE. +.\" %End-Header% +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_COPY 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "@E2FSPROGS_VERSION@" +.SH NAME +uuid_copy \- copy a UUID value +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void uuid_copy(uuid_t " dst ", uuid_t " src); +.fi +.SH DESCRIPTION +The +.B uuid_copy +function copies the UUID variable +.IR src " to " dst . +.SH RETURN VALUE +The copied UUID is returned in the location pointed to by +.IR dst . +.SH AUTHOR +Theodore Y. Ts'o +.SH AVAILABILITY +.UR http://e2fsprogs.sourceforge.net/ +http://e2fsprogs.sourceforge.net/ +.UE +.SH "SEE ALSO" +.BR uuid (3), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_generate (3), +.BR uuid_is_null (3), +.BR uuid_parse (3), +.BR uuid_unparse (3) diff --git a/uuid/uuidsrc/uuid_generate.3.in b/uuid/uuidsrc/uuid_generate.3.in new file mode 100644 index 0000000..7ec7762 --- /dev/null +++ b/uuid/uuidsrc/uuid_generate.3.in @@ -0,0 +1,103 @@ +.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca) +.\" +.\" %Begin-Header% +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, and the entire permission notice in its entirety, +.\" including the disclaimer of warranties. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +.\" WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +.\" USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +.\" DAMAGE. +.\" %End-Header% +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_GENERATE 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "@E2FSPROGS_VERSION@" +.SH NAME +uuid_generate, uuid_generate_random, uuid_generate_time \- create a new unique UUID value +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "void uuid_generate(uuid_t " out ); +.BI "void uuid_generate_random(uuid_t " out ); +.BI "void uuid_generate_time(uuid_t " out ); +.fi +.SH DESCRIPTION +The +.B uuid_generate +function creates a new universally unique identifier (UUID). The uuid will +be generated based on high-quality randomness from +.IR /dev/urandom , +if available. If it is not available, then +.B uuid_generate +will use an alternative algorithm which uses the current time, the +local ethernet MAC address (if available), and random data generated +using a pseudo-random generator. +.sp +The +.B uuid_generate_random +function forces the use of the all-random UUID format, even if +a high-quality random number generator (i.e., +.IR /dev/urandom ) +is not available, in which case a pseudo-random +generator will be subsituted. Note that the use of a pseudo-random +generator may compromise the uniqueness of UUID's +generated in this fashion. +.sp +The +.B uuid_generate_time +function forces the use of the alternative algorithm which uses the +current time and the local ethernet MAC address (if available). +This algorithm used to be the default one used to generate UUID, but +because of the use of the ethernet MAC address, it can leak +information about when and where the UUID was generated. This can cause +privacy problems in some applications, so the +.B uuid_generate +function only uses this algorithm if a high-quality source of +randomness is not available. +.sp +The UUID is 16 bytes (128 bits) long, which gives approximately 3.4x10^38 +unique values (there are approximately 10^80 elemntary particles in +the universe according to Carl Sagan's +.IR Cosmos ). +The new UUID can reasonably be considered unique among all UUIDs created +on the local system, and among UUIDs created on other systems in the past +and in the future. +.SH RETURN VALUE +The newly created UUID is returned in the memory location pointed to by +.IR out . +.SH "CONFORMING TO" +OSF DCE 1.1 +.SH AUTHOR +Theodore Y. Ts'o +.SH AVAILABILITY +.UR http://e2fsprogs.sourceforge.net/ +http://e2fsprogs.sourceforge.net/ +.UE +.SH "SEE ALSO" +.BR uuid (3), +.BR uuidgen (1), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_is_null (3), +.BR uuid_parse (3), +.BR uuid_unparse (3) diff --git a/uuid/uuidsrc/uuid_is_null.3.in b/uuid/uuidsrc/uuid_is_null.3.in new file mode 100644 index 0000000..5b9f5b5 --- /dev/null +++ b/uuid/uuidsrc/uuid_is_null.3.in @@ -0,0 +1,61 @@ +.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca) +.\" +.\" %Begin-Header% +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, and the entire permission notice in its entirety, +.\" including the disclaimer of warranties. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +.\" WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +.\" USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +.\" DAMAGE. +.\" %End-Header% +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_IS_NULL 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "@E2FSPROGS_VERSION@" +.SH NAME +uuid_is_null \- compare the value of the UUID to the NULL value +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int uuid_is_null(uuid_t " uu ); +.fi +.SH DESCRIPTION +The +.B uuid_is_null +function compares the value of the supplied UUID variable +.I uu +to the NULL value. If the value is equal to the NULL UUID, 1 is returned, +otherwise 0 is returned. +.SH AUTHOR +Theodore Y. Ts'o +.SH AVAILABILITY +.UR http://e2fsprogs.sourceforge.net/ +http://e2fsprogs.sourceforge.net/ +.UE +.SH "SEE ALSO" +.BR uuid (3), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_parse (3), +.BR uuid_unparse (3) diff --git a/uuid/uuidsrc/uuid_parse.3.in b/uuid/uuidsrc/uuid_parse.3.in new file mode 100644 index 0000000..4584fa9 --- /dev/null +++ b/uuid/uuidsrc/uuid_parse.3.in @@ -0,0 +1,70 @@ +.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca) +.\" +.\" %Begin-Header% +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, and the entire permission notice in its entirety, +.\" including the disclaimer of warranties. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +.\" WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +.\" USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +.\" DAMAGE. +.\" %End-Header% +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_PARSE 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "@E2FSPROGS_VERSION@" +.SH NAME +uuid_parse \- convert an input UUID string into binary representation +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int uuid_parse( char *" in ", uuid_t " uu ); +.fi +.SH DESCRIPTION +The +.B uuid_parse +function converts the UUID string given by +.I in +into the binary representation. The input UUID is a string of the form +1b4e28ba\-2fa1\-11d2\-883f\-b9a761bde3fb (in +.BR printf (3) +format "%08x\-%04x\-%04x\-%04x\-%012x", 36 bytes plus the trailing '\\0'). +.SH RETURN VALUE +Upon successfully parsing the input string, 0 is returned, and the UUID is +stored in the location pointed to by +.IR uu , +otherwise \-1 is returned. +.SH "CONFORMING TO" +OSF DCE 1.1 +.SH AUTHOR +Theodore Y. Ts'o +.SH AVAILABILITY +.UR http://e2fsprogs.sourceforge.net/ +http://e2fsprogs.sourceforge.net/ +.UE +.SH "SEE ALSO" +.BR uuid (3), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3), +.BR uuid_unparse (3) diff --git a/uuid/uuidsrc/uuid_unparse.3.in b/uuid/uuidsrc/uuid_unparse.3.in new file mode 100644 index 0000000..70734fd --- /dev/null +++ b/uuid/uuidsrc/uuid_unparse.3.in @@ -0,0 +1,87 @@ +.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca) +.\" +.\" %Begin-Header% +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, and the entire permission notice in its entirety, +.\" including the disclaimer of warranties. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +.\" WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +.\" USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +.\" DAMAGE. +.\" %End-Header% +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_UNPARSE 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "@E2FSPROGS_VERSION@" +.SH NAME +uuid_unparse \- convert an UUID from binary representation to a string +.SH SYNOPSIS +.nf +.B #include +.sp +\fIvoid\fP +.br +\fBuuid_unparse\fP(\fIuuid_t uu\fP, \fIuuid_string_t out\fP); +.sp +\fIvoid\fP +.br +\fBuuid_unparse_lower\fP(\fIuuid_t uu\fP, \fIuuid_string_t out\fP); +.sp +\fIvoid\fP +.br +\fBuuid_unparse_upper\fP(\fIuuid_t uu\fP, \fIuuid_string_t out\fP); +.sp +.fi +.SH DESCRIPTION +The +.B uuid_unparse +function converts the supplied UUID +.I uu +from the binary representation into a uuid_string_t (37\-byte string including tailing '\\0') +of the form 1b4e28ba\-2fa1\-11d2\-883f\-b9a761bde3fb and stores this value in the +character string pointed to by +.IR out . +The case of the hex digits returned by +.B uuid_unparse +may be upper or lower case, and is +dependent on the system-dependent local default. +.PP +If the case of the +hex digits is important then the functions +.B uuid_unparse_upper +and +.B uuid_unparse_lower +may be used. +.SH "CONFORMING TO" +OSF DCE 1.1 +.SH AUTHOR +Theodore Y. Ts'o +.SH AVAILABILITY +.UR http://e2fsprogs.sourceforge.net/ +http://e2fsprogs.sourceforge.net/ +.UE +.SH "SEE ALSO" +.BR uuid (3), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3), +.BR uuid_parse (3) diff --git a/weak_reference.h b/weak_reference.h new file mode 100644 index 0000000..fb12be4 --- /dev/null +++ b/weak_reference.h @@ -0,0 +1 @@ +#define __weak_reference(sym,alias) diff --git a/x86_64/CMakeLists.txt b/x86_64/CMakeLists.txt new file mode 100644 index 0000000..92bc472 --- /dev/null +++ b/x86_64/CMakeLists.txt @@ -0,0 +1,23 @@ +project(libc-x86_64) + +cmake_minimum_required(VERSION 3.10) +enable_language(C ASM) + +add_definitions(-DPRIVATE) + +#set(CMAKE_C_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/../../duct/include/commpage.h -include ${DARLING_TOP_DIRECTORY}/platform-include/sys/time.h") + +if (TARGET_x86_64) + set(x86_64_sources + gen/mcount.S + ) +endif (TARGET_x86_64) + +add_library(libc-x86_64 OBJECT ${x86_64_sources}) + +add_library(libc-hwplat_dyld OBJECT + gen/mcount.S +) + +set_target_properties(libc-hwplat_dyld PROPERTIES COMPILE_FLAGS "-DVARIANT_DYLD") + diff --git a/x86_64/gen/mcount.S b/x86_64/gen/mcount.S new file mode 100644 index 0000000..3456862 --- /dev/null +++ b/x86_64/gen/mcount.S @@ -0,0 +1,52 @@ +/* + * Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#import + +.text + .globl mcount +mcount: + pushq %rbp // setup mcount's frame + movq %rsp, %rbp + subq $64, %rsp // allocate space for storage and alignment + movq %rax, 0(%rsp) + movq %rdi, 8(%rsp) + movq %rsi, 16(%rsp) + movq %rdx, 24(%rsp) + movq %rcx, 32(%rsp) + movq %r8, 40(%rsp) + movq %r9, 48(%rsp) + movq (%rbp), %rsi // load the frame pointer of mcount's caller + movq 8(%rsi), %rsi // load mcount's caller's return address + movq 8(%rbp), %rdi // set up the selfpc parameter for moncount() + CALL_EXTERN(_moncount) // call moncount() + movq 48(%rsp), %r9 + movq 40(%rsp), %r8 + movq 32(%rsp), %rcx + movq 24(%rsp), %rdx + movq 16(%rsp), %rsi + movq 8(%rsp), %rdi + movq 0(%rsp), %rax + + movq %rbp, %rsp + popq %rbp // tear down frame + ret diff --git a/xcodescripts/Libc.order b/xcodescripts/Libc.order new file mode 100644 index 0000000..ec19af8 --- /dev/null +++ b/xcodescripts/Libc.order @@ -0,0 +1,100 @@ +libBase.a(nanosleep.o):_clock_sem +libBase.a(nanosleep.o):_clock_port +libFortifySource.a(chk_fail.o):___chk_assert_no_overlap +libBase.a(xlocale.o):___locale_key +libBase.a(fork.o):__MergedGlobals +libFreeBSD.a(atexit.o):___atexit_new_registration +libBase.a(fork.o):__libSystem_atfork_prepare +libBase.a(fork.o):__libSystem_atfork_parent +libBase.a(fork.o):__libSystem_atfork_child +libFreeBSD.a(atexit.o):__MergedGlobals +libFreeBSD.a(atexit.o):___atexit +libBase.a(confstr):__dirhelper_func +libBase.a(crt_externs.o):__MergedGlobals +libBase.a(crt_externs.o):_NXArgv_pointer +libBase.a(crt_externs.o):_NXArgc_pointer +libBase.a(crt_externs.o):_environ_pointer +libBase.a(crt_externs.o):___progname_pointer +libBase.a(crt_externs.o):__mh_execute_header_pointer +libFreeBSD.a(stack_protector.o):___stack_chk_guard +libFreeBSD.a(atexit.o):_atexit_mutex +libBase.a(xlocale.o):__MergedGlobals +libBase.a(xlocale.o):___c_locale +libBase.a(xlocale.o):___global_locale +libFreeBSD.a(findfp.o):__MergedGlobals +libFreeBSD.a(exit.o):___cleanup +libFreeBSD.a(findfp.o):___sdidinit +libFreeBSD.a(findfp.o):___sglue +libFreeBSD.a(findfp.o):__MergedGlobals1 +libFreeBSD.a(findfp.o):___stream_max +libFreeBSD.a(findfp.o):___scounted +libFreeBSD.a(findfp.o):_thread_lock +libFreeBSD.a(findfp.o):_lastglue +libBase.a(timezone_unix03.o):_timezone +libFreeBSD.a(localtime.o):_daylight +libFreeBSD.a(localtime.o):___darwin_altzone +libFreeBSD.a(localtime.o):_lclptr +libFreeBSD.a(localtime.o):_tzname +libFreeBSD.a(localtime.o):_lcl_notify +libFreeBSD.a(localtime.o):_lcl_rwlock +libFreeBSD.a(localtime.o):__MergedGlobals +libFreeBSD.a(localtime.o):__MergedGlobals8 +libFreeBSD.a(getpagesize.o):_getpagesize.value +libFreeBSD.a(setenv.o):___env_owned +libFreeBSD.a(arc4random.o):_rs_stired +libFreeBSD.a(arc4random.o):_rs.0 +libFreeBSD.a(arc4random.o):_rs.1 +libFreeBSD.a(arc4random.o):__MergedGlobals +libFreeBSD.a(arc4random.o):_rs_data_available +libFreeBSD.a(arc4random.o):_lock +libFreeBSD.a(arc4random.o):_arc4_count +libFreeBSD.a(arc4random.o):_rdat +libFreeBSD.a(arc4random.o):_rs.2 +libFreeBSD.a(gdtoa-misc.o):_gdtoa_tsd_key +libFreeBSD.a(gdtoa-misc.o):_gdtoa_tsd_lock +libvDarwinExtsn.a(realpath.o):_realpath$DARWIN_EXTSN.rootdev_inited +libvDarwinExtsn.a(realpath.o):_realpath$DARWIN_EXTSN.rootdev +libFreeBSD.a(gdtoa-misc.o):_p5s +libFreeBSD.a(glue.o):___gdtoa_locks +libFreeBSD.a(findfp.o):___sFX +libFreeBSD.a(getopt.o):_optreset +libFreeBSD.a(strerror.o):___strerror_ebuf +libBase.a(NSSystemDirectories.o):_nextRoot +libFreeBSD.a(getopt.o):_optarg +libBase.a(NSSystemDirectories.o):_nextRoot_init_once +libFreeBSD.a(findfp.o):___sF +libFreeBSD.a(localtime.o):_localtime.localtime_key +libFreeBSD.a(getopt.o):_getopt.place +libFreeBSD.a(getopt_long.o):__MergedGlobals +libFreeBSD.a(random.o):__MergedGlobals +libFreeBSD.a(random.o):_fptr +libFreeBSD.a(random.o):_rptr +libFreeBSD.a(localtime.o):_localtime.localtime_mutex +libFreeBSD.a(random.o):_randtbl +libFreeBSD.a(getopt_long.o):_nonopt_end +libFreeBSD.a(getopt_long.o):_nonopt_start +libFreeBSD.a(getopt_long.o):_place +libFreeBSD.a(rand.o):_next +libBase.a(OSThermalNotification.o):_predicates +libBase.a(OSThermalNotification.o):_tokens +libFreeBSD.a(getopt.o):_optind +libBase.a(OSThermalNotification.o):__MergedGlobals +libBase.a(OSThermalNotification.o):_thermalLevelsReady +libFreeBSD.a(asctime.o):_buf_asctime +libFreeBSD.a(getopt.o):_opterr +libFreeBSD.a(basename.o):_basename.bname +libFreeBSD.a(getopt.o):_optopt +libFreeBSD.a(localtime.o):_gmtptr +libFreeBSD.a(localtime.o):_gmt_notify +libFreeBSD.a(localtime.o):_gmt_mutex +libFreeBSD.a(vfscanf.o):___parsefloat_buf.parsefloat_tsd_key +libFreeBSD.a(vfscanf.o):___parsefloat_buf.bsiz +libFreeBSD.a(vfscanf.o):___parsefloat_buf.parsefloat_tsd_lock +libNetBSD.a(utmpx.o):___utx__ +libFreeBSD.a(strtok.o):_strtok.last +libNetBSD.a(utmpx.o):___default_utx.once +libBase.a(assumes.o):__os_abort_on_assumes.once +libFreeBSD.a(inet_ntoa.o):_inet_ntoa.ret +libFreeBSD.a(strsignal.o):_sig_init_once +libFreeBSD.a(strsignal.o):__MergedGlobals +libFreeBSD.a(localtime.o):_lcl_TZname diff --git a/xcodescripts/abort_unsupported.sh b/xcodescripts/abort_unsupported.sh new file mode 100644 index 0000000..b817d28 --- /dev/null +++ b/xcodescripts/abort_unsupported.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +for platform in ${SUPPORTED_PLATFORMS} ; do + [[ "${platform}" == "${PLATFORM_NAME}" ]] && exit 0 +done + +echo "Unsupported platform encountered:" >&2 +echo " PLATFORM_NAME: ${PLATFORM_NAME}" >&2 +echo " SUPPORTED_PLATFORMS: ${SUPPORTED_PLATFORMS}" >&2 +echo "Please contact the Darwin Runtime Team for help with your new platform bringup needs" >&2 +exit 1 diff --git a/xcodescripts/alias.list b/xcodescripts/alias.list new file mode 100644 index 0000000..c162edc --- /dev/null +++ b/xcodescripts/alias.list @@ -0,0 +1,22 @@ +__platform_bzero _bzero +__platform_memccpy _memccpy +__platform_memchr _memchr +__platform_memcmp _memcmp +__platform_memcmp _bcmp +__platform_memmove _memmove +__platform_memmove _memcpy +__platform_memset _memset +__platform_memset_pattern16 _memset_pattern16 +__platform_memset_pattern4 _memset_pattern4 +__platform_memset_pattern8 _memset_pattern8 +__platform_strchr _strchr +__platform_strchr _index +__platform_strcmp _strcmp +__platform_strcpy _strcpy +__platform_strlcat _strlcat +__platform_strlcpy _strlcpy +__platform_strlen _strlen +__platform_strncmp _strncmp +__platform_strncpy _strncpy +__platform_strnlen _strnlen +__platform_strstr _strstr diff --git a/xcodescripts/build_linklists.sh b/xcodescripts/build_linklists.sh new file mode 100755 index 0000000..59bf260 --- /dev/null +++ b/xcodescripts/build_linklists.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# build_linklists.sh +# Libc + +# Skip script during installhdrs +if [ "$ACTION" == installhdrs ]; then exit 0; fi +# BUILD_ARCHIVES needs to be set in the project settings +if [ -z "$BUILD_ARCHIVES" ]; then exit 0; fi + +[ ! -d "$BUILT_PRODUCTS_DIR" ] && mkdir -p "$BUILT_PRODUCTS_DIR" +[ ! -d "$DERIVED_FILES_DIR" ] && mkdir -p "$DERIVED_FILES_DIR" + +NORMAL_LIST="$BUILT_PRODUCTS_DIR/normal.linklist" +DEBUG_LIST="$BUILT_PRODUCTS_DIR/debug.linklist" +INTERPOSABLE_LIST="$DERIVED_FILES_DIR/interposable.list" +UNEXPORT_LIST="$DERIVED_FILES_DIR/unexport.list" + +rm -f "$NORMAL_LIST" +rm -f "$DEBUG_LIST" +rm -f "$INTERPOSABLE_LIST" +rm -f "$UNEXPORT_LIST" + +for x in ${BUILD_ARCHIVES[@]}; do + nm -AUamgf "$BUILT_PRODUCTS_DIR/lib${x}.a" 2>/dev/null | \ + grep '__TEXT,__text' | \ + grep -vE '\$VARIANT' | \ + awk '{ print $NF }' >> "$INTERPOSABLE_LIST" + + nm -AUamgf "$BUILT_PRODUCTS_DIR/lib${x}.a" 2>/dev/null | \ + awk '/\$VARIANT/ { print $NF }' >> "$UNEXPORT_LIST" + + echo "$BUILT_PRODUCTS_DIR/lib${x}.a" >> "$NORMAL_LIST.libtool" + filename=$(printf %s "$BUILT_PRODUCTS_DIR/lib${x}.a" | sed "s/\ /\\\ /g") + echo "$filename" >> "$NORMAL_LIST" + + echo "$BUILT_PRODUCTS_DIR/lib${x}_debug.a" >> "$DEBUG_LIST.libtool" + filename=$(printf %s "$BUILT_PRODUCTS_DIR/lib${x}_debug.a" | sed "s/\ /\\\ /g") + echo "$filename" >> "$DEBUG_LIST" +done + +touch "$BUILT_PRODUCTS_DIR/deps.c" + +exit 0 diff --git a/xcodescripts/eos.xcconfig b/xcodescripts/eos.xcconfig new file mode 100644 index 0000000..d86e479 --- /dev/null +++ b/xcodescripts/eos.xcconfig @@ -0,0 +1,33 @@ +#include "libc.xcconfig" + +BUILD_ARCHIVES = Base FreeBSD TRE vCancelable vDarwinExtsn +BUILD_VARIANTS = normal +EXECUTABLE_PREFIX = lib +INSTALL_PATH = /usr/local/lib/eOS +OTHER_LIBTOOLFLAGS = -filelist $(BUILT_PRODUCTS_DIR)/$(CURRENT_VARIANT).linklist.libtool +PRODUCT_NAME = c_eOS +SKIP_INSTALL = YES +SKIP_INSTALL[sdk=iphoneos*] = NO +STRIP_INSTALLED_PRODUCT = NO +VARIANT = EOS +VERSIONING_SYSTEM = apple-generic + +// Variants. All variants contain all source files but all excluded. Specific variants then include the files they need. +EXCLUDED_SOURCE_FILE_NAMES = * +EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*] = $(VARIANT_EOS_EXCLUDED_FILES) +EXCLUDED_SOURCE_FILE_NAMES[sdk=watchos*] = $(VARIANT_EOS_EXCLUDED_FILES) +EXCLUDED_SOURCE_FILE_NAMES[sdk=appletvos*] = $(VARIANT_EOS_EXCLUDED_FILES) +EXCLUDED_SOURCE_FILE_NAMES[sdk=bridgeos*] = $(VARIANT_EOS_EXCLUDED_FILES) +INCLUDED_SOURCE_FILE_NAMES = +INCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*] = $(VARIANT_EOS_INCLUDED_FILES) +INCLUDED_SOURCE_FILE_NAMES[sdk=watchos*] = $(VARIANT_EOS_INCLUDED_FILES) +INCLUDED_SOURCE_FILE_NAMES[sdk=appletvos*] = $(VARIANT_EOS_INCLUDED_FILES) +INCLUDED_SOURCE_FILE_NAMES[sdk=bridgeos*] = $(VARIANT_EOS_INCLUDED_FILES) +VARIANT_PREPROCESSOR_MACROS = -UBUILDING_VARIANT -DVARIANT_STATIC -DVARIANT_EOS -DVARIANT_CANCELABLE -DVARIANT_DARWINEXTSN -U__DARWIN_NON_CANCELABLE -D__DARWIN_NON_CANCELABLE=0 + +SYSTEM_FRAMEWORK_HEADERS = $(DERIVED_FILES_DIR)/System.framework/Versions/B/PrivateHeaders +HEADER_SEARCH_PATHS = $(FreeBSD_SEARCH_PATHS) $(inherited) + +// EOS (libc_eOS.a) +VARIANT_EOS_EXCLUDED_FILES = * +VARIANT_EOS_INCLUDED_FILES = secure/*.c $(ARCH_FAMILY_$(CURRENT_ARCH))/*/*.c $(ARCH_FAMILY_$(CURRENT_ARCH))/*/*.S $(ARCH_FAMILY_$(CURRENT_ARCH))/*/*.s diff --git a/xcodescripts/force_libc_to_build.sh b/xcodescripts/force_libc_to_build.sh new file mode 100755 index 0000000..28b1c1e --- /dev/null +++ b/xcodescripts/force_libc_to_build.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# force_libc_to_build.sh +# Libc +# +# Created by Matt Wright on 10/4/11. +# Copyright (c) 2011 None. All rights reserved. + +if [ "x$ACTION" == "xinstallhdrs" ]; then exit 0; fi + +DEPS_C="$BUILT_PRODUCTS_DIR/deps.c" + +[ -e "$DEPS_C" ] && rm -f "$DEPS_C" diff --git a/xcodescripts/generate_features.pl b/xcodescripts/generate_features.pl new file mode 100755 index 0000000..e2da8f9 --- /dev/null +++ b/xcodescripts/generate_features.pl @@ -0,0 +1,219 @@ +#!/usr/bin/perl + +# Generates the libc-features.h files used to control #ifdef behaviour in Libc +use warnings; +use Data::Dumper; +use File::Path qw(mkpath); + +#printf Dumper(\%ENV); + +my $unifdef = 0; +my %unifdefs = (); +my $bash = 0; +if (scalar(@ARGV) > 0) { + $unifdef = 1 if $ARGV[0] =~ /--unifdef/; + $bash = 1 if $ARGV[0] =~ /--bash/; +} + +for my $arch (split(/ /, $ENV{"ARCHS"})) +{ + # set ENV{"CURRENT_ARCH"} so we can predicate on it + $ENV{"CURRENT_ARCH"} = $arch; + + my $platformName = $ENV{"VARIANT_PLATFORM_NAME"}; + $platformName =~ s/simulator/os/; + + my $platformPath = $ENV{"SRCROOT"} . "/Platforms/" . $platformName . "/Makefile.inc"; + my $featuresHeaderDir = $ENV{"DERIVED_FILES_DIR"}."/".$arch; + my $featuresHeader = $featuresHeaderDir."/libc-features.h"; + + open FEATURESFILE, "<$platformPath" or die "Unable to open: $platformPath"; + + my %features = (); + my $skip = 0; + my $nested = 0; + + while () { + next if $_ =~ /\s*#/; + + if ($_ =~ /^.endif/) { + $skip-- if $skip > 0; + $nested--; + } + + elsif ($_ =~ /^\.if\s+(\S+)\s+(\S+)/) { + # an if statement, very rudimentary regex against envvar + my $envvar = $1; + my $regex = $2; + + $nested++; + if (!defined($ENV{$envvar}) || ($ENV{$envvar} !~ /$regex/)) { + $skip += 1; + } + } + + elsif ($_ =~ /^\s*([^= ]+)\s*=\s*(\d)/) { + if ($skip == 0) { + if ($2 == 1) { + $features{$1} = $2; + } elsif (defined($features{$1})) { + delete $features{$1}; + } + } + } + } + + close FEATURESFILE; + + if ($bash == 1) { + for my $f (keys %features) { + print "$f=$features{$f} "; + } + printf "\n"; + exit 0; + } + + elsif ($unifdef == 1) { + # assume FEATURE_BLOCKS was on by default + $unifdefs{"UNIFDEF_BLOCKS"} = 1; + $unifdefs{"UNIFDEF_DRIVERKIT"} = defined($ENV{"DRIVERKITSDK"}); + $unifdefs{"UNIFDEF_LEGACY_64_APIS"} = defined($features{"FEATURE_LEGACY_64_APIS"}); + $unifdefs{"UNIFDEF_LEGACY_RUNE_APIS"} = defined($features{"FEATURE_LEGACY_RUNE_APIS"}); + $unifdefs{"UNIFDEF_LEGACY_UTMP_APIS"} = defined($features{"FEATURE_LEGACY_UTMP_APIS"}); + $unifdefs{"UNIFDEF_POSIX_ILP32_ALLOW"} = defined($features{"FEATURE_POSIX_ILP32_ALLOW"}); + + my $output = ""; + for my $d (keys %unifdefs) { + $output .= " " . ($unifdefs{$d} == 1 ? "-D" : "-U") . $d; + } + + chomp $output; + print "$output\n"; + exit 0; + } + + elsif ($unifdef == 0) { + # If we touch this file on every build, then every other iterative build in Xcode will rebuild *everything* + my $platform_mtime = (stat($platformPath))[9]; + my $header_mtime = (stat($featuresHeader))[9]; + + if (defined($header_mtime) && defined($platform_mtime) && ($header_mtime > $platform_mtime)) { + exit 0; + } + + printf $arch." features:\n"; + printf Dumper(\%features); + + if ($nested != 0) { + die "Unbalanced .if/.endif directive"; + } + + # And the meat, new header options should go under here + if (! -d $featuresHeaderDir) { + mkpath $featuresHeaderDir or die "Unable to mkdir: $featuresHeaderDir"; + } + open HEADER, ">$featuresHeader" or die "Unable to open (for writing): $featuresHeader"; + + printf HEADER "#ifndef _LIBC_FEATURES_H_\n"; + printf HEADER "#define _LIBC_FEATURES_H_\n\n"; + + my $shortarch = $arch; + $shortarch =~ s/armv\d+[a-z]?/arm/g; + + # map all arm64 subtypes to arm64 + $shortarch =~ s/arm64[_a-z0-9]*/arm64/g; + + printf HEADER "#if !defined(__".$shortarch."__)\n"; + printf HEADER "#error Mismatched libc-features.h architecture\n"; + printf HEADER "#endif\n\n"; + + if (defined($features{"FEATURE_LEGACY_RUNE_APIS"})) { + printf HEADER "#define UNIFDEF_LEGACY_RUNE_APIS 1\n"; + } else { + printf HEADER "/* #undef UNIFDEF_LEGACY_RUNE_APIS */\n"; + } + + if (defined($features{"FEATURE_LEGACY_CRT1_ENVIRON"})) { + printf HEADER "#define LEGACY_CRT1_ENVIRON 1\n"; + } else { + printf HEADER "/* #undef LEGACY_CRT1_ENVIRON */\n"; + } + + if (defined($features{"FEATURE_LEGACY_UTMP_APIS"})) { + printf HEADER "#define UNIFDEF_LEGACY_UTMP_APIS 1\n"; + } else { + printf HEADER "/* #undef UNIFDEF_LEGACY_UTMP_APIS */\n"; + } + + if (defined($features{"FEATURE_ONLY_1050_VARIANTS"})) { + printf HEADER "#if !__DARWIN_ONLY_VERS_1050\n"; + printf HEADER "# error Feature mismatch: __DARWIN_ONLY_VERS_1050 == 0\n"; + printf HEADER "#endif /* !__DARWIN_ONLY_VERS_1050 */\n"; + } else { + printf HEADER "#if __DARWIN_ONLY_VERS_1050\n"; + printf HEADER "# error Feature mismatch: __DARWIN_ONLY_VERS_1050 == 1\n"; + printf HEADER "#endif /* __DARWIN_ONLY_VERS_1050 */\n"; + } + + if (defined($features{"FEATURE_ONLY_UNIX_CONFORMANCE"})) { + printf HEADER "#if !__DARWIN_ONLY_UNIX_CONFORMANCE\n"; + printf HEADER "# error Feature mismatch: __DARWIN_ONLY_UNIX_CONFORMANCE == 0\n"; + printf HEADER "#endif /* !__DARWIN_ONLY_UNIX_CONFORMANCE */\n"; + } else { + printf HEADER "#if __DARWIN_ONLY_UNIX_CONFORMANCE\n"; + printf HEADER "# error Feature mismatch: __DARWIN_ONLY_UNIX_CONFORMANCE == 1\n"; + printf HEADER "#endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */\n"; + } + + if (defined($features{"FEATURE_ONLY_64_BIT_INO_T"})) { + printf HEADER "#if !__DARWIN_ONLY_64_BIT_INO_T\n"; + printf HEADER "# error Feature mismatch: __DARWIN_ONLY_64_BIT_INO_T == 0\n"; + printf HEADER "#endif /* !__DARWIN_ONLY_64_BIT_INO_T */\n"; + } else { + printf HEADER "#if __DARWIN_ONLY_64_BIT_INO_T\n"; + printf HEADER "# error Feature mismatch: __DARWIN_ONLY_64_BIT_INO_T == 1\n"; + printf HEADER "#endif /* __DARWIN_ONLY_64_BIT_INO_T */\n"; + } + + if (defined($features{"FEATURE_PATCH_3417676"})) { + printf HEADER "#define __APPLE_PR3417676_HACK__ 1\n"; + } else { + printf HEADER "/* #undef __APPLE_PR3417676_HACK__ */\n"; + } + + if (defined($features{"FEATURE_PLOCKSTAT"})) { + printf HEADER "#define PLOCKSTAT 1\n"; + } else { + printf HEADER "/* #undef PLOCKSTAT */\n"; + } + + if (defined($features{"FEATURE_TIMEZONE_CHANGE_NOTIFICATION"})) { + printf HEADER "#define NOTIFY_TZ 1\n"; + } else { + printf HEADER "/* #undef NOTIFY_TZ */\n"; + } + + if (defined($features{"FEATURE_SMALL_STDIOBUF"})) { + printf HEADER "#define FEATURE_SMALL_STDIOBUF 1\n"; + } else { + printf HEADER "/* #undef FEATURE_SMALL_STDIOBUF */\n"; + } + + if (defined($features{"FEATURE_XPRINTF_PERF"})) { + printf HEADER "#define XPRINTF_PERF 1\n"; + } else { + printf HEADER "/* #undef XPRINTF_PERF */\n"; + } + + if (defined($features{"FEATURE_SIGNAL_RESTRICTION"})) { + printf HEADER "#define FEATURE_SIGNAL_RESTRICTION 1\n"; + } else { + printf HEADER "/* #undef FEATURE_SIGNAL_RESTRICTION */\n"; + } + + printf HEADER "#endif // _LIBC_FEATURES_H_\n"; + close HEADER; + } +} + +exit 0; diff --git a/xcodescripts/headers.sh b/xcodescripts/headers.sh new file mode 100755 index 0000000..2c53924 --- /dev/null +++ b/xcodescripts/headers.sh @@ -0,0 +1,352 @@ +#!/bin/bash +set -x + +# Installs Libc header files + +if [ -n "${DRIVERKIT}" -a -z "${DRIVERKITSDK}" ]; then + # Run script in the mode that installs public DriverKit SDK headers first: + # required to get the correct header unifdef ordering, that mode strips out more + # and rewrites all headers under the parent directory (/System/DriverKit) + DRIVERKITSDK=1 SDK_INSTALL_HEADERS_ROOT="${SDK_INSTALL_ROOT}" "${BASH}" -e "$0" +fi + +MKDIR="mkdir -p" +INSTALL=install +MV=mv +ECHO=echo +CHMOD=chmod +CP=cp +UNIFDEF=unifdef +FIND=find +RM=rm +ED=ed +XARGS=xargs +GREP=grep +FGREP=fgrep + +eval $(${SRCROOT}/xcodescripts/generate_features.pl --bash) +UNIFDEFARGS=$(${SRCROOT}/xcodescripts/generate_features.pl --unifdef) + +if [[ "${DEPLOYMENT_LOCATION}" == "NO" ]] ; then + HDRROOT=${BUILT_PRODUCTS_DIR} +else + HDRROOT=${DSTROOT} +fi + +INCDIR=${HDRROOT}/${SDK_INSTALL_HEADERS_ROOT}/usr/include +LOCINCDIR=${HDRROOT}/${SDK_INSTALL_HEADERS_ROOT}/usr/local/include +SYSTEMFRAMEWORK=${HDRROOT}/${SDK_INSTALL_HEADERS_ROOT}/System/Library/Frameworks/System.framework +KERNELFRAMEWORK=${HDRROOT}/${SDK_INSTALL_HEADERS_ROOT}/System/Library/Frameworks/Kernel.framework + +PRIVHDRS=${SYSTEMFRAMEWORK}/Versions/B/PrivateHeaders +PRIVKERNELHDRS=${KERNELFRAMEWORK}/Versions/A/PrivateHeaders +INSTALLMODE=$([[ `id -u` -eq 0 ]] && echo 444 || echo 644) + +if [ -z "${DRIVERKITSDK}" ]; then + +INSTHDRS=( + ${SRCROOT}/gen/get_compat.h + ${SRCROOT}/gen/execinfo.h +) + +INC_INSTHDRS=( + __wctype.h + _ctype.h + _locale.h + _regex.h + _stdio.h + _types.h + _wctype.h + _xlocale.h + _ctermid.h + aio.h + alloca.h + ar.h + assert.h + asm.h + bitstring.h + cpio.h + crt_externs.h + ctype.h + db.h + dirent.h + disktab.h + err.h + errno.h + fcntl.h + fmtmsg.h + fnmatch.h + fsproperties.h + fstab.h + fts.h + ftw.h + getopt.h + glob.h + inttypes.h + iso646.h + langinfo.h + libc.h + libgen.h + limits.h + locale.h + memory.h + monetary.h + monitor.h + mpool.h + ndbm.h + nlist.h + paths.h + printf.h + poll.h + ranlib.h + readpassphrase.h + regex.h + runetype.h + search.h + semaphore.h + sgtty.h + signal.h + stab.h + standards.h + stddef.h + stdio.h + stdint.h + stdlib.h + strhash.h + string.h + stringlist.h + strings.h + struct.h + sysexits.h + syslog.h + tar.h + termios.h + time.h + timeconv.h + ttyent.h + ulimit.h + unistd.h + util.h + utime.h + vis.h + wchar.h + wctype.h + wordexp.h + xlocale.h +) +if [ "x${FEATURE_LEGACY_RUNE_APIS}" == "x1" ]; then + INC_INSTHDRS=( "${INC_INSTHDRS[@]}" rune.h ) +fi +if [ "x${FEATURE_LEGACY_UTMP_APIS}" == "x1" ]; then + INC_INSTHDRS=( "${INC_INSTHDRS[@]}" utmp.h ) +fi + +INC_INSTHDRS=( + "${INC_INSTHDRS[@]/#/${SRCROOT}/include/}" + ${SRCROOT}/include/FreeBSD/nl_types.h + ${SRCROOT}/include/NetBSD/utmpx.h + ${SRCROOT}/stdtime/FreeBSD/tzfile.h +) +INSTHDRS=( "${INSTHDRS[@]}" "${INC_INSTHDRS[@]}" ) + +INC_ARPA_INSTHDRS=( ftp.h inet.h nameser_compat.h telnet.h tftp.h ) +ARPA_INSTHDRS=( "${INC_ARPA_INSTHDRS[@]/#/${SRCROOT}/include/arpa/}" ) + +if [ "x${FEATURE_THERM_NOTIFICATION_APIS}" == "x1" ]; then + INC_THERM_INSTHDRS=( OSThermalNotification.h ) + THERM_INSTHDRS=( "${INC_THERM_INSTHDRS[@]/#/${SRCROOT}/include/libkern/}" ) +fi + +INC_PROTO_INSTHDRS=( routed.h rwhod.h talkd.h timed.h ) +PROTO_INSTHDRS=( "${INC_PROTO_INSTHDRS[@]/#/${SRCROOT}/include/protocols/}" ) + +INC_SECURE_INSTHDRS=( _common.h _string.h _strings.h _stdio.h ) +SECURE_INSTHDRS=( "${INC_SECURE_INSTHDRS[@]/#/${SRCROOT}/include/secure/}" ) + +SYS_INSTHDRS=( ${SRCROOT}/include/sys/acl.h ${SRCROOT}/include/sys/statvfs.h ) + +INC_XLOCALE_INSTHDRS=( + __wctype.h + _ctype.h + _inttypes.h + _langinfo.h + _monetary.h + _regex.h + _stdio.h + _stdlib.h + _string.h + _time.h + _wchar.h + _wctype.h +) +XLOCALE_INSTHDRS=( "${INC_XLOCALE_INSTHDRS[@]/#/${SRCROOT}/include/xlocale/}" ) + +TYPES_INSTHDRS=( + ${SRCROOT}/include/_types/_intmax_t.h + ${SRCROOT}/include/_types/_nl_item.h + ${SRCROOT}/include/_types/_uint16_t.h + ${SRCROOT}/include/_types/_uint32_t.h + ${SRCROOT}/include/_types/_uint64_t.h + ${SRCROOT}/include/_types/_uint8_t.h + ${SRCROOT}/include/_types/_uintmax_t.h + ${SRCROOT}/include/_types/_wctrans_t.h + ${SRCROOT}/include/_types/_wctype_t.h +) + +LOCALHDRS=( + ${SRCROOT}/darwin/libc_private.h + ${SRCROOT}/gen/utmpx_thread.h + ${SRCROOT}/nls/FreeBSD/msgcat.h + ${SRCROOT}/gen/thread_stack_pcs.h + ${SRCROOT}/libdarwin/h/dirstat.h +) + +OS_LOCALHDRS=( ${SRCROOT}/os/assumes.h ${SRCROOT}/os/debug_private.h ) + +PRIV_INSTHDRS=( + ${SRCROOT}/stdlib/FreeBSD/atexit.h +) + +PRIV_BTREEHDRS=( + ${SRCROOT}/db/btree/FreeBSD/btree.h + ${SRCROOT}/db/btree/FreeBSD/bt_extern.h +) + +SYS_INSTHDRS=( + ${SRCROOT}/include/sys/acl.h + ${SRCROOT}/include/sys/rbtree.h + ${SRCROOT}/include/sys/statvfs.h +) +PRIVUUID_INSTHDRS=( ${SRCROOT}/uuid/namespace.h ) + +else # DRIVERKITSDK + +# Public DriverKit SDK headers + +UNIFDEFARGS="${UNIFDEFARGS} -U_USE_EXTENDED_LOCALES_" + +INC_INSTHDRS=( + __wctype.h + _ctype.h + _locale.h + _stdio.h + _types.h + _wctype.h + alloca.h + assert.h + ctype.h + inttypes.h + limits.h + locale.h + runetype.h + stddef.h + stdio.h + stdint.h + stdlib.h + string.h + strings.h + time.h + wchar.h + wctype.h +) + +TYPES_INSTHDRS=( + ${SRCROOT}/include/_types/_intmax_t.h + ${SRCROOT}/include/_types/_uint16_t.h + ${SRCROOT}/include/_types/_uint32_t.h + ${SRCROOT}/include/_types/_uint64_t.h + ${SRCROOT}/include/_types/_uint8_t.h + ${SRCROOT}/include/_types/_uintmax_t.h + ${SRCROOT}/include/_types/_wctrans_t.h + ${SRCROOT}/include/_types/_wctype_t.h +) + +INC_INSTHDRS=( + "${INC_INSTHDRS[@]/#/${SRCROOT}/include/}" +) +INSTHDRS=( "${INSTHDRS[@]}" "${INC_INSTHDRS[@]}" ) + +INC_SECURE_INSTHDRS=( _common.h _string.h _strings.h _stdio.h ) +SECURE_INSTHDRS=( "${INC_SECURE_INSTHDRS[@]/#/${SRCROOT}/include/secure/}" ) + +fi # DRIVERKITSDK + +if [ -n "${INSTHDRS}" ]; then +${MKDIR} ${INCDIR} +${INSTALL} -m ${INSTALLMODE} ${INSTHDRS[@]} ${INCDIR} +fi +if [ -n "${ARPA_INSTHDRS}" ]; then +${MKDIR} ${INCDIR}/arpa +${INSTALL} -m ${INSTALLMODE} ${ARPA_INSTHDRS[@]} ${INCDIR}/arpa +fi +if [ -n "${THERM_INSTHDRS}" ]; then +${MKDIR} ${INCDIR}/libkern +${INSTALL} -m ${INSTALLMODE} ${THERM_INSTHDRS[@]} ${INCDIR}/libkern +fi +if [ -n "${PROTO_INSTHDRS}" ]; then +${MKDIR} ${INCDIR}/protocols +${INSTALL} -m ${INSTALLMODE} ${PROTO_INSTHDRS[@]} ${INCDIR}/protocols +fi +if [ -n "${SECURE_INSTHDRS}" ]; then +${MKDIR} ${INCDIR}/secure +${INSTALL} -m ${INSTALLMODE} ${SECURE_INSTHDRS[@]} ${INCDIR}/secure +fi +if [ -n "${SYS_INSTHDRS}" ]; then +${MKDIR} ${INCDIR}/sys +${INSTALL} -m ${INSTALLMODE} ${SYS_INSTHDRS[@]} ${INCDIR}/sys +fi +if [ -n "${XLOCALE_INSTHDRS}" ]; then +${MKDIR} ${INCDIR}/xlocale +${INSTALL} -m ${INSTALLMODE} ${XLOCALE_INSTHDRS[@]} ${INCDIR}/xlocale +fi +if [ -n "${TYPES_INSTHDRS}" ]; then +${MKDIR} ${INCDIR}/_types +${INSTALL} -m ${INSTALLMODE} ${TYPES_INSTHDRS[@]} ${INCDIR}/_types +fi +if [ -n "${LOCALHDRS}" ]; then +${MKDIR} ${LOCINCDIR} +${INSTALL} -m ${INSTALLMODE} ${LOCALHDRS[@]} ${LOCINCDIR} +fi +if [ -n "${OS_LOCALHDRS}" ]; then +${MKDIR} ${LOCINCDIR}/os +${INSTALL} -m ${INSTALLMODE} ${OS_LOCALHDRS[@]} ${LOCINCDIR}/os +fi +if [ -n "${PRIV_INSTHDRS}" ]; then +${MKDIR} ${PRIVHDRS} +${INSTALL} -m ${INSTALLMODE} ${PRIV_INSTHDRS[@]} ${PRIVHDRS} +fi +if [ -n "${PRIV_BTREEHDRS}" ]; then +${MKDIR} ${PRIVHDRS}/btree +${INSTALL} -m ${INSTALLMODE} ${PRIV_BTREEHDRS[@]} ${PRIVHDRS}/btree +fi +if [ -n "${SYS_INSTHDRS}" ]; then +${MKDIR} ${PRIVHDRS}/sys +${INSTALL} -m ${INSTALLMODE} ${SYS_INSTHDRS[@]} ${PRIVHDRS}/sys +fi +if [ -n "${PRIVUUID_INSTHDRS}" ]; then +${MKDIR} ${PRIVHDRS}/uuid +${INSTALL} -m ${INSTALLMODE} ${PRIVUUID_INSTHDRS[@]} ${PRIVHDRS}/uuid +${MKDIR} ${PRIVKERNELHDRS}/uuid +${INSTALL} -m ${INSTALLMODE} ${PRIVUUID_INSTHDRS[@]} ${PRIVKERNELHDRS}/uuid +fi +if [ -f "${INCDIR}/asm.h" ]; then +${MKDIR} ${PRIVHDRS}/machine +${MV} ${INCDIR}/asm.h ${PRIVHDRS}/machine +fi + +for i in `${FIND} "${HDRROOT}/${SDK_INSTALL_HEADERS_ROOT}" -name \*.h -print0 | ${XARGS} -0 ${GREP} -l '^//Begin-Libc'`; do + ${CHMOD} u+w $i && + ${ECHO} ${ED} - $i \< ${SRCROOT}/xcodescripts/strip-header.ed && + ${ED} - $i < ${SRCROOT}/xcodescripts/strip-header.ed && + ${CHMOD} u-w $i || exit 1; +done +for i in `${FIND} "${HDRROOT}/${SDK_INSTALL_HEADERS_ROOT}" -name \*.h -print0 | ${XARGS} -0 ${FGREP} -l -e UNIFDEF -e OPEN_SOURCE -e _USE_EXTENDED_LOCALES_`; do + ${CHMOD} u+w $i && + ${CP} $i $i.orig && + ${ECHO} ${UNIFDEF} ${UNIFDEFARGS} $i.orig \> $i && + { ${UNIFDEF} ${UNIFDEFARGS} $i.orig > $i || [ $? -ne 2 ]; } && + ${RM} $i.orig && + ${CHMOD} u-w $i || exit 1; +done + +exit 0 diff --git a/xcodescripts/legacy_alias.list b/xcodescripts/legacy_alias.list new file mode 100644 index 0000000..fe2ecc4 --- /dev/null +++ b/xcodescripts/legacy_alias.list @@ -0,0 +1,19 @@ +# (i386 only) +# There used to be legacy versions of various funciotns, but we've removed them +# and just given everyone the UNIX2003 behavior. The legacy variant doesn't +# build those functions anymore, they are just aliased to corresponding 32-bit +# non-legacy symbols. e.g.: +# _opendir legacy, aliased to _opendir$UNIX2003 +# _opendir$UNIX2003 32-bit inodes +# _opendir$INODE64$UNIX2003 64-bit inodes + +___opendir2$UNIX2003 ___opendir2 +__seekdir$UNIX2003 __seekdir +_closedir$UNIX2003 _closedir +_fdopendir$UNIX2003 _fdopendir +_opendir$UNIX2003 _opendir +_rewinddir$UNIX2003 _rewinddir +_seekdir$UNIX2003 _seekdir +_telldir$UNIX2003 _telldir + +_strerror$UNIX2003 _strerror diff --git a/xcodescripts/libc.xcconfig b/xcodescripts/libc.xcconfig new file mode 100644 index 0000000..a7437ae --- /dev/null +++ b/xcodescripts/libc.xcconfig @@ -0,0 +1,170 @@ +#include "/Makefiles/CoreOS/Xcode/BSD.xcconfig" + +// Standard settings +SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator iphoneosnano iphonesimulatornano bridgeos + +SDK_INSTALL_VARIANT = $(SDK_INSTALL_VARIANT_$(DRIVERKIT)) +SDK_INSTALL_VARIANT_1 = driverkit +SDK_INSTALL_VARIANT_ = default +SDK_INSTALL_ROOT = $(SDK_INSTALL_ROOT_$(SDK_INSTALL_VARIANT)) +SDK_INSTALL_ROOT_driverkit = $(DRIVERKITROOT) +SDK_INSTALL_HEADERS_ROOT = $(SDK_INSTALL_HEADERS_ROOT_$(SDK_INSTALL_VARIANT)) +SDK_INSTALL_HEADERS_ROOT_driverkit = $(SDK_INSTALL_ROOT)/$(SDK_RUNTIME_HEADERS_PREFIX) +SDK_RUNTIME_HEADERS_PREFIX = Runtime + +SRCROOT_SEARCH_PATHS = $(SRCROOT) $(SRCROOT)/include $(SRCROOT)/gen $(SRCROOT)/locale $(SRCROOT)/locale/FreeBSD $(SRCROOT)/stdtime/FreeBSD $(SRCROOT)/darwin +SYSTEM_FRAMEWORK_HEADERS = $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/System/Library/Frameworks/System.framework/PrivateHeaders +SDK_SYSTEM_FRAMEWORK_HEADERS = $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders +HEADER_SEARCH_PATHS = $($(TARGET_NAME)_SEARCH_PATHS) $(DERIVED_FILES_DIR)/dtrace $(SRCROOT_SEARCH_PATHS) $(inherited) +SYSTEM_HEADER_SEARCH_PATHS = $(SYSTEM_FRAMEWORK_HEADERS) $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/usr/local/include $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/usr/include +SYSTEM_FRAMEWORK_SEARCH_PATHS = $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/System/Library/Frameworks +ALWAYS_SEARCH_USER_PATHS = YES +USE_HEADERMAP = NO +BUILD_VARIANTS = normal +GCC_OPTIMIZATION_LEVEL = s +GCC_C_LANGUAGE_STANDARD = gnu11 +GCC_ENABLE_OBJC_EXCEPTIONS = YES +GCC_SYMBOLS_PRIVATE_EXTERN = NO +GCC_DYNAMIC_NO_PIC = NO +GCC_THUMB_SUPPORT = YES +GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + +//CLANG_WARN_INT_CONVERSION = YES +//CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES +//GCC_WARN_64_TO_32_BIT_CONVERSION = YES +//GCC_WARN_SHADOW = YES +GCC_WARN_UNINITIALIZED_AUTOS = YES; +GCC_WARN_UNUSED_VARIABLE = YES; +GCC_WARN_ABOUT_RETURN_TYPE = YES; +//WARNING_CFLAGS = -Wall -Wextra +WARNING_CFLAGS = -Wall -Werror -Wno-error=shorten-64-to-32 -Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-nullability-completeness + +COPY_PHASE_STRIP = NO +SKIP_INSTALL = YES +INSTALLHDRS_SCRIPT_PHASE = YES +INSTALLHDRS_COPY_PHASE = YES +VERSIONING_SYSTEM = +VERSION_INFO_PREFIX = __attribute__((visibility("hidden"))) +COPY_PHASE_STRIP = NO +STRIP_INSTALLED_PRODUCT = NO +LD_DYLIB_INSTALL_NAME = $(SDK_INSTALL_ROOT)/usr/lib/system/$(EXECUTABLE_NAME) +IS_ZIPPERED = YES + +BUILD_VARIANTS = normal debug +BUILD_ARCHIVES = Platform Base FreeBSD NetBSD TRE vCancelable vDarwinExtsn vDarwinExtsnCancelable vPre1050 vLegacy vInode32 FortifySource + +// clang is desired over llvm-gcc for OSAtomics. However, it isn't capable of building armv6 correctly. +GCC_VERSION = com.apple.compilers.llvm.clang.1_0 +GCC_VERSION[arch=armv6] = com.apple.compilers.llvmgcc42 + +EXECUTABLE_PREFIX = libsystem_ +INSTALL_PATH = $(SDK_INSTALL_ROOT)/usr/lib/system +PUBLIC_HEADERS_FOLDER_PATH = $(SDK_INSTALL_HEADERS_ROOT)/usr/include +PRIVATE_HEADERS_FOLDER_PATH = $(SDK_INSTALL_HEADERS_ROOT)/usr/local/include + +DARWIN_PUBLIC_HEADERS_FOLDER_PATH = $(SDK_INSTALL_HEADERS_ROOT)/usr/include/os +DARWIN_PRIVATE_HEADERS_FOLDER_PATH = $(SDK_INSTALL_HEADERS_ROOT)/usr/local/include/os + +// Simulator +BASE_PREPROCESSOR_MACROS = __LIBC__ __DARWIN_UNIX03=1 __DARWIN_64_BIT_INO_T=1 __DARWIN_NON_CANCELABLE=1 __DARWIN_VERS_1050=1 _FORTIFY_SOURCE=0 +OTHER_CFLAGS = -fdollars-in-identifiers -fno-common -fverbose-asm $($(TARGET_NAME)_CFLAGS) $(VARIANT_PREPROCESSOR_MACROS) +OTHER_CFLAGS_debug = -fstack-protector -fno-inline -O0 -DDEBUG=1 +SIM_SUFFIX[sdk=*simulator*] = _sim + +GCC_PREPROCESSOR_DEFINITIONS = $(BASE_PREPROCESSOR_MACROS) + +// libsystem_c.dylib linking +CR_LDFLAGS = -lCrashReporterClient +CR_LDFLAGS[sdk=driverkit*] = +LIBCOMPILER_RT_LDFLAGS = -lcompiler_rt +LIBMALLOC_LDFLAGS = -lsystem_malloc +LIBC_LDFLAGS = -lsystem_c +LIBDISPATCH_LDFLAGS = -ldispatch +LIBXPC_LDFLAGS = -lxpc +LIBPLATFORM_LDFLAGS = -lsystem$(SIM_SUFFIX)_platform +LIBPTHREAD_LDFLAGS = -lsystem$(SIM_SUFFIX)_pthread +LIBSYSCALL_LDFLAGS = -lsystem$(SIM_SUFFIX)_kernel +LIBM_LDFLAGS = -lsystem_m +LIBDYLD_LDFLAGS = -ldyld +LIBSYSTEM_C_LDFLAGS = -all_load -nostdlib -L$(SDK_INSTALL_ROOT)/usr/lib/system -umbrella System $(CR_LDFLAGS) $(LIBCOMPILER_RT_LDFLAGS) $(LIBDYLD_LDFLAGS) $(LIBSYSCALL_LDFLAGS) $(LIBM_LDFLAGS) $(LIBMALLOC_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBPTHREAD_LDFLAGS) $(UPWARD_LDFLAGS) $(LIBSYSTEM_C_EXTRA_LDFLAGS_$(CURRENT_ARCH)) -Wl,-interposable_list,$(DERIVED_FILES_DIR)/interposable.list -Wl,-unexported_symbols_list,$(DERIVED_FILES_DIR)/unexport.list -Wl,-alias_list,$(SRCROOT)/xcodescripts/alias.list -Wl,-order_file,$(SRCROOT)/xcodescripts/Libc.order @$(BUILT_PRODUCTS_DIR)/$(CURRENT_VARIANT).linklist +LIBSYSTEM_C_EXTRA_LDFLAGS_i386 = -Wl,-alias_list,$(SRCROOT)/xcodescripts/legacy_alias.list + +// TODO: Remove upward links - mostly , macho is for assumes.c +UPWARD_LDFLAGS = -Wl,-upward-ldispatch -Wl,-upward-lmacho -Wl,-upward-lsystem_asl -Wl,-upward-lsystem_blocks -Wl,-upward-lsystem_info -Wl,-upward-lsystem_notify -Wl,-upward-lxpc -Wl,-upward-lcorecrypto -Wl,-upward-lsystem_trace +UPWARD_LDFLAGS[sdk=driverkit*] = -Wl,-upward-lmacho -Wl,-upward-lsystem_blocks -Wl,-upward-lcorecrypto + +LIBSYSTEM_DARWIN_LDFLAGS = -all_load -nostdlib -L$(SDK_INSTALL_ROOT)/usr/lib/system -umbrella System $(LIBCOMPILER_RT_LDFLAGS) $(LIBDYLD_LDFLAGS) $(LIBSYSCALL_LDFLAGS) $(LIBM_LDFLAGS) $(LIBMALLOC_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBPTHREAD_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBC_LDFLAGS) $(LIBDISPATCH_LDFLAGS) $(LIBXPC_LDFLAGS) + +// libPlatform.a architectures +ARCH_FAMILY = $(ARCH_FAMILY_$(CURRENT_ARCH)) +ARCH_FAMILY_x86_64 = x86_64 +ARCH_FAMILY_i386 = i386 +ARCH_FAMILY_armv6 = arm +ARCH_FAMILY_armv7 = arm +ARCH_FAMILY_armv7s = arm +ARCH_FAMILY_armv7f = arm +ARCH_FAMILY_armv7k = arm +ARCH_FAMILY_arm64 = arm64 + +// Platform target +Platform_INCLUDED_SOURCE_FILE_NAMES = forceLibcToBuild.c $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) +Platform_INCLUDED_SOURCE_FILE_NAMES_gen = $(ARCH_FAMILY)/gen/*.c $(ARCH_FAMILY)/gen/*.s $(ARCH_FAMILY)/gen/*.S + +// FreeBSD target +FreeBSD_CFLAGS = -include $(SRCROOT)/fbsdcompat/_fbsd_compat_.h +FreeBSD_SEARCH_PATHS = $(SRCROOT)/fbsdcompat $(SRCROOT)/gdtoa $(SRCROOT)/gdtoa/FreeBSD +FreeBSD_EXCLUDED_SOURCE_GDTOA = gdtoa/FreeBSD/machdep* gdtoa-strtopx.c +// Include the correct parts of gdtoa per-arch +FreeBSD_INCLUDED_SOURCE_FILE_NAMES = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_$(ARCH_FAMILY)) +FreeBSD_INCLUDED_SOURCE_FILE_NAMES_x86_64 = gdtoa-strtopx.c machdep_ldisx.c +FreeBSD_INCLUDED_SOURCE_FILE_NAMES_i386 = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_x86_64) +FreeBSD_INCLUDED_SOURCE_FILE_NAMES_arm = machdep_ldisd.c +FreeBSD_INCLUDED_SOURCE_FILE_NAMES_arm64 = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_arm) + +// NetBSD target +NetBSD_CFLAGS = -include $(SRCROOT)/nbsdcompat/_nbsd_compat_.h +NetBSD_SEARCH_PATHS = $(SRCROOT)/nbsdcompat + +// TRE target +TRE_CFLAGS = -DHAVE_CONFIG_H +TRE_SEARCH_PATHS = $(SRCROOT)/regex/TRE $(SRCROOT)/regex/FreeBSD + +// Files per architecture to exclude from the non-platform builds (because optimised versions exist in Platform) +BASE_INCLUDED_SOURCE_FILE_NAMES = $(BASE_INCLUDED_SOURCE_FILE_NAMES_$(ARCH_FAMILY)) +BASE_EXCLUDED_SOURCE_FILE_NAMES = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_$(ARCH_FAMILY)) $(BASE_EXCLUDED_SOURCE_FILE_NAMES_$(VARIANT_PLATFORM_NAME)) +BASE_EXCLUDED_SOURCE_FILE_NAMES_x86_64 = kvm.c nlist.c +BASE_EXCLUDED_SOURCE_FILE_NAMES_arm64 = kvm.c nlist.c + +// Rune support isn't included on iOS but there's no better way to exclude their complication +BASE_EXCLUDED_SOURCE_FILE_NAMES_macosx = OSMemoryNotification.c +BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos = frune.c login.c logout.c mbrune.c runedepreciated.c setinvalidrune.c getmntinfo64.c +BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos) +BASE_EXCLUDED_SOURCE_FILE_NAMES_appletvos = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos) +BASE_EXCLUDED_SOURCE_FILE_NAMES_appletvsimulator = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator) +BASE_EXCLUDED_SOURCE_FILE_NAMES_watchos = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos) +BASE_EXCLUDED_SOURCE_FILE_NAMES_watchsimulator = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator) +BASE_EXCLUDED_SOURCE_FILE_NAMES_bridgeos = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos) +BASE_EXCLUDED_SOURCE_FILE_NAMES_driverkit = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_macosx) $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos) getlogin.c setlogin.c logwtmp.c utmpx.c utmpx-darwin.c daemon.c authentication.c pty.c opendev.c fparseln.c psort*.c crypt.c glob.c readpassphrase.c atexit_receipt.c debug_private.c sourcefilter.c inet*.c nsap_addr.c ascii2addr.c addr2ascii.c acl*.c filesec.c chmodx_np.c openx_np.c umaskx_np.c statx_np.c + +// TODO: Remove these legacy platform names: +BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneosnano = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_watchos) +BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulatornano = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_watchsimulator) + +// Enable installapi +SUPPORTS_TEXT_BASED_API = YES +TAPI_VERIFY_MODE = Pedantic +OTHER_TAPI_FLAGS = --no-infer-include-paths -umbrella System -extra-public-header $(TAPI_PUBLIC_HEADER_PATH) -extra-private-header $(TAPI_PRIVATE_HEADER_PATH) +TAPI_PUBLIC_HEADER_PATH = $(TAPI_PUBLIC_HEADER_PATH_$(DEPLOYMENT_LOCATION)) +TAPI_PUBLIC_HEADER_PATH_NO = $(BUILT_PRODUCTS_DIR)$(PUBLIC_HEADERS_FOLDER_PATH) +TAPI_PUBLIC_HEADER_PATH_YES = $(DSTROOT)$(PUBLIC_HEADERS_FOLDER_PATH) +TAPI_PRIVATE_HEADER_PATH = $(TAPI_PRIVATE_HEADER_PATH_$(DEPLOYMENT_LOCATION)) +TAPI_PRIVATE_HEADER_PATH_NO = $(BUILT_PRODUCTS_DIR)$(PRIVATE_HEADERS_FOLDER_PATH) +TAPI_PRIVATE_HEADER_PATH_YES = $(DSTROOT)$(PRIVATE_HEADERS_FOLDER_PATH) +TAPI_HEADER_SEARCH_PATHS = + +// TODO: Remove this hack once Marzipan bringup is done +VARIANT_PLATFORM_NAME = $(VARIANT_PLATFORM_NAME_$(RC_MARZIPAN)) +VARIANT_PLATFORM_NAME_YES = macosx +VARIANT_PLATFORM_NAME_ = $(VARIANT_PLATFORM_NAME_$(SDK_INSTALL_VARIANT)) +VARIANT_PLATFORM_NAME_default = $(PLATFORM_NAME) +VARIANT_PLATFORM_NAME_driverkit = driverkit diff --git a/xcodescripts/libc_static.xcconfig b/xcodescripts/libc_static.xcconfig new file mode 100644 index 0000000..d6f7765 --- /dev/null +++ b/xcodescripts/libc_static.xcconfig @@ -0,0 +1,21 @@ +#include "libc.xcconfig" + +BUILD_ARCHIVES = Base FreeBSD TRE vCancelable vDarwinExtsn +BUILD_VARIANTS = normal debug +EXECUTABLE_PREFIX = lib +INSTALL_PATH = /usr/local/lib/system +OTHER_LIBTOOLFLAGS = -filelist $(BUILT_PRODUCTS_DIR)/$(CURRENT_VARIANT).linklist.libtool +PRODUCT_NAME = c +SKIP_INSTALL = NO +STRIP_INSTALLED_PRODUCT = NO +VARIANT = STATIC_VERSION +VERSIONING_SYSTEM = apple-generic + +// Only include what's needed +EXCLUDED_SOURCE_FILE_NAMES = * +INCLUDED_SOURCE_FILE_NAMES = secure/*.c $(ARCH_FAMILY_$(CURRENT_ARCH))/*/*.c $(ARCH_FAMILY_$(CURRENT_ARCH))/*/*.S $(ARCH_FAMILY_$(CURRENT_ARCH))/*/*.s + +VARIANT_PREPROCESSOR_MACROS = -UBUILDING_VARIANT -DVARIANT_STATIC -DVARIANT_CANCELABLE -DVARIANT_DARWINEXTSN -U__DARWIN_NON_CANCELABLE -D__DARWIN_NON_CANCELABLE=0 + +SYSTEM_FRAMEWORK_HEADERS = $(DERIVED_FILES_DIR)/System.framework/Versions/B/PrivateHeaders +HEADER_SEARCH_PATHS = $(FreeBSD_SEARCH_PATHS) $(inherited) diff --git a/xcodescripts/manpages.sh b/xcodescripts/manpages.sh new file mode 100755 index 0000000..3141add --- /dev/null +++ b/xcodescripts/manpages.sh @@ -0,0 +1,69 @@ +#!/bin/bash -e + +if [ "$ACTION" = installhdrs ]; then exit 0; fi +if [ "${PLATFORM_NAME}" != "macosx" ]; then exit 0; fi +if [ "${SKIP_MANPAGES}" = "YES" ]; then exit 0; fi +if [ "${DRIVERKIT}" = 1 ]; then exit 0; fi + +UNIFDEF_FLAGS=`${SRCROOT}/xcodescripts/generate_features.pl --unifdef` +MANPAGES_LIST="${SRCROOT}/man/manpages.lst" +FILES=$(find -E ${SRCROOT} -regex '.*/[^.]+\.[0-9]' -type f) + +cat ${MANPAGES_LIST} | grep -v -E '(^#|^\s*$)' | while read first solid rest; do + SOURCE=$(grep -E "/${first}$"< uuid.3 + [[ "${page}" == "libuuid.3" ]] && DEST=${DESTDIR}/uuid.3 + + sed -f ${SRCROOT}/uuid/uuidman.sed ${SRCROOT}/uuid/uuidsrc/${page}.in > ${DEST} +done + +# and because uuid pages are special cased, so are the links +for link in uuid_generate_random.3 uuid_generate_time.3; do + SECTION=$(echo ${link} | tail -c 2) + ln -sf uuid_generate.3 ${DSTROOT}/usr/share/man/man${SECTION}/${link} +done + +for link in uuid_unparse_lower.3 uuid_unparse_upper.3; do + SECTION=$(echo ${link} | tail -c 2) + ln -sf uuid_unparse.3 ${DSTROOT}/usr/share/man/man${SECTION}/${link} +done diff --git a/xcodescripts/patch_headers_variants.pl b/xcodescripts/patch_headers_variants.pl new file mode 100644 index 0000000..a71d758 --- /dev/null +++ b/xcodescripts/patch_headers_variants.pl @@ -0,0 +1,129 @@ +#!/usr/bin/perl +# +# Copyright (c) 2006, 2007 Apple Inc. All rights reserved. +# +# @APPLE_LICENSE_HEADER_START@ +# +# This file contains Original Code and/or Modifications of Original Code +# as defined in and that are subject to the Apple Public Source License +# Version 2.0 (the 'License'). You may not use this file except in +# compliance with the License. Please obtain a copy of the License at +# http://www.opensource.apple.com/apsl/ and read it before using this +# file. +# +# The Original Code and all software distributed under the License are +# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +# Please see the License for the specific language governing rights and +# limitations under the License. +# +# @APPLE_LICENSE_HEADER_END@ +# +# patchheaders srcdir destdir +# +# The last path component of srcdir is replicated in destdir, with the +# __DARWIN_ALIAS* and __DARWIN_EXTSN macro wrapped so that Libc can set +# the symbol decoration independently: +# +# #ifndef LIBC_ALIAS_FOO +# int foo(int) __DARWIN_ALIAS(foo); +# #else /* LIBC_ALIAS_FOO */ +# int foo(int) LIBC_ALIAS(foo); +# #endif /* !LIBC_ALIAS_FOO */ + +use strict; +use IO::File; +use File::Basename (); +use File::Find (); +use File::Path (); +use File::Spec; + +my $MyName = File::Basename::basename($0); +my $dest; + +sub process { + my($path, $file) = @_; + local $_; + if (-e $file) { + my $dest_mtime = (stat($file))[9]; + my $src_mtime = (stat($path))[9]; + + if ($dest_mtime > $src_mtime) { + return; + } + } + + my($fname, $dirs, $suffix) = File::Basename::fileparse($file, ".h"); + if ($suffix ne ".h") { + return; + } + + my $p = IO::File->new($path, 'r'); + die "$MyName: Can't open $path: $!\n" unless defined($p); + my $f = IO::File->new($file, 'w'); + die "$MyName: Can't open $file: $!\n" unless defined($f); + my @save; + while(<$p>) { + if(/^\S/ or /^\s*$/) { + my $n = scalar(@save); + my $sym; + if($n > 0) { + my($sym) = ($save[$n - 1] =~ /__DARWIN_(?:10\d+|ALIAS|EXTSN|INODE64)[^(]*\(([^)]*)\)/); + if($save[$n - 1] =~ /__DARWIN_ALIAS_STARTING/) { + undef $sym; + } + if(defined($sym)) { + if(defined($path)) { + print " $path\n"; + undef($path); + } + $sym =~ s/^\s+//; + $sym =~ s/\s+$//; + $sym =~ tr/a-z/A-Z/; + $f->print("#ifndef LIBC_ALIAS_$sym\n"); + } + $f->print(@save); + if(defined($sym)) { + $save[$n - 1] =~ s/__DARWIN_(10\d+|ALIAS|EXTSN|INODE64)/LIBC_$1/; + $f->print("#else /* LIBC_ALIAS_$sym */\n"); + $f->print(@save); + $f->print("#endif /* !LIBC_ALIAS_$sym */\n"); + } + } + if(/^#/) { + $f->print($_); + @save = (); + } else { + @save = ($_); + } + } else { + push(@save, $_); + } +} +$f->print(@save); +} + +sub usage { + die "Usage: $MyName srcdir dstdir\n"; +} + +sub wanted { + if(-d $File::Find::name) { + #print "DIR: $File::Find::name\n"; + my $dir = File::Spec->join($dest, $File::Find::name); + File::Path::mkpath($dir, 0, 0755); + } else { + #print "FIL: $File::Find::name\n"; + my $file = File::Spec->join($dest, $File::Find::name); + process($File::Find::name, $file); + } +} + +usage() unless scalar(@ARGV) == 2; +my $start = File::Basename::dirname($ARGV[0]); +chdir($start) || die "$MyName: chdir($start): $!\n"; +$dest = $ARGV[1]; +File::Path::mkpath($dest, 0, 0755); +File::Find::find({wanted => \&wanted, no_chdir => 1}, File::Basename::basename($ARGV[0])); diff --git a/xcodescripts/sanitise_headers.sh b/xcodescripts/sanitise_headers.sh new file mode 100755 index 0000000..41f4669 --- /dev/null +++ b/xcodescripts/sanitise_headers.sh @@ -0,0 +1,21 @@ +#!/bin/bash -e +# +# Copyright (c) 2010-2011 Apple Inc. All rights reserved. +# +# @APPLE_APACHE_LICENSE_HEADER_START@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# @APPLE_APACHE_LICENSE_HEADER_END@ +# + diff --git a/xcodescripts/sim-compat-symlink.sh b/xcodescripts/sim-compat-symlink.sh new file mode 100755 index 0000000..7c1826a --- /dev/null +++ b/xcodescripts/sim-compat-symlink.sh @@ -0,0 +1,9 @@ +#!/bin/bash -ex + +if [[ "${ACTION}" == "installhdrs" ]]; then + exit 0 +fi + +if [[ "${PLATFORM_NAME}" =~ "simulator" ]]; then + ln -s libsystem_c.dylib ${DSTROOT}${INSTALL_PATH}/libsystem_sim_c.dylib +fi diff --git a/xcodescripts/skip_installhdrs.sh b/xcodescripts/skip_installhdrs.sh new file mode 100755 index 0000000..f3bb0f7 --- /dev/null +++ b/xcodescripts/skip_installhdrs.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +if [[ "x${ACTION}" == "xinstallhdrs" ]]; then + exit 0 +fi + +if [[ "x${ACTION}" == "xinstallapi" ]]; then + exit 0 +fi + +$@ diff --git a/xcodescripts/strip-header.ed b/xcodescripts/strip-header.ed new file mode 100644 index 0000000..a7d7aa8 --- /dev/null +++ b/xcodescripts/strip-header.ed @@ -0,0 +1,2 @@ +g/^\/\/Begin-Libc$/.,/^\/\/End-Libc$/d +w diff --git a/xcodescripts/variants.xcconfig b/xcodescripts/variants.xcconfig new file mode 100644 index 0000000..68fd071 --- /dev/null +++ b/xcodescripts/variants.xcconfig @@ -0,0 +1,82 @@ +#include "libc.xcconfig" + +// Variants. All variants contain all source files but all excluded. Specific variants then include the files they need. +VARIANT_EXCLUDED_SOURCE_FILE_NAMES = * +VARIANT_INCLUDED_SOURCE_FILE_NAMES = forceLibcToBuild.c $(VARIANT_$(VARIANT)_INCLUDE) +VARIANT_PREPROCESSOR_MACROS = -DBUILDING_VARIANT $(VARIANT_$(VARIANT)_MACROS) + +SYSTEM_FRAMEWORK_HEADERS = $(DERIVED_FILES_DIR)/System.framework/Versions/B/PrivateHeaders +HEADER_SEARCH_PATHS = $(FreeBSD_SEARCH_PATHS) $(inherited) + +VARIANT_CANCELABLE_MACROS = -DVARIANT_CANCELABLE + +VARIANT_CANCELABLE_INCLUDE = $(VARIANT_CANCELABLE_INCLUDE_compat) $(VARIANT_CANCELABLE_INCLUDE_gen) $(VARIANT_CANCELABLE_INCLUDE_net) $(VARIANT_CANCELABLE_INCLUDE_sys) + +VARIANT_CANCELABLE_INCLUDE_compat = creat.c sigcompat.c +VARIANT_CANCELABLE_INCLUDE_gen = lockf.c nanosleep.c pause.c sleep.c termios.c usleep.c wait.c waitpid.c +VARIANT_CANCELABLE_INCLUDE_net = recv.c send.c +VARIANT_CANCELABLE_INCLUDE_sys = system.c + +// $DARWINEXTSN + +VARIANT_DARWINEXTSN_MACROS = -DVARIANT_DARWINEXTSN + +VARIANT_DARWINEXTSN_INCLUDE = $(VARIANT_DARWINEXTSN_INCLUDE_gen) $(VARIANT_DARWINEXTSN_INCLUDE_stdio) $(VARIANT_DARWINEXTSN_INCLUDE_stdlib) $(VARIANT_DARWINEXTSN_INCLUDE_sys_$(SDK_INSTALL_VARIANT)) + +VARIANT_DARWINEXTSN_INCLUDE_gen = popen.c +VARIANT_DARWINEXTSN_INCLUDE_stdio = fdopen.c fopen.c +VARIANT_DARWINEXTSN_INCLUDE_stdlib = realpath.c +VARIANT_DARWINEXTSN_INCLUDE_sys_default = getgroups.c + +// $DARWINEXTSN + no cancel (everyone else is cancelable anyway) + +VARIANT_DARWINEXTSN_CANCELABLE_MACROS = -DVARIANT_CANCELABLE -DVARIANT_DARWINEXTSN + +// Pre-1050 symbols + +VARIANT_PRE1050_MACROS = $(VARIANT_PRE1050_MACROS_$(VARIANT_PLATFORM_NAME)) +VARIANT_PRE1050_MACROS_macosx = -U__DARWIN_VERS_1050 -D__DARWIN_VERS_1050=0 -DVARIANT_PRE1050 +VARIANT_PRE1050_INCLUDE = $(VARIANT_PRE1050_INCLUDE_$(VARIANT_PLATFORM_NAME)) +VARIANT_PRE1050_INCLUDE_macosx = daemon.c $(VARIANT_PRE1050_INCLUDE_$(VARIANT_PLATFORM_NAME)_$(CURRENT_ARCH)) + +// Legacy symbols +VARIANT_LEGACY_MACROS = -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0 -U__DARWIN_64_BIT_INO_T -D__DARWIN_64_BIT_INO_T=0 -DVARIANT_LEGACY + +VARIANT_LEGACY_INCLUDE = $(VARIANT_LEGACY_INCLUDE_$(VARIANT_PLATFORM_NAME)) +VARIANT_LEGACY_INCLUDE_macosx = $(VARIANT_LEGACY_INCLUDE_$(VARIANT_PLATFORM_NAME)_$(CURRENT_ARCH)) +VARIANT_LEGACY_INCLUDE_macosx_i386 = $(VARIANT_LEGACY_INCLUDE_compat) $(VARIANT_LEGACY_INCLUDE_gdtoa) $(VARIANT_LEGACY_INCLUDE_gen) $(VARIANT_LEGACY_INCLUDE_locale) $(VARIANT_LEGACY_INCLUDE_net) $(VARIANT_LEGACY_INCLUDE_regex) $(VARIANT_LEGACY_INCLUDE_stdio) $(VARIANT_LEGACY_INCLUDE_stdlib) $(VARIANT_LEGACY_INCLUDE_stdtime) $(VARIANT_LEGACY_INCLUDE_sys) + +VARIANT_LEGACY_INCLUDE_compat = creat.c setregid.c setreuid.c sigcompat.c killpg.c +VARIANT_LEGACY_INCLUDE_gdtoa = gdtoa-strtof.c gdtoa-strtod.c gdtoa-strtodg.c +VARIANT_LEGACY_INCLUDE_gen = clock.c confstr.c crypt.c fnmatch.c lockf.c nanosleep.c nftw.c nice.c pause.c popen.c setmode.c sleep.c termios.c timezone.c ttyname.c usleep.c wait.c waitpid.c +VARIANT_LEGACY_INCLUDE_locale = wcsftime.c +VARIANT_LEGACY_INCLUDE_net = recv.c send.c +VARIANT_LEGACY_INCLUDE_regex = regcomp.c +VARIANT_LEGACY_INCLUDE_stdio = fdopen.c fopen.c fputs.c freopen.c fwrite.c tempnam.c +VARIANT_LEGACY_INCLUDE_stdlib = getopt.c putenv.c realpath.c setenv.c system.c +VARIANT_LEGACY_INCLUDE_stdtime = localtime.c strftime.c strptime.c +VARIANT_LEGACY_INCLUDE_sys = msgctl.c semctl.c shmctl.c + +// INODE32 symbols + +VARIANT_INODE32_MACROS = -U__DARWIN_64_BIT_INO_T -D__DARWIN_64_BIT_INO_T=0 -DVARIANT_INODE32 + +VARIANT_INODE32_INCLUDE = $(VARIANT_INODE32_INCLUDE_$(VARIANT_PLATFORM_NAME)) +VARIANT_INODE32_INCLUDE_macosx = $(VARIANT_INODE32_INCLUDE_$(VARIANT_PLATFORM_NAME)_$(CURRENT_ARCH)) +VARIANT_INODE32_INCLUDE_macosx_i386 = $(VARIANT_INODE32_INCLUDE_gen) $(VARIANT_INODE32_INCLUDE_sys) +VARIANT_INODE32_INCLUDE_macosx_x86_64 = $(VARIANT_INODE32_INCLUDE_gen) $(VARIANT_INODE32_INCLUDE_sys) + +VARIANT_INODE32_INCLUDE_gen = fts.c getmntinfo.c glob.c nftw.c opendir.c readdir.c rewinddir.c scandir.c seekdir.c telldir.c scandir_b.c +VARIANT_INODE32_INCLUDE_sys = statx_np.c + +// DYLD (libc.a) + +VARIANT_DYLD_MACROS = -UBUILDING_VARIANT -DVARIANT_STATIC -DVARIANT_CANCELABLE -DVARIANT_DARWINEXTSN -U__DARWIN_NON_CANCELABLE -D__DARWIN_NON_CANCELABLE=0 + +VARIANT_DYLD_INCLUDE = $(VARIANT_DYLD_INCLUDE_generic) $(VARIANT_DYLD_INCLUDE_$(CURRENT_ARCH)) + +VARIANT_DYLD_INCLUDE_generic = $(VARIANT_DYLD_INCLUDE_gen) $(VARIANT_DYLD_INCLUDE_stdlib) $(VARIANT_DYLD_INCLUDE_string) $(VARIANT_DYLD_INCLUDE_sys) +VARIANT_DYLD_INCLUDE_gen = arc4random.c closedir.c dirfd.c getcwd.c getpagesize.c nanosleep.c opendir.c readdir.c scandir.c sysctl.c sysctlbyname.c telldir.c usleep.c +VARIANT_DYLD_INCLUDE_stdlib = atexit.c exit.c gettimeofday.c heapsort.c merge.c qsort.c reallocf.c realpath.c +VARIANT_DYLD_INCLUDE_string = bcopy.c strcat.c strdup.c strrchr.c +VARIANT_DYLD_INCLUDE_sys = _libc_init.c

    uTWiQ&khM?*7&LJg1vi4nv2PZ?MAq<;iU(b$$5y zdhGn&IPBAoS<>qNb4#W=W0qeDHB0s$cpkSWX0HE_dMWb=MMJb8c997s)Sy5N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